veo-sdk 0.5.23 → 0.5.25

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
@@ -2147,11 +2147,17 @@ function mountCodeBlock(block, doc, context) {
2147
2147
  if (typeof block.html === "string" && block.html.trim()) {
2148
2148
  node = doc.createElement("div");
2149
2149
  node.className = "veo-code-html";
2150
- node.innerHTML = block.html;
2151
- for (const old of Array.from(node.querySelectorAll("script"))) {
2150
+ const inner = node.attachShadow({ mode: "open" });
2151
+ for (const sheet of Array.from(hostDoc.querySelectorAll('link[rel="stylesheet"], style'))) {
2152
+ inner.appendChild(sheet.cloneNode(true));
2153
+ }
2154
+ const holder = doc.createElement("div");
2155
+ holder.innerHTML = block.html;
2156
+ for (const old of Array.from(holder.querySelectorAll("script"))) {
2152
2157
  injected.push(runScript(old, hostDoc));
2153
2158
  old.remove();
2154
2159
  }
2160
+ inner.appendChild(holder);
2155
2161
  }
2156
2162
  if (typeof block.js === "string" && block.js.trim()) {
2157
2163
  const s = hostDoc.createElement("script");
@@ -2479,15 +2485,6 @@ function applyClosePosition(btn, position) {
2479
2485
  s.setProperty(vertical, CLOSE_INSET);
2480
2486
  s.setProperty(horizontal, CLOSE_INSET);
2481
2487
  }
2482
- function reserveCloseSpace(card, position) {
2483
- const blocks = Array.from(card.children).filter(
2484
- (c) => c instanceof HTMLElement && !c.classList.contains("veo-guide-close")
2485
- );
2486
- if (blocks.length === 0) return;
2487
- const target = position.includes("bottom") ? blocks[blocks.length - 1] : blocks[0];
2488
- if (!target) return;
2489
- target.style[position.includes("left") ? "paddingLeft" : "paddingRight"] = CLOSE_RESERVE;
2490
- }
2491
2488
  function makeCaret(doc, design) {
2492
2489
  const caret = doc.createElement("div");
2493
2490
  caret.className = "veo-composite-caret";
@@ -2581,7 +2578,7 @@ function applyCompositeDesign(card, design) {
2581
2578
  if (m) s.setProperty(`margin-${side.toLowerCase()}`, m);
2582
2579
  }
2583
2580
  }
2584
- var ROW_ALIGN, CompositeRenderer, CLOSE_INSET, CLOSE_RESERVE;
2581
+ var ROW_ALIGN, CompositeRenderer, CLOSE_INSET;
2585
2582
  var init_composite_renderer = __esm({
2586
2583
  "src/plugins/guides/renderers/composite-renderer.ts"() {
2587
2584
  init_block_builder();
@@ -2636,7 +2633,6 @@ var init_composite_renderer = __esm({
2636
2633
  if (closeColor) closeBtn.style.color = closeColor;
2637
2634
  const closePos = typeof design.closePosition === "string" ? design.closePosition : "top-right";
2638
2635
  applyClosePosition(closeBtn, closePos);
2639
- reserveCloseSpace(card, closePos);
2640
2636
  if (hoverColor) {
2641
2637
  closeBtn.addEventListener("mouseenter", () => {
2642
2638
  closeBtn.style.color = hoverColor;
@@ -2838,7 +2834,6 @@ var init_composite_renderer = __esm({
2838
2834
  }
2839
2835
  };
2840
2836
  CLOSE_INSET = "10px";
2841
- CLOSE_RESERVE = "34px";
2842
2837
  }
2843
2838
  });
2844
2839
  function applyFloatingPosition(wrapper, placement) {