veo-sdk 0.6.2 → 0.6.3

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.
@@ -85,6 +85,14 @@ interface ElementPickerOptions {
85
85
  hint?: string;
86
86
  /** Subtítulo del banner (default: cómo abrir menús con Alt + clic). */
87
87
  subhint?: string;
88
+ /**
89
+ * `'interactive'`: solo se pueden elegir elementos interactivos (botones,
90
+ * enlaces, campos, formularios, controles ARIA…); al pasar sobre un hijo
91
+ * (p. ej. el `<span>` de un botón) se resalta el control que lo contiene, y
92
+ * sobre zonas no interactivas no se resalta ni se puede elegir nada.
93
+ * Default: cualquier elemento (anclas de guías).
94
+ */
95
+ only?: 'interactive';
88
96
  }
89
97
  interface ElementPickerHandle {
90
98
  /** Cierra el picker sin elegir nada. Idempotente. */
@@ -127,6 +135,14 @@ declare function stopElementPicker(): void;
127
135
  * de verdad; el chrome solo lo refleja y devuelve `chrome-action`s.
128
136
  */
129
137
  interface EditorChromeState {
138
+ /**
139
+ * `tagging` = «Modo tagging» (panel de features): solo la topbar, con ese
140
+ * título y sin fila de pasos, vista previa ni Guardar (cada tag se guarda al
141
+ * crearse). Default `guide` = editor de guías.
142
+ */
143
+ variant?: 'guide' | 'tagging';
144
+ /** Título del header de la tarjeta; si falta, el SDK lo deriva de la sección. */
145
+ panelTitle?: string;
130
146
  guideName: string;
131
147
  /** ISO de creación (null = guía nueva sin guardar). */
132
148
  createdAt: string | null;
@@ -286,16 +302,75 @@ type BuilderEvent = {
286
302
  } | {
287
303
  type: 'preview-status';
288
304
  payload: PreviewStatus;
305
+ }
306
+ /** Respuesta a `scan-page`: elementos clickeables de la página y qué selectores dados existen en ella. */
307
+ | {
308
+ type: 'page-scan';
309
+ payload: PageScan;
310
+ }
311
+ /** El autor cerró el modal de `show-confirmation`. */
312
+ | {
313
+ type: 'confirmation-closed';
289
314
  } | {
290
315
  type: 'closed';
291
316
  };
317
+ /**
318
+ * Modal de confirmación que el SDK pinta CENTRADO sobre la app del cliente
319
+ * (mock «Feature tagueada»): check verde, título, mensaje, filas
320
+ * label/valor y un botón que lo cierra. Mientras está abierto el panel se
321
+ * oculta; al cerrarlo el SDK postea `confirmation-closed`.
322
+ */
323
+ interface ConfirmationCard {
324
+ title: string;
325
+ message: string;
326
+ rows: Array<{
327
+ label: string;
328
+ value: string;
329
+ }>;
330
+ /** Texto del botón. Default «Listo». */
331
+ buttonLabel?: string;
332
+ }
333
+ /** Un elemento clickeable de la página (candidato a feature), sin `rect`. */
334
+ type PageElement = Omit<PickedElement, 'rect'>;
335
+ interface PageScan {
336
+ /** `location.pathname`: el mismo valor que `$page_path` de autocapture (restricción «Solo en esta página»). */
337
+ pagePath: string;
338
+ /**
339
+ * Ruta «humana» de la app: en apps con hash routing (`/#/settings`) incluye
340
+ * el hash; si no, es igual a `pagePath`. Para mostrar y para la foto del
341
+ * elemento, NO para contar (autocapture no lleva el hash).
342
+ */
343
+ routePath: string;
344
+ /** Elementos clickeables visibles que NO matchean ninguno de los `selectors` pedidos. */
345
+ candidates: PageElement[];
346
+ /** De los `selectors` pedidos, cuáles existen en esta página. */
347
+ present: string[];
348
+ }
292
349
  /** Comandos que el dashboard/panel envía a la app del cliente. */
293
- type BuilderCommand = {
350
+ type BuilderCommand =
351
+ /** `only: 'interactive'` (features): solo botones/enlaces/campos/formularios… (ver `ElementPickerOptions.only`). */
352
+ {
294
353
  type: 'start-picker';
295
354
  maxAncestors?: number;
296
355
  hint?: string;
356
+ only?: 'interactive';
297
357
  } | {
298
358
  type: 'stop-picker';
359
+ }
360
+ /** Panel de features: inventario de la página actual (ver `PageScan`). */
361
+ | {
362
+ type: 'scan-page';
363
+ selectors: string[];
364
+ }
365
+ /** Resalta (o deja de resaltar) un elemento por selector, sin entrar en modo picker. */
366
+ | {
367
+ type: 'highlight';
368
+ selector: string | null;
369
+ }
370
+ /** Modal de confirmación centrado sobre la app (ver `ConfirmationCard`). */
371
+ | {
372
+ type: 'show-confirmation';
373
+ payload: ConfirmationCard;
299
374
  } | {
300
375
  type: 'preview';
301
376
  guide: PreviewGuideInput;
@@ -360,11 +435,6 @@ interface BuilderModeHandle {
360
435
  /** Desconecta el puente y limpia picker/preview/panel. */
361
436
  teardown(): void;
362
437
  }
363
- /**
364
- * Inicializa el modo builder si hay contexto (URL o persistido). Devuelve un
365
- * handle, o `null` si no estamos en modo builder o no hay canal con el editor.
366
- * Es seguro llamarla siempre.
367
- */
368
438
  declare function initBuilderMode(): BuilderModeHandle | null;
369
439
 
370
440
  interface BuilderSessionOptions {
package/dist/builder.d.ts CHANGED
@@ -85,6 +85,14 @@ interface ElementPickerOptions {
85
85
  hint?: string;
86
86
  /** Subtítulo del banner (default: cómo abrir menús con Alt + clic). */
87
87
  subhint?: string;
88
+ /**
89
+ * `'interactive'`: solo se pueden elegir elementos interactivos (botones,
90
+ * enlaces, campos, formularios, controles ARIA…); al pasar sobre un hijo
91
+ * (p. ej. el `<span>` de un botón) se resalta el control que lo contiene, y
92
+ * sobre zonas no interactivas no se resalta ni se puede elegir nada.
93
+ * Default: cualquier elemento (anclas de guías).
94
+ */
95
+ only?: 'interactive';
88
96
  }
89
97
  interface ElementPickerHandle {
90
98
  /** Cierra el picker sin elegir nada. Idempotente. */
@@ -127,6 +135,14 @@ declare function stopElementPicker(): void;
127
135
  * de verdad; el chrome solo lo refleja y devuelve `chrome-action`s.
128
136
  */
129
137
  interface EditorChromeState {
138
+ /**
139
+ * `tagging` = «Modo tagging» (panel de features): solo la topbar, con ese
140
+ * título y sin fila de pasos, vista previa ni Guardar (cada tag se guarda al
141
+ * crearse). Default `guide` = editor de guías.
142
+ */
143
+ variant?: 'guide' | 'tagging';
144
+ /** Título del header de la tarjeta; si falta, el SDK lo deriva de la sección. */
145
+ panelTitle?: string;
130
146
  guideName: string;
131
147
  /** ISO de creación (null = guía nueva sin guardar). */
132
148
  createdAt: string | null;
@@ -286,16 +302,75 @@ type BuilderEvent = {
286
302
  } | {
287
303
  type: 'preview-status';
288
304
  payload: PreviewStatus;
305
+ }
306
+ /** Respuesta a `scan-page`: elementos clickeables de la página y qué selectores dados existen en ella. */
307
+ | {
308
+ type: 'page-scan';
309
+ payload: PageScan;
310
+ }
311
+ /** El autor cerró el modal de `show-confirmation`. */
312
+ | {
313
+ type: 'confirmation-closed';
289
314
  } | {
290
315
  type: 'closed';
291
316
  };
317
+ /**
318
+ * Modal de confirmación que el SDK pinta CENTRADO sobre la app del cliente
319
+ * (mock «Feature tagueada»): check verde, título, mensaje, filas
320
+ * label/valor y un botón que lo cierra. Mientras está abierto el panel se
321
+ * oculta; al cerrarlo el SDK postea `confirmation-closed`.
322
+ */
323
+ interface ConfirmationCard {
324
+ title: string;
325
+ message: string;
326
+ rows: Array<{
327
+ label: string;
328
+ value: string;
329
+ }>;
330
+ /** Texto del botón. Default «Listo». */
331
+ buttonLabel?: string;
332
+ }
333
+ /** Un elemento clickeable de la página (candidato a feature), sin `rect`. */
334
+ type PageElement = Omit<PickedElement, 'rect'>;
335
+ interface PageScan {
336
+ /** `location.pathname`: el mismo valor que `$page_path` de autocapture (restricción «Solo en esta página»). */
337
+ pagePath: string;
338
+ /**
339
+ * Ruta «humana» de la app: en apps con hash routing (`/#/settings`) incluye
340
+ * el hash; si no, es igual a `pagePath`. Para mostrar y para la foto del
341
+ * elemento, NO para contar (autocapture no lleva el hash).
342
+ */
343
+ routePath: string;
344
+ /** Elementos clickeables visibles que NO matchean ninguno de los `selectors` pedidos. */
345
+ candidates: PageElement[];
346
+ /** De los `selectors` pedidos, cuáles existen en esta página. */
347
+ present: string[];
348
+ }
292
349
  /** Comandos que el dashboard/panel envía a la app del cliente. */
293
- type BuilderCommand = {
350
+ type BuilderCommand =
351
+ /** `only: 'interactive'` (features): solo botones/enlaces/campos/formularios… (ver `ElementPickerOptions.only`). */
352
+ {
294
353
  type: 'start-picker';
295
354
  maxAncestors?: number;
296
355
  hint?: string;
356
+ only?: 'interactive';
297
357
  } | {
298
358
  type: 'stop-picker';
359
+ }
360
+ /** Panel de features: inventario de la página actual (ver `PageScan`). */
361
+ | {
362
+ type: 'scan-page';
363
+ selectors: string[];
364
+ }
365
+ /** Resalta (o deja de resaltar) un elemento por selector, sin entrar en modo picker. */
366
+ | {
367
+ type: 'highlight';
368
+ selector: string | null;
369
+ }
370
+ /** Modal de confirmación centrado sobre la app (ver `ConfirmationCard`). */
371
+ | {
372
+ type: 'show-confirmation';
373
+ payload: ConfirmationCard;
299
374
  } | {
300
375
  type: 'preview';
301
376
  guide: PreviewGuideInput;
@@ -360,11 +435,6 @@ interface BuilderModeHandle {
360
435
  /** Desconecta el puente y limpia picker/preview/panel. */
361
436
  teardown(): void;
362
437
  }
363
- /**
364
- * Inicializa el modo builder si hay contexto (URL o persistido). Devuelve un
365
- * handle, o `null` si no estamos en modo builder o no hay canal con el editor.
366
- * Es seguro llamarla siempre.
367
- */
368
438
  declare function initBuilderMode(): BuilderModeHandle | null;
369
439
 
370
440
  interface BuilderSessionOptions {
package/dist/builder.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import './chunk-L3QQJLDJ.mjs';
2
- import { initBuilderMode } from './chunk-4QZDNJJE.mjs';
3
- export { createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-4QZDNJJE.mjs';
4
- export { closeGuidePreview, previewGuide } from './chunk-ZILDR4YE.mjs';
1
+ import './chunk-3JEAPZ6A.mjs';
2
+ import { initBuilderMode } from './chunk-DU6I4ZU2.mjs';
3
+ export { createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-DU6I4ZU2.mjs';
4
+ export { closeGuidePreview, previewGuide } from './chunk-SZCIXA5X.mjs';
5
5
  import './chunk-PTG3BTJE.mjs';
6
6
 
7
7
  // src/builder.ts
@@ -1,4 +1,4 @@
1
- import { hasDocument, hasWindow, isAutomaticActivation, activationDelayMs, clearPreviewToken, DEFAULT_TRACKER_MAX_RETRIES, DEFAULT_TRACKER_BATCH_SIZE, DEFAULT_TRACKER_FLUSH_INTERVAL_MS, isDeviceAllowed, isSnoozed, stepMatchesPage, CompositeRenderer, ModalRenderer, BannerRenderer, WalkthroughRenderer, BadgeRenderer, InlineFormRenderer, FormRenderer, InlineCustomRenderer, InlineRenderer, CustomRenderer, TooltipRenderer, previewGuide, FREQUENCY_CACHE_KEY_PREFIX, FREQUENCY_CACHE_TTL_MS, FREQUENCY_CACHE_MAX_ENTRIES, WALKTHROUGH_STATE_KEY_PREFIX, WALKTHROUGH_ABANDONMENT_TIMEOUT_MS } from './chunk-ZILDR4YE.mjs';
1
+ import { hasDocument, hasWindow, isAutomaticActivation, activationDelayMs, clearPreviewToken, DEFAULT_TRACKER_MAX_RETRIES, DEFAULT_TRACKER_BATCH_SIZE, DEFAULT_TRACKER_FLUSH_INTERVAL_MS, isDeviceAllowed, isSnoozed, stepMatchesPage, CompositeRenderer, ModalRenderer, BannerRenderer, WalkthroughRenderer, BadgeRenderer, InlineFormRenderer, FormRenderer, InlineCustomRenderer, InlineRenderer, CustomRenderer, TooltipRenderer, previewGuide, FREQUENCY_CACHE_KEY_PREFIX, FREQUENCY_CACHE_TTL_MS, FREQUENCY_CACHE_MAX_ENTRIES, WALKTHROUGH_STATE_KEY_PREFIX, WALKTHROUGH_ABANDONMENT_TIMEOUT_MS } from './chunk-SZCIXA5X.mjs';
2
2
 
3
3
  // src/plugins/plugin.ts
4
4
  function definePlugin(plugin) {
@@ -1616,5 +1616,5 @@ function guidesPlugin(config) {
1616
1616
  }
1617
1617
 
1618
1618
  export { definePlugin, guidesPlugin, runPreviewMode };
1619
- //# sourceMappingURL=chunk-L3QQJLDJ.mjs.map
1620
- //# sourceMappingURL=chunk-L3QQJLDJ.mjs.map
1619
+ //# sourceMappingURL=chunk-3JEAPZ6A.mjs.map
1620
+ //# sourceMappingURL=chunk-3JEAPZ6A.mjs.map