@charisol/plexo-sdk 1.4.23 → 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.
|
@@ -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 };
|
|
@@ -14,6 +14,8 @@ type AuthAction = {
|
|
|
14
14
|
email: string;
|
|
15
15
|
password: string;
|
|
16
16
|
name: string;
|
|
17
|
+
companyName: string;
|
|
18
|
+
phone: string;
|
|
17
19
|
} | {
|
|
18
20
|
action: 'login';
|
|
19
21
|
email: string;
|
|
@@ -22,7 +24,6 @@ type AuthAction = {
|
|
|
22
24
|
action: 'verify';
|
|
23
25
|
email: string;
|
|
24
26
|
code: string;
|
|
25
|
-
password: string;
|
|
26
27
|
} | {
|
|
27
28
|
action: 'resend';
|
|
28
29
|
email: string;
|
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";
|
|
@@ -53198,9 +53198,9 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
53198
53198
|
})
|
|
53199
53199
|
}) });
|
|
53200
53200
|
}, rG = ({ onMaildripAuth: e, onConnected: t, InlineTextInput: n }) => {
|
|
53201
|
-
let [r, i] = T.useState("login"), [a, o] = T.useState("credentials"), [s, c] = T.useState(""), [l, u] = T.useState(""), [d, f] = T.useState(""), [p, m] = T.useState(""), [h, g] = T.useState(
|
|
53201
|
+
let [r, i] = T.useState("login"), [a, o] = T.useState("credentials"), [s, c] = T.useState(""), [l, u] = T.useState(""), [d, f] = T.useState(""), [p, m] = T.useState(""), [h, g] = T.useState(""), [_, v] = T.useState(!1), [y, b] = T.useState(null), [x, S] = T.useState("idle"), C = (e) => {
|
|
53202
53202
|
if ("error" in e) {
|
|
53203
|
-
|
|
53203
|
+
b(e.error);
|
|
53204
53204
|
return;
|
|
53205
53205
|
}
|
|
53206
53206
|
if (e.status === "connected") {
|
|
@@ -53232,52 +53232,51 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
53232
53232
|
children: [
|
|
53233
53233
|
/* @__PURE__ */ P(n, {
|
|
53234
53234
|
label: "Verification Code",
|
|
53235
|
-
value:
|
|
53236
|
-
onChange:
|
|
53235
|
+
value: h,
|
|
53236
|
+
onChange: g
|
|
53237
53237
|
}),
|
|
53238
53238
|
/* @__PURE__ */ P("button", {
|
|
53239
53239
|
type: "button",
|
|
53240
|
-
disabled:
|
|
53240
|
+
disabled: _ || !h.trim(),
|
|
53241
53241
|
onClick: async () => {
|
|
53242
|
-
if (
|
|
53243
|
-
|
|
53242
|
+
if (h.trim()) {
|
|
53243
|
+
v(!0), b(null);
|
|
53244
53244
|
try {
|
|
53245
53245
|
let t = await e({
|
|
53246
53246
|
action: "verify",
|
|
53247
53247
|
email: s.trim(),
|
|
53248
|
-
code:
|
|
53249
|
-
password: l
|
|
53248
|
+
code: h.trim()
|
|
53250
53249
|
});
|
|
53251
|
-
|
|
53250
|
+
C(t);
|
|
53252
53251
|
} finally {
|
|
53253
|
-
|
|
53252
|
+
v(!1);
|
|
53254
53253
|
}
|
|
53255
53254
|
}
|
|
53256
53255
|
},
|
|
53257
53256
|
className: "rounded bg-cyan-600 px-2.5 py-1.5 text-[11px] font-bold text-white transition hover:bg-cyan-500 disabled:cursor-not-allowed disabled:opacity-50",
|
|
53258
|
-
children:
|
|
53257
|
+
children: _ ? "Verifying…" : "Verify & Connect"
|
|
53259
53258
|
}),
|
|
53260
53259
|
/* @__PURE__ */ P("button", {
|
|
53261
53260
|
type: "button",
|
|
53262
|
-
disabled:
|
|
53261
|
+
disabled: x === "sending",
|
|
53263
53262
|
onClick: async () => {
|
|
53264
|
-
|
|
53263
|
+
S("sending");
|
|
53265
53264
|
try {
|
|
53266
53265
|
let t = await e({
|
|
53267
53266
|
action: "resend",
|
|
53268
53267
|
email: s.trim()
|
|
53269
53268
|
});
|
|
53270
|
-
|
|
53269
|
+
S("error" in t ? "idle" : "sent"), "error" in t && b(t.error);
|
|
53271
53270
|
} catch {
|
|
53272
|
-
|
|
53271
|
+
S("idle");
|
|
53273
53272
|
}
|
|
53274
53273
|
},
|
|
53275
53274
|
className: "text-[9px] text-slate-400 underline hover:text-slate-200 disabled:opacity-50",
|
|
53276
|
-
children:
|
|
53275
|
+
children: x === "sent" ? "Code resent" : x === "sending" ? "Sending…" : "Didn't get it? Resend code"
|
|
53277
53276
|
}),
|
|
53278
|
-
|
|
53277
|
+
y && /* @__PURE__ */ P("span", {
|
|
53279
53278
|
className: "text-[9px] leading-snug text-rose-400",
|
|
53280
|
-
children:
|
|
53279
|
+
children: y
|
|
53281
53280
|
})
|
|
53282
53281
|
]
|
|
53283
53282
|
})
|
|
@@ -53294,7 +53293,7 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
53294
53293
|
children: ["login", "register"].map((e) => /* @__PURE__ */ P("button", {
|
|
53295
53294
|
type: "button",
|
|
53296
53295
|
onClick: () => {
|
|
53297
|
-
i(e),
|
|
53296
|
+
i(e), b(null);
|
|
53298
53297
|
},
|
|
53299
53298
|
className: `flex-1 rounded px-2 py-1 text-[10px] font-bold transition ${r === e ? "bg-cyan-600 text-white" : "bg-slate-900 text-slate-400 hover:text-white"}`,
|
|
53300
53299
|
children: e === "login" ? "Log In" : "Create Account"
|
|
@@ -53303,11 +53302,15 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
53303
53302
|
/* @__PURE__ */ F("div", {
|
|
53304
53303
|
className: "mt-1.5 flex flex-col gap-1.5",
|
|
53305
53304
|
children: [
|
|
53306
|
-
r === "register" && /* @__PURE__ */ P(n, {
|
|
53305
|
+
r === "register" && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(n, {
|
|
53307
53306
|
label: "Name",
|
|
53308
53307
|
value: d,
|
|
53309
53308
|
onChange: f
|
|
53310
|
-
}),
|
|
53309
|
+
}), /* @__PURE__ */ P(n, {
|
|
53310
|
+
label: "Phone Number",
|
|
53311
|
+
value: p,
|
|
53312
|
+
onChange: m
|
|
53313
|
+
})] }),
|
|
53311
53314
|
/* @__PURE__ */ P(n, {
|
|
53312
53315
|
label: "Email",
|
|
53313
53316
|
value: s,
|
|
@@ -53322,33 +53325,35 @@ var ZW = ({ value: e, onChange: t, sitePages: n }) => {
|
|
|
53322
53325
|
}),
|
|
53323
53326
|
/* @__PURE__ */ P("button", {
|
|
53324
53327
|
type: "button",
|
|
53325
|
-
disabled:
|
|
53328
|
+
disabled: _ || !s.trim() || !l || r === "register" && (!d.trim() || !p.trim()),
|
|
53326
53329
|
onClick: async () => {
|
|
53327
|
-
if (!(!s.trim() || !l || r === "register" && !d.trim())) {
|
|
53328
|
-
|
|
53330
|
+
if (!(!s.trim() || !l || r === "register" && (!d.trim() || !p.trim()))) {
|
|
53331
|
+
v(!0), b(null);
|
|
53329
53332
|
try {
|
|
53330
53333
|
let t = await e(r === "register" ? {
|
|
53331
53334
|
action: "register",
|
|
53332
53335
|
email: s.trim(),
|
|
53333
53336
|
password: l,
|
|
53334
|
-
name: d.trim()
|
|
53337
|
+
name: d.trim(),
|
|
53338
|
+
companyName: d.trim(),
|
|
53339
|
+
phone: p.trim()
|
|
53335
53340
|
} : {
|
|
53336
53341
|
action: "login",
|
|
53337
53342
|
email: s.trim(),
|
|
53338
53343
|
password: l
|
|
53339
53344
|
});
|
|
53340
|
-
|
|
53345
|
+
C(t);
|
|
53341
53346
|
} finally {
|
|
53342
|
-
|
|
53347
|
+
v(!1);
|
|
53343
53348
|
}
|
|
53344
53349
|
}
|
|
53345
53350
|
},
|
|
53346
53351
|
className: "rounded bg-cyan-600 px-2.5 py-1.5 text-[11px] font-bold text-white transition hover:bg-cyan-500 disabled:cursor-not-allowed disabled:opacity-50",
|
|
53347
|
-
children:
|
|
53352
|
+
children: _ ? "Connecting…" : r === "login" ? "Log In" : "Create Account"
|
|
53348
53353
|
}),
|
|
53349
|
-
|
|
53354
|
+
y && /* @__PURE__ */ P("span", {
|
|
53350
53355
|
className: "text-[9px] leading-snug text-rose-400",
|
|
53351
|
-
children:
|
|
53356
|
+
children: y
|
|
53352
53357
|
}),
|
|
53353
53358
|
/* @__PURE__ */ P("span", {
|
|
53354
53359
|
className: "text-[8.5px] leading-snug text-slate-500",
|
|
@@ -205,9 +205,8 @@ export interface PlexoBuilderProps {
|
|
|
205
205
|
* code, so the real result is always 'verify_required', never immediate.
|
|
206
206
|
* - 'login' -> 'connected' for an already-verified account, 'verify_required' if the
|
|
207
207
|
* account exists but was never finished verifying.
|
|
208
|
-
* - 'verify' ->
|
|
209
|
-
*
|
|
210
|
-
* password past this step.
|
|
208
|
+
* - 'verify' -> MailDrip's own verify endpoint returns a usable session token on success,
|
|
209
|
+
* so the host fetches/stores the API key in this one call — no password resubmission.
|
|
211
210
|
* - 'resend' -> re-sends the verification email.
|
|
212
211
|
*/
|
|
213
212
|
onMaildripAuth?: (input: {
|
|
@@ -215,6 +214,8 @@ export interface PlexoBuilderProps {
|
|
|
215
214
|
email: string;
|
|
216
215
|
password: string;
|
|
217
216
|
name: string;
|
|
217
|
+
companyName: string;
|
|
218
|
+
phone: string;
|
|
218
219
|
} | {
|
|
219
220
|
action: 'login';
|
|
220
221
|
email: string;
|
|
@@ -223,7 +224,6 @@ export interface PlexoBuilderProps {
|
|
|
223
224
|
action: 'verify';
|
|
224
225
|
email: string;
|
|
225
226
|
code: string;
|
|
226
|
-
password: string;
|
|
227
227
|
} | {
|
|
228
228
|
action: 'resend';
|
|
229
229
|
email: string;
|
package/package.json
CHANGED