libreria-astro-lefebvre 0.1.93 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ComponentMetadata } from '../interfaces/types';
|
|
2
|
+
|
|
3
|
+
export const metadata: ComponentMetadata = {
|
|
4
|
+
component_name: 'Grid_2026_Aldaia',
|
|
5
|
+
category: 'Contenido con listas',
|
|
6
|
+
name: 'Grid de cards con título: 3 columnas en escritorio y carrusel horizontal en móvil 2026',
|
|
7
|
+
description: 'Bloque con título opcional (h2 centrado) y un listado de cards Contenido_2025_Montevideo (imagen, etiqueta, título y descripción, toda la card clicable). En escritorio se muestra como grid de máximo 3 columnas (2 en tablet) que crece en filas según el número de ítems. En móvil las cards se disponen en una fila con scroll horizontal y snap. Emite un ItemList en JSON-LD con los ítems',
|
|
8
|
+
framework: 'Astro',
|
|
9
|
+
priority: 1,
|
|
10
|
+
tags: ['grid', 'card', 'carrusel', 'scroll', 'imagen', 'boletines', 'listado'],
|
|
11
|
+
fields: [
|
|
12
|
+
{
|
|
13
|
+
name: 'title',
|
|
14
|
+
type: 'text',
|
|
15
|
+
mandatory: false,
|
|
16
|
+
label: 'Título del bloque',
|
|
17
|
+
help: 'Título (h2) centrado que aparece encima del grid. Si se deja vacío, no se muestra ningún título',
|
|
18
|
+
example_value: 'Descubre nuestros boletines'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'items',
|
|
22
|
+
type: 'list',
|
|
23
|
+
label: 'Listado de cards',
|
|
24
|
+
mandatory: false,
|
|
25
|
+
help: 'Cards del bloque. En escritorio se muestran en un grid de 3 columnas (a partir de la cuarta card se crea una nueva fila); en móvil se muestran en una fila con scroll horizontal. Cada card se renderiza con el componente Contenido_2025_Montevideo',
|
|
26
|
+
items: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
fields: [
|
|
29
|
+
{ name: 'title', type: 'text', label: 'Título', help: 'Título de la card (h3). Se muestra siempre', example_value: 'Apuntes & Consejos Impuestos' },
|
|
30
|
+
{ name: 'tag', type: 'text', label: 'Etiqueta', help: 'Etiqueta en mayúsculas que aparece sobre el título (p. ej. la materia). Si se deja vacía, NO se muestra', example_value: 'Fiscal' },
|
|
31
|
+
{ name: 'description', type: 'textArea', label: 'Descripción', help: 'Descripción breve de la card, debajo del título. Si se deja vacía, no ocupa espacio visible', example_value: 'Novedades fiscales explicadas de forma clara y práctica' },
|
|
32
|
+
{ name: 'link', type: 'text', label: 'Url del enlace', help: 'URL de destino al hacer click en la card (toda la card es clicable). Si se deja vacío, apunta a "#" (no navega)', example_value: '/fiscal-impuestos' },
|
|
33
|
+
{ name: 'image', type: 'image', label: 'Imagen', help: 'Imagen de la card (parte superior, proporción 16:9). Se renderiza siempre; si se deja vacía aparece una imagen rota', example_value: 'https://assets.lefebvre.es/media/img/preview-comp/comp-16-9.png' },
|
|
34
|
+
{ name: 'altImage', type: 'text', label: 'Alt de la imagen', help: 'Texto alternativo de la imagen para accesibilidad', example_value: 'Portada del boletín Apuntes & Consejos Impuestos' }
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Contenido_2025_Montevideo from "./Contenido_2025_Montevideo.astro";
|
|
3
|
+
import { extractImageUrl, PAGE_ENTITY_ID } from '../../lib/functions.js';
|
|
4
|
+
|
|
5
|
+
interface AldaiaItem {
|
|
6
|
+
title?: string;
|
|
7
|
+
tag?: string;
|
|
8
|
+
image?: string;
|
|
9
|
+
altImage?: string;
|
|
10
|
+
link?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
title = '',
|
|
16
|
+
items = [],
|
|
17
|
+
}: { title?: string; items?: AldaiaItem[] } = Astro.props;
|
|
18
|
+
|
|
19
|
+
// isPartOf hacia el nodo de página (#webpage por defecto). Opt-out con pageId="".
|
|
20
|
+
// itemListId opcional: si se pasa, el ItemList lleva ese @id (para ser mainEntity de la CollectionPage).
|
|
21
|
+
const { pageId = PAGE_ENTITY_ID, itemListId = '' } = Astro.props;
|
|
22
|
+
|
|
23
|
+
const escapeJson = (s = "") => String(s).replace(/<[^>]*>/g, '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/[\n\r\t]+/g, ' ');
|
|
24
|
+
|
|
25
|
+
const structuredData = `<script type="application/ld+json">
|
|
26
|
+
{
|
|
27
|
+
"@context": "https://schema.org",
|
|
28
|
+
"@type": "ItemList",${itemListId ? `
|
|
29
|
+
"@id": "${itemListId}",` : ''}${pageId ? `
|
|
30
|
+
"isPartOf": { "@id": "${pageId}" },` : ''}${title ? `
|
|
31
|
+
"name": "${escapeJson(title)}",` : ''}
|
|
32
|
+
"numberOfItems": ${items.length},
|
|
33
|
+
"itemListElement": [${items.map((item: AldaiaItem, i: number) => `{
|
|
34
|
+
"@type": "ListItem",
|
|
35
|
+
"position": ${i + 1},
|
|
36
|
+
"name": "${escapeJson(item.title)}"${item.description ? `,
|
|
37
|
+
"description": "${escapeJson(item.description)}"` : ""}${item.image ? `,
|
|
38
|
+
"image": "${escapeJson(extractImageUrl(item.image))}"` : ""}${item.link ? `,
|
|
39
|
+
"url": "${escapeJson(item.link)}"` : ""}
|
|
40
|
+
}`).join(',')}]
|
|
41
|
+
}
|
|
42
|
+
</script>`;
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
<section class="w-full max-w-7xl mx-auto flex flex-col mb-4">
|
|
46
|
+
{title && title.trim() !== '' && (
|
|
47
|
+
<h2 class="font-poppins text-[#262626] text-[36px] md:text-[40px] font-normal text-center leading-[48px] my-8 md:mb-8 px-8" set:html={title}></h2>
|
|
48
|
+
)}
|
|
49
|
+
<ul class="aldaia-list list-none m-0 flex gap-4 overflow-x-auto snap-x snap-mandatory px-8 scroll-px-8 pb-4 md:grid md:grid-cols-2 lg:grid-cols-3 md:gap-8 md:overflow-visible md:pb-0 lg:px-0">
|
|
50
|
+
{items.map((item: AldaiaItem) => (
|
|
51
|
+
<li class="shrink-0 w-72 snap-start flex md:w-auto">
|
|
52
|
+
<Contenido_2025_Montevideo
|
|
53
|
+
link={item.link}
|
|
54
|
+
image={item.image}
|
|
55
|
+
altImage={item.altImage}
|
|
56
|
+
title={item.title}
|
|
57
|
+
tag={item.tag}
|
|
58
|
+
description={item.description} />
|
|
59
|
+
</li>
|
|
60
|
+
))}
|
|
61
|
+
</ul>
|
|
62
|
+
</section>
|
|
63
|
+
|
|
64
|
+
<Fragment set:html={structuredData} />
|
|
65
|
+
|
|
66
|
+
<style>
|
|
67
|
+
/* Ocultar la barra de scroll del carrusel en móvil (se navega con gesto/snap). */
|
|
68
|
+
.aldaia-list {
|
|
69
|
+
scrollbar-width: none;
|
|
70
|
+
}
|
|
71
|
+
.aldaia-list::-webkit-scrollbar {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -48,6 +48,7 @@ import * as Formulario_2026_Carabanchel from '../carbins/Formulario_2026_Caraban
|
|
|
48
48
|
import * as Formulario_2026_Wichita from '../carbins/Formulario_2026_Wichita.ts';
|
|
49
49
|
import * as Galeria_2026_Segorbe from '../carbins/Galeria_2026_Segorbe.ts';
|
|
50
50
|
import * as GeometricShapeCard from '../carbins/GeometricShapeCard.ts';
|
|
51
|
+
import * as Grid_2026_Aldaia from '../carbins/Grid_2026_Aldaia.ts';
|
|
51
52
|
import * as HeaderCorporativo from '../carbins/HeaderCorporativo.ts';
|
|
52
53
|
import * as Hero_2025_Benidorm from '../carbins/Hero_2025_Benidorm.ts';
|
|
53
54
|
import * as Hero_2026_Benidorm from '../carbins/Hero_2026_Benidorm.ts';
|
|
@@ -143,6 +144,7 @@ export const components = [
|
|
|
143
144
|
{component: Formulario_2026_Wichita},
|
|
144
145
|
{component: Galeria_2026_Segorbe},
|
|
145
146
|
{component: GeometricShapeCard},
|
|
147
|
+
{component: Grid_2026_Aldaia},
|
|
146
148
|
{component: HeaderCorporativo},
|
|
147
149
|
{component: Hero_2025_Benidorm},
|
|
148
150
|
{component: Hero_2026_Benidorm},
|
package/src/index.ts
CHANGED
|
@@ -55,6 +55,7 @@ import Formulario_2026_Wichita from './components/Astro/Formulario_2026_Wichita.
|
|
|
55
55
|
import Galeria_2026_Segorbe from './components/Astro/Galeria_2026_Segorbe.astro';
|
|
56
56
|
import GeometricShape from './components/Astro/GeometricShape.astro';
|
|
57
57
|
import GeometricShapeCard from './components/Astro/GeometricShapeCard.astro';
|
|
58
|
+
import Grid_2026_Aldaia from './components/Astro/Grid_2026_Aldaia.astro';
|
|
58
59
|
import HeaderCorporativo from './components/Astro/HeaderCorporativo.astro';
|
|
59
60
|
import Hero_2025_Benidorm from './components/Astro/Hero_2025_Benidorm.astro';
|
|
60
61
|
import Hero_2026_Benidorm from './components/Astro/Hero_2026_Benidorm.astro';
|
|
@@ -103,7 +104,7 @@ import ReactButton from './components/React/ReactButton.jsx';
|
|
|
103
104
|
// Exporta todos los componentes uno a uno para que puedan ser usados directamente.
|
|
104
105
|
|
|
105
106
|
|
|
106
|
-
export { VueButton, Author_2025_Algarve, Button, CTA_2025_Formentera, Cabecera_2025_Barcelona, Cabecera_2025_Madrid, Cabecera_2026_Bilbao, Cabecera_2026_Dakota, Cabecera_2026_Madrid, Calculadora_2026_Lisboa, Card_2025_Malta, Contenido_2025_Alcorcon, Contenido_2025_Cordoba, Contenido_2025_Granada, Contenido_2025_Malaga, Contenido_2025_Montevideo, Contenido_2026_Cabra, Contenido_2026_Denia, Contenido_2026_Dubai, Contenido_2026_Estepona, Contenido_2026_Estocolmo, Contenido_2026_Huesca, Contenido_2026_Jaen, Contenido_2026_Leon, Contenido_2026_Mallorca, Contenido_2026_Marruecos, Contenido_2026_Menorca, Contenido_2026_Michigan, Contenido_2026_Moraira, Contenido_2026_Mostoles, Contenido_2026_Orcasitas, Contenido_2026_Oslo, Contenido_2026_Quito, Contenido_2026_Seattle, Contenido_2026_Sevilla, Contenido_2026_Tokyo, Contenido_2026_Ubeda, Contenido_2026_Yakarta, CorpFooter, CorpHero, CorpNavigation, Enlace_2025_Venecia, FAQ_2025_Hiroshima, Footer_2025_Napoles, Formulario_2025_Nara, Formulario_2025_Seul, Formulario_2025_Teruel, Formulario_2026_Carabanchel, Formulario_2026_Wichita, Galeria_2026_Segorbe, GeometricShape, GeometricShapeCard, HeaderCorporativo, Hero_2025_Benidorm, Hero_2026_Benidorm, Hero_2026_Lliria, ImageTextSimple, Imagen_2025_Bogota, Imagen_2025_Fukushima, Imagen_2026_Algar, Indice_2025_Taiwan, Mapa_2026_Girona, Modal_2025_Sagunto, Modal_2026_Almeria, Paginacion_2025_Paris, RRSS_2025_Pisa, SEO_Head_Section, SEO_Schema_Page, Separador_2025_Reinosa, Separador_2025_Toledo, Separador_2026_Teulada, Share_2025_Florencia, SpectrumSeparator, Sumario_2025_Beijing, Tabla_2025_Fuenlabrada, Tabla_2026_Cadiz, Tag_2025_Bolonia, TestHijo, TestPadre, Test_2026_Gaza, TextBox, TextImageBackground, TextImageBlock, TextImageCard, TextImageHeader, Texto_2025_Kyoto, Texto_2026_Alicante, Texto_2026_Castellon, Tiempo_2025_Londres, Titulo_2025_Algeciras, Titulo_2025_Santorini, VideoAutoplay, Video_2025_Polop, Video_2025_Valencia, Video_2026_Andujar, ReactButton };
|
|
107
|
+
export { VueButton, Author_2025_Algarve, Button, CTA_2025_Formentera, Cabecera_2025_Barcelona, Cabecera_2025_Madrid, Cabecera_2026_Bilbao, Cabecera_2026_Dakota, Cabecera_2026_Madrid, Calculadora_2026_Lisboa, Card_2025_Malta, Contenido_2025_Alcorcon, Contenido_2025_Cordoba, Contenido_2025_Granada, Contenido_2025_Malaga, Contenido_2025_Montevideo, Contenido_2026_Cabra, Contenido_2026_Denia, Contenido_2026_Dubai, Contenido_2026_Estepona, Contenido_2026_Estocolmo, Contenido_2026_Huesca, Contenido_2026_Jaen, Contenido_2026_Leon, Contenido_2026_Mallorca, Contenido_2026_Marruecos, Contenido_2026_Menorca, Contenido_2026_Michigan, Contenido_2026_Moraira, Contenido_2026_Mostoles, Contenido_2026_Orcasitas, Contenido_2026_Oslo, Contenido_2026_Quito, Contenido_2026_Seattle, Contenido_2026_Sevilla, Contenido_2026_Tokyo, Contenido_2026_Ubeda, Contenido_2026_Yakarta, CorpFooter, CorpHero, CorpNavigation, Enlace_2025_Venecia, FAQ_2025_Hiroshima, Footer_2025_Napoles, Formulario_2025_Nara, Formulario_2025_Seul, Formulario_2025_Teruel, Formulario_2026_Carabanchel, Formulario_2026_Wichita, Galeria_2026_Segorbe, GeometricShape, GeometricShapeCard, Grid_2026_Aldaia, HeaderCorporativo, Hero_2025_Benidorm, Hero_2026_Benidorm, Hero_2026_Lliria, ImageTextSimple, Imagen_2025_Bogota, Imagen_2025_Fukushima, Imagen_2026_Algar, Indice_2025_Taiwan, Mapa_2026_Girona, Modal_2025_Sagunto, Modal_2026_Almeria, Paginacion_2025_Paris, RRSS_2025_Pisa, SEO_Head_Section, SEO_Schema_Page, Separador_2025_Reinosa, Separador_2025_Toledo, Separador_2026_Teulada, Share_2025_Florencia, SpectrumSeparator, Sumario_2025_Beijing, Tabla_2025_Fuenlabrada, Tabla_2026_Cadiz, Tag_2025_Bolonia, TestHijo, TestPadre, Test_2026_Gaza, TextBox, TextImageBackground, TextImageBlock, TextImageCard, TextImageHeader, Texto_2025_Kyoto, Texto_2026_Alicante, Texto_2026_Castellon, Tiempo_2025_Londres, Titulo_2025_Algeciras, Titulo_2025_Santorini, VideoAutoplay, Video_2025_Polop, Video_2025_Valencia, Video_2026_Andujar, ReactButton };
|
|
107
108
|
|
|
108
109
|
|
|
109
110
|
// Exporta la función listComponents para que sea usado en el Pagebuilder en Vue.
|
|
@@ -170,6 +171,7 @@ export const components = {
|
|
|
170
171
|
Galeria_2026_Segorbe: Galeria_2026_Segorbe,
|
|
171
172
|
GeometricShape: GeometricShape,
|
|
172
173
|
GeometricShapeCard: GeometricShapeCard,
|
|
174
|
+
Grid_2026_Aldaia: Grid_2026_Aldaia,
|
|
173
175
|
HeaderCorporativo: HeaderCorporativo,
|
|
174
176
|
Hero_2025_Benidorm: Hero_2025_Benidorm,
|
|
175
177
|
Hero_2026_Benidorm: Hero_2026_Benidorm,
|