@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.
@@ -614,51 +614,51 @@ function q(e) {
614
614
  }
615
615
  var J = (g) => {
616
616
  if (!g || typeof g != "object") return "";
617
- 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 = F(g.type === "form_container" ? {
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
- ...v
620
- } : x), C = g.attributes || {}, w = ` data-plexo-id="${V(g.id)}"`, T = String(C.boxAlign || "left"), E = y && (b || !!v.width), D = (e) => E ? `<div style="text-align: ${T};">${e}</div>` : e, O = `${E ? "display: inline-block; " : ""}${y && v.height ? "overflow: hidden; " : ""}`;
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 D(`<h2${w} style="margin-top: 0; margin-bottom: 8px; ${O}${S}">${C.text || "Heading"}</h2>`);
623
- case "paragraph": return D(`<p${w} style="margin-top: 0; margin-bottom: 12px; ${O}${S}">${C.text || "Paragraph text content."}</p>`);
624
- case "text": return D(`<div${w} style="${O}${S}">${C.text || ""}</div>`);
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
- ...v,
627
+ ..._,
628
628
  width: e.width,
629
629
  height: e.height
630
630
  });
631
- return `<div style="text-align: ${v.textAlign || "center"};"><a${w} href="${C.href || "#"}" target="${C.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${C.text || "Button"}</a></div>`;
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 = v.textAlign === "center" ? "margin: 0 auto; display: block;" : v.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = F({
635
- ...v,
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${w} src="${C.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${C.alt || ""}" style="${n} ${t}" />`;
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${w} style="border: 0; border-top: ${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#334155"}; ${S}" />`;
642
- case "spacer": return `<div${w} style="height: ${v.height || "24px"};"></div>`;
643
- case "card": return `<div${w} style="${S}">
644
- <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${C.title || "Card Title"}</h3>
645
- <p style="margin: 0; color: #94a3b8; font-size: 14px;">${C.description || "Card description."}</p>
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 (C.provider === "maildrip" && typeof C.maildripPageId == "string" && C.maildripPageId.trim()) {
649
- let e = V(C.maildripPageId.trim());
650
- return `<div${w} style="${F({
651
- ...v,
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
- })}"><script type="module" src="${_}"><\/script><opt-in-embed-form page-id="${e}"></opt-in-embed-form></div>`;
653
+ })}"><opt-in-embed-form page-id="${e}"></opt-in-embed-form></div>`;
654
654
  }
655
655
  let n = {
656
656
  ...B(),
657
- ...v
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(C.fields) ? C.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${W(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 = F({
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${w} action="${V(C.actionUrl || C.action || "#")}" method="${V(C.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${C.submitLabel || "Submit"}</button></div></form>`;
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 = C.inputType || C.type || "text", t = V(C.name || C.fieldName || "field"), n = V(C.placeholder || ""), r = C.required ? " required" : "";
682
- return `<input${w} type="${V(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${r} />`;
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${w} name="${V(C.name || C.fieldName || "field")}" placeholder="${V(C.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${C.required ? " required" : ""}></textarea>`;
685
- case "select": return `<select${w} name="${V(C.name || C.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${S}"${C.required ? " required" : ""}>${(Array.isArray(C.options) ? C.options : []).map((e) => `<option value="${V(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
686
- case "html": return `<div${w} style="${F({
687
- ...v,
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
- })}">${C.htmlContent || C.text || ""}</div>`;
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(v);
699
- return `<div${w} data-plexo-blog-${e}="true"${H("data-plexo-blog-prefix", C.prefix)} style="${t}"></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(v);
709
- return `<div${w} data-plexo-commerce-${e}="true"${H("data-plexo-product-id", C.productId)}${H("data-plexo-service-id", C.serviceId)}${H("data-plexo-commerce-mode", C.mode)}${C.storeMode === !1 ? " data-plexo-commerce-store-mode=\"false\"" : ""}${H("data-plexo-commerce-limit", C.limit)}${H("data-plexo-commerce-category", C.category)}${H("data-plexo-commerce-sort", C.sort)}${H("data-plexo-commerce-items-per-row", C.itemsPerRow)}${H("data-plexo-commerce-items-per-page", C.itemsPerPage)}${C.paginated ? " data-plexo-commerce-paginated=\"true\"" : ""} style="${t}"></div>`;
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 = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
713
- return `<div${w} style="${F({
714
- padding: v.padding,
715
- margin: v.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: v.iconSpacing || "8px",
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 = v.textAlign === "center" ? "center" : v.textAlign === "right" ? "flex-end" : "flex-start";
738
- return `<div${w} style="${F({
739
- ...v,
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: ${v.fontWeight || 600};">${V(e.label)}</a>`).join("")}</div>`;
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 = 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 = F({
748
- padding: v.padding,
749
- margin: v.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 C.href == "string" ? C.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${w} href="${V(o)}" target="${C.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${w}>${s}</span>`}</div>`;
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 = `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#cbd5e1"}`, n = (n, r, i, a) => {
757
- let o = a ? "th" : "td", s = a ? v.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : v.contentBgColor || "#ffffff", c = a ? v.headerTextColor || "#1e293b" : v.contentTextColor || "#475569", l = a ? v.headerTextAlign || "left" : v.contentTextAlign || "left";
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: v.cellPadding || "8px",
760
+ padding: _.cellPadding || "8px",
761
761
  border: t,
762
762
  backgroundColor: s,
763
763
  color: c,
764
764
  textAlign: l,
765
- lineHeight: v.contentLineHeight,
766
- letterSpacing: v.contentLetterSpacing,
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 || "&nbsp;"}</${o}>`;
@@ -772,67 +772,67 @@ var J = (g) => {
772
772
  borderCollapse: "collapse",
773
773
  width: "100%"
774
774
  });
775
- return `<div${w} style="${F({
776
- padding: v.padding,
777
- margin: v.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(C.videoUrl), t = C.linkType === "email" ? `mailto:${C.href || ""}` : C.href || C.videoUrl || "#", n = C.target || "_blank";
783
- return `<div${w} style="${F({
784
- padding: v.padding,
785
- margin: v.margin,
786
- borderRadius: v.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(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>`;
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 = C.showLabels !== !1, t = F({
792
- fontFamily: v.digitsFontFamily,
793
- fontSize: v.digitsFontSize || "40px",
794
- color: v.digitsColor || "#1e293b",
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: v.labelsFontFamily,
798
- fontSize: v.labelsFontSize || "16px",
799
- color: v.labelsColor || "#64748b"
797
+ fontFamily: _.labelsFontFamily,
798
+ fontSize: _.labelsFontSize || "16px",
799
+ color: _.labelsColor || "#64748b"
800
800
  }), r = F({
801
- backgroundColor: v.backgroundColor || "#f8fafc",
802
- borderRadius: v.borderRadius || "8px",
803
- padding: v.padding || "16px",
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(C.targetDate, C.timezone), s = V(new Date(o.targetTimestamp).toISOString()), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
806
- 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>`;
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(C.images) ? C.images : [], t = `plexo-carousel-${g.id}`, n = F({
810
- padding: v.padding || "10px",
811
- margin: v.margin,
812
- backgroundColor: v.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: v.borderRadius || "12px",
815
- width: v.width || "100%",
816
- height: v.height || "360px"
814
+ borderRadius: _.borderRadius || "12px",
815
+ width: _.width || "100%",
816
+ height: _.height || "360px"
817
817
  });
818
- if (e.length === 0) return `<div${w} 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(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) => {
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${w} class="${t}" style="${n}">${e.length > 1 ? `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}.${t}-dots{position:absolute;left:0;right:0;bottom:${c};}@keyframes ${t}-fade{0%{opacity:0;}${f}%{opacity:1;}${u}%{opacity:1;}${d}%{opacity:0;}100%{opacity:0;}}@keyframes ${t}-dot{0%{background:#cbd5e1;}${f}%{background:#4f46e5;}${u}%{background:#4f46e5;}${d}%{background:#cbd5e1;}100%{background:#cbd5e1;}}</style>` : `<style>.${t}{position:relative;}.${t} [data-slide-idx]{position:absolute;inset:0;}.${t}-caption{position:absolute;left:0;right:0;bottom:0;}</style>`}${s}${l}</div>`;
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 = C.mode === "multi" ? "multi" : "single", n = C.iconStyle || "chevron", r = C.iconPosition === "left", i = C.showDividers !== !1, a = C.animation !== "none", s = F({
830
- border: `${v.borderWidth || "1px"} ${v.borderStyle || "solid"} ${v.borderColor || "#e2e8f0"}`,
831
- borderRadius: v.borderRadius || "10px",
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: v.margin
833
+ margin: _.margin
834
834
  });
835
- return e.length === 0 ? `<div${w} style="${s}"></div>` : `<div${w} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${K(e, v, {
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() : "", _ = typeof a.contentMaxWidth == "string" && a.contentMaxWidth.trim() ? a.contentMaxWidth.trim() : "1200px", v = Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : [], y = P(N(v, [a.fontFamily])), b = {
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
- }, x = "";
915
- for (let e of v) x += Y(e, b, n);
916
- let S = b.tablet.length ? `\n ${b.tablet.join("\n ")}` : "", C = b.mobile.length ? `\n ${b.mobile.join("\n ")}` : "", w = `<!DOCTYPE html>
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
- ${y ? `<link rel="stylesheet" href="${y}">` : ""}
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) {${S}
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
- }${C}
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: ${_}; margin: 0 auto; width: 100%;">`;
966
- return w += x, w += `\n </div>
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>`, w = w.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), w;
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-dVsQwify.js";
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-dVsQwify.js";
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "1.4.24",
4
+ "version": "1.4.25",
5
5
  "description": "Plexo visual email and landing page builder SDK — drag-and-drop template editor with AI integration.",
6
6
  "keywords": [
7
7
  "email-builder",