@charisol/plexo-sdk 1.4.24 → 1.4.25
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-dVsQwify.js → compiler-C4Rkxl1E.js} +101 -100
- package/dist/compiler.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -614,51 +614,51 @@ function q(e) {
|
|
|
614
614
|
}
|
|
615
615
|
var J = (g) => {
|
|
616
616
|
if (!g || typeof g != "object") return "";
|
|
617
|
-
let
|
|
617
|
+
let _ = g.style || {}, v = g.type === "heading" || g.type === "paragraph" || g.type === "text", y = v ? c(g).autoWidth : !1, b = y ? Object.fromEntries(Object.entries(_).filter(([e]) => e !== "width")) : _, x = F(g.type === "form_container" ? {
|
|
618
618
|
...B(),
|
|
619
|
-
...
|
|
620
|
-
} :
|
|
619
|
+
..._
|
|
620
|
+
} : b), S = g.attributes || {}, C = ` data-plexo-id="${V(g.id)}"`, w = String(S.boxAlign || "left"), T = v && (y || !!_.width), E = (e) => T ? `<div style="text-align: ${w};">${e}</div>` : e, D = `${T ? "display: inline-block; " : ""}${v && _.height ? "overflow: hidden; " : ""}`;
|
|
621
621
|
switch (g.type) {
|
|
622
|
-
case "heading": return
|
|
623
|
-
case "paragraph": return
|
|
624
|
-
case "text": return
|
|
622
|
+
case "heading": return E(`<h2${C} style="margin-top: 0; margin-bottom: 8px; ${D}${x}">${S.text || "Heading"}</h2>`);
|
|
623
|
+
case "paragraph": return E(`<p${C} style="margin-top: 0; margin-bottom: 12px; ${D}${x}">${S.text || "Paragraph text content."}</p>`);
|
|
624
|
+
case "text": return E(`<div${C} style="${D}${x}">${S.text || ""}</div>`);
|
|
625
625
|
case "button": {
|
|
626
626
|
let e = u(g), t = F({
|
|
627
|
-
...
|
|
627
|
+
..._,
|
|
628
628
|
width: e.width,
|
|
629
629
|
height: e.height
|
|
630
630
|
});
|
|
631
|
-
return `<div style="text-align: ${
|
|
631
|
+
return `<div style="text-align: ${_.textAlign || "center"};"><a${C} href="${S.href || "#"}" target="${S.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${S.text || "Button"}</a></div>`;
|
|
632
632
|
}
|
|
633
633
|
case "image": {
|
|
634
|
-
let e = h(g), t =
|
|
635
|
-
...
|
|
634
|
+
let e = h(g), t = _.textAlign === "center" ? "margin: 0 auto; display: block;" : _.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = F({
|
|
635
|
+
..._,
|
|
636
636
|
width: e.width,
|
|
637
637
|
height: e.height
|
|
638
638
|
});
|
|
639
|
-
return `<img${
|
|
639
|
+
return `<img${C} src="${S.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${S.alt || ""}" style="${n} ${t}" />`;
|
|
640
640
|
}
|
|
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;">${
|
|
641
|
+
case "divider": return `<hr${C} style="border: 0; border-top: ${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#334155"}; ${x}" />`;
|
|
642
|
+
case "spacer": return `<div${C} style="height: ${_.height || "24px"};"></div>`;
|
|
643
|
+
case "card": return `<div${C} style="${x}">
|
|
644
|
+
<h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${S.title || "Card Title"}</h3>
|
|
645
|
+
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${S.description || "Card description."}</p>
|
|
646
646
|
</div>`;
|
|
647
647
|
case "form_container": {
|
|
648
|
-
if (
|
|
649
|
-
let e = V(
|
|
650
|
-
return `<div${
|
|
651
|
-
...
|
|
648
|
+
if (S.provider === "maildrip" && typeof S.maildripPageId == "string" && S.maildripPageId.trim()) {
|
|
649
|
+
let e = V(S.maildripPageId.trim());
|
|
650
|
+
return `<div${C} style="${F({
|
|
651
|
+
..._,
|
|
652
652
|
height: p(g)
|
|
653
|
-
})}"><
|
|
653
|
+
})}"><opt-in-embed-form page-id="${e}"></opt-in-embed-form></div>`;
|
|
654
654
|
}
|
|
655
655
|
let n = {
|
|
656
656
|
...B(),
|
|
657
|
-
...
|
|
657
|
+
..._
|
|
658
658
|
}, r = {};
|
|
659
659
|
for (let e of Object.keys(n)) U.includes(e) || (r[e] = n[e]);
|
|
660
660
|
r.height = p(g);
|
|
661
|
-
let i = F(r), a = l(t(Array.isArray(
|
|
661
|
+
let i = F(r), a = l(t(Array.isArray(S.fields) ? S.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${W(e)}</div>`).join(""), c = S.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = S.buttonAutoHeight === !1 && n.buttonHeight || "auto", f = F({
|
|
662
662
|
backgroundColor: n.buttonBackgroundColor,
|
|
663
663
|
color: n.buttonTextColor,
|
|
664
664
|
borderRadius: n.buttonBorderRadius,
|
|
@@ -675,18 +675,18 @@ var J = (g) => {
|
|
|
675
675
|
width: c,
|
|
676
676
|
height: d
|
|
677
677
|
});
|
|
678
|
-
return `<form${
|
|
678
|
+
return `<form${C} action="${V(S.actionUrl || S.action || "#")}" method="${V(S.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${S.submitLabel || "Submit"}</button></div></form>`;
|
|
679
679
|
}
|
|
680
680
|
case "input": {
|
|
681
|
-
let e =
|
|
682
|
-
return `<input${
|
|
681
|
+
let e = S.inputType || S.type || "text", t = V(S.name || S.fieldName || "field"), n = V(S.placeholder || ""), r = S.required ? " required" : "";
|
|
682
|
+
return `<input${C} type="${V(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${r} />`;
|
|
683
683
|
}
|
|
684
|
-
case "textarea": return `<textarea${
|
|
685
|
-
case "select": return `<select${
|
|
686
|
-
case "html": return `<div${
|
|
687
|
-
...
|
|
684
|
+
case "textarea": return `<textarea${C} name="${V(S.name || S.fieldName || "field")}" placeholder="${V(S.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}></textarea>`;
|
|
685
|
+
case "select": return `<select${C} name="${V(S.name || S.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${x}"${S.required ? " required" : ""}>${(Array.isArray(S.options) ? S.options : []).map((e) => `<option value="${V(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
686
|
+
case "html": return `<div${C} style="${F({
|
|
687
|
+
..._,
|
|
688
688
|
height: s(g, "auto")
|
|
689
|
-
})}">${
|
|
689
|
+
})}">${S.htmlContent || S.text || ""}</div>`;
|
|
690
690
|
case "blog_title":
|
|
691
691
|
case "blog_content":
|
|
692
692
|
case "blog_featured_image":
|
|
@@ -695,8 +695,8 @@ var J = (g) => {
|
|
|
695
695
|
case "blog_categories":
|
|
696
696
|
case "blog_comments":
|
|
697
697
|
case "blog_post_list": {
|
|
698
|
-
let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = F(
|
|
699
|
-
return `<div${
|
|
698
|
+
let e = g.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = F(_);
|
|
699
|
+
return `<div${C} data-plexo-blog-${e}="true"${H("data-plexo-blog-prefix", S.prefix)} style="${t}"></div>`;
|
|
700
700
|
}
|
|
701
701
|
case "product":
|
|
702
702
|
case "booking":
|
|
@@ -705,17 +705,17 @@ var J = (g) => {
|
|
|
705
705
|
case "checkout_flow":
|
|
706
706
|
case "order_confirmation":
|
|
707
707
|
case "order_tracking": {
|
|
708
|
-
let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = F(
|
|
709
|
-
return `<div${
|
|
708
|
+
let e = g.type.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = F(_);
|
|
709
|
+
return `<div${C} data-plexo-commerce-${e}="true"${H("data-plexo-product-id", S.productId)}${H("data-plexo-service-id", S.serviceId)}${H("data-plexo-commerce-mode", S.mode)}${S.storeMode === !1 ? " data-plexo-commerce-store-mode=\"false\"" : ""}${H("data-plexo-commerce-limit", S.limit)}${H("data-plexo-commerce-category", S.category)}${H("data-plexo-commerce-sort", S.sort)}${H("data-plexo-commerce-items-per-row", S.itemsPerRow)}${H("data-plexo-commerce-items-per-page", S.itemsPerPage)}${S.paginated ? " data-plexo-commerce-paginated=\"true\"" : ""} style="${t}"></div>`;
|
|
710
710
|
}
|
|
711
711
|
case "social": {
|
|
712
|
-
let e = r(g), t =
|
|
713
|
-
return `<div${
|
|
714
|
-
padding:
|
|
715
|
-
margin:
|
|
712
|
+
let e = r(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
|
|
713
|
+
return `<div${C} style="${F({
|
|
714
|
+
padding: _.padding,
|
|
715
|
+
margin: _.margin,
|
|
716
716
|
display: "flex",
|
|
717
717
|
flexWrap: "wrap",
|
|
718
|
-
gap:
|
|
718
|
+
gap: _.iconSpacing || "8px",
|
|
719
719
|
justifyContent: t
|
|
720
720
|
})}">${e.map((e) => {
|
|
721
721
|
let t = F({
|
|
@@ -734,36 +734,36 @@ var J = (g) => {
|
|
|
734
734
|
}).join("")}</div>`;
|
|
735
735
|
}
|
|
736
736
|
case "menu": {
|
|
737
|
-
let e = n(g), t =
|
|
738
|
-
return `<div${
|
|
739
|
-
...
|
|
737
|
+
let e = n(g), t = _.textAlign === "center" ? "center" : _.textAlign === "right" ? "flex-end" : "flex-start";
|
|
738
|
+
return `<div${C} style="${F({
|
|
739
|
+
..._,
|
|
740
740
|
display: "flex",
|
|
741
741
|
flexWrap: "wrap",
|
|
742
742
|
gap: "16px",
|
|
743
743
|
justifyContent: t
|
|
744
|
-
})}">${e.map((e) => `<a href="${V(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${
|
|
744
|
+
})}">${e.map((e) => `<a href="${V(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${_.fontWeight || 600};">${V(e.label)}</a>`).join("")}</div>`;
|
|
745
745
|
}
|
|
746
746
|
case "icon": {
|
|
747
|
-
let e =
|
|
748
|
-
padding:
|
|
749
|
-
margin:
|
|
747
|
+
let e = _.fontSize || `${S.iconSize || 48}px`, t = _.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(S.iconName, n, t), i = _.textAlign === "right" ? "flex-end" : _.textAlign === "left" ? "flex-start" : "center", a = F({
|
|
748
|
+
padding: _.padding,
|
|
749
|
+
margin: _.margin,
|
|
750
750
|
display: "flex",
|
|
751
751
|
justifyContent: i
|
|
752
|
-
}), o = typeof
|
|
753
|
-
return `<div style="${a}">${o ? `<a${
|
|
752
|
+
}), o = typeof S.href == "string" ? S.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
|
|
753
|
+
return `<div style="${a}">${o ? `<a${C} href="${V(o)}" target="${S.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${C}>${s}</span>`}</div>`;
|
|
754
754
|
}
|
|
755
755
|
case "table": {
|
|
756
|
-
let e = d(g), t = `${
|
|
757
|
-
let o = a ? "th" : "td", s = a ?
|
|
756
|
+
let e = d(g), t = `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
|
|
757
|
+
let o = a ? "th" : "td", s = a ? _.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : _.contentBgColor || "#ffffff", c = a ? _.headerTextColor || "#1e293b" : _.contentTextColor || "#475569", l = a ? _.headerTextAlign || "left" : _.contentTextAlign || "left";
|
|
758
758
|
return `<tr>${n.map((e, n) => {
|
|
759
759
|
let r = F({
|
|
760
|
-
padding:
|
|
760
|
+
padding: _.cellPadding || "8px",
|
|
761
761
|
border: t,
|
|
762
762
|
backgroundColor: s,
|
|
763
763
|
color: c,
|
|
764
764
|
textAlign: l,
|
|
765
|
-
lineHeight:
|
|
766
|
-
letterSpacing:
|
|
765
|
+
lineHeight: _.contentLineHeight,
|
|
766
|
+
letterSpacing: _.contentLetterSpacing,
|
|
767
767
|
fontWeight: a ? "700" : void 0
|
|
768
768
|
}), u = ` data-plexo-cell="${V(g.id)}|${i}-${n}"`;
|
|
769
769
|
return `<${o}${u} style="${r}">${e || " "}</${o}>`;
|
|
@@ -772,67 +772,67 @@ var J = (g) => {
|
|
|
772
772
|
borderCollapse: "collapse",
|
|
773
773
|
width: "100%"
|
|
774
774
|
});
|
|
775
|
-
return `<div${
|
|
776
|
-
padding:
|
|
777
|
-
margin:
|
|
775
|
+
return `<div${C} style="${F({
|
|
776
|
+
padding: _.padding,
|
|
777
|
+
margin: _.margin,
|
|
778
778
|
overflowX: "auto"
|
|
779
779
|
})}"><table style="${c}">${r}<tbody>${o}</tbody>${s}</table></div>`;
|
|
780
780
|
}
|
|
781
781
|
case "video": {
|
|
782
|
-
let e = i(
|
|
783
|
-
return `<div${
|
|
784
|
-
padding:
|
|
785
|
-
margin:
|
|
786
|
-
borderRadius:
|
|
782
|
+
let e = i(S.videoUrl), t = S.linkType === "email" ? `mailto:${S.href || ""}` : S.href || S.videoUrl || "#", n = S.target || "_blank";
|
|
783
|
+
return `<div${C} style="${F({
|
|
784
|
+
padding: _.padding,
|
|
785
|
+
margin: _.margin,
|
|
786
|
+
borderRadius: _.borderRadius,
|
|
787
787
|
overflow: "hidden"
|
|
788
|
-
})}"><a href="${V(t)}" target="${V(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${V(e.thumbnailUrl)}" alt="${V(
|
|
788
|
+
})}"><a href="${V(t)}" target="${V(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${V(e.thumbnailUrl)}" alt="${V(S.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
789
|
}
|
|
790
790
|
case "timer": {
|
|
791
|
-
let e =
|
|
792
|
-
fontFamily:
|
|
793
|
-
fontSize:
|
|
794
|
-
color:
|
|
791
|
+
let e = S.showLabels !== !1, t = F({
|
|
792
|
+
fontFamily: _.digitsFontFamily,
|
|
793
|
+
fontSize: _.digitsFontSize || "40px",
|
|
794
|
+
color: _.digitsColor || "#1e293b",
|
|
795
795
|
fontWeight: "800"
|
|
796
796
|
}), n = F({
|
|
797
|
-
fontFamily:
|
|
798
|
-
fontSize:
|
|
799
|
-
color:
|
|
797
|
+
fontFamily: _.labelsFontFamily,
|
|
798
|
+
fontSize: _.labelsFontSize || "16px",
|
|
799
|
+
color: _.labelsColor || "#64748b"
|
|
800
800
|
}), r = F({
|
|
801
|
-
backgroundColor:
|
|
802
|
-
borderRadius:
|
|
803
|
-
padding:
|
|
801
|
+
backgroundColor: _.backgroundColor || "#f8fafc",
|
|
802
|
+
borderRadius: _.borderRadius || "8px",
|
|
803
|
+
padding: _.padding || "16px",
|
|
804
804
|
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${
|
|
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(S.targetDate, S.timezone), s = V(new Date(o.targetTimestamp).toISOString()), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
|
|
806
|
+
return `<div${C} 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
807
|
}
|
|
808
808
|
case "carousel": {
|
|
809
|
-
let e = Array.isArray(
|
|
810
|
-
padding:
|
|
811
|
-
margin:
|
|
812
|
-
backgroundColor:
|
|
809
|
+
let e = Array.isArray(S.images) ? S.images : [], t = `plexo-carousel-${g.id}`, n = F({
|
|
810
|
+
padding: _.padding || "10px",
|
|
811
|
+
margin: _.margin,
|
|
812
|
+
backgroundColor: _.backgroundColor,
|
|
813
813
|
overflow: "hidden",
|
|
814
|
-
borderRadius:
|
|
815
|
-
width:
|
|
816
|
-
height:
|
|
814
|
+
borderRadius: _.borderRadius || "12px",
|
|
815
|
+
width: _.width || "100%",
|
|
816
|
+
height: _.height || "360px"
|
|
817
817
|
});
|
|
818
|
-
if (e.length === 0) return `<div${
|
|
819
|
-
let r = Math.min(e.length - 1, Math.max(0, parseInt(String(
|
|
818
|
+
if (e.length === 0) return `<div${C} style="${n}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
|
|
819
|
+
let r = Math.min(e.length - 1, Math.max(0, parseInt(String(S.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
820
|
let o = i[r] * 5, s = e.length > 1 ? ` animation: ${t}-fade ${a}s ease-in-out infinite; animation-delay: ${o}s;` : "";
|
|
821
821
|
return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${V(n.src)}" alt="${V(n.alt || n.caption || "")}" style="width: 100%; height: 100%; object-fit: cover; display: block;" />${n.caption ? `<div class="${t}-caption" style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${V(n.caption)}</div>` : ""}</div>`;
|
|
822
822
|
}).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
823
|
let r = i[n] * 5;
|
|
824
824
|
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
825
|
}).join("")}</div>` : "", u = (5 - o) / a * 100, d = 5 / a * 100, f = o / a * 100;
|
|
826
|
-
return `<div${
|
|
826
|
+
return `<div${C} 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
827
|
}
|
|
828
828
|
case "accordion": {
|
|
829
|
-
let e = o(g), t =
|
|
830
|
-
border: `${
|
|
831
|
-
borderRadius:
|
|
829
|
+
let e = o(g), t = S.mode === "multi" ? "multi" : "single", n = S.iconStyle || "chevron", r = S.iconPosition === "left", i = S.showDividers !== !1, a = S.animation !== "none", s = F({
|
|
830
|
+
border: `${_.borderWidth || "1px"} ${_.borderStyle || "solid"} ${_.borderColor || "#e2e8f0"}`,
|
|
831
|
+
borderRadius: _.borderRadius || "10px",
|
|
832
832
|
overflow: "hidden",
|
|
833
|
-
margin:
|
|
833
|
+
margin: _.margin
|
|
834
834
|
});
|
|
835
|
-
return e.length === 0 ? `<div${
|
|
835
|
+
return e.length === 0 ? `<div${C} style="${s}"></div>` : `<div${C} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${K(e, _, {
|
|
836
836
|
iconStyle: n,
|
|
837
837
|
iconOnLeft: r,
|
|
838
838
|
showDividers: i,
|
|
@@ -908,12 +908,12 @@ var J = (g) => {
|
|
|
908
908
|
"ogImageUrl"
|
|
909
909
|
], s = {};
|
|
910
910
|
for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
|
|
911
|
-
let c = F(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = H("id", a.htmlId), d = H("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = typeof a.metaDescription == "string" && a.metaDescription.trim() ? a.metaDescription.trim() : "", g = typeof a.ogImageUrl == "string" && a.ogImageUrl.trim() ? a.ogImageUrl.trim() : "",
|
|
911
|
+
let c = F(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = H("id", a.htmlId), d = H("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = typeof a.metaDescription == "string" && a.metaDescription.trim() ? a.metaDescription.trim() : "", g = typeof a.ogImageUrl == "string" && a.ogImageUrl.trim() ? a.ogImageUrl.trim() : "", v = typeof a.contentMaxWidth == "string" && a.contentMaxWidth.trim() ? a.contentMaxWidth.trim() : "1200px", y = Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : [], b = P(N(y, [a.fontFamily])), x = {
|
|
912
912
|
tablet: [],
|
|
913
913
|
mobile: []
|
|
914
|
-
},
|
|
915
|
-
for (let e of
|
|
916
|
-
let
|
|
914
|
+
}, S = "";
|
|
915
|
+
for (let e of y) S += Y(e, x, n);
|
|
916
|
+
let C = x.tablet.length ? `\n ${x.tablet.join("\n ")}` : "", w = x.mobile.length ? `\n ${x.mobile.join("\n ")}` : "", T = `<!DOCTYPE html>
|
|
917
917
|
<html>
|
|
918
918
|
<head>
|
|
919
919
|
<meta charset="utf-8">
|
|
@@ -929,7 +929,8 @@ var J = (g) => {
|
|
|
929
929
|
${h ? `<meta name="twitter:description" content="${V(h)}">` : ""}
|
|
930
930
|
${g ? `<meta name="twitter:image" content="${V(g)}">` : ""}
|
|
931
931
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
932
|
-
${
|
|
932
|
+
${b ? `<link rel="stylesheet" href="${b}">` : ""}
|
|
933
|
+
${S.includes("<opt-in-embed-form") ? `<script type="module" src="${_}"><\/script>` : ""}
|
|
933
934
|
<style>
|
|
934
935
|
/* .plexo-row's own -8px side margins (below) are a gutter-cancelling trick that's always
|
|
935
936
|
harmless under the default max-width wrapper -- centered on any viewport wider than
|
|
@@ -946,7 +947,7 @@ var J = (g) => {
|
|
|
946
947
|
/* Tablet: auto-scaled fonts/heights/spacing (see utilities/responsiveDefaults.ts) and
|
|
947
948
|
any explicit per-element styleTablet/stylesTablet override — columns stay side by
|
|
948
949
|
side at this width. */
|
|
949
|
-
@media (min-width: 769px) and (max-width: 1024px) {${
|
|
950
|
+
@media (min-width: 769px) and (max-width: 1024px) {${C}
|
|
950
951
|
}
|
|
951
952
|
@media (max-width: 768px) {
|
|
952
953
|
.plexo-row {
|
|
@@ -956,17 +957,17 @@ var J = (g) => {
|
|
|
956
957
|
width: 100% !important;
|
|
957
958
|
max-width: 100% !important;
|
|
958
959
|
margin-bottom: var(--plexo-col-gap, 16px);
|
|
959
|
-
}${
|
|
960
|
+
}${w}
|
|
960
961
|
}
|
|
961
962
|
</style>
|
|
962
963
|
${f ? `<style>\n${f}\n </style>` : ""}
|
|
963
964
|
</head>
|
|
964
965
|
<body${u}${d} style="${c}">
|
|
965
|
-
<div style="max-width: ${
|
|
966
|
-
return
|
|
966
|
+
<div style="max-width: ${v}; margin: 0 auto; width: 100%;">`;
|
|
967
|
+
return T += S, T += `\n </div>
|
|
967
968
|
${p ? ` <script>\n${p}\n <\/script>` : ""}
|
|
968
969
|
</body>
|
|
969
|
-
</html>`,
|
|
970
|
+
</html>`, T = T.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), T;
|
|
970
971
|
};
|
|
971
972
|
function Z(e) {
|
|
972
973
|
return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
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-C4Rkxl1E.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-C4Rkxl1E.js";
|
|
4
4
|
import { t as ne } from "./compilerClient-BIrZIgfG.js";
|
|
5
5
|
import T, { createContext as E, createElement as re, forwardRef as ie, useCallback as ae, useContext as oe, useEffect as D, useImperativeHandle as se, useMemo as O, useRef as k, useState as A } from "react";
|
|
6
6
|
import { DndContext as ce, DragOverlay as le, MeasuringStrategy as ue, PointerSensor as de, TouchSensor as fe, pointerWithin as pe, rectIntersection as me, useDraggable as j, useDroppable as he, useSensor as M, useSensors as ge } from "@dnd-kit/core";
|
package/package.json
CHANGED