libreria-astro-lefebvre 0.0.180 → 0.0.182

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.0.180",
3
+ "version": "0.0.182",
4
4
  "description": "Librería de componentes Astro, React y Vue para Lefebvre",
5
5
  "author": "Equipo web desarrollo Lefebvre",
6
6
  "type": "module",
@@ -126,6 +126,14 @@ export const metadata: ComponentMetadata = {
126
126
  label: 'Nombre del formulario LF2',
127
127
  mandatory: false,
128
128
  example_value: 'formulario-contacto-genial'
129
+ },
130
+ {
131
+ name: 'idebook',
132
+ type: 'text',
133
+ help: 'ID del ebook, whitepaper o documento registrado en BI con formato EXXXXXXX para pasar como parámetro oculto al formulario de LF2. No es obligatorio, solo debe usarse para formularios que acabaran con una descarga',
134
+ label: 'ID de documento en BI (opcional)',
135
+ mandatory: false,
136
+ example_value: ''
129
137
  }
130
138
  ]
131
139
  };
@@ -81,5 +81,13 @@ export const metadata: ComponentMetadata = {
81
81
  mandatory: false,
82
82
  example_value: '27925 Formulario Solicitar Demo GenIA-L'
83
83
  },
84
+ {
85
+ name: 'idebook',
86
+ type: 'text',
87
+ help: 'ID del ebook, whitepaper o documento registrado en BI con formato EXXXXXXX para pasar como parámetro oculto al formulario de LF2. No es obligatorio, solo debe usarse para formularios que acabaran con una descarga',
88
+ label: 'ID de documento en BI (opcional)',
89
+ mandatory: false,
90
+ example_value: ''
91
+ },
84
92
  ]
85
93
  };
@@ -9,8 +9,7 @@ const {
9
9
  title='',
10
10
  tag='',
11
11
  description='',
12
- author='',
13
- authorURL='#',
12
+ author=''
14
13
  } = Astro.props;
15
14
 
16
15
  const imageUrl = extractImageUrl(image);
@@ -18,6 +18,7 @@ const {
18
18
  titleModal = '',
19
19
  descriptionModal = '',
20
20
  lf2FormTitle = '',
21
+ idebook = '',
21
22
 
22
23
  } = Astro.props;
23
24
 
@@ -46,7 +47,7 @@ const hasContent = title || description;
46
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
48
  )}
48
49
  {showBtnModal && (
49
- <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#fffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} />
50
+ <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#fffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
50
51
  )}
51
52
  </div>
52
53
  </section>
@@ -94,7 +95,7 @@ const hasContent = title || description;
94
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
96
  )}
96
97
  {showBtnModal && (
97
- <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#ffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} />
98
+ <Modal_2025_Sagunto buttonText={txtBtnModal} frontColor="#2134F1" backColor="#ffffff" borderColor="#2134F1" imageModal={imageModal} altModal={altModal} titleModal={titleModal} descriptionModal={descriptionModal} lf2FormTitle={lf2FormTitle} idebook={idebook} />
98
99
  )}
99
100
  </div>
100
101
  </section>
@@ -12,6 +12,7 @@ const {
12
12
  titleModal = '',
13
13
  descriptionModal = '',
14
14
  lf2FormTitle = '',
15
+ idebook = '',
15
16
  } = Astro.props;
16
17
 
17
18
  const imageModalUrl = extractImageUrl(imageModal);
@@ -65,7 +66,7 @@ const structuredData = `<script type="application/ld+json">
65
66
 
66
67
  <Fragment set:html={structuredData} />
67
68
 
68
- <script is:inline define:vars={{ randomId, lf2FormTitle }}>
69
+ <script is:inline define:vars={{ randomId, lf2FormTitle, idebook }}>
69
70
 
70
71
  document.addEventListener('DOMContentLoaded', () => {
71
72
 
@@ -73,9 +74,16 @@ const structuredData = `<script type="application/ld+json">
73
74
  fake: true,
74
75
  formulario: lf2FormTitle,
75
76
  bootstrap: true,
76
- target: '#'+ `lf2-form-container-${randomId}`
77
+ target: '#'+ `lf2-form-container-${randomId}`,
77
78
  };
78
79
 
80
+ if (idebook && idebook !== '') {
81
+ configLf2.defaultparameters = {
82
+ 'idebook': idebook,
83
+ 'codprod': idebook
84
+ };
85
+ }
86
+
79
87
  try {
80
88
  apiManager.pintarFormularioAutogestionado(configLf2);
81
89
  } catch (error) {