- 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>
92 lines
5.4 KiB
PHP
92 lines
5.4 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace ROITheme\Admin\TableOfContents\Infrastructure\FieldMapping;
|
|
|
|
use ROITheme\Admin\Shared\Domain\Contracts\FieldMapperInterface;
|
|
|
|
/**
|
|
* Field Mapper para Table of Contents
|
|
*
|
|
* RESPONSABILIDAD:
|
|
* - Mapear field IDs del formulario a atributos de BD
|
|
* - Solo conoce sus propios campos (modularidad)
|
|
*/
|
|
final class TableOfContentsFieldMapper implements FieldMapperInterface
|
|
{
|
|
public function getComponentName(): string
|
|
{
|
|
return 'table-of-contents';
|
|
}
|
|
|
|
public function getFieldMapping(): array
|
|
{
|
|
return [
|
|
// Visibility
|
|
'tocEnabled' => ['group' => 'visibility', 'attribute' => 'is_enabled'],
|
|
'tocShowOnDesktop' => ['group' => 'visibility', 'attribute' => 'show_on_desktop'],
|
|
'tocShowOnMobile' => ['group' => 'visibility', 'attribute' => 'show_on_mobile'],
|
|
|
|
// Page Visibility (grupo especial _page_visibility)
|
|
'tocVisibilityHome' => ['group' => '_page_visibility', 'attribute' => 'show_on_home'],
|
|
'tocVisibilityPosts' => ['group' => '_page_visibility', 'attribute' => 'show_on_posts'],
|
|
'tocVisibilityPages' => ['group' => '_page_visibility', 'attribute' => 'show_on_pages'],
|
|
'tocVisibilityArchives' => ['group' => '_page_visibility', 'attribute' => 'show_on_archives'],
|
|
'tocVisibilitySearch' => ['group' => '_page_visibility', 'attribute' => 'show_on_search'],
|
|
|
|
// Content
|
|
'tocTitle' => ['group' => 'content', 'attribute' => 'title'],
|
|
'tocAutoGenerate' => ['group' => 'content', 'attribute' => 'auto_generate'],
|
|
'tocHeadingLevels' => ['group' => 'content', 'attribute' => 'heading_levels'],
|
|
'tocSmoothScroll' => ['group' => 'content', 'attribute' => 'smooth_scroll'],
|
|
|
|
// Typography
|
|
'tocTitleFontSize' => ['group' => 'typography', 'attribute' => 'title_font_size'],
|
|
'tocTitleFontWeight' => ['group' => 'typography', 'attribute' => 'title_font_weight'],
|
|
'tocLinkFontSize' => ['group' => 'typography', 'attribute' => 'link_font_size'],
|
|
'tocLinkLineHeight' => ['group' => 'typography', 'attribute' => 'link_line_height'],
|
|
'tocLevelThreeFontSize' => ['group' => 'typography', 'attribute' => 'level_three_font_size'],
|
|
'tocLevelFourFontSize' => ['group' => 'typography', 'attribute' => 'level_four_font_size'],
|
|
|
|
// Colors
|
|
'tocBackgroundColor' => ['group' => 'colors', 'attribute' => 'background_color'],
|
|
'tocBorderColor' => ['group' => 'colors', 'attribute' => 'border_color'],
|
|
'tocTitleColor' => ['group' => 'colors', 'attribute' => 'title_color'],
|
|
'tocTitleBorderColor' => ['group' => 'colors', 'attribute' => 'title_border_color'],
|
|
'tocLinkColor' => ['group' => 'colors', 'attribute' => 'link_color'],
|
|
'tocLinkHoverColor' => ['group' => 'colors', 'attribute' => 'link_hover_color'],
|
|
'tocLinkHoverBackground' => ['group' => 'colors', 'attribute' => 'link_hover_background'],
|
|
'tocActiveBorderColor' => ['group' => 'colors', 'attribute' => 'active_border_color'],
|
|
'tocActiveBackgroundColor' => ['group' => 'colors', 'attribute' => 'active_background_color'],
|
|
'tocActiveTextColor' => ['group' => 'colors', 'attribute' => 'active_text_color'],
|
|
'tocScrollbarTrackColor' => ['group' => 'colors', 'attribute' => 'scrollbar_track_color'],
|
|
'tocScrollbarThumbColor' => ['group' => 'colors', 'attribute' => 'scrollbar_thumb_color'],
|
|
|
|
// Spacing
|
|
'tocContainerPadding' => ['group' => 'spacing', 'attribute' => 'container_padding'],
|
|
'tocMarginBottom' => ['group' => 'spacing', 'attribute' => 'margin_bottom'],
|
|
'tocTitlePaddingBottom' => ['group' => 'spacing', 'attribute' => 'title_padding_bottom'],
|
|
'tocTitleMarginBottom' => ['group' => 'spacing', 'attribute' => 'title_margin_bottom'],
|
|
'tocItemMarginBottom' => ['group' => 'spacing', 'attribute' => 'item_margin_bottom'],
|
|
'tocLinkPadding' => ['group' => 'spacing', 'attribute' => 'link_padding'],
|
|
'tocLevelThreePaddingLeft' => ['group' => 'spacing', 'attribute' => 'level_three_padding_left'],
|
|
'tocLevelFourPaddingLeft' => ['group' => 'spacing', 'attribute' => 'level_four_padding_left'],
|
|
'tocScrollbarWidth' => ['group' => 'spacing', 'attribute' => 'scrollbar_width'],
|
|
|
|
// Visual Effects
|
|
'tocBorderRadius' => ['group' => 'visual_effects', 'attribute' => 'border_radius'],
|
|
'tocBoxShadow' => ['group' => 'visual_effects', 'attribute' => 'box_shadow'],
|
|
'tocBorderWidth' => ['group' => 'visual_effects', 'attribute' => 'border_width'],
|
|
'tocLinkBorderRadius' => ['group' => 'visual_effects', 'attribute' => 'link_border_radius'],
|
|
'tocActiveBorderLeftWidth' => ['group' => 'visual_effects', 'attribute' => 'active_border_left_width'],
|
|
'tocTransitionDuration' => ['group' => 'visual_effects', 'attribute' => 'transition_duration'],
|
|
'tocScrollbarBorderRadius' => ['group' => 'visual_effects', 'attribute' => 'scrollbar_border_radius'],
|
|
|
|
// Behavior
|
|
'tocIsSticky' => ['group' => 'behavior', 'attribute' => 'is_sticky'],
|
|
'tocScrollOffset' => ['group' => 'behavior', 'attribute' => 'scroll_offset'],
|
|
'tocMaxHeight' => ['group' => 'behavior', 'attribute' => 'max_height'],
|
|
];
|
|
}
|
|
}
|