veo-sdk 0.5.1 → 0.5.3

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
@@ -503,6 +503,33 @@ function buildStepContent(step, doc, callbacks) {
503
503
  container.appendChild(createCloseButton(doc, () => callbacks.onDismiss()));
504
504
  return container;
505
505
  }
506
+ function buildContentNodes(step, doc) {
507
+ const blocks = normalizeBlocks(step);
508
+ if (blocks) {
509
+ return blocks.filter((b) => b.type !== "button").map((b) => buildContentBlock(b, doc)).filter((n) => n !== null);
510
+ }
511
+ const nodes = [];
512
+ if (typeof step.imageUrl === "string" && step.imageUrl && isSafeUrl(step.imageUrl)) {
513
+ const img = doc.createElement("img");
514
+ img.className = "veo-guide-image";
515
+ img.src = step.imageUrl;
516
+ img.alt = typeof step.title === "string" ? step.title : "";
517
+ nodes.push(img);
518
+ }
519
+ if (typeof step.title === "string" && step.title) {
520
+ const heading = doc.createElement("h2");
521
+ heading.className = "veo-guide-title";
522
+ heading.textContent = step.title;
523
+ nodes.push(heading);
524
+ }
525
+ if (typeof step.content === "string" && step.content) {
526
+ const paragraph = doc.createElement("p");
527
+ paragraph.className = "veo-guide-text";
528
+ paragraph.textContent = step.content;
529
+ nodes.push(paragraph);
530
+ }
531
+ return nodes;
532
+ }
506
533
  function renderLegacyStep(container, step, doc, callbacks) {
507
534
  if (typeof step.imageUrl === "string" && step.imageUrl && isSafeUrl(step.imageUrl)) {
508
535
  const img = doc.createElement("img");
@@ -1093,6 +1120,18 @@ var init_styles = __esm({
1093
1120
  .veo-guide-text em { font-style: italic; }
1094
1121
  .veo-guide-text u { text-decoration: underline; }
1095
1122
  .veo-guide-text s { text-decoration: line-through; }
1123
+ /*
1124
+ * El \xDALTIMO bloque de contenido no deja su margin-bottom colgando: ese margen
1125
+ * existe para separar del bloque SIGUIENTE, y sin siguiente se suma al padding
1126
+ * de la tarjeta y parece un "hueco fantasma" (p.ej. quitar el bot\xF3n de un
1127
+ * tooltip dejaba el espacio como si siguiera ah\xED). El pen\xFAltimo hijo es el
1128
+ * \xFAltimo bloque real (el \u2715 de cerrar siempre va \xFAltimo y es absoluto). La
1129
+ * mayor especificidad le gana a las reglas por clase, pero NO a un margen
1130
+ * inline elegido expl\xEDcitamente por el autor (block.style.marginBottom).
1131
+ */
1132
+ .veo-guide-content > :nth-last-child(2) {
1133
+ margin-bottom: 0;
1134
+ }
1096
1135
  .veo-guide-actions {
1097
1136
  display: flex; gap: 8px; justify-content: var(--veo-actions-justify);
1098
1137
  }
@@ -1734,24 +1773,8 @@ function buildWalkthroughStepContent(step, stepIndex, totalSteps, doc, callbacks
1734
1773
  progress.appendChild(dot);
1735
1774
  }
1736
1775
  container.appendChild(progress);
1737
- if (typeof step.imageUrl === "string" && step.imageUrl && isSafeUrl(step.imageUrl)) {
1738
- const img = doc.createElement("img");
1739
- img.className = "veo-guide-image";
1740
- img.src = step.imageUrl;
1741
- img.alt = typeof step.title === "string" ? step.title : "";
1742
- container.appendChild(img);
1743
- }
1744
- if (typeof step.title === "string" && step.title) {
1745
- const heading = doc.createElement("h2");
1746
- heading.className = "veo-guide-title";
1747
- heading.textContent = step.title;
1748
- container.appendChild(heading);
1749
- }
1750
- if (typeof step.content === "string" && step.content) {
1751
- const paragraph = doc.createElement("p");
1752
- paragraph.className = "veo-guide-text";
1753
- paragraph.textContent = step.content;
1754
- container.appendChild(paragraph);
1776
+ for (const node of buildContentNodes(step, doc)) {
1777
+ container.appendChild(node);
1755
1778
  }
1756
1779
  const actions = doc.createElement("div");
1757
1780
  actions.className = "veo-walkthrough-actions";
@@ -1811,7 +1834,7 @@ var init_banner_renderer = __esm({
1811
1834
  const step = context.guide.guideSteps[idx];
1812
1835
  if (!step) return;
1813
1836
  const position = step.style?.position === "bottom" ? "bottom" : "top";
1814
- const selector = context.nav ? null : step.selector?.trim() ?? null;
1837
+ const selector = step.selector?.trim() || null;
1815
1838
  let anchor = null;
1816
1839
  if (selector) {
1817
1840
  anchor = await waitForElement(selector);