libreria-astro-lefebvre 0.1.10 → 0.1.16

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libreria-astro-lefebvre",
3
- "version": "0.1.10",
3
+ "version": "0.1.16",
4
4
  "description": "Librería de componentes Astro, React y Vue para Lefebvre",
5
5
  "author": "Equipo web desarrollo Lefebvre",
6
6
  "type": "module",
@@ -0,0 +1,36 @@
1
+ import type { ComponentMetadata } from '../interfaces/types';
2
+
3
+ export const metadata: ComponentMetadata = {
4
+ component_name: 'Galeria_2026_Segorbe',
5
+ category: 'Contenido con listas',
6
+ name: 'Galería de imágenes en masonry 2026',
7
+ description: 'Galería tipo masonry (estilo Pinterest): muestra una lista de imágenes en columnas con altura variable usando CSS columns. El número de columnas en escritorio es configurable (2, 3 o 4); en tablet siempre 2 y en móvil 1. Cada imagen conserva su proporción original. Incluye structured data schema.org (ItemList de ImageObject)',
8
+ framework: 'Astro',
9
+ priority: 1,
10
+ tags: ['galeria', 'imagenes', 'masonry', 'pinterest', 'grid'],
11
+ fields: [
12
+ {
13
+ name: 'columns',
14
+ type: 'select',
15
+ help: 'Número de columnas en escritorio (breakpoint lg). En tablet (md) siempre se muestran 2 columnas y en móvil 1',
16
+ label: 'Columnas en escritorio',
17
+ options: ['2', '3', '4'],
18
+ options_labels: ['2 columnas', '3 columnas', '4 columnas'],
19
+ example_value: '3'
20
+ },
21
+ {
22
+ name: 'items',
23
+ type: 'list',
24
+ help: 'Listado de imágenes que componen la galería. Cada imagen mantiene su proporción original; el layout las distribuye en columnas de altura variable. IMPORTANTE: para conseguir el efecto masonry (estilo Pinterest) las imágenes deben tener proporciones distintas entre sí (verticales, horizontales, cuadradas, etc.). Si todas tienen el mismo aspect-ratio (p. ej. todas 16:9) el resultado se verá como una rejilla uniforme, no como masonry',
25
+ label: 'Imágenes de la galería',
26
+ mandatory: false,
27
+ items: {
28
+ type: 'object',
29
+ fields: [
30
+ { name: 'image', type: 'image', help: 'Imagen de la galería. Acepta URL directa o JSON de Limbo', label: 'Imagen', example_value: 'https://assets.lefebvre.es/media/img/preview-comp/comp-16-9.png' },
31
+ { name: 'alt', type: 'text', help: 'Texto alternativo de la imagen para accesibilidad y SEO. Si se deja vacío se usa un texto genérico', label: 'Texto alternativo (alt)', example_value: 'Imagen de la galería' }
32
+ ]
33
+ }
34
+ }
35
+ ]
36
+ };
@@ -45,10 +45,10 @@ const hasContent = title || description;
45
45
 
46
46
  <div class="w-full max-w-7xl flex flex-col items-center justify-center text-center">
47
47
  {showBtn && linkBtn && (
48
- <a href={linkBtn} target="_self" class="flex items-center justify-center w-fit py-3 px-6 mx-auto gap-4 shrink-0 rounded-lg border border-[#2134F1] bg-[rgba(255,255,255,0.01)] text-[#2134F1] text-center font-[Inter] text-base font-semibold leading-6 no-underline hover:underline transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
48
+ <a href={linkBtn} target="_self" class="flex items-center justify-center w-fit py-3 px-6 mx-auto gap-4 shrink-0 rounded-lg border border-[#2134F1] bg-[#2134F1] text-white text-center font-inter text-base font-semibold leading-6 no-underline hover:bg-white hover:text-[#2134F1] transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
49
49
  )}
50
50
  {showBtnModal && (
51
- <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#fffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
51
+ <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#ffffff" backColor="#2134F1" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
52
52
  )}
53
53
  </div>
54
54
  </section>
@@ -66,10 +66,10 @@ const hasContent = title || description;
66
66
  )}
67
67
  <div class={`w-full max-w-7xl flex flex-col items-center justify-center text-center ${hasContent ? '' : 'my-auto'}`}>
68
68
  {showBtn && linkBtn && (
69
- <a href={linkBtn} target="_self" class="flex items-center justify-center w-fit py-3 px-6 mx-auto gap-4 shrink-0 rounded-lg border border-[#2134F1] bg-white text-[#2134F1] text-center font-[Inter] text-base font-semibold leading-6 no-underline hover:underline transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
69
+ <a href={linkBtn} target="_self" class="flex items-center justify-center w-fit py-3 px-6 mx-auto gap-4 shrink-0 rounded-lg border border-[#2134F1] bg-[#2134F1] text-white text-center font-inter text-base font-semibold leading-6 no-underline hover:bg-white hover:text-[#2134F1] transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
70
70
  )}
71
71
  {showBtnModal && (
72
- <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#ffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
72
+ <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#ffffff" backColor="#2134F1" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
73
73
  )}
74
74
  </div>
75
75
  </section>
@@ -37,14 +37,14 @@ const hasContent = title || description;
37
37
  <section class={`w-full flex flex-col ${hasContent ? 'justify-between' : 'justify-center'} items-center p-6 rounded-2xl bg-cover bg-center min-h-[289px] bg-white`} style={backgroundStyle}>
38
38
  {hasContent && (
39
39
  <div class="w-full max-w-7xl flex flex-col items-center justify-center text-left gap-4">
40
- {title && <h3 class="text-[#262626] font-[Poppins] text-2xl font-semibold leading-8" style="font-feature-settings: 'liga' off, 'clig' off;">{title}</h3>}
41
- {description && <p class="text-[#627384] font-[Inter] text-base font-normal leading-6" style="font-feature-settings: 'liga' off, 'clig' off;" set:html={description}></p>}
40
+ {title && <h3 class="text-[#262626] font-[Poppins] text-2xl font-semibold leading-8">{title}</h3>}
41
+ {description && <p class="text-[#627384] font-[Inter] text-base font-normal leading-6" set:html={description}></p>}
42
42
  </div>
43
43
  )}
44
44
 
45
45
  <div class="w-full max-w-7xl flex flex-col items-center justify-center text-center">
46
46
  {showBtn && linkBtn && (
47
- <a href={linkBtn} target="_self" class="flex items-center justify-center h-12 gap-4 shrink-0 self-stretch rounded-lg border border-[#2134F1] bg-[rgba(255,255,255,0.01)] text-[#2134F1] text-center font-[Inter] text-base font-semibold leading-6 no-underline hover:underline transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
47
+ <a href={linkBtn} target="_self" class="flex items-center justify-center w-fit mx-auto px-6 py-4 h-12 gap-4 shrink-0 self-stretch rounded-lg border border-[#2134F1] bg-[rgba(255,255,255,0.01)] text-[#2134F1] text-center font-[Inter] text-base font-semibold leading-6 no-underline hover:underline hover:bg-white transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
48
48
  )}
49
49
  {showBtnModal && (
50
50
  <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#fffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
@@ -59,8 +59,8 @@ const hasContent = title || description;
59
59
  <section class={`w-full flex flex-col items-center p-6 rounded-2xl bg-cover bg-center min-h-[289px] my-8 ${hasContent ? 'justify-between' : ''}`} style={backgroundStyle}>
60
60
  {hasContent && (
61
61
  <div class="w-full max-w-7xl flex flex-col items-center justify-center text-left gap-4">
62
- {title && <h3 class="text-[#262626] font-[Poppins] text-2xl font-semibold leading-8" style="font-feature-settings: 'liga' off, 'clig' off;">{title}</h3>}
63
- {description && <p class="text-[#627384] font-[Inter] text-base font-normal leading-6" style="font-feature-settings: 'liga' off, 'clig' off;" set:html={description}></p>}
62
+ {title && <h3 class="text-[#262626] font-[Poppins] text-2xl font-semibold leading-8">{title}</h3>}
63
+ {description && <p class="text-[#627384] font-[Inter] text-base font-normal leading-6" set:html={description}></p>}
64
64
  </div>
65
65
  )}
66
66
  <div class={`w-full max-w-7xl flex flex-col items-center text-center gap-6 ${hasContent ? '' : 'my-auto'}`}>
@@ -92,7 +92,7 @@ const hasContent = title || description;
92
92
 
93
93
  <div class={`w-full max-w-7xl flex flex-col items-center justify-center text-center ${hasContent ? '' : 'mt-auto'}`}>
94
94
  {showBtn && linkBtn && (
95
- <a href={linkBtn} target="_self" class="flex items-center justify-center h-12 gap-4 shrink-0 self-stretch rounded-lg border border-[#2134F1] bg-[rgba(255,255,255,0.01)] text-[#2134F1] text-center font-[Inter] text-base font-semibold leading-6 no-underline hover:underline transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
95
+ <a href={linkBtn} target="_self" class="flex items-center justify-center w-fit mx-auto px-6 py-4 h-12 gap-4 shrink-0 self-stretch rounded-lg border border-[#2134F1] bg-[rgba(255,255,255,0.01)] text-[#2134F1] text-center font-[Inter] text-base font-semibold leading-6 no-underline hover:underline hover:bg-white transition-all duration-300 cursor-pointer shadow-[0_2px_4px_-2px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.04)]">{txtBtn}</a>
96
96
  )}
97
97
  {showBtnModal && (
98
98
  <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#ffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
@@ -0,0 +1,57 @@
1
+ ---
2
+ import { extractImageUrl } from '../../lib/functions.js';
3
+
4
+ interface GaleriaItem {
5
+ image?: string;
6
+ alt?: string;
7
+ }
8
+
9
+ const {
10
+ columns = '3',
11
+ items = []
12
+ }: { columns?: string; items?: GaleriaItem[] } = Astro.props;
13
+
14
+ const lgColsClass = {
15
+ '2': 'lg:columns-2',
16
+ '3': 'lg:columns-3',
17
+ '4': 'lg:columns-4',
18
+ }[columns] || 'lg:columns-3';
19
+
20
+ const visibleItems = items.filter((i: GaleriaItem) => !!i.image);
21
+
22
+ const escapeJson = (s = '') => String(s).replace(/<[^>]*>/g, '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/[\n\r\t]+/g, ' ');
23
+
24
+ const structuredData = `<script type="application/ld+json">
25
+ {
26
+ "@context": "https://schema.org",
27
+ "@type": "ItemList",
28
+ "numberOfItems": ${visibleItems.length},
29
+ "itemListElement": [${visibleItems.map((item: GaleriaItem, i: number) => `{
30
+ "@type": "ListItem",
31
+ "position": ${i + 1},
32
+ "item": {
33
+ "@type": "ImageObject",
34
+ "contentUrl": "${escapeJson(extractImageUrl(item.image))}"${item.alt ? `,
35
+ "name": "${escapeJson(item.alt)}"` : ''}
36
+ }
37
+ }`).join(',')}]
38
+ }
39
+ </script>`;
40
+ ---
41
+
42
+ <section class="w-full px-6 md:px-0 py-10">
43
+ <div class={`columns-1 md:columns-2 ${lgColsClass} gap-6`}>
44
+ {visibleItems.map((item: GaleriaItem) => (
45
+ <figure class="mb-6 break-inside-avoid">
46
+ <img
47
+ src={extractImageUrl(item.image)}
48
+ alt={item.alt || 'Imagen de la galería'}
49
+ loading="lazy"
50
+ class="w-full h-auto rounded-xl"
51
+ />
52
+ </figure>
53
+ ))}
54
+ </div>
55
+ </section>
56
+
57
+ <Fragment set:html={structuredData} />
@@ -42,6 +42,7 @@ import * as Formulario_2025_Seul from '../carbins/Formulario_2025_Seul.ts';
42
42
  import * as Formulario_2025_Teruel from '../carbins/Formulario_2025_Teruel.ts';
43
43
  import * as Formulario_2026_Carabanchel from '../carbins/Formulario_2026_Carabanchel.ts';
44
44
  import * as Formulario_2026_Wichita from '../carbins/Formulario_2026_Wichita.ts';
45
+ import * as Galeria_2026_Segorbe from '../carbins/Galeria_2026_Segorbe.ts';
45
46
  import * as GeometricShapeCard from '../carbins/GeometricShapeCard.ts';
46
47
  import * as HeaderCorporativo from '../carbins/HeaderCorporativo.ts';
47
48
  import * as Hero_2025_Benidorm from '../carbins/Hero_2025_Benidorm.ts';
@@ -128,6 +129,7 @@ export const components = [
128
129
  {component: Formulario_2025_Teruel},
129
130
  {component: Formulario_2026_Carabanchel},
130
131
  {component: Formulario_2026_Wichita},
132
+ {component: Galeria_2026_Segorbe},
131
133
  {component: GeometricShapeCard},
132
134
  {component: HeaderCorporativo},
133
135
  {component: Hero_2025_Benidorm},
package/src/index.ts CHANGED
@@ -48,6 +48,7 @@ import Formulario_2025_Seul from './components/Astro/Formulario_2025_Seul.astro'
48
48
  import Formulario_2025_Teruel from './components/Astro/Formulario_2025_Teruel.astro';
49
49
  import Formulario_2026_Carabanchel from './components/Astro/Formulario_2026_Carabanchel.astro';
50
50
  import Formulario_2026_Wichita from './components/Astro/Formulario_2026_Wichita.astro';
51
+ import Galeria_2026_Segorbe from './components/Astro/Galeria_2026_Segorbe.astro';
51
52
  import GeometricShape from './components/Astro/GeometricShape.astro';
52
53
  import GeometricShapeCard from './components/Astro/GeometricShapeCard.astro';
53
54
  import HeaderCorporativo from './components/Astro/HeaderCorporativo.astro';
@@ -94,7 +95,7 @@ import ReactButton from './components/React/ReactButton.jsx';
94
95
  // Exporta todos los componentes uno a uno para que puedan ser usados directamente.
95
96
 
96
97
 
97
- export { VueButton, Author_2025_Algarve, Button, CTA_2025_Formentera, Cabecera_2025_Barcelona, Cabecera_2025_Madrid, Cabecera_2026_Bilbao, Cabecera_2026_Madrid, 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_Estocolmo, 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, GeometricShape, GeometricShapeCard, HeaderCorporativo, Hero_2025_Benidorm, Hero_2026_Benidorm, ImageTextSimple, Imagen_2025_Bogota, Imagen_2025_Fukushima, Imagen_2026_Algar, Indice_2025_Taiwan, Modal_2025_Sagunto, Paginacion_2025_Paris, RRSS_2025_Pisa, SEO_Head_Section, SEO_Schema_Page, Separador_2025_Reinosa, Separador_2025_Toledo, 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 };
98
+ export { VueButton, Author_2025_Algarve, Button, CTA_2025_Formentera, Cabecera_2025_Barcelona, Cabecera_2025_Madrid, Cabecera_2026_Bilbao, Cabecera_2026_Madrid, 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_Estocolmo, 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, ImageTextSimple, Imagen_2025_Bogota, Imagen_2025_Fukushima, Imagen_2026_Algar, Indice_2025_Taiwan, Modal_2025_Sagunto, Paginacion_2025_Paris, RRSS_2025_Pisa, SEO_Head_Section, SEO_Schema_Page, Separador_2025_Reinosa, Separador_2025_Toledo, 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 };
98
99
 
99
100
 
100
101
  // Exporta la función listComponents para que sea usado en el Pagebuilder en Vue.
@@ -154,6 +155,7 @@ export const components = {
154
155
  Formulario_2025_Teruel: Formulario_2025_Teruel,
155
156
  Formulario_2026_Carabanchel: Formulario_2026_Carabanchel,
156
157
  Formulario_2026_Wichita: Formulario_2026_Wichita,
158
+ Galeria_2026_Segorbe: Galeria_2026_Segorbe,
157
159
  GeometricShape: GeometricShape,
158
160
  GeometricShapeCard: GeometricShapeCard,
159
161
  HeaderCorporativo: HeaderCorporativo,