@charisol/plexo-sdk 1.4.16 → 1.4.18

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.
@@ -798,17 +798,23 @@ var q = (g) => {
798
798
  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>`;
799
799
  }
800
800
  case "carousel": {
801
- let e = Array.isArray(S.images) ? S.images : [], t = P({
801
+ let e = Array.isArray(S.images) ? S.images : [], t = `plexo-carousel-${g.id}`, n = P({
802
802
  padding: _.padding || "10px",
803
803
  margin: _.margin,
804
804
  backgroundColor: _.backgroundColor,
805
- position: "relative",
806
805
  overflow: "hidden",
807
- borderRadius: "12px"
806
+ borderRadius: _.borderRadius || "12px",
807
+ height: _.height || "360px"
808
808
  });
809
- if (e.length === 0) return `<div${C} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
810
- let n = Math.min(e.length - 1, Math.max(0, parseInt(String(S.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${B(e.src)}" alt="${B(e.alt || e.caption || "")}" style="width: 100%; display: block;" />${e.caption ? `<div style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${B(e.caption)}</div>` : ""}</div>`).join(""), i = e.length > 1 ? `<div style="display: flex; gap: 6px; justify-content: center; padding: 8px 0;">${e.map((e, t) => `<button type="button" data-dot-idx="${t}" style="width: 8px; height: 8px; border-radius: 9999px; border: none; background: ${t === n ? "#4f46e5" : "#cbd5e1"}; cursor: pointer;"></button>`).join("")}</div>` : "";
811
- return `<div${C} data-active-idx="${n}" style="${t}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${r}${i}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${g.id}"]`)});if(!wrap)return;var slides=wrap.querySelectorAll('[data-slide-idx]');var dots=wrap.querySelectorAll('[data-dot-idx]');function show(n){var idx=(n+slides.length)%slides.length;slides.forEach(function(s,i){s.style.display=i===idx?'block':'none';});dots.forEach(function(d,i){d.style.background=i===idx?'#4f46e5':'#cbd5e1';});wrap.setAttribute('data-active-idx',String(idx));}var prev=wrap.querySelector('[data-nav="prev"]');var next=wrap.querySelector('[data-nav="next"]');if(prev)prev.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)-1);});if(next)next.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)+1);});dots.forEach(function(d,i){d.addEventListener('click',function(){show(i);});});})();<\/script>`}</div>`;
809
+ if (e.length === 0) return `<div${C} style="${n}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
810
+ 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) => {
811
+ let o = i[r] * 5, s = e.length > 1 ? ` animation: ${t}-fade ${a}s ease-in-out infinite; animation-delay: ${o}s;` : "";
812
+ return `<div data-slide-idx="${r}" style="opacity: ${e.length > 1 ? "0" : "1"};${s}"><img src="${B(n.src)}" alt="${B(n.alt || n.caption || "")}" style="width: 100%; height: 100%; object-fit: cover; display: block;" />${n.caption ? `<div class="${t}-caption" style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${B(n.caption)}</div>` : ""}</div>`;
813
+ }).join(""), c = e.length > 1 ? `<div class="${t}-dots" style="display: flex; gap: 6px; justify-content: center;">${e.map((e, n) => {
814
+ let r = i[n] * 5;
815
+ 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>`;
816
+ }).join("")}</div>` : "", l = (5 - o) / a * 100, u = 5 / a * 100, d = o / a * 100;
817
+ 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:10px;}@keyframes ${t}-fade{0%{opacity:0;}${d}%{opacity:1;}${l}%{opacity:1;}${u}%{opacity:0;}100%{opacity:0;}}@keyframes ${t}-dot{0%{background:#cbd5e1;}${d}%{background:#4f46e5;}${l}%{background:#4f46e5;}${u}%{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}${c}</div>`;
812
818
  }
813
819
  case "accordion": {
814
820
  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 = P({
@@ -886,22 +892,33 @@ var q = (g) => {
886
892
  "customJs",
887
893
  "textColor",
888
894
  "favicon",
889
- "contentMaxWidth"
895
+ "contentMaxWidth",
896
+ "metaDescription",
897
+ "ogImageUrl"
890
898
  ], s = {};
891
899
  for (let e of Object.keys(a)) o.includes(e) || (s[e] = a[e]);
892
- let c = P(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = V("id", a.htmlId), d = V("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = typeof a.contentMaxWidth == "string" && a.contentMaxWidth.trim() ? a.contentMaxWidth.trim() : "1200px", g = Array.isArray(i.rows) ? i.rows : Array.isArray(r.rows) ? r.rows : Array.isArray(e.rows) ? e.rows : [], _ = N(M(g, [a.fontFamily])), v = {
900
+ let c = P(s), l = typeof a.htmlTitle == "string" && a.htmlTitle.trim() ? a.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = V("id", a.htmlId), d = V("class", a.htmlClass), f = typeof a.customCss == "string" && a.customCss.trim() ? a.customCss.trim() : "", p = typeof a.customJs == "string" && a.customJs.trim() ? a.customJs.trim() : "", m = typeof a.favicon == "string" && a.favicon.trim() ? a.favicon.trim() : "", h = typeof a.metaDescription == "string" && a.metaDescription.trim() ? a.metaDescription.trim() : "", g = typeof a.ogImageUrl == "string" && a.ogImageUrl.trim() ? a.ogImageUrl.trim() : "", _ = 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 = N(M(v, [a.fontFamily])), b = {
893
901
  tablet: [],
894
902
  mobile: []
895
- }, y = "";
896
- for (let e of g) y += J(e, v, n);
897
- let b = v.tablet.length ? `\n ${v.tablet.join("\n ")}` : "", x = v.mobile.length ? `\n ${v.mobile.join("\n ")}` : "", S = `<!DOCTYPE html>
903
+ }, x = "";
904
+ for (let e of v) x += J(e, b, n);
905
+ let S = b.tablet.length ? `\n ${b.tablet.join("\n ")}` : "", C = b.mobile.length ? `\n ${b.mobile.join("\n ")}` : "", w = `<!DOCTYPE html>
898
906
  <html>
899
907
  <head>
900
908
  <meta charset="utf-8">
901
909
  <title>${B(l)}</title>
910
+ ${h ? `<meta name="description" content="${B(h)}">` : ""}
902
911
  ${m ? `<link rel="icon" href="${B(m)}">` : ""}
912
+ <meta property="og:type" content="website">
913
+ <meta property="og:title" content="${B(l)}">
914
+ ${h ? `<meta property="og:description" content="${B(h)}">` : ""}
915
+ ${g ? `<meta property="og:image" content="${B(g)}">` : ""}
916
+ <meta name="twitter:card" content="${g ? "summary_large_image" : "summary"}">
917
+ <meta name="twitter:title" content="${B(l)}">
918
+ ${h ? `<meta name="twitter:description" content="${B(h)}">` : ""}
919
+ ${g ? `<meta name="twitter:image" content="${B(g)}">` : ""}
903
920
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
904
- ${_ ? `<link rel="stylesheet" href="${_}">` : ""}
921
+ ${y ? `<link rel="stylesheet" href="${y}">` : ""}
905
922
  <style>
906
923
  /* .plexo-row's own -8px side margins (below) are a gutter-cancelling trick that's always
907
924
  harmless under the default max-width wrapper -- centered on any viewport wider than
@@ -918,7 +935,7 @@ var q = (g) => {
918
935
  /* Tablet: auto-scaled fonts/heights/spacing (see utilities/responsiveDefaults.ts) and
919
936
  any explicit per-element styleTablet/stylesTablet override — columns stay side by
920
937
  side at this width. */
921
- @media (min-width: 769px) and (max-width: 1024px) {${b}
938
+ @media (min-width: 769px) and (max-width: 1024px) {${S}
922
939
  }
923
940
  @media (max-width: 768px) {
924
941
  .plexo-row {
@@ -928,17 +945,17 @@ var q = (g) => {
928
945
  width: 100% !important;
929
946
  max-width: 100% !important;
930
947
  margin-bottom: var(--plexo-col-gap, 16px);
931
- }${x}
948
+ }${C}
932
949
  }
933
950
  </style>
934
951
  ${f ? `<style>\n${f}\n </style>` : ""}
935
952
  </head>
936
953
  <body${u}${d} style="${c}">
937
- <div style="max-width: ${h}; margin: 0 auto; width: 100%;">`;
938
- return S += y, S += `\n </div>
954
+ <div style="max-width: ${_}; margin: 0 auto; width: 100%;">`;
955
+ return w += x, w += `\n </div>
939
956
  ${p ? ` <script>\n${p}\n <\/script>` : ""}
940
957
  </body>
941
- </html>`, S = S.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), S;
958
+ </html>`, w = w.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), w;
942
959
  };
943
960
  function X(e) {
944
961
  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-CHtTI8Yn.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-BErz0Hcj.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
- import { i as e, n as t, o as n, r, s as i, t as a } from "./sanitizeCompiledHtml-DoiJcfDC.js";
1
+ import { i as e, n as t, o as n, r, s as i, t as a } from "./sanitizeCompiledHtml-BDiv8Bkr.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-CHtTI8Yn.js";
3
+ import { a as x, d as S, f as C, i as ee, o as te, u as w } from "./compiler-BErz0Hcj.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";
@@ -1895,7 +1895,7 @@ async function Tt(e, t) {
1895
1895
  let n = ne(e, "email", {
1896
1896
  instrument: !0,
1897
1897
  canvasEditorPadding: !0
1898
- }), { compileMjmlInBrowser: i } = await import("./mjmlBrowser-CpKNB3HB.js"), { html: a, errors: o } = i(n, { validationLevel: "soft" });
1898
+ }), { compileMjmlInBrowser: i } = await import("./mjmlBrowser-DQvN8hjF.js"), { html: a, errors: o } = i(n, { validationLevel: "soft" });
1899
1899
  return {
1900
1900
  html: a,
1901
1901
  error: o.length > 0 ? o.map((e) => e.message ?? e.formattedMessage ?? "Unknown MJML error").join("; ") : null
@@ -9860,6 +9860,28 @@ var gd = ({ activeTab: e, setActiveTab: t, showSaveButton: n, isSavingLayout: r,
9860
9860
  className: "text-[8.5px] text-slate-500 block leading-normal mt-0.5",
9861
9861
  children: "Sets the HTML <title> tag in the exported page."
9862
9862
  }),
9863
+ /* @__PURE__ */ F("div", {
9864
+ className: "mt-3",
9865
+ children: [/* @__PURE__ */ P(d, {
9866
+ label: "Meta Description",
9867
+ value: e.body.style.metaDescription || "",
9868
+ onChange: (e) => t({ metaDescription: e })
9869
+ }), /* @__PURE__ */ P("span", {
9870
+ className: "text-[8.5px] text-slate-500 block leading-normal mt-0.5",
9871
+ children: "Shown under the page title in search results and link previews (Slack, WhatsApp, iMessage). Aim for one or two sentences."
9872
+ })]
9873
+ }),
9874
+ /* @__PURE__ */ F("div", {
9875
+ className: "mt-3",
9876
+ children: [/* @__PURE__ */ P(d, {
9877
+ label: "Social Share Image URL",
9878
+ value: e.body.style.ogImageUrl || "",
9879
+ onChange: (e) => t({ ogImageUrl: e })
9880
+ }), /* @__PURE__ */ P("span", {
9881
+ className: "text-[8.5px] text-slate-500 block leading-normal mt-0.5",
9882
+ children: "The image shown when this page is shared — social apps and chat previews. A wide image (1200×630) works best."
9883
+ })]
9884
+ }),
9863
9885
  /* @__PURE__ */ F("div", {
9864
9886
  className: "flex items-center gap-2 mt-3 mb-1",
9865
9887
  children: [e.body.style.favicon ? /* @__PURE__ */ P("img", {
@@ -1,4 +1,4 @@
1
- import { a as e, s as t } from "./sanitizeCompiledHtml-DoiJcfDC.js";
1
+ import { a as e, s as t } from "./sanitizeCompiledHtml-BDiv8Bkr.js";
2
2
  //#endregion
3
3
  //#region src/utilities/mjmlBrowser.ts
4
4
  var n = /* @__PURE__ */ t((/* @__PURE__ */ e(((e, t) => {
package/dist/sanitize.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./sanitizeCompiledHtml-DoiJcfDC.js";
1
+ import { n as e, r as t, t as n } from "./sanitizeCompiledHtml-BDiv8Bkr.js";
2
2
  export { n as ALLOWED_ATTR, e as ALLOWED_TAGS, t as sanitizeCompiledHtml };
@@ -5043,7 +5043,7 @@ function ir(e) {
5043
5043
  }
5044
5044
  return n.join("; ");
5045
5045
  }
5046
- var ar = /* @__PURE__ */ "html.head.body.title.meta.style.link.div.span.p.h1.h2.h3.h4.h5.h6.a.img.button.svg.path.table.thead.tbody.tr.th.td.hr.br.ul.ol.li.section.article.main.header.footer.aside.g.circle.rect.line.polyline.polygon.ellipse.defs.lineargradient.radialgradient.stop.clippath.use.text.tspan".split("."), or = /* @__PURE__ */ "href.src.alt.class.id.style.title.target.rel.width.height.align.valign.cellpadding.cellspacing.border.viewbox.fill.stroke.d.xmlns.charset.name.content.lang.cx.cy.r.rx.ry.x1.y1.x2.y2.points.transform.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.opacity.stop-color.stop-opacity.offset.clip-path.gradientunits.preserveaspectratio.text-anchor.dominant-baseline.font-size.letter-spacing.data-*".split("."), sr = [
5046
+ var ar = /* @__PURE__ */ "html.head.body.title.meta.style.link.div.span.p.h1.h2.h3.h4.h5.h6.a.img.button.svg.path.table.thead.tbody.tr.th.td.hr.br.ul.ol.li.section.article.main.header.footer.aside.g.circle.rect.line.polyline.polygon.ellipse.defs.lineargradient.radialgradient.stop.clippath.use.text.tspan".split("."), or = /* @__PURE__ */ "href.src.alt.class.id.style.title.target.rel.width.height.align.valign.cellpadding.cellspacing.border.viewbox.fill.stroke.d.xmlns.charset.name.content.lang.property.cx.cy.r.rx.ry.x1.y1.x2.y2.points.transform.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.opacity.stop-color.stop-opacity.offset.clip-path.gradientunits.preserveaspectratio.text-anchor.dominant-baseline.font-size.letter-spacing.data-*".split("."), sr = [
5047
5047
  "javascript:",
5048
5048
  "vbscript:",
5049
5049
  "data:"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "1.4.16",
4
+ "version": "1.4.18",
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",