veo-sdk 0.5.0 → 0.5.2
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-LSWVQYFZ.mjs +5 -0
- package/dist/{builder-AW37YKWO.mjs.map → builder-LSWVQYFZ.mjs.map} +1 -1
- package/dist/builder.cjs +71 -30
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-3W47W3PI.mjs → chunk-2EH5DXVN.mjs} +3 -3
- package/dist/{chunk-3W47W3PI.mjs.map → chunk-2EH5DXVN.mjs.map} +1 -1
- package/dist/{chunk-UJTSYDQ6.mjs → chunk-5QI3UUE5.mjs} +73 -32
- package/dist/chunk-5QI3UUE5.mjs.map +1 -0
- package/dist/{chunk-H464CQY3.mjs → chunk-7Q7IBICO.mjs} +3 -3
- package/dist/{chunk-H464CQY3.mjs.map → chunk-7Q7IBICO.mjs.map} +1 -1
- package/dist/index.cjs +71 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/veo-builder.js +33 -9
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +31 -7
- package/dist/veo-guides.js.map +1 -1
- package/package.json +2 -2
- package/dist/builder-AW37YKWO.mjs +0 -5
- package/dist/chunk-UJTSYDQ6.mjs.map +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { attachDesignManipulator, createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-7Q7IBICO.mjs';
|
|
2
|
+
import './chunk-5QI3UUE5.mjs';
|
|
3
|
+
import './chunk-PTG3BTJE.mjs';
|
|
4
|
+
//# sourceMappingURL=builder-LSWVQYFZ.mjs.map
|
|
5
|
+
//# sourceMappingURL=builder-LSWVQYFZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"builder-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"builder-LSWVQYFZ.mjs"}
|
package/dist/builder.cjs
CHANGED
|
@@ -265,6 +265,33 @@ function buildStepContent(step, doc, callbacks) {
|
|
|
265
265
|
container.appendChild(createCloseButton(doc, () => callbacks.onDismiss()));
|
|
266
266
|
return container;
|
|
267
267
|
}
|
|
268
|
+
function buildContentNodes(step, doc) {
|
|
269
|
+
const blocks = normalizeBlocks(step);
|
|
270
|
+
if (blocks) {
|
|
271
|
+
return blocks.filter((b) => b.type !== "button").map((b) => buildContentBlock(b, doc)).filter((n) => n !== null);
|
|
272
|
+
}
|
|
273
|
+
const nodes = [];
|
|
274
|
+
if (typeof step.imageUrl === "string" && step.imageUrl && isSafeUrl(step.imageUrl)) {
|
|
275
|
+
const img = doc.createElement("img");
|
|
276
|
+
img.className = "veo-guide-image";
|
|
277
|
+
img.src = step.imageUrl;
|
|
278
|
+
img.alt = typeof step.title === "string" ? step.title : "";
|
|
279
|
+
nodes.push(img);
|
|
280
|
+
}
|
|
281
|
+
if (typeof step.title === "string" && step.title) {
|
|
282
|
+
const heading = doc.createElement("h2");
|
|
283
|
+
heading.className = "veo-guide-title";
|
|
284
|
+
heading.textContent = step.title;
|
|
285
|
+
nodes.push(heading);
|
|
286
|
+
}
|
|
287
|
+
if (typeof step.content === "string" && step.content) {
|
|
288
|
+
const paragraph = doc.createElement("p");
|
|
289
|
+
paragraph.className = "veo-guide-text";
|
|
290
|
+
paragraph.textContent = step.content;
|
|
291
|
+
nodes.push(paragraph);
|
|
292
|
+
}
|
|
293
|
+
return nodes;
|
|
294
|
+
}
|
|
268
295
|
function renderLegacyStep(container, step, doc, callbacks) {
|
|
269
296
|
if (typeof step.imageUrl === "string" && step.imageUrl && isSafeUrl(step.imageUrl)) {
|
|
270
297
|
const img = doc.createElement("img");
|
|
@@ -830,6 +857,18 @@ var GUIDE_STYLES = `
|
|
|
830
857
|
.veo-guide-text em { font-style: italic; }
|
|
831
858
|
.veo-guide-text u { text-decoration: underline; }
|
|
832
859
|
.veo-guide-text s { text-decoration: line-through; }
|
|
860
|
+
/*
|
|
861
|
+
* El \xDALTIMO bloque de contenido no deja su margin-bottom colgando: ese margen
|
|
862
|
+
* existe para separar del bloque SIGUIENTE, y sin siguiente se suma al padding
|
|
863
|
+
* de la tarjeta y parece un "hueco fantasma" (p.ej. quitar el bot\xF3n de un
|
|
864
|
+
* tooltip dejaba el espacio como si siguiera ah\xED). El pen\xFAltimo hijo es el
|
|
865
|
+
* \xFAltimo bloque real (el \u2715 de cerrar siempre va \xFAltimo y es absoluto). La
|
|
866
|
+
* mayor especificidad le gana a las reglas por clase, pero NO a un margen
|
|
867
|
+
* inline elegido expl\xEDcitamente por el autor (block.style.marginBottom).
|
|
868
|
+
*/
|
|
869
|
+
.veo-guide-content > :nth-last-child(2) {
|
|
870
|
+
margin-bottom: 0;
|
|
871
|
+
}
|
|
833
872
|
.veo-guide-actions {
|
|
834
873
|
display: flex; gap: 8px; justify-content: var(--veo-actions-justify);
|
|
835
874
|
}
|
|
@@ -996,10 +1035,22 @@ var GUIDE_STYLES = `
|
|
|
996
1035
|
padding: 3px 9px;
|
|
997
1036
|
white-space: nowrap;
|
|
998
1037
|
}
|
|
1038
|
+
.veo-badge--text {
|
|
1039
|
+
color: var(--veo-primary);
|
|
1040
|
+
font-weight: 600;
|
|
1041
|
+
white-space: nowrap;
|
|
1042
|
+
text-decoration: underline dotted;
|
|
1043
|
+
text-underline-offset: 3px;
|
|
1044
|
+
}
|
|
999
1045
|
.veo-badge--image img { display: block; border-radius: 4px; object-fit: cover; }
|
|
1000
1046
|
/* El tooltip del badge usa strategy fixed (el host vive dentro del flujo del
|
|
1001
|
-
cliente; un absoluto se recortar\xEDa con overflow de ancestros).
|
|
1002
|
-
|
|
1047
|
+
cliente; un absoluto se recortar\xEDa con overflow de ancestros). Su ancho es
|
|
1048
|
+
personalizable v\xEDa var dedicada (--veo-width no sirve: el :host la define
|
|
1049
|
+
en 420px siempre y pisar\xEDa el default de 300px de los tooltips). */
|
|
1050
|
+
.veo-badge-tooltip {
|
|
1051
|
+
position: fixed;
|
|
1052
|
+
max-width: var(--veo-badge-tip-width, 300px);
|
|
1053
|
+
}
|
|
1003
1054
|
@keyframes veo-badge-pulse {
|
|
1004
1055
|
0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--veo-primary) 45%, transparent); }
|
|
1005
1056
|
70% { box-shadow: 0 0 0 7px transparent; }
|
|
@@ -1183,6 +1234,13 @@ var BadgeRenderer = class extends BaseRenderer {
|
|
|
1183
1234
|
const { host, root } = this.createHost();
|
|
1184
1235
|
const ownerDocument = root.ownerDocument ?? document;
|
|
1185
1236
|
this.applyDesign(step.style);
|
|
1237
|
+
const tipWidth = step.style?.width;
|
|
1238
|
+
if (typeof tipWidth === "number" && Number.isFinite(tipWidth)) {
|
|
1239
|
+
host.style.setProperty(
|
|
1240
|
+
"--veo-badge-tip-width",
|
|
1241
|
+
`${Math.min(720, Math.max(220, tipWidth))}px`
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1186
1244
|
this.trigger = step.style?.badgeTrigger === "click" ? "click" : "hover";
|
|
1187
1245
|
const rawSide = step.style?.tooltipPlacement;
|
|
1188
1246
|
this.side = rawSide === "bottom" || rawSide === "left" || rawSide === "right" ? rawSide : "top";
|
|
@@ -1209,18 +1267,11 @@ var BadgeRenderer = class extends BaseRenderer {
|
|
|
1209
1267
|
onCtaClick: (action, target, meta) => {
|
|
1210
1268
|
emit("cta_clicked", meta);
|
|
1211
1269
|
if (action === "url" && target) window.open(target, "_blank", "noopener,noreferrer");
|
|
1212
|
-
if (action === "dismiss") {
|
|
1213
|
-
emit("dismissed");
|
|
1214
|
-
context.onClose();
|
|
1215
|
-
return;
|
|
1216
|
-
}
|
|
1217
1270
|
this.closeTooltip();
|
|
1218
1271
|
if (action === "guide" && target) context.onOpenGuide?.(target);
|
|
1219
1272
|
},
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
context.onClose();
|
|
1223
|
-
}
|
|
1273
|
+
// La ✕ también cierra solo el tooltip (nunca el badge, nunca dismissed).
|
|
1274
|
+
onDismiss: () => this.closeTooltip()
|
|
1224
1275
|
});
|
|
1225
1276
|
const content = buildTooltipContent(step);
|
|
1226
1277
|
tooltip.appendChild(content);
|
|
@@ -1351,7 +1402,7 @@ function readBadgeConfig(step) {
|
|
|
1351
1402
|
const raw = step.style?.badge;
|
|
1352
1403
|
if (!raw || typeof raw !== "object") return { kind: "icon" };
|
|
1353
1404
|
const b = raw;
|
|
1354
|
-
const kind = b.kind === "dot" || b.kind === "pill" || b.kind === "image" || b.kind === "icon" ? b.kind : "icon";
|
|
1405
|
+
const kind = b.kind === "dot" || b.kind === "pill" || b.kind === "text" || b.kind === "image" || b.kind === "icon" ? b.kind : "icon";
|
|
1355
1406
|
return {
|
|
1356
1407
|
kind,
|
|
1357
1408
|
icon: typeof b.icon === "string" ? b.icon : null,
|
|
@@ -1382,6 +1433,12 @@ function buildBadgeElement(config, doc) {
|
|
|
1382
1433
|
if (config.color) btn.style.background = config.color;
|
|
1383
1434
|
break;
|
|
1384
1435
|
}
|
|
1436
|
+
case "text": {
|
|
1437
|
+
btn.textContent = config.text?.slice(0, 32) || "Nuevo";
|
|
1438
|
+
btn.style.fontSize = `${clamp2(Math.round(size * 0.7), 9, 28)}px`;
|
|
1439
|
+
if (config.color) btn.style.color = config.color;
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1385
1442
|
case "image": {
|
|
1386
1443
|
if (config.imageUrl && isSafeUrl(config.imageUrl)) {
|
|
1387
1444
|
const img = doc.createElement("img");
|
|
@@ -1429,24 +1486,8 @@ function buildWalkthroughStepContent(step, stepIndex, totalSteps, doc, callbacks
|
|
|
1429
1486
|
progress.appendChild(dot);
|
|
1430
1487
|
}
|
|
1431
1488
|
container.appendChild(progress);
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
img.className = "veo-guide-image";
|
|
1435
|
-
img.src = step.imageUrl;
|
|
1436
|
-
img.alt = typeof step.title === "string" ? step.title : "";
|
|
1437
|
-
container.appendChild(img);
|
|
1438
|
-
}
|
|
1439
|
-
if (typeof step.title === "string" && step.title) {
|
|
1440
|
-
const heading = doc.createElement("h2");
|
|
1441
|
-
heading.className = "veo-guide-title";
|
|
1442
|
-
heading.textContent = step.title;
|
|
1443
|
-
container.appendChild(heading);
|
|
1444
|
-
}
|
|
1445
|
-
if (typeof step.content === "string" && step.content) {
|
|
1446
|
-
const paragraph = doc.createElement("p");
|
|
1447
|
-
paragraph.className = "veo-guide-text";
|
|
1448
|
-
paragraph.textContent = step.content;
|
|
1449
|
-
container.appendChild(paragraph);
|
|
1489
|
+
for (const node of buildContentNodes(step, doc)) {
|
|
1490
|
+
container.appendChild(node);
|
|
1450
1491
|
}
|
|
1451
1492
|
const actions = doc.createElement("div");
|
|
1452
1493
|
actions.className = "veo-walkthrough-actions";
|