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.
- package/dist/builder-BKLDSVN5.mjs +5 -0
- package/dist/{builder-K2NEYSSB.mjs.map → builder-BKLDSVN5.mjs.map} +1 -1
- package/dist/builder.cjs +60 -16
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-QSMHZVDK.mjs → chunk-2INDL77W.mjs} +59 -15
- package/dist/chunk-2INDL77W.mjs.map +1 -0
- package/dist/{chunk-US3RVEXR.mjs → chunk-EF4BZR5R.mjs} +6 -6
- package/dist/chunk-EF4BZR5R.mjs.map +1 -0
- package/dist/{chunk-HOF4GU5I.mjs → chunk-WVLVN422.mjs} +4 -4
- package/dist/chunk-WVLVN422.mjs.map +1 -0
- package/dist/index.cjs +61 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/veo-builder.js +29 -10
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +27 -8
- package/dist/veo-guides.js.map +1 -1
- package/dist/veo.js.map +1 -1
- package/package.json +1 -1
- package/dist/builder-K2NEYSSB.mjs +0 -5
- package/dist/chunk-HOF4GU5I.mjs.map +0 -1
- package/dist/chunk-QSMHZVDK.mjs.map +0 -1
- package/dist/chunk-US3RVEXR.mjs.map +0 -1
package/dist/builder.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
import { initBuilderMode } from './chunk-
|
|
3
|
-
export { createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-
|
|
4
|
-
export { closeGuidePreview, previewGuide } from './chunk-
|
|
1
|
+
import './chunk-WVLVN422.mjs';
|
|
2
|
+
import { initBuilderMode } from './chunk-EF4BZR5R.mjs';
|
|
3
|
+
export { createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-EF4BZR5R.mjs';
|
|
4
|
+
export { closeGuidePreview, previewGuide } from './chunk-2INDL77W.mjs';
|
|
5
5
|
import './chunk-PTG3BTJE.mjs';
|
|
6
6
|
|
|
7
7
|
// src/builder.ts
|
|
@@ -475,6 +475,15 @@ function applyDesignVars(host, style) {
|
|
|
475
475
|
host.style.setProperty(key, value);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
+
if (typeof s.background === "string" && COLOR_RE.test(s.background.trim())) {
|
|
479
|
+
host.style.setProperty("--veo-bg", s.background.trim());
|
|
480
|
+
}
|
|
481
|
+
if (typeof s.textColor === "string" && COLOR_RE.test(s.textColor.trim())) {
|
|
482
|
+
host.style.setProperty("--veo-text", s.textColor.trim());
|
|
483
|
+
}
|
|
484
|
+
if (typeof s.textSecondaryColor === "string" && COLOR_RE.test(s.textSecondaryColor.trim())) {
|
|
485
|
+
host.style.setProperty("--veo-text-secondary", s.textSecondaryColor.trim());
|
|
486
|
+
}
|
|
478
487
|
if (typeof s.radius === "number" && Number.isFinite(s.radius)) {
|
|
479
488
|
host.style.setProperty("--veo-radius", `${clamp(s.radius, 0, 48)}px`);
|
|
480
489
|
}
|
|
@@ -516,10 +525,26 @@ function applyDesignVars(host, style) {
|
|
|
516
525
|
applyElementVars(host, "title", el.title);
|
|
517
526
|
applyElementVars(host, "text", el.text);
|
|
518
527
|
applyElementVars(host, "image", el.image);
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
528
|
+
applyCtaVars(host, el.cta);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function applyCtaVars(host, raw) {
|
|
532
|
+
if (!raw || typeof raw !== "object") return;
|
|
533
|
+
const cta = raw;
|
|
534
|
+
if (typeof cta.align === "string" && ALIGN_JUSTIFY[cta.align]) {
|
|
535
|
+
host.style.setProperty("--veo-actions-justify", ALIGN_JUSTIFY[cta.align]);
|
|
536
|
+
}
|
|
537
|
+
if (typeof cta.background === "string" && COLOR_RE.test(cta.background.trim())) {
|
|
538
|
+
host.style.setProperty("--veo-cta-bg", cta.background.trim());
|
|
539
|
+
}
|
|
540
|
+
if (typeof cta.color === "string" && COLOR_RE.test(cta.color.trim())) {
|
|
541
|
+
host.style.setProperty("--veo-cta-color", cta.color.trim());
|
|
542
|
+
}
|
|
543
|
+
if (typeof cta.fontSize === "number" && Number.isFinite(cta.fontSize)) {
|
|
544
|
+
host.style.setProperty("--veo-cta-size", `${clamp(cta.fontSize, 10, 24)}px`);
|
|
545
|
+
}
|
|
546
|
+
if (typeof cta.radius === "number" && Number.isFinite(cta.radius)) {
|
|
547
|
+
host.style.setProperty("--veo-cta-radius", `${clamp(cta.radius, 0, 48)}px`);
|
|
523
548
|
}
|
|
524
549
|
}
|
|
525
550
|
function applyElementVars(host, prefix, raw) {
|
|
@@ -553,7 +578,7 @@ function applyElementVars(host, prefix, raw) {
|
|
|
553
578
|
// src/plugins/guides/styles.ts
|
|
554
579
|
var GUIDE_STYLES = `
|
|
555
580
|
:host {
|
|
556
|
-
--veo-primary: #
|
|
581
|
+
--veo-primary: #FF5B35;
|
|
557
582
|
--veo-text: #1f2937;
|
|
558
583
|
--veo-text-secondary: #4b5563;
|
|
559
584
|
--veo-bg: #ffffff;
|
|
@@ -671,9 +696,10 @@ var GUIDE_STYLES = `
|
|
|
671
696
|
display: flex; gap: 8px; justify-content: var(--veo-actions-justify);
|
|
672
697
|
}
|
|
673
698
|
.veo-guide-cta {
|
|
674
|
-
background: var(--veo-primary);
|
|
675
|
-
|
|
676
|
-
|
|
699
|
+
background: var(--veo-cta-bg, var(--veo-primary));
|
|
700
|
+
color: var(--veo-cta-color, #fff); border: none;
|
|
701
|
+
padding: 9px 18px; border-radius: var(--veo-cta-radius, 8px);
|
|
702
|
+
font-size: var(--veo-cta-size, 14px); font-weight: 500; cursor: pointer;
|
|
677
703
|
transition: opacity 120ms ease;
|
|
678
704
|
}
|
|
679
705
|
.veo-guide-cta:hover { opacity: 0.9; }
|
|
@@ -686,6 +712,24 @@ var GUIDE_STYLES = `
|
|
|
686
712
|
cursor: pointer; color: #9ca3af; padding: 0;
|
|
687
713
|
}
|
|
688
714
|
.veo-guide-close:hover { color: var(--veo-text); }
|
|
715
|
+
/*
|
|
716
|
+
* Si el PRIMER bloque es una imagen, la \u2715 quedar\xEDa sobre la esquina de la foto
|
|
717
|
+
* (invisible seg\xFAn el color). En ese caso pasa a ser una pastilla flotante con
|
|
718
|
+
* fondo propio, legible sobre cualquier imagen. (Sin soporte de :has() queda el
|
|
719
|
+
* estilo base \u2014 mismo comportamiento de antes, sin regresi\xF3n.)
|
|
720
|
+
*/
|
|
721
|
+
.veo-guide-content:has(> .veo-guide-image:first-child) > .veo-guide-close {
|
|
722
|
+
top: 2px; right: 2px;
|
|
723
|
+
display: flex; align-items: center; justify-content: center;
|
|
724
|
+
font-size: 16px; color: #374151;
|
|
725
|
+
background: rgba(255, 255, 255, 0.92);
|
|
726
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
727
|
+
border-radius: 50%;
|
|
728
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
|
|
729
|
+
}
|
|
730
|
+
.veo-guide-content:has(> .veo-guide-image:first-child) > .veo-guide-close:hover {
|
|
731
|
+
color: #111827;
|
|
732
|
+
}
|
|
689
733
|
|
|
690
734
|
.veo-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
|
|
691
735
|
.veo-form-field { display: flex; flex-direction: column; gap: 6px; }
|
|
@@ -978,7 +1022,7 @@ function mountCustomFrame(doc, step, context, opts) {
|
|
|
978
1022
|
const iframe = doc.createElement("iframe");
|
|
979
1023
|
iframe.className = "veo-custom-frame";
|
|
980
1024
|
iframe.setAttribute("sandbox", "allow-scripts");
|
|
981
|
-
iframe.setAttribute("title", context.guide.guideName || "
|
|
1025
|
+
iframe.setAttribute("title", context.guide.guideName || "OnUser");
|
|
982
1026
|
iframe.style.width = opts.width;
|
|
983
1027
|
const hasFixedHeight = opts.fixedHeight !== void 0 && opts.fixedHeight !== null;
|
|
984
1028
|
if (hasFixedHeight) iframe.style.height = toCssSize(opts.fixedHeight);
|
|
@@ -1238,7 +1282,7 @@ function mountFormContent(card, context, doc) {
|
|
|
1238
1282
|
const empty = value === void 0 || value === null || value === "";
|
|
1239
1283
|
if (empty) {
|
|
1240
1284
|
if (field.required) {
|
|
1241
|
-
error.textContent = `
|
|
1285
|
+
error.textContent = `Completa "${field.label}"`;
|
|
1242
1286
|
error.style.display = "block";
|
|
1243
1287
|
return;
|
|
1244
1288
|
}
|
|
@@ -1247,7 +1291,7 @@ function mountFormContent(card, context, doc) {
|
|
|
1247
1291
|
answers[field.key] = value;
|
|
1248
1292
|
}
|
|
1249
1293
|
if (Object.keys(answers).length === 0) {
|
|
1250
|
-
error.textContent = "
|
|
1294
|
+
error.textContent = "Responde al menos un campo";
|
|
1251
1295
|
error.style.display = "block";
|
|
1252
1296
|
return;
|
|
1253
1297
|
}
|
|
@@ -1256,7 +1300,7 @@ function mountFormContent(card, context, doc) {
|
|
|
1256
1300
|
void submitFn(answers).then((ok) => {
|
|
1257
1301
|
if (!ok) {
|
|
1258
1302
|
submit.disabled = false;
|
|
1259
|
-
error.textContent = "No se pudo enviar.
|
|
1303
|
+
error.textContent = "No se pudo enviar. Prueba de nuevo.";
|
|
1260
1304
|
error.style.display = "block";
|
|
1261
1305
|
return;
|
|
1262
1306
|
}
|
|
@@ -1315,7 +1359,7 @@ function buildField(field, doc) {
|
|
|
1315
1359
|
select.className = "veo-form-input";
|
|
1316
1360
|
const blank = doc.createElement("option");
|
|
1317
1361
|
blank.value = "";
|
|
1318
|
-
blank.textContent = field.placeholder || "
|
|
1362
|
+
blank.textContent = field.placeholder || "Elige una opci\xF3n\u2026";
|
|
1319
1363
|
select.appendChild(blank);
|
|
1320
1364
|
for (const opt of field.options ?? []) {
|
|
1321
1365
|
const option = doc.createElement("option");
|
|
@@ -2098,5 +2142,5 @@ function buildSelectorPath(element, maxAncestors = 5) {
|
|
|
2098
2142
|
}
|
|
2099
2143
|
|
|
2100
2144
|
export { ALWAYS_BLOCK_SELECTORS, BannerRenderer, CustomRenderer, DEFAULT_AUTOCAPTURE_CONFIG, DEFAULT_TRACKER_BATCH_SIZE, DEFAULT_TRACKER_FLUSH_INTERVAL_MS, DEFAULT_TRACKER_MAX_RETRIES, FREQUENCY_CACHE_KEY_PREFIX, FREQUENCY_CACHE_MAX_ENTRIES, FREQUENCY_CACHE_TTL_MS, FormRenderer, InlineCustomRenderer, InlineFormRenderer, InlineRenderer, MAX_ANCESTORS, ModalRenderer, PRIORITY_ATTRIBUTES, SENSITIVE_ATTRIBUTES, TooltipRenderer, WALKTHROUGH_ABANDONMENT_TIMEOUT_MS, WALKTHROUGH_STATE_KEY_PREFIX, WalkthroughRenderer, buildSelectorPath, clearBuilderToken, closeGuidePreview, filterHumanClasses, hasDocument, hasLocalStorage, hasNavigatorSendBeacon, hasWindow, isBuilderMode, previewGuide, resolveBuilderContext, resolveBuilderToken, uuidv7 };
|
|
2101
|
-
//# sourceMappingURL=chunk-
|
|
2102
|
-
//# sourceMappingURL=chunk-
|
|
2145
|
+
//# sourceMappingURL=chunk-2INDL77W.mjs.map
|
|
2146
|
+
//# sourceMappingURL=chunk-2INDL77W.mjs.map
|