veo-sdk 0.6.3 → 0.6.5

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/index.d.cts CHANGED
@@ -132,6 +132,8 @@ type VeoClientEventListener<E extends VeoClientEventName> = (payload: VeoClientE
132
132
  * Forward declaration del client (implementación viene en core/client.ts).
133
133
  */
134
134
  interface VeoClient {
135
+ /** Versión del SDK cargado (la de package.json en el build). `window.veo.version` en consola. */
136
+ readonly version: string;
135
137
  identify(payload: {
136
138
  visitor: VeoVisitor;
137
139
  organization?: VeoOrganization;
@@ -185,7 +187,8 @@ declare function guidesPlugin(config: GuidesPluginConfig): VeoPlugin;
185
187
  * - veo-backend/src/modules/ingest/dto/*.dto.ts
186
188
  * - CONTRACT.md
187
189
  */
188
- declare const SDK_VERSION = "0.0.1";
190
+ /** Versión del SDK, inyectada en build desde package.json (tsup `define`); fallback en tests/dev. */
191
+ declare const SDK_VERSION: string;
189
192
 
190
193
  /**
191
194
  * Cliente principal del SDK. Expone la API pública (`identify`, `track`,
@@ -194,6 +197,7 @@ declare const SDK_VERSION = "0.0.1";
194
197
  */
195
198
  declare class Client implements VeoClient {
196
199
  private readonly config;
200
+ readonly version: string;
197
201
  private readonly transport;
198
202
  private readonly storage;
199
203
  private readonly session;
package/dist/index.d.ts CHANGED
@@ -132,6 +132,8 @@ type VeoClientEventListener<E extends VeoClientEventName> = (payload: VeoClientE
132
132
  * Forward declaration del client (implementación viene en core/client.ts).
133
133
  */
134
134
  interface VeoClient {
135
+ /** Versión del SDK cargado (la de package.json en el build). `window.veo.version` en consola. */
136
+ readonly version: string;
135
137
  identify(payload: {
136
138
  visitor: VeoVisitor;
137
139
  organization?: VeoOrganization;
@@ -185,7 +187,8 @@ declare function guidesPlugin(config: GuidesPluginConfig): VeoPlugin;
185
187
  * - veo-backend/src/modules/ingest/dto/*.dto.ts
186
188
  * - CONTRACT.md
187
189
  */
188
- declare const SDK_VERSION = "0.0.1";
190
+ /** Versión del SDK, inyectada en build desde package.json (tsup `define`); fallback en tests/dev. */
191
+ declare const SDK_VERSION: string;
189
192
 
190
193
  /**
191
194
  * Cliente principal del SDK. Expone la API pública (`identify`, `track`,
@@ -194,6 +197,7 @@ declare const SDK_VERSION = "0.0.1";
194
197
  */
195
198
  declare class Client implements VeoClient {
196
199
  private readonly config;
200
+ readonly version: string;
197
201
  private readonly transport;
198
202
  private readonly storage;
199
203
  private readonly session;
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { definePlugin, guidesPlugin, runPreviewMode } from './chunk-3JEAPZ6A.mjs';
2
- export { definePlugin, guidesPlugin } from './chunk-3JEAPZ6A.mjs';
3
- import { hasWindow, hasDocument, uuidv7, DEFAULT_AUTOCAPTURE_CONFIG, MAX_ANCESTORS, hasLocalStorage, hasNavigatorSendBeacon, isBuilderMode, buildSelectorPath, ALWAYS_BLOCK_SELECTORS, resolveBuilderToken, filterHumanClasses, PRIORITY_ATTRIBUTES, SENSITIVE_ATTRIBUTES, getPreviewToken, previewGuide, closeGuidePreview } from './chunk-SZCIXA5X.mjs';
4
- export { closeGuidePreview, previewGuide } from './chunk-SZCIXA5X.mjs';
1
+ import { definePlugin, guidesPlugin, runPreviewMode } from './chunk-72YH2GXC.mjs';
2
+ export { definePlugin, guidesPlugin } from './chunk-72YH2GXC.mjs';
3
+ import { hasWindow, hasDocument, uuidv7, DEFAULT_AUTOCAPTURE_CONFIG, MAX_ANCESTORS, hasLocalStorage, hasNavigatorSendBeacon, isBuilderMode, buildSelectorPath, ALWAYS_BLOCK_SELECTORS, resolveBuilderToken, filterHumanClasses, PRIORITY_ATTRIBUTES, SENSITIVE_ATTRIBUTES, getPreviewToken, previewGuide, closeGuidePreview } from './chunk-CMPOHTUM.mjs';
4
+ export { closeGuidePreview, previewGuide } from './chunk-CMPOHTUM.mjs';
5
5
  import './chunk-PTG3BTJE.mjs';
6
6
 
7
7
  // src/contract/v1.ts
8
- var SDK_VERSION = "0.0.1";
8
+ var SDK_VERSION = "0.6.5";
9
9
  var DEFAULT_FLUSH_INTERVAL_MS = 5e3;
10
10
  var DEFAULT_FLUSH_BATCH_SIZE = 20;
11
11
  var DEFAULT_API_URL = "https://veo-backend-production-8c78.up.railway.app";
@@ -530,13 +530,23 @@ var DomListener = class {
530
530
  if (!this.throttle.shouldFire(target)) return;
531
531
  this.emit("change", target);
532
532
  }
533
- /** Busca hacia arriba un ancestro "interactivo". Devuelve null si no hay ninguno. */
533
+ /**
534
+ * Busca hacia arriba un ancestro "interactivo". Devuelve null si no hay ninguno.
535
+ *
536
+ * Además de los controles nativos, reconoce los patrones de las apps modernas
537
+ * (React/Vue/Radix), donde el handler NO está en el HTML: acordeones, menús
538
+ * desplegables y tabs marcados con `aria-expanded`/`aria-haspopup`/`aria-controls`/
539
+ * `aria-pressed`/`aria-selected`/`data-state`, elementos enfocables por
540
+ * `tabindex`, y cualquier elemento cuyo cursor COMPUTADO sea `pointer` (antes
541
+ * solo se miraba el inline, que casi nadie usa: el cursor viene por clase).
542
+ */
534
543
  findMeaningfulAncestor(element) {
535
544
  let current = element;
536
545
  let depth = 0;
537
546
  while (current && current !== document.documentElement && depth < 5) {
538
547
  const tag = current.tagName.toLowerCase();
539
- const isInteractive = tag === "button" || tag === "a" || tag === "input" || tag === "select" || tag === "textarea" || current.hasAttribute("data-veo-tag") || current.hasAttribute("role") || current.hasAttribute("onclick") || current instanceof HTMLElement && current.style.cursor === "pointer";
548
+ const tabindex = current.getAttribute("tabindex");
549
+ const isInteractive = tag === "button" || tag === "a" || tag === "input" || tag === "select" || tag === "textarea" || tag === "summary" || tag === "label" || current.hasAttribute("data-veo-tag") || current.hasAttribute("role") || current.hasAttribute("onclick") || current.hasAttribute("aria-expanded") || current.hasAttribute("aria-haspopup") || current.hasAttribute("aria-controls") || current.hasAttribute("aria-pressed") || current.hasAttribute("aria-selected") || current.hasAttribute("data-state") || current.hasAttribute("contenteditable") || tabindex !== null && tabindex !== "-1" || hasPointerCursor(current);
540
550
  if (isInteractive) return current;
541
551
  current = current.parentElement;
542
552
  depth++;
@@ -548,6 +558,16 @@ var DomListener = class {
548
558
  this.client.track("$autocapture", payload);
549
559
  }
550
560
  };
561
+ function hasPointerCursor(element) {
562
+ if (!(element instanceof HTMLElement)) return false;
563
+ if (element.style.cursor === "pointer") return true;
564
+ try {
565
+ const win = element.ownerDocument.defaultView;
566
+ return win ? win.getComputedStyle(element).cursor === "pointer" : false;
567
+ } catch {
568
+ return false;
569
+ }
570
+ }
551
571
 
552
572
  // src/plugins/autocapture/index.ts
553
573
  function autocapturePlugin(config = {}) {
@@ -1004,6 +1024,7 @@ function stableStringify(value) {
1004
1024
  var Client = class {
1005
1025
  constructor(config) {
1006
1026
  this.config = config;
1027
+ this.version = SDK_VERSION;
1007
1028
  this.plugins = [];
1008
1029
  this.currentOrganizationId = null;
1009
1030
  this.listeners = {
@@ -1266,7 +1287,7 @@ function init(config) {
1266
1287
  // Fallback de carga del builder para bundlers: `import()` dinámico → el bundler
1267
1288
  // lo code-splitea (solo se descarga en modo builder). Así el consumidor por
1268
1289
  // bundler NO necesita copiar `veo-builder.js` ni setear `builderUrl`.
1269
- () => import('./builder-PPLIAUCM.mjs').then((m) => m.initBuilderMode()),
1290
+ () => import('./builder-O75QIFKQ.mjs').then((m) => m.initBuilderMode()),
1270
1291
  // Detector de tema: también por `import()` dinámico → chunk aparte que el
1271
1292
  // bundler solo descarga cuando toca detectar (como mucho una vez al día).
1272
1293
  () => import('./detect-theme-X4K3TLUL.mjs')