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.
@@ -0,0 +1,5 @@
1
+ export { VEO_BLOCK_MIME, attachBlockDropTarget, attachDesignManipulator, createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-345TTBZM.mjs';
2
+ import './chunk-JRUCBH2I.mjs';
3
+ import './chunk-PTG3BTJE.mjs';
4
+ //# sourceMappingURL=builder-Q3V33JIO.mjs.map
5
+ //# sourceMappingURL=builder-Q3V33JIO.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"builder-M6QP7H3A.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"builder-Q3V33JIO.mjs"}
package/dist/builder.cjs CHANGED
@@ -1956,6 +1956,10 @@ function mountCodeBlock(block, doc, context) {
1956
1956
  wrapper.appendChild(iframe);
1957
1957
  return { node: wrapper, cleanup };
1958
1958
  }
1959
+ if (context.editorPreview) {
1960
+ return { node: buildHostPlaceholder(doc), cleanup: () => {
1961
+ } };
1962
+ }
1959
1963
  const hostDoc = doc;
1960
1964
  const injected = [];
1961
1965
  if (typeof block.css === "string" && block.css.trim()) {
@@ -1987,6 +1991,18 @@ function mountCodeBlock(block, doc, context) {
1987
1991
  }
1988
1992
  };
1989
1993
  }
1994
+ function buildHostPlaceholder(doc) {
1995
+ const box = doc.createElement("div");
1996
+ box.className = "veo-code-placeholder";
1997
+ 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;";
1998
+ const t = doc.createElement("strong");
1999
+ t.textContent = "\u27E8 \u27E9 Bloque de c\xF3digo";
2000
+ t.style.cssText = "display:block;color:#475569;margin-bottom:2px;";
2001
+ const s = doc.createElement("span");
2002
+ s.textContent = "Se ejecuta en tu app al publicar (no corre en el editor).";
2003
+ box.append(t, s);
2004
+ return box;
2005
+ }
1990
2006
  function runScript(old, hostDoc) {
1991
2007
  const s = hostDoc.createElement("script");
1992
2008
  for (const attr of Array.from(old.attributes)) s.setAttribute(attr.name, attr.value);
@@ -2267,36 +2283,10 @@ var ROW_ALIGN = {
2267
2283
  right: "flex-end"
2268
2284
  };
2269
2285
  var CompositeRenderer = class extends BaseRenderer {
2270
- constructor() {
2271
- super(...arguments);
2272
- /** Delegado para pasos `badge` (reusa el BadgeRenderer con un step sintético). */
2273
- this.badgeDelegate = null;
2274
- }
2275
2286
  async render(context) {
2276
2287
  const idx = context.nav?.stepIndex ?? 0;
2277
2288
  const step = context.guide.guideSteps[idx];
2278
2289
  if (!step) return;
2279
- if (step.presentation === "badge") {
2280
- const syntheticStep = {
2281
- title: "",
2282
- content: "",
2283
- selector: step.anchorSelector ?? void 0,
2284
- blocks: step.blocks ?? [],
2285
- style: {
2286
- ...step.design ?? {},
2287
- ...step.badge ? { badge: step.badge } : {},
2288
- ...step.badgeTrigger ? { badgeTrigger: step.badgeTrigger } : {}
2289
- }
2290
- };
2291
- const syntheticGuide = {
2292
- ...context.guide,
2293
- guideSteps: [syntheticStep]
2294
- };
2295
- const { nav: _nav, ...rest } = context;
2296
- this.badgeDelegate = new BadgeRenderer();
2297
- await this.badgeDelegate.render({ ...rest, guide: syntheticGuide });
2298
- return;
2299
- }
2300
2290
  const anchorSelector = step.position === "relative-to-element" || step.presentation === "inline" ? step.anchorSelector?.trim() || void 0 : void 0;
2301
2291
  let anchor = null;
2302
2292
  if (anchorSelector) {
@@ -2530,12 +2520,6 @@ var CompositeRenderer = class extends BaseRenderer {
2530
2520
  if (context.nav?.callbacks) context.nav.callbacks.onSkip();
2531
2521
  else context.onClose();
2532
2522
  }
2533
- /** Además del host propio, destruye el delegado de badge si lo hubo. */
2534
- destroy() {
2535
- this.badgeDelegate?.destroy();
2536
- this.badgeDelegate = null;
2537
- super.destroy();
2538
- }
2539
2523
  };
2540
2524
  function inlinePosOf(p) {
2541
2525
  return p === "before" || p === "prepend" || p === "append" ? p : "after";
@@ -3185,6 +3169,7 @@ var GuidePreviewController = class {
3185
3169
  // el caller puede pasar `formSubmit` real (link de preview).
3186
3170
  onFormSubmit: this.input?.formSubmit ?? (() => Promise.resolve(true)),
3187
3171
  isPreview: true,
3172
+ editorPreview: this.input?.editorPreview === true,
3188
3173
  ...this.input?.formSubmit && this.input.formSubmitNote !== void 0 ? { previewNote: this.input.formSubmitNote } : {}
3189
3174
  });
3190
3175
  } catch {
@@ -4060,7 +4045,7 @@ function initBuilderMode() {
4060
4045
  dropTarget?.detach();
4061
4046
  dropTarget = null;
4062
4047
  previewStepIndex = cmd.guide.startStepIndex ?? 0;
4063
- const handle = previewGuide(cmd.guide);
4048
+ const handle = previewGuide({ ...cmd.guide, editorPreview: true });
4064
4049
  if (!cmd.editable) return;
4065
4050
  void handle.ready.then((result) => {
4066
4051
  if (!result.rendered) return;