@charisol/plexo-sdk 1.4.36 → 1.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{compiler-BOsCUhY-.js → compiler-BvseEhDC.js} +66 -66
- package/dist/compiler.js +2 -2
- package/dist/index.js +28 -23
- package/dist/{mjmlBrowser-zNNbjrDQ.js → mjmlBrowser-DbrDHUyU.js} +1 -1
- package/dist/sanitize.js +1 -1
- package/dist/{sanitizeCompiledHtml-D3k1f2jT.js → sanitizeCompiledHtml-DNV2nhH2.js} +1 -1
- package/dist/utilities/compiler.d.ts +1 -0
- package/package.json +1 -1
|
@@ -484,24 +484,24 @@ var P = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
484
484
|
"height"
|
|
485
485
|
].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
|
|
486
486
|
}).join(" "), F = (e = {}) => P(e).replace(/;(\s|$)/g, " !important;$1");
|
|
487
|
-
function
|
|
487
|
+
function te(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 I(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)) te(a[e]) && delete a[e];
|
|
498
498
|
if (Object.keys(a).length === 0) return;
|
|
499
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 L(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,16 +509,16 @@ function R(e, t) {
|
|
|
509
509
|
justifyContent: n
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function R(e, t, n, r) {
|
|
513
513
|
if (!r || r.textAlign === void 0 || t.type !== "button" && t.type !== "icon") return;
|
|
514
514
|
let i = `${t.id}-align`;
|
|
515
515
|
if (t.type === "button") {
|
|
516
|
-
|
|
516
|
+
I(e, i, void 0, n, { textAlign: r.textAlign });
|
|
517
517
|
return;
|
|
518
518
|
}
|
|
519
|
-
|
|
519
|
+
I(e, i, void 0, n, { justifyContent: r.textAlign === "right" ? "flex-end" : r.textAlign === "left" ? "flex-start" : "center" });
|
|
520
520
|
}
|
|
521
|
-
var
|
|
521
|
+
var z = () => ({
|
|
522
522
|
backgroundColor: "#ffffff",
|
|
523
523
|
borderRadius: "20px",
|
|
524
524
|
width: "100%",
|
|
@@ -541,11 +541,11 @@ var B = () => ({
|
|
|
541
541
|
buttonPaddingRight: "14px",
|
|
542
542
|
buttonFontSize: "13px",
|
|
543
543
|
buttonFontWeight: "700"
|
|
544
|
-
}),
|
|
544
|
+
}), B = (e) => (e || "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), V = (e, t) => {
|
|
545
545
|
if (typeof t != "string") return "";
|
|
546
546
|
let n = t.trim();
|
|
547
|
-
return n ? ` ${e}="${
|
|
548
|
-
}, U = [
|
|
547
|
+
return n ? ` ${e}="${B(n)}"` : "";
|
|
548
|
+
}, H = "_hp_field", U = [
|
|
549
549
|
"fieldSpacing",
|
|
550
550
|
"buttonBackgroundColor",
|
|
551
551
|
"buttonTextColor",
|
|
@@ -566,7 +566,7 @@ var B = () => ({
|
|
|
566
566
|
"buttonHeight",
|
|
567
567
|
"buttonAlign"
|
|
568
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
|
|
569
|
+
function ne(e) {
|
|
570
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>`;
|
|
571
571
|
switch (e) {
|
|
572
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>`;
|
|
@@ -592,9 +592,9 @@ function te(e) {
|
|
|
592
592
|
default: return "";
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
var
|
|
595
|
+
var re = (e) => {
|
|
596
596
|
if (!e || typeof e != "object") return "";
|
|
597
|
-
let t = e.kind || "text", n =
|
|
597
|
+
let t = e.kind || "text", n = B(e.name || e.id || "field"), r = e.required ? " required" : "", i = P({
|
|
598
598
|
fontSize: e.fontSize || "13px",
|
|
599
599
|
borderRadius: e.borderRadius || "12px",
|
|
600
600
|
borderWidth: e.borderWidth || "1px",
|
|
@@ -602,14 +602,14 @@ var ne = (e) => {
|
|
|
602
602
|
borderStyle: "solid",
|
|
603
603
|
color: e.inputTextColor
|
|
604
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>`;
|
|
605
|
-
return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${
|
|
605
|
+
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 : [{
|
|
606
606
|
label: e.label || "Option",
|
|
607
607
|
value: e.name || "option"
|
|
608
|
-
}]).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="${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} />`;
|
|
609
609
|
};
|
|
610
|
-
function
|
|
610
|
+
function ie(e, t, n) {
|
|
611
611
|
if (e === "none") return "";
|
|
612
|
-
let r =
|
|
612
|
+
let r = B(t);
|
|
613
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>`;
|
|
614
614
|
}
|
|
615
615
|
function X(e, t, n, r, i = []) {
|
|
@@ -641,19 +641,19 @@ function X(e, t, n, r, i = []) {
|
|
|
641
641
|
color: t.contentTextColor || "#475569",
|
|
642
642
|
fontSize: t.contentFontSize || "13px",
|
|
643
643
|
whiteSpace: "pre-wrap"
|
|
644
|
-
}), p =
|
|
645
|
-
return `<div class="plexo-acc-item" style="${l}"><button type="button"${` data-plexo-acc-item="${
|
|
644
|
+
}), p = ie(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>` : "";
|
|
645
|
+
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>`;
|
|
646
646
|
}).join("");
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function ae(e) {
|
|
649
649
|
return `<!-- Unsupported block ${String(e)} -->`;
|
|
650
650
|
}
|
|
651
|
-
var
|
|
651
|
+
var oe = (g, _ = !1) => {
|
|
652
652
|
if (!g || typeof g != "object") return "";
|
|
653
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
|
-
...
|
|
654
|
+
...z(),
|
|
655
655
|
...v
|
|
656
|
-
} : x), C = g.attributes || {}, w = ` data-plexo-id="${
|
|
656
|
+
} : 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; " : ""}`;
|
|
657
657
|
switch (g.type) {
|
|
658
658
|
case "heading": return D(`<h2${w} style="margin-top: 0; margin-bottom: 8px; ${O}${S}">${C.text || "Heading"}</h2>`);
|
|
659
659
|
case "paragraph": return D(`<p${w} style="margin-top: 0; margin-bottom: 12px; ${O}${S}">${C.text || "Paragraph text content."}</p>`);
|
|
@@ -664,7 +664,7 @@ var ae = (g, _ = !1) => {
|
|
|
664
664
|
width: e.width,
|
|
665
665
|
height: e.height
|
|
666
666
|
});
|
|
667
|
-
return `<div data-plexo-id="${
|
|
667
|
+
return `<div data-plexo-id="${B(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>`;
|
|
668
668
|
}
|
|
669
669
|
case "image": {
|
|
670
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({
|
|
@@ -682,19 +682,19 @@ var ae = (g, _ = !1) => {
|
|
|
682
682
|
</div>`;
|
|
683
683
|
case "form_container": {
|
|
684
684
|
if (C.provider === "maildrip" && typeof C.maildripPageId == "string" && C.maildripPageId.trim()) {
|
|
685
|
-
let e =
|
|
685
|
+
let e = B(C.maildripPageId.trim());
|
|
686
686
|
return `<div${w} style="${P({
|
|
687
687
|
...v,
|
|
688
688
|
height: p(g)
|
|
689
689
|
})}"><opt-in-embed-form page-id="${e}"></opt-in-embed-form></div>`;
|
|
690
690
|
}
|
|
691
691
|
let n = {
|
|
692
|
-
...
|
|
692
|
+
...z(),
|
|
693
693
|
...v
|
|
694
694
|
}, r = {};
|
|
695
695
|
for (let e of Object.keys(n)) U.includes(e) || (r[e] = n[e]);
|
|
696
696
|
r.height = p(g);
|
|
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};">${
|
|
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};">${re(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({
|
|
698
698
|
backgroundColor: n.buttonBackgroundColor,
|
|
699
699
|
color: n.buttonTextColor,
|
|
700
700
|
borderRadius: n.buttonBorderRadius,
|
|
@@ -710,15 +710,15 @@ var ae = (g, _ = !1) => {
|
|
|
710
710
|
fontWeight: n.buttonFontWeight,
|
|
711
711
|
width: c,
|
|
712
712
|
height: d
|
|
713
|
-
});
|
|
714
|
-
return `<form${w} action="${
|
|
713
|
+
}), m = B(C.actionUrl || C.action || "#"), h = B(C.method || "POST"), _ = C.submitLabel || "Submit";
|
|
714
|
+
return `<form${w} action="${m}" method="${h}" style="${i}">${s}${`<div style="opacity: 0; height: 0; width: 0; overflow: hidden;"><label>Leave this field blank</label><input type="text" name="${H}" tabindex="-1" autocomplete="off" /></div>`}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${_}</button></div></form>`;
|
|
715
715
|
}
|
|
716
716
|
case "input": {
|
|
717
|
-
let e = C.inputType || C.type || "text", t =
|
|
718
|
-
return `<input${w} type="${
|
|
717
|
+
let e = C.inputType || C.type || "text", t = B(C.name || C.fieldName || "field"), n = B(C.placeholder || ""), r = C.required ? " required" : "";
|
|
718
|
+
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} />`;
|
|
719
719
|
}
|
|
720
|
-
case "textarea": return `<textarea${w} name="${
|
|
721
|
-
case "select": return `<select${w} name="${
|
|
720
|
+
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>`;
|
|
721
|
+
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>`;
|
|
722
722
|
case "html": return `<div${w} style="${P({
|
|
723
723
|
...v,
|
|
724
724
|
height: s(g, "auto")
|
|
@@ -732,7 +732,7 @@ var ae = (g, _ = !1) => {
|
|
|
732
732
|
case "blog_comments":
|
|
733
733
|
case "blog_post_list": {
|
|
734
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"${
|
|
735
|
+
return `<div${w} data-plexo-blog-${e}="true"${V("data-plexo-blog-prefix", C.prefix)} style="${t}"></div>`;
|
|
736
736
|
}
|
|
737
737
|
case "product":
|
|
738
738
|
case "booking":
|
|
@@ -742,7 +742,7 @@ var ae = (g, _ = !1) => {
|
|
|
742
742
|
case "order_confirmation":
|
|
743
743
|
case "order_tracking": {
|
|
744
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"${
|
|
745
|
+
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%;">${ne(g.type)}</div>` : ""}</div>`;
|
|
746
746
|
}
|
|
747
747
|
case "social": {
|
|
748
748
|
let e = r(g), t = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
|
|
@@ -766,7 +766,7 @@ var ae = (g, _ = !1) => {
|
|
|
766
766
|
justifyContent: "center",
|
|
767
767
|
overflow: "hidden"
|
|
768
768
|
});
|
|
769
|
-
return `<a href="${
|
|
769
|
+
return `<a href="${B(e.url)}" style="${t} text-decoration: none;">${f(e.provider, e.color)}</a>`;
|
|
770
770
|
}).join("")}</div>`;
|
|
771
771
|
}
|
|
772
772
|
case "menu": {
|
|
@@ -777,7 +777,7 @@ var ae = (g, _ = !1) => {
|
|
|
777
777
|
flexWrap: "wrap",
|
|
778
778
|
gap: "16px",
|
|
779
779
|
justifyContent: t
|
|
780
|
-
})}">${e.map((e) => `<a href="${
|
|
780
|
+
})}">${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>`;
|
|
781
781
|
}
|
|
782
782
|
case "icon": {
|
|
783
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({
|
|
@@ -785,8 +785,8 @@ var ae = (g, _ = !1) => {
|
|
|
785
785
|
margin: v.margin,
|
|
786
786
|
display: "flex",
|
|
787
787
|
justifyContent: i
|
|
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="${
|
|
789
|
-
return `<div data-plexo-id="${
|
|
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="${B(o)}" target="${C.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${w}>${s}</span>`;
|
|
789
|
+
return `<div data-plexo-id="${B(String(g.id))}-align" style="${a}">${c}</div>`;
|
|
790
790
|
}
|
|
791
791
|
case "table": {
|
|
792
792
|
let e = d(g), t = `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
|
|
@@ -801,7 +801,7 @@ var ae = (g, _ = !1) => {
|
|
|
801
801
|
lineHeight: v.contentLineHeight,
|
|
802
802
|
letterSpacing: v.contentLetterSpacing,
|
|
803
803
|
fontWeight: a ? "700" : void 0
|
|
804
|
-
}), u = ` data-plexo-cell="${
|
|
804
|
+
}), u = ` data-plexo-cell="${B(g.id)}|${i}-${n}"`;
|
|
805
805
|
return `<${o}${u} style="${r}">${e || " "}</${o}>`;
|
|
806
806
|
}).join("")}</tr>`;
|
|
807
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({
|
|
@@ -821,7 +821,7 @@ var ae = (g, _ = !1) => {
|
|
|
821
821
|
margin: v.margin,
|
|
822
822
|
borderRadius: v.borderRadius,
|
|
823
823
|
overflow: "hidden"
|
|
824
|
-
})}"><a href="${
|
|
824
|
+
})}"><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>`;
|
|
825
825
|
}
|
|
826
826
|
case "timer": {
|
|
827
827
|
let e = C.showLabels !== !1, t = P({
|
|
@@ -838,7 +838,7 @@ var ae = (g, _ = !1) => {
|
|
|
838
838
|
borderRadius: v.borderRadius || "8px",
|
|
839
839
|
padding: v.padding || "16px",
|
|
840
840
|
textAlign: "center"
|
|
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 =
|
|
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 = 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>`;
|
|
842
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>`;
|
|
843
843
|
}
|
|
844
844
|
case "carousel": {
|
|
@@ -854,7 +854,7 @@ var ae = (g, _ = !1) => {
|
|
|
854
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>`;
|
|
855
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) => {
|
|
856
856
|
let o = i[r] * 5, s = e.length > 1 ? ` animation: ${t}-fade ${a}s ease-in-out infinite; animation-delay: ${o}s;` : "";
|
|
857
|
-
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="${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>`;
|
|
858
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) => {
|
|
859
859
|
let r = i[n] * 5;
|
|
860
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>`;
|
|
@@ -875,7 +875,7 @@ var ae = (g, _ = !1) => {
|
|
|
875
875
|
animated: a
|
|
876
876
|
}, 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>`;
|
|
877
877
|
}
|
|
878
|
-
default: return
|
|
878
|
+
default: return ae(g.type);
|
|
879
879
|
}
|
|
880
880
|
}, Z = (e, t, n) => {
|
|
881
881
|
if (!e || typeof e != "object") return "";
|
|
@@ -883,15 +883,15 @@ var ae = (g, _ = !1) => {
|
|
|
883
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. -->`;
|
|
884
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 || {} };
|
|
885
885
|
delete u.columnGap;
|
|
886
|
-
let d = P(u), f =
|
|
887
|
-
|
|
886
|
+
let d = P(u), f = V("id", r.htmlId), p = V("class", r.htmlClass), m = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
887
|
+
I(t, m, r.style, "tablet", r.styleTablet), I(t, m, r.style, "mobile", r.styleMobile), (o || l) && t.mobile.push(`[data-plexo-id="${m}"] > .plexo-col { margin-bottom: 0; }`);
|
|
888
888
|
let h = `\n <!-- ROW START: ${r.id || "row"} -->`, _ = o ? `gap: ${a}; margin-left: 0; margin-right: 0;` : "margin-left: -8px; margin-right: -8px;";
|
|
889
889
|
h += `\n <div data-plexo-id="${m}"${f}${p} class="plexo-row" style="display: flex; flex-wrap: wrap; ${_} ${d}">`;
|
|
890
890
|
let v = Array.isArray(r.columns) ? r.columns : [], y = o && v.length > 1 ? `(${a} * ${v.length - 1} / ${v.length})` : "";
|
|
891
891
|
for (let e of v) {
|
|
892
892
|
if (!e) continue;
|
|
893
|
-
let r = e.styles || e.style || {}, i = P(r), a = r.gap || "16px", s =
|
|
894
|
-
|
|
893
|
+
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)}`;
|
|
894
|
+
I(t, l, r, "tablet", e.stylesTablet), I(t, l, r, "mobile", e.stylesMobile);
|
|
895
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;";
|
|
896
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}">`;
|
|
897
897
|
let b = new Map(u.map((e) => [e.id, e])), x = new Map(d.map((e) => [e.id, e])), S = g({
|
|
@@ -902,8 +902,8 @@ var ae = (g, _ = !1) => {
|
|
|
902
902
|
for (let e of S) {
|
|
903
903
|
let r = b.get(e);
|
|
904
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 =
|
|
906
|
-
|
|
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 = V("id", i.htmlId), c = V("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
|
+
I(t, r.id, r.style, "tablet", L(r, r.styleTablet)), I(t, r.id, r.style, "mobile", L(r, r.styleMobile)), R(t, r, "tablet", r.styleTablet), R(t, r, "mobile", r.styleMobile), h += `\n <div${s}${c} style="${f}">`, h += `\n ${oe(r, n)}`, h += "\n </div>";
|
|
907
907
|
continue;
|
|
908
908
|
}
|
|
909
909
|
let i = x.get(e);
|
|
@@ -913,7 +913,7 @@ var ae = (g, _ = !1) => {
|
|
|
913
913
|
}
|
|
914
914
|
return h += "\n </div>", h;
|
|
915
915
|
};
|
|
916
|
-
function
|
|
916
|
+
function se(e) {
|
|
917
917
|
let t = /* @__PURE__ */ new Set(), n = 0, r = (e) => {
|
|
918
918
|
let r;
|
|
919
919
|
do
|
|
@@ -980,7 +980,7 @@ var Q = (e, t) => {
|
|
|
980
980
|
"ogImageUrl"
|
|
981
981
|
], s = {};
|
|
982
982
|
for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
|
|
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 =
|
|
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 = 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 = se(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 = {
|
|
984
984
|
tablet: [],
|
|
985
985
|
mobile: []
|
|
986
986
|
}, S = "";
|
|
@@ -989,17 +989,17 @@ var Q = (e, t) => {
|
|
|
989
989
|
<html>
|
|
990
990
|
<head>
|
|
991
991
|
<meta charset="utf-8">
|
|
992
|
-
<title>${
|
|
993
|
-
${h ? `<meta name="description" content="${
|
|
994
|
-
${m ? `<link rel="icon" href="${
|
|
992
|
+
<title>${B(l)}</title>
|
|
993
|
+
${h ? `<meta name="description" content="${B(h)}">` : ""}
|
|
994
|
+
${m ? `<link rel="icon" href="${B(m)}">` : ""}
|
|
995
995
|
<meta property="og:type" content="website">
|
|
996
|
-
<meta property="og:title" content="${
|
|
997
|
-
${h ? `<meta property="og:description" content="${
|
|
998
|
-
${g ? `<meta property="og:image" content="${
|
|
996
|
+
<meta property="og:title" content="${B(l)}">
|
|
997
|
+
${h ? `<meta property="og:description" content="${B(h)}">` : ""}
|
|
998
|
+
${g ? `<meta property="og:image" content="${B(g)}">` : ""}
|
|
999
999
|
<meta name="twitter:card" content="${g ? "summary_large_image" : "summary"}">
|
|
1000
|
-
<meta name="twitter:title" content="${
|
|
1001
|
-
${h ? `<meta name="twitter:description" content="${
|
|
1002
|
-
${g ? `<meta name="twitter:image" content="${
|
|
1000
|
+
<meta name="twitter:title" content="${B(l)}">
|
|
1001
|
+
${h ? `<meta name="twitter:description" content="${B(h)}">` : ""}
|
|
1002
|
+
${g ? `<meta name="twitter:image" content="${B(g)}">` : ""}
|
|
1003
1003
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1004
1004
|
${b ? `<link rel="stylesheet" href="${b}">` : ""}
|
|
1005
1005
|
${S.includes("<opt-in-embed-form") ? `<script type="module" src="${_}"><\/script>` : ""}
|
|
@@ -1067,14 +1067,14 @@ ${p ? ` <script>\n${p}\n <\/script>` : ""}
|
|
|
1067
1067
|
function $(e) {
|
|
1068
1068
|
return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function ce(e) {
|
|
1071
1071
|
return $(Q(e));
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function le(e) {
|
|
1074
1074
|
return Q(e);
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function ue(e) {
|
|
1077
1077
|
return e;
|
|
1078
1078
|
}
|
|
1079
1079
|
//#endregion
|
|
1080
|
-
export {
|
|
1080
|
+
export { Q as a, j as c, $ as d, ue as f, I as i, z as l, H as n, le as o, k as p, U as r, ce as s, A as t, F as u };
|
package/dist/compiler.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, d as n,
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./compiler-BvseEhDC.js";
|
|
2
|
+
export { u as DEFAULT_BODY_FONT_FAMILY, o as FORM_HONEYPOT_FIELD_NAME, c as FORM_NON_CSS_STYLE_KEYS, i as collectResponsiveRule, e as compileToHTML, s as compileToHTMLWithStrataAuto, l as compileToPlainText, t as convertSectionRowToPlexoRow, a as getFormDefaultStyle, d as getInlineStylesImportant, n as htmlToPlainText, r as injectStrataBundle };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as e, n as t, o as n, r, s as i, t as a } from "./sanitizeCompiledHtml-
|
|
1
|
+
import { i as e, n as t, o as n, r, s as i, t as a } from "./sanitizeCompiledHtml-DNV2nhH2.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,
|
|
3
|
+
import { a as x, d as S, f as C, o as ee, p as te, s as w } from "./compiler-BvseEhDC.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";
|
|
@@ -1889,13 +1889,13 @@ var Ct = ({ disabled: e }) => {
|
|
|
1889
1889
|
//#region src/components/editor/frame/useCompiledCanvasHtml.ts
|
|
1890
1890
|
async function Tt(e, t) {
|
|
1891
1891
|
if (t === "landing_page") return {
|
|
1892
|
-
html: r(
|
|
1892
|
+
html: r(x(e, { canvasEditorPadding: !0 })),
|
|
1893
1893
|
error: null
|
|
1894
1894
|
};
|
|
1895
1895
|
let n = ne(e, "email", {
|
|
1896
1896
|
instrument: !0,
|
|
1897
1897
|
canvasEditorPadding: !0
|
|
1898
|
-
}), { compileMjmlInBrowser: i } = await import("./mjmlBrowser-
|
|
1898
|
+
}), { compileMjmlInBrowser: i } = await import("./mjmlBrowser-DbrDHUyU.js"), { html: a, errors: o } = i(n, { validationLevel: "soft" });
|
|
1899
1899
|
return {
|
|
1900
1900
|
html: a,
|
|
1901
1901
|
error: o.length > 0 ? o.map((e) => e.message ?? e.formattedMessage ?? "Unknown MJML error").join("; ") : null
|
|
@@ -7235,7 +7235,7 @@ var Eu = ({ html: e, className: t, style: n, tag: r = "div", dataPlexoId: i }) =
|
|
|
7235
7235
|
typeof e == "string" && (n = uu(e));
|
|
7236
7236
|
let i = lu(n), a = Su.safeParse(i);
|
|
7237
7237
|
if (!a.success) return console.error("PlexoRenderer schema validation failed:", a.error), null;
|
|
7238
|
-
let o = a.data, s =
|
|
7238
|
+
let o = a.data, s = x(o);
|
|
7239
7239
|
return r(t ? s.replace("</head>", `<style>${t}</style></head>`) : s);
|
|
7240
7240
|
} catch (e) {
|
|
7241
7241
|
return console.error("PlexoRenderer validation error:", e), null;
|
|
@@ -55864,7 +55864,7 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
55864
55864
|
});
|
|
55865
55865
|
}, jG = (e, t) => {
|
|
55866
55866
|
let n = t === "tablet" ? "tablet" : t === "mobile" ? "mobile" : null, r = n === "tablet" ? e.styleTablet : n === "mobile" ? e.styleMobile : void 0;
|
|
55867
|
-
return
|
|
55867
|
+
return te(e.style, r, n);
|
|
55868
55868
|
}, MG = ({ row: e, selectedRowId: t, selectRow: n, previewMode: r, children: i, deviceView: a, selectedElementId: o }) => {
|
|
55869
55869
|
let { attributes: s, listeners: c, setNodeRef: l, transform: u, transition: d, isDragging: f, isOver: p } = ye({
|
|
55870
55870
|
id: e.id,
|
|
@@ -55962,7 +55962,7 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
55962
55962
|
parentColId: r
|
|
55963
55963
|
},
|
|
55964
55964
|
disabled: o
|
|
55965
|
-
}), d = i === e.id, f = y(e), p = c === "tablet" ? "tablet" : c === "mobile" ? "mobile" : null, m = p === "tablet" ? e.stylesTablet : p === "mobile" ? e.stylesMobile : void 0, h =
|
|
55965
|
+
}), d = i === e.id, f = y(e), p = c === "tablet" ? "tablet" : c === "mobile" ? "mobile" : null, m = p === "tablet" ? e.stylesTablet : p === "mobile" ? e.stylesMobile : void 0, h = te(e.styles, m, p), g = h.display, _ = g === "flex" || g === "block" || g === "inline-flex", v = _ ? "h-full" : "flex flex-col h-full", b = _ ? {
|
|
55966
55966
|
display: g,
|
|
55967
55967
|
flexDirection: h.flexDirection,
|
|
55968
55968
|
flexWrap: h.flexWrap,
|
|
@@ -56358,7 +56358,7 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
56358
56358
|
]
|
|
56359
56359
|
})]
|
|
56360
56360
|
});
|
|
56361
|
-
}, RG = ({ elem: e, columnId: t, rowId: n, selectedElementId: r, selectElement: i, deviceView: a, transientStyle: o, transientAttr: l, updateElement: y, onTransientStyleChange: b, onTransientAttrChange: x, clearTransientOverrides: S, duplicateElement:
|
|
56361
|
+
}, RG = ({ elem: e, columnId: t, rowId: n, selectedElementId: r, selectElement: i, deviceView: a, transientStyle: o, transientAttr: l, updateElement: y, onTransientStyleChange: b, onTransientAttrChange: x, clearTransientOverrides: S, duplicateElement: C, deleteElement: ee, previewMode: w, useAi: ne, aiTier: E, apiKey: re, externalUserId: ie, templateKind: ae, onRequestComment: se, ICONS: O, getFormFields: ce, getDefaultStyle: le, isElementHiddenForView: ue, renderSocialIcon: de, onNotify: fe, textColor: pe = "#e2e8f0", backgroundColor: me = "#0e1526", customCss: j = "", mergeTags: he = [], themeBgColor: M = "#273df2" }) => {
|
|
56362
56362
|
let { attributes: ge, listeners: N, setNodeRef: _e, transform: ve, transition: be, isDragging: Se, isOver: Ce } = ye({
|
|
56363
56363
|
id: e.id,
|
|
56364
56364
|
data: {
|
|
@@ -56433,7 +56433,7 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
56433
56433
|
return () => clearTimeout(e);
|
|
56434
56434
|
}, [I.status]);
|
|
56435
56435
|
let et = a === "tablet" ? "tablet" : a === "mobile" ? "mobile" : null, tt = et === "tablet" ? e.styleTablet : et === "mobile" ? e.styleMobile : void 0, V = {
|
|
56436
|
-
...
|
|
56436
|
+
...te(e.style, tt, et),
|
|
56437
56437
|
...o || {}
|
|
56438
56438
|
}, H = {
|
|
56439
56439
|
...e.attributes,
|
|
@@ -56919,14 +56919,14 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
56919
56919
|
})
|
|
56920
56920
|
}),
|
|
56921
56921
|
/* @__PURE__ */ P("button", {
|
|
56922
|
-
onClick: () =>
|
|
56922
|
+
onClick: () => C(e.id),
|
|
56923
56923
|
className: "p-1.5 text-slate-400 hover:text-white rounded hover:bg-slate-900 transition flex items-center justify-center",
|
|
56924
56924
|
title: "Duplicate",
|
|
56925
56925
|
children: O.copy
|
|
56926
56926
|
}),
|
|
56927
56927
|
/* @__PURE__ */ P("button", {
|
|
56928
56928
|
onClick: () => {
|
|
56929
|
-
|
|
56929
|
+
ee(e.id), i(null);
|
|
56930
56930
|
},
|
|
56931
56931
|
className: "p-1.5 text-slate-400 hover:text-rose-500 rounded hover:bg-slate-900 transition flex items-center justify-center",
|
|
56932
56932
|
title: "Delete",
|
|
@@ -58645,7 +58645,7 @@ var BG = ({ label: e, value: t, unit: n = "px", units: r, min: i = 0, max: a = 5
|
|
|
58645
58645
|
}
|
|
58646
58646
|
return {
|
|
58647
58647
|
json: n,
|
|
58648
|
-
html:
|
|
58648
|
+
html: x(r)
|
|
58649
58649
|
};
|
|
58650
58650
|
}, [
|
|
58651
58651
|
e,
|
|
@@ -58985,7 +58985,7 @@ var gK = (e) => ({ body: {
|
|
|
58985
58985
|
}, o.onerror = () => i(e), o.src = a.target?.result;
|
|
58986
58986
|
}, a.onerror = () => i(e), a.readAsDataURL(e);
|
|
58987
58987
|
}), xK = ie((e, t) => {
|
|
58988
|
-
let { showSaveButton: n = !1, mode: r, apiKey: i, backgroundColor: a = "#0e1526", themeBgColor: o = "#4f46e5", themeFgColor: c = "#ffffff", textColor: l = "#e2e8f0", builderFontFamily: u = "'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif", initialTemplate: d, initialHtml: f, initialCss: p, initialJs: m, onSave: h, useAi: _, aiProvider: v, aiTier: b, externalUserId:
|
|
58988
|
+
let { showSaveButton: n = !1, mode: r, apiKey: i, backgroundColor: a = "#0e1526", themeBgColor: o = "#4f46e5", themeFgColor: c = "#ffffff", textColor: l = "#e2e8f0", builderFontFamily: u = "'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif", initialTemplate: d, initialHtml: f, initialCss: p, initialJs: m, onSave: h, useAi: _, aiProvider: v, aiTier: b, externalUserId: C, onUpload: ee, customUpload: ne, disableImageUpload: T = !1, autoSave: E = !1, autoSaveDuration: re = 3e3, unsplashKey: ie, pexelsKey: oe, pixabayKey: de, allowPublishLandingPage: fe = !1, templateId: pe, headerLeftContent: me, headerRightContent: j, mergeTags: he, isBlogLayout: M = !1, commerceEnabled: ge = !1, readOnly: _e = !1, commentMode: ve = !1, onRequestComment: ye, canvasFidelity: be, onCreateMaildripOptInPage: xe, maildripConnected: Se = !1, onMaildripAuth: Ce } = e, we = e.__internalPlan, Ee = hd(i, we), Oe = ud(Ee.plan), I = e.themeBgColor === void 0 ? Ee.branding?.brandColor ?? o : o, Ne = k(null), { template: Pe, selectedElementId: Fe, selectedRowId: L, selectedColumnId: R, past: Ie, future: Le, selectElement: z, selectRow: Re, selectColumn: ze, undo: Be, redo: Ve, hydrateTemplate: He, addRow: Ue, moveRow: We, addElement: B, moveElement: Ge, updateElement: Ke, deleteElement: qe, duplicateElement: Je, deleteRow: Ye, duplicateRow: Xe, updateRowStyle: Ze, updateRowAttrs: Qe, updateColumnStyle: $e, updateColumnAttrs: et, updateTemplateBodyStyle: tt, updateRowColumns: V, updateColumnWidth: nt, addColumnToRow: rt, deleteColumnFromRow: it, duplicateColumn: at, moveColumn: ut, addUploadedImage: dt, addNestedRowToColumn: ft, nestRowInColumn: pt, moveNestedRowToTopLevel: mt, moveNestedRowBetweenColumns: ht } = Zt(), [gt, _t] = A(null), vt = Pe?.body?.publishConfig?.apiKeyOverride ?? "", yt = () => vt.trim() || i, bt = (e) => typeof window < "u" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") && window.location.port !== "3000" ? `http://localhost:3000${e}` : e, xt = (e, t) => {
|
|
58989
58989
|
_t(t), mn(e), z(null), Re(null), ze(null);
|
|
58990
58990
|
}, St = {
|
|
58991
58991
|
useAi: Pe.body.aiConfig?.useAi ?? _,
|
|
@@ -59050,7 +59050,7 @@ var gK = (e) => ({ body: {
|
|
|
59050
59050
|
templateKind: Ot,
|
|
59051
59051
|
isBlogLayout: M,
|
|
59052
59052
|
tier: St.tier,
|
|
59053
|
-
externalUserId:
|
|
59053
|
+
externalUserId: C,
|
|
59054
59054
|
onApply: (e) => {
|
|
59055
59055
|
let t = Su.safeParse(e);
|
|
59056
59056
|
if (!t.success) throw Error("The AI returned a layout that could not be applied. Please try again.");
|
|
@@ -59138,7 +59138,12 @@ var gK = (e) => ({ body: {
|
|
|
59138
59138
|
getJson: cr,
|
|
59139
59139
|
getNodeRect: fr,
|
|
59140
59140
|
getCanvasContainerRect: pr
|
|
59141
|
-
}), [
|
|
59141
|
+
}), [
|
|
59142
|
+
lr,
|
|
59143
|
+
cr,
|
|
59144
|
+
fr,
|
|
59145
|
+
pr
|
|
59146
|
+
]), D(() => {
|
|
59142
59147
|
if (!E || !h) return;
|
|
59143
59148
|
let e = re ?? 3e3;
|
|
59144
59149
|
er.current === null && (er.current = JSON.stringify(Zt.getState().template));
|
|
@@ -59167,7 +59172,7 @@ var gK = (e) => ({ body: {
|
|
|
59167
59172
|
lr("email").then((t) => {
|
|
59168
59173
|
e || Yt({
|
|
59169
59174
|
html: t.html,
|
|
59170
|
-
text:
|
|
59175
|
+
text: S(t.html)
|
|
59171
59176
|
});
|
|
59172
59177
|
}).catch((t) => {
|
|
59173
59178
|
e || tn(t instanceof Error ? t.message : "Failed to compile email preview.");
|
|
@@ -59883,7 +59888,7 @@ var gK = (e) => ({ body: {
|
|
|
59883
59888
|
aiProvider: Ct,
|
|
59884
59889
|
aiTier: St.tier,
|
|
59885
59890
|
apiKey: yt(),
|
|
59886
|
-
externalUserId:
|
|
59891
|
+
externalUserId: C,
|
|
59887
59892
|
templateKind: Ot,
|
|
59888
59893
|
onRequestComment: ye,
|
|
59889
59894
|
ICONS: U,
|
|
@@ -59976,7 +59981,7 @@ var gK = (e) => ({ body: {
|
|
|
59976
59981
|
try {
|
|
59977
59982
|
let e = t;
|
|
59978
59983
|
t.type.startsWith("image/") && (Or(`Compressing "${n}"...`), e = await bK(t)), Or(`Uploading "${n}"...`);
|
|
59979
|
-
let r = "", i = ne ||
|
|
59984
|
+
let r = "", i = ne || ee;
|
|
59980
59985
|
if (i) {
|
|
59981
59986
|
let t = await i(e);
|
|
59982
59987
|
if (typeof t != "string" || !t.trim()) {
|
|
@@ -60124,13 +60129,13 @@ var gK = (e) => ({ body: {
|
|
|
60124
60129
|
attributes: cd(n)
|
|
60125
60130
|
}), z(r);
|
|
60126
60131
|
}, Q = ei ? {
|
|
60127
|
-
...
|
|
60132
|
+
...te(ei.style, Nr === "tablet" ? ei.styleTablet : ei.styleMobile, Nr),
|
|
60128
60133
|
...Pn || {}
|
|
60129
60134
|
} : ti ? {
|
|
60130
|
-
...
|
|
60135
|
+
...te(ti.style, Nr === "tablet" ? ti.styleTablet : ti.styleMobile, Nr),
|
|
60131
60136
|
...Pn || {}
|
|
60132
60137
|
} : ni ? {
|
|
60133
|
-
...
|
|
60138
|
+
...te(ni.styles, Nr === "tablet" ? ni.stylesTablet : ni.stylesMobile, Nr),
|
|
60134
60139
|
...Pn || {}
|
|
60135
60140
|
} : {}, fi = ei ? {
|
|
60136
60141
|
...ei.attributes,
|
|
@@ -60152,7 +60157,7 @@ var gK = (e) => ({ body: {
|
|
|
60152
60157
|
group: e.category,
|
|
60153
60158
|
disabled: e.width > cn,
|
|
60154
60159
|
disabledReason: e.width > cn ? "Requires a larger screen to preview" : void 0
|
|
60155
|
-
})), bi = on === "dark" ? K.body.style.darkBackground || "#0f172a" : K.body.style.background || K.body.style.backgroundColor || "#ffffff", xi =
|
|
60160
|
+
})), bi = on === "dark" ? K.body.style.darkBackground || "#0f172a" : K.body.style.background || K.body.style.backgroundColor || "#ffffff", xi = x(K), Si = w(K), Ci = r === "email" && Jt ? Jt.html : xi, wi = r === "email" && Jt ? Jt.text : Si, Ti = R ? ((e) => {
|
|
60156
60161
|
let t = (n) => {
|
|
60157
60162
|
for (let r of n) {
|
|
60158
60163
|
if (r.columns.some((t) => t.id === e)) return r;
|
|
@@ -61771,4 +61776,4 @@ var SK = ie((e, t) => {
|
|
|
61771
61776
|
});
|
|
61772
61777
|
SK.displayName = "PlexoBuilder";
|
|
61773
61778
|
//#endregion
|
|
61774
|
-
export { gu as ColumnJSONSchema, hu as ElementJSONSchema, SK as PlexoBuilder, Du as PlexoRenderer, _u as RowJSONSchema, a as SANITIZE_ALLOWED_ATTR, t as SANITIZE_ALLOWED_TAGS, Eu as SafeHTML, Su as TemplateJSONSchema, oK as applyTokensToElement,
|
|
61779
|
+
export { gu as ColumnJSONSchema, hu as ElementJSONSchema, SK as PlexoBuilder, Du as PlexoRenderer, _u as RowJSONSchema, a as SANITIZE_ALLOWED_ATTR, t as SANITIZE_ALLOWED_TAGS, Eu as SafeHTML, Su as TemplateJSONSchema, oK as applyTokensToElement, x as compileToHTML, ee as compileToHTMLWithStrataAuto, w as compileToPlainText, aK as createTokenMapping, uK as createTokenSwatch, cK as generateTokenCSS, sK as getTokensByCategory, C as injectStrataBundle, ne as parseJsonToTargetFormat, lK as resolveTokenValue, uu as safeJsonParse, r as sanitizeCompiledHtml, Tu as sanitizeHtml, lu as sanitizeObject, wu as sanitizeStyleObject, Cu as sanitizeStyleString };
|
package/dist/sanitize.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./sanitizeCompiledHtml-
|
|
1
|
+
import { n as e, r as t, t as n } from "./sanitizeCompiledHtml-DNV2nhH2.js";
|
|
2
2
|
export { n as ALLOWED_ATTR, e as ALLOWED_TAGS, t as sanitizeCompiledHtml };
|
|
@@ -5044,7 +5044,7 @@ function ir(e) {
|
|
|
5044
5044
|
}
|
|
5045
5045
|
return n.join("; ");
|
|
5046
5046
|
}
|
|
5047
|
-
var ar = /* @__PURE__ */ "html.head.body.title.meta.style.link.div.span.p.h1.h2.h3.h4.h5.h6.a.img.button.svg.path.table.thead.tbody.tr.th.td.hr.br.ul.ol.li.section.article.main.header.footer.aside.g.circle.rect.line.polyline.polygon.ellipse.defs.lineargradient.radialgradient.stop.clippath.use.text.tspan.form.input.textarea.select.option.label.script.opt-in-embed-form".split("."), or = /* @__PURE__ */ "href.src.alt.class.id.style.title.target.rel.width.height.align.valign.cellpadding.cellspacing.border.viewbox.fill.stroke.d.xmlns.charset.name.content.lang.action.method.type.placeholder.required.value.page-id.property.cx.cy.r.rx.ry.x1.y1.x2.y2.points.transform.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.opacity.stop-color.stop-opacity.offset.clip-path.gradientunits.preserveaspectratio.text-anchor.dominant-baseline.font-size.letter-spacing.data
|
|
5047
|
+
var ar = /* @__PURE__ */ "html.head.body.title.meta.style.link.div.span.p.h1.h2.h3.h4.h5.h6.a.img.button.svg.path.table.thead.tbody.tr.th.td.hr.br.ul.ol.li.section.article.main.header.footer.aside.g.circle.rect.line.polyline.polygon.ellipse.defs.lineargradient.radialgradient.stop.clippath.use.text.tspan.form.input.textarea.select.option.label.script.opt-in-embed-form".split("."), or = /* @__PURE__ */ "href.src.alt.class.id.style.title.target.rel.width.height.align.valign.cellpadding.cellspacing.border.viewbox.fill.stroke.d.xmlns.charset.name.content.lang.action.method.type.placeholder.required.value.page-id.property.cx.cy.r.rx.ry.x1.y1.x2.y2.points.transform.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.opacity.stop-color.stop-opacity.offset.clip-path.gradientunits.preserveaspectratio.text-anchor.dominant-baseline.font-size.letter-spacing.data-*.tabindex.autocomplete".split("."), sr = [
|
|
5048
5048
|
"javascript:",
|
|
5049
5049
|
"vbscript:",
|
|
5050
5050
|
"data:"
|
|
@@ -60,6 +60,7 @@ export declare const getFormDefaultStyle: () => {
|
|
|
60
60
|
buttonFontSize: string;
|
|
61
61
|
buttonFontWeight: string;
|
|
62
62
|
};
|
|
63
|
+
export declare const FORM_HONEYPOT_FIELD_NAME = "_hp_field";
|
|
63
64
|
export declare const FORM_NON_CSS_STYLE_KEYS: string[];
|
|
64
65
|
export declare const compileToHTML: (rawTemplate: TemplateJSON | any, opts?: {
|
|
65
66
|
canvasEditorPadding?: boolean;
|
package/package.json
CHANGED