@charisol/plexo-sdk 1.0.37 → 1.0.39
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 +1 -0
- package/dist/{compiler-BHUlR0D2.js → compiler-CogJrihV.js} +228 -181
- package/dist/compiler.js +1 -1
- package/dist/compilerClient.js +82 -68
- package/dist/components/icons.d.ts +1 -0
- package/dist/components/properties/accordionSections/AccordionPropertiesAccordion.d.ts +2 -0
- package/dist/components/sidebarTabs/BodyGlobalSettingsTab.d.ts +1 -0
- package/dist/iconSvgStatic-DOyb-nIf.js +15024 -0
- package/dist/index.js +45104 -4717
- package/dist/plexo-sdk.css +1 -1
- package/dist/utilities/elementResolvers.d.ts +19 -1
- package/dist/utilities/iconSvgStatic.d.ts +21 -0
- package/dist/utilities/playground.helpers.d.ts +375 -0
- package/dist/utilities/playground.interfaces.d.ts +16 -0
- package/dist/utilities/plexoBuilderRuntime.d.ts +1 -1
- package/dist/utilities/tierFeatures.d.ts +1 -1
- package/dist/utilities/types.d.ts +1 -1
- package/package.json +2 -1
- package/dist/elementResolvers-qyNepC_f.js +0 -39752
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
import * as p from "react";
|
|
3
|
-
import { renderToStaticMarkup as m } from "react-dom/server";
|
|
1
|
+
import { a as e, d as t, f as n, i as r, l as i, n as a, o, p as s, r as c, s as l, t as u, u as d } from "./iconSvgStatic-DOyb-nIf.js";
|
|
4
2
|
//#region src/utilities/playground.constants.ts
|
|
5
|
-
var
|
|
3
|
+
var f = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, p = [
|
|
6
4
|
{
|
|
7
5
|
id: "all",
|
|
8
6
|
label: "All sources"
|
|
@@ -19,7 +17,7 @@ var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g
|
|
|
19
17
|
id: "pixabay",
|
|
20
18
|
label: "Pixabay"
|
|
21
19
|
}
|
|
22
|
-
],
|
|
20
|
+
], m = [
|
|
23
21
|
{
|
|
24
22
|
id: "surface-book",
|
|
25
23
|
label: "Surface Book",
|
|
@@ -86,7 +84,7 @@ var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g
|
|
|
86
84
|
width: 375,
|
|
87
85
|
category: "mobile"
|
|
88
86
|
}
|
|
89
|
-
],
|
|
87
|
+
], h = 1280, g = [
|
|
90
88
|
{
|
|
91
89
|
id: "facebook",
|
|
92
90
|
label: "Facebook"
|
|
@@ -119,7 +117,7 @@ var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g
|
|
|
119
117
|
id: "tiktok",
|
|
120
118
|
label: "TikTok"
|
|
121
119
|
}
|
|
122
|
-
],
|
|
120
|
+
], _ = [
|
|
123
121
|
{
|
|
124
122
|
label: "Text",
|
|
125
123
|
value: "text"
|
|
@@ -152,7 +150,7 @@ var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g
|
|
|
152
150
|
label: "Checkbox",
|
|
153
151
|
value: "checkbox"
|
|
154
152
|
}
|
|
155
|
-
],
|
|
153
|
+
], v = [
|
|
156
154
|
{
|
|
157
155
|
label: "1 Column",
|
|
158
156
|
widths: ["100%"],
|
|
@@ -201,7 +199,7 @@ var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g
|
|
|
201
199
|
"25%"
|
|
202
200
|
]
|
|
203
201
|
}
|
|
204
|
-
],
|
|
202
|
+
], y = [
|
|
205
203
|
{
|
|
206
204
|
label: "Roboto",
|
|
207
205
|
value: "'Roboto', sans-serif",
|
|
@@ -602,8 +600,8 @@ var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g
|
|
|
602
600
|
value: "'Great Vibes', cursive",
|
|
603
601
|
style: "handwriting"
|
|
604
602
|
}
|
|
605
|
-
],
|
|
606
|
-
function
|
|
603
|
+
], b = new Map(y.map((e) => [e.value, e.label]));
|
|
604
|
+
function x(e, t = []) {
|
|
607
605
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
608
606
|
if (!e) return;
|
|
609
607
|
let t = Array.isArray(e.columns) ? e.columns : [];
|
|
@@ -621,17 +619,17 @@ function w(e, t = []) {
|
|
|
621
619
|
for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
|
|
622
620
|
return n;
|
|
623
621
|
}
|
|
624
|
-
function
|
|
622
|
+
function S(e) {
|
|
625
623
|
let t = /* @__PURE__ */ new Set();
|
|
626
624
|
for (let n of e) {
|
|
627
|
-
let e =
|
|
625
|
+
let e = b.get(n);
|
|
628
626
|
e && t.add(e);
|
|
629
627
|
}
|
|
630
628
|
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`;
|
|
631
629
|
}
|
|
632
630
|
//#endregion
|
|
633
631
|
//#region src/utilities/responsiveDefaults.ts
|
|
634
|
-
var
|
|
632
|
+
var C = {
|
|
635
633
|
tablet: {
|
|
636
634
|
thresholdPx: 24,
|
|
637
635
|
scale: .85,
|
|
@@ -642,7 +640,7 @@ var E = {
|
|
|
642
640
|
scale: .7,
|
|
643
641
|
floorPx: 14
|
|
644
642
|
}
|
|
645
|
-
},
|
|
643
|
+
}, w = {
|
|
646
644
|
tablet: {
|
|
647
645
|
thresholdPx: 320,
|
|
648
646
|
scale: .8,
|
|
@@ -653,7 +651,7 @@ var E = {
|
|
|
653
651
|
scale: .55,
|
|
654
652
|
floorPx: 140
|
|
655
653
|
}
|
|
656
|
-
},
|
|
654
|
+
}, T = {
|
|
657
655
|
tablet: {
|
|
658
656
|
thresholdPx: 48,
|
|
659
657
|
scale: .75,
|
|
@@ -664,7 +662,7 @@ var E = {
|
|
|
664
662
|
scale: .55,
|
|
665
663
|
floorPx: 16
|
|
666
664
|
}
|
|
667
|
-
},
|
|
665
|
+
}, E = {
|
|
668
666
|
tablet: {
|
|
669
667
|
thresholdPx: 500,
|
|
670
668
|
scale: 1,
|
|
@@ -675,11 +673,11 @@ var E = {
|
|
|
675
673
|
scale: 1,
|
|
676
674
|
floorPx: 0
|
|
677
675
|
}
|
|
678
|
-
},
|
|
676
|
+
}, D = ["fontSize"], O = [
|
|
679
677
|
"height",
|
|
680
678
|
"minHeight",
|
|
681
679
|
"maxHeight"
|
|
682
|
-
],
|
|
680
|
+
], k = [
|
|
683
681
|
"padding",
|
|
684
682
|
"paddingTop",
|
|
685
683
|
"paddingBottom",
|
|
@@ -688,8 +686,8 @@ var E = {
|
|
|
688
686
|
"margin",
|
|
689
687
|
"marginTop",
|
|
690
688
|
"marginBottom"
|
|
691
|
-
],
|
|
692
|
-
function
|
|
689
|
+
], A = ["width", "maxWidth"];
|
|
690
|
+
function j(e) {
|
|
693
691
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
694
692
|
if (typeof e != "string") return null;
|
|
695
693
|
let t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/);
|
|
@@ -697,48 +695,48 @@ function N(e) {
|
|
|
697
695
|
let n = parseFloat(t[1]);
|
|
698
696
|
return Number.isFinite(n) ? n : null;
|
|
699
697
|
}
|
|
700
|
-
function
|
|
698
|
+
function M(e, t) {
|
|
701
699
|
return e < t.thresholdPx ? null : Math.max(Math.round(e * t.scale), t.floorPx);
|
|
702
700
|
}
|
|
703
|
-
function
|
|
701
|
+
function N(e, t) {
|
|
704
702
|
if (!e || typeof e != "object") return {};
|
|
705
703
|
let n = {};
|
|
706
|
-
for (let r of
|
|
707
|
-
let i =
|
|
704
|
+
for (let r of D) {
|
|
705
|
+
let i = j(e[r]);
|
|
708
706
|
if (i === null) continue;
|
|
709
|
-
let a =
|
|
707
|
+
let a = M(i, C[t]);
|
|
710
708
|
a !== null && (n[r] = `${a}px`);
|
|
711
709
|
}
|
|
712
|
-
for (let r of
|
|
713
|
-
let i =
|
|
710
|
+
for (let r of O) {
|
|
711
|
+
let i = j(e[r]);
|
|
714
712
|
if (i === null) continue;
|
|
715
|
-
let a =
|
|
713
|
+
let a = M(i, w[t]);
|
|
716
714
|
a !== null && (n[r] = `${a}px`);
|
|
717
715
|
}
|
|
718
|
-
for (let r of
|
|
719
|
-
let i =
|
|
716
|
+
for (let r of k) {
|
|
717
|
+
let i = j(e[r]);
|
|
720
718
|
if (i === null) continue;
|
|
721
|
-
let a =
|
|
719
|
+
let a = M(i, T[t]);
|
|
722
720
|
a !== null && (n[r] = `${a}px`);
|
|
723
721
|
}
|
|
724
|
-
for (let r of
|
|
725
|
-
let i =
|
|
726
|
-
i !== null && i >=
|
|
722
|
+
for (let r of A) {
|
|
723
|
+
let i = j(e[r]);
|
|
724
|
+
i !== null && i >= E[t].thresholdPx && (n[r] = "100%");
|
|
727
725
|
}
|
|
728
726
|
return n;
|
|
729
727
|
}
|
|
730
|
-
function
|
|
728
|
+
function P(e, t, n) {
|
|
731
729
|
let r = e || {};
|
|
732
730
|
return n ? {
|
|
733
731
|
...r,
|
|
734
|
-
...
|
|
732
|
+
...N(r, n),
|
|
735
733
|
...t || {}
|
|
736
734
|
} : r;
|
|
737
735
|
}
|
|
738
736
|
//#endregion
|
|
739
737
|
//#region src/utilities/compiler.ts
|
|
740
|
-
var
|
|
741
|
-
switch (
|
|
738
|
+
var F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", I = (e) => e === "twitter" ? "x" : e, L = (e, t = "currentColor") => {
|
|
739
|
+
switch (I(e)) {
|
|
742
740
|
case "facebook": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M14 8h2V4h-2c-2.2 0-4 1.8-4 4v2H8v4h2v6h4v-6h2.5l.5-4H14V8c0-.55.45-1 1-1Z"/></svg>`;
|
|
743
741
|
case "instagram": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="4" y="4" width="16" height="16" rx="5" ry="5" fill="none" stroke="${t}" stroke-width="2"/><circle cx="12" cy="12" r="3.5" fill="none" stroke="${t}" stroke-width="2"/><circle cx="17" cy="7" r="1" fill="${t}"/></svg>`;
|
|
744
742
|
case "linkedin": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><circle cx="8" cy="9" r="1.25" fill="${t}"/><path fill="${t}" d="M7 11h2v6H7zM11 11h2v.9c.5-.7 1.34-1.15 2.4-1.15 2 0 3.1 1.25 3.1 3.6V17h-2v-2.2c0-1.3-.45-2.05-1.55-2.05-1.2 0-1.85.8-1.85 2.05V17h-2z"/></svg>`;
|
|
@@ -750,7 +748,7 @@ var L = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
750
748
|
default: return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><circle cx="12" cy="12" r="4" fill="${t}"/></svg>`;
|
|
751
749
|
}
|
|
752
750
|
};
|
|
753
|
-
function
|
|
751
|
+
function R(e) {
|
|
754
752
|
if (!e || typeof e != "object") return null;
|
|
755
753
|
if (Array.isArray(e.columns) && e.columns.length > 0) return e;
|
|
756
754
|
let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
|
|
@@ -1004,7 +1002,7 @@ function B(e) {
|
|
|
1004
1002
|
}
|
|
1005
1003
|
}
|
|
1006
1004
|
}
|
|
1007
|
-
var
|
|
1005
|
+
var z = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
|
|
1008
1006
|
let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
|
|
1009
1007
|
return typeof t == "number" && [
|
|
1010
1008
|
"padding",
|
|
@@ -1015,25 +1013,25 @@ var V = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
1015
1013
|
"width",
|
|
1016
1014
|
"height"
|
|
1017
1015
|
].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
|
|
1018
|
-
}).join(" "),
|
|
1019
|
-
function
|
|
1016
|
+
}).join(" "), B = (e = {}) => z(e).replace(/;(\s|$)/g, " !important;$1");
|
|
1017
|
+
function V(e) {
|
|
1020
1018
|
if (typeof e != "string") return !1;
|
|
1021
1019
|
let t = e.toLowerCase();
|
|
1022
1020
|
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);
|
|
1023
1021
|
}
|
|
1024
|
-
function
|
|
1022
|
+
function H(e, t, n, r, i) {
|
|
1025
1023
|
let a = {
|
|
1026
|
-
...
|
|
1024
|
+
...N(n, r),
|
|
1027
1025
|
...i || {}
|
|
1028
1026
|
};
|
|
1029
|
-
for (let e of Object.keys(a))
|
|
1027
|
+
for (let e of Object.keys(a)) V(a[e]) && delete a[e];
|
|
1030
1028
|
if (Object.keys(a).length === 0) return;
|
|
1031
|
-
let o =
|
|
1029
|
+
let o = B(a);
|
|
1032
1030
|
if (!o) return;
|
|
1033
1031
|
let s = String(t).replace(/["\\]/g, "");
|
|
1034
1032
|
e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
|
|
1035
1033
|
}
|
|
1036
|
-
var
|
|
1034
|
+
var U = () => ({
|
|
1037
1035
|
backgroundColor: "#ffffff",
|
|
1038
1036
|
borderRadius: "20px",
|
|
1039
1037
|
width: "100%",
|
|
@@ -1056,11 +1054,11 @@ var G = () => ({
|
|
|
1056
1054
|
buttonPaddingRight: "14px",
|
|
1057
1055
|
buttonFontSize: "13px",
|
|
1058
1056
|
buttonFontWeight: "700"
|
|
1059
|
-
}),
|
|
1057
|
+
}), W = (e) => (e || "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), G = (e, t) => {
|
|
1060
1058
|
if (typeof t != "string") return "";
|
|
1061
1059
|
let n = t.trim();
|
|
1062
|
-
return n ? ` ${e}="${
|
|
1063
|
-
},
|
|
1060
|
+
return n ? ` ${e}="${W(n)}"` : "";
|
|
1061
|
+
}, K = [
|
|
1064
1062
|
"fieldSpacing",
|
|
1065
1063
|
"buttonBackgroundColor",
|
|
1066
1064
|
"buttonTextColor",
|
|
@@ -1073,9 +1071,9 @@ var G = () => ({
|
|
|
1073
1071
|
"buttonFontWeight",
|
|
1074
1072
|
"buttonWidth",
|
|
1075
1073
|
"buttonAlign"
|
|
1076
|
-
],
|
|
1074
|
+
], q = (e) => {
|
|
1077
1075
|
if (!e || typeof e != "object") return "";
|
|
1078
|
-
let t = e.kind || "text", n =
|
|
1076
|
+
let t = e.kind || "text", n = W(e.name || e.label || "field"), r = e.required ? " required" : "", i = z({
|
|
1079
1077
|
fontSize: e.fontSize || "13px",
|
|
1080
1078
|
borderRadius: e.borderRadius || "12px",
|
|
1081
1079
|
borderWidth: e.borderWidth || "1px",
|
|
@@ -1083,88 +1081,126 @@ var G = () => ({
|
|
|
1083
1081
|
borderStyle: "solid",
|
|
1084
1082
|
color: e.inputTextColor
|
|
1085
1083
|
}), 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>`;
|
|
1086
|
-
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${
|
|
1084
|
+
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${W(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="${W(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 : [{
|
|
1087
1085
|
label: e.label || "Option",
|
|
1088
1086
|
value: e.name || "option"
|
|
1089
|
-
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${
|
|
1087
|
+
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${W(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${W(t)}" name="${n}" placeholder="${W(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
|
|
1090
1088
|
};
|
|
1089
|
+
function J(e, t, n) {
|
|
1090
|
+
if (e === "none") return "";
|
|
1091
|
+
let r = W(t);
|
|
1092
|
+
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>`;
|
|
1093
|
+
}
|
|
1094
|
+
function Y(e, t, n) {
|
|
1095
|
+
return e.map((r, i) => {
|
|
1096
|
+
let a = i === e.length - 1, o = z({ borderBottom: n.showDividers && !a ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), s = z({
|
|
1097
|
+
display: "flex",
|
|
1098
|
+
alignItems: "center",
|
|
1099
|
+
gap: "8px",
|
|
1100
|
+
width: "100%",
|
|
1101
|
+
cursor: "pointer",
|
|
1102
|
+
textAlign: "left",
|
|
1103
|
+
flexDirection: n.iconOnLeft ? "row-reverse" : "row",
|
|
1104
|
+
padding: t.padding || "14px",
|
|
1105
|
+
backgroundColor: r.defaultOpen ? t.headerActiveBackgroundColor || t.headerBackgroundColor || "#ffffff" : t.headerBackgroundColor || "#ffffff",
|
|
1106
|
+
color: r.defaultOpen ? t.headerActiveTextColor || t.headerTextColor || "#0f172a" : t.headerTextColor || "#0f172a",
|
|
1107
|
+
fontSize: t.headerFontSize || "14px",
|
|
1108
|
+
fontWeight: t.headerFontWeight || 600,
|
|
1109
|
+
fontFamily: t.headerFontFamily,
|
|
1110
|
+
border: "none",
|
|
1111
|
+
font: "inherit",
|
|
1112
|
+
background: void 0
|
|
1113
|
+
}), c = z({
|
|
1114
|
+
display: "grid",
|
|
1115
|
+
gridTemplateRows: r.defaultOpen ? "1fr" : "0fr",
|
|
1116
|
+
transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
|
|
1117
|
+
backgroundColor: t.contentBackgroundColor || "#ffffff"
|
|
1118
|
+
}), l = z({
|
|
1119
|
+
padding: t.contentPadding || "14px",
|
|
1120
|
+
color: t.contentTextColor || "#475569",
|
|
1121
|
+
fontSize: t.contentFontSize || "13px",
|
|
1122
|
+
whiteSpace: "pre-wrap"
|
|
1123
|
+
}), u = J(n.iconStyle, t.iconColor || "#64748b", !!r.defaultOpen), d = W(r.title), f = W(r.content), p = r.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${Y(r.children, t, n)}</div>` : "";
|
|
1124
|
+
return `<div class="plexo-acc-item" style="${o}"><button type="button" data-acc-header data-acc-open="${r.defaultOpen ? "1" : "0"}" style="${s}"><span style="flex: 1;">${d}</span>${u}</button><div data-acc-panel style="${c}"><div style="overflow: hidden;"><div style="${l}">${f}${p}</div></div></div></div>`;
|
|
1125
|
+
}).join("");
|
|
1126
|
+
}
|
|
1091
1127
|
function X(e) {
|
|
1092
1128
|
return `<!-- Unsupported block ${String(e)} -->`;
|
|
1093
1129
|
}
|
|
1094
|
-
var Z = (
|
|
1095
|
-
if (!
|
|
1096
|
-
let
|
|
1097
|
-
...
|
|
1098
|
-
...
|
|
1099
|
-
} :
|
|
1100
|
-
switch (
|
|
1101
|
-
case "heading": return `<h2${
|
|
1102
|
-
case "paragraph": return `<p${
|
|
1103
|
-
case "text": return `<div${
|
|
1130
|
+
var Z = (f) => {
|
|
1131
|
+
if (!f || typeof f != "object") return "";
|
|
1132
|
+
let p = f.style || {}, m = z(f.type === "form_container" ? {
|
|
1133
|
+
...U(),
|
|
1134
|
+
...p
|
|
1135
|
+
} : p), h = f.attributes || {}, g = ` data-plexo-id="${W(f.id)}"`;
|
|
1136
|
+
switch (f.type) {
|
|
1137
|
+
case "heading": return `<h2${g} style="margin-top: 0; margin-bottom: 8px; ${m}">${h.text || "Heading"}</h2>`;
|
|
1138
|
+
case "paragraph": return `<p${g} style="margin-top: 0; margin-bottom: 12px; ${m}">${h.text || "Paragraph text content."}</p>`;
|
|
1139
|
+
case "text": return `<div${g} style="${m}">${h.text || ""}</div>`;
|
|
1104
1140
|
case "button": {
|
|
1105
|
-
let e =
|
|
1106
|
-
...
|
|
1141
|
+
let e = c(f), t = z({
|
|
1142
|
+
...p,
|
|
1107
1143
|
width: e.width,
|
|
1108
1144
|
height: e.height
|
|
1109
1145
|
});
|
|
1110
|
-
return `<div style="text-align: ${
|
|
1146
|
+
return `<div style="text-align: ${p.textAlign || "center"};"><a${g} href="${h.href || "#"}" target="${h.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${h.text || "Button"}</a></div>`;
|
|
1111
1147
|
}
|
|
1112
1148
|
case "image": {
|
|
1113
|
-
let
|
|
1114
|
-
...
|
|
1115
|
-
width:
|
|
1116
|
-
height:
|
|
1149
|
+
let e = l(f), t = p.textAlign === "center" ? "margin: 0 auto; display: block;" : p.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = z({
|
|
1150
|
+
...p,
|
|
1151
|
+
width: e.width,
|
|
1152
|
+
height: e.height
|
|
1117
1153
|
});
|
|
1118
|
-
return `<img${
|
|
1154
|
+
return `<img${g} src="${h.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${h.alt || ""}" style="${n} ${t}" />`;
|
|
1119
1155
|
}
|
|
1120
|
-
case "divider": return `<hr${
|
|
1121
|
-
case "spacer": return `<div${
|
|
1122
|
-
case "card": return `<div${
|
|
1123
|
-
<h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${
|
|
1124
|
-
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${
|
|
1156
|
+
case "divider": return `<hr${g} style="border: 0; border-top: ${p.borderWidth || "1px"} ${p.borderStyle || "solid"} ${p.borderColor || "#334155"}; ${m}" />`;
|
|
1157
|
+
case "spacer": return `<div${g} style="height: ${p.height || "24px"};"></div>`;
|
|
1158
|
+
case "card": return `<div${g} style="${m}">
|
|
1159
|
+
<h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${h.title || "Card Title"}</h3>
|
|
1160
|
+
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${h.description || "Card description."}</p>
|
|
1125
1161
|
</div>`;
|
|
1126
1162
|
case "form_container": {
|
|
1127
|
-
let
|
|
1128
|
-
...
|
|
1129
|
-
...
|
|
1130
|
-
},
|
|
1131
|
-
for (let
|
|
1132
|
-
|
|
1133
|
-
let
|
|
1134
|
-
backgroundColor:
|
|
1135
|
-
color:
|
|
1136
|
-
borderRadius:
|
|
1137
|
-
paddingTop:
|
|
1138
|
-
paddingBottom:
|
|
1139
|
-
paddingLeft:
|
|
1140
|
-
paddingRight:
|
|
1141
|
-
fontSize:
|
|
1142
|
-
fontWeight:
|
|
1143
|
-
width:
|
|
1163
|
+
let t = {
|
|
1164
|
+
...U(),
|
|
1165
|
+
...p
|
|
1166
|
+
}, n = {};
|
|
1167
|
+
for (let e of Object.keys(t)) K.includes(e) || (n[e] = t[e]);
|
|
1168
|
+
n.height = r(f);
|
|
1169
|
+
let i = z(n), a = e(Array.isArray(h.fields) ? h.fields : []), o = t.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${q(e)}</div>`).join(""), c = h.buttonAutoWidth === !1 ? t.buttonWidth || "100%" : "auto", l = t.buttonAlign === "left" ? "flex-start" : t.buttonAlign === "right" ? "flex-end" : "center", u = z({
|
|
1170
|
+
backgroundColor: t.buttonBackgroundColor,
|
|
1171
|
+
color: t.buttonTextColor,
|
|
1172
|
+
borderRadius: t.buttonBorderRadius,
|
|
1173
|
+
paddingTop: t.buttonPaddingTop,
|
|
1174
|
+
paddingBottom: t.buttonPaddingBottom,
|
|
1175
|
+
paddingLeft: t.buttonPaddingLeft,
|
|
1176
|
+
paddingRight: t.buttonPaddingRight,
|
|
1177
|
+
fontSize: t.buttonFontSize,
|
|
1178
|
+
fontWeight: t.buttonFontWeight,
|
|
1179
|
+
width: c
|
|
1144
1180
|
});
|
|
1145
|
-
return `<form${
|
|
1181
|
+
return `<form${g} action="${W(h.actionUrl || h.action || "#")}" method="${W(h.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${l};"><button type="submit" style="border: 0; cursor: pointer; ${u}">${h.submitLabel || "Submit"}</button></div></form>`;
|
|
1146
1182
|
}
|
|
1147
1183
|
case "input": {
|
|
1148
|
-
let e =
|
|
1149
|
-
return `<input${
|
|
1184
|
+
let e = h.inputType || h.type || "text", t = W(h.name || h.fieldName || "field"), n = W(h.placeholder || ""), r = h.required ? " required" : "";
|
|
1185
|
+
return `<input${g} type="${W(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${m}"${r} />`;
|
|
1150
1186
|
}
|
|
1151
|
-
case "textarea": return `<textarea${
|
|
1152
|
-
case "select": return `<select${
|
|
1153
|
-
case "html": return `<div${
|
|
1154
|
-
...
|
|
1155
|
-
height:
|
|
1156
|
-
})}">${
|
|
1187
|
+
case "textarea": return `<textarea${g} name="${W(h.name || h.fieldName || "field")}" placeholder="${W(h.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${m}"${h.required ? " required" : ""}></textarea>`;
|
|
1188
|
+
case "select": return `<select${g} name="${W(h.name || h.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${m}"${h.required ? " required" : ""}>${(Array.isArray(h.options) ? h.options : []).map((e) => `<option value="${W(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
1189
|
+
case "html": return `<div${g} style="${z({
|
|
1190
|
+
...p,
|
|
1191
|
+
height: o(f, "auto")
|
|
1192
|
+
})}">${h.htmlContent || h.text || ""}</div>`;
|
|
1157
1193
|
case "social": {
|
|
1158
|
-
let e =
|
|
1159
|
-
return `<div${
|
|
1160
|
-
padding:
|
|
1161
|
-
margin:
|
|
1194
|
+
let e = d(f), t = p.textAlign === "center" ? "center" : p.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1195
|
+
return `<div${g} style="${z({
|
|
1196
|
+
padding: p.padding,
|
|
1197
|
+
margin: p.margin,
|
|
1162
1198
|
display: "flex",
|
|
1163
1199
|
flexWrap: "wrap",
|
|
1164
|
-
gap:
|
|
1165
|
-
justifyContent:
|
|
1200
|
+
gap: p.iconSpacing || "8px",
|
|
1201
|
+
justifyContent: t
|
|
1166
1202
|
})}">${e.map((e) => {
|
|
1167
|
-
let t =
|
|
1203
|
+
let t = z({
|
|
1168
1204
|
width: e.size,
|
|
1169
1205
|
height: e.size,
|
|
1170
1206
|
padding: "8px",
|
|
@@ -1176,117 +1212,128 @@ var Z = (h) => {
|
|
|
1176
1212
|
justifyContent: "center",
|
|
1177
1213
|
overflow: "hidden"
|
|
1178
1214
|
});
|
|
1179
|
-
return `<a href="${
|
|
1215
|
+
return `<a href="${W(e.url)}" style="${t} text-decoration: none;">${L(e.provider, e.color)}</a>`;
|
|
1180
1216
|
}).join("")}</div>`;
|
|
1181
1217
|
}
|
|
1182
1218
|
case "menu": {
|
|
1183
|
-
let e =
|
|
1184
|
-
return `<div${
|
|
1185
|
-
...
|
|
1219
|
+
let e = i(f), t = p.textAlign === "center" ? "center" : p.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1220
|
+
return `<div${g} style="${z({
|
|
1221
|
+
...p,
|
|
1186
1222
|
display: "flex",
|
|
1187
1223
|
flexWrap: "wrap",
|
|
1188
1224
|
gap: "16px",
|
|
1189
1225
|
justifyContent: t
|
|
1190
|
-
})}">${e.map((e) => `<a href="${
|
|
1226
|
+
})}">${e.map((e) => `<a href="${W(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${p.fontWeight || 600};">${W(e.label)}</a>`).join("")}</div>`;
|
|
1191
1227
|
}
|
|
1192
1228
|
case "icon": {
|
|
1193
|
-
let e =
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
})), o = g.textAlign === "right" ? "flex-end" : g.textAlign === "left" ? "flex-start" : "center", l = V({
|
|
1197
|
-
padding: g.padding,
|
|
1198
|
-
margin: g.margin,
|
|
1229
|
+
let e = p.fontSize || `${h.iconSize || 48}px`, t = p.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = u(h.iconName, n, t), i = p.textAlign === "right" ? "flex-end" : p.textAlign === "left" ? "flex-start" : "center", a = z({
|
|
1230
|
+
padding: p.padding,
|
|
1231
|
+
margin: p.margin,
|
|
1199
1232
|
display: "flex",
|
|
1200
|
-
justifyContent:
|
|
1201
|
-
}),
|
|
1202
|
-
return `<div style="${
|
|
1233
|
+
justifyContent: i
|
|
1234
|
+
}), o = typeof h.href == "string" ? h.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
|
|
1235
|
+
return `<div style="${a}">${o ? `<a${g} href="${W(o)}" target="${h.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${g}>${s}</span>`}</div>`;
|
|
1203
1236
|
}
|
|
1204
1237
|
case "table": {
|
|
1205
|
-
let e =
|
|
1206
|
-
let a = i ? "th" : "td", o = i ?
|
|
1207
|
-
return `<tr>${
|
|
1208
|
-
let
|
|
1209
|
-
padding:
|
|
1210
|
-
border:
|
|
1238
|
+
let e = t(f), n = `${p.borderWidth || "1px"} ${p.borderStyle || "solid"} ${p.borderColor || "#cbd5e1"}`, r = (t, r, i) => {
|
|
1239
|
+
let a = i ? "th" : "td", o = i ? p.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : p.contentBgColor || "#ffffff", s = i ? p.headerTextColor || "#1e293b" : p.contentTextColor || "#475569", c = i ? p.headerTextAlign || "left" : p.contentTextAlign || "left";
|
|
1240
|
+
return `<tr>${t.map((e) => {
|
|
1241
|
+
let t = z({
|
|
1242
|
+
padding: p.cellPadding || "8px",
|
|
1243
|
+
border: n,
|
|
1211
1244
|
backgroundColor: o,
|
|
1212
1245
|
color: s,
|
|
1213
1246
|
textAlign: c,
|
|
1214
|
-
lineHeight:
|
|
1215
|
-
letterSpacing:
|
|
1247
|
+
lineHeight: p.contentLineHeight,
|
|
1248
|
+
letterSpacing: p.contentLetterSpacing,
|
|
1216
1249
|
fontWeight: i ? "700" : void 0
|
|
1217
1250
|
});
|
|
1218
|
-
return `<${a} style="${
|
|
1251
|
+
return `<${a} style="${t}">${e || " "}</${a}>`;
|
|
1219
1252
|
}).join("")}</tr>`;
|
|
1220
|
-
},
|
|
1253
|
+
}, i = e.enableHeader && e.cells.length > 0 ? `<thead>${r(e.cells[0], 0, !0)}</thead>` : "", a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length, s = e.cells.slice(a, Math.max(a, o)).map((e, t) => r(e, t, !1)).join(""), c = e.enableFooter && e.cells.length > a ? `<tfoot>${r(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l = z({
|
|
1221
1254
|
borderCollapse: "collapse",
|
|
1222
1255
|
width: "100%"
|
|
1223
1256
|
});
|
|
1224
|
-
return `<div${
|
|
1225
|
-
padding:
|
|
1226
|
-
margin:
|
|
1257
|
+
return `<div${g} style="${z({
|
|
1258
|
+
padding: p.padding,
|
|
1259
|
+
margin: p.margin,
|
|
1227
1260
|
overflowX: "auto"
|
|
1228
|
-
})}"><table style="${l}">${
|
|
1261
|
+
})}"><table style="${l}">${i}<tbody>${s}</tbody>${c}</table></div>`;
|
|
1229
1262
|
}
|
|
1230
1263
|
case "video": {
|
|
1231
|
-
let e =
|
|
1232
|
-
return `<div${
|
|
1233
|
-
padding:
|
|
1234
|
-
margin:
|
|
1235
|
-
borderRadius:
|
|
1264
|
+
let e = s(h.videoUrl), t = h.linkType === "email" ? `mailto:${h.href || ""}` : h.href || h.videoUrl || "#", n = h.target || "_blank";
|
|
1265
|
+
return `<div${g} style="${z({
|
|
1266
|
+
padding: p.padding,
|
|
1267
|
+
margin: p.margin,
|
|
1268
|
+
borderRadius: p.borderRadius,
|
|
1236
1269
|
overflow: "hidden"
|
|
1237
|
-
})}"><a href="${
|
|
1270
|
+
})}"><a href="${W(t)}" target="${W(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${W(e.thumbnailUrl)}" alt="${W(h.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>`;
|
|
1238
1271
|
}
|
|
1239
1272
|
case "timer": {
|
|
1240
|
-
let e =
|
|
1241
|
-
fontFamily:
|
|
1242
|
-
fontSize:
|
|
1243
|
-
color:
|
|
1273
|
+
let e = h.showLabels !== !1, t = z({
|
|
1274
|
+
fontFamily: p.digitsFontFamily,
|
|
1275
|
+
fontSize: p.digitsFontSize || "40px",
|
|
1276
|
+
color: p.digitsColor || "#1e293b",
|
|
1244
1277
|
fontWeight: "800"
|
|
1245
|
-
}),
|
|
1246
|
-
fontFamily:
|
|
1247
|
-
fontSize:
|
|
1248
|
-
color:
|
|
1249
|
-
}),
|
|
1250
|
-
backgroundColor:
|
|
1251
|
-
borderRadius:
|
|
1252
|
-
padding:
|
|
1278
|
+
}), r = z({
|
|
1279
|
+
fontFamily: p.labelsFontFamily,
|
|
1280
|
+
fontSize: p.labelsFontSize || "16px",
|
|
1281
|
+
color: p.labelsColor || "#64748b"
|
|
1282
|
+
}), i = z({
|
|
1283
|
+
backgroundColor: p.backgroundColor || "#f8fafc",
|
|
1284
|
+
borderRadius: p.borderRadius || "8px",
|
|
1285
|
+
padding: p.padding || "16px",
|
|
1253
1286
|
textAlign: "center"
|
|
1254
|
-
}),
|
|
1255
|
-
return `<div${
|
|
1287
|
+
}), a = (n, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${n}" style="${t}">${a}</span>${e ? `<span style="${r}">${i}</span>` : ""}</div>`, o = n(h.targetDate), s = W(h.targetDate || "2026-12-31T23:59:59"), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${f.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>`;
|
|
1288
|
+
return `<div${g} data-plexo-target="${s}" style="${i}"><div>${a("days", "Days", o.days)}${a("hours", "Hours", o.hours)}${a("minutes", "Mins", o.minutes)}${a("seconds", "Secs", o.seconds)}</div>${c}</div>`;
|
|
1256
1289
|
}
|
|
1257
1290
|
case "carousel": {
|
|
1258
|
-
let e = Array.isArray(
|
|
1259
|
-
padding:
|
|
1260
|
-
margin:
|
|
1261
|
-
backgroundColor:
|
|
1291
|
+
let e = Array.isArray(h.images) ? h.images : [], t = z({
|
|
1292
|
+
padding: p.padding || "10px",
|
|
1293
|
+
margin: p.margin,
|
|
1294
|
+
backgroundColor: p.backgroundColor,
|
|
1262
1295
|
position: "relative",
|
|
1263
1296
|
overflow: "hidden",
|
|
1264
1297
|
borderRadius: "12px"
|
|
1265
1298
|
});
|
|
1266
|
-
if (e.length === 0) return `<div${
|
|
1267
|
-
let n = Math.min(e.length - 1, Math.max(0, parseInt(String(
|
|
1268
|
-
return `<div${
|
|
1299
|
+
if (e.length === 0) return `<div${g} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
|
|
1300
|
+
let n = Math.min(e.length - 1, Math.max(0, parseInt(String(h.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${W(e.src)}" alt="${W(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;">${W(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>` : "";
|
|
1301
|
+
return `<div${g} 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="${f.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>`;
|
|
1302
|
+
}
|
|
1303
|
+
case "accordion": {
|
|
1304
|
+
let e = a(f), t = h.mode === "multi" ? "multi" : "single", n = h.iconStyle || "chevron", r = h.iconPosition === "left", i = h.showDividers !== !1, o = h.animation !== "none", s = z({
|
|
1305
|
+
border: `${p.borderWidth || "1px"} ${p.borderStyle || "solid"} ${p.borderColor || "#e2e8f0"}`,
|
|
1306
|
+
borderRadius: p.borderRadius || "10px",
|
|
1307
|
+
overflow: "hidden",
|
|
1308
|
+
margin: p.margin
|
|
1309
|
+
});
|
|
1310
|
+
return e.length === 0 ? `<div${g} style="${s}"></div>` : `<div${g} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${Y(e, p, {
|
|
1311
|
+
iconStyle: n,
|
|
1312
|
+
iconOnLeft: r,
|
|
1313
|
+
showDividers: i,
|
|
1314
|
+
animated: o
|
|
1315
|
+
})}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${f.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>`;
|
|
1269
1316
|
}
|
|
1270
|
-
default: return X(
|
|
1317
|
+
default: return X(f.type);
|
|
1271
1318
|
}
|
|
1272
1319
|
}, Q = (e, t) => {
|
|
1273
1320
|
if (!e || typeof e != "object") return "";
|
|
1274
|
-
let n =
|
|
1321
|
+
let n = R(e);
|
|
1275
1322
|
if (!n) 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. -->`;
|
|
1276
|
-
let r =
|
|
1277
|
-
|
|
1323
|
+
let r = z(n.style || {}), i = G("id", n.htmlId), a = G("class", n.htmlClass), o = n.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
1324
|
+
H(t, o, n.style, "tablet", n.styleTablet), H(t, o, n.style, "mobile", n.styleMobile);
|
|
1278
1325
|
let s = `\n <!-- ROW START: ${n.id || "row"} -->`;
|
|
1279
1326
|
s += `\n <div data-plexo-id="${o}"${i}${a} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${r}">`;
|
|
1280
1327
|
let c = Array.isArray(n.columns) ? n.columns : [];
|
|
1281
1328
|
for (let e of c) {
|
|
1282
1329
|
if (!e) continue;
|
|
1283
|
-
let n = e.styles || e.style || {}, r =
|
|
1284
|
-
|
|
1330
|
+
let n = e.styles || e.style || {}, r = z(n), i = G("id", e.attrs?.htmlId), a = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", o = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
|
|
1331
|
+
H(t, o, n, "tablet", e.stylesTablet), H(t, o, n, "mobile", e.stylesMobile), s += `\n <!-- COLUMN START: ${e.id || "col"} -->`, s += `\n <div data-plexo-id="${o}"${i} class="plexo-col${a}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; ${r}">`;
|
|
1285
1332
|
let c = Array.isArray(e.elements) ? e.elements : [];
|
|
1286
1333
|
for (let e of c) {
|
|
1287
1334
|
if (!e) continue;
|
|
1288
|
-
let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i =
|
|
1289
|
-
|
|
1335
|
+
let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i = G("id", n.htmlId), a = G("class", r), o = e.style?.display, c = o === "inline-block" || o === "inline" || o === "inline-flex" ? `margin-bottom: 16px; display: ${o}; vertical-align: top;` : "margin-bottom: 16px;";
|
|
1336
|
+
H(t, e.id, e.style, "tablet", e.styleTablet), H(t, e.id, e.style, "mobile", e.styleMobile), s += `\n <div${i}${a} style="${c}">`, s += `\n ${Z(e)}`, s += "\n </div>";
|
|
1290
1337
|
}
|
|
1291
1338
|
let l = Array.isArray(e.nestedRows) ? e.nestedRows : [];
|
|
1292
1339
|
for (let e of l) s += Q(e, t);
|
|
@@ -1320,7 +1367,7 @@ var Z = (h) => {
|
|
|
1320
1367
|
"textColor"
|
|
1321
1368
|
], a = {};
|
|
1322
1369
|
for (let e of Object.keys(r)) i.includes(e) || (a[e] = r[e]);
|
|
1323
|
-
let o =
|
|
1370
|
+
let o = z(a), s = typeof r.htmlTitle == "string" && r.htmlTitle.trim() ? r.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", c = G("id", r.htmlId), l = G("class", r.htmlClass), u = typeof r.customCss == "string" && r.customCss.trim() ? r.customCss.trim() : "", d = typeof r.customJs == "string" && r.customJs.trim() ? r.customJs.trim() : "", f = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], p = S(x(f, [r.fontFamily])), m = {
|
|
1324
1371
|
tablet: [],
|
|
1325
1372
|
mobile: []
|
|
1326
1373
|
}, h = "";
|
|
@@ -1329,11 +1376,11 @@ var Z = (h) => {
|
|
|
1329
1376
|
<html>
|
|
1330
1377
|
<head>
|
|
1331
1378
|
<meta charset="utf-8">
|
|
1332
|
-
<title>${
|
|
1379
|
+
<title>${W(s)}</title>
|
|
1333
1380
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1334
1381
|
${p ? `<link rel="stylesheet" href="${p}">` : ""}
|
|
1335
1382
|
<style>
|
|
1336
|
-
body { margin: 0; font-family: ${
|
|
1383
|
+
body { margin: 0; font-family: ${F}; }
|
|
1337
1384
|
.plexo-row {
|
|
1338
1385
|
display: flex;
|
|
1339
1386
|
flex-wrap: wrap;
|
|
@@ -1363,14 +1410,14 @@ ${d ? ` <script>\n${d}\n <\/script>` : ""}
|
|
|
1363
1410
|
</body>
|
|
1364
1411
|
</html>`, v = v.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), v;
|
|
1365
1412
|
};
|
|
1366
|
-
function
|
|
1413
|
+
function ee(e) {
|
|
1367
1414
|
return $(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
1368
1415
|
}
|
|
1369
|
-
function
|
|
1416
|
+
function te(e) {
|
|
1370
1417
|
return $(e);
|
|
1371
1418
|
}
|
|
1372
|
-
function
|
|
1419
|
+
function ne(e) {
|
|
1373
1420
|
return e;
|
|
1374
1421
|
}
|
|
1375
1422
|
//#endregion
|
|
1376
|
-
export {
|
|
1423
|
+
export { y as _, te as a, p as b, U as c, P as d, S as f, _ as g, m as h, $ as i, B as l, v as m, K as n, ee as o, x as p, H as r, R as s, F as t, ne as u, h as v, f as x, g as y };
|