@charisol/plexo-sdk 1.4.25 → 1.4.27
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-C4Rkxl1E.js → compiler-ZeSTpC8a.js} +185 -158
- package/dist/compiler.js +1 -1
- package/dist/index.js +21 -1
- package/package.json +1 -1
|
@@ -362,7 +362,7 @@ function j(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 M = /* @__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 N(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 F = (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,7 @@ function z(e, t) {
|
|
|
509
509
|
justifyContent: n
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
|
-
var
|
|
512
|
+
var z = () => ({
|
|
513
513
|
backgroundColor: "#ffffff",
|
|
514
514
|
borderRadius: "20px",
|
|
515
515
|
width: "100%",
|
|
@@ -532,11 +532,11 @@ var B = () => ({
|
|
|
532
532
|
buttonPaddingRight: "14px",
|
|
533
533
|
buttonFontSize: "13px",
|
|
534
534
|
buttonFontWeight: "700"
|
|
535
|
-
}),
|
|
535
|
+
}), B = (e) => (e || "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), V = (e, t) => {
|
|
536
536
|
if (typeof t != "string") return "";
|
|
537
537
|
let n = t.trim();
|
|
538
|
-
return n ? ` ${e}="${
|
|
539
|
-
},
|
|
538
|
+
return n ? ` ${e}="${B(n)}"` : "";
|
|
539
|
+
}, H = [
|
|
540
540
|
"fieldSpacing",
|
|
541
541
|
"buttonBackgroundColor",
|
|
542
542
|
"buttonTextColor",
|
|
@@ -556,9 +556,36 @@ var B = () => ({
|
|
|
556
556
|
"buttonWidth",
|
|
557
557
|
"buttonHeight",
|
|
558
558
|
"buttonAlign"
|
|
559
|
-
], W = (e) => {
|
|
559
|
+
], U = "#cbd5e1", W = "#e2e8f0", G = "#1e293b", K = "#64748b", q = (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>`, J = (e, t = W, n = "8px") => `<div style="width:${e};height:${n};background:${t};border-radius:3px;"></div>`;
|
|
560
|
+
function Y(e) {
|
|
561
|
+
let t = (e = "90px") => `<div style="width:100%;height:${e};background:linear-gradient(135deg,${W},${U});border-radius:6px;"></div>`, n = () => `<div style="flex:1;display:flex;flex-direction:column;gap:6px;">${t("64px")}${J("75%")}${J("40%", U)}</div>`;
|
|
562
|
+
switch (e) {
|
|
563
|
+
case "product": return `${q("Product")}<div style="display:flex;flex-direction:column;gap:8px;">${t()}<div style="font-weight:600;font-size:14px;color:${G};">Sample Product Name</div><div style="font-size:13px;color:${K};">$29.99</div><div style="background:${G};color:#fff;text-align:center;padding:8px;border-radius:6px;font-size:13px;font-weight:600;">Add to Cart</div></div>`;
|
|
564
|
+
case "booking": return `${q("Booking")}<div style="font-weight:600;font-size:14px;color:${G};margin-bottom:8px;">Select a time</div><div style="display:flex;gap:6px;flex-wrap:wrap;">${[
|
|
565
|
+
"9:00 AM",
|
|
566
|
+
"10:00 AM",
|
|
567
|
+
"11:30 AM",
|
|
568
|
+
"2:00 PM"
|
|
569
|
+
].map((e) => `<span style="border:1px solid ${U};border-radius:6px;padding:6px 10px;font-size:12px;color:${G};">${e}</span>`).join("")}</div>`;
|
|
570
|
+
case "shop_grid": return `${q("Shop Grid")}<div style="display:flex;gap:10px;">${n()}${n()}${n()}</div>`;
|
|
571
|
+
case "cart_summary": {
|
|
572
|
+
let e = `<div style="width:36px;height:36px;flex-shrink:0;background:linear-gradient(135deg,${W},${U});border-radius:4px;"></div>`, t = () => `<div style="display:flex;gap:8px;align-items:center;">${e}<div style="flex:1;">${J("80%")}</div>${J("30px")}</div>`;
|
|
573
|
+
return `${q("Cart Summary")}<div style="display:flex;flex-direction:column;gap:10px;">${t()}${t()}<div style="border-top:1px solid ${W};padding-top:8px;display:flex;justify-content:space-between;font-size:13px;font-weight:600;color:${G};"><span>Subtotal</span><span>$59.98</span></div></div>`;
|
|
574
|
+
}
|
|
575
|
+
case "checkout_flow": return `${q("Checkout")}<div style="display:flex;gap:12px;"><div style="flex:1;display:flex;flex-direction:column;gap:8px;">${J("50%", U, "10px")}<div style="height:32px;background:#fff;border:1px solid ${W};border-radius:6px;"></div><div style="height:32px;background:#fff;border:1px solid ${W};border-radius:6px;"></div></div><div style="width:120px;flex-shrink:0;border:1px solid ${W};border-radius:6px;padding:10px;background:#fff;display:flex;flex-direction:column;gap:8px;">${J("70%", U)}${J("50%")}<div style="height:26px;background:${G};border-radius:4px;margin-top:4px;"></div></div></div>`;
|
|
576
|
+
case "order_confirmation": return `${q("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:${G};">Thank you for your order</div><div style="font-size:12px;color:${K};margin-top:4px;">Order #10482</div></div>`;
|
|
577
|
+
case "order_tracking": return `${q("Order Tracking")}<div style="display:flex;gap:8px;margin-bottom:16px;"><div style="flex:1;height:32px;background:#fff;border:1px solid ${W};border-radius:6px;"></div><div style="width:76px;height:32px;background:${G};border-radius:6px;flex-shrink:0;"></div></div><div style="display:flex;justify-content:space-between;">${[
|
|
578
|
+
["Placed", !0],
|
|
579
|
+
["Processing", !1],
|
|
580
|
+
["Shipped", !1],
|
|
581
|
+
["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" : U};"></div><span style="font-size:9px;color:${K};">${e}</span></div>`).join("")}</div>`;
|
|
583
|
+
default: return "";
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
var te = (e) => {
|
|
560
587
|
if (!e || typeof e != "object") return "";
|
|
561
|
-
let t = e.kind || "text", n =
|
|
588
|
+
let t = e.kind || "text", n = B(e.name || e.id || "field"), r = e.required ? " required" : "", i = P({
|
|
562
589
|
fontSize: e.fontSize || "13px",
|
|
563
590
|
borderRadius: e.borderRadius || "12px",
|
|
564
591
|
borderWidth: e.borderWidth || "1px",
|
|
@@ -566,19 +593,19 @@ var B = () => ({
|
|
|
566
593
|
borderStyle: "solid",
|
|
567
594
|
color: e.inputTextColor
|
|
568
595
|
}), 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>`;
|
|
569
|
-
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${
|
|
596
|
+
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${B(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${B(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
|
|
570
597
|
label: e.label || "Option",
|
|
571
598
|
value: e.name || "option"
|
|
572
|
-
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${
|
|
599
|
+
}]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${B(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${B(t)}" name="${n}" placeholder="${B(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
|
|
573
600
|
};
|
|
574
|
-
function
|
|
601
|
+
function ne(e, t, n) {
|
|
575
602
|
if (e === "none") return "";
|
|
576
|
-
let r =
|
|
603
|
+
let r = B(t);
|
|
577
604
|
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>`;
|
|
578
605
|
}
|
|
579
|
-
function
|
|
606
|
+
function X(e, t, n, r, i = []) {
|
|
580
607
|
return e.map((a, o) => {
|
|
581
|
-
let s = [...i, o], c = o === e.length - 1, l =
|
|
608
|
+
let s = [...i, o], c = o === e.length - 1, l = P({ borderBottom: n.showDividers && !c ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), u = P({
|
|
582
609
|
display: "flex",
|
|
583
610
|
alignItems: "center",
|
|
584
611
|
gap: "8px",
|
|
@@ -595,70 +622,70 @@ function K(e, t, n, r, i = []) {
|
|
|
595
622
|
border: "none",
|
|
596
623
|
font: "inherit",
|
|
597
624
|
background: void 0
|
|
598
|
-
}), d =
|
|
625
|
+
}), d = P({
|
|
599
626
|
display: "grid",
|
|
600
627
|
gridTemplateRows: a.defaultOpen ? "1fr" : "0fr",
|
|
601
628
|
transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
|
|
602
629
|
backgroundColor: t.contentBackgroundColor || "#ffffff"
|
|
603
|
-
}), f =
|
|
630
|
+
}), f = P({
|
|
604
631
|
padding: t.contentPadding || "14px",
|
|
605
632
|
color: t.contentTextColor || "#475569",
|
|
606
633
|
fontSize: t.contentFontSize || "13px",
|
|
607
634
|
whiteSpace: "pre-wrap"
|
|
608
|
-
}), p =
|
|
609
|
-
return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${
|
|
635
|
+
}), p = ne(n.iconStyle, t.iconColor || "#64748b", !!a.defaultOpen), m = B(a.title), h = B(a.content), g = a.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${X(a.children, t, n, r, s)}</div>` : "";
|
|
636
|
+
return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${B(r)}|${s.join(".")}"`} data-acc-header data-acc-open="${a.defaultOpen ? "1" : "0"}" style="${u}"><span style="flex: 1;">${m}</span>${p}</button><div data-acc-panel style="${d}"><div style="overflow: hidden;"><div style="${f}">${h}${g}</div></div></div></div>`;
|
|
610
637
|
}).join("");
|
|
611
638
|
}
|
|
612
|
-
function
|
|
639
|
+
function re(e) {
|
|
613
640
|
return `<!-- Unsupported block ${String(e)} -->`;
|
|
614
641
|
}
|
|
615
|
-
var
|
|
642
|
+
var ie = (g, _ = !1) => {
|
|
616
643
|
if (!g || typeof g != "object") return "";
|
|
617
|
-
let
|
|
618
|
-
...
|
|
619
|
-
...
|
|
620
|
-
} :
|
|
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 = P(g.type === "form_container" ? {
|
|
645
|
+
...z(),
|
|
646
|
+
...v
|
|
647
|
+
} : x), C = g.attributes || {}, w = ` data-plexo-id="${B(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; " : ""}`;
|
|
621
648
|
switch (g.type) {
|
|
622
|
-
case "heading": return
|
|
623
|
-
case "paragraph": return
|
|
624
|
-
case "text": return
|
|
649
|
+
case "heading": return D(`<h2${w} style="margin-top: 0; margin-bottom: 8px; ${O}${S}">${C.text || "Heading"}</h2>`);
|
|
650
|
+
case "paragraph": return D(`<p${w} style="margin-top: 0; margin-bottom: 12px; ${O}${S}">${C.text || "Paragraph text content."}</p>`);
|
|
651
|
+
case "text": return D(`<div${w} style="${O}${S}">${C.text || ""}</div>`);
|
|
625
652
|
case "button": {
|
|
626
|
-
let e = u(g), t =
|
|
627
|
-
...
|
|
653
|
+
let e = u(g), t = P({
|
|
654
|
+
...v,
|
|
628
655
|
width: e.width,
|
|
629
656
|
height: e.height
|
|
630
657
|
});
|
|
631
|
-
return `<div style="text-align: ${
|
|
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; ${t}">${C.text || "Button"}</a></div>`;
|
|
632
659
|
}
|
|
633
660
|
case "image": {
|
|
634
|
-
let e = h(g), t =
|
|
635
|
-
...
|
|
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 = P({
|
|
662
|
+
...v,
|
|
636
663
|
width: e.width,
|
|
637
664
|
height: e.height
|
|
638
665
|
});
|
|
639
|
-
return `<img${
|
|
666
|
+
return `<img${w} src="${C.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${C.alt || ""}" style="${n} ${t}" />`;
|
|
640
667
|
}
|
|
641
|
-
case "divider": return `<hr${
|
|
642
|
-
case "spacer": return `<div${
|
|
643
|
-
case "card": return `<div${
|
|
644
|
-
<h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${
|
|
645
|
-
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${
|
|
668
|
+
case "divider": return `<hr${w} style="border: 0; border-top: ${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#334155"}; ${S}" />`;
|
|
669
|
+
case "spacer": return `<div${w} style="height: ${v.height || "24px"};"></div>`;
|
|
670
|
+
case "card": return `<div${w} style="${S}">
|
|
671
|
+
<h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${C.title || "Card Title"}</h3>
|
|
672
|
+
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${C.description || "Card description."}</p>
|
|
646
673
|
</div>`;
|
|
647
674
|
case "form_container": {
|
|
648
|
-
if (
|
|
649
|
-
let e =
|
|
650
|
-
return `<div${
|
|
651
|
-
...
|
|
675
|
+
if (C.provider === "maildrip" && typeof C.maildripPageId == "string" && C.maildripPageId.trim()) {
|
|
676
|
+
let e = B(C.maildripPageId.trim());
|
|
677
|
+
return `<div${w} style="${P({
|
|
678
|
+
...v,
|
|
652
679
|
height: p(g)
|
|
653
680
|
})}"><opt-in-embed-form page-id="${e}"></opt-in-embed-form></div>`;
|
|
654
681
|
}
|
|
655
682
|
let n = {
|
|
656
|
-
...
|
|
657
|
-
...
|
|
683
|
+
...z(),
|
|
684
|
+
...v
|
|
658
685
|
}, r = {};
|
|
659
|
-
for (let e of Object.keys(n))
|
|
686
|
+
for (let e of Object.keys(n)) H.includes(e) || (r[e] = n[e]);
|
|
660
687
|
r.height = p(g);
|
|
661
|
-
let i =
|
|
688
|
+
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};">${te(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({
|
|
662
689
|
backgroundColor: n.buttonBackgroundColor,
|
|
663
690
|
color: n.buttonTextColor,
|
|
664
691
|
borderRadius: n.buttonBorderRadius,
|
|
@@ -675,18 +702,18 @@ var J = (g) => {
|
|
|
675
702
|
width: c,
|
|
676
703
|
height: d
|
|
677
704
|
});
|
|
678
|
-
return `<form${
|
|
705
|
+
return `<form${w} action="${B(C.actionUrl || C.action || "#")}" method="${B(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>`;
|
|
679
706
|
}
|
|
680
707
|
case "input": {
|
|
681
|
-
let e =
|
|
682
|
-
return `<input${
|
|
708
|
+
let e = C.inputType || C.type || "text", t = B(C.name || C.fieldName || "field"), n = B(C.placeholder || ""), r = C.required ? " required" : "";
|
|
709
|
+
return `<input${w} type="${B(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${r} />`;
|
|
683
710
|
}
|
|
684
|
-
case "textarea": return `<textarea${
|
|
685
|
-
case "select": return `<select${
|
|
686
|
-
case "html": return `<div${
|
|
687
|
-
...
|
|
711
|
+
case "textarea": return `<textarea${w} name="${B(C.name || C.fieldName || "field")}" placeholder="${B(C.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${C.required ? " required" : ""}></textarea>`;
|
|
712
|
+
case "select": return `<select${w} name="${B(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="${B(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
713
|
+
case "html": return `<div${w} style="${P({
|
|
714
|
+
...v,
|
|
688
715
|
height: s(g, "auto")
|
|
689
|
-
})}">${
|
|
716
|
+
})}">${C.htmlContent || C.text || ""}</div>`;
|
|
690
717
|
case "blog_title":
|
|
691
718
|
case "blog_content":
|
|
692
719
|
case "blog_featured_image":
|
|
@@ -695,8 +722,8 @@ var J = (g) => {
|
|
|
695
722
|
case "blog_categories":
|
|
696
723
|
case "blog_comments":
|
|
697
724
|
case "blog_post_list": {
|
|
698
|
-
let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t =
|
|
699
|
-
return `<div${
|
|
725
|
+
let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(v);
|
|
726
|
+
return `<div${w} data-plexo-blog-${e}="true"${V("data-plexo-blog-prefix", C.prefix)} style="${t}"></div>`;
|
|
700
727
|
}
|
|
701
728
|
case "product":
|
|
702
729
|
case "booking":
|
|
@@ -705,20 +732,20 @@ var J = (g) => {
|
|
|
705
732
|
case "checkout_flow":
|
|
706
733
|
case "order_confirmation":
|
|
707
734
|
case "order_tracking": {
|
|
708
|
-
let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t =
|
|
709
|
-
return `<div${
|
|
735
|
+
let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = P(v);
|
|
736
|
+
return `<div${w} data-plexo-commerce-${e}="true"${V("data-plexo-product-id", C.productId)}${V("data-plexo-service-id", C.serviceId)}${V("data-plexo-commerce-mode", C.mode)}${C.storeMode === !1 ? " data-plexo-commerce-store-mode=\"false\"" : ""}${V("data-plexo-commerce-limit", C.limit)}${V("data-plexo-commerce-category", C.category)}${V("data-plexo-commerce-sort", C.sort)}${V("data-plexo-commerce-items-per-row", C.itemsPerRow)}${V("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%;">${Y(g.type)}</div>` : ""}</div>`;
|
|
710
737
|
}
|
|
711
738
|
case "social": {
|
|
712
|
-
let e = r(g), t =
|
|
713
|
-
return `<div${
|
|
714
|
-
padding:
|
|
715
|
-
margin:
|
|
739
|
+
let e = r(g), t = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
|
|
740
|
+
return `<div${w} style="${P({
|
|
741
|
+
padding: v.padding,
|
|
742
|
+
margin: v.margin,
|
|
716
743
|
display: "flex",
|
|
717
744
|
flexWrap: "wrap",
|
|
718
|
-
gap:
|
|
745
|
+
gap: v.iconSpacing || "8px",
|
|
719
746
|
justifyContent: t
|
|
720
747
|
})}">${e.map((e) => {
|
|
721
|
-
let t =
|
|
748
|
+
let t = P({
|
|
722
749
|
width: e.size,
|
|
723
750
|
height: e.size,
|
|
724
751
|
padding: "8px",
|
|
@@ -730,132 +757,132 @@ var J = (g) => {
|
|
|
730
757
|
justifyContent: "center",
|
|
731
758
|
overflow: "hidden"
|
|
732
759
|
});
|
|
733
|
-
return `<a href="${
|
|
760
|
+
return `<a href="${B(e.url)}" style="${t} text-decoration: none;">${f(e.provider, e.color)}</a>`;
|
|
734
761
|
}).join("")}</div>`;
|
|
735
762
|
}
|
|
736
763
|
case "menu": {
|
|
737
|
-
let e = n(g), t =
|
|
738
|
-
return `<div${
|
|
739
|
-
...
|
|
764
|
+
let e = n(g), t = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
|
|
765
|
+
return `<div${w} style="${P({
|
|
766
|
+
...v,
|
|
740
767
|
display: "flex",
|
|
741
768
|
flexWrap: "wrap",
|
|
742
769
|
gap: "16px",
|
|
743
770
|
justifyContent: t
|
|
744
|
-
})}">${e.map((e) => `<a href="${
|
|
771
|
+
})}">${e.map((e) => `<a href="${B(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${v.fontWeight || 600};">${B(e.label)}</a>`).join("")}</div>`;
|
|
745
772
|
}
|
|
746
773
|
case "icon": {
|
|
747
|
-
let e =
|
|
748
|
-
padding:
|
|
749
|
-
margin:
|
|
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 = P({
|
|
775
|
+
padding: v.padding,
|
|
776
|
+
margin: v.margin,
|
|
750
777
|
display: "flex",
|
|
751
778
|
justifyContent: i
|
|
752
|
-
}), o = typeof
|
|
753
|
-
return `<div style="${a}">${o ? `<a${
|
|
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 style="${a}">${o ? `<a${w} href="${B(o)}" target="${C.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${w}>${s}</span>`}</div>`;
|
|
754
781
|
}
|
|
755
782
|
case "table": {
|
|
756
|
-
let e = d(g), t = `${
|
|
757
|
-
let o = a ? "th" : "td", s = a ?
|
|
783
|
+
let e = d(g), t = `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
|
|
784
|
+
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";
|
|
758
785
|
return `<tr>${n.map((e, n) => {
|
|
759
|
-
let r =
|
|
760
|
-
padding:
|
|
786
|
+
let r = P({
|
|
787
|
+
padding: v.cellPadding || "8px",
|
|
761
788
|
border: t,
|
|
762
789
|
backgroundColor: s,
|
|
763
790
|
color: c,
|
|
764
791
|
textAlign: l,
|
|
765
|
-
lineHeight:
|
|
766
|
-
letterSpacing:
|
|
792
|
+
lineHeight: v.contentLineHeight,
|
|
793
|
+
letterSpacing: v.contentLetterSpacing,
|
|
767
794
|
fontWeight: a ? "700" : void 0
|
|
768
|
-
}), u = ` data-plexo-cell="${
|
|
795
|
+
}), u = ` data-plexo-cell="${B(g.id)}|${i}-${n}"`;
|
|
769
796
|
return `<${o}${u} style="${r}">${e || " "}</${o}>`;
|
|
770
797
|
}).join("")}</tr>`;
|
|
771
|
-
}, 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 =
|
|
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 = P({
|
|
772
799
|
borderCollapse: "collapse",
|
|
773
800
|
width: "100%"
|
|
774
801
|
});
|
|
775
|
-
return `<div${
|
|
776
|
-
padding:
|
|
777
|
-
margin:
|
|
802
|
+
return `<div${w} style="${P({
|
|
803
|
+
padding: v.padding,
|
|
804
|
+
margin: v.margin,
|
|
778
805
|
overflowX: "auto"
|
|
779
806
|
})}"><table style="${c}">${r}<tbody>${o}</tbody>${s}</table></div>`;
|
|
780
807
|
}
|
|
781
808
|
case "video": {
|
|
782
|
-
let e = i(
|
|
783
|
-
return `<div${
|
|
784
|
-
padding:
|
|
785
|
-
margin:
|
|
786
|
-
borderRadius:
|
|
809
|
+
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="${P({
|
|
811
|
+
padding: v.padding,
|
|
812
|
+
margin: v.margin,
|
|
813
|
+
borderRadius: v.borderRadius,
|
|
787
814
|
overflow: "hidden"
|
|
788
|
-
})}"><a href="${
|
|
815
|
+
})}"><a href="${B(t)}" target="${B(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${B(e.thumbnailUrl)}" alt="${B(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>`;
|
|
789
816
|
}
|
|
790
817
|
case "timer": {
|
|
791
|
-
let e =
|
|
792
|
-
fontFamily:
|
|
793
|
-
fontSize:
|
|
794
|
-
color:
|
|
818
|
+
let e = C.showLabels !== !1, t = P({
|
|
819
|
+
fontFamily: v.digitsFontFamily,
|
|
820
|
+
fontSize: v.digitsFontSize || "40px",
|
|
821
|
+
color: v.digitsColor || "#1e293b",
|
|
795
822
|
fontWeight: "800"
|
|
796
|
-
}), n =
|
|
797
|
-
fontFamily:
|
|
798
|
-
fontSize:
|
|
799
|
-
color:
|
|
800
|
-
}), r =
|
|
801
|
-
backgroundColor:
|
|
802
|
-
borderRadius:
|
|
803
|
-
padding:
|
|
823
|
+
}), n = P({
|
|
824
|
+
fontFamily: v.labelsFontFamily,
|
|
825
|
+
fontSize: v.labelsFontSize || "16px",
|
|
826
|
+
color: v.labelsColor || "#64748b"
|
|
827
|
+
}), r = P({
|
|
828
|
+
backgroundColor: v.backgroundColor || "#f8fafc",
|
|
829
|
+
borderRadius: v.borderRadius || "8px",
|
|
830
|
+
padding: v.padding || "16px",
|
|
804
831
|
textAlign: "center"
|
|
805
|
-
}), 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(
|
|
806
|
-
return `<div${
|
|
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 = B(new Date(o.targetTimestamp).toISOString()), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
|
|
833
|
+
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>`;
|
|
807
834
|
}
|
|
808
835
|
case "carousel": {
|
|
809
|
-
let e = Array.isArray(
|
|
810
|
-
padding:
|
|
811
|
-
margin:
|
|
812
|
-
backgroundColor:
|
|
836
|
+
let e = Array.isArray(C.images) ? C.images : [], t = `plexo-carousel-${g.id}`, n = P({
|
|
837
|
+
padding: v.padding || "10px",
|
|
838
|
+
margin: v.margin,
|
|
839
|
+
backgroundColor: v.backgroundColor,
|
|
813
840
|
overflow: "hidden",
|
|
814
|
-
borderRadius:
|
|
815
|
-
width:
|
|
816
|
-
height:
|
|
841
|
+
borderRadius: v.borderRadius || "12px",
|
|
842
|
+
width: v.width || "100%",
|
|
843
|
+
height: v.height || "360px"
|
|
817
844
|
});
|
|
818
|
-
if (e.length === 0) return `<div${
|
|
819
|
-
let r = Math.min(e.length - 1, Math.max(0, parseInt(String(
|
|
845
|
+
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
|
+
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) => {
|
|
820
847
|
let o = i[r] * 5, s = e.length > 1 ? ` animation: ${t}-fade ${a}s ease-in-out infinite; animation-delay: ${o}s;` : "";
|
|
821
|
-
return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${
|
|
848
|
+
return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${B(n.src)}" alt="${B(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;">${B(n.caption)}</div>` : ""}</div>`;
|
|
822
849
|
}).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) => {
|
|
823
850
|
let r = i[n] * 5;
|
|
824
851
|
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>`;
|
|
825
852
|
}).join("")}</div>` : "", u = (5 - o) / a * 100, d = 5 / a * 100, f = o / a * 100;
|
|
826
|
-
return `<div${
|
|
853
|
+
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>`;
|
|
827
854
|
}
|
|
828
855
|
case "accordion": {
|
|
829
|
-
let e = o(g), t =
|
|
830
|
-
border: `${
|
|
831
|
-
borderRadius:
|
|
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 = P({
|
|
857
|
+
border: `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#e2e8f0"}`,
|
|
858
|
+
borderRadius: v.borderRadius || "10px",
|
|
832
859
|
overflow: "hidden",
|
|
833
|
-
margin:
|
|
860
|
+
margin: v.margin
|
|
834
861
|
});
|
|
835
|
-
return e.length === 0 ? `<div${
|
|
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">${X(e, v, {
|
|
836
863
|
iconStyle: n,
|
|
837
864
|
iconOnLeft: r,
|
|
838
865
|
showDividers: i,
|
|
839
866
|
animated: a
|
|
840
867
|
}, g.id)}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!root)return;var mode=root.getAttribute('data-acc-mode')||'single';var iconStyle=root.getAttribute('data-acc-icon-style')||'chevron';function setIconState(icon,open){if(!icon)return;if(iconStyle==='plus'){icon.textContent=open?'−':'+';}else if(iconStyle==='arrow'){icon.style.transform=open?'rotate(90deg)':'';}else if(iconStyle==='chevron'){icon.style.transform=open?'rotate(180deg)':'';}}var headers=root.querySelectorAll('[data-acc-header]');headers.forEach(function(header){header.addEventListener('click',function(){var item=header.parentElement;var group=item.parentElement;var panel=item.children[1];var isOpen=header.getAttribute('data-acc-open')==='1';if(mode!=='multi'&&group){Array.prototype.forEach.call(group.children,function(sib){if(sib===item)return;var sh=sib.children[0];var sp=sib.children[1];if(sh){sh.setAttribute('data-acc-open','0');setIconState(sh.querySelector('[data-acc-icon]'),false);}if(sp)sp.style.gridTemplateRows='0fr';});}var next=!isOpen;header.setAttribute('data-acc-open',next?'1':'0');panel.style.gridTemplateRows=next?'1fr':'0fr';setIconState(header.querySelector('[data-acc-icon]'),next);});});})();<\/script>`}</div>`;
|
|
841
868
|
}
|
|
842
|
-
default: return
|
|
869
|
+
default: return re(g.type);
|
|
843
870
|
}
|
|
844
|
-
},
|
|
871
|
+
}, Z = (e, t, n) => {
|
|
845
872
|
if (!e || typeof e != "object") return "";
|
|
846
873
|
let r = j(e);
|
|
847
874
|
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. -->`;
|
|
848
875
|
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 || {} };
|
|
849
876
|
delete s.columnGap;
|
|
850
|
-
let c =
|
|
851
|
-
|
|
877
|
+
let c = P(s), l = V("id", r.htmlId), u = V("class", r.htmlClass), d = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
878
|
+
L(t, d, r.style, "tablet", r.styleTablet), L(t, d, r.style, "mobile", r.styleMobile);
|
|
852
879
|
let f = `\n <!-- ROW START: ${r.id || "row"} -->`, p = o ? `gap: ${a}; margin-left: 0; margin-right: 0;` : "margin-left: -8px; margin-right: -8px;";
|
|
853
880
|
f += `\n <div data-plexo-id="${d}"${l}${u} class="plexo-row" style="display: flex; flex-wrap: wrap; ${p} ${c}">`;
|
|
854
881
|
let m = Array.isArray(r.columns) ? r.columns : [], h = o && m.length > 1 ? `(${a} * ${m.length - 1} / ${m.length})` : "";
|
|
855
882
|
for (let e of m) {
|
|
856
883
|
if (!e) continue;
|
|
857
|
-
let r = e.styles || e.style || {}, i =
|
|
858
|
-
|
|
884
|
+
let r = e.styles || e.style || {}, i = P(r), a = r.gap || "16px", s = V("id", e.attrs?.htmlId), c = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
|
|
885
|
+
L(t, l, r, "tablet", e.stylesTablet), L(t, l, r, "mobile", e.stylesMobile);
|
|
859
886
|
let u = Array.isArray(e.elements) ? e.elements : [], d = Array.isArray(e.nestedRows) ? e.nestedRows : [], p = n && u.length === 0 && d.length === 0 ? "min-height: 148px; " : "", m = e.width || "100%", _ = typeof m == "string" && /^\s*\d+(\.\d+)?\s*%\s*$/.test(m), v = o && _ && h ? `calc(${m.trim()} - ${h})` : m, y = o ? "padding-left: 0; padding-right: 0;" : "padding-left: 8px; padding-right: 8px;";
|
|
860
887
|
f += `\n <!-- COLUMN START: ${e.id || "col"} -->`, f += `\n <div data-plexo-id="${l}"${s} class="plexo-col${c}" style="box-sizing: border-box; ${y} width: ${v}; --plexo-col-gap: ${a}; ${p}${i}">`;
|
|
861
888
|
let b = new Map(u.map((e) => [e.id, e])), x = new Map(d.map((e) => [e.id, e]));
|
|
@@ -866,17 +893,17 @@ var J = (g) => {
|
|
|
866
893
|
})) {
|
|
867
894
|
let e = b.get(r);
|
|
868
895
|
if (e) {
|
|
869
|
-
let
|
|
870
|
-
|
|
896
|
+
let r = e.attributes || {}, i = typeof r.htmlClassNames == "string" ? r.htmlClassNames : typeof r.htmlClass == "string" ? r.htmlClass : typeof r.className == "string" ? r.className : "", o = V("id", r.htmlId), s = V("class", i), c = e.style?.display, l = c === "inline-block" || c === "inline" || c === "inline-flex" ? `margin-bottom: ${a}; display: ${c}; vertical-align: top;` : `margin-bottom: ${a};`;
|
|
897
|
+
L(t, e.id, e.style, "tablet", R(e, e.styleTablet)), L(t, e.id, e.style, "mobile", R(e, e.styleMobile)), f += `\n <div${o}${s} style="${l}">`, f += `\n ${ie(e, n)}`, f += "\n </div>";
|
|
871
898
|
continue;
|
|
872
899
|
}
|
|
873
900
|
let i = x.get(r);
|
|
874
|
-
i && (f +=
|
|
901
|
+
i && (f += Z(i, t, n));
|
|
875
902
|
}
|
|
876
903
|
f += "\n </div>";
|
|
877
904
|
}
|
|
878
905
|
return f += "\n </div>", f;
|
|
879
|
-
},
|
|
906
|
+
}, Q = (e, t) => {
|
|
880
907
|
let n = t?.canvasEditorPadding ?? !1;
|
|
881
908
|
if (!e || typeof e != "object") return "<!-- Empty template -->";
|
|
882
909
|
let r = e.designJson || e.template || e, i = r.body || (Array.isArray(r.rows) ? {
|
|
@@ -908,26 +935,26 @@ var J = (g) => {
|
|
|
908
935
|
"ogImageUrl"
|
|
909
936
|
], s = {};
|
|
910
937
|
for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
|
|
911
|
-
let c =
|
|
938
|
+
let c = P(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = V("id", a.htmlId), d = V("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = 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 = 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 = {
|
|
912
939
|
tablet: [],
|
|
913
940
|
mobile: []
|
|
914
941
|
}, S = "";
|
|
915
|
-
for (let e of y) S +=
|
|
942
|
+
for (let e of y) S += Z(e, x, n);
|
|
916
943
|
let C = x.tablet.length ? `\n ${x.tablet.join("\n ")}` : "", w = x.mobile.length ? `\n ${x.mobile.join("\n ")}` : "", T = `<!DOCTYPE html>
|
|
917
944
|
<html>
|
|
918
945
|
<head>
|
|
919
946
|
<meta charset="utf-8">
|
|
920
|
-
<title>${
|
|
921
|
-
${h ? `<meta name="description" content="${
|
|
922
|
-
${m ? `<link rel="icon" href="${
|
|
947
|
+
<title>${B(l)}</title>
|
|
948
|
+
${h ? `<meta name="description" content="${B(h)}">` : ""}
|
|
949
|
+
${m ? `<link rel="icon" href="${B(m)}">` : ""}
|
|
923
950
|
<meta property="og:type" content="website">
|
|
924
|
-
<meta property="og:title" content="${
|
|
925
|
-
${h ? `<meta property="og:description" content="${
|
|
926
|
-
${g ? `<meta property="og:image" content="${
|
|
951
|
+
<meta property="og:title" content="${B(l)}">
|
|
952
|
+
${h ? `<meta property="og:description" content="${B(h)}">` : ""}
|
|
953
|
+
${g ? `<meta property="og:image" content="${B(g)}">` : ""}
|
|
927
954
|
<meta name="twitter:card" content="${g ? "summary_large_image" : "summary"}">
|
|
928
|
-
<meta name="twitter:title" content="${
|
|
929
|
-
${h ? `<meta name="twitter:description" content="${
|
|
930
|
-
${g ? `<meta name="twitter:image" content="${
|
|
955
|
+
<meta name="twitter:title" content="${B(l)}">
|
|
956
|
+
${h ? `<meta name="twitter:description" content="${B(h)}">` : ""}
|
|
957
|
+
${g ? `<meta name="twitter:image" content="${B(g)}">` : ""}
|
|
931
958
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
932
959
|
${b ? `<link rel="stylesheet" href="${b}">` : ""}
|
|
933
960
|
${S.includes("<opt-in-embed-form") ? `<script type="module" src="${_}"><\/script>` : ""}
|
|
@@ -969,17 +996,17 @@ ${p ? ` <script>\n${p}\n <\/script>` : ""}
|
|
|
969
996
|
</body>
|
|
970
997
|
</html>`, T = T.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), T;
|
|
971
998
|
};
|
|
972
|
-
function
|
|
999
|
+
function $(e) {
|
|
973
1000
|
return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
974
1001
|
}
|
|
975
|
-
function
|
|
976
|
-
return
|
|
1002
|
+
function ae(e) {
|
|
1003
|
+
return $(Q(e));
|
|
977
1004
|
}
|
|
978
|
-
function
|
|
979
|
-
return
|
|
1005
|
+
function oe(e) {
|
|
1006
|
+
return Q(e);
|
|
980
1007
|
}
|
|
981
|
-
function
|
|
1008
|
+
function se(e) {
|
|
982
1009
|
return e;
|
|
983
1010
|
}
|
|
984
1011
|
//#endregion
|
|
985
|
-
export {
|
|
1012
|
+
export { oe as a, z as c, se as d, k as f, Q as i, F as l, H as n, ae 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-ZeSTpC8a.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-ZeSTpC8a.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";
|
|
@@ -60937,6 +60937,26 @@ var gK = (e) => ({ body: {
|
|
|
60937
60937
|
max: 200,
|
|
60938
60938
|
onChange: (e) => Y("columnGap", e)
|
|
60939
60939
|
}),
|
|
60940
|
+
/* @__PURE__ */ F("div", {
|
|
60941
|
+
className: "flex items-center justify-between py-3 border-b border-slate-800/10 last:border-b-0",
|
|
60942
|
+
children: [/* @__PURE__ */ P("span", {
|
|
60943
|
+
className: "text-sm text-slate-300 font-semibold leading-5 tracking-[0.01em]",
|
|
60944
|
+
children: "Layout"
|
|
60945
|
+
}), /* @__PURE__ */ P("div", {
|
|
60946
|
+
className: "flex items-center gap-1",
|
|
60947
|
+
children: [{
|
|
60948
|
+
value: "row",
|
|
60949
|
+
label: "Row"
|
|
60950
|
+
}, {
|
|
60951
|
+
value: "column",
|
|
60952
|
+
label: "Column"
|
|
60953
|
+
}].map((e) => /* @__PURE__ */ P("button", {
|
|
60954
|
+
onClick: () => Y("flexDirection", e.value),
|
|
60955
|
+
className: `h-6 px-2.5 rounded text-[10px] font-bold transition border ${(Q.flexDirection || "row") === e.value ? "bg-indigo-600 border-indigo-500 text-white" : "bg-slate-900 border-slate-700 text-slate-400 hover:text-white"}`,
|
|
60956
|
+
children: e.label
|
|
60957
|
+
}, e.value))
|
|
60958
|
+
})]
|
|
60959
|
+
}),
|
|
60940
60960
|
/* @__PURE__ */ F("div", {
|
|
60941
60961
|
className: "flex items-center justify-between py-3 border-b border-slate-800/10 last:border-b-0",
|
|
60942
60962
|
children: [/* @__PURE__ */ P("span", {
|
package/package.json
CHANGED