veo-sdk 0.5.33 → 0.6.0
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/dist/builder-3QPHB2VJ.mjs +5 -0
- package/dist/{builder-MUTQMYAH.mjs.map → builder-3QPHB2VJ.mjs.map} +1 -1
- package/dist/builder.cjs +2470 -577
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.d.cts +92 -4
- package/dist/builder.d.ts +92 -4
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-FZ72JUAR.mjs → chunk-GMXQMZ4X.mjs} +123 -27
- package/dist/chunk-GMXQMZ4X.mjs.map +1 -0
- package/dist/{chunk-3ZOKCQ54.mjs → chunk-N4VFMZFA.mjs} +917 -44
- package/dist/chunk-N4VFMZFA.mjs.map +1 -0
- package/dist/{chunk-M6PB5UMW.mjs → chunk-O6USA4TU.mjs} +1133 -99
- package/dist/chunk-O6USA4TU.mjs.map +1 -0
- package/dist/{guide-preview-C73rKO0u.d.cts → guide-preview-DylsEhrg.d.cts} +109 -6
- package/dist/{guide-preview-C73rKO0u.d.ts → guide-preview-DylsEhrg.d.ts} +109 -6
- package/dist/index.cjs +2213 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +5 -5
- package/dist/veo-builder.js +261 -28
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +228 -16
- package/dist/veo-guides.js.map +1 -1
- package/package.json +1 -1
- package/dist/builder-MUTQMYAH.mjs +0 -5
- package/dist/chunk-3ZOKCQ54.mjs.map +0 -1
- package/dist/chunk-FZ72JUAR.mjs.map +0 -1
- package/dist/chunk-M6PB5UMW.mjs.map +0 -1
|
@@ -18,6 +18,13 @@ interface FormField {
|
|
|
18
18
|
options?: string[] | null;
|
|
19
19
|
required?: boolean | null;
|
|
20
20
|
placeholder?: string | null;
|
|
21
|
+
/** Escala numérica (`nps`): rango de valores (default 0..10, máx. 11 valores). */
|
|
22
|
+
min?: number | null;
|
|
23
|
+
max?: number | null;
|
|
24
|
+
/** Escala: etiqueta por valor (índice = valor − min); vacías se omiten. */
|
|
25
|
+
scaleLabels?: string[] | null;
|
|
26
|
+
/** Escala: mostrar las etiquetas de los extremos bajo las casillas (default true). */
|
|
27
|
+
showLabels?: boolean | null;
|
|
21
28
|
}
|
|
22
29
|
type CustomPlacementMode = 'floating' | 'anchored';
|
|
23
30
|
type CustomFloatingPosition = 'top-left' | 'top-center' | 'top-right' | 'center' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
@@ -34,13 +41,28 @@ interface CustomPlacement {
|
|
|
34
41
|
height?: number | string;
|
|
35
42
|
}
|
|
36
43
|
type UrlMatchType = 'exact' | 'prefix' | 'regex';
|
|
37
|
-
type ActivationTrigger = 'immediate' | 'on_element' | 'on_event' | 'delayed' | 'on_click' | 'on_hover';
|
|
44
|
+
type ActivationTrigger = 'immediate' | 'on_element' | 'on_event' | 'delayed' | 'on_click' | 'on_hover' | 'manual';
|
|
38
45
|
type CtaAction = 'dismiss' | 'next' | 'url' | 'guide';
|
|
39
46
|
/**
|
|
40
47
|
* Acciones de un bloque `button` en el modelo unificado (estilo Pendo). Superset
|
|
41
48
|
* de `CtaAction`: agrega navegación (prev) y envío de formularios del paso.
|
|
42
49
|
*/
|
|
43
|
-
type ButtonAction = 'dismiss' | 'next' | 'prev'
|
|
50
|
+
type ButtonAction = 'dismiss' | 'next' | 'prev'
|
|
51
|
+
/** Ir a un paso concreto (`targetStep`). */
|
|
52
|
+
| 'goto'
|
|
53
|
+
/** Posponer la guía `snoozeEvery` `snoozeUnit`: se cierra y no vuelve hasta entonces. */
|
|
54
|
+
| 'snooze' | 'url' | 'guide' | 'submit-forms' | 'submit-forms-advance' | 'submit-forms-goto';
|
|
55
|
+
type SnoozeUnit = 'hour' | 'day' | 'week';
|
|
56
|
+
/** Configuración de una acción de botón (la principal vive en el bloque; `secondAction` es otra igual). */
|
|
57
|
+
interface ButtonActionSpec {
|
|
58
|
+
action?: ButtonAction | null;
|
|
59
|
+
url?: string | null;
|
|
60
|
+
newTab?: boolean | null;
|
|
61
|
+
targetGuideId?: string | null;
|
|
62
|
+
targetStep?: number | null;
|
|
63
|
+
snoozeEvery?: number | null;
|
|
64
|
+
snoozeUnit?: SnoozeUnit | null;
|
|
65
|
+
}
|
|
44
66
|
interface UrlMatcher {
|
|
45
67
|
type: UrlMatchType;
|
|
46
68
|
pattern: string;
|
|
@@ -68,6 +90,12 @@ interface ActivationRules {
|
|
|
68
90
|
selector?: string;
|
|
69
91
|
eventName?: string;
|
|
70
92
|
delayMs?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Con `on_click`/`on_hover`: además de abrirse al interactuar con el
|
|
95
|
+
* elemento objetivo, la guía arranca sola al cargar (Automático + Elemento
|
|
96
|
+
* objetivo). `delayMs` aplica a ese arranque automático.
|
|
97
|
+
*/
|
|
98
|
+
autoShow?: boolean | null;
|
|
71
99
|
repeat?: ActivationRepeat | null;
|
|
72
100
|
/** En qué dispositivos se muestra; lo filtra el SDK (`isDeviceAllowed`). */
|
|
73
101
|
devices?: ActivationDevices | null;
|
|
@@ -77,7 +105,30 @@ interface ActivationRules {
|
|
|
77
105
|
targetBase?: string | null;
|
|
78
106
|
}
|
|
79
107
|
/** Tipo de un bloque de contenido (para pasos con varios títulos/textos/botones). */
|
|
80
|
-
type StepBlockType = 'title' | 'text' | 'button' | 'image' | 'code' | 'form';
|
|
108
|
+
type StepBlockType = 'title' | 'text' | 'button' | 'image' | 'video' | 'divider' | 'code' | 'form' | 'checklist';
|
|
109
|
+
/** Ítem de una lista de tareas (bloque `checklist`): cada tarea ES una guía. */
|
|
110
|
+
interface ChecklistItem {
|
|
111
|
+
guideId: string;
|
|
112
|
+
/** Texto visible (default: nombre de la guía). */
|
|
113
|
+
text?: string | null;
|
|
114
|
+
}
|
|
115
|
+
/** Progreso de un usuario en una guía (`GET /v1/guides/progress`). */
|
|
116
|
+
interface GuideProgressItem {
|
|
117
|
+
guideId: string;
|
|
118
|
+
guideName: string;
|
|
119
|
+
totalSteps: number;
|
|
120
|
+
/** Pasos hechos (un paso visto cuenta como hecho). */
|
|
121
|
+
currentStep: number;
|
|
122
|
+
completed: boolean;
|
|
123
|
+
/** `false` solo en preview del editor (guía aún no publicada). */
|
|
124
|
+
published?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** `file` = video subido al almacenamiento de OnUser: se reproduce con <video>, no con iframe. */
|
|
127
|
+
/**
|
|
128
|
+
* Proveedores del bloque video. `msstream` = Microsoft Stream (clásico),
|
|
129
|
+
* `sharepoint` = Microsoft Stream (SharePoint); `file` = archivo propio (R2).
|
|
130
|
+
*/
|
|
131
|
+
type VideoProvider = 'youtube' | 'vimeo' | 'wistia' | 'msstream' | 'sharepoint' | 'brightcove' | 'vidyard' | 'loom' | 'kaltura' | 'file';
|
|
81
132
|
/**
|
|
82
133
|
* Un bloque de contenido dentro de un paso. Permite componer un paso con VARIOS
|
|
83
134
|
* títulos/textos/botones/imágenes en orden (no solo un título + un texto + un
|
|
@@ -95,7 +146,8 @@ interface StepBlock {
|
|
|
95
146
|
/** title/text/button: el texto. En bloques `text` es el FALLBACK de `html`. */
|
|
96
147
|
text?: string | null;
|
|
97
148
|
/**
|
|
98
|
-
*
|
|
149
|
+
* Bloques `text` (contenido) y `form` (la pregunta de la encuesta): rich text
|
|
150
|
+
* con subset whitelisted (negrita/cursiva/
|
|
99
151
|
* links/listas). El backend lo guarda sanitizado; el SDK lo re-valida al
|
|
100
152
|
* renderizar con `renderRichText` (DOMParser inerte + rebuild manual — nunca
|
|
101
153
|
* innerHTML sobre DOM vivo). Si está presente, manda sobre `text`.
|
|
@@ -110,18 +162,50 @@ interface StepBlock {
|
|
|
110
162
|
* sancionada a la regla no-eval (ver CLAUDE.md).
|
|
111
163
|
*/
|
|
112
164
|
sandboxed?: boolean | null;
|
|
165
|
+
/** Bloques `image`: texto alternativo. Bloques `video`: título accesible del reproductor. */
|
|
166
|
+
alt?: string | null;
|
|
167
|
+
/** Bloques `video`: proveedor (la `url` es la del video en ese proveedor). */
|
|
168
|
+
provider?: VideoProvider | null;
|
|
113
169
|
/** Bloques `form`: los campos del formulario (desacoplado del botón). */
|
|
114
170
|
fields?: FormField[] | null;
|
|
171
|
+
/** Bloques `checklist`: las guías de la lista, en orden. */
|
|
172
|
+
items?: ChecklistItem[] | null;
|
|
173
|
+
/**
|
|
174
|
+
* Bloques `form` (encuestas): botón de envío PROPIO del bloque. Es un botón
|
|
175
|
+
* normal (texto/estilo/acciones) que primero envía las respuestas de ESTE
|
|
176
|
+
* bloque y, si el envío fue bien, ejecuta su acción (cerrar, siguiente…).
|
|
177
|
+
* La pregunta va en `html`/`text` del bloque (rich text, como `text`).
|
|
178
|
+
*/
|
|
179
|
+
submit?: StepBlock | null;
|
|
115
180
|
/** image: la URL; button con acción `url`: el destino. */
|
|
116
181
|
url?: string | null;
|
|
182
|
+
/** button `url`: `false` → misma pestaña; default (ausente/true) → pestaña nueva. */
|
|
183
|
+
newTab?: boolean | null;
|
|
184
|
+
/**
|
|
185
|
+
* Layout del paso: fila y columna del bloque. Sin `row`, cada bloque va en su
|
|
186
|
+
* propia fila (apilado). Misma fila + distinta columna = lado a lado.
|
|
187
|
+
*/
|
|
188
|
+
row?: number | null;
|
|
189
|
+
col?: number | null;
|
|
117
190
|
/** button: qué hace al hacer click (composite: `ButtonAction`). */
|
|
118
191
|
action?: ButtonAction | null;
|
|
119
192
|
/** button con acción `guide`: id de la guía que abre (encadenado). */
|
|
120
193
|
targetGuideId?: string | null;
|
|
121
|
-
/** button con acción `submit-forms-goto`: índice del paso destino. */
|
|
194
|
+
/** button con acción `goto` / `submit-forms-goto`: índice del paso destino. */
|
|
122
195
|
targetStep?: number | null;
|
|
196
|
+
/** button con acción `snooze`: cuánto posponer (cantidad + unidad). */
|
|
197
|
+
snoozeEvery?: number | null;
|
|
198
|
+
snoozeUnit?: SnoozeUnit | null;
|
|
199
|
+
/** Segunda acción del botón (máximo dos): se ejecuta después de la principal. */
|
|
200
|
+
secondAction?: ButtonActionSpec | null;
|
|
123
201
|
/** Estilo por-bloque (align/color/fontSize/margin…). Se aplica inline. */
|
|
124
202
|
style?: Record<string, unknown> | null;
|
|
203
|
+
/**
|
|
204
|
+
* Solo editor (preview in-app): id local del bloque en el panel. El renderer
|
|
205
|
+
* lo pone en `data-veo-block-id` para que el builder pueda seleccionar el
|
|
206
|
+
* bloque en la app y el panel abra su editor. No se persiste.
|
|
207
|
+
*/
|
|
208
|
+
editorId?: string | null;
|
|
125
209
|
}
|
|
126
210
|
interface GuideStep {
|
|
127
211
|
title: string;
|
|
@@ -150,6 +234,15 @@ interface GuideStep {
|
|
|
150
234
|
/** Solo guías `form`: los campos del formulario. */
|
|
151
235
|
fields?: FormField[] | null;
|
|
152
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* De dónde salen las respuestas enviadas: la encuesta (id del bloque `form`,
|
|
239
|
+
* si todas las respuestas son de un mismo bloque) y el paso. El backend guarda
|
|
240
|
+
* las respuestas de guías composite POR GUÍA y POR ENCUESTA con este dato.
|
|
241
|
+
*/
|
|
242
|
+
interface FormSubmitMeta {
|
|
243
|
+
pollId?: string;
|
|
244
|
+
stepIndex: number;
|
|
245
|
+
}
|
|
153
246
|
|
|
154
247
|
/** Entrada mínima para previsualizar una guía. */
|
|
155
248
|
interface PreviewGuideInput {
|
|
@@ -173,10 +266,20 @@ interface PreviewGuideInput {
|
|
|
173
266
|
* es un no-op (no escribe props). Lo usa el modo preview-por-link, que sí
|
|
174
267
|
* guarda en el usuario que responde.
|
|
175
268
|
*/
|
|
176
|
-
formSubmit?: (answers: Record<string, unknown
|
|
269
|
+
formSubmit?: (answers: Record<string, unknown>, meta?: FormSubmitMeta) => Promise<boolean>;
|
|
270
|
+
/**
|
|
271
|
+
* Lista de tareas en preview: progreso de las guías de la lista (el editor
|
|
272
|
+
* lo pide al backend con un usuario de preview: nombres y pasos reales,
|
|
273
|
+
* progreso en cero). Sin esto la lista se ve sin subtítulos ni barra.
|
|
274
|
+
*/
|
|
275
|
+
fetchProgress?: (guideIds: string[]) => Promise<GuideProgressItem[]>;
|
|
177
276
|
/** Nota bajo el "¡Gracias!" cuando hay `formSubmit` propio. */
|
|
178
277
|
formSubmitNote?: string;
|
|
179
278
|
/** Modo badge: montar con el tooltip ABIERTO (toggle del editor). */
|
|
279
|
+
/**
|
|
280
|
+
* Badge: tooltip abierto (true) o cerrado (false). Sin definir, se abre si la
|
|
281
|
+
* activación es automática (igual que el runtime).
|
|
282
|
+
*/
|
|
180
283
|
badgeOpen?: boolean;
|
|
181
284
|
/**
|
|
182
285
|
* Se llama cuando el USUARIO cierra la preview (✕ / descartar), no cuando el
|
|
@@ -18,6 +18,13 @@ interface FormField {
|
|
|
18
18
|
options?: string[] | null;
|
|
19
19
|
required?: boolean | null;
|
|
20
20
|
placeholder?: string | null;
|
|
21
|
+
/** Escala numérica (`nps`): rango de valores (default 0..10, máx. 11 valores). */
|
|
22
|
+
min?: number | null;
|
|
23
|
+
max?: number | null;
|
|
24
|
+
/** Escala: etiqueta por valor (índice = valor − min); vacías se omiten. */
|
|
25
|
+
scaleLabels?: string[] | null;
|
|
26
|
+
/** Escala: mostrar las etiquetas de los extremos bajo las casillas (default true). */
|
|
27
|
+
showLabels?: boolean | null;
|
|
21
28
|
}
|
|
22
29
|
type CustomPlacementMode = 'floating' | 'anchored';
|
|
23
30
|
type CustomFloatingPosition = 'top-left' | 'top-center' | 'top-right' | 'center' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
@@ -34,13 +41,28 @@ interface CustomPlacement {
|
|
|
34
41
|
height?: number | string;
|
|
35
42
|
}
|
|
36
43
|
type UrlMatchType = 'exact' | 'prefix' | 'regex';
|
|
37
|
-
type ActivationTrigger = 'immediate' | 'on_element' | 'on_event' | 'delayed' | 'on_click' | 'on_hover';
|
|
44
|
+
type ActivationTrigger = 'immediate' | 'on_element' | 'on_event' | 'delayed' | 'on_click' | 'on_hover' | 'manual';
|
|
38
45
|
type CtaAction = 'dismiss' | 'next' | 'url' | 'guide';
|
|
39
46
|
/**
|
|
40
47
|
* Acciones de un bloque `button` en el modelo unificado (estilo Pendo). Superset
|
|
41
48
|
* de `CtaAction`: agrega navegación (prev) y envío de formularios del paso.
|
|
42
49
|
*/
|
|
43
|
-
type ButtonAction = 'dismiss' | 'next' | 'prev'
|
|
50
|
+
type ButtonAction = 'dismiss' | 'next' | 'prev'
|
|
51
|
+
/** Ir a un paso concreto (`targetStep`). */
|
|
52
|
+
| 'goto'
|
|
53
|
+
/** Posponer la guía `snoozeEvery` `snoozeUnit`: se cierra y no vuelve hasta entonces. */
|
|
54
|
+
| 'snooze' | 'url' | 'guide' | 'submit-forms' | 'submit-forms-advance' | 'submit-forms-goto';
|
|
55
|
+
type SnoozeUnit = 'hour' | 'day' | 'week';
|
|
56
|
+
/** Configuración de una acción de botón (la principal vive en el bloque; `secondAction` es otra igual). */
|
|
57
|
+
interface ButtonActionSpec {
|
|
58
|
+
action?: ButtonAction | null;
|
|
59
|
+
url?: string | null;
|
|
60
|
+
newTab?: boolean | null;
|
|
61
|
+
targetGuideId?: string | null;
|
|
62
|
+
targetStep?: number | null;
|
|
63
|
+
snoozeEvery?: number | null;
|
|
64
|
+
snoozeUnit?: SnoozeUnit | null;
|
|
65
|
+
}
|
|
44
66
|
interface UrlMatcher {
|
|
45
67
|
type: UrlMatchType;
|
|
46
68
|
pattern: string;
|
|
@@ -68,6 +90,12 @@ interface ActivationRules {
|
|
|
68
90
|
selector?: string;
|
|
69
91
|
eventName?: string;
|
|
70
92
|
delayMs?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Con `on_click`/`on_hover`: además de abrirse al interactuar con el
|
|
95
|
+
* elemento objetivo, la guía arranca sola al cargar (Automático + Elemento
|
|
96
|
+
* objetivo). `delayMs` aplica a ese arranque automático.
|
|
97
|
+
*/
|
|
98
|
+
autoShow?: boolean | null;
|
|
71
99
|
repeat?: ActivationRepeat | null;
|
|
72
100
|
/** En qué dispositivos se muestra; lo filtra el SDK (`isDeviceAllowed`). */
|
|
73
101
|
devices?: ActivationDevices | null;
|
|
@@ -77,7 +105,30 @@ interface ActivationRules {
|
|
|
77
105
|
targetBase?: string | null;
|
|
78
106
|
}
|
|
79
107
|
/** Tipo de un bloque de contenido (para pasos con varios títulos/textos/botones). */
|
|
80
|
-
type StepBlockType = 'title' | 'text' | 'button' | 'image' | 'code' | 'form';
|
|
108
|
+
type StepBlockType = 'title' | 'text' | 'button' | 'image' | 'video' | 'divider' | 'code' | 'form' | 'checklist';
|
|
109
|
+
/** Ítem de una lista de tareas (bloque `checklist`): cada tarea ES una guía. */
|
|
110
|
+
interface ChecklistItem {
|
|
111
|
+
guideId: string;
|
|
112
|
+
/** Texto visible (default: nombre de la guía). */
|
|
113
|
+
text?: string | null;
|
|
114
|
+
}
|
|
115
|
+
/** Progreso de un usuario en una guía (`GET /v1/guides/progress`). */
|
|
116
|
+
interface GuideProgressItem {
|
|
117
|
+
guideId: string;
|
|
118
|
+
guideName: string;
|
|
119
|
+
totalSteps: number;
|
|
120
|
+
/** Pasos hechos (un paso visto cuenta como hecho). */
|
|
121
|
+
currentStep: number;
|
|
122
|
+
completed: boolean;
|
|
123
|
+
/** `false` solo en preview del editor (guía aún no publicada). */
|
|
124
|
+
published?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** `file` = video subido al almacenamiento de OnUser: se reproduce con <video>, no con iframe. */
|
|
127
|
+
/**
|
|
128
|
+
* Proveedores del bloque video. `msstream` = Microsoft Stream (clásico),
|
|
129
|
+
* `sharepoint` = Microsoft Stream (SharePoint); `file` = archivo propio (R2).
|
|
130
|
+
*/
|
|
131
|
+
type VideoProvider = 'youtube' | 'vimeo' | 'wistia' | 'msstream' | 'sharepoint' | 'brightcove' | 'vidyard' | 'loom' | 'kaltura' | 'file';
|
|
81
132
|
/**
|
|
82
133
|
* Un bloque de contenido dentro de un paso. Permite componer un paso con VARIOS
|
|
83
134
|
* títulos/textos/botones/imágenes en orden (no solo un título + un texto + un
|
|
@@ -95,7 +146,8 @@ interface StepBlock {
|
|
|
95
146
|
/** title/text/button: el texto. En bloques `text` es el FALLBACK de `html`. */
|
|
96
147
|
text?: string | null;
|
|
97
148
|
/**
|
|
98
|
-
*
|
|
149
|
+
* Bloques `text` (contenido) y `form` (la pregunta de la encuesta): rich text
|
|
150
|
+
* con subset whitelisted (negrita/cursiva/
|
|
99
151
|
* links/listas). El backend lo guarda sanitizado; el SDK lo re-valida al
|
|
100
152
|
* renderizar con `renderRichText` (DOMParser inerte + rebuild manual — nunca
|
|
101
153
|
* innerHTML sobre DOM vivo). Si está presente, manda sobre `text`.
|
|
@@ -110,18 +162,50 @@ interface StepBlock {
|
|
|
110
162
|
* sancionada a la regla no-eval (ver CLAUDE.md).
|
|
111
163
|
*/
|
|
112
164
|
sandboxed?: boolean | null;
|
|
165
|
+
/** Bloques `image`: texto alternativo. Bloques `video`: título accesible del reproductor. */
|
|
166
|
+
alt?: string | null;
|
|
167
|
+
/** Bloques `video`: proveedor (la `url` es la del video en ese proveedor). */
|
|
168
|
+
provider?: VideoProvider | null;
|
|
113
169
|
/** Bloques `form`: los campos del formulario (desacoplado del botón). */
|
|
114
170
|
fields?: FormField[] | null;
|
|
171
|
+
/** Bloques `checklist`: las guías de la lista, en orden. */
|
|
172
|
+
items?: ChecklistItem[] | null;
|
|
173
|
+
/**
|
|
174
|
+
* Bloques `form` (encuestas): botón de envío PROPIO del bloque. Es un botón
|
|
175
|
+
* normal (texto/estilo/acciones) que primero envía las respuestas de ESTE
|
|
176
|
+
* bloque y, si el envío fue bien, ejecuta su acción (cerrar, siguiente…).
|
|
177
|
+
* La pregunta va en `html`/`text` del bloque (rich text, como `text`).
|
|
178
|
+
*/
|
|
179
|
+
submit?: StepBlock | null;
|
|
115
180
|
/** image: la URL; button con acción `url`: el destino. */
|
|
116
181
|
url?: string | null;
|
|
182
|
+
/** button `url`: `false` → misma pestaña; default (ausente/true) → pestaña nueva. */
|
|
183
|
+
newTab?: boolean | null;
|
|
184
|
+
/**
|
|
185
|
+
* Layout del paso: fila y columna del bloque. Sin `row`, cada bloque va en su
|
|
186
|
+
* propia fila (apilado). Misma fila + distinta columna = lado a lado.
|
|
187
|
+
*/
|
|
188
|
+
row?: number | null;
|
|
189
|
+
col?: number | null;
|
|
117
190
|
/** button: qué hace al hacer click (composite: `ButtonAction`). */
|
|
118
191
|
action?: ButtonAction | null;
|
|
119
192
|
/** button con acción `guide`: id de la guía que abre (encadenado). */
|
|
120
193
|
targetGuideId?: string | null;
|
|
121
|
-
/** button con acción `submit-forms-goto`: índice del paso destino. */
|
|
194
|
+
/** button con acción `goto` / `submit-forms-goto`: índice del paso destino. */
|
|
122
195
|
targetStep?: number | null;
|
|
196
|
+
/** button con acción `snooze`: cuánto posponer (cantidad + unidad). */
|
|
197
|
+
snoozeEvery?: number | null;
|
|
198
|
+
snoozeUnit?: SnoozeUnit | null;
|
|
199
|
+
/** Segunda acción del botón (máximo dos): se ejecuta después de la principal. */
|
|
200
|
+
secondAction?: ButtonActionSpec | null;
|
|
123
201
|
/** Estilo por-bloque (align/color/fontSize/margin…). Se aplica inline. */
|
|
124
202
|
style?: Record<string, unknown> | null;
|
|
203
|
+
/**
|
|
204
|
+
* Solo editor (preview in-app): id local del bloque en el panel. El renderer
|
|
205
|
+
* lo pone en `data-veo-block-id` para que el builder pueda seleccionar el
|
|
206
|
+
* bloque en la app y el panel abra su editor. No se persiste.
|
|
207
|
+
*/
|
|
208
|
+
editorId?: string | null;
|
|
125
209
|
}
|
|
126
210
|
interface GuideStep {
|
|
127
211
|
title: string;
|
|
@@ -150,6 +234,15 @@ interface GuideStep {
|
|
|
150
234
|
/** Solo guías `form`: los campos del formulario. */
|
|
151
235
|
fields?: FormField[] | null;
|
|
152
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* De dónde salen las respuestas enviadas: la encuesta (id del bloque `form`,
|
|
239
|
+
* si todas las respuestas son de un mismo bloque) y el paso. El backend guarda
|
|
240
|
+
* las respuestas de guías composite POR GUÍA y POR ENCUESTA con este dato.
|
|
241
|
+
*/
|
|
242
|
+
interface FormSubmitMeta {
|
|
243
|
+
pollId?: string;
|
|
244
|
+
stepIndex: number;
|
|
245
|
+
}
|
|
153
246
|
|
|
154
247
|
/** Entrada mínima para previsualizar una guía. */
|
|
155
248
|
interface PreviewGuideInput {
|
|
@@ -173,10 +266,20 @@ interface PreviewGuideInput {
|
|
|
173
266
|
* es un no-op (no escribe props). Lo usa el modo preview-por-link, que sí
|
|
174
267
|
* guarda en el usuario que responde.
|
|
175
268
|
*/
|
|
176
|
-
formSubmit?: (answers: Record<string, unknown
|
|
269
|
+
formSubmit?: (answers: Record<string, unknown>, meta?: FormSubmitMeta) => Promise<boolean>;
|
|
270
|
+
/**
|
|
271
|
+
* Lista de tareas en preview: progreso de las guías de la lista (el editor
|
|
272
|
+
* lo pide al backend con un usuario de preview: nombres y pasos reales,
|
|
273
|
+
* progreso en cero). Sin esto la lista se ve sin subtítulos ni barra.
|
|
274
|
+
*/
|
|
275
|
+
fetchProgress?: (guideIds: string[]) => Promise<GuideProgressItem[]>;
|
|
177
276
|
/** Nota bajo el "¡Gracias!" cuando hay `formSubmit` propio. */
|
|
178
277
|
formSubmitNote?: string;
|
|
179
278
|
/** Modo badge: montar con el tooltip ABIERTO (toggle del editor). */
|
|
279
|
+
/**
|
|
280
|
+
* Badge: tooltip abierto (true) o cerrado (false). Sin definir, se abre si la
|
|
281
|
+
* activación es automática (igual que el runtime).
|
|
282
|
+
*/
|
|
180
283
|
badgeOpen?: boolean;
|
|
181
284
|
/**
|
|
182
285
|
* Se llama cuando el USUARIO cierra la preview (✕ / descartar), no cuando el
|