lf-pagebuilder-vue 0.0.40 → 0.0.42

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 CHANGED
@@ -2,6 +2,86 @@
2
2
 
3
3
  Editor visual para construir páginas HTML usando los componentes de `libreria-astro-lefebvre`.
4
4
 
5
+ ---
6
+
7
+ ## ⚡ Referencia rápida — Todas las opciones
8
+
9
+ ### Modo 1 — Componente Vue
10
+
11
+ ```bash
12
+ npm install lf-pagebuilder-vue
13
+ ```
14
+
15
+ ```vue
16
+ <template>
17
+ <Pagebuilder
18
+ :isProduction="false"
19
+ :debugMode="false"
20
+ :submitForm="false"
21
+ inputId="mi-input-hidden"
22
+ :excludeComponentTypes="['SEO', 'Footer']"
23
+ :visibleSections="['Header', 'Body', 'Footer']"
24
+ allowRenderMode="open"
25
+ limboToken="eyJ..."
26
+ client:only="vue"
27
+ />
28
+ </template>
29
+
30
+ <script setup>
31
+ import { Pagebuilder } from 'lf-pagebuilder-vue';
32
+ import 'lf-pagebuilder-vue/styles';
33
+ </script>
34
+ ```
35
+
36
+ | Prop | Tipo | Default | Descripción |
37
+ |------|------|---------|-------------|
38
+ | `isProduction` | `boolean` | `false` | `true` = API producción · `false` = API desarrollo |
39
+ | `debugMode` | `boolean` | `false` | Muestra panel de import/export JSON y botón de carga desde localStorage |
40
+ | `submitForm` | `boolean` | `false` | Al guardar, busca el `<form>` padre y hace `.submit()` automáticamente |
41
+ | `inputId` | `string \| null` | `null` | ID del `<input hidden>` donde se vuelca el JSON de configuración al guardar |
42
+ | `excludeComponentTypes` | `string[]` | `[]` | Categorías de componentes que NO aparecerán en el selector. "Repetidor" siempre se excluye. |
43
+ | `visibleSections` | `string[]` | — | Secciones visibles. Si no se indica, se muestran todas. Valores posibles: `Header`, `Body`, `Footer`, `Sidebar` |
44
+ | `allowRenderMode` | `'open' \| 'fullpage' \| 'onlybody'` | `'open'` | Controla el modo de renderizado. `open` = el usuario elige · `fullpage` = forzado página completa · `onlybody` = forzado solo body |
45
+ | `limboToken` | `string` | — | Token JWT para el gestor de imágenes Limbo. Obtenerlo server-side con `fetchLimboToken()` |
46
+
47
+ > **Categorías disponibles para `excludeComponentTypes`:**
48
+ > `Call to Action`, `Contenido`, `Separador`, `Texto`, `Cabecera`, `Footer`, `Imagen`, `Repetidor`, `Formulario`, `Título`, `SEO`
49
+
50
+ ---
51
+
52
+ ### Modo 2 — Script IIFE (Symfony / Twig / cualquier backend)
53
+
54
+ ```html
55
+ <link rel="stylesheet" href="/build/lf-pagebuilder-iife.css">
56
+ <script src="/build/lf-pagebuilder-iife.iife.js"></script>
57
+
58
+ <input
59
+ type="hidden"
60
+ class="js-lf-pagebuilder-vue-input"
61
+ name="page_config"
62
+ id="mi-input"
63
+ data-is-production="false"
64
+ data-debug-mode="false"
65
+ data-submit-form="false"
66
+ data-exclude-component-types="SEO,Footer,Cabecera"
67
+ data-visible-sections="Header,Body,Footer"
68
+ data-allow-render-mode="open"
69
+ />
70
+ ```
71
+
72
+ | Atributo `data-*` | Valores | Default | Descripción |
73
+ |-------------------|---------|---------|-------------|
74
+ | `data-is-production` | `"true"` \| `"false"` | `"false"` | Entorno de la API de renderizado |
75
+ | `data-debug-mode` | `"true"` \| `"false"` | `"false"` | Muestra panel de import/export JSON y botón de carga desde localStorage |
76
+ | `data-submit-form` | `"true"` \| `"false"` | `"false"` | Al guardar, busca el `<form>` padre y hace `.submit()` automáticamente |
77
+ | `data-exclude-component-types` | `string` (separado por comas) | — | Categorías de componentes a excluir. Ej: `"SEO,Footer,Cabecera"` |
78
+ | `data-visible-sections` | `string` (separado por comas) | — | Secciones visibles. Si no se indica, se muestran todas. Ej: `"Header,Body"` |
79
+ | `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
+
81
+ > El `id` del input se usa como clave de localStorage y como referencia interna. Si no tiene `id`, se genera uno automáticamente.
82
+
83
+ ---
84
+
5
85
  ## Instalación
6
86
 
7
87
  ```bash
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface PageSection {
3
4
  section: string;
4
5
  config: any;
@@ -47,8 +48,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
47
48
  default: boolean;
48
49
  };
49
50
  }>> & Readonly<{}>, {
51
+ isProduction: boolean;
50
52
  isComponentMode: boolean;
51
53
  fullwidthMode: boolean;
52
- isProduction: boolean;
53
54
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
54
55
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface PageSection {
3
4
  section: string;
4
5
  config: any;
@@ -3,7 +3,7 @@ interface ColumnToInsert {
3
3
  columnIndex: number | null;
4
4
  section: string | null;
5
5
  }
6
- type __VLS_Props = {
6
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
7
  isComponentMode: boolean;
8
8
  fullwidthMode: boolean;
9
9
  columnToInsert: ColumnToInsert;
@@ -13,6 +13,24 @@ type __VLS_Props = {
13
13
  isProduction: boolean;
14
14
  components: Record<string, any>;
15
15
  excludedCategories?: string[];
16
- };
17
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
17
+ isComponentMode: boolean;
18
+ fullwidthMode: boolean;
19
+ columnToInsert: ColumnToInsert;
20
+ addComponentToColumn: (component: any) => void;
21
+ renderApiDomain: string;
22
+ toggleComponentModeFunction: () => void;
23
+ isProduction: boolean;
24
+ components: Record<string, any>;
25
+ excludedCategories?: string[];
26
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
27
  export default _default;
28
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
29
+ type __VLS_TypePropsToRuntimeProps<T> = {
30
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
31
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
32
+ } : {
33
+ type: import('vue').PropType<T[K]>;
34
+ required: true;
35
+ };
36
+ };
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface ComponentField {
3
4
  name: string;
4
5
  label: string;
@@ -67,5 +68,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
67
68
  };
68
69
  }>> & Readonly<{}>, {
69
70
  isProduction: boolean;
70
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
71
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
71
72
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface ComponentField {
3
4
  name: string;
4
5
  label: string;
@@ -33,9 +34,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
33
34
  type: BooleanConstructor;
34
35
  default: boolean;
35
36
  };
36
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
37
- fieldUpdated: (fieldName: string, value: string | boolean) => any;
38
- exclusiveFieldChanged: (groupName: string, activeFieldName: string) => any;
37
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
38
+ fieldUpdated: (fieldName: string, value: string | boolean) => void;
39
+ exclusiveFieldChanged: (groupName: string, activeFieldName: string) => void;
39
40
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
40
41
  object: {
41
42
  type: PropType<ComponentObject>;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface PageSection {
3
4
  section: string;
4
5
  config: {
@@ -34,6 +35,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
34
35
  parametersPageConfiguration: PropType<PageParameters>;
35
36
  renderApiDomain: StringConstructor;
36
37
  inputId: PropType<string | null>;
38
+ allowRenderMode: {
39
+ type: PropType<"open" | "fullpage" | "onlybody">;
40
+ default: string;
41
+ };
37
42
  }>, {
38
43
  validateSeo: () => void;
39
44
  importConfig: import('vue').Ref<string, string>;
@@ -61,6 +66,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
61
66
  parametersPageConfiguration: PropType<PageParameters>;
62
67
  renderApiDomain: StringConstructor;
63
68
  inputId: PropType<string | null>;
69
+ allowRenderMode: {
70
+ type: PropType<"open" | "fullpage" | "onlybody">;
71
+ default: string;
72
+ };
64
73
  }>> & Readonly<{
65
74
  "onUpdate:sectionSelected"?: ((...args: any[]) => any) | undefined;
66
75
  "onUpdate:parametersPageConfiguration.global.sidebarEnabled"?: ((...args: any[]) => any) | undefined;
@@ -76,5 +85,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
76
85
  fullwidthMode: boolean;
77
86
  debugMode: boolean;
78
87
  submitForm: boolean;
88
+ allowRenderMode: "open" | "fullpage" | "onlybody";
79
89
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
80
90
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface ComponentField {
3
4
  name: string;
4
5
  label: string;
@@ -85,11 +86,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
85
86
  default: boolean;
86
87
  };
87
88
  }>> & Readonly<{}>, {
89
+ isProduction: boolean;
88
90
  isComponentMode: boolean;
89
91
  fullwidthMode: boolean;
90
- isProduction: boolean;
91
92
  insideComponentBox: boolean;
92
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
93
- rootElement: HTMLDivElement;
94
- }, HTMLDivElement>;
93
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
95
94
  export default _default;
@@ -1,11 +1,35 @@
1
- type __VLS_Props = {
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
2
  isProduction?: boolean;
3
3
  debugMode?: boolean;
4
4
  submitForm?: boolean;
5
5
  inputId?: string | null;
6
6
  excludeComponentTypes?: string[];
7
+ /** Modo de renderizado permitido. 'open' = el usuario puede elegir (defecto), 'fullpage' = forzado página completa, 'onlybody' = forzado solo body */
8
+ allowRenderMode?: "open" | "fullpage" | "onlybody";
9
+ /** Secciones visibles. Si no se indica, se muestran todas: Header, Body, Footer, Sidebar */
10
+ visibleSections?: string[];
7
11
  /** Token JWT de Limbo - obtenido server-side con fetchLimboToken() */
8
12
  limboToken?: string;
9
- };
10
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
13
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
14
+ isProduction?: boolean;
15
+ debugMode?: boolean;
16
+ submitForm?: boolean;
17
+ inputId?: string | null;
18
+ excludeComponentTypes?: string[];
19
+ /** Modo de renderizado permitido. 'open' = el usuario puede elegir (defecto), 'fullpage' = forzado página completa, 'onlybody' = forzado solo body */
20
+ allowRenderMode?: "open" | "fullpage" | "onlybody";
21
+ /** Secciones visibles. Si no se indica, se muestran todas: Header, Body, Footer, Sidebar */
22
+ visibleSections?: string[];
23
+ /** Token JWT de Limbo - obtenido server-side con fetchLimboToken() */
24
+ limboToken?: string;
25
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
11
26
  export default _default;
27
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
28
+ type __VLS_TypePropsToRuntimeProps<T> = {
29
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
30
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
31
+ } : {
32
+ type: import('vue').PropType<T[K]>;
33
+ required: true;
34
+ };
35
+ };
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface PageSection {
3
4
  section: string;
4
5
  config: any;
@@ -1,4 +1,5 @@
1
1
  import { PropType } from 'vue';
2
+
2
3
  interface FeedCriteria {
3
4
  name: string;
4
5
  url: string;
@@ -31,5 +32,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
31
32
  };
32
33
  }>> & Readonly<{}>, {
33
34
  isProduction: boolean;
34
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
35
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
35
36
  export default _default;