@charisol/plexo-sdk 1.0.35 → 1.0.37
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/{compiler-CZDi3u8S.js → compiler-BHUlR0D2.js} +259 -118
- package/dist/compiler.js +1 -1
- package/dist/compilerClient.js +87 -41
- package/dist/components/CodeViewer.d.ts +3 -0
- package/dist/components/ImportModal.d.ts +32 -0
- package/dist/components/properties/InternalLinkField.d.ts +28 -0
- package/dist/elementResolvers-qyNepC_f.js +39752 -0
- package/dist/index.js +16129 -54827
- package/dist/plexo-sdk.css +1 -1
- package/dist/store.d.ts +7 -0
- package/dist/utilities/elementResolvers.d.ts +121 -0
- package/dist/utilities/htmlToTemplate.d.ts +2 -0
- package/dist/utilities/playground.interfaces.d.ts +17 -0
- package/package.json +2 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./elementResolvers-qyNepC_f.js";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { renderToStaticMarkup as m } from "react-dom/server";
|
|
1
4
|
//#region src/utilities/playground.constants.ts
|
|
2
|
-
var
|
|
5
|
+
var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g = [
|
|
3
6
|
{
|
|
4
7
|
id: "all",
|
|
5
8
|
label: "All sources"
|
|
@@ -16,7 +19,7 @@ var e = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, t
|
|
|
16
19
|
id: "pixabay",
|
|
17
20
|
label: "Pixabay"
|
|
18
21
|
}
|
|
19
|
-
],
|
|
22
|
+
], _ = [
|
|
20
23
|
{
|
|
21
24
|
id: "surface-book",
|
|
22
25
|
label: "Surface Book",
|
|
@@ -83,7 +86,7 @@ var e = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, t
|
|
|
83
86
|
width: 375,
|
|
84
87
|
category: "mobile"
|
|
85
88
|
}
|
|
86
|
-
],
|
|
89
|
+
], v = 1280, y = [
|
|
87
90
|
{
|
|
88
91
|
id: "facebook",
|
|
89
92
|
label: "Facebook"
|
|
@@ -116,7 +119,7 @@ var e = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, t
|
|
|
116
119
|
id: "tiktok",
|
|
117
120
|
label: "TikTok"
|
|
118
121
|
}
|
|
119
|
-
],
|
|
122
|
+
], b = [
|
|
120
123
|
{
|
|
121
124
|
label: "Text",
|
|
122
125
|
value: "text"
|
|
@@ -149,7 +152,7 @@ var e = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, t
|
|
|
149
152
|
label: "Checkbox",
|
|
150
153
|
value: "checkbox"
|
|
151
154
|
}
|
|
152
|
-
],
|
|
155
|
+
], x = [
|
|
153
156
|
{
|
|
154
157
|
label: "1 Column",
|
|
155
158
|
widths: ["100%"],
|
|
@@ -198,7 +201,7 @@ var e = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, t
|
|
|
198
201
|
"25%"
|
|
199
202
|
]
|
|
200
203
|
}
|
|
201
|
-
],
|
|
204
|
+
], S = [
|
|
202
205
|
{
|
|
203
206
|
label: "Roboto",
|
|
204
207
|
value: "'Roboto', sans-serif",
|
|
@@ -599,8 +602,8 @@ var e = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, t
|
|
|
599
602
|
value: "'Great Vibes', cursive",
|
|
600
603
|
style: "handwriting"
|
|
601
604
|
}
|
|
602
|
-
],
|
|
603
|
-
function
|
|
605
|
+
], C = new Map(S.map((e) => [e.value, e.label]));
|
|
606
|
+
function w(e, t = []) {
|
|
604
607
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
605
608
|
if (!e) return;
|
|
606
609
|
let t = Array.isArray(e.columns) ? e.columns : [];
|
|
@@ -618,17 +621,17 @@ function l(e, t = []) {
|
|
|
618
621
|
for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
|
|
619
622
|
return n;
|
|
620
623
|
}
|
|
621
|
-
function
|
|
624
|
+
function T(e) {
|
|
622
625
|
let t = /* @__PURE__ */ new Set();
|
|
623
626
|
for (let n of e) {
|
|
624
|
-
let e =
|
|
627
|
+
let e = C.get(n);
|
|
625
628
|
e && t.add(e);
|
|
626
629
|
}
|
|
627
630
|
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`;
|
|
628
631
|
}
|
|
629
632
|
//#endregion
|
|
630
633
|
//#region src/utilities/responsiveDefaults.ts
|
|
631
|
-
var
|
|
634
|
+
var E = {
|
|
632
635
|
tablet: {
|
|
633
636
|
thresholdPx: 24,
|
|
634
637
|
scale: .85,
|
|
@@ -639,7 +642,7 @@ var d = {
|
|
|
639
642
|
scale: .7,
|
|
640
643
|
floorPx: 14
|
|
641
644
|
}
|
|
642
|
-
},
|
|
645
|
+
}, D = {
|
|
643
646
|
tablet: {
|
|
644
647
|
thresholdPx: 320,
|
|
645
648
|
scale: .8,
|
|
@@ -650,7 +653,7 @@ var d = {
|
|
|
650
653
|
scale: .55,
|
|
651
654
|
floorPx: 140
|
|
652
655
|
}
|
|
653
|
-
},
|
|
656
|
+
}, ee = {
|
|
654
657
|
tablet: {
|
|
655
658
|
thresholdPx: 48,
|
|
656
659
|
scale: .75,
|
|
@@ -661,7 +664,7 @@ var d = {
|
|
|
661
664
|
scale: .55,
|
|
662
665
|
floorPx: 16
|
|
663
666
|
}
|
|
664
|
-
},
|
|
667
|
+
}, O = {
|
|
665
668
|
tablet: {
|
|
666
669
|
thresholdPx: 500,
|
|
667
670
|
scale: 1,
|
|
@@ -672,11 +675,11 @@ var d = {
|
|
|
672
675
|
scale: 1,
|
|
673
676
|
floorPx: 0
|
|
674
677
|
}
|
|
675
|
-
},
|
|
678
|
+
}, k = ["fontSize"], A = [
|
|
676
679
|
"height",
|
|
677
680
|
"minHeight",
|
|
678
681
|
"maxHeight"
|
|
679
|
-
],
|
|
682
|
+
], j = [
|
|
680
683
|
"padding",
|
|
681
684
|
"paddingTop",
|
|
682
685
|
"paddingBottom",
|
|
@@ -685,8 +688,8 @@ var d = {
|
|
|
685
688
|
"margin",
|
|
686
689
|
"marginTop",
|
|
687
690
|
"marginBottom"
|
|
688
|
-
],
|
|
689
|
-
function
|
|
691
|
+
], M = ["width", "maxWidth"];
|
|
692
|
+
function N(e) {
|
|
690
693
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
691
694
|
if (typeof e != "string") return null;
|
|
692
695
|
let t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/);
|
|
@@ -694,48 +697,60 @@ function y(e) {
|
|
|
694
697
|
let n = parseFloat(t[1]);
|
|
695
698
|
return Number.isFinite(n) ? n : null;
|
|
696
699
|
}
|
|
697
|
-
function
|
|
700
|
+
function P(e, t) {
|
|
698
701
|
return e < t.thresholdPx ? null : Math.max(Math.round(e * t.scale), t.floorPx);
|
|
699
702
|
}
|
|
700
|
-
function
|
|
703
|
+
function F(e, t) {
|
|
701
704
|
if (!e || typeof e != "object") return {};
|
|
702
705
|
let n = {};
|
|
703
|
-
for (let r of
|
|
704
|
-
let i =
|
|
706
|
+
for (let r of k) {
|
|
707
|
+
let i = N(e[r]);
|
|
705
708
|
if (i === null) continue;
|
|
706
|
-
let a =
|
|
709
|
+
let a = P(i, E[t]);
|
|
707
710
|
a !== null && (n[r] = `${a}px`);
|
|
708
711
|
}
|
|
709
|
-
for (let r of
|
|
710
|
-
let i =
|
|
712
|
+
for (let r of A) {
|
|
713
|
+
let i = N(e[r]);
|
|
711
714
|
if (i === null) continue;
|
|
712
|
-
let a =
|
|
715
|
+
let a = P(i, D[t]);
|
|
713
716
|
a !== null && (n[r] = `${a}px`);
|
|
714
717
|
}
|
|
715
|
-
for (let r of
|
|
716
|
-
let i =
|
|
718
|
+
for (let r of j) {
|
|
719
|
+
let i = N(e[r]);
|
|
717
720
|
if (i === null) continue;
|
|
718
|
-
let a =
|
|
721
|
+
let a = P(i, ee[t]);
|
|
719
722
|
a !== null && (n[r] = `${a}px`);
|
|
720
723
|
}
|
|
721
|
-
for (let r of
|
|
722
|
-
let i =
|
|
723
|
-
i !== null && i >=
|
|
724
|
+
for (let r of M) {
|
|
725
|
+
let i = N(e[r]);
|
|
726
|
+
i !== null && i >= O[t].thresholdPx && (n[r] = "100%");
|
|
724
727
|
}
|
|
725
728
|
return n;
|
|
726
729
|
}
|
|
727
|
-
function
|
|
730
|
+
function I(e, t, n) {
|
|
728
731
|
let r = e || {};
|
|
729
732
|
return n ? {
|
|
730
733
|
...r,
|
|
731
|
-
...
|
|
734
|
+
...F(r, n),
|
|
732
735
|
...t || {}
|
|
733
736
|
} : r;
|
|
734
737
|
}
|
|
735
738
|
//#endregion
|
|
736
739
|
//#region src/utilities/compiler.ts
|
|
737
|
-
var
|
|
738
|
-
|
|
740
|
+
var L = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", R = (e) => e === "twitter" ? "x" : e, z = (e, t = "currentColor") => {
|
|
741
|
+
switch (R(e)) {
|
|
742
|
+
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
|
+
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
|
+
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>`;
|
|
745
|
+
case "x": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M6 5h3.1l3 4.2L15.7 5H18l-4.8 5.5L18.4 18h-3.1l-3.3-4.7L8 18H5.6l5-5.8z"/></svg>`;
|
|
746
|
+
case "youtube": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="3" y="6.5" width="18" height="11" rx="3" fill="${t}"/><path fill="#fff" d="m10 9 5 3-5 3z"/></svg>`;
|
|
747
|
+
case "pinterest": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M12 4a8 8 0 0 0-2.9 15.46c-.04-1.17 0-2.58.3-3.82l1.1-4.6s-.27-.56-.27-1.4c0-1.3.75-2.27 1.68-2.27.8 0 1.18.6 1.18 1.3 0 .8-.5 2-.77 3.12-.22.94.47 1.7 1.4 1.7 1.67 0 2.8-2.15 2.8-4.7 0-1.93-1.3-3.37-3.67-3.37-2.68 0-4.35 2-4.35 4.23 0 .77.23 1.34.6 1.77.17.2.2.29.13.53l-.2.8c-.07.25-.3.34-.56.25-1.55-.63-2.27-2.32-2.27-4.22 0-3.14 2.64-6.9 7.89-6.9 4.21 0 6.98 3.05 6.98 6.32 0 4.32-2.4 7.54-5.93 7.54-1.18 0-2.28-.64-2.65-1.37l-.73 2.78c-.26.95-.77 2.14-1.22 2.96A8 8 0 1 0 12 4Z"/></svg>`;
|
|
748
|
+
case "whatsapp": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M12 4a8 8 0 0 0-6.9 12.04L4 20l4.11-1.06A8 8 0 1 0 12 4Zm4.55 11.36c-.2.56-1.14 1.04-1.57 1.1-.4.06-.92.09-1.48-.08-.34-.11-.78-.25-1.35-.5-2.37-1.03-3.92-3.45-4.04-3.6-.11-.15-.96-1.27-.96-2.42s.6-1.72.8-1.96c.2-.24.45-.3.6-.3h.43c.14 0 .33-.05.51.38.2.48.7 1.67.75 1.79.06.12.1.26.02.42-.07.15-.11.26-.22.39-.11.13-.23.29-.33.39-.11.11-.22.23-.1.45.11.22.52.86 1.11 1.39.76.68 1.4.89 1.62.99.22.11.35.09.48-.06.13-.15.56-.65.72-.88.15-.22.31-.18.52-.11.22.08 1.36.64 1.6.76.23.11.38.17.44.27.06.1.06.61-.14 1.17Z"/></svg>`;
|
|
749
|
+
case "tiktok": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M14.4 4c.24 1.12.9 2.08 1.86 2.67.7.42 1.52.64 2.35.63V10a6.5 6.5 0 0 1-4.2-1.52v5.24A4.72 4.72 0 1 1 9.7 9v2.6a2.12 2.12 0 1 0 2.1 2.12V4z"/></svg>`;
|
|
750
|
+
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
|
+
}
|
|
752
|
+
};
|
|
753
|
+
function B(e) {
|
|
739
754
|
if (!e || typeof e != "object") return null;
|
|
740
755
|
if (Array.isArray(e.columns) && e.columns.length > 0) return e;
|
|
741
756
|
let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
|
|
@@ -989,7 +1004,7 @@ function w(e) {
|
|
|
989
1004
|
}
|
|
990
1005
|
}
|
|
991
1006
|
}
|
|
992
|
-
var
|
|
1007
|
+
var V = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
|
|
993
1008
|
let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
|
|
994
1009
|
return typeof t == "number" && [
|
|
995
1010
|
"padding",
|
|
@@ -1000,25 +1015,25 @@ var T = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
1000
1015
|
"width",
|
|
1001
1016
|
"height"
|
|
1002
1017
|
].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
|
|
1003
|
-
}).join(" "),
|
|
1004
|
-
function
|
|
1018
|
+
}).join(" "), H = (e = {}) => V(e).replace(/;(\s|$)/g, " !important;$1");
|
|
1019
|
+
function U(e) {
|
|
1005
1020
|
if (typeof e != "string") return !1;
|
|
1006
1021
|
let t = e.toLowerCase();
|
|
1007
1022
|
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);
|
|
1008
1023
|
}
|
|
1009
|
-
function
|
|
1024
|
+
function W(e, t, n, r, i) {
|
|
1010
1025
|
let a = {
|
|
1011
|
-
...
|
|
1026
|
+
...F(n, r),
|
|
1012
1027
|
...i || {}
|
|
1013
1028
|
};
|
|
1014
|
-
for (let e of Object.keys(a))
|
|
1029
|
+
for (let e of Object.keys(a)) U(a[e]) && delete a[e];
|
|
1015
1030
|
if (Object.keys(a).length === 0) return;
|
|
1016
|
-
let o =
|
|
1031
|
+
let o = H(a);
|
|
1017
1032
|
if (!o) return;
|
|
1018
1033
|
let s = String(t).replace(/["\\]/g, "");
|
|
1019
1034
|
e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
|
|
1020
1035
|
}
|
|
1021
|
-
var
|
|
1036
|
+
var G = () => ({
|
|
1022
1037
|
backgroundColor: "#ffffff",
|
|
1023
1038
|
borderRadius: "20px",
|
|
1024
1039
|
width: "100%",
|
|
@@ -1041,11 +1056,11 @@ var k = () => ({
|
|
|
1041
1056
|
buttonPaddingRight: "14px",
|
|
1042
1057
|
buttonFontSize: "13px",
|
|
1043
1058
|
buttonFontWeight: "700"
|
|
1044
|
-
}),
|
|
1059
|
+
}), K = (e) => (e || "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), q = (e, t) => {
|
|
1045
1060
|
if (typeof t != "string") return "";
|
|
1046
1061
|
let n = t.trim();
|
|
1047
|
-
return n ? ` ${e}="${
|
|
1048
|
-
},
|
|
1062
|
+
return n ? ` ${e}="${K(n)}"` : "";
|
|
1063
|
+
}, J = [
|
|
1049
1064
|
"fieldSpacing",
|
|
1050
1065
|
"buttonBackgroundColor",
|
|
1051
1066
|
"buttonTextColor",
|
|
@@ -1058,54 +1073,64 @@ var k = () => ({
|
|
|
1058
1073
|
"buttonFontWeight",
|
|
1059
1074
|
"buttonWidth",
|
|
1060
1075
|
"buttonAlign"
|
|
1061
|
-
],
|
|
1076
|
+
], Y = (e) => {
|
|
1062
1077
|
if (!e || typeof e != "object") return "";
|
|
1063
|
-
let t = e.kind || "text", n =
|
|
1064
|
-
fontSize: e.fontSize,
|
|
1065
|
-
borderRadius: e.borderRadius,
|
|
1078
|
+
let t = e.kind || "text", n = K(e.name || e.label || "field"), r = e.required ? " required" : "", i = V({
|
|
1079
|
+
fontSize: e.fontSize || "13px",
|
|
1080
|
+
borderRadius: e.borderRadius || "12px",
|
|
1066
1081
|
borderWidth: e.borderWidth || "1px",
|
|
1067
|
-
borderColor: e.borderColor || "#
|
|
1082
|
+
borderColor: e.borderColor || "#334155",
|
|
1068
1083
|
borderStyle: "solid",
|
|
1069
1084
|
color: e.inputTextColor
|
|
1070
1085
|
}), 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>`;
|
|
1071
|
-
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${
|
|
1086
|
+
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${K(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="${K(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 : [{
|
|
1072
1087
|
label: e.label || "Option",
|
|
1073
1088
|
value: e.name || "option"
|
|
1074
|
-
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1089
|
+
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${K(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${K(t)}" name="${n}" placeholder="${K(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
|
|
1090
|
+
};
|
|
1091
|
+
function X(e) {
|
|
1092
|
+
return `<!-- Unsupported block ${String(e)} -->`;
|
|
1093
|
+
}
|
|
1094
|
+
var Z = (h) => {
|
|
1095
|
+
if (!h || typeof h != "object") return "";
|
|
1096
|
+
let g = h.style || {}, _ = V(h.type === "form_container" ? {
|
|
1097
|
+
...G(),
|
|
1098
|
+
...g
|
|
1099
|
+
} : g), v = h.attributes || {}, y = ` data-plexo-id="${K(h.id)}"`;
|
|
1100
|
+
switch (h.type) {
|
|
1101
|
+
case "heading": return `<h2${y} style="margin-top: 0; margin-bottom: 8px; ${_}">${v.text || "Heading"}</h2>`;
|
|
1102
|
+
case "paragraph": return `<p${y} style="margin-top: 0; margin-bottom: 12px; ${_}">${v.text || "Paragraph text content."}</p>`;
|
|
1103
|
+
case "text": return `<div${y} style="${_}">${v.text || ""}</div>`;
|
|
1085
1104
|
case "button": {
|
|
1086
|
-
let e =
|
|
1087
|
-
...
|
|
1088
|
-
width: e
|
|
1105
|
+
let e = d(h), t = V({
|
|
1106
|
+
...g,
|
|
1107
|
+
width: e.width,
|
|
1108
|
+
height: e.height
|
|
1089
1109
|
});
|
|
1090
|
-
return `<div style="text-align: ${
|
|
1110
|
+
return `<div style="text-align: ${g.textAlign || "center"};"><a${y} href="${v.href || "#"}" target="${v.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${v.text || "Button"}</a></div>`;
|
|
1091
1111
|
}
|
|
1092
1112
|
case "image": {
|
|
1093
|
-
let e =
|
|
1094
|
-
|
|
1113
|
+
let t = e(h), n = g.textAlign === "center" ? "margin: 0 auto; display: block;" : g.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", r = V({
|
|
1114
|
+
...g,
|
|
1115
|
+
width: t.width,
|
|
1116
|
+
height: t.height
|
|
1117
|
+
});
|
|
1118
|
+
return `<img${y} src="${v.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${v.alt || ""}" style="${r} ${n}" />`;
|
|
1095
1119
|
}
|
|
1096
|
-
case "divider": return `<hr${
|
|
1097
|
-
case "spacer": return `<div${
|
|
1098
|
-
case "card": return `<div${
|
|
1099
|
-
<h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${
|
|
1100
|
-
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${
|
|
1120
|
+
case "divider": return `<hr${y} style="border: 0; border-top: ${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#334155"}; ${_}" />`;
|
|
1121
|
+
case "spacer": return `<div${y} style="height: ${g.height || "24px"};"></div>`;
|
|
1122
|
+
case "card": return `<div${y} style="${_}">
|
|
1123
|
+
<h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${v.title || "Card Title"}</h3>
|
|
1124
|
+
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${v.description || "Card description."}</p>
|
|
1101
1125
|
</div>`;
|
|
1102
1126
|
case "form_container": {
|
|
1103
1127
|
let e = {
|
|
1104
|
-
...
|
|
1105
|
-
...
|
|
1106
|
-
},
|
|
1107
|
-
for (let
|
|
1108
|
-
|
|
1128
|
+
...G(),
|
|
1129
|
+
...g
|
|
1130
|
+
}, t = {};
|
|
1131
|
+
for (let n of Object.keys(e)) J.includes(n) || (t[n] = e[n]);
|
|
1132
|
+
t.height = o(h);
|
|
1133
|
+
let n = V(t), r = l(Array.isArray(v.fields) ? v.fields : []), i = e.fieldSpacing || "12px", a = r.map((e) => `<div style="margin-bottom: ${i};">${Y(e)}</div>`).join(""), s = v.buttonAutoWidth === !1 ? e.buttonWidth || "100%" : "auto", c = e.buttonAlign === "left" ? "flex-start" : e.buttonAlign === "right" ? "flex-end" : "center", u = V({
|
|
1109
1134
|
backgroundColor: e.buttonBackgroundColor,
|
|
1110
1135
|
color: e.buttonTextColor,
|
|
1111
1136
|
borderRadius: e.buttonBorderRadius,
|
|
@@ -1115,44 +1140,160 @@ var k = () => ({
|
|
|
1115
1140
|
paddingRight: e.buttonPaddingRight,
|
|
1116
1141
|
fontSize: e.buttonFontSize,
|
|
1117
1142
|
fontWeight: e.buttonFontWeight,
|
|
1118
|
-
width:
|
|
1143
|
+
width: s
|
|
1119
1144
|
});
|
|
1120
|
-
return `<form${
|
|
1145
|
+
return `<form${y} action="${K(v.actionUrl || v.action || "#")}" method="${K(v.method || "POST")}" style="${n}">${a}<div style="display: flex; width: 100%; justify-content: ${c};"><button type="submit" style="border: 0; cursor: pointer; ${u}">${v.submitLabel || "Submit"}</button></div></form>`;
|
|
1121
1146
|
}
|
|
1122
1147
|
case "input": {
|
|
1123
|
-
let e =
|
|
1124
|
-
return `<input${
|
|
1148
|
+
let e = v.inputType || v.type || "text", t = K(v.name || v.fieldName || "field"), n = K(v.placeholder || ""), r = v.required ? " required" : "";
|
|
1149
|
+
return `<input${y} type="${K(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${r} />`;
|
|
1150
|
+
}
|
|
1151
|
+
case "textarea": return `<textarea${y} name="${K(v.name || v.fieldName || "field")}" placeholder="${K(v.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${v.required ? " required" : ""}></textarea>`;
|
|
1152
|
+
case "select": return `<select${y} name="${K(v.name || v.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${v.required ? " required" : ""}>${(Array.isArray(v.options) ? v.options : []).map((e) => `<option value="${K(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
1153
|
+
case "html": return `<div${y} style="${V({
|
|
1154
|
+
...g,
|
|
1155
|
+
height: i(h, "auto")
|
|
1156
|
+
})}">${v.htmlContent || v.text || ""}</div>`;
|
|
1157
|
+
case "social": {
|
|
1158
|
+
let e = t(h), n = g.textAlign === "center" ? "center" : g.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1159
|
+
return `<div${y} style="${V({
|
|
1160
|
+
padding: g.padding,
|
|
1161
|
+
margin: g.margin,
|
|
1162
|
+
display: "flex",
|
|
1163
|
+
flexWrap: "wrap",
|
|
1164
|
+
gap: g.iconSpacing || "8px",
|
|
1165
|
+
justifyContent: n
|
|
1166
|
+
})}">${e.map((e) => {
|
|
1167
|
+
let t = V({
|
|
1168
|
+
width: e.size,
|
|
1169
|
+
height: e.size,
|
|
1170
|
+
padding: "8px",
|
|
1171
|
+
borderRadius: e.iconType === "square" ? "14px" : "9999px",
|
|
1172
|
+
backgroundColor: e.backgroundColor,
|
|
1173
|
+
color: e.color,
|
|
1174
|
+
display: "inline-flex",
|
|
1175
|
+
alignItems: "center",
|
|
1176
|
+
justifyContent: "center",
|
|
1177
|
+
overflow: "hidden"
|
|
1178
|
+
});
|
|
1179
|
+
return `<a href="${K(e.url)}" style="${t} text-decoration: none;">${z(e.provider, e.color)}</a>`;
|
|
1180
|
+
}).join("")}</div>`;
|
|
1181
|
+
}
|
|
1182
|
+
case "menu": {
|
|
1183
|
+
let e = u(h), t = g.textAlign === "center" ? "center" : g.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1184
|
+
return `<div${y} style="${V({
|
|
1185
|
+
...g,
|
|
1186
|
+
display: "flex",
|
|
1187
|
+
flexWrap: "wrap",
|
|
1188
|
+
gap: "16px",
|
|
1189
|
+
justifyContent: t
|
|
1190
|
+
})}">${e.map((e) => `<a href="${K(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${g.fontWeight || 600};">${K(e.label)}</a>`).join("")}</div>`;
|
|
1191
|
+
}
|
|
1192
|
+
case "icon": {
|
|
1193
|
+
let e = g.fontSize || `${v.iconSize || 48}px`, t = g.color || "#1e293b", n = parseInt(String(e), 10) || 48, i = r[s(v.iconName, Object.keys(r))] || c, a = m(p.createElement(i, {
|
|
1194
|
+
size: n,
|
|
1195
|
+
color: t
|
|
1196
|
+
})), o = g.textAlign === "right" ? "flex-end" : g.textAlign === "left" ? "flex-start" : "center", l = V({
|
|
1197
|
+
padding: g.padding,
|
|
1198
|
+
margin: g.margin,
|
|
1199
|
+
display: "flex",
|
|
1200
|
+
justifyContent: o
|
|
1201
|
+
}), u = typeof v.href == "string" ? v.href.trim() : "", d = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${a}</span>`;
|
|
1202
|
+
return `<div style="${l}">${u ? `<a${y} href="${K(u)}" target="${v.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${d}</a>` : `<span${y}>${d}</span>`}</div>`;
|
|
1203
|
+
}
|
|
1204
|
+
case "table": {
|
|
1205
|
+
let e = a(h), t = `${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#cbd5e1"}`, n = (n, r, i) => {
|
|
1206
|
+
let a = i ? "th" : "td", o = i ? g.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : g.contentBgColor || "#ffffff", s = i ? g.headerTextColor || "#1e293b" : g.contentTextColor || "#475569", c = i ? g.headerTextAlign || "left" : g.contentTextAlign || "left";
|
|
1207
|
+
return `<tr>${n.map((e) => {
|
|
1208
|
+
let n = V({
|
|
1209
|
+
padding: g.cellPadding || "8px",
|
|
1210
|
+
border: t,
|
|
1211
|
+
backgroundColor: o,
|
|
1212
|
+
color: s,
|
|
1213
|
+
textAlign: c,
|
|
1214
|
+
lineHeight: g.contentLineHeight,
|
|
1215
|
+
letterSpacing: g.contentLetterSpacing,
|
|
1216
|
+
fontWeight: i ? "700" : void 0
|
|
1217
|
+
});
|
|
1218
|
+
return `<${a} style="${n}">${e || " "}</${a}>`;
|
|
1219
|
+
}).join("")}</tr>`;
|
|
1220
|
+
}, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 0, !0)}</thead>` : "", i = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length, s = e.cells.slice(i, Math.max(i, o)).map((e, t) => n(e, t, !1)).join(""), c = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l = V({
|
|
1221
|
+
borderCollapse: "collapse",
|
|
1222
|
+
width: "100%"
|
|
1223
|
+
});
|
|
1224
|
+
return `<div${y} style="${V({
|
|
1225
|
+
padding: g.padding,
|
|
1226
|
+
margin: g.margin,
|
|
1227
|
+
overflowX: "auto"
|
|
1228
|
+
})}"><table style="${l}">${r}<tbody>${s}</tbody>${c}</table></div>`;
|
|
1229
|
+
}
|
|
1230
|
+
case "video": {
|
|
1231
|
+
let e = n(v.videoUrl), t = v.linkType === "email" ? `mailto:${v.href || ""}` : v.href || v.videoUrl || "#", r = v.target || "_blank";
|
|
1232
|
+
return `<div${y} style="${V({
|
|
1233
|
+
padding: g.padding,
|
|
1234
|
+
margin: g.margin,
|
|
1235
|
+
borderRadius: g.borderRadius,
|
|
1236
|
+
overflow: "hidden"
|
|
1237
|
+
})}"><a href="${K(t)}" target="${K(r)}" style="position: relative; display: block; text-decoration: none;"><img src="${K(e.thumbnailUrl)}" alt="${K(v.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
|
+
}
|
|
1239
|
+
case "timer": {
|
|
1240
|
+
let e = v.showLabels !== !1, t = V({
|
|
1241
|
+
fontFamily: g.digitsFontFamily,
|
|
1242
|
+
fontSize: g.digitsFontSize || "40px",
|
|
1243
|
+
color: g.digitsColor || "#1e293b",
|
|
1244
|
+
fontWeight: "800"
|
|
1245
|
+
}), n = V({
|
|
1246
|
+
fontFamily: g.labelsFontFamily,
|
|
1247
|
+
fontSize: g.labelsFontSize || "16px",
|
|
1248
|
+
color: g.labelsColor || "#64748b"
|
|
1249
|
+
}), r = V({
|
|
1250
|
+
backgroundColor: g.backgroundColor || "#f8fafc",
|
|
1251
|
+
borderRadius: g.borderRadius || "8px",
|
|
1252
|
+
padding: g.padding || "16px",
|
|
1253
|
+
textAlign: "center"
|
|
1254
|
+
}), 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>`, a = f(v.targetDate), o = K(v.targetDate || "2026-12-31T23:59:59"), s = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${h.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>`;
|
|
1255
|
+
return `<div${y} data-plexo-target="${o}" style="${r}"><div>${i("days", "Days", a.days)}${i("hours", "Hours", a.hours)}${i("minutes", "Mins", a.minutes)}${i("seconds", "Secs", a.seconds)}</div>${s}</div>`;
|
|
1256
|
+
}
|
|
1257
|
+
case "carousel": {
|
|
1258
|
+
let e = Array.isArray(v.images) ? v.images : [], t = V({
|
|
1259
|
+
padding: g.padding || "10px",
|
|
1260
|
+
margin: g.margin,
|
|
1261
|
+
backgroundColor: g.backgroundColor,
|
|
1262
|
+
position: "relative",
|
|
1263
|
+
overflow: "hidden",
|
|
1264
|
+
borderRadius: "12px"
|
|
1265
|
+
});
|
|
1266
|
+
if (e.length === 0) return `<div${y} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
|
|
1267
|
+
let n = Math.min(e.length - 1, Math.max(0, parseInt(String(v.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${K(e.src)}" alt="${K(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;">${K(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>` : "";
|
|
1268
|
+
return `<div${y} 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="${h.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>`;
|
|
1125
1269
|
}
|
|
1126
|
-
|
|
1127
|
-
case "select": return `<select${i} name="${A(r.name || r.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #d1d5db; ${n}"${r.required ? " required" : ""}>${(Array.isArray(r.options) ? r.options : []).map((e) => `<option value="${A(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
1128
|
-
case "html": return `<div${i} style="${n}">${r.htmlContent || r.text || ""}</div>`;
|
|
1129
|
-
default: return `<!-- Unsupported block ${e.type} -->`;
|
|
1270
|
+
default: return X(h.type);
|
|
1130
1271
|
}
|
|
1131
|
-
},
|
|
1272
|
+
}, Q = (e, t) => {
|
|
1132
1273
|
if (!e || typeof e != "object") return "";
|
|
1133
|
-
let n =
|
|
1274
|
+
let n = B(e);
|
|
1134
1275
|
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. -->`;
|
|
1135
|
-
let r =
|
|
1136
|
-
|
|
1276
|
+
let r = V(n.style || {}), i = q("id", n.htmlId), a = q("class", n.htmlClass), o = n.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
1277
|
+
W(t, o, n.style, "tablet", n.styleTablet), W(t, o, n.style, "mobile", n.styleMobile);
|
|
1137
1278
|
let s = `\n <!-- ROW START: ${n.id || "row"} -->`;
|
|
1138
1279
|
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}">`;
|
|
1139
1280
|
let c = Array.isArray(n.columns) ? n.columns : [];
|
|
1140
1281
|
for (let e of c) {
|
|
1141
1282
|
if (!e) continue;
|
|
1142
|
-
let n = e.styles || e.style || {}, r =
|
|
1143
|
-
|
|
1283
|
+
let n = e.styles || e.style || {}, r = V(n), i = q("id", e.attrs?.htmlId), a = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", o = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
|
|
1284
|
+
W(t, o, n, "tablet", e.stylesTablet), W(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}">`;
|
|
1144
1285
|
let c = Array.isArray(e.elements) ? e.elements : [];
|
|
1145
1286
|
for (let e of c) {
|
|
1146
1287
|
if (!e) continue;
|
|
1147
|
-
let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", i =
|
|
1148
|
-
|
|
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 = q("id", n.htmlId), a = q("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;";
|
|
1289
|
+
W(t, e.id, e.style, "tablet", e.styleTablet), W(t, e.id, e.style, "mobile", e.styleMobile), s += `\n <div${i}${a} style="${c}">`, s += `\n ${Z(e)}`, s += "\n </div>";
|
|
1149
1290
|
}
|
|
1150
1291
|
let l = Array.isArray(e.nestedRows) ? e.nestedRows : [];
|
|
1151
|
-
for (let e of l) s +=
|
|
1292
|
+
for (let e of l) s += Q(e, t);
|
|
1152
1293
|
s += "\n </div>";
|
|
1153
1294
|
}
|
|
1154
1295
|
return s += "\n </div>", s;
|
|
1155
|
-
},
|
|
1296
|
+
}, $ = (e) => {
|
|
1156
1297
|
if (!e || typeof e != "object") return "<!-- Empty template -->";
|
|
1157
1298
|
let t = e.designJson || e.template || e, n = t.body || (Array.isArray(t.rows) ? {
|
|
1158
1299
|
style: t.style || {},
|
|
@@ -1179,20 +1320,20 @@ var k = () => ({
|
|
|
1179
1320
|
"textColor"
|
|
1180
1321
|
], a = {};
|
|
1181
1322
|
for (let e of Object.keys(r)) i.includes(e) || (a[e] = r[e]);
|
|
1182
|
-
let o =
|
|
1323
|
+
let o = V(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 = q("id", r.htmlId), l = q("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 = T(w(f, [r.fontFamily])), m = {
|
|
1183
1324
|
tablet: [],
|
|
1184
1325
|
mobile: []
|
|
1185
|
-
},
|
|
1186
|
-
for (let e of
|
|
1187
|
-
let
|
|
1326
|
+
}, h = "";
|
|
1327
|
+
for (let e of f) h += Q(e, m);
|
|
1328
|
+
let g = m.tablet.length ? `\n ${m.tablet.join("\n ")}` : "", _ = m.mobile.length ? `\n ${m.mobile.join("\n ")}` : "", v = `<!DOCTYPE html>
|
|
1188
1329
|
<html>
|
|
1189
1330
|
<head>
|
|
1190
1331
|
<meta charset="utf-8">
|
|
1191
|
-
<title>${
|
|
1332
|
+
<title>${K(s)}</title>
|
|
1192
1333
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1193
|
-
${
|
|
1334
|
+
${p ? `<link rel="stylesheet" href="${p}">` : ""}
|
|
1194
1335
|
<style>
|
|
1195
|
-
body { margin: 0; font-family: ${
|
|
1336
|
+
body { margin: 0; font-family: ${L}; }
|
|
1196
1337
|
.plexo-row {
|
|
1197
1338
|
display: flex;
|
|
1198
1339
|
flex-wrap: wrap;
|
|
@@ -1200,7 +1341,7 @@ var k = () => ({
|
|
|
1200
1341
|
/* Tablet: auto-scaled fonts/heights/spacing (see utilities/responsiveDefaults.ts) and
|
|
1201
1342
|
any explicit per-element styleTablet/stylesTablet override — columns stay side by
|
|
1202
1343
|
side at this width. */
|
|
1203
|
-
@media (min-width: 769px) and (max-width: 1024px) {${
|
|
1344
|
+
@media (min-width: 769px) and (max-width: 1024px) {${g}
|
|
1204
1345
|
}
|
|
1205
1346
|
@media (max-width: 768px) {
|
|
1206
1347
|
.plexo-row {
|
|
@@ -1210,26 +1351,26 @@ var k = () => ({
|
|
|
1210
1351
|
width: 100% !important;
|
|
1211
1352
|
max-width: 100% !important;
|
|
1212
1353
|
margin-bottom: 16px;
|
|
1213
|
-
}${
|
|
1354
|
+
}${_}
|
|
1214
1355
|
}
|
|
1215
1356
|
</style>
|
|
1216
|
-
${
|
|
1357
|
+
${u ? `<style>\n${u}\n </style>` : ""}
|
|
1217
1358
|
</head>
|
|
1218
|
-
<body${c}${
|
|
1359
|
+
<body${c}${l} style="${o}">
|
|
1219
1360
|
<div style="max-width: 1200px; margin: 0 auto; width: 100%;">`;
|
|
1220
|
-
return
|
|
1221
|
-
${
|
|
1361
|
+
return v += h, v += `\n </div>
|
|
1362
|
+
${d ? ` <script>\n${d}\n <\/script>` : ""}
|
|
1222
1363
|
</body>
|
|
1223
|
-
</html>`,
|
|
1364
|
+
</html>`, v = v.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), v;
|
|
1224
1365
|
};
|
|
1225
|
-
function
|
|
1226
|
-
return
|
|
1366
|
+
function te(e) {
|
|
1367
|
+
return $(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
1227
1368
|
}
|
|
1228
|
-
function
|
|
1229
|
-
return
|
|
1369
|
+
function ne(e) {
|
|
1370
|
+
return $(e);
|
|
1230
1371
|
}
|
|
1231
|
-
function
|
|
1372
|
+
function re(e) {
|
|
1232
1373
|
return e;
|
|
1233
1374
|
}
|
|
1234
1375
|
//#endregion
|
|
1235
|
-
export {
|
|
1376
|
+
export { S as _, ne as a, g as b, G as c, I as d, T as f, b as g, _ as h, $ as i, H as l, x as m, J as n, te as o, w as p, W as r, B as s, L as t, re as u, v, h as x, y };
|