- Añadir PageVisibility use case y repositorio - Implementar PageTypeDetector para detectar home/single/page/archive - Actualizar FieldMappers con soporte show_on_[page_type] - Extender FormBuilders con UI de visibilidad por página - Refactorizar Renderers para evaluar visibilidad dinámica - Limpiar schemas removiendo campos de visibilidad legacy - Añadir MigrationCommand para migrar configuraciones existentes - Implementar adsense-loader.js para carga lazy de ads - Actualizar front-page.php con nueva estructura - Extender DIContainer con nuevos servicios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
73 lines
3.7 KiB
PHP
73 lines
3.7 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace ROITheme\Admin\Hero\Infrastructure\FieldMapping;
|
|
|
|
use ROITheme\Admin\Shared\Domain\Contracts\FieldMapperInterface;
|
|
|
|
/**
|
|
* Field Mapper para Hero Section
|
|
*
|
|
* RESPONSABILIDAD:
|
|
* - Mapear field IDs del formulario a atributos de BD
|
|
* - Solo conoce sus propios campos (modularidad)
|
|
*/
|
|
final class HeroFieldMapper implements FieldMapperInterface
|
|
{
|
|
public function getComponentName(): string
|
|
{
|
|
return 'hero';
|
|
}
|
|
|
|
public function getFieldMapping(): array
|
|
{
|
|
return [
|
|
// Visibility
|
|
'heroEnabled' => ['group' => 'visibility', 'attribute' => 'is_enabled'],
|
|
'heroShowOnDesktop' => ['group' => 'visibility', 'attribute' => 'show_on_desktop'],
|
|
'heroShowOnMobile' => ['group' => 'visibility', 'attribute' => 'show_on_mobile'],
|
|
'heroIsCritical' => ['group' => 'visibility', 'attribute' => 'is_critical'],
|
|
|
|
// Page Visibility (grupo especial _page_visibility)
|
|
'heroVisibilityHome' => ['group' => '_page_visibility', 'attribute' => 'show_on_home'],
|
|
'heroVisibilityPosts' => ['group' => '_page_visibility', 'attribute' => 'show_on_posts'],
|
|
'heroVisibilityPages' => ['group' => '_page_visibility', 'attribute' => 'show_on_pages'],
|
|
'heroVisibilityArchives' => ['group' => '_page_visibility', 'attribute' => 'show_on_archives'],
|
|
'heroVisibilitySearch' => ['group' => '_page_visibility', 'attribute' => 'show_on_search'],
|
|
|
|
// Content
|
|
'heroShowCategories' => ['group' => 'content', 'attribute' => 'show_categories'],
|
|
'heroShowBadgeIcon' => ['group' => 'content', 'attribute' => 'show_badge_icon'],
|
|
'heroBadgeIconClass' => ['group' => 'content', 'attribute' => 'badge_icon_class'],
|
|
'heroTitleTag' => ['group' => 'content', 'attribute' => 'title_tag'],
|
|
|
|
// Colors
|
|
'heroGradientStart' => ['group' => 'colors', 'attribute' => 'gradient_start'],
|
|
'heroGradientEnd' => ['group' => 'colors', 'attribute' => 'gradient_end'],
|
|
'heroTitleColor' => ['group' => 'colors', 'attribute' => 'title_color'],
|
|
'heroBadgeBgColor' => ['group' => 'colors', 'attribute' => 'badge_bg_color'],
|
|
'heroBadgeTextColor' => ['group' => 'colors', 'attribute' => 'badge_text_color'],
|
|
'heroBadgeIconColor' => ['group' => 'colors', 'attribute' => 'badge_icon_color'],
|
|
'heroBadgeHoverBg' => ['group' => 'colors', 'attribute' => 'badge_hover_bg'],
|
|
|
|
// Typography
|
|
'heroTitleFontSize' => ['group' => 'typography', 'attribute' => 'title_font_size'],
|
|
'heroTitleFontSizeMobile' => ['group' => 'typography', 'attribute' => 'title_font_size_mobile'],
|
|
'heroTitleFontWeight' => ['group' => 'typography', 'attribute' => 'title_font_weight'],
|
|
'heroTitleLineHeight' => ['group' => 'typography', 'attribute' => 'title_line_height'],
|
|
'heroBadgeFontSize' => ['group' => 'typography', 'attribute' => 'badge_font_size'],
|
|
|
|
// Spacing
|
|
'heroPaddingVertical' => ['group' => 'spacing', 'attribute' => 'padding_vertical'],
|
|
'heroMarginBottom' => ['group' => 'spacing', 'attribute' => 'margin_bottom'],
|
|
'heroBadgePadding' => ['group' => 'spacing', 'attribute' => 'badge_padding'],
|
|
'heroBadgeBorderRadius' => ['group' => 'spacing', 'attribute' => 'badge_border_radius'],
|
|
|
|
// Visual Effects
|
|
'heroBoxShadow' => ['group' => 'visual_effects', 'attribute' => 'box_shadow'],
|
|
'heroTitleTextShadow' => ['group' => 'visual_effects', 'attribute' => 'title_text_shadow'],
|
|
'heroBadgeBackdropBlur' => ['group' => 'visual_effects', 'attribute' => 'badge_backdrop_blur'],
|
|
];
|
|
}
|
|
}
|