veo-sdk 0.5.16 → 0.5.18
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-Q3V33JIO.mjs +5 -0
- package/dist/{builder-M6QP7H3A.mjs.map → builder-Q3V33JIO.mjs.map} +1 -1
- package/dist/builder.cjs +18 -33
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.d.cts +2 -2
- package/dist/builder.d.ts +2 -2
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-362B5ACY.mjs → chunk-345TTBZM.mjs} +4 -4
- package/dist/chunk-345TTBZM.mjs.map +1 -0
- package/dist/{chunk-KSQJQ2UU.mjs → chunk-JRUCBH2I.mjs} +19 -34
- package/dist/chunk-JRUCBH2I.mjs.map +1 -0
- package/dist/{chunk-GRKV26HT.mjs → chunk-JYTQQ623.mjs} +3 -3
- package/dist/{chunk-GRKV26HT.mjs.map → chunk-JYTQQ623.mjs.map} +1 -1
- package/dist/{guide-preview-XUnTmzUO.d.cts → guide-preview-BiufCjq9.d.cts} +7 -0
- package/dist/{guide-preview-XUnTmzUO.d.ts → guide-preview-BiufCjq9.d.ts} +7 -0
- package/dist/index.cjs +18 -34
- 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 +6 -6
- 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-M6QP7H3A.mjs +0 -5
- package/dist/chunk-362B5ACY.mjs.map +0 -1
- package/dist/chunk-KSQJQ2UU.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2135,6 +2135,10 @@ function mountCodeBlock(block, doc, context) {
|
|
|
2135
2135
|
wrapper.appendChild(iframe);
|
|
2136
2136
|
return { node: wrapper, cleanup };
|
|
2137
2137
|
}
|
|
2138
|
+
if (context.editorPreview) {
|
|
2139
|
+
return { node: buildHostPlaceholder(doc), cleanup: () => {
|
|
2140
|
+
} };
|
|
2141
|
+
}
|
|
2138
2142
|
const hostDoc = doc;
|
|
2139
2143
|
const injected = [];
|
|
2140
2144
|
if (typeof block.css === "string" && block.css.trim()) {
|
|
@@ -2166,6 +2170,18 @@ function mountCodeBlock(block, doc, context) {
|
|
|
2166
2170
|
}
|
|
2167
2171
|
};
|
|
2168
2172
|
}
|
|
2173
|
+
function buildHostPlaceholder(doc) {
|
|
2174
|
+
const box = doc.createElement("div");
|
|
2175
|
+
box.className = "veo-code-placeholder";
|
|
2176
|
+
box.style.cssText = "border:1px dashed #cbd5e1;border-radius:8px;padding:12px;text-align:center;font:13px/1.4 system-ui,sans-serif;color:#64748b;background:#f8fafc;";
|
|
2177
|
+
const t = doc.createElement("strong");
|
|
2178
|
+
t.textContent = "\u27E8 \u27E9 Bloque de c\xF3digo";
|
|
2179
|
+
t.style.cssText = "display:block;color:#475569;margin-bottom:2px;";
|
|
2180
|
+
const s = doc.createElement("span");
|
|
2181
|
+
s.textContent = "Se ejecuta en tu app al publicar (no corre en el editor).";
|
|
2182
|
+
box.append(t, s);
|
|
2183
|
+
return box;
|
|
2184
|
+
}
|
|
2169
2185
|
function runScript(old, hostDoc) {
|
|
2170
2186
|
const s = hostDoc.createElement("script");
|
|
2171
2187
|
for (const attr of Array.from(old.attributes)) s.setAttribute(attr.name, attr.value);
|
|
@@ -2589,7 +2605,6 @@ var init_composite_renderer = __esm({
|
|
|
2589
2605
|
init_form_content();
|
|
2590
2606
|
init_inline_host();
|
|
2591
2607
|
init_wait_for_element();
|
|
2592
|
-
init_badge_renderer();
|
|
2593
2608
|
init_base_renderer();
|
|
2594
2609
|
init_floating_arrow();
|
|
2595
2610
|
ROW_ALIGN = {
|
|
@@ -2598,36 +2613,10 @@ var init_composite_renderer = __esm({
|
|
|
2598
2613
|
right: "flex-end"
|
|
2599
2614
|
};
|
|
2600
2615
|
CompositeRenderer = class extends BaseRenderer {
|
|
2601
|
-
constructor() {
|
|
2602
|
-
super(...arguments);
|
|
2603
|
-
/** Delegado para pasos `badge` (reusa el BadgeRenderer con un step sintético). */
|
|
2604
|
-
this.badgeDelegate = null;
|
|
2605
|
-
}
|
|
2606
2616
|
async render(context) {
|
|
2607
2617
|
const idx = context.nav?.stepIndex ?? 0;
|
|
2608
2618
|
const step = context.guide.guideSteps[idx];
|
|
2609
2619
|
if (!step) return;
|
|
2610
|
-
if (step.presentation === "badge") {
|
|
2611
|
-
const syntheticStep = {
|
|
2612
|
-
title: "",
|
|
2613
|
-
content: "",
|
|
2614
|
-
selector: step.anchorSelector ?? void 0,
|
|
2615
|
-
blocks: step.blocks ?? [],
|
|
2616
|
-
style: {
|
|
2617
|
-
...step.design ?? {},
|
|
2618
|
-
...step.badge ? { badge: step.badge } : {},
|
|
2619
|
-
...step.badgeTrigger ? { badgeTrigger: step.badgeTrigger } : {}
|
|
2620
|
-
}
|
|
2621
|
-
};
|
|
2622
|
-
const syntheticGuide = {
|
|
2623
|
-
...context.guide,
|
|
2624
|
-
guideSteps: [syntheticStep]
|
|
2625
|
-
};
|
|
2626
|
-
const { nav: _nav, ...rest } = context;
|
|
2627
|
-
this.badgeDelegate = new BadgeRenderer();
|
|
2628
|
-
await this.badgeDelegate.render({ ...rest, guide: syntheticGuide });
|
|
2629
|
-
return;
|
|
2630
|
-
}
|
|
2631
2620
|
const anchorSelector = step.position === "relative-to-element" || step.presentation === "inline" ? step.anchorSelector?.trim() || void 0 : void 0;
|
|
2632
2621
|
let anchor = null;
|
|
2633
2622
|
if (anchorSelector) {
|
|
@@ -2861,12 +2850,6 @@ var init_composite_renderer = __esm({
|
|
|
2861
2850
|
if (context.nav?.callbacks) context.nav.callbacks.onSkip();
|
|
2862
2851
|
else context.onClose();
|
|
2863
2852
|
}
|
|
2864
|
-
/** Además del host propio, destruye el delegado de badge si lo hubo. */
|
|
2865
|
-
destroy() {
|
|
2866
|
-
this.badgeDelegate?.destroy();
|
|
2867
|
-
this.badgeDelegate = null;
|
|
2868
|
-
super.destroy();
|
|
2869
|
-
}
|
|
2870
2853
|
};
|
|
2871
2854
|
CLOSE_INSET = "10px";
|
|
2872
2855
|
CLOSE_RESERVE = "34px";
|
|
@@ -3532,6 +3515,7 @@ var init_guide_preview = __esm({
|
|
|
3532
3515
|
// el caller puede pasar `formSubmit` real (link de preview).
|
|
3533
3516
|
onFormSubmit: this.input?.formSubmit ?? (() => Promise.resolve(true)),
|
|
3534
3517
|
isPreview: true,
|
|
3518
|
+
editorPreview: this.input?.editorPreview === true,
|
|
3535
3519
|
...this.input?.formSubmit && this.input.formSubmitNote !== void 0 ? { previewNote: this.input.formSubmitNote } : {}
|
|
3536
3520
|
});
|
|
3537
3521
|
} catch {
|
|
@@ -4396,7 +4380,7 @@ function initBuilderMode() {
|
|
|
4396
4380
|
dropTarget?.detach();
|
|
4397
4381
|
dropTarget = null;
|
|
4398
4382
|
previewStepIndex = cmd.guide.startStepIndex ?? 0;
|
|
4399
|
-
const handle = previewGuide(cmd.guide);
|
|
4383
|
+
const handle = previewGuide({ ...cmd.guide, editorPreview: true });
|
|
4400
4384
|
if (!cmd.editable) return;
|
|
4401
4385
|
void handle.ready.then((result) => {
|
|
4402
4386
|
if (!result.rendered) return;
|