feat(critical-css): agregar TOC y CTA Let's Talk a CSS crítico

- Agregar campo is_critical a schemas table-of-contents.json y cta-lets-talk.json
- Cambiar generateCSS() de private a public en TableOfContentsRenderer y CtaLetsTalkRenderer
- Registrar table-of-contents y cta-lets-talk en CRITICAL_RENDERERS
- Ahora 6 componentes inyectan CSS crítico inline en <head>

Componentes críticos:
- top-notification-bar
- navbar
- cta-lets-talk (NUEVO)
- hero
- featured-image
- table-of-contents (NUEVO)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-12-01 14:08:43 -06:00
parent cc4de0eda7
commit 972c3c5de9
5 changed files with 18 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ final class CtaLetsTalkRenderer implements RendererInterface
* @param array $data Datos del componente
* @return string CSS generado
*/
private function generateCSS(array $data): string
public function generateCSS(array $data): string
{
$css = '';

View File

@@ -203,7 +203,7 @@ final class TableOfContentsRenderer implements RendererInterface
}, 20);
}
private function generateCSS(array $data): string
public function generateCSS(array $data): string
{
$colors = $data['colors'] ?? [];
$spacing = $data['spacing'] ?? [];

View File

@@ -42,6 +42,13 @@
"pages": "Solo páginas"
},
"description": "Define en qué páginas se mostrará el botón"
},
"is_critical": {
"type": "boolean",
"label": "CSS Crítico",
"default": true,
"editable": true,
"description": "Inyectar CSS inline en <head> para optimizar LCP (componente above-the-fold)"
}
}
},

View File

@@ -35,6 +35,13 @@
"editable": true,
"options": ["all", "posts", "pages"],
"description": "Tipos de contenido donde se muestra"
},
"is_critical": {
"type": "boolean",
"label": "CSS Crítico",
"default": true,
"editable": true,
"description": "Inyectar CSS inline en <head> para optimizar LCP (componente above-the-fold)"
}
}
},

View File

@@ -52,8 +52,10 @@ final class CriticalCSSService
private const CRITICAL_RENDERERS = [
'top-notification-bar' => \ROITheme\Public\TopNotificationBar\Infrastructure\Ui\TopNotificationBarRenderer::class,
'navbar' => \ROITheme\Public\Navbar\Infrastructure\Ui\NavbarRenderer::class,
'cta-lets-talk' => \ROITheme\Public\CtaLetsTalk\Infrastructure\Ui\CtaLetsTalkRenderer::class,
'hero' => \ROITheme\Public\Hero\Infrastructure\Ui\HeroRenderer::class,
'featured-image' => \ROITheme\Public\FeaturedImage\Infrastructure\Ui\FeaturedImageRenderer::class,
'table-of-contents' => \ROITheme\Public\TableOfContents\Infrastructure\Ui\TableOfContentsRenderer::class
];
/**