> */ public function getGroups(): array { // Design System: Todos los grupos usan el mismo gradiente Navy (#0E2337 → #1e3a5f) // No se requiere propiedad 'color' ya que está definido en CSS $defaultGroups = [ 'header-navigation' => [ 'label' => __('Header & Navegación', 'roi-theme'), 'icon' => 'bi-layout-text-window', 'description' => __('Barras superiores, menú y pie de página', 'roi-theme'), 'components' => ['top-notification-bar', 'navbar', 'footer'] ], 'main-content' => [ 'label' => __('Contenido Principal', 'roi-theme'), 'icon' => 'bi-file-richtext', 'description' => __('Secciones principales de páginas y posts', 'roi-theme'), 'components' => ['hero', 'featured-image', 'table-of-contents', 'related-post', 'archive-header', 'post-grid'] ], 'ctas-conversion' => [ 'label' => __('CTAs & Conversión', 'roi-theme'), 'icon' => 'bi-lightning-charge', 'description' => __('Llamadas a la acción y elementos de conversión', 'roi-theme'), 'components' => ['cta-lets-talk', 'cta-box-sidebar', 'cta-post'] ], 'engagement' => [ 'label' => __('Engagement', 'roi-theme'), 'icon' => 'bi-share', 'description' => __('Interacción social y compartir', 'roi-theme'), 'components' => ['social-share'] ], 'forms' => [ 'label' => __('Formularios', 'roi-theme'), 'icon' => 'bi-envelope-paper', 'description' => __('Formularios de contacto y captura', 'roi-theme'), 'components' => ['contact-form'] ], 'settings' => [ 'label' => __('Configuración', 'roi-theme'), 'icon' => 'bi-gear', 'description' => __('Ajustes globales del tema y monetización', 'roi-theme'), 'components' => ['theme-settings', 'adsense-placement', 'custom-css-manager'] ], ]; /** * Filtro para extender o modificar los grupos de componentes * * @param array> $groups Grupos por defecto * @return array> Grupos modificados */ return apply_filters('roi_theme_component_groups', $defaultGroups); } /** * Obtiene el grupo al que pertenece un componente * * @param string $componentId ID del componente en kebab-case * @return string|null ID del grupo o null si no pertenece a ninguno */ public function getGroupForComponent(string $componentId): ?string { foreach ($this->getGroups() as $groupId => $group) { if (in_array($componentId, $group['components'], true)) { return $groupId; } } return null; } /** * Obtiene la información de un grupo específico * * @param string $groupId ID del grupo * @return array|null Datos del grupo o null */ public function getGroup(string $groupId): ?array { $groups = $this->getGroups(); return $groups[$groupId] ?? null; } }