veo-sdk 0.5.17 → 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/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);
@@ -3499,6 +3515,7 @@ var init_guide_preview = __esm({
3499
3515
  // el caller puede pasar `formSubmit` real (link de preview).
3500
3516
  onFormSubmit: this.input?.formSubmit ?? (() => Promise.resolve(true)),
3501
3517
  isPreview: true,
3518
+ editorPreview: this.input?.editorPreview === true,
3502
3519
  ...this.input?.formSubmit && this.input.formSubmitNote !== void 0 ? { previewNote: this.input.formSubmitNote } : {}
3503
3520
  });
3504
3521
  } catch {
@@ -4363,7 +4380,7 @@ function initBuilderMode() {
4363
4380
  dropTarget?.detach();
4364
4381
  dropTarget = null;
4365
4382
  previewStepIndex = cmd.guide.startStepIndex ?? 0;
4366
- const handle = previewGuide(cmd.guide);
4383
+ const handle = previewGuide({ ...cmd.guide, editorPreview: true });
4367
4384
  if (!cmd.editable) return;
4368
4385
  void handle.ready.then((result) => {
4369
4386
  if (!result.rendered) return;