- Fix flexbox gap issue causing unequal horizontal/vertical spacing - Reset Bootstrap row/col margins to use only CSS gap property - Replace WordPress pagination with Bootstrap-style pagination - Add cta-post component to category.php and archive.php templates - Fix spacing controls UI with separate horizontal/vertical gap fields - Update FieldMapper with new gap_horizontal and gap_vertical attributes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
99 lines
6.0 KiB
PHP
99 lines
6.0 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace ROITheme\Admin\PostGrid\Infrastructure\FieldMapping;
|
|
|
|
use ROITheme\Admin\Shared\Domain\Contracts\FieldMapperInterface;
|
|
|
|
/**
|
|
* Field Mapper para Post Grid
|
|
*
|
|
* RESPONSABILIDAD:
|
|
* - Mapear field IDs del formulario a atributos de BD
|
|
* - Solo conoce sus propios campos (modularidad)
|
|
*/
|
|
final class PostGridFieldMapper implements FieldMapperInterface
|
|
{
|
|
public function getComponentName(): string
|
|
{
|
|
return 'post-grid';
|
|
}
|
|
|
|
public function getFieldMapping(): array
|
|
{
|
|
return [
|
|
// Visibility
|
|
'postGridEnabled' => ['group' => 'visibility', 'attribute' => 'is_enabled'],
|
|
'postGridShowOnDesktop' => ['group' => 'visibility', 'attribute' => 'show_on_desktop'],
|
|
'postGridShowOnMobile' => ['group' => 'visibility', 'attribute' => 'show_on_mobile'],
|
|
|
|
// Page Visibility (grupo especial _page_visibility)
|
|
'postGridVisibilityHome' => ['group' => '_page_visibility', 'attribute' => 'show_on_home'],
|
|
'postGridVisibilityPosts' => ['group' => '_page_visibility', 'attribute' => 'show_on_posts'],
|
|
'postGridVisibilityPages' => ['group' => '_page_visibility', 'attribute' => 'show_on_pages'],
|
|
'postGridVisibilityArchives' => ['group' => '_page_visibility', 'attribute' => 'show_on_archives'],
|
|
'postGridVisibilitySearch' => ['group' => '_page_visibility', 'attribute' => 'show_on_search'],
|
|
|
|
// Exclusions (grupo especial _exclusions)
|
|
'postGridExclusionsEnabled' => ['group' => '_exclusions', 'attribute' => 'exclusions_enabled'],
|
|
'postGridExcludeCategories' => ['group' => '_exclusions', 'attribute' => 'exclude_categories', 'type' => 'json_array'],
|
|
'postGridExcludePostIds' => ['group' => '_exclusions', 'attribute' => 'exclude_post_ids', 'type' => 'json_array_int'],
|
|
'postGridExcludeUrlPatterns' => ['group' => '_exclusions', 'attribute' => 'exclude_url_patterns', 'type' => 'json_array_lines'],
|
|
|
|
// Content
|
|
'postGridShowThumbnail' => ['group' => 'content', 'attribute' => 'show_thumbnail'],
|
|
'postGridShowExcerpt' => ['group' => 'content', 'attribute' => 'show_excerpt'],
|
|
'postGridShowMeta' => ['group' => 'content', 'attribute' => 'show_meta'],
|
|
'postGridShowCategories' => ['group' => 'content', 'attribute' => 'show_categories'],
|
|
'postGridExcerptLength' => ['group' => 'content', 'attribute' => 'excerpt_length'],
|
|
'postGridReadMoreText' => ['group' => 'content', 'attribute' => 'read_more_text'],
|
|
'postGridNoPostsMessage' => ['group' => 'content', 'attribute' => 'no_posts_message'],
|
|
|
|
// Layout
|
|
'postGridColumnsDesktop' => ['group' => 'layout', 'attribute' => 'columns_desktop'],
|
|
'postGridColumnsTablet' => ['group' => 'layout', 'attribute' => 'columns_tablet'],
|
|
'postGridColumnsMobile' => ['group' => 'layout', 'attribute' => 'columns_mobile'],
|
|
'postGridImagePosition' => ['group' => 'layout', 'attribute' => 'image_position'],
|
|
|
|
// Media
|
|
'postGridFallbackImage' => ['group' => 'media', 'attribute' => 'fallback_image'],
|
|
'postGridFallbackImageAlt' => ['group' => 'media', 'attribute' => 'fallback_image_alt'],
|
|
|
|
// Typography
|
|
'postGridHeadingLevel' => ['group' => 'typography', 'attribute' => 'heading_level'],
|
|
'postGridCardTitleSize' => ['group' => 'typography', 'attribute' => 'card_title_size'],
|
|
'postGridCardTitleWeight' => ['group' => 'typography', 'attribute' => 'card_title_weight'],
|
|
'postGridExcerptSize' => ['group' => 'typography', 'attribute' => 'excerpt_size'],
|
|
'postGridMetaSize' => ['group' => 'typography', 'attribute' => 'meta_size'],
|
|
|
|
// Colors
|
|
'postGridCardBgColor' => ['group' => 'colors', 'attribute' => 'card_bg_color'],
|
|
'postGridCardTitleColor' => ['group' => 'colors', 'attribute' => 'card_title_color'],
|
|
'postGridCardHoverBgColor' => ['group' => 'colors', 'attribute' => 'card_hover_bg_color'],
|
|
'postGridCardBorderColor' => ['group' => 'colors', 'attribute' => 'card_border_color'],
|
|
'postGridCardHoverBorderColor' => ['group' => 'colors', 'attribute' => 'card_hover_border_color'],
|
|
'postGridExcerptColor' => ['group' => 'colors', 'attribute' => 'excerpt_color'],
|
|
'postGridMetaColor' => ['group' => 'colors', 'attribute' => 'meta_color'],
|
|
'postGridCategoryBgColor' => ['group' => 'colors', 'attribute' => 'category_bg_color'],
|
|
'postGridCategoryTextColor' => ['group' => 'colors', 'attribute' => 'category_text_color'],
|
|
'postGridPaginationColor' => ['group' => 'colors', 'attribute' => 'pagination_color'],
|
|
'postGridPaginationActiveBg' => ['group' => 'colors', 'attribute' => 'pagination_active_bg'],
|
|
'postGridPaginationActiveColor' => ['group' => 'colors', 'attribute' => 'pagination_active_color'],
|
|
|
|
// Spacing
|
|
'postGridGapHorizontal' => ['group' => 'spacing', 'attribute' => 'gap_horizontal'],
|
|
'postGridGapVertical' => ['group' => 'spacing', 'attribute' => 'gap_vertical'],
|
|
'postGridCardPadding' => ['group' => 'spacing', 'attribute' => 'card_padding'],
|
|
'postGridSectionMarginTop' => ['group' => 'spacing', 'attribute' => 'section_margin_top'],
|
|
'postGridSectionMarginBottom' => ['group' => 'spacing', 'attribute' => 'section_margin_bottom'],
|
|
|
|
// Visual Effects
|
|
'postGridCardBorderRadius' => ['group' => 'visual_effects', 'attribute' => 'card_border_radius'],
|
|
'postGridCardShadow' => ['group' => 'visual_effects', 'attribute' => 'card_shadow'],
|
|
'postGridCardHoverShadow' => ['group' => 'visual_effects', 'attribute' => 'card_hover_shadow'],
|
|
'postGridCardTransition' => ['group' => 'visual_effects', 'attribute' => 'card_transition'],
|
|
'postGridImageBorderRadius' => ['group' => 'visual_effects', 'attribute' => 'image_border_radius'],
|
|
];
|
|
}
|
|
}
|