@charisol/plexo-sdk 1.4.33 → 1.4.34
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-DFzrMJge.js → compiler-BOsCUhY-.js} +127 -118
- package/dist/compiler.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -97,7 +97,7 @@ function O(e, t) {
|
|
|
97
97
|
}
|
|
98
98
|
return n;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function k(e, t, n) {
|
|
101
101
|
let r = e || {};
|
|
102
102
|
return n ? {
|
|
103
103
|
...r,
|
|
@@ -107,8 +107,8 @@ function ee(e, t, n) {
|
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/utilities/compiler.ts
|
|
110
|
-
var
|
|
111
|
-
function
|
|
110
|
+
var A = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
111
|
+
function j(e) {
|
|
112
112
|
if (!e || typeof e != "object") return null;
|
|
113
113
|
if (Array.isArray(e.columns) && e.columns.length > 0) return e;
|
|
114
114
|
let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
|
|
@@ -362,7 +362,7 @@ function A(e) {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
var
|
|
365
|
+
var ee = /* @__PURE__ */ new Map([
|
|
366
366
|
["'Roboto', sans-serif", "Roboto"],
|
|
367
367
|
["'Open Sans', sans-serif", "Open Sans"],
|
|
368
368
|
["'Lato', sans-serif", "Lato"],
|
|
@@ -446,7 +446,7 @@ var te = /* @__PURE__ */ new Map([
|
|
|
446
446
|
["'Cookie', cursive", "Cookie"],
|
|
447
447
|
["'Great Vibes', cursive", "Great Vibes"]
|
|
448
448
|
]);
|
|
449
|
-
function
|
|
449
|
+
function M(e, t = []) {
|
|
450
450
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
451
451
|
if (!e) return;
|
|
452
452
|
let t = Array.isArray(e.columns) ? e.columns : [];
|
|
@@ -464,15 +464,15 @@ function ne(e, t = []) {
|
|
|
464
464
|
for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
|
|
465
465
|
return n;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function N(e) {
|
|
468
468
|
let t = /* @__PURE__ */ new Set();
|
|
469
469
|
for (let n of e) {
|
|
470
|
-
let e =
|
|
470
|
+
let e = ee.get(n);
|
|
471
471
|
e && t.add(e);
|
|
472
472
|
}
|
|
473
473
|
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`;
|
|
474
474
|
}
|
|
475
|
-
var
|
|
475
|
+
var P = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
|
|
476
476
|
let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
|
|
477
477
|
return typeof t == "number" && [
|
|
478
478
|
"padding",
|
|
@@ -483,25 +483,25 @@ var M = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
483
483
|
"width",
|
|
484
484
|
"height"
|
|
485
485
|
].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
|
|
486
|
-
}).join(" "),
|
|
487
|
-
function
|
|
486
|
+
}).join(" "), F = (e = {}) => P(e).replace(/;(\s|$)/g, " !important;$1");
|
|
487
|
+
function I(e) {
|
|
488
488
|
if (typeof e != "string") return !1;
|
|
489
489
|
let t = e.toLowerCase();
|
|
490
490
|
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);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function L(e, t, n, r, i) {
|
|
493
493
|
let a = {
|
|
494
494
|
...O(n, r),
|
|
495
495
|
...i || {}
|
|
496
496
|
};
|
|
497
|
-
for (let e of Object.keys(a))
|
|
497
|
+
for (let e of Object.keys(a)) I(a[e]) && delete a[e];
|
|
498
498
|
if (Object.keys(a).length === 0) return;
|
|
499
|
-
let o =
|
|
499
|
+
let o = F(a);
|
|
500
500
|
if (!o) return;
|
|
501
501
|
let s = String(t).replace(/["\\]/g, "");
|
|
502
502
|
e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function R(e, t) {
|
|
505
505
|
if (e.type !== "menu" || !t || t.textAlign === void 0) return t;
|
|
506
506
|
let n = t.textAlign === "center" ? "center" : t.textAlign === "right" ? "flex-end" : "flex-start";
|
|
507
507
|
return {
|
|
@@ -509,7 +509,16 @@ function F(e, t) {
|
|
|
509
509
|
justifyContent: n
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
|
-
|
|
512
|
+
function z(e, t, n, r) {
|
|
513
|
+
if (!r || r.textAlign === void 0 || t.type !== "button" && t.type !== "icon") return;
|
|
514
|
+
let i = `${t.id}-align`;
|
|
515
|
+
if (t.type === "button") {
|
|
516
|
+
L(e, i, void 0, n, { textAlign: r.textAlign });
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
L(e, i, void 0, n, { justifyContent: r.textAlign === "right" ? "flex-end" : r.textAlign === "left" ? "flex-start" : "center" });
|
|
520
|
+
}
|
|
521
|
+
var B = () => ({
|
|
513
522
|
backgroundColor: "#ffffff",
|
|
514
523
|
borderRadius: "20px",
|
|
515
524
|
width: "100%",
|
|
@@ -532,11 +541,11 @@ var I = () => ({
|
|
|
532
541
|
buttonPaddingRight: "14px",
|
|
533
542
|
buttonFontSize: "13px",
|
|
534
543
|
buttonFontWeight: "700"
|
|
535
|
-
}),
|
|
544
|
+
}), V = (e) => (e || "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), H = (e, t) => {
|
|
536
545
|
if (typeof t != "string") return "";
|
|
537
546
|
let n = t.trim();
|
|
538
|
-
return n ? ` ${e}="${
|
|
539
|
-
},
|
|
547
|
+
return n ? ` ${e}="${V(n)}"` : "";
|
|
548
|
+
}, U = [
|
|
540
549
|
"fieldSpacing",
|
|
541
550
|
"buttonBackgroundColor",
|
|
542
551
|
"buttonTextColor",
|
|
@@ -556,36 +565,36 @@ var I = () => ({
|
|
|
556
565
|
"buttonWidth",
|
|
557
566
|
"buttonHeight",
|
|
558
567
|
"buttonAlign"
|
|
559
|
-
],
|
|
560
|
-
function
|
|
561
|
-
let t = (e = "90px") => `<div style="width:100%;height:${e};background:linear-gradient(135deg,${
|
|
568
|
+
], W = "#cbd5e1", G = "#e2e8f0", K = "#1e293b", q = "#64748b", J = (e) => `<span style="display:block;font-family:monospace;font-size:10px;letter-spacing:0.06em;text-transform:uppercase;color:#94a3b8;margin-bottom:8px;">${e} (live once published)</span>`, Y = (e, t = G, n = "8px") => `<div style="width:${e};height:${n};background:${t};border-radius:3px;"></div>`;
|
|
569
|
+
function te(e) {
|
|
570
|
+
let t = (e = "90px") => `<div style="width:100%;height:${e};background:linear-gradient(135deg,${G},${W});border-radius:6px;"></div>`, n = () => `<div style="flex:1;display:flex;flex-direction:column;gap:6px;">${t("64px")}${Y("75%")}${Y("40%", W)}</div>`;
|
|
562
571
|
switch (e) {
|
|
563
|
-
case "product": return `${
|
|
564
|
-
case "booking": return `${
|
|
572
|
+
case "product": return `${J("Product")}<div style="display:flex;flex-direction:column;gap:8px;">${t()}<div style="font-weight:600;font-size:14px;color:${K};">Sample Product Name</div><div style="font-size:13px;color:${q};">$29.99</div><div style="background:${K};color:#fff;text-align:center;padding:8px;border-radius:6px;font-size:13px;font-weight:600;">Add to Cart</div></div>`;
|
|
573
|
+
case "booking": return `${J("Booking")}<div style="font-weight:600;font-size:14px;color:${K};margin-bottom:8px;">Select a time</div><div style="display:flex;gap:6px;flex-wrap:wrap;">${[
|
|
565
574
|
"9:00 AM",
|
|
566
575
|
"10:00 AM",
|
|
567
576
|
"11:30 AM",
|
|
568
577
|
"2:00 PM"
|
|
569
|
-
].map((e) => `<span style="border:1px solid ${
|
|
570
|
-
case "shop_grid": return `${
|
|
578
|
+
].map((e) => `<span style="border:1px solid ${W};border-radius:6px;padding:6px 10px;font-size:12px;color:${K};">${e}</span>`).join("")}</div>`;
|
|
579
|
+
case "shop_grid": return `${J("Shop Grid")}<div style="display:flex;gap:10px;">${n()}${n()}${n()}</div>`;
|
|
571
580
|
case "cart_summary": {
|
|
572
|
-
let e = `<div style="width:36px;height:36px;flex-shrink:0;background:linear-gradient(135deg,${
|
|
573
|
-
return `${
|
|
581
|
+
let e = `<div style="width:36px;height:36px;flex-shrink:0;background:linear-gradient(135deg,${G},${W});border-radius:4px;"></div>`, t = () => `<div style="display:flex;gap:8px;align-items:center;">${e}<div style="flex:1;">${Y("80%")}</div>${Y("30px")}</div>`;
|
|
582
|
+
return `${J("Cart Summary")}<div style="display:flex;flex-direction:column;gap:10px;">${t()}${t()}<div style="border-top:1px solid ${G};padding-top:8px;display:flex;justify-content:space-between;font-size:13px;font-weight:600;color:${K};"><span>Subtotal</span><span>$59.98</span></div></div>`;
|
|
574
583
|
}
|
|
575
|
-
case "checkout_flow": return `${
|
|
576
|
-
case "order_confirmation": return `${
|
|
577
|
-
case "order_tracking": return `${
|
|
584
|
+
case "checkout_flow": return `${J("Checkout")}<div style="display:flex;gap:12px;"><div style="flex:1;display:flex;flex-direction:column;gap:8px;">${Y("50%", W, "10px")}<div style="height:32px;background:#fff;border:1px solid ${G};border-radius:6px;"></div><div style="height:32px;background:#fff;border:1px solid ${G};border-radius:6px;"></div></div><div style="width:120px;flex-shrink:0;border:1px solid ${G};border-radius:6px;padding:10px;background:#fff;display:flex;flex-direction:column;gap:8px;">${Y("70%", W)}${Y("50%")}<div style="height:26px;background:${K};border-radius:4px;margin-top:4px;"></div></div></div>`;
|
|
585
|
+
case "order_confirmation": return `${J("Order Confirmation")}<div style="text-align:center;padding:12px 0;"><div style="width:40px;height:40px;border-radius:100px;background:#dcfce7;color:#16a34a;display:flex;align-items:center;justify-content:center;margin:0 auto 10px;font-size:20px;line-height:1;">✓</div><div style="font-weight:600;font-size:15px;color:${K};">Thank you for your order</div><div style="font-size:12px;color:${q};margin-top:4px;">Order #10482</div></div>`;
|
|
586
|
+
case "order_tracking": return `${J("Order Tracking")}<div style="display:flex;gap:8px;margin-bottom:16px;"><div style="flex:1;height:32px;background:#fff;border:1px solid ${G};border-radius:6px;"></div><div style="width:76px;height:32px;background:${K};border-radius:6px;flex-shrink:0;"></div></div><div style="display:flex;justify-content:space-between;">${[
|
|
578
587
|
["Placed", !0],
|
|
579
588
|
["Processing", !1],
|
|
580
589
|
["Shipped", !1],
|
|
581
590
|
["Delivered", !1]
|
|
582
|
-
].map(([e, t]) => `<div style="display:flex;flex-direction:column;align-items:center;gap:4px;"><div style="width:10px;height:10px;border-radius:100px;background:${t ? "#16a34a" :
|
|
591
|
+
].map(([e, t]) => `<div style="display:flex;flex-direction:column;align-items:center;gap:4px;"><div style="width:10px;height:10px;border-radius:100px;background:${t ? "#16a34a" : W};"></div><span style="font-size:9px;color:${q};">${e}</span></div>`).join("")}</div>`;
|
|
583
592
|
default: return "";
|
|
584
593
|
}
|
|
585
594
|
}
|
|
586
|
-
var
|
|
595
|
+
var ne = (e) => {
|
|
587
596
|
if (!e || typeof e != "object") return "";
|
|
588
|
-
let t = e.kind || "text", n =
|
|
597
|
+
let t = e.kind || "text", n = V(e.name || e.id || "field"), r = e.required ? " required" : "", i = P({
|
|
589
598
|
fontSize: e.fontSize || "13px",
|
|
590
599
|
borderRadius: e.borderRadius || "12px",
|
|
591
600
|
borderWidth: e.borderWidth || "1px",
|
|
@@ -593,19 +602,19 @@ var q = (e) => {
|
|
|
593
602
|
borderStyle: "solid",
|
|
594
603
|
color: e.inputTextColor
|
|
595
604
|
}), 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>`;
|
|
596
|
-
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${
|
|
605
|
+
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${V(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="${V(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 : [{
|
|
597
606
|
label: e.label || "Option",
|
|
598
607
|
value: e.name || "option"
|
|
599
|
-
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${
|
|
608
|
+
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${V(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${V(t)}" name="${n}" placeholder="${V(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
|
|
600
609
|
};
|
|
601
|
-
function
|
|
610
|
+
function re(e, t, n) {
|
|
602
611
|
if (e === "none") return "";
|
|
603
|
-
let r =
|
|
612
|
+
let r = V(t);
|
|
604
613
|
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>`;
|
|
605
614
|
}
|
|
606
|
-
function
|
|
615
|
+
function X(e, t, n, r, i = []) {
|
|
607
616
|
return e.map((a, o) => {
|
|
608
|
-
let s = [...i, o], c = o === e.length - 1, l =
|
|
617
|
+
let s = [...i, o], c = o === e.length - 1, l = P({ borderBottom: n.showDividers && !c ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), u = P({
|
|
609
618
|
display: "flex",
|
|
610
619
|
alignItems: "center",
|
|
611
620
|
gap: "8px",
|
|
@@ -622,18 +631,18 @@ function Y(e, t, n, r, i = []) {
|
|
|
622
631
|
border: "none",
|
|
623
632
|
font: "inherit",
|
|
624
633
|
background: void 0
|
|
625
|
-
}), d =
|
|
634
|
+
}), d = P({
|
|
626
635
|
display: "grid",
|
|
627
636
|
gridTemplateRows: a.defaultOpen ? "1fr" : "0fr",
|
|
628
637
|
transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
|
|
629
638
|
backgroundColor: t.contentBackgroundColor || "#ffffff"
|
|
630
|
-
}), f =
|
|
639
|
+
}), f = P({
|
|
631
640
|
padding: t.contentPadding || "14px",
|
|
632
641
|
color: t.contentTextColor || "#475569",
|
|
633
642
|
fontSize: t.contentFontSize || "13px",
|
|
634
643
|
whiteSpace: "pre-wrap"
|
|
635
|
-
}), p =
|
|
636
|
-
return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${
|
|
644
|
+
}), p = re(n.iconStyle, t.iconColor || "#64748b", !!a.defaultOpen), m = V(a.title), h = V(a.content), g = a.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${X(a.children, t, n, r, s)}</div>` : "";
|
|
645
|
+
return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${V(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>`;
|
|
637
646
|
}).join("");
|
|
638
647
|
}
|
|
639
648
|
function ie(e) {
|
|
@@ -641,24 +650,24 @@ function ie(e) {
|
|
|
641
650
|
}
|
|
642
651
|
var ae = (g, _ = !1) => {
|
|
643
652
|
if (!g || typeof g != "object") return "";
|
|
644
|
-
let v = g.style || {}, y = g.type === "heading" || g.type === "paragraph" || g.type === "text", b = y ? c(g).autoWidth : !1, x = b ? Object.fromEntries(Object.entries(v).filter(([e]) => e !== "width")) : v, S =
|
|
645
|
-
...
|
|
653
|
+
let v = g.style || {}, y = g.type === "heading" || g.type === "paragraph" || g.type === "text", b = y ? c(g).autoWidth : !1, x = b ? Object.fromEntries(Object.entries(v).filter(([e]) => e !== "width")) : v, S = P(g.type === "form_container" ? {
|
|
654
|
+
...B(),
|
|
646
655
|
...v
|
|
647
|
-
} : x), C = g.attributes || {}, w = ` data-plexo-id="${
|
|
656
|
+
} : x), C = g.attributes || {}, w = ` data-plexo-id="${V(g.id)}"`, T = String(C.boxAlign || "left"), E = y && (b || !!v.width), D = (e) => E ? `<div style="text-align: ${T};">${e}</div>` : e, O = `${E ? "display: inline-block; " : ""}${y && v.height ? "overflow: hidden; " : ""}`;
|
|
648
657
|
switch (g.type) {
|
|
649
658
|
case "heading": return D(`<h2${w} style="margin-top: 0; margin-bottom: 8px; ${O}${S}">${C.text || "Heading"}</h2>`);
|
|
650
659
|
case "paragraph": return D(`<p${w} style="margin-top: 0; margin-bottom: 12px; ${O}${S}">${C.text || "Paragraph text content."}</p>`);
|
|
651
660
|
case "text": return D(`<div${w} style="${O}${S}">${C.text || ""}</div>`);
|
|
652
661
|
case "button": {
|
|
653
|
-
let e = u(g), t =
|
|
662
|
+
let e = u(g), t = P({
|
|
654
663
|
...v,
|
|
655
664
|
width: e.width,
|
|
656
665
|
height: e.height
|
|
657
666
|
});
|
|
658
|
-
return `<div style="text-align: ${v.textAlign || "center"};"><a${w} href="${C.href || "#"}" target="${C.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; box-sizing: border-box; ${t}">${C.text || "Button"}</a></div>`;
|
|
667
|
+
return `<div data-plexo-id="${V(String(g.id))}-align" style="text-align: ${v.textAlign || "center"};"><a${w} href="${C.href || "#"}" target="${C.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; box-sizing: border-box; ${t}">${C.text || "Button"}</a></div>`;
|
|
659
668
|
}
|
|
660
669
|
case "image": {
|
|
661
|
-
let e = h(g), t = v.textAlign === "center" ? "margin: 0 auto; display: block;" : v.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n =
|
|
670
|
+
let e = h(g), t = v.textAlign === "center" ? "margin: 0 auto; display: block;" : v.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = P({
|
|
662
671
|
...v,
|
|
663
672
|
width: e.width,
|
|
664
673
|
height: e.height
|
|
@@ -673,19 +682,19 @@ var ae = (g, _ = !1) => {
|
|
|
673
682
|
</div>`;
|
|
674
683
|
case "form_container": {
|
|
675
684
|
if (C.provider === "maildrip" && typeof C.maildripPageId == "string" && C.maildripPageId.trim()) {
|
|
676
|
-
let e =
|
|
677
|
-
return `<div${w} style="${
|
|
685
|
+
let e = V(C.maildripPageId.trim());
|
|
686
|
+
return `<div${w} style="${P({
|
|
678
687
|
...v,
|
|
679
688
|
height: p(g)
|
|
680
689
|
})}"><opt-in-embed-form page-id="${e}"></opt-in-embed-form></div>`;
|
|
681
690
|
}
|
|
682
691
|
let n = {
|
|
683
|
-
...
|
|
692
|
+
...B(),
|
|
684
693
|
...v
|
|
685
694
|
}, r = {};
|
|
686
|
-
for (let e of Object.keys(n))
|
|
695
|
+
for (let e of Object.keys(n)) U.includes(e) || (r[e] = n[e]);
|
|
687
696
|
r.height = p(g);
|
|
688
|
-
let i =
|
|
697
|
+
let i = P(r), a = l(t(Array.isArray(C.fields) ? C.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${ne(e)}</div>`).join(""), c = C.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = C.buttonAutoHeight === !1 && n.buttonHeight || "auto", f = P({
|
|
689
698
|
backgroundColor: n.buttonBackgroundColor,
|
|
690
699
|
color: n.buttonTextColor,
|
|
691
700
|
borderRadius: n.buttonBorderRadius,
|
|
@@ -702,15 +711,15 @@ var ae = (g, _ = !1) => {
|
|
|
702
711
|
width: c,
|
|
703
712
|
height: d
|
|
704
713
|
});
|
|
705
|
-
return `<form${w} action="${
|
|
714
|
+
return `<form${w} action="${V(C.actionUrl || C.action || "#")}" method="${V(C.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${C.submitLabel || "Submit"}</button></div></form>`;
|
|
706
715
|
}
|
|
707
716
|
case "input": {
|
|
708
|
-
let e = C.inputType || C.type || "text", t =
|
|
709
|
-
return `<input${w} type="${
|
|
717
|
+
let e = C.inputType || C.type || "text", t = V(C.name || C.fieldName || "field"), n = V(C.placeholder || ""), r = C.required ? " required" : "";
|
|
718
|
+
return `<input${w} type="${V(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${r} />`;
|
|
710
719
|
}
|
|
711
|
-
case "textarea": return `<textarea${w} name="${
|
|
712
|
-
case "select": return `<select${w} name="${
|
|
713
|
-
case "html": return `<div${w} style="${
|
|
720
|
+
case "textarea": return `<textarea${w} name="${V(C.name || C.fieldName || "field")}" placeholder="${V(C.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${C.required ? " required" : ""}></textarea>`;
|
|
721
|
+
case "select": return `<select${w} name="${V(C.name || C.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${C.required ? " required" : ""}>${(Array.isArray(C.options) ? C.options : []).map((e) => `<option value="${V(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
722
|
+
case "html": return `<div${w} style="${P({
|
|
714
723
|
...v,
|
|
715
724
|
height: s(g, "auto")
|
|
716
725
|
})}">${C.htmlContent || C.text || ""}</div>`;
|
|
@@ -722,8 +731,8 @@ var ae = (g, _ = !1) => {
|
|
|
722
731
|
case "blog_categories":
|
|
723
732
|
case "blog_comments":
|
|
724
733
|
case "blog_post_list": {
|
|
725
|
-
let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t =
|
|
726
|
-
return `<div${w} data-plexo-blog-${e}="true"${
|
|
734
|
+
let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(v);
|
|
735
|
+
return `<div${w} data-plexo-blog-${e}="true"${H("data-plexo-blog-prefix", C.prefix)} style="${t}"></div>`;
|
|
727
736
|
}
|
|
728
737
|
case "product":
|
|
729
738
|
case "booking":
|
|
@@ -732,12 +741,12 @@ var ae = (g, _ = !1) => {
|
|
|
732
741
|
case "checkout_flow":
|
|
733
742
|
case "order_confirmation":
|
|
734
743
|
case "order_tracking": {
|
|
735
|
-
let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t =
|
|
736
|
-
return `<div${w} data-plexo-commerce-${e}="true"${
|
|
744
|
+
let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(v);
|
|
745
|
+
return `<div${w} data-plexo-commerce-${e}="true"${H("data-plexo-product-id", C.productId)}${H("data-plexo-service-id", C.serviceId)}${H("data-plexo-commerce-mode", C.mode)}${C.storeMode === !1 ? " data-plexo-commerce-store-mode=\"false\"" : ""}${H("data-plexo-commerce-limit", C.limit)}${H("data-plexo-commerce-category", C.category)}${H("data-plexo-commerce-sort", C.sort)}${H("data-plexo-commerce-items-per-row", C.itemsPerRow)}${H("data-plexo-commerce-items-per-page", C.itemsPerPage)}${C.paginated ? " data-plexo-commerce-paginated=\"true\"" : ""} style="${t}">${_ ? `<div style="padding: 12px; box-sizing: border-box; height: 100%;">${te(g.type)}</div>` : ""}</div>`;
|
|
737
746
|
}
|
|
738
747
|
case "social": {
|
|
739
748
|
let e = r(g), t = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
|
|
740
|
-
return `<div${w} style="${
|
|
749
|
+
return `<div${w} style="${P({
|
|
741
750
|
padding: v.padding,
|
|
742
751
|
margin: v.margin,
|
|
743
752
|
display: "flex",
|
|
@@ -745,7 +754,7 @@ var ae = (g, _ = !1) => {
|
|
|
745
754
|
gap: v.iconSpacing || "8px",
|
|
746
755
|
justifyContent: t
|
|
747
756
|
})}">${e.map((e) => {
|
|
748
|
-
let t =
|
|
757
|
+
let t = P({
|
|
749
758
|
width: e.size,
|
|
750
759
|
height: e.size,
|
|
751
760
|
padding: "8px",
|
|
@@ -757,33 +766,33 @@ var ae = (g, _ = !1) => {
|
|
|
757
766
|
justifyContent: "center",
|
|
758
767
|
overflow: "hidden"
|
|
759
768
|
});
|
|
760
|
-
return `<a href="${
|
|
769
|
+
return `<a href="${V(e.url)}" style="${t} text-decoration: none;">${f(e.provider, e.color)}</a>`;
|
|
761
770
|
}).join("")}</div>`;
|
|
762
771
|
}
|
|
763
772
|
case "menu": {
|
|
764
773
|
let e = n(g), t = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
|
|
765
|
-
return `<div${w} style="${
|
|
774
|
+
return `<div${w} style="${P({
|
|
766
775
|
...v,
|
|
767
776
|
display: "flex",
|
|
768
777
|
flexWrap: "wrap",
|
|
769
778
|
gap: "16px",
|
|
770
779
|
justifyContent: t
|
|
771
|
-
})}">${e.map((e) => `<a href="${
|
|
780
|
+
})}">${e.map((e) => `<a href="${V(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${v.fontWeight || 600};">${V(e.label)}</a>`).join("")}</div>`;
|
|
772
781
|
}
|
|
773
782
|
case "icon": {
|
|
774
|
-
let e = v.fontSize || `${C.iconSize || 48}px`, t = v.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(C.iconName, n, t), i = v.textAlign === "right" ? "flex-end" : v.textAlign === "left" ? "flex-start" : "center", a =
|
|
783
|
+
let e = v.fontSize || `${C.iconSize || 48}px`, t = v.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(C.iconName, n, t), i = v.textAlign === "right" ? "flex-end" : v.textAlign === "left" ? "flex-start" : "center", a = P({
|
|
775
784
|
padding: v.padding,
|
|
776
785
|
margin: v.margin,
|
|
777
786
|
display: "flex",
|
|
778
787
|
justifyContent: i
|
|
779
|
-
}), o = typeof C.href == "string" ? C.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
|
|
780
|
-
return `<div
|
|
788
|
+
}), o = typeof C.href == "string" ? C.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`, c = o ? `<a${w} href="${V(o)}" target="${C.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${w}>${s}</span>`;
|
|
789
|
+
return `<div data-plexo-id="${V(String(g.id))}-align" style="${a}">${c}</div>`;
|
|
781
790
|
}
|
|
782
791
|
case "table": {
|
|
783
792
|
let e = d(g), t = `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
|
|
784
793
|
let o = a ? "th" : "td", s = a ? v.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : v.contentBgColor || "#ffffff", c = a ? v.headerTextColor || "#1e293b" : v.contentTextColor || "#475569", l = a ? v.headerTextAlign || "left" : v.contentTextAlign || "left";
|
|
785
794
|
return `<tr>${n.map((e, n) => {
|
|
786
|
-
let r =
|
|
795
|
+
let r = P({
|
|
787
796
|
padding: v.cellPadding || "8px",
|
|
788
797
|
border: t,
|
|
789
798
|
backgroundColor: s,
|
|
@@ -792,14 +801,14 @@ var ae = (g, _ = !1) => {
|
|
|
792
801
|
lineHeight: v.contentLineHeight,
|
|
793
802
|
letterSpacing: v.contentLetterSpacing,
|
|
794
803
|
fontWeight: a ? "700" : void 0
|
|
795
|
-
}), u = ` data-plexo-cell="${
|
|
804
|
+
}), u = ` data-plexo-cell="${V(g.id)}|${i}-${n}"`;
|
|
796
805
|
return `<${o}${u} style="${r}">${e || " "}</${o}>`;
|
|
797
806
|
}).join("")}</tr>`;
|
|
798
|
-
}, 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 =
|
|
807
|
+
}, 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({
|
|
799
808
|
borderCollapse: "collapse",
|
|
800
809
|
width: "100%"
|
|
801
810
|
});
|
|
802
|
-
return `<div${w} style="${
|
|
811
|
+
return `<div${w} style="${P({
|
|
803
812
|
padding: v.padding,
|
|
804
813
|
margin: v.margin,
|
|
805
814
|
overflowX: "auto"
|
|
@@ -807,33 +816,33 @@ var ae = (g, _ = !1) => {
|
|
|
807
816
|
}
|
|
808
817
|
case "video": {
|
|
809
818
|
let e = i(C.videoUrl), t = C.linkType === "email" ? `mailto:${C.href || ""}` : C.href || C.videoUrl || "#", n = C.target || "_blank";
|
|
810
|
-
return `<div${w} style="${
|
|
819
|
+
return `<div${w} style="${P({
|
|
811
820
|
padding: v.padding,
|
|
812
821
|
margin: v.margin,
|
|
813
822
|
borderRadius: v.borderRadius,
|
|
814
823
|
overflow: "hidden"
|
|
815
|
-
})}"><a href="${
|
|
824
|
+
})}"><a href="${V(t)}" target="${V(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${V(e.thumbnailUrl)}" alt="${V(C.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>`;
|
|
816
825
|
}
|
|
817
826
|
case "timer": {
|
|
818
|
-
let e = C.showLabels !== !1, t =
|
|
827
|
+
let e = C.showLabels !== !1, t = P({
|
|
819
828
|
fontFamily: v.digitsFontFamily,
|
|
820
829
|
fontSize: v.digitsFontSize || "40px",
|
|
821
830
|
color: v.digitsColor || "#1e293b",
|
|
822
831
|
fontWeight: "800"
|
|
823
|
-
}), n =
|
|
832
|
+
}), n = P({
|
|
824
833
|
fontFamily: v.labelsFontFamily,
|
|
825
834
|
fontSize: v.labelsFontSize || "16px",
|
|
826
835
|
color: v.labelsColor || "#64748b"
|
|
827
|
-
}), r =
|
|
836
|
+
}), r = P({
|
|
828
837
|
backgroundColor: v.backgroundColor || "#f8fafc",
|
|
829
838
|
borderRadius: v.borderRadius || "8px",
|
|
830
839
|
padding: v.padding || "16px",
|
|
831
840
|
textAlign: "center"
|
|
832
|
-
}), 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(C.targetDate, C.timezone), s =
|
|
841
|
+
}), 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(C.targetDate, C.timezone), s = V(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>`;
|
|
833
842
|
return `<div${w} 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>`;
|
|
834
843
|
}
|
|
835
844
|
case "carousel": {
|
|
836
|
-
let e = Array.isArray(C.images) ? C.images : [], t = `plexo-carousel-${g.id}`, n =
|
|
845
|
+
let e = Array.isArray(C.images) ? C.images : [], t = `plexo-carousel-${g.id}`, n = P({
|
|
837
846
|
padding: v.padding || "10px",
|
|
838
847
|
margin: v.margin,
|
|
839
848
|
backgroundColor: v.backgroundColor,
|
|
@@ -845,7 +854,7 @@ var ae = (g, _ = !1) => {
|
|
|
845
854
|
if (e.length === 0) return `<div${w} style="${n}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
|
|
846
855
|
let r = Math.min(e.length - 1, Math.max(0, parseInt(String(C.activeIdx), 10) || 0)), i = e.map((t, n) => (n - r + e.length) % e.length), a = e.length * 5, o = .6, s = e.map((n, r) => {
|
|
847
856
|
let o = i[r] * 5, s = e.length > 1 ? ` animation: ${t}-fade ${a}s ease-in-out infinite; animation-delay: ${o}s;` : "";
|
|
848
|
-
return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${
|
|
857
|
+
return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${V(n.src)}" alt="${V(n.alt || n.caption || "")}" style="width: 100%; height: 100%; object-fit: cover; display: block;" />${n.caption ? `<div class="${t}-caption" style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${V(n.caption)}</div>` : ""}</div>`;
|
|
849
858
|
}).join(""), c = e.some((e) => !!e.caption) ? "38px" : "10px", l = e.length > 1 ? `<div class="${t}-dots" style="display: flex; gap: 6px; justify-content: center;">${e.map((e, n) => {
|
|
850
859
|
let r = i[n] * 5;
|
|
851
860
|
return `<span style="width: 6px; height: 6px; border-radius: 9999px; background: #cbd5e1; animation: ${t}-dot ${a}s ease-in-out infinite; animation-delay: ${r}s;"></span>`;
|
|
@@ -853,13 +862,13 @@ var ae = (g, _ = !1) => {
|
|
|
853
862
|
return `<div${w} class="${t}" style="${n}">${e.length > 1 ? `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}.${t}-dots{position:absolute;left:0;right:0;bottom:${c};}@keyframes ${t}-fade{0%{opacity:0;}${f}%{opacity:1;}${u}%{opacity:1;}${d}%{opacity:0;}100%{opacity:0;}}@keyframes ${t}-dot{0%{background:#cbd5e1;}${f}%{background:#4f46e5;}${u}%{background:#4f46e5;}${d}%{background:#cbd5e1;}100%{background:#cbd5e1;}}</style>` : `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}</style>`}${s}${l}</div>`;
|
|
854
863
|
}
|
|
855
864
|
case "accordion": {
|
|
856
|
-
let e = o(g), t = C.mode === "multi" ? "multi" : "single", n = C.iconStyle || "chevron", r = C.iconPosition === "left", i = C.showDividers !== !1, a = C.animation !== "none", s =
|
|
865
|
+
let e = o(g), t = C.mode === "multi" ? "multi" : "single", n = C.iconStyle || "chevron", r = C.iconPosition === "left", i = C.showDividers !== !1, a = C.animation !== "none", s = P({
|
|
857
866
|
border: `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#e2e8f0"}`,
|
|
858
867
|
borderRadius: v.borderRadius || "10px",
|
|
859
868
|
overflow: "hidden",
|
|
860
869
|
margin: v.margin
|
|
861
870
|
});
|
|
862
|
-
return e.length === 0 ? `<div${w} style="${s}"></div>` : `<div${w} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${
|
|
871
|
+
return e.length === 0 ? `<div${w} style="${s}"></div>` : `<div${w} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${X(e, v, {
|
|
863
872
|
iconStyle: n,
|
|
864
873
|
iconOnLeft: r,
|
|
865
874
|
showDividers: i,
|
|
@@ -868,43 +877,43 @@ var ae = (g, _ = !1) => {
|
|
|
868
877
|
}
|
|
869
878
|
default: return ie(g.type);
|
|
870
879
|
}
|
|
871
|
-
},
|
|
880
|
+
}, Z = (e, t, n) => {
|
|
872
881
|
if (!e || typeof e != "object") return "";
|
|
873
|
-
let r =
|
|
882
|
+
let r = j(e);
|
|
874
883
|
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. -->`;
|
|
875
884
|
let i = r.style?.columnGap, a = typeof i == "number" ? `${i}px` : typeof i == "string" ? i.trim() : "", o = a !== "" && a !== "0" && a !== "0px", s = r.style?.gap, c = typeof s == "number" ? `${s}px` : typeof s == "string" ? s.trim() : "", l = c !== "" && c !== "0" && c !== "0px", u = { ...r.style || {} };
|
|
876
885
|
delete u.columnGap;
|
|
877
|
-
let d =
|
|
878
|
-
|
|
886
|
+
let d = P(u), f = H("id", r.htmlId), p = H("class", r.htmlClass), m = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
887
|
+
L(t, m, r.style, "tablet", r.styleTablet), L(t, m, r.style, "mobile", r.styleMobile), (o || l) && t.mobile.push(`[data-plexo-id="${m}"] > .plexo-col { margin-bottom: 0; }`);
|
|
879
888
|
let h = `\n <!-- ROW START: ${r.id || "row"} -->`, _ = o ? `gap: ${a}; margin-left: 0; margin-right: 0;` : "margin-left: -8px; margin-right: -8px;";
|
|
880
889
|
h += `\n <div data-plexo-id="${m}"${f}${p} class="plexo-row" style="display: flex; flex-wrap: wrap; ${_} ${d}">`;
|
|
881
890
|
let v = Array.isArray(r.columns) ? r.columns : [], y = o && v.length > 1 ? `(${a} * ${v.length - 1} / ${v.length})` : "";
|
|
882
891
|
for (let e of v) {
|
|
883
892
|
if (!e) continue;
|
|
884
|
-
let r = e.styles || e.style || {}, i =
|
|
885
|
-
|
|
893
|
+
let r = e.styles || e.style || {}, i = P(r), a = r.gap || "16px", s = H("id", e.attrs?.htmlId), c = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
|
|
894
|
+
L(t, l, r, "tablet", e.stylesTablet), L(t, l, r, "mobile", e.stylesMobile);
|
|
886
895
|
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; " : "", p = e.width || "100%", m = typeof p == "string" && /^\s*\d+(\.\d+)?\s*%\s*$/.test(p), _ = o && m && y ? `calc(${p.trim()} - ${y})` : p, v = o ? "padding-left: 0; padding-right: 0;" : "padding-left: 8px; padding-right: 8px;";
|
|
887
896
|
h += `\n <!-- COLUMN START: ${e.id || "col"} -->`, h += `\n <div data-plexo-id="${l}"${s} class="plexo-col${c}" style="box-sizing: border-box; ${v} width: ${_}; --plexo-col-gap: ${a}; ${f}${i}">`;
|
|
888
|
-
let b = new Map(u.map((e) => [e.id, e])), x = new Map(d.map((e) => [e.id, e]))
|
|
889
|
-
for (let r of g({
|
|
897
|
+
let b = new Map(u.map((e) => [e.id, e])), x = new Map(d.map((e) => [e.id, e])), S = g({
|
|
890
898
|
...e,
|
|
891
899
|
elements: u,
|
|
892
900
|
nestedRows: d
|
|
893
|
-
})
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
901
|
+
}), C = S[S.length - 1];
|
|
902
|
+
for (let e of S) {
|
|
903
|
+
let r = b.get(e);
|
|
904
|
+
if (r) {
|
|
905
|
+
let i = r.attributes || {}, o = typeof i.htmlClassNames == "string" ? i.htmlClassNames : typeof i.htmlClass == "string" ? i.htmlClass : typeof i.className == "string" ? i.className : "", s = H("id", i.htmlId), c = H("class", o), l = r.style?.display, u = l === "inline-block" || l === "inline" || l === "inline-flex", d = e === C ? "" : `margin-bottom: ${a};`, f = u ? `${d}${d ? " " : ""}display: ${l}; vertical-align: top;` : d;
|
|
906
|
+
L(t, r.id, r.style, "tablet", R(r, r.styleTablet)), L(t, r.id, r.style, "mobile", R(r, r.styleMobile)), z(t, r, "tablet", r.styleTablet), z(t, r, "mobile", r.styleMobile), h += `\n <div${s}${c} style="${f}">`, h += `\n ${ae(r, n)}`, h += "\n </div>";
|
|
898
907
|
continue;
|
|
899
908
|
}
|
|
900
|
-
let i = x.get(
|
|
901
|
-
i && (h +=
|
|
909
|
+
let i = x.get(e);
|
|
910
|
+
i && (h += Z(i, t, n));
|
|
902
911
|
}
|
|
903
912
|
h += "\n </div>";
|
|
904
913
|
}
|
|
905
914
|
return h += "\n </div>", h;
|
|
906
915
|
};
|
|
907
|
-
function
|
|
916
|
+
function oe(e) {
|
|
908
917
|
let t = /* @__PURE__ */ new Set(), n = 0, r = (e) => {
|
|
909
918
|
let r;
|
|
910
919
|
do
|
|
@@ -971,26 +980,26 @@ var Q = (e, t) => {
|
|
|
971
980
|
"ogImageUrl"
|
|
972
981
|
], s = {};
|
|
973
982
|
for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
|
|
974
|
-
let c =
|
|
983
|
+
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 = H("id", a.htmlId), d = H("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 = typeof a.metaDescription == "string" && a.metaDescription.trim() ? a.metaDescription.trim() : "", g = typeof a.ogImageUrl == "string" && a.ogImageUrl.trim() ? a.ogImageUrl.trim() : "", v = typeof a.contentMaxWidth == "string" && a.contentMaxWidth.trim() ? a.contentMaxWidth.trim() : "1200px", y = oe(Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : []), b = N(M(y, [a.fontFamily])), x = {
|
|
975
984
|
tablet: [],
|
|
976
985
|
mobile: []
|
|
977
986
|
}, S = "";
|
|
978
|
-
for (let e of y) S +=
|
|
987
|
+
for (let e of y) S += Z(e, x, n);
|
|
979
988
|
let C = x.tablet.length ? `\n ${x.tablet.join("\n ")}` : "", w = x.mobile.length ? `\n ${x.mobile.join("\n ")}` : "", T = `<!DOCTYPE html>
|
|
980
989
|
<html>
|
|
981
990
|
<head>
|
|
982
991
|
<meta charset="utf-8">
|
|
983
|
-
<title>${
|
|
984
|
-
${h ? `<meta name="description" content="${
|
|
985
|
-
${m ? `<link rel="icon" href="${
|
|
992
|
+
<title>${V(l)}</title>
|
|
993
|
+
${h ? `<meta name="description" content="${V(h)}">` : ""}
|
|
994
|
+
${m ? `<link rel="icon" href="${V(m)}">` : ""}
|
|
986
995
|
<meta property="og:type" content="website">
|
|
987
|
-
<meta property="og:title" content="${
|
|
988
|
-
${h ? `<meta property="og:description" content="${
|
|
989
|
-
${g ? `<meta property="og:image" content="${
|
|
996
|
+
<meta property="og:title" content="${V(l)}">
|
|
997
|
+
${h ? `<meta property="og:description" content="${V(h)}">` : ""}
|
|
998
|
+
${g ? `<meta property="og:image" content="${V(g)}">` : ""}
|
|
990
999
|
<meta name="twitter:card" content="${g ? "summary_large_image" : "summary"}">
|
|
991
|
-
<meta name="twitter:title" content="${
|
|
992
|
-
${h ? `<meta name="twitter:description" content="${
|
|
993
|
-
${g ? `<meta name="twitter:image" content="${
|
|
1000
|
+
<meta name="twitter:title" content="${V(l)}">
|
|
1001
|
+
${h ? `<meta name="twitter:description" content="${V(h)}">` : ""}
|
|
1002
|
+
${g ? `<meta name="twitter:image" content="${V(g)}">` : ""}
|
|
994
1003
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
995
1004
|
${b ? `<link rel="stylesheet" href="${b}">` : ""}
|
|
996
1005
|
${S.includes("<opt-in-embed-form") ? `<script type="module" src="${_}"><\/script>` : ""}
|
|
@@ -1002,7 +1011,7 @@ var Q = (e, t) => {
|
|
|
1002
1011
|
margin entirely, so the same -8px bleed would otherwise show as a permanent ~8px
|
|
1003
1012
|
horizontal scrollbar with nothing to absorb it. Scoped to body, not any inner element,
|
|
1004
1013
|
so it only ever suppresses that specific layout overflow -- never clips real content. */
|
|
1005
|
-
body { margin: 0; overflow-x: hidden; font-family: ${
|
|
1014
|
+
body { margin: 0; overflow-x: hidden; font-family: ${A}; }
|
|
1006
1015
|
.plexo-row {
|
|
1007
1016
|
display: flex;
|
|
1008
1017
|
flex-wrap: wrap;
|
|
@@ -1058,14 +1067,14 @@ ${p ? ` <script>\n${p}\n <\/script>` : ""}
|
|
|
1058
1067
|
function $(e) {
|
|
1059
1068
|
return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
1060
1069
|
}
|
|
1061
|
-
function
|
|
1070
|
+
function se(e) {
|
|
1062
1071
|
return $(Q(e));
|
|
1063
1072
|
}
|
|
1064
|
-
function
|
|
1073
|
+
function ce(e) {
|
|
1065
1074
|
return Q(e);
|
|
1066
1075
|
}
|
|
1067
|
-
function
|
|
1076
|
+
function le(e) {
|
|
1068
1077
|
return e;
|
|
1069
1078
|
}
|
|
1070
1079
|
//#endregion
|
|
1071
|
-
export {
|
|
1080
|
+
export { ce as a, B as c, le as d, k as f, Q as i, F as l, U as n, se as o, L as r, j as s, A as t, $ as u };
|
package/dist/compiler.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./compiler-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./compiler-BOsCUhY-.js";
|
|
2
2
|
export { l as DEFAULT_BODY_FONT_FAMILY, a as FORM_NON_CSS_STYLE_KEYS, s as collectResponsiveRule, r as compileToHTML, e as compileToHTMLWithStrataAuto, o as compileToPlainText, c as convertSectionRowToPlexoRow, t as getFormDefaultStyle, i as getInlineStylesImportant, u as htmlToPlainText, n as injectStrataBundle };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e, n as t, o as n, r, s as i, t as a } from "./sanitizeCompiledHtml-D3k1f2jT.js";
|
|
2
2
|
import { S as o, _ as s, a as c, b as l, c as u, f as d, h as f, i as p, l as m, o as h, p as g, s as _, u as v, x as y, y as b } from "./iconSvgStatic-CGue7nyp.js";
|
|
3
|
-
import { a as x, d as S, f as C, i as ee, o as te, u as w } from "./compiler-
|
|
3
|
+
import { a as x, d as S, f as C, i as ee, o as te, u as w } from "./compiler-BOsCUhY-.js";
|
|
4
4
|
import { t as ne } from "./compilerClient-BIrZIgfG.js";
|
|
5
5
|
import T, { createContext as E, createElement as re, forwardRef as ie, useCallback as ae, useContext as oe, useEffect as D, useImperativeHandle as se, useMemo as O, useRef as k, useState as A } from "react";
|
|
6
6
|
import { DndContext as ce, DragOverlay as le, MeasuringStrategy as ue, PointerSensor as de, TouchSensor as fe, pointerWithin as pe, rectIntersection as me, useDraggable as j, useDroppable as he, useSensor as M, useSensors as ge } from "@dnd-kit/core";
|
package/package.json
CHANGED