veo-sdk 0.3.12 → 0.3.15

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 { createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-EF4BZR5R.mjs';
2
+ import './chunk-2INDL77W.mjs';
3
+ import './chunk-PTG3BTJE.mjs';
4
+ //# sourceMappingURL=builder-BKLDSVN5.mjs.map
5
+ //# sourceMappingURL=builder-BKLDSVN5.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"builder-K2NEYSSB.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"builder-BKLDSVN5.mjs"}
package/dist/builder.cjs CHANGED
@@ -455,6 +455,15 @@ function applyDesignVars(host, style) {
455
455
  host.style.setProperty(key, value);
456
456
  }
457
457
  }
458
+ if (typeof s.background === "string" && COLOR_RE.test(s.background.trim())) {
459
+ host.style.setProperty("--veo-bg", s.background.trim());
460
+ }
461
+ if (typeof s.textColor === "string" && COLOR_RE.test(s.textColor.trim())) {
462
+ host.style.setProperty("--veo-text", s.textColor.trim());
463
+ }
464
+ if (typeof s.textSecondaryColor === "string" && COLOR_RE.test(s.textSecondaryColor.trim())) {
465
+ host.style.setProperty("--veo-text-secondary", s.textSecondaryColor.trim());
466
+ }
458
467
  if (typeof s.radius === "number" && Number.isFinite(s.radius)) {
459
468
  host.style.setProperty("--veo-radius", `${clamp(s.radius, 0, 48)}px`);
460
469
  }
@@ -496,10 +505,26 @@ function applyDesignVars(host, style) {
496
505
  applyElementVars(host, "title", el.title);
497
506
  applyElementVars(host, "text", el.text);
498
507
  applyElementVars(host, "image", el.image);
499
- const cta = el.cta;
500
- if (cta && typeof cta.align === "string" && ALIGN_JUSTIFY[cta.align]) {
501
- host.style.setProperty("--veo-actions-justify", ALIGN_JUSTIFY[cta.align]);
502
- }
508
+ applyCtaVars(host, el.cta);
509
+ }
510
+ }
511
+ function applyCtaVars(host, raw) {
512
+ if (!raw || typeof raw !== "object") return;
513
+ const cta = raw;
514
+ if (typeof cta.align === "string" && ALIGN_JUSTIFY[cta.align]) {
515
+ host.style.setProperty("--veo-actions-justify", ALIGN_JUSTIFY[cta.align]);
516
+ }
517
+ if (typeof cta.background === "string" && COLOR_RE.test(cta.background.trim())) {
518
+ host.style.setProperty("--veo-cta-bg", cta.background.trim());
519
+ }
520
+ if (typeof cta.color === "string" && COLOR_RE.test(cta.color.trim())) {
521
+ host.style.setProperty("--veo-cta-color", cta.color.trim());
522
+ }
523
+ if (typeof cta.fontSize === "number" && Number.isFinite(cta.fontSize)) {
524
+ host.style.setProperty("--veo-cta-size", `${clamp(cta.fontSize, 10, 24)}px`);
525
+ }
526
+ if (typeof cta.radius === "number" && Number.isFinite(cta.radius)) {
527
+ host.style.setProperty("--veo-cta-radius", `${clamp(cta.radius, 0, 48)}px`);
503
528
  }
504
529
  }
505
530
  function applyElementVars(host, prefix, raw) {
@@ -533,7 +558,7 @@ function applyElementVars(host, prefix, raw) {
533
558
  // src/plugins/guides/styles.ts
534
559
  var GUIDE_STYLES = `
535
560
  :host {
536
- --veo-primary: #4f46e5;
561
+ --veo-primary: #FF5B35;
537
562
  --veo-text: #1f2937;
538
563
  --veo-text-secondary: #4b5563;
539
564
  --veo-bg: #ffffff;
@@ -651,9 +676,10 @@ var GUIDE_STYLES = `
651
676
  display: flex; gap: 8px; justify-content: var(--veo-actions-justify);
652
677
  }
653
678
  .veo-guide-cta {
654
- background: var(--veo-primary); color: #fff; border: none;
655
- padding: 9px 18px; border-radius: 8px;
656
- font-size: 14px; font-weight: 500; cursor: pointer;
679
+ background: var(--veo-cta-bg, var(--veo-primary));
680
+ color: var(--veo-cta-color, #fff); border: none;
681
+ padding: 9px 18px; border-radius: var(--veo-cta-radius, 8px);
682
+ font-size: var(--veo-cta-size, 14px); font-weight: 500; cursor: pointer;
657
683
  transition: opacity 120ms ease;
658
684
  }
659
685
  .veo-guide-cta:hover { opacity: 0.9; }
@@ -666,6 +692,24 @@ var GUIDE_STYLES = `
666
692
  cursor: pointer; color: #9ca3af; padding: 0;
667
693
  }
668
694
  .veo-guide-close:hover { color: var(--veo-text); }
695
+ /*
696
+ * Si el PRIMER bloque es una imagen, la \u2715 quedar\xEDa sobre la esquina de la foto
697
+ * (invisible seg\xFAn el color). En ese caso pasa a ser una pastilla flotante con
698
+ * fondo propio, legible sobre cualquier imagen. (Sin soporte de :has() queda el
699
+ * estilo base \u2014 mismo comportamiento de antes, sin regresi\xF3n.)
700
+ */
701
+ .veo-guide-content:has(> .veo-guide-image:first-child) > .veo-guide-close {
702
+ top: 2px; right: 2px;
703
+ display: flex; align-items: center; justify-content: center;
704
+ font-size: 16px; color: #374151;
705
+ background: rgba(255, 255, 255, 0.92);
706
+ border: 1px solid rgba(0, 0, 0, 0.08);
707
+ border-radius: 50%;
708
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
709
+ }
710
+ .veo-guide-content:has(> .veo-guide-image:first-child) > .veo-guide-close:hover {
711
+ color: #111827;
712
+ }
669
713
 
670
714
  .veo-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
671
715
  .veo-form-field { display: flex; flex-direction: column; gap: 6px; }
@@ -958,7 +1002,7 @@ function mountCustomFrame(doc, step, context, opts) {
958
1002
  const iframe = doc.createElement("iframe");
959
1003
  iframe.className = "veo-custom-frame";
960
1004
  iframe.setAttribute("sandbox", "allow-scripts");
961
- iframe.setAttribute("title", context.guide.guideName || "Veo");
1005
+ iframe.setAttribute("title", context.guide.guideName || "OnUser");
962
1006
  iframe.style.width = opts.width;
963
1007
  const hasFixedHeight = opts.fixedHeight !== void 0 && opts.fixedHeight !== null;
964
1008
  if (hasFixedHeight) iframe.style.height = toCssSize(opts.fixedHeight);
@@ -1218,7 +1262,7 @@ function mountFormContent(card, context, doc) {
1218
1262
  const empty = value === void 0 || value === null || value === "";
1219
1263
  if (empty) {
1220
1264
  if (field.required) {
1221
- error.textContent = `Complet\xE1 "${field.label}"`;
1265
+ error.textContent = `Completa "${field.label}"`;
1222
1266
  error.style.display = "block";
1223
1267
  return;
1224
1268
  }
@@ -1227,7 +1271,7 @@ function mountFormContent(card, context, doc) {
1227
1271
  answers[field.key] = value;
1228
1272
  }
1229
1273
  if (Object.keys(answers).length === 0) {
1230
- error.textContent = "Respond\xE9 al menos un campo";
1274
+ error.textContent = "Responde al menos un campo";
1231
1275
  error.style.display = "block";
1232
1276
  return;
1233
1277
  }
@@ -1236,7 +1280,7 @@ function mountFormContent(card, context, doc) {
1236
1280
  void submitFn(answers).then((ok) => {
1237
1281
  if (!ok) {
1238
1282
  submit.disabled = false;
1239
- error.textContent = "No se pudo enviar. Prob\xE1 de nuevo.";
1283
+ error.textContent = "No se pudo enviar. Prueba de nuevo.";
1240
1284
  error.style.display = "block";
1241
1285
  return;
1242
1286
  }
@@ -1295,7 +1339,7 @@ function buildField(field, doc) {
1295
1339
  select.className = "veo-form-input";
1296
1340
  const blank = doc.createElement("option");
1297
1341
  blank.value = "";
1298
- blank.textContent = field.placeholder || "Eleg\xED una opci\xF3n\u2026";
1342
+ blank.textContent = field.placeholder || "Elige una opci\xF3n\u2026";
1299
1343
  select.appendChild(blank);
1300
1344
  for (const opt of field.options ?? []) {
1301
1345
  const option = doc.createElement("option");
@@ -1977,7 +2021,7 @@ function injectBuilderPanel(opts) {
1977
2021
  header.className = "veo-panel-header";
1978
2022
  const title = document.createElement("span");
1979
2023
  title.className = "veo-panel-title";
1980
- title.textContent = "Veo \xB7 Editor";
2024
+ title.textContent = "OnUser \xB7 Editor";
1981
2025
  const actions = document.createElement("div");
1982
2026
  actions.className = "veo-panel-actions";
1983
2027
  const popout = document.createElement("button");
@@ -2109,7 +2153,7 @@ var PANEL_CSS = `
2109
2153
  flex: 0 0 auto;
2110
2154
  display: flex; align-items: center; justify-content: space-between;
2111
2155
  padding: 8px 10px 8px 12px;
2112
- background: #0f172a; color: #fff;
2156
+ background: #1b1714; color: #f7f1eb;
2113
2157
  font-size: 13px; font-weight: 600;
2114
2158
  cursor: grab;
2115
2159
  }
@@ -2325,7 +2369,7 @@ var ElementPicker = class {
2325
2369
  this.label.style.display = "none";
2326
2370
  const hint = document.createElement("div");
2327
2371
  hint.className = "veo-pick-hint";
2328
- hint.textContent = options.hint ?? "Seleccion\xE1 un elemento \xB7 Esc para cancelar";
2372
+ hint.textContent = options.hint ?? "Selecciona un elemento \xB7 Esc para cancelar";
2329
2373
  shadow.append(style, this.box, this.label, hint);
2330
2374
  document.body.appendChild(host);
2331
2375
  this.host = host;