buildHeader($componentId); $html .= '
'; // Columna izquierda $html .= '
'; $html .= $this->buildVisibilityGroup($componentId); $html .= $this->buildContentGroup($componentId); $html .= $this->buildBehaviorGroup($componentId); $html .= '
'; // Columna derecha $html .= '
'; $html .= $this->buildTypographyGroup($componentId); $html .= $this->buildColorsGroup($componentId); $html .= $this->buildSpacingGroup($componentId); $html .= $this->buildEffectsGroup($componentId); $html .= '
'; $html .= '
'; return $html; } private function buildHeader(string $componentId): string { $html = '
renderer->getFieldValue($componentId, 'visibility', 'is_enabled', true); $html .= $this->buildSwitch('ctaEnabled', 'Activar CTA box', 'bi-power', $enabled); // show_on_desktop $showOnDesktop = $this->renderer->getFieldValue($componentId, 'visibility', 'show_on_desktop', true); $html .= $this->buildSwitch('ctaShowOnDesktop', 'Mostrar en escritorio', 'bi-display', $showOnDesktop); // show_on_mobile $showOnMobile = $this->renderer->getFieldValue($componentId, 'visibility', 'show_on_mobile', false); $html .= $this->buildSwitch('ctaShowOnMobile', 'Mostrar en movil', 'bi-phone', $showOnMobile); // ============================================= // Checkboxes de visibilidad por tipo de página // Grupo especial: _page_visibility // ============================================= $html .= '
'; $html .= '

'; $html .= ' '; $html .= ' Mostrar en tipos de pagina'; $html .= '

'; // Obtener valores de _page_visibility (grupo especial) $showOnHome = $this->renderer->getFieldValue($componentId, '_page_visibility', 'show_on_home', true); $showOnPosts = $this->renderer->getFieldValue($componentId, '_page_visibility', 'show_on_posts', true); $showOnPages = $this->renderer->getFieldValue($componentId, '_page_visibility', 'show_on_pages', true); $showOnArchives = $this->renderer->getFieldValue($componentId, '_page_visibility', 'show_on_archives', false); $showOnSearch = $this->renderer->getFieldValue($componentId, '_page_visibility', 'show_on_search', false); // Grid 3 columnas según Design System $html .= '
'; $html .= '
'; $html .= $this->buildPageVisibilityCheckbox('ctaVisibilityHome', 'Home', 'bi-house', $showOnHome); $html .= '
'; $html .= '
'; $html .= $this->buildPageVisibilityCheckbox('ctaVisibilityPosts', 'Posts', 'bi-file-earmark-text', $showOnPosts); $html .= '
'; $html .= '
'; $html .= $this->buildPageVisibilityCheckbox('ctaVisibilityPages', 'Paginas', 'bi-file-earmark', $showOnPages); $html .= '
'; $html .= '
'; $html .= $this->buildPageVisibilityCheckbox('ctaVisibilityArchives', 'Archivos', 'bi-archive', $showOnArchives); $html .= '
'; $html .= '
'; $html .= $this->buildPageVisibilityCheckbox('ctaVisibilitySearch', 'Busqueda', 'bi-search', $showOnSearch); $html .= '
'; $html .= '
'; // ============================================= // Reglas de exclusion avanzadas // Grupo especial: _exclusions (Plan 99.11) // ============================================= $exclusionPartial = new ExclusionFormPartial($this->renderer); $html .= $exclusionPartial->render($componentId, 'cta'); $html .= '
'; $html .= ''; return $html; } private function buildContentGroup(string $componentId): string { $html = '
'; $html .= '
'; $html .= '
'; $html .= ' '; $html .= ' Contenido'; $html .= '
'; // title $title = $this->renderer->getFieldValue($componentId, 'content', 'title', '¿Listo para potenciar tus proyectos?'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // description $description = $this->renderer->getFieldValue($componentId, 'content', 'description', 'Accede a nuestra biblioteca completa de APUs y herramientas profesionales.'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // button_text $buttonText = $this->renderer->getFieldValue($componentId, 'content', 'button_text', 'Solicitar Demo'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // button_icon $buttonIcon = $this->renderer->getFieldValue($componentId, 'content', 'button_icon', 'bi bi-calendar-check'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= ' Clase de Bootstrap Icons'; $html .= '
'; // button_action $buttonAction = $this->renderer->getFieldValue($componentId, 'content', 'button_action', 'modal'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // button_link $buttonLink = $this->renderer->getFieldValue($componentId, 'content', 'button_link', '#contactModal'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= ' Para modal usa #nombreModal, para scroll usa #idSeccion'; $html .= '
'; $html .= '
'; $html .= '
'; return $html; } private function buildBehaviorGroup(string $componentId): string { $html = '
'; $html .= '
'; $html .= '
'; $html .= ' '; $html .= ' Comportamiento'; $html .= '
'; // text_align $textAlign = $this->renderer->getFieldValue($componentId, 'behavior', 'text_align', 'center'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; return $html; } private function buildTypographyGroup(string $componentId): string { $html = '
'; $html .= '
'; $html .= '
'; $html .= ' '; $html .= ' Tipografia'; $html .= '
'; $html .= '
'; // title_font_size $titleFontSize = $this->renderer->getFieldValue($componentId, 'typography', 'title_font_size', '1.25rem'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // title_font_weight $titleFontWeight = $this->renderer->getFieldValue($componentId, 'typography', 'title_font_weight', '700'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; // description_font_size $descFontSize = $this->renderer->getFieldValue($componentId, 'typography', 'description_font_size', '0.9rem'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // button_font_size $buttonFontSize = $this->renderer->getFieldValue($componentId, 'typography', 'button_font_size', '1rem'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; // button_font_weight $buttonFontWeight = $this->renderer->getFieldValue($componentId, 'typography', 'button_font_weight', '700'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; return $html; } private function buildColorsGroup(string $componentId): string { $html = '
'; $html .= '
'; $html .= '
'; $html .= ' '; $html .= ' Colores'; $html .= '
'; // Colores principales $html .= '

Contenedor

'; $html .= '
'; $bgColor = $this->renderer->getFieldValue($componentId, 'colors', 'background_color', '#FF8600'); $html .= $this->buildColorPicker('ctaBackgroundColor', 'Fondo', $bgColor); $titleColor = $this->renderer->getFieldValue($componentId, 'colors', 'title_color', '#ffffff'); $html .= $this->buildColorPicker('ctaTitleColor', 'Titulo', $titleColor); $html .= '
'; $html .= '
'; $descColor = $this->renderer->getFieldValue($componentId, 'colors', 'description_color', 'rgba(255, 255, 255, 0.95)'); $html .= $this->buildColorPicker('ctaDescriptionColor', 'Descripcion', $descColor); $html .= '
'; // Colores del boton $html .= '

Boton

'; $html .= '
'; $buttonBgColor = $this->renderer->getFieldValue($componentId, 'colors', 'button_background_color', '#ffffff'); $html .= $this->buildColorPicker('ctaButtonBgColor', 'Fondo', $buttonBgColor); $buttonTextColor = $this->renderer->getFieldValue($componentId, 'colors', 'button_text_color', '#FF8600'); $html .= $this->buildColorPicker('ctaButtonTextColor', 'Texto', $buttonTextColor); $html .= '
'; // Colores hover $html .= '

Boton Hover

'; $html .= '
'; $buttonHoverBg = $this->renderer->getFieldValue($componentId, 'colors', 'button_hover_background', '#0E2337'); $html .= $this->buildColorPicker('ctaButtonHoverBg', 'Fondo hover', $buttonHoverBg); $buttonHoverText = $this->renderer->getFieldValue($componentId, 'colors', 'button_hover_text_color', '#ffffff'); $html .= $this->buildColorPicker('ctaButtonHoverText', 'Texto hover', $buttonHoverText); $html .= '
'; $html .= '
'; $html .= '
'; return $html; } private function buildSpacingGroup(string $componentId): string { $html = '
'; $html .= '
'; $html .= '
'; $html .= ' '; $html .= ' Espaciado'; $html .= '
'; $html .= '
'; // container_padding $containerPadding = $this->renderer->getFieldValue($componentId, 'spacing', 'container_padding', '24px'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // title_margin_bottom $titleMarginBottom = $this->renderer->getFieldValue($componentId, 'spacing', 'title_margin_bottom', '1rem'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; // description_margin_bottom $descMarginBottom = $this->renderer->getFieldValue($componentId, 'spacing', 'description_margin_bottom', '1rem'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // button_padding $buttonPadding = $this->renderer->getFieldValue($componentId, 'spacing', 'button_padding', '0.75rem 1.5rem'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; // icon_margin_right $iconMarginRight = $this->renderer->getFieldValue($componentId, 'spacing', 'icon_margin_right', '0.5rem'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; return $html; } private function buildEffectsGroup(string $componentId): string { $html = '
'; $html .= '
'; $html .= '
'; $html .= ' '; $html .= ' Efectos Visuales'; $html .= '
'; $html .= '
'; // border_radius $borderRadius = $this->renderer->getFieldValue($componentId, 'visual_effects', 'border_radius', '8px'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; // button_border_radius $buttonBorderRadius = $this->renderer->getFieldValue($componentId, 'visual_effects', 'button_border_radius', '8px'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; // box_shadow $boxShadow = $this->renderer->getFieldValue($componentId, 'visual_effects', 'box_shadow', '0 4px 12px rgba(255, 133, 0, 0.2)'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; // transition_duration $transitionDuration = $this->renderer->getFieldValue($componentId, 'visual_effects', 'transition_duration', '0.3s'); $html .= '
'; $html .= ' '; $html .= ' '; $html .= '
'; $html .= '
'; $html .= '
'; $html .= '
'; return $html; } private function buildSwitch(string $id, string $label, string $icon, bool $checked): string { $html = '
'; $html .= '
'; $html .= sprintf( ' ', esc_attr($id), $checked ? 'checked' : '' ); $html .= sprintf( ' '; $html .= '
'; $html .= '
'; return $html; } private function buildColorPicker(string $id, string $label, string $value): string { $html = '
'; $html .= sprintf( ' ', esc_html($label) ); $html .= '
'; $html .= sprintf( ' ', esc_attr($id), esc_attr($value) ); $html .= sprintf( ' %s', esc_attr($id), esc_html(strtoupper($value)) ); $html .= '
'; $html .= '
'; return $html; } /** * Genera un checkbox de visibilidad por tipo de pagina * * Sigue Design System: form-check-checkbox es obligatorio */ private function buildPageVisibilityCheckbox(string $id, string $label, string $icon, bool $checked): string { $html = '
'; $html .= sprintf( ' ', esc_attr($id), $checked ? 'checked' : '' ); $html .= sprintf( ' '; $html .= '
'; return $html; } }