feat(templates): add archive-header and post-grid components

- Add ArchiveHeader component (schema, renderer, formbuilder)
- Add PostGrid component (schema, renderer, formbuilder)
- Unify archive templates (home, archive, category, tag,
  author, date, search)
- Add page visibility system with VisibilityDefaults
- Register components in AdminDashboardRenderer
- Fix boolean conversion in functions-addon.php
- All 172 unit tests passed

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-12-06 20:36:27 -06:00
parent b79569c5e7
commit c23dc22d76
24 changed files with 3224 additions and 852 deletions

View File

@@ -207,8 +207,17 @@ function roi_render_component(string $componentName): string {
// Decodificar valor
$value = $row->attribute_value;
// Convertir booleanos almacenados como '1' o '0'
if ($value === '1' || $value === '0') {
// Solo convertir a booleano campos que realmente son booleanos
// Los grupos 'visibility', '_page_visibility' y campos que empiezan con 'show_', 'is_', 'enable'
$isBooleanField = (
$row->group_name === 'visibility' ||
$row->group_name === '_page_visibility' ||
str_starts_with($row->attribute_name, 'show_') ||
str_starts_with($row->attribute_name, 'is_') ||
str_starts_with($row->attribute_name, 'enable')
);
if ($isBooleanField && ($value === '1' || $value === '0')) {
$value = ($value === '1');
} else {
// Intentar decodificar JSON
@@ -321,6 +330,12 @@ function roi_render_component(string $componentName): string {
case 'footer':
$renderer = new \ROITheme\Public\Footer\Infrastructure\Ui\FooterRenderer($cssGenerator);
break;
case 'archive-header':
$renderer = new \ROITheme\Public\ArchiveHeader\Infrastructure\Ui\ArchiveHeaderRenderer($cssGenerator);
break;
case 'post-grid':
$renderer = new \ROITheme\Public\PostGrid\Infrastructure\Ui\PostGridRenderer($cssGenerator);
break;
}
if (!$renderer) {