veo-sdk 0.6.4 → 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/{builder-5F2EFT4X.mjs → builder-O75QIFKQ.mjs} +3 -3
- package/dist/{builder-5F2EFT4X.mjs.map → builder-O75QIFKQ.mjs.map} +1 -1
- package/dist/builder.cjs +22 -1
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.mjs +2 -2
- package/dist/{chunk-YEKCBVNJ.mjs → chunk-POPDESAP.mjs} +24 -3
- package/dist/chunk-POPDESAP.mjs.map +1 -0
- package/dist/index.cjs +45 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -4
- package/dist/index.mjs.map +1 -1
- package/dist/veo-builder.js +1 -1
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo.js +2 -2
- package/dist/veo.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-YEKCBVNJ.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ 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.6.
|
|
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
|
-
/**
|
|
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
|
|
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 = {}) {
|
|
@@ -1267,7 +1287,7 @@ function init(config) {
|
|
|
1267
1287
|
// Fallback de carga del builder para bundlers: `import()` dinámico → el bundler
|
|
1268
1288
|
// lo code-splitea (solo se descarga en modo builder). Así el consumidor por
|
|
1269
1289
|
// bundler NO necesita copiar `veo-builder.js` ni setear `builderUrl`.
|
|
1270
|
-
() => import('./builder-
|
|
1290
|
+
() => import('./builder-O75QIFKQ.mjs').then((m) => m.initBuilderMode()),
|
|
1271
1291
|
// Detector de tema: también por `import()` dinámico → chunk aparte que el
|
|
1272
1292
|
// bundler solo descarga cuando toca detectar (como mucho una vez al día).
|
|
1273
1293
|
() => import('./detect-theme-X4K3TLUL.mjs')
|