@charisol/plexo-sdk 1.4.5 → 1.4.7
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/PlexoRenderer.d.ts +7 -0
- package/dist/{compiler-Zh5KObm4.js → compiler-DFybM5XW.js} +270 -150
- package/dist/compiler.js +1 -1
- package/dist/compilerClient-DNKp-n6N.js +371 -0
- package/dist/compilerClient.js +1 -1
- package/dist/components/icons.d.ts +7 -0
- package/dist/components/properties/accordionSections/CommerceProductPropertiesAccordion.d.ts +10 -0
- package/dist/components/sidebarTabs/ContentTab.d.ts +6 -0
- package/dist/{iconSvgStatic-DEgDUD68.js → iconSvgStatic-CGue7nyp.js} +61 -660
- package/dist/index.js +15487 -14433
- package/dist/utilities/playground.helpers.d.ts +214 -0
- package/dist/utilities/playground.interfaces.d.ts +21 -0
- package/dist/utilities/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/compilerClient-BwRHkl-b.js +0 -254
- package/dist/utilities/googleFonts.d.ts +0 -17
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, g as i, h as a, i as o,
|
|
1
|
+
import { a as e, c as t, d as n, f as r, g as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h, x as g } from "./iconSvgStatic-CGue7nyp.js";
|
|
2
2
|
//#region src/utilities/responsiveDefaults.ts
|
|
3
|
-
var
|
|
3
|
+
var _ = {
|
|
4
4
|
tablet: {
|
|
5
5
|
thresholdPx: 24,
|
|
6
6
|
scale: .85,
|
|
@@ -11,7 +11,7 @@ var y = {
|
|
|
11
11
|
scale: .7,
|
|
12
12
|
floorPx: 14
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, v = {
|
|
15
15
|
tablet: {
|
|
16
16
|
thresholdPx: 320,
|
|
17
17
|
scale: .8,
|
|
@@ -22,7 +22,7 @@ var y = {
|
|
|
22
22
|
scale: .55,
|
|
23
23
|
floorPx: 140
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, y = {
|
|
26
26
|
tablet: {
|
|
27
27
|
thresholdPx: 48,
|
|
28
28
|
scale: .75,
|
|
@@ -33,7 +33,7 @@ var y = {
|
|
|
33
33
|
scale: .55,
|
|
34
34
|
floorPx: 16
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, b = {
|
|
37
37
|
tablet: {
|
|
38
38
|
thresholdPx: 500,
|
|
39
39
|
scale: 1,
|
|
@@ -44,11 +44,11 @@ var y = {
|
|
|
44
44
|
scale: 1,
|
|
45
45
|
floorPx: 0
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, x = ["fontSize"], S = [
|
|
48
48
|
"height",
|
|
49
49
|
"minHeight",
|
|
50
50
|
"maxHeight"
|
|
51
|
-
],
|
|
51
|
+
], C = [
|
|
52
52
|
"padding",
|
|
53
53
|
"paddingTop",
|
|
54
54
|
"paddingBottom",
|
|
@@ -57,8 +57,8 @@ var y = {
|
|
|
57
57
|
"margin",
|
|
58
58
|
"marginTop",
|
|
59
59
|
"marginBottom"
|
|
60
|
-
],
|
|
61
|
-
function
|
|
60
|
+
], w = ["width", "maxWidth"];
|
|
61
|
+
function T(e) {
|
|
62
62
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
63
63
|
if (typeof e != "string") return null;
|
|
64
64
|
let t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/);
|
|
@@ -66,48 +66,48 @@ function D(e) {
|
|
|
66
66
|
let n = parseFloat(t[1]);
|
|
67
67
|
return Number.isFinite(n) ? n : null;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function E(e, t) {
|
|
70
70
|
return e < t.thresholdPx ? null : Math.max(Math.round(e * t.scale), t.floorPx);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function D(e, t) {
|
|
73
73
|
if (!e || typeof e != "object") return {};
|
|
74
74
|
let n = {};
|
|
75
|
-
for (let r of
|
|
76
|
-
let i =
|
|
75
|
+
for (let r of x) {
|
|
76
|
+
let i = T(e[r]);
|
|
77
77
|
if (i === null) continue;
|
|
78
|
-
let a =
|
|
78
|
+
let a = E(i, _[t]);
|
|
79
79
|
a !== null && (n[r] = `${a}px`);
|
|
80
80
|
}
|
|
81
|
-
for (let r of
|
|
82
|
-
let i =
|
|
81
|
+
for (let r of S) {
|
|
82
|
+
let i = T(e[r]);
|
|
83
83
|
if (i === null) continue;
|
|
84
|
-
let a =
|
|
84
|
+
let a = E(i, v[t]);
|
|
85
85
|
a !== null && (n[r] = `${a}px`);
|
|
86
86
|
}
|
|
87
|
-
for (let r of
|
|
88
|
-
let i =
|
|
87
|
+
for (let r of C) {
|
|
88
|
+
let i = T(e[r]);
|
|
89
89
|
if (i === null) continue;
|
|
90
|
-
let a =
|
|
90
|
+
let a = E(i, y[t]);
|
|
91
91
|
a !== null && (n[r] = `${a}px`);
|
|
92
92
|
}
|
|
93
|
-
for (let r of
|
|
94
|
-
let i =
|
|
95
|
-
i !== null && i >=
|
|
93
|
+
for (let r of w) {
|
|
94
|
+
let i = T(e[r]);
|
|
95
|
+
i !== null && i >= b[t].thresholdPx && (n[r] = "100%");
|
|
96
96
|
}
|
|
97
97
|
return n;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function O(e, t, n) {
|
|
100
100
|
let r = e || {};
|
|
101
101
|
return n ? {
|
|
102
102
|
...r,
|
|
103
|
-
...
|
|
103
|
+
...D(r, n),
|
|
104
104
|
...t || {}
|
|
105
105
|
} : r;
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/utilities/compiler.ts
|
|
109
|
-
var
|
|
110
|
-
function
|
|
109
|
+
var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
110
|
+
function A(e) {
|
|
111
111
|
if (!e || typeof e != "object") return null;
|
|
112
112
|
if (Array.isArray(e.columns) && e.columns.length > 0) return e;
|
|
113
113
|
let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
|
|
@@ -361,7 +361,117 @@ function M(e) {
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
var
|
|
364
|
+
var j = /* @__PURE__ */ new Map([
|
|
365
|
+
["'Roboto', sans-serif", "Roboto"],
|
|
366
|
+
["'Open Sans', sans-serif", "Open Sans"],
|
|
367
|
+
["'Lato', sans-serif", "Lato"],
|
|
368
|
+
["'Montserrat', sans-serif", "Montserrat"],
|
|
369
|
+
["'Inter', sans-serif", "Inter"],
|
|
370
|
+
["'Poppins', sans-serif", "Poppins"],
|
|
371
|
+
["'Raleway', sans-serif", "Raleway"],
|
|
372
|
+
["'Nunito', sans-serif", "Nunito"],
|
|
373
|
+
["'Nunito Sans', sans-serif", "Nunito Sans"],
|
|
374
|
+
["'Ubuntu', sans-serif", "Ubuntu"],
|
|
375
|
+
["'Rubik', sans-serif", "Rubik"],
|
|
376
|
+
["'Plus Jakarta Sans', sans-serif", "Plus Jakarta Sans"],
|
|
377
|
+
["'DM Sans', sans-serif", "DM Sans"],
|
|
378
|
+
["'Outfit', sans-serif", "Outfit"],
|
|
379
|
+
["'Figtree', sans-serif", "Figtree"],
|
|
380
|
+
["'Karla', sans-serif", "Karla"],
|
|
381
|
+
["'Barlow', sans-serif", "Barlow"],
|
|
382
|
+
["'Work Sans', sans-serif", "Work Sans"],
|
|
383
|
+
["'Manrope', sans-serif", "Manrope"],
|
|
384
|
+
["'Jost', sans-serif", "Jost"],
|
|
385
|
+
["'Sora', sans-serif", "Sora"],
|
|
386
|
+
["'Be Vietnam Pro', sans-serif", "Be Vietnam Pro"],
|
|
387
|
+
["'Mulish', sans-serif", "Mulish"],
|
|
388
|
+
["'Noto Sans', sans-serif", "Noto Sans"],
|
|
389
|
+
["'Source Sans 3', sans-serif", "Source Sans 3"],
|
|
390
|
+
["'IBM Plex Sans', sans-serif", "IBM Plex Sans"],
|
|
391
|
+
["'Josefin Sans', sans-serif", "Josefin Sans"],
|
|
392
|
+
["'Quicksand', sans-serif", "Quicksand"],
|
|
393
|
+
["'Exo 2', sans-serif", "Exo 2"],
|
|
394
|
+
["'Titillium Web', sans-serif", "Titillium Web"],
|
|
395
|
+
["'Public Sans', sans-serif", "Public Sans"],
|
|
396
|
+
["'Merriweather', serif", "Merriweather"],
|
|
397
|
+
["'Fraunces', serif", "Fraunces"],
|
|
398
|
+
["'Playfair Display', serif", "Playfair Display"],
|
|
399
|
+
["'Lora', serif", "Lora"],
|
|
400
|
+
["'PT Serif', serif", "PT Serif"],
|
|
401
|
+
["'Noto Serif', serif", "Noto Serif"],
|
|
402
|
+
["'EB Garamond', serif", "EB Garamond"],
|
|
403
|
+
["'Libre Baskerville', serif", "Libre Baskerville"],
|
|
404
|
+
["'Cormorant Garamond', serif", "Cormorant Garamond"],
|
|
405
|
+
["'Crimson Text', serif", "Crimson Text"],
|
|
406
|
+
["'DM Serif Display', serif", "DM Serif Display"],
|
|
407
|
+
["'Domine', serif", "Domine"],
|
|
408
|
+
["'Bitter', serif", "Bitter"],
|
|
409
|
+
["'Spectral', serif", "Spectral"],
|
|
410
|
+
["'Cardo', serif", "Cardo"],
|
|
411
|
+
["'Gilda Display', serif", "Gilda Display"],
|
|
412
|
+
["'Roboto Mono', monospace", "Roboto Mono"],
|
|
413
|
+
["'Source Code Pro', monospace", "Source Code Pro"],
|
|
414
|
+
["'Fira Code', monospace", "Fira Code"],
|
|
415
|
+
["'JetBrains Mono', monospace", "JetBrains Mono"],
|
|
416
|
+
["'IBM Plex Mono', monospace", "IBM Plex Mono"],
|
|
417
|
+
["'Space Mono', monospace", "Space Mono"],
|
|
418
|
+
["'Inconsolata', monospace", "Inconsolata"],
|
|
419
|
+
["'Courier Prime', monospace", "Courier Prime"],
|
|
420
|
+
["'Oswald', sans-serif", "Oswald"],
|
|
421
|
+
["'Anton', sans-serif", "Anton"],
|
|
422
|
+
["'Bebas Neue', sans-serif", "Bebas Neue"],
|
|
423
|
+
["'Righteous', sans-serif", "Righteous"],
|
|
424
|
+
["'Russo One', sans-serif", "Russo One"],
|
|
425
|
+
["'Chakra Petch', sans-serif", "Chakra Petch"],
|
|
426
|
+
["'Orbitron', sans-serif", "Orbitron"],
|
|
427
|
+
["'Abril Fatface', serif", "Abril Fatface"],
|
|
428
|
+
["'Lobster', cursive", "Lobster"],
|
|
429
|
+
["'Alfa Slab One', serif", "Alfa Slab One"],
|
|
430
|
+
["'Archivo Black', sans-serif", "Archivo Black"],
|
|
431
|
+
["'Bangers', cursive", "Bangers"],
|
|
432
|
+
["'Boogaloo', cursive", "Boogaloo"],
|
|
433
|
+
["'Fredoka One', cursive", "Fredoka One"],
|
|
434
|
+
["'Permanent Marker', cursive", "Permanent Marker"],
|
|
435
|
+
["'Lilita One', cursive", "Lilita One"],
|
|
436
|
+
["'Dancing Script', cursive", "Dancing Script"],
|
|
437
|
+
["'Pacifico', cursive", "Pacifico"],
|
|
438
|
+
["'Satisfy', cursive", "Satisfy"],
|
|
439
|
+
["'Caveat', cursive", "Caveat"],
|
|
440
|
+
["'Indie Flower', cursive", "Indie Flower"],
|
|
441
|
+
["'Kalam', cursive", "Kalam"],
|
|
442
|
+
["'Shadows Into Light', cursive", "Shadows Into Light"],
|
|
443
|
+
["'Amatic SC', cursive", "Amatic SC"],
|
|
444
|
+
["'Courgette', cursive", "Courgette"],
|
|
445
|
+
["'Cookie', cursive", "Cookie"],
|
|
446
|
+
["'Great Vibes', cursive", "Great Vibes"]
|
|
447
|
+
]);
|
|
448
|
+
function M(e, t = []) {
|
|
449
|
+
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
450
|
+
if (!e) return;
|
|
451
|
+
let t = Array.isArray(e.columns) ? e.columns : [];
|
|
452
|
+
for (let e of t) {
|
|
453
|
+
if (!e) continue;
|
|
454
|
+
let t = Array.isArray(e.elements) ? e.elements : [];
|
|
455
|
+
for (let e of t) {
|
|
456
|
+
let t = e?.style?.fontFamily;
|
|
457
|
+
typeof t == "string" && t.trim() && n.add(t.trim());
|
|
458
|
+
}
|
|
459
|
+
(Array.isArray(e.nestedRows) ? e.nestedRows : []).forEach(r);
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
(e || []).forEach(r);
|
|
463
|
+
for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
|
|
464
|
+
return n;
|
|
465
|
+
}
|
|
466
|
+
function N(e) {
|
|
467
|
+
let t = /* @__PURE__ */ new Set();
|
|
468
|
+
for (let n of e) {
|
|
469
|
+
let e = j.get(n);
|
|
470
|
+
e && t.add(e);
|
|
471
|
+
}
|
|
472
|
+
return t.size === 0 ? null : `https://fonts.googleapis.com/css?family=${Array.from(t).map((e) => `${encodeURIComponent(e).replace(/%20/g, "+")}:400,700`).join("|")}&display=swap`;
|
|
473
|
+
}
|
|
474
|
+
var P = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
|
|
365
475
|
let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
|
|
366
476
|
return typeof t == "number" && [
|
|
367
477
|
"padding",
|
|
@@ -372,25 +482,25 @@ var N = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
372
482
|
"width",
|
|
373
483
|
"height"
|
|
374
484
|
].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
|
|
375
|
-
}).join(" "),
|
|
376
|
-
function
|
|
485
|
+
}).join(" "), F = (e = {}) => P(e).replace(/;(\s|$)/g, " !important;$1");
|
|
486
|
+
function I(e) {
|
|
377
487
|
if (typeof e != "string") return !1;
|
|
378
488
|
let t = e.toLowerCase();
|
|
379
489
|
return t.includes("javascript:") || t.includes("vbscript:") || t.includes("expression") || t.includes("url(") || t.includes("@import") || t.includes("-moz-binding") || t.includes("behavior") || t.includes("</style") || /\\/.test(e);
|
|
380
490
|
}
|
|
381
|
-
function
|
|
491
|
+
function L(e, t, n, r, i) {
|
|
382
492
|
let a = {
|
|
383
|
-
...
|
|
493
|
+
...D(n, r),
|
|
384
494
|
...i || {}
|
|
385
495
|
};
|
|
386
|
-
for (let e of Object.keys(a))
|
|
496
|
+
for (let e of Object.keys(a)) I(a[e]) && delete a[e];
|
|
387
497
|
if (Object.keys(a).length === 0) return;
|
|
388
|
-
let o =
|
|
498
|
+
let o = F(a);
|
|
389
499
|
if (!o) return;
|
|
390
500
|
let s = String(t).replace(/["\\]/g, "");
|
|
391
501
|
e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
|
|
392
502
|
}
|
|
393
|
-
function
|
|
503
|
+
function R(e, t) {
|
|
394
504
|
if (e.type !== "menu" || !t || t.textAlign === void 0) return t;
|
|
395
505
|
let n = t.textAlign === "center" ? "center" : t.textAlign === "right" ? "flex-end" : "flex-start";
|
|
396
506
|
return {
|
|
@@ -398,7 +508,7 @@ function L(e, t) {
|
|
|
398
508
|
justifyContent: n
|
|
399
509
|
};
|
|
400
510
|
}
|
|
401
|
-
var
|
|
511
|
+
var z = () => ({
|
|
402
512
|
backgroundColor: "#ffffff",
|
|
403
513
|
borderRadius: "20px",
|
|
404
514
|
width: "100%",
|
|
@@ -421,11 +531,11 @@ var R = () => ({
|
|
|
421
531
|
buttonPaddingRight: "14px",
|
|
422
532
|
buttonFontSize: "13px",
|
|
423
533
|
buttonFontWeight: "700"
|
|
424
|
-
}),
|
|
534
|
+
}), B = (e) => (e || "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), V = (e, t) => {
|
|
425
535
|
if (typeof t != "string") return "";
|
|
426
536
|
let n = t.trim();
|
|
427
|
-
return n ? ` ${e}="${
|
|
428
|
-
},
|
|
537
|
+
return n ? ` ${e}="${B(n)}"` : "";
|
|
538
|
+
}, H = [
|
|
429
539
|
"fieldSpacing",
|
|
430
540
|
"buttonBackgroundColor",
|
|
431
541
|
"buttonTextColor",
|
|
@@ -445,9 +555,9 @@ var R = () => ({
|
|
|
445
555
|
"buttonWidth",
|
|
446
556
|
"buttonHeight",
|
|
447
557
|
"buttonAlign"
|
|
448
|
-
],
|
|
558
|
+
], U = (e) => {
|
|
449
559
|
if (!e || typeof e != "object") return "";
|
|
450
|
-
let t = e.kind || "text", n =
|
|
560
|
+
let t = e.kind || "text", n = B(e.name || e.id || "field"), r = e.required ? " required" : "", i = P({
|
|
451
561
|
fontSize: e.fontSize || "13px",
|
|
452
562
|
borderRadius: e.borderRadius || "12px",
|
|
453
563
|
borderWidth: e.borderWidth || "1px",
|
|
@@ -455,19 +565,19 @@ var R = () => ({
|
|
|
455
565
|
borderStyle: "solid",
|
|
456
566
|
color: e.inputTextColor
|
|
457
567
|
}), a = e.showLabel === !1 ? "" : `<label style="display: block; margin-bottom: 4px; font-size: ${e.fontSize || "12px"}; font-weight: ${e.labelFontWeight || "700"}; color: ${e.labelColor || "inherit"};">${e.label || ""}${e.required ? " <span style=\"color:#e11d48;\">*</span>" : ""}</label>`;
|
|
458
|
-
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${
|
|
568
|
+
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${B(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${B(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
|
|
459
569
|
label: e.label || "Option",
|
|
460
570
|
value: e.name || "option"
|
|
461
|
-
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${
|
|
571
|
+
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${B(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${B(t)}" name="${n}" placeholder="${B(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
|
|
462
572
|
};
|
|
463
|
-
function
|
|
573
|
+
function W(e, t, n) {
|
|
464
574
|
if (e === "none") return "";
|
|
465
|
-
let r =
|
|
575
|
+
let r = B(t);
|
|
466
576
|
return e === "plus" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; font-weight: 700; color: ${r};">${n ? "−" : "+"}</span>` : e === "arrow" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; display: inline-block; color: ${r}; transform: ${n ? "rotate(90deg)" : "none"}; transition: transform 0.2s ease;">›</span>` : `<svg data-acc-icon width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="${r}" stroke-width="2.5" style="flex-shrink: 0; transform: ${n ? "rotate(180deg)" : "none"}; transition: transform 0.2s ease;"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5"/></svg>`;
|
|
467
577
|
}
|
|
468
|
-
function
|
|
578
|
+
function G(e, t, n, r, i = []) {
|
|
469
579
|
return e.map((a, o) => {
|
|
470
|
-
let s = [...i, o], c = o === e.length - 1, l =
|
|
580
|
+
let s = [...i, o], c = o === e.length - 1, l = P({ borderBottom: n.showDividers && !c ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), u = P({
|
|
471
581
|
display: "flex",
|
|
472
582
|
alignItems: "center",
|
|
473
583
|
gap: "8px",
|
|
@@ -484,35 +594,35 @@ function W(e, t, n, r, i = []) {
|
|
|
484
594
|
border: "none",
|
|
485
595
|
font: "inherit",
|
|
486
596
|
background: void 0
|
|
487
|
-
}), d =
|
|
597
|
+
}), d = P({
|
|
488
598
|
display: "grid",
|
|
489
599
|
gridTemplateRows: a.defaultOpen ? "1fr" : "0fr",
|
|
490
600
|
transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
|
|
491
601
|
backgroundColor: t.contentBackgroundColor || "#ffffff"
|
|
492
|
-
}), f =
|
|
602
|
+
}), f = P({
|
|
493
603
|
padding: t.contentPadding || "14px",
|
|
494
604
|
color: t.contentTextColor || "#475569",
|
|
495
605
|
fontSize: t.contentFontSize || "13px",
|
|
496
606
|
whiteSpace: "pre-wrap"
|
|
497
|
-
}), p =
|
|
498
|
-
return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${
|
|
607
|
+
}), p = W(n.iconStyle, t.iconColor || "#64748b", !!a.defaultOpen), m = B(a.title), h = B(a.content), g = a.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${G(a.children, t, n, r, s)}</div>` : "";
|
|
608
|
+
return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${B(r)}|${s.join(".")}"`} data-acc-header data-acc-open="${a.defaultOpen ? "1" : "0"}" style="${u}"><span style="flex: 1;">${m}</span>${p}</button><div data-acc-panel style="${d}"><div style="overflow: hidden;"><div style="${f}">${h}${g}</div></div></div></div>`;
|
|
499
609
|
}).join("");
|
|
500
610
|
}
|
|
501
|
-
function
|
|
611
|
+
function K(e) {
|
|
502
612
|
return `<!-- Unsupported block ${String(e)} -->`;
|
|
503
613
|
}
|
|
504
|
-
var
|
|
505
|
-
if (!
|
|
506
|
-
let _ =
|
|
507
|
-
...
|
|
614
|
+
var q = (g) => {
|
|
615
|
+
if (!g || typeof g != "object") return "";
|
|
616
|
+
let _ = g.style || {}, v = g.type === "heading" || g.type === "paragraph" || g.type === "text", y = v ? c(g).autoWidth : !1, b = y ? Object.fromEntries(Object.entries(_).filter(([e]) => e !== "width")) : _, x = P(g.type === "form_container" ? {
|
|
617
|
+
...z(),
|
|
508
618
|
..._
|
|
509
|
-
} : b), S =
|
|
510
|
-
switch (
|
|
619
|
+
} : b), S = g.attributes || {}, C = ` data-plexo-id="${B(g.id)}"`, w = String(S.boxAlign || "left"), T = v && (y || !!_.width), E = (e) => T ? `<div style="text-align: ${w};">${e}</div>` : e, D = `${T ? "display: inline-block; " : ""}${v && _.height ? "overflow: hidden; " : ""}`;
|
|
620
|
+
switch (g.type) {
|
|
511
621
|
case "heading": return E(`<h2${C} style="margin-top: 0; margin-bottom: 8px; ${D}${x}">${S.text || "Heading"}</h2>`);
|
|
512
622
|
case "paragraph": return E(`<p${C} style="margin-top: 0; margin-bottom: 12px; ${D}${x}">${S.text || "Paragraph text content."}</p>`);
|
|
513
623
|
case "text": return E(`<div${C} style="${D}${x}">${S.text || ""}</div>`);
|
|
514
624
|
case "button": {
|
|
515
|
-
let e =
|
|
625
|
+
let e = u(g), t = P({
|
|
516
626
|
..._,
|
|
517
627
|
width: e.width,
|
|
518
628
|
height: e.height
|
|
@@ -520,7 +630,7 @@ var K = (s) => {
|
|
|
520
630
|
return `<div style="text-align: ${_.textAlign || "center"};"><a${C} href="${S.href || "#"}" target="${S.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${S.text || "Button"}</a></div>`;
|
|
521
631
|
}
|
|
522
632
|
case "image": {
|
|
523
|
-
let e = g
|
|
633
|
+
let e = h(g), t = _.textAlign === "center" ? "margin: 0 auto; display: block;" : _.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = P({
|
|
524
634
|
..._,
|
|
525
635
|
width: e.width,
|
|
526
636
|
height: e.height
|
|
@@ -535,12 +645,12 @@ var K = (s) => {
|
|
|
535
645
|
</div>`;
|
|
536
646
|
case "form_container": {
|
|
537
647
|
let n = {
|
|
538
|
-
...
|
|
648
|
+
...z(),
|
|
539
649
|
..._
|
|
540
650
|
}, r = {};
|
|
541
|
-
for (let e of Object.keys(n))
|
|
542
|
-
r.height =
|
|
543
|
-
let i =
|
|
651
|
+
for (let e of Object.keys(n)) H.includes(e) || (r[e] = n[e]);
|
|
652
|
+
r.height = p(g);
|
|
653
|
+
let i = P(r), a = l(t(Array.isArray(S.fields) ? S.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${U(e)}</div>`).join(""), c = S.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = S.buttonAutoHeight === !1 && n.buttonHeight || "auto", f = P({
|
|
544
654
|
backgroundColor: n.buttonBackgroundColor,
|
|
545
655
|
color: n.buttonTextColor,
|
|
546
656
|
borderRadius: n.buttonBorderRadius,
|
|
@@ -554,20 +664,20 @@ var K = (s) => {
|
|
|
554
664
|
marginRight: e(n.buttonMarginRight, n.buttonMargin, "right"),
|
|
555
665
|
fontSize: n.buttonFontSize,
|
|
556
666
|
fontWeight: n.buttonFontWeight,
|
|
557
|
-
width:
|
|
558
|
-
height:
|
|
667
|
+
width: c,
|
|
668
|
+
height: d
|
|
559
669
|
});
|
|
560
|
-
return `<form${C} action="${
|
|
670
|
+
return `<form${C} action="${B(S.actionUrl || S.action || "#")}" method="${B(S.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${S.submitLabel || "Submit"}</button></div></form>`;
|
|
561
671
|
}
|
|
562
672
|
case "input": {
|
|
563
|
-
let e = S.inputType || S.type || "text", t =
|
|
564
|
-
return `<input${C} type="${
|
|
673
|
+
let e = S.inputType || S.type || "text", t = B(S.name || S.fieldName || "field"), n = B(S.placeholder || ""), r = S.required ? " required" : "";
|
|
674
|
+
return `<input${C} type="${B(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${r} />`;
|
|
565
675
|
}
|
|
566
|
-
case "textarea": return `<textarea${C} name="${
|
|
567
|
-
case "select": return `<select${C} name="${
|
|
568
|
-
case "html": return `<div${C} style="${
|
|
676
|
+
case "textarea": return `<textarea${C} name="${B(S.name || S.fieldName || "field")}" placeholder="${B(S.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}></textarea>`;
|
|
677
|
+
case "select": return `<select${C} name="${B(S.name || S.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}>${(Array.isArray(S.options) ? S.options : []).map((e) => `<option value="${B(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
678
|
+
case "html": return `<div${C} style="${P({
|
|
569
679
|
..._,
|
|
570
|
-
height:
|
|
680
|
+
height: s(g, "auto")
|
|
571
681
|
})}">${S.htmlContent || S.text || ""}</div>`;
|
|
572
682
|
case "blog_title":
|
|
573
683
|
case "blog_content":
|
|
@@ -577,12 +687,22 @@ var K = (s) => {
|
|
|
577
687
|
case "blog_categories":
|
|
578
688
|
case "blog_comments":
|
|
579
689
|
case "blog_post_list": {
|
|
580
|
-
let e =
|
|
581
|
-
return `<div${C} data-plexo-blog-${e}="true"${
|
|
690
|
+
let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(_);
|
|
691
|
+
return `<div${C} data-plexo-blog-${e}="true"${V("data-plexo-blog-prefix", S.prefix)} style="${t}"></div>`;
|
|
692
|
+
}
|
|
693
|
+
case "product":
|
|
694
|
+
case "booking":
|
|
695
|
+
case "shop_grid":
|
|
696
|
+
case "cart_summary":
|
|
697
|
+
case "checkout_flow":
|
|
698
|
+
case "order_confirmation":
|
|
699
|
+
case "order_tracking": {
|
|
700
|
+
let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(_);
|
|
701
|
+
return `<div${C} data-plexo-commerce-${e}="true"${V("data-plexo-product-id", S.productId)}${V("data-plexo-service-id", S.serviceId)} style="${t}"></div>`;
|
|
582
702
|
}
|
|
583
703
|
case "social": {
|
|
584
|
-
let e = r(
|
|
585
|
-
return `<div${C} style="${
|
|
704
|
+
let e = r(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
|
|
705
|
+
return `<div${C} style="${P({
|
|
586
706
|
padding: _.padding,
|
|
587
707
|
margin: _.margin,
|
|
588
708
|
display: "flex",
|
|
@@ -590,7 +710,7 @@ var K = (s) => {
|
|
|
590
710
|
gap: _.iconSpacing || "8px",
|
|
591
711
|
justifyContent: t
|
|
592
712
|
})}">${e.map((e) => {
|
|
593
|
-
let t =
|
|
713
|
+
let t = P({
|
|
594
714
|
width: e.size,
|
|
595
715
|
height: e.size,
|
|
596
716
|
padding: "8px",
|
|
@@ -602,83 +722,83 @@ var K = (s) => {
|
|
|
602
722
|
justifyContent: "center",
|
|
603
723
|
overflow: "hidden"
|
|
604
724
|
});
|
|
605
|
-
return `<a href="${
|
|
725
|
+
return `<a href="${B(e.url)}" style="${t} text-decoration: none;">${f(e.provider, e.color)}</a>`;
|
|
606
726
|
}).join("")}</div>`;
|
|
607
727
|
}
|
|
608
728
|
case "menu": {
|
|
609
|
-
let e = n(
|
|
610
|
-
return `<div${C} style="${
|
|
729
|
+
let e = n(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
|
|
730
|
+
return `<div${C} style="${P({
|
|
611
731
|
..._,
|
|
612
732
|
display: "flex",
|
|
613
733
|
flexWrap: "wrap",
|
|
614
734
|
gap: "16px",
|
|
615
735
|
justifyContent: t
|
|
616
|
-
})}">${e.map((e) => `<a href="${
|
|
736
|
+
})}">${e.map((e) => `<a href="${B(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${_.fontWeight || 600};">${B(e.label)}</a>`).join("")}</div>`;
|
|
617
737
|
}
|
|
618
738
|
case "icon": {
|
|
619
|
-
let e = _.fontSize || `${S.iconSize || 48}px`, t = _.color || "#1e293b", n = parseInt(String(e), 10) || 48, r =
|
|
739
|
+
let e = _.fontSize || `${S.iconSize || 48}px`, t = _.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(S.iconName, n, t), i = _.textAlign === "right" ? "flex-end" : _.textAlign === "left" ? "flex-start" : "center", a = P({
|
|
620
740
|
padding: _.padding,
|
|
621
741
|
margin: _.margin,
|
|
622
742
|
display: "flex",
|
|
623
743
|
justifyContent: i
|
|
624
744
|
}), o = typeof S.href == "string" ? S.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
|
|
625
|
-
return `<div style="${a}">${o ? `<a${C} href="${
|
|
745
|
+
return `<div style="${a}">${o ? `<a${C} href="${B(o)}" target="${S.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${C}>${s}</span>`}</div>`;
|
|
626
746
|
}
|
|
627
747
|
case "table": {
|
|
628
|
-
let e =
|
|
629
|
-
let o = a ? "th" : "td",
|
|
748
|
+
let e = d(g), t = `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
|
|
749
|
+
let o = a ? "th" : "td", s = a ? _.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : _.contentBgColor || "#ffffff", c = a ? _.headerTextColor || "#1e293b" : _.contentTextColor || "#475569", l = a ? _.headerTextAlign || "left" : _.contentTextAlign || "left";
|
|
630
750
|
return `<tr>${n.map((e, n) => {
|
|
631
|
-
let r =
|
|
751
|
+
let r = P({
|
|
632
752
|
padding: _.cellPadding || "8px",
|
|
633
753
|
border: t,
|
|
634
|
-
backgroundColor:
|
|
635
|
-
color:
|
|
636
|
-
textAlign:
|
|
754
|
+
backgroundColor: s,
|
|
755
|
+
color: c,
|
|
756
|
+
textAlign: l,
|
|
637
757
|
lineHeight: _.contentLineHeight,
|
|
638
758
|
letterSpacing: _.contentLetterSpacing,
|
|
639
759
|
fontWeight: a ? "700" : void 0
|
|
640
|
-
}),
|
|
641
|
-
return `<${o}${
|
|
760
|
+
}), u = ` data-plexo-cell="${B(g.id)}|${i}-${n}"`;
|
|
761
|
+
return `<${o}${u} style="${r}">${e || " "}</${o}>`;
|
|
642
762
|
}).join("")}</tr>`;
|
|
643
|
-
}, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 0, 0, !0)}</thead>` : "", i = +!!e.enableHeader, a = e.enableFooter ? e.cells.length - 1 : e.cells.length, o = e.cells.slice(i, Math.max(i, a)).map((e, t) => n(e, t, i + t, !1)).join(""),
|
|
763
|
+
}, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 0, 0, !0)}</thead>` : "", i = +!!e.enableHeader, a = e.enableFooter ? e.cells.length - 1 : e.cells.length, o = e.cells.slice(i, Math.max(i, a)).map((e, t) => n(e, t, i + t, !1)).join(""), s = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, e.cells.length - 1, !1)}</tfoot>` : "", c = P({
|
|
644
764
|
borderCollapse: "collapse",
|
|
645
765
|
width: "100%"
|
|
646
766
|
});
|
|
647
|
-
return `<div${C} style="${
|
|
767
|
+
return `<div${C} style="${P({
|
|
648
768
|
padding: _.padding,
|
|
649
769
|
margin: _.margin,
|
|
650
770
|
overflowX: "auto"
|
|
651
|
-
})}"><table style="${
|
|
771
|
+
})}"><table style="${c}">${r}<tbody>${o}</tbody>${s}</table></div>`;
|
|
652
772
|
}
|
|
653
773
|
case "video": {
|
|
654
774
|
let e = i(S.videoUrl), t = S.linkType === "email" ? `mailto:${S.href || ""}` : S.href || S.videoUrl || "#", n = S.target || "_blank";
|
|
655
|
-
return `<div${C} style="${
|
|
775
|
+
return `<div${C} style="${P({
|
|
656
776
|
padding: _.padding,
|
|
657
777
|
margin: _.margin,
|
|
658
778
|
borderRadius: _.borderRadius,
|
|
659
779
|
overflow: "hidden"
|
|
660
|
-
})}"><a href="${
|
|
780
|
+
})}"><a href="${B(t)}" target="${B(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${B(e.thumbnailUrl)}" alt="${B(S.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
|
|
661
781
|
}
|
|
662
782
|
case "timer": {
|
|
663
|
-
let e = S.showLabels !== !1, t =
|
|
783
|
+
let e = S.showLabels !== !1, t = P({
|
|
664
784
|
fontFamily: _.digitsFontFamily,
|
|
665
785
|
fontSize: _.digitsFontSize || "40px",
|
|
666
786
|
color: _.digitsColor || "#1e293b",
|
|
667
787
|
fontWeight: "800"
|
|
668
|
-
}), n =
|
|
788
|
+
}), n = P({
|
|
669
789
|
fontFamily: _.labelsFontFamily,
|
|
670
790
|
fontSize: _.labelsFontSize || "16px",
|
|
671
791
|
color: _.labelsColor || "#64748b"
|
|
672
|
-
}), r =
|
|
792
|
+
}), r = P({
|
|
673
793
|
backgroundColor: _.backgroundColor || "#f8fafc",
|
|
674
794
|
borderRadius: _.borderRadius || "8px",
|
|
675
795
|
padding: _.padding || "16px",
|
|
676
796
|
textAlign: "center"
|
|
677
|
-
}), i = (r, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${r}" style="${t}">${a}</span>${e ? `<span style="${n}">${i}</span>` : ""}</div>`, o = a(S.targetDate, S.timezone),
|
|
678
|
-
return `<div${C} data-plexo-target="${
|
|
797
|
+
}), i = (r, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${r}" style="${t}">${a}</span>${e ? `<span style="${n}">${i}</span>` : ""}</div>`, o = a(S.targetDate, S.timezone), s = B(new Date(o.targetTimestamp).toISOString()), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
|
|
798
|
+
return `<div${C} data-plexo-target="${s}" style="${r}"><div>${i("days", "Days", o.days)}${i("hours", "Hours", o.hours)}${i("minutes", "Mins", o.minutes)}${i("seconds", "Secs", o.seconds)}</div>${c}</div>`;
|
|
679
799
|
}
|
|
680
800
|
case "carousel": {
|
|
681
|
-
let e = Array.isArray(S.images) ? S.images : [], t =
|
|
801
|
+
let e = Array.isArray(S.images) ? S.images : [], t = P({
|
|
682
802
|
padding: _.padding || "10px",
|
|
683
803
|
margin: _.margin,
|
|
684
804
|
backgroundColor: _.backgroundColor,
|
|
@@ -687,59 +807,59 @@ var K = (s) => {
|
|
|
687
807
|
borderRadius: "12px"
|
|
688
808
|
});
|
|
689
809
|
if (e.length === 0) return `<div${C} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
|
|
690
|
-
let n = Math.min(e.length - 1, Math.max(0, parseInt(String(S.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${
|
|
691
|
-
return `<div${C} data-active-idx="${n}" style="${t}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${r}${i}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${
|
|
810
|
+
let n = Math.min(e.length - 1, Math.max(0, parseInt(String(S.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${B(e.src)}" alt="${B(e.alt || e.caption || "")}" style="width: 100%; display: block;" />${e.caption ? `<div style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${B(e.caption)}</div>` : ""}</div>`).join(""), i = e.length > 1 ? `<div style="display: flex; gap: 6px; justify-content: center; padding: 8px 0;">${e.map((e, t) => `<button type="button" data-dot-idx="${t}" style="width: 8px; height: 8px; border-radius: 9999px; border: none; background: ${t === n ? "#4f46e5" : "#cbd5e1"}; cursor: pointer;"></button>`).join("")}</div>` : "";
|
|
811
|
+
return `<div${C} data-active-idx="${n}" style="${t}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${r}${i}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var slides=wrap.querySelectorAll('[data-slide-idx]');var dots=wrap.querySelectorAll('[data-dot-idx]');function show(n){var idx=(n+slides.length)%slides.length;slides.forEach(function(s,i){s.style.display=i===idx?'block':'none';});dots.forEach(function(d,i){d.style.background=i===idx?'#4f46e5':'#cbd5e1';});wrap.setAttribute('data-active-idx',String(idx));}var prev=wrap.querySelector('[data-nav="prev"]');var next=wrap.querySelector('[data-nav="next"]');if(prev)prev.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)-1);});if(next)next.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)+1);});dots.forEach(function(d,i){d.addEventListener('click',function(){show(i);});});})();<\/script>`}</div>`;
|
|
692
812
|
}
|
|
693
813
|
case "accordion": {
|
|
694
|
-
let e = o(
|
|
814
|
+
let e = o(g), t = S.mode === "multi" ? "multi" : "single", n = S.iconStyle || "chevron", r = S.iconPosition === "left", i = S.showDividers !== !1, a = S.animation !== "none", s = P({
|
|
695
815
|
border: `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#e2e8f0"}`,
|
|
696
816
|
borderRadius: _.borderRadius || "10px",
|
|
697
817
|
overflow: "hidden",
|
|
698
818
|
margin: _.margin
|
|
699
819
|
});
|
|
700
|
-
return e.length === 0 ? `<div${C} style="${
|
|
820
|
+
return e.length === 0 ? `<div${C} style="${s}"></div>` : `<div${C} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${G(e, _, {
|
|
701
821
|
iconStyle: n,
|
|
702
822
|
iconOnLeft: r,
|
|
703
823
|
showDividers: i,
|
|
704
824
|
animated: a
|
|
705
|
-
},
|
|
825
|
+
}, g.id)}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!root)return;var mode=root.getAttribute('data-acc-mode')||'single';var iconStyle=root.getAttribute('data-acc-icon-style')||'chevron';function setIconState(icon,open){if(!icon)return;if(iconStyle==='plus'){icon.textContent=open?'−':'+';}else if(iconStyle==='arrow'){icon.style.transform=open?'rotate(90deg)':'';}else if(iconStyle==='chevron'){icon.style.transform=open?'rotate(180deg)':'';}}var headers=root.querySelectorAll('[data-acc-header]');headers.forEach(function(header){header.addEventListener('click',function(){var item=header.parentElement;var group=item.parentElement;var panel=item.children[1];var isOpen=header.getAttribute('data-acc-open')==='1';if(mode!=='multi'&&group){Array.prototype.forEach.call(group.children,function(sib){if(sib===item)return;var sh=sib.children[0];var sp=sib.children[1];if(sh){sh.setAttribute('data-acc-open','0');setIconState(sh.querySelector('[data-acc-icon]'),false);}if(sp)sp.style.gridTemplateRows='0fr';});}var next=!isOpen;header.setAttribute('data-acc-open',next?'1':'0');panel.style.gridTemplateRows=next?'1fr':'0fr';setIconState(header.querySelector('[data-acc-icon]'),next);});});})();<\/script>`}</div>`;
|
|
706
826
|
}
|
|
707
|
-
default: return
|
|
827
|
+
default: return K(g.type);
|
|
708
828
|
}
|
|
709
|
-
},
|
|
829
|
+
}, J = (e, t, n) => {
|
|
710
830
|
if (!e || typeof e != "object") return "";
|
|
711
|
-
let r =
|
|
831
|
+
let r = A(e);
|
|
712
832
|
if (!r) return `\n <!-- ROW SKIPPED (type="${typeof e.type == "string" ? e.type : "unknown"}"${e.id ? `, id="${e.id}"` : ""}): this row has no 'columns' array and its shorthand content (e.g. a list of items/links) can't be auto-converted without losing data. Provide a fully hydrated row with 'columns' and 'elements' instead. -->`;
|
|
713
|
-
let i =
|
|
714
|
-
|
|
715
|
-
let
|
|
716
|
-
|
|
717
|
-
let
|
|
718
|
-
for (let e of
|
|
833
|
+
let i = P(r.style || {}), a = V("id", r.htmlId), o = V("class", r.htmlClass), s = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
834
|
+
L(t, s, r.style, "tablet", r.styleTablet), L(t, s, r.style, "mobile", r.styleMobile);
|
|
835
|
+
let c = `\n <!-- ROW START: ${r.id || "row"} -->`;
|
|
836
|
+
c += `\n <div data-plexo-id="${s}"${a}${o} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${i}">`;
|
|
837
|
+
let l = Array.isArray(r.columns) ? r.columns : [];
|
|
838
|
+
for (let e of l) {
|
|
719
839
|
if (!e) continue;
|
|
720
|
-
let r = e.styles || e.style || {}, i =
|
|
721
|
-
|
|
722
|
-
let
|
|
723
|
-
|
|
724
|
-
let
|
|
725
|
-
for (let r of
|
|
840
|
+
let r = e.styles || e.style || {}, i = P(r), a = r.gap || "16px", o = V("id", e.attrs?.htmlId), s = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
|
|
841
|
+
L(t, l, r, "tablet", e.stylesTablet), L(t, l, r, "mobile", e.stylesMobile);
|
|
842
|
+
let u = Array.isArray(e.elements) ? e.elements : [], d = Array.isArray(e.nestedRows) ? e.nestedRows : [], f = n && u.length === 0 && d.length === 0 ? "min-height: 148px; " : "";
|
|
843
|
+
c += `\n <!-- COLUMN START: ${e.id || "col"} -->`, c += `\n <div data-plexo-id="${l}"${o} class="plexo-col${s}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; --plexo-col-gap: ${a}; ${f}${i}">`;
|
|
844
|
+
let p = new Map(u.map((e) => [e.id, e])), m = new Map(d.map((e) => [e.id, e]));
|
|
845
|
+
for (let r of g({
|
|
726
846
|
...e,
|
|
727
|
-
elements:
|
|
728
|
-
nestedRows:
|
|
847
|
+
elements: u,
|
|
848
|
+
nestedRows: d
|
|
729
849
|
})) {
|
|
730
|
-
let e =
|
|
850
|
+
let e = p.get(r);
|
|
731
851
|
if (e) {
|
|
732
|
-
let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i =
|
|
733
|
-
|
|
852
|
+
let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i = V("id", n.htmlId), o = V("class", r), s = e.style?.display, l = s === "inline-block" || s === "inline" || s === "inline-flex" ? `margin-bottom: ${a}; display: ${s}; vertical-align: top;` : `margin-bottom: ${a};`;
|
|
853
|
+
L(t, e.id, e.style, "tablet", R(e, e.styleTablet)), L(t, e.id, e.style, "mobile", R(e, e.styleMobile)), c += `\n <div${i}${o} style="${l}">`, c += `\n ${q(e)}`, c += "\n </div>";
|
|
734
854
|
continue;
|
|
735
855
|
}
|
|
736
|
-
let i =
|
|
737
|
-
i && (
|
|
856
|
+
let i = m.get(r);
|
|
857
|
+
i && (c += J(i, t, n));
|
|
738
858
|
}
|
|
739
|
-
|
|
859
|
+
c += "\n </div>";
|
|
740
860
|
}
|
|
741
|
-
return
|
|
742
|
-
},
|
|
861
|
+
return c += "\n </div>", c;
|
|
862
|
+
}, Y = (e, t) => {
|
|
743
863
|
let n = t?.canvasEditorPadding ?? !1;
|
|
744
864
|
if (!e || typeof e != "object") return "<!-- Empty template -->";
|
|
745
865
|
let r = e.designJson || e.template || e, i = r.body || (Array.isArray(r.rows) ? {
|
|
@@ -768,21 +888,21 @@ var K = (s) => {
|
|
|
768
888
|
"favicon"
|
|
769
889
|
], s = {};
|
|
770
890
|
for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
|
|
771
|
-
let c =
|
|
891
|
+
let c = P(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = V("id", a.htmlId), d = V("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : [], g = N(M(h, [a.fontFamily])), _ = {
|
|
772
892
|
tablet: [],
|
|
773
893
|
mobile: []
|
|
774
|
-
},
|
|
775
|
-
for (let e of h)
|
|
776
|
-
let
|
|
894
|
+
}, v = "";
|
|
895
|
+
for (let e of h) v += J(e, _, n);
|
|
896
|
+
let y = _.tablet.length ? `\n ${_.tablet.join("\n ")}` : "", b = _.mobile.length ? `\n ${_.mobile.join("\n ")}` : "", x = `<!DOCTYPE html>
|
|
777
897
|
<html>
|
|
778
898
|
<head>
|
|
779
899
|
<meta charset="utf-8">
|
|
780
|
-
<title>${
|
|
781
|
-
${m ? `<link rel="icon" href="${
|
|
900
|
+
<title>${B(l)}</title>
|
|
901
|
+
${m ? `<link rel="icon" href="${B(m)}">` : ""}
|
|
782
902
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
783
903
|
${g ? `<link rel="stylesheet" href="${g}">` : ""}
|
|
784
904
|
<style>
|
|
785
|
-
body { margin: 0; font-family: ${
|
|
905
|
+
body { margin: 0; font-family: ${k}; }
|
|
786
906
|
.plexo-row {
|
|
787
907
|
display: flex;
|
|
788
908
|
flex-wrap: wrap;
|
|
@@ -790,7 +910,7 @@ var K = (s) => {
|
|
|
790
910
|
/* Tablet: auto-scaled fonts/heights/spacing (see utilities/responsiveDefaults.ts) and
|
|
791
911
|
any explicit per-element styleTablet/stylesTablet override — columns stay side by
|
|
792
912
|
side at this width. */
|
|
793
|
-
@media (min-width: 769px) and (max-width: 1024px) {${
|
|
913
|
+
@media (min-width: 769px) and (max-width: 1024px) {${y}
|
|
794
914
|
}
|
|
795
915
|
@media (max-width: 768px) {
|
|
796
916
|
.plexo-row {
|
|
@@ -800,29 +920,29 @@ var K = (s) => {
|
|
|
800
920
|
width: 100% !important;
|
|
801
921
|
max-width: 100% !important;
|
|
802
922
|
margin-bottom: var(--plexo-col-gap, 16px);
|
|
803
|
-
}${
|
|
923
|
+
}${b}
|
|
804
924
|
}
|
|
805
925
|
</style>
|
|
806
926
|
${f ? `<style>\n${f}\n </style>` : ""}
|
|
807
927
|
</head>
|
|
808
928
|
<body${u}${d} style="${c}">
|
|
809
929
|
<div style="max-width: 1200px; margin: 0 auto; width: 100%;">`;
|
|
810
|
-
return
|
|
930
|
+
return x += v, x += `\n </div>
|
|
811
931
|
${p ? ` <script>\n${p}\n <\/script>` : ""}
|
|
812
932
|
</body>
|
|
813
|
-
</html>`,
|
|
933
|
+
</html>`, x = x.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), x;
|
|
814
934
|
};
|
|
815
|
-
function Y(e) {
|
|
816
|
-
return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
817
|
-
}
|
|
818
935
|
function X(e) {
|
|
819
|
-
return
|
|
936
|
+
return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
820
937
|
}
|
|
821
938
|
function Z(e) {
|
|
822
|
-
return
|
|
939
|
+
return X(Y(e));
|
|
823
940
|
}
|
|
824
941
|
function Q(e) {
|
|
942
|
+
return Y(e);
|
|
943
|
+
}
|
|
944
|
+
function $(e) {
|
|
825
945
|
return e;
|
|
826
946
|
}
|
|
827
947
|
//#endregion
|
|
828
|
-
export {
|
|
948
|
+
export { Q as a, z as c, $ as d, O as f, Y as i, F as l, H as n, Z as o, L as r, A as s, k as t, X as u };
|