veo-sdk 0.5.27 → 0.5.28
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-RSWK3RIB.mjs +5 -0
- package/dist/{builder-5UDF6IHS.mjs.map → builder-RSWK3RIB.mjs.map} +1 -1
- package/dist/builder.cjs +104 -1
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-6XZPR7VC.mjs → chunk-CWIUNHWA.mjs} +106 -3
- package/dist/chunk-CWIUNHWA.mjs.map +1 -0
- package/dist/{chunk-RHYVNG3X.mjs → chunk-L5X4AGR7.mjs} +3 -3
- package/dist/{chunk-RHYVNG3X.mjs.map → chunk-L5X4AGR7.mjs.map} +1 -1
- package/dist/{chunk-XW4KLWLJ.mjs → chunk-WLW5Y5LU.mjs} +3 -3
- package/dist/{chunk-XW4KLWLJ.mjs.map → chunk-WLW5Y5LU.mjs.map} +1 -1
- package/dist/index.cjs +104 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/veo-builder.js +10 -10
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +5 -5
- package/dist/veo-guides.js.map +1 -1
- package/package.json +1 -1
- package/dist/builder-5UDF6IHS.mjs +0 -5
- package/dist/chunk-6XZPR7VC.mjs.map +0 -1
package/dist/builder.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
import { initBuilderMode } from './chunk-
|
|
3
|
-
export { createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-
|
|
4
|
-
export { closeGuidePreview, previewGuide } from './chunk-
|
|
1
|
+
import './chunk-WLW5Y5LU.mjs';
|
|
2
|
+
import { initBuilderMode } from './chunk-L5X4AGR7.mjs';
|
|
3
|
+
export { createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-L5X4AGR7.mjs';
|
|
4
|
+
export { closeGuidePreview, previewGuide } from './chunk-CWIUNHWA.mjs';
|
|
5
5
|
import './chunk-PTG3BTJE.mjs';
|
|
6
6
|
|
|
7
7
|
// src/builder.ts
|
|
@@ -2218,7 +2218,8 @@ var CompositeRenderer = class extends BaseRenderer {
|
|
|
2218
2218
|
const idx = context.nav?.stepIndex ?? 0;
|
|
2219
2219
|
const step = context.guide.guideSteps[idx];
|
|
2220
2220
|
if (!step) return;
|
|
2221
|
-
const
|
|
2221
|
+
const badgeMode = step.badge?.enabled === true;
|
|
2222
|
+
const anchorSelector = step.position === "relative-to-element" || step.presentation === "inline" || badgeMode ? step.anchorSelector?.trim() || void 0 : void 0;
|
|
2222
2223
|
let anchor = null;
|
|
2223
2224
|
if (anchorSelector) {
|
|
2224
2225
|
anchor = await waitForElement(anchorSelector);
|
|
@@ -2255,8 +2256,13 @@ var CompositeRenderer = class extends BaseRenderer {
|
|
|
2255
2256
|
this.buildContent(card, step.blocks ?? [], doc, context, idx, readers, host);
|
|
2256
2257
|
const lastBlock = card.lastElementChild;
|
|
2257
2258
|
if (lastBlock && !lastBlock.style.marginBottom) lastBlock.style.marginBottom = "0";
|
|
2259
|
+
let closeTooltip = null;
|
|
2258
2260
|
if (design.closeButton !== false) {
|
|
2259
2261
|
const closeBtn = createCloseButton(doc, () => {
|
|
2262
|
+
if (closeTooltip) {
|
|
2263
|
+
closeTooltip();
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2260
2266
|
dismiss("dismissed");
|
|
2261
2267
|
this.closeOrSkip(context);
|
|
2262
2268
|
});
|
|
@@ -2275,6 +2281,21 @@ var CompositeRenderer = class extends BaseRenderer {
|
|
|
2275
2281
|
}
|
|
2276
2282
|
card.appendChild(closeBtn);
|
|
2277
2283
|
}
|
|
2284
|
+
if (badgeMode && anchor) {
|
|
2285
|
+
closeTooltip = this.renderBadgeMode(
|
|
2286
|
+
step,
|
|
2287
|
+
card,
|
|
2288
|
+
anchor,
|
|
2289
|
+
anchorSelector,
|
|
2290
|
+
host,
|
|
2291
|
+
root,
|
|
2292
|
+
doc,
|
|
2293
|
+
context,
|
|
2294
|
+
idx,
|
|
2295
|
+
design
|
|
2296
|
+
);
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2278
2299
|
if (step.presentation === "inline" && anchor) {
|
|
2279
2300
|
host.style.display = "block";
|
|
2280
2301
|
const pos = inlinePosOf(step.inlinePosition);
|
|
@@ -2464,6 +2485,88 @@ var CompositeRenderer = class extends BaseRenderer {
|
|
|
2464
2485
|
if (context.nav?.callbacks) context.nav.callbacks.onSkip();
|
|
2465
2486
|
else context.onClose();
|
|
2466
2487
|
}
|
|
2488
|
+
/**
|
|
2489
|
+
* Modo BADGE: inserta un MARCADOR permanente (compuesto con `step.badge.blocks`)
|
|
2490
|
+
* junto al ancla, en el flujo del DOM. Al hover/click abre la `card` (los
|
|
2491
|
+
* bloques del paso) como TOOLTIP anclado al marcador. Devuelve una función que
|
|
2492
|
+
* cierra el tooltip (para el ✕). El marcador nunca se descarta.
|
|
2493
|
+
*/
|
|
2494
|
+
renderBadgeMode(step, card, anchor, anchorSelector, host, root, doc, context, idx, design) {
|
|
2495
|
+
const trigger = step.badge?.trigger === "click" ? "click" : "hover";
|
|
2496
|
+
const badge = doc.createElement("div");
|
|
2497
|
+
badge.className = "veo-composite-badge";
|
|
2498
|
+
badge.setAttribute("role", "button");
|
|
2499
|
+
badge.tabIndex = 0;
|
|
2500
|
+
badge.style.cursor = "pointer";
|
|
2501
|
+
badge.style.display = "inline-flex";
|
|
2502
|
+
badge.style.alignItems = "center";
|
|
2503
|
+
this.buildContent(badge, step.badge?.blocks ?? [], doc, context, idx, [], host);
|
|
2504
|
+
root.appendChild(badge);
|
|
2505
|
+
const wrapper = doc.createElement("div");
|
|
2506
|
+
wrapper.className = "veo-composite-anchored";
|
|
2507
|
+
wrapper.style.display = "none";
|
|
2508
|
+
const caretEl = design.caret === false ? null : makeCaret(doc, design);
|
|
2509
|
+
if (caretEl) wrapper.appendChild(caretEl);
|
|
2510
|
+
wrapper.appendChild(card);
|
|
2511
|
+
root.appendChild(wrapper);
|
|
2512
|
+
host.style.display = "inline-block";
|
|
2513
|
+
const pos = inlinePosOf(step.inlinePosition);
|
|
2514
|
+
insertHost(anchor, host, pos);
|
|
2515
|
+
this.registerCleanup(keepHostAttached(host, anchorSelector, pos));
|
|
2516
|
+
let open = false;
|
|
2517
|
+
let stopFloat = null;
|
|
2518
|
+
let closeTimer = null;
|
|
2519
|
+
let shownEmitted = false;
|
|
2520
|
+
const openTip = () => {
|
|
2521
|
+
if (open) return;
|
|
2522
|
+
open = true;
|
|
2523
|
+
wrapper.style.display = "block";
|
|
2524
|
+
void anchorPosition(badge, wrapper, caretEl).then((stop) => {
|
|
2525
|
+
if (open) stopFloat = stop;
|
|
2526
|
+
else stop();
|
|
2527
|
+
});
|
|
2528
|
+
if (!shownEmitted) {
|
|
2529
|
+
shownEmitted = true;
|
|
2530
|
+
context.onInteraction({ guideId: context.guide.guideId, stepIndex: idx, action: "shown" });
|
|
2531
|
+
}
|
|
2532
|
+
};
|
|
2533
|
+
const closeTip = () => {
|
|
2534
|
+
open = false;
|
|
2535
|
+
wrapper.style.display = "none";
|
|
2536
|
+
stopFloat?.();
|
|
2537
|
+
stopFloat = null;
|
|
2538
|
+
};
|
|
2539
|
+
if (trigger === "hover") {
|
|
2540
|
+
const cancelClose = () => {
|
|
2541
|
+
if (closeTimer !== null) {
|
|
2542
|
+
clearTimeout(closeTimer);
|
|
2543
|
+
closeTimer = null;
|
|
2544
|
+
}
|
|
2545
|
+
};
|
|
2546
|
+
const scheduleClose = () => {
|
|
2547
|
+
cancelClose();
|
|
2548
|
+
closeTimer = window.setTimeout(closeTip, 150);
|
|
2549
|
+
};
|
|
2550
|
+
badge.addEventListener("mouseenter", () => {
|
|
2551
|
+
cancelClose();
|
|
2552
|
+
openTip();
|
|
2553
|
+
});
|
|
2554
|
+
badge.addEventListener("mouseleave", scheduleClose);
|
|
2555
|
+
badge.addEventListener("focus", openTip);
|
|
2556
|
+
wrapper.addEventListener("mouseenter", cancelClose);
|
|
2557
|
+
wrapper.addEventListener("mouseleave", scheduleClose);
|
|
2558
|
+
} else {
|
|
2559
|
+
badge.addEventListener("click", () => {
|
|
2560
|
+
if (open) closeTip();
|
|
2561
|
+
else openTip();
|
|
2562
|
+
});
|
|
2563
|
+
}
|
|
2564
|
+
this.registerCleanup(() => {
|
|
2565
|
+
stopFloat?.();
|
|
2566
|
+
if (closeTimer !== null) clearTimeout(closeTimer);
|
|
2567
|
+
});
|
|
2568
|
+
return closeTip;
|
|
2569
|
+
}
|
|
2467
2570
|
};
|
|
2468
2571
|
function inlinePosOf(p) {
|
|
2469
2572
|
return p === "before" || p === "prepend" || p === "append" ? p : "after";
|
|
@@ -3405,5 +3508,5 @@ function buildSelectorPath(element, maxAncestors = 5) {
|
|
|
3405
3508
|
}
|
|
3406
3509
|
|
|
3407
3510
|
export { ALWAYS_BLOCK_SELECTORS, BadgeRenderer, BannerRenderer, CompositeRenderer, CustomRenderer, DEFAULT_AUTOCAPTURE_CONFIG, DEFAULT_TRACKER_BATCH_SIZE, DEFAULT_TRACKER_FLUSH_INTERVAL_MS, DEFAULT_TRACKER_MAX_RETRIES, FREQUENCY_CACHE_KEY_PREFIX, FREQUENCY_CACHE_MAX_ENTRIES, FREQUENCY_CACHE_TTL_MS, FormRenderer, InlineCustomRenderer, InlineFormRenderer, InlineRenderer, MAX_ANCESTORS, ModalRenderer, PRIORITY_ATTRIBUTES, SENSITIVE_ATTRIBUTES, TooltipRenderer, WALKTHROUGH_ABANDONMENT_TIMEOUT_MS, WALKTHROUGH_STATE_KEY_PREFIX, WalkthroughRenderer, buildSelectorPath, clearBuilderToken, closeGuidePreview, filterHumanClasses, hasDocument, hasLocalStorage, hasNavigatorSendBeacon, hasWindow, isBuilderMode, previewGuide, resolveBuilderContext, resolveBuilderToken, stepMatchesPage, uuidv7 };
|
|
3408
|
-
//# sourceMappingURL=chunk-
|
|
3409
|
-
//# sourceMappingURL=chunk-
|
|
3511
|
+
//# sourceMappingURL=chunk-CWIUNHWA.mjs.map
|
|
3512
|
+
//# sourceMappingURL=chunk-CWIUNHWA.mjs.map
|