veo-sdk 0.5.0 → 0.5.1

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 { attachDesignManipulator, createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-PGGUVH4V.mjs';
2
+ import './chunk-L3JSRBVO.mjs';
3
+ import './chunk-PTG3BTJE.mjs';
4
+ //# sourceMappingURL=builder-R2BHDQZH.mjs.map
5
+ //# sourceMappingURL=builder-R2BHDQZH.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"builder-AW37YKWO.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"builder-R2BHDQZH.mjs"}
package/dist/builder.cjs CHANGED
@@ -996,10 +996,22 @@ var GUIDE_STYLES = `
996
996
  padding: 3px 9px;
997
997
  white-space: nowrap;
998
998
  }
999
+ .veo-badge--text {
1000
+ color: var(--veo-primary);
1001
+ font-weight: 600;
1002
+ white-space: nowrap;
1003
+ text-decoration: underline dotted;
1004
+ text-underline-offset: 3px;
1005
+ }
999
1006
  .veo-badge--image img { display: block; border-radius: 4px; object-fit: cover; }
1000
1007
  /* 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
- .veo-badge-tooltip { position: fixed; }
1008
+ cliente; un absoluto se recortar\xEDa con overflow de ancestros). Su ancho es
1009
+ personalizable v\xEDa var dedicada (--veo-width no sirve: el :host la define
1010
+ en 420px siempre y pisar\xEDa el default de 300px de los tooltips). */
1011
+ .veo-badge-tooltip {
1012
+ position: fixed;
1013
+ max-width: var(--veo-badge-tip-width, 300px);
1014
+ }
1003
1015
  @keyframes veo-badge-pulse {
1004
1016
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--veo-primary) 45%, transparent); }
1005
1017
  70% { box-shadow: 0 0 0 7px transparent; }
@@ -1183,6 +1195,13 @@ var BadgeRenderer = class extends BaseRenderer {
1183
1195
  const { host, root } = this.createHost();
1184
1196
  const ownerDocument = root.ownerDocument ?? document;
1185
1197
  this.applyDesign(step.style);
1198
+ const tipWidth = step.style?.width;
1199
+ if (typeof tipWidth === "number" && Number.isFinite(tipWidth)) {
1200
+ host.style.setProperty(
1201
+ "--veo-badge-tip-width",
1202
+ `${Math.min(720, Math.max(220, tipWidth))}px`
1203
+ );
1204
+ }
1186
1205
  this.trigger = step.style?.badgeTrigger === "click" ? "click" : "hover";
1187
1206
  const rawSide = step.style?.tooltipPlacement;
1188
1207
  this.side = rawSide === "bottom" || rawSide === "left" || rawSide === "right" ? rawSide : "top";
@@ -1209,18 +1228,11 @@ var BadgeRenderer = class extends BaseRenderer {
1209
1228
  onCtaClick: (action, target, meta) => {
1210
1229
  emit("cta_clicked", meta);
1211
1230
  if (action === "url" && target) window.open(target, "_blank", "noopener,noreferrer");
1212
- if (action === "dismiss") {
1213
- emit("dismissed");
1214
- context.onClose();
1215
- return;
1216
- }
1217
1231
  this.closeTooltip();
1218
1232
  if (action === "guide" && target) context.onOpenGuide?.(target);
1219
1233
  },
1220
- onDismiss: () => {
1221
- emit("dismissed");
1222
- context.onClose();
1223
- }
1234
+ // La ✕ también cierra solo el tooltip (nunca el badge, nunca dismissed).
1235
+ onDismiss: () => this.closeTooltip()
1224
1236
  });
1225
1237
  const content = buildTooltipContent(step);
1226
1238
  tooltip.appendChild(content);
@@ -1351,7 +1363,7 @@ function readBadgeConfig(step) {
1351
1363
  const raw = step.style?.badge;
1352
1364
  if (!raw || typeof raw !== "object") return { kind: "icon" };
1353
1365
  const b = raw;
1354
- const kind = b.kind === "dot" || b.kind === "pill" || b.kind === "image" || b.kind === "icon" ? b.kind : "icon";
1366
+ const kind = b.kind === "dot" || b.kind === "pill" || b.kind === "text" || b.kind === "image" || b.kind === "icon" ? b.kind : "icon";
1355
1367
  return {
1356
1368
  kind,
1357
1369
  icon: typeof b.icon === "string" ? b.icon : null,
@@ -1382,6 +1394,12 @@ function buildBadgeElement(config, doc) {
1382
1394
  if (config.color) btn.style.background = config.color;
1383
1395
  break;
1384
1396
  }
1397
+ case "text": {
1398
+ btn.textContent = config.text?.slice(0, 32) || "Nuevo";
1399
+ btn.style.fontSize = `${clamp2(Math.round(size * 0.7), 9, 28)}px`;
1400
+ if (config.color) btn.style.color = config.color;
1401
+ break;
1402
+ }
1385
1403
  case "image": {
1386
1404
  if (config.imageUrl && isSafeUrl(config.imageUrl)) {
1387
1405
  const img = doc.createElement("img");