lf-pagebuilder-vue 0.0.67 → 0.0.69
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/README.md +64 -4
- package/dist/components/BodySection.vue.d.ts +4 -4
- package/dist/components/ColConfig.vue.d.ts +7 -4
- package/dist/components/GlobalConfig.vue.d.ts +1 -0
- package/dist/components/Pagebuilder.vue.d.ts +2 -0
- package/dist/components/RowConfig.vue.d.ts +9 -4
- package/dist/index.cjs +35 -35
- package/dist/index.js +7072 -7032
- package/dist-symfony/lf-pagebuilder-iife.css +1 -1
- package/dist-symfony/lf-pagebuilder-iife.iife.js +84 -96
- package/dist-symfony/lf-pagebuilder-iife.iife.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ npm install lf-pagebuilder-vue
|
|
|
20
20
|
:submitForm="false"
|
|
21
21
|
inputId="mi-input-hidden"
|
|
22
22
|
:excludeComponentTypes="['SEO', 'Footer']"
|
|
23
|
+
:excludeComponentTags="['boton', 'destacado']"
|
|
24
|
+
:includeOnlyComponentTags="['articulo']"
|
|
23
25
|
:visibleSections="['Header', 'Body', 'Footer']"
|
|
24
26
|
allowRenderMode="open"
|
|
25
27
|
limboToken="eyJ..."
|
|
@@ -40,6 +42,8 @@ import 'lf-pagebuilder-vue/styles';
|
|
|
40
42
|
| `submitForm` | `boolean` | `false` | Al guardar, busca el `<form>` padre y hace `.submit()` automáticamente |
|
|
41
43
|
| `inputId` | `string \| null` | `null` | ID del `<input hidden>` donde se vuelca el JSON de configuración al guardar |
|
|
42
44
|
| `excludeComponentTypes` | `string[]` | `[]` | Categorías de componentes que NO aparecerán en el selector. "Repetidor" siempre se excluye. |
|
|
45
|
+
| `excludeComponentTags` | `string[]` | `[]` | Tags de componentes a excluir (lista negra). Un componente con cualquiera de estos tags no aparecerá. Compatible con `excludeComponentTypes`. |
|
|
46
|
+
| `includeOnlyComponentTags` | `string[]` | `[]` | Solo muestra componentes que tengan al menos uno de estos tags (lista blanca). Si se combina con `excludeComponentTags`, la exclusión tiene prioridad. |
|
|
43
47
|
| `visibleSections` | `string[]` | — | Secciones visibles. Si no se indica, se muestran todas. Valores posibles: `Header`, `Body`, `Footer`, `Sidebar` |
|
|
44
48
|
| `allowRenderMode` | `'open' \| 'fullpage' \| 'onlybody'` | `'open'` | Controla el modo de renderizado. `open` = el usuario elige · `fullpage` = forzado página completa · `onlybody` = forzado solo body |
|
|
45
49
|
| `limboToken` | `string` | — | Token JWT para el gestor de imágenes Limbo. Obtenerlo server-side con `fetchLimboToken()` |
|
|
@@ -47,6 +51,9 @@ import 'lf-pagebuilder-vue/styles';
|
|
|
47
51
|
> **Categorías disponibles para `excludeComponentTypes`:**
|
|
48
52
|
> `Call to Action`, `Contenido`, `Separador`, `Texto`, `Cabecera`, `Footer`, `Imagen`, `Repetidor`, `Formulario`, `Título`, `SEO`
|
|
49
53
|
|
|
54
|
+
> **Nota sobre filtrado por tags (`excludeComponentTags` / `includeOnlyComponentTags`):**
|
|
55
|
+
> Los tags son metadatos libres definidos en cada componente de la librería. Puedes usar uno o ambos filtros simultáneamente: si un componente está en `excludeComponentTags` y también cumple `includeOnlyComponentTags`, la exclusión tiene prioridad y no aparece.
|
|
56
|
+
|
|
50
57
|
---
|
|
51
58
|
|
|
52
59
|
### Modo 2 — Script IIFE (Symfony / Twig / cualquier backend)
|
|
@@ -64,6 +71,8 @@ import 'lf-pagebuilder-vue/styles';
|
|
|
64
71
|
data-debug-mode="false"
|
|
65
72
|
data-submit-form="false"
|
|
66
73
|
data-exclude-component-types="SEO,Footer,Cabecera"
|
|
74
|
+
data-exclude-component-tags="boton,destacado"
|
|
75
|
+
data-include-only-component-tags="articulo"
|
|
67
76
|
data-visible-sections="Header,Body,Footer"
|
|
68
77
|
data-allow-render-mode="open"
|
|
69
78
|
/>
|
|
@@ -75,6 +84,8 @@ import 'lf-pagebuilder-vue/styles';
|
|
|
75
84
|
| `data-debug-mode` | `"true"` \| `"false"` | `"false"` | Muestra panel de import/export JSON y botón de carga desde localStorage |
|
|
76
85
|
| `data-submit-form` | `"true"` \| `"false"` | `"false"` | Al guardar, busca el `<form>` padre y hace `.submit()` automáticamente |
|
|
77
86
|
| `data-exclude-component-types` | `string` (separado por comas) | — | Categorías de componentes a excluir. Ej: `"SEO,Footer,Cabecera"` |
|
|
87
|
+
| `data-exclude-component-tags` | `string` (separado por comas) | — | Tags de componentes a excluir (lista negra). Ej: `"boton,destacado"` |
|
|
88
|
+
| `data-include-only-component-tags` | `string` (separado por comas) | — | Solo muestra componentes con estos tags (lista blanca). Ej: `"articulo"`. Si se combina con `data-exclude-component-tags`, la exclusión tiene prioridad. |
|
|
78
89
|
| `data-visible-sections` | `string` (separado por comas) | — | Secciones visibles. Si no se indica, se muestran todas. Ej: `"Header,Body"` |
|
|
79
90
|
| `data-allow-render-mode` | `"open"` \| `"fullpage"` \| `"onlybody"` | `"open"` | Controla el modo de renderizado. `open` = el usuario elige · `fullpage` = forzado página completa · `onlybody` = forzado solo body |
|
|
80
91
|
|
|
@@ -140,23 +151,28 @@ Se pueden pasar opciones de configuración al Pagebuilder mediante atributos `da
|
|
|
140
151
|
| `data-debug-mode` | `"true"` \| `"false"` | `"false"` | Activa el modo debug |
|
|
141
152
|
| `data-submit-form` | `"true"` \| `"false"` | `"false"` | Envía el formulario automáticamente |
|
|
142
153
|
| `data-exclude-component-types` | `string` | - | Categorías de componentes a excluir, separadas por coma |
|
|
154
|
+
| `data-exclude-component-tags` | `string` | - | Tags de componentes a excluir (lista negra), separados por coma. Ej: `"boton,destacado"` |
|
|
155
|
+
| `data-include-only-component-tags` | `string` | - | Solo muestra componentes con estos tags (lista blanca), separados por coma. Ej: `"articulo"`. Si se combina con `data-exclude-component-tags`, la exclusión tiene prioridad. |
|
|
143
156
|
|
|
144
157
|
**Ejemplo completo:**
|
|
145
158
|
|
|
146
159
|
```html
|
|
147
|
-
<input
|
|
148
|
-
type="hidden"
|
|
149
|
-
class="js-lf-pagebuilder-vue-input"
|
|
160
|
+
<input
|
|
161
|
+
type="hidden"
|
|
162
|
+
class="js-lf-pagebuilder-vue-input"
|
|
150
163
|
name="page_config"
|
|
151
164
|
data-is-production="true"
|
|
152
165
|
data-debug-mode="false"
|
|
153
166
|
data-submit-form="true"
|
|
154
167
|
data-exclude-component-types="SEO, Footer, Cabecera"
|
|
168
|
+
data-exclude-component-tags="boton,destacado"
|
|
155
169
|
/>
|
|
156
170
|
```
|
|
157
171
|
|
|
158
172
|
> **Nota sobre `data-exclude-component-types`:** La categoría "Repetidor" siempre se excluye automáticamente. Las categorías adicionales que pases se suman a esta exclusión. Las categorías disponibles son: `Call to Action`, `Contenido`, `Separador`, `Texto`, `Cabecera`, `Footer`, `Imagen`, `Repetidor`, `Formulario`, `Título`, `SEO`.
|
|
159
173
|
|
|
174
|
+
> **Nota sobre filtrado por tags:** `data-exclude-component-tags` y `data-include-only-component-tags` actúan sobre los tags de los componentes (metadatos libres definidos en la librería). Pueden usarse de forma independiente o combinada. Si un componente aparece en ambos filtros, la exclusión prevalece.
|
|
175
|
+
|
|
160
176
|
---
|
|
161
177
|
|
|
162
178
|
### 2. Como componente Vue
|
|
@@ -185,14 +201,17 @@ import { Pagebuilder } from 'lf-pagebuilder-vue';
|
|
|
185
201
|
| `submitForm` | `boolean` | `false` | Envía el formulario automáticamente |
|
|
186
202
|
| `inputId` | `string \| null` | `null` | ID del input hidden donde guardar la configuración |
|
|
187
203
|
| `excludeComponentTypes` | `string[]` | `[]` | Categorías de componentes a excluir (además de "Repetidor" que siempre se excluye) |
|
|
204
|
+
| `excludeComponentTags` | `string[]` | `[]` | Tags de componentes a excluir (lista negra). Un componente con cualquiera de estos tags no aparecerá. |
|
|
205
|
+
| `includeOnlyComponentTags` | `string[]` | `[]` | Solo muestra componentes que tengan al menos uno de estos tags (lista blanca). Si se combina con `excludeComponentTags`, la exclusión tiene prioridad. |
|
|
188
206
|
|
|
189
207
|
**Ejemplo con exclusión de componentes:**
|
|
190
208
|
|
|
191
209
|
```vue
|
|
192
210
|
<template>
|
|
193
|
-
<Pagebuilder
|
|
211
|
+
<Pagebuilder
|
|
194
212
|
:isProduction="false"
|
|
195
213
|
:excludeComponentTypes="['SEO', 'Footer', 'Cabecera']"
|
|
214
|
+
:excludeComponentTags="['boton', 'destacado']"
|
|
196
215
|
/>
|
|
197
216
|
</template>
|
|
198
217
|
|
|
@@ -291,6 +310,47 @@ Para más detalles, consulta [README_LIMBO.md](README_LIMBO.md).
|
|
|
291
310
|
|
|
292
311
|
---
|
|
293
312
|
|
|
313
|
+
## Funcionalidades del editor
|
|
314
|
+
|
|
315
|
+
### Color de fondo en filas y columnas
|
|
316
|
+
|
|
317
|
+
Cada fila y cada columna del editor puede tener un color de fondo personalizado con soporte de canal alpha (opacidad). El color se configura desde el panel de configuración de la fila o columna y se exporta junto al resto de la configuración del layout.
|
|
318
|
+
|
|
319
|
+
El panel de color incluye:
|
|
320
|
+
- Selector de color (rueda de color nativa del navegador)
|
|
321
|
+
- Deslizador de opacidad (0–100%)
|
|
322
|
+
- Indicador visual del color resultante con su valor RGBA
|
|
323
|
+
|
|
324
|
+
El color se almacena en el JSON de configuración como un valor `rgba(r, g, b, a)` dentro de la propiedad `backgroundColor` del objeto de configuración de la fila o columna:
|
|
325
|
+
|
|
326
|
+
```json
|
|
327
|
+
{
|
|
328
|
+
"rows": [
|
|
329
|
+
{
|
|
330
|
+
"config": {
|
|
331
|
+
"backgroundColor": "rgba(255, 200, 100, 0.75)"
|
|
332
|
+
},
|
|
333
|
+
"columns": [
|
|
334
|
+
{
|
|
335
|
+
"config": {
|
|
336
|
+
"backgroundColor": "rgba(240, 240, 240, 1)"
|
|
337
|
+
},
|
|
338
|
+
"components": []
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Resaltado de elemento en edición
|
|
347
|
+
|
|
348
|
+
Cuando se abre el panel de configuración de una fila, una columna o un componente, el elemento correspondiente se resalta visualmente en el editor con un borde ámbar y un halo de sombra. Esto facilita identificar qué elemento se está editando, especialmente en layouts con múltiples filas y columnas.
|
|
349
|
+
|
|
350
|
+
El resaltado desaparece automáticamente al cerrar el panel de configuración.
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
294
354
|
## Build
|
|
295
355
|
|
|
296
356
|
El proyecto tiene dos builds diferentes:
|
|
@@ -18,8 +18,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
18
18
|
removeCol: PropType<(rowIndex: number, colIndex: number, section: string) => void>;
|
|
19
19
|
moveCol: PropType<(rowIndex: number, colIndex: number, section: string, direction?: "left" | "right") => void>;
|
|
20
20
|
moveRow: PropType<(rowIndex: number, section: string, direction?: "up" | "down") => void>;
|
|
21
|
-
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string) => void>;
|
|
22
|
-
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string) => void>;
|
|
21
|
+
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string, backgroundColor: string) => void>;
|
|
22
|
+
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string, backgroundColor: string) => void>;
|
|
23
23
|
renderApiDomain: StringConstructor;
|
|
24
24
|
isProduction: {
|
|
25
25
|
type: BooleanConstructor;
|
|
@@ -39,8 +39,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
39
39
|
removeCol: PropType<(rowIndex: number, colIndex: number, section: string) => void>;
|
|
40
40
|
moveCol: PropType<(rowIndex: number, colIndex: number, section: string, direction?: "left" | "right") => void>;
|
|
41
41
|
moveRow: PropType<(rowIndex: number, section: string, direction?: "up" | "down") => void>;
|
|
42
|
-
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string) => void>;
|
|
43
|
-
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string) => void>;
|
|
42
|
+
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string, backgroundColor: string) => void>;
|
|
43
|
+
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string, backgroundColor: string) => void>;
|
|
44
44
|
renderApiDomain: StringConstructor;
|
|
45
45
|
isProduction: {
|
|
46
46
|
type: BooleanConstructor;
|
|
@@ -9,6 +9,7 @@ interface PageSection {
|
|
|
9
9
|
width?: string;
|
|
10
10
|
gap?: string;
|
|
11
11
|
flexDirection?: string;
|
|
12
|
+
backgroundColor?: string;
|
|
12
13
|
};
|
|
13
14
|
components: any[];
|
|
14
15
|
}>;
|
|
@@ -26,7 +27,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
26
27
|
};
|
|
27
28
|
fullwidthMode: BooleanConstructor;
|
|
28
29
|
addCol: PropType<(rowIndex: number, colIndex: number, section: string, direction?: "left" | "right") => void>;
|
|
29
|
-
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string) => void>;
|
|
30
|
+
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string, backgroundColor: string) => void>;
|
|
30
31
|
removeCol: PropType<(rowIndex: number, colIndex: number, section: string) => void>;
|
|
31
32
|
addComponentFunction: PropType<(rowIndex: number, columnIndex: number, section: string) => void>;
|
|
32
33
|
moveCol: PropType<(rowIndex: number, colIndex: number, section: string, direction?: "left" | "right") => void>;
|
|
@@ -36,7 +37,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
36
37
|
default: boolean;
|
|
37
38
|
};
|
|
38
39
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
39
|
-
"toggle-visibility": (
|
|
40
|
+
"toggle-visibility": () => any;
|
|
41
|
+
"config-open": (value: boolean) => any;
|
|
40
42
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
41
43
|
globalPageConfiguration: PropType<PageSection[]>;
|
|
42
44
|
rowIndex: {
|
|
@@ -49,7 +51,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
49
51
|
};
|
|
50
52
|
fullwidthMode: BooleanConstructor;
|
|
51
53
|
addCol: PropType<(rowIndex: number, colIndex: number, section: string, direction?: "left" | "right") => void>;
|
|
52
|
-
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string) => void>;
|
|
54
|
+
updateColConfig: PropType<(rowIndex: number, columnIndex: number, section: string, width: string, gap: string, flexDirection: string, backgroundColor: string) => void>;
|
|
53
55
|
removeCol: PropType<(rowIndex: number, colIndex: number, section: string) => void>;
|
|
54
56
|
addComponentFunction: PropType<(rowIndex: number, columnIndex: number, section: string) => void>;
|
|
55
57
|
moveCol: PropType<(rowIndex: number, colIndex: number, section: string, direction?: "left" | "right") => void>;
|
|
@@ -59,7 +61,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
59
61
|
default: boolean;
|
|
60
62
|
};
|
|
61
63
|
}>> & Readonly<{
|
|
62
|
-
"onToggle-visibility"?: ((
|
|
64
|
+
"onToggle-visibility"?: (() => any) | undefined;
|
|
65
|
+
"onConfig-open"?: ((value: boolean) => any) | undefined;
|
|
63
66
|
}>, {
|
|
64
67
|
fullwidthMode: boolean;
|
|
65
68
|
isHidden: boolean;
|
|
@@ -48,6 +48,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
48
48
|
saveButtonAction: () => void;
|
|
49
49
|
loadFromLocalStorage: () => void;
|
|
50
50
|
toggleExpandScreen: () => void;
|
|
51
|
+
scrollToTop: () => void;
|
|
51
52
|
sectionWidth: import('vue').WritableComputedRef<string, string>;
|
|
52
53
|
isSaved: import('vue').Ref<boolean, boolean>;
|
|
53
54
|
componentRoot: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
@@ -4,6 +4,8 @@ type __VLS_Props = {
|
|
|
4
4
|
submitForm?: boolean;
|
|
5
5
|
inputId?: string | null;
|
|
6
6
|
excludeComponentTypes?: string[];
|
|
7
|
+
excludeComponentTags?: string[];
|
|
8
|
+
includeOnlyComponentTags?: string[];
|
|
7
9
|
/** Modo de renderizado permitido. 'open' = el usuario puede elegir (defecto), 'fullpage' = forzado página completa, 'onlybody' = forzado solo body */
|
|
8
10
|
allowRenderMode?: 'open' | 'fullpage' | 'onlybody';
|
|
9
11
|
/** Secciones visibles. Si no se indica, se muestran todas: Header, Body, Footer, Sidebar */
|
|
@@ -7,6 +7,7 @@ interface PageSection {
|
|
|
7
7
|
padding?: string;
|
|
8
8
|
gap?: string;
|
|
9
9
|
width?: string;
|
|
10
|
+
backgroundColor?: string;
|
|
10
11
|
};
|
|
11
12
|
columns: any[];
|
|
12
13
|
}>;
|
|
@@ -16,22 +17,26 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
16
17
|
type: NumberConstructor;
|
|
17
18
|
required: true;
|
|
18
19
|
};
|
|
19
|
-
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string) => void>;
|
|
20
|
+
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string, backgroundColor: string) => void>;
|
|
20
21
|
removeRow: PropType<(index: number, section: string) => void>;
|
|
21
22
|
addRow: PropType<(index: number | null, section: string) => void>;
|
|
22
23
|
globalPageConfiguration: PropType<PageSection[]>;
|
|
23
24
|
section: StringConstructor;
|
|
24
25
|
moveRow: PropType<(rowIndex: number, section: string, direction: "up" | "down") => void>;
|
|
25
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
27
|
+
"config-open": (value: boolean) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
26
29
|
rowIndex: {
|
|
27
30
|
type: NumberConstructor;
|
|
28
31
|
required: true;
|
|
29
32
|
};
|
|
30
|
-
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string) => void>;
|
|
33
|
+
updateRowConfig: PropType<(rowIndex: number, section: string, padding: string, gap: string, width: string, backgroundColor: string) => void>;
|
|
31
34
|
removeRow: PropType<(index: number, section: string) => void>;
|
|
32
35
|
addRow: PropType<(index: number | null, section: string) => void>;
|
|
33
36
|
globalPageConfiguration: PropType<PageSection[]>;
|
|
34
37
|
section: StringConstructor;
|
|
35
38
|
moveRow: PropType<(rowIndex: number, section: string, direction: "up" | "down") => void>;
|
|
36
|
-
}>> & Readonly<{
|
|
39
|
+
}>> & Readonly<{
|
|
40
|
+
"onConfig-open"?: ((value: boolean) => any) | undefined;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
37
42
|
export default _default;
|