@charisol/plexo-sdk 1.1.12 → 1.1.14

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.
Files changed (50) hide show
  1. package/dist/{compiler-Bxo7wIKY.js → compiler-1K7XytEa.js} +129 -151
  2. package/dist/compiler.js +1 -1
  3. package/dist/compilerClient.js +94 -72
  4. package/dist/{iconSvgStatic-D5PrYZfC.js → iconSvgStatic-CUYMC8Am.js} +247 -145
  5. package/dist/index.js +19 -4
  6. package/dist/social-icons/applemusic.png +0 -0
  7. package/dist/social-icons/applepodcasts.png +0 -0
  8. package/dist/social-icons/behance.png +0 -0
  9. package/dist/social-icons/bluesky.png +0 -0
  10. package/dist/social-icons/buymeacoffee.png +0 -0
  11. package/dist/social-icons/clubhouse.png +0 -0
  12. package/dist/social-icons/discord.png +0 -0
  13. package/dist/social-icons/dribbble.png +0 -0
  14. package/dist/social-icons/facebook.png +0 -0
  15. package/dist/social-icons/fallback.png +0 -0
  16. package/dist/social-icons/goodreads.png +0 -0
  17. package/dist/social-icons/instagram.png +0 -0
  18. package/dist/social-icons/kakaotalk.png +0 -0
  19. package/dist/social-icons/kofi.png +0 -0
  20. package/dist/social-icons/line.png +0 -0
  21. package/dist/social-icons/linkedin.png +0 -0
  22. package/dist/social-icons/mastodon.png +0 -0
  23. package/dist/social-icons/messenger.png +0 -0
  24. package/dist/social-icons/patreon.png +0 -0
  25. package/dist/social-icons/pinterest.png +0 -0
  26. package/dist/social-icons/producthunt.png +0 -0
  27. package/dist/social-icons/quora.png +0 -0
  28. package/dist/social-icons/reddit.png +0 -0
  29. package/dist/social-icons/signal.png +0 -0
  30. package/dist/social-icons/snapchat.png +0 -0
  31. package/dist/social-icons/soundcloud.png +0 -0
  32. package/dist/social-icons/spotify.png +0 -0
  33. package/dist/social-icons/substack.png +0 -0
  34. package/dist/social-icons/telegram.png +0 -0
  35. package/dist/social-icons/threads.png +0 -0
  36. package/dist/social-icons/tiktok.png +0 -0
  37. package/dist/social-icons/tripadvisor.png +0 -0
  38. package/dist/social-icons/tumblr.png +0 -0
  39. package/dist/social-icons/twitch.png +0 -0
  40. package/dist/social-icons/viber.png +0 -0
  41. package/dist/social-icons/vimeo.png +0 -0
  42. package/dist/social-icons/vk.png +0 -0
  43. package/dist/social-icons/wechat.png +0 -0
  44. package/dist/social-icons/whatsapp.png +0 -0
  45. package/dist/social-icons/x.png +0 -0
  46. package/dist/social-icons/yelp.png +0 -0
  47. package/dist/social-icons/youtube.png +0 -0
  48. package/dist/utilities/playground.constants.d.ts +1 -0
  49. package/dist/utilities/socialBrandIcons.d.ts +9 -6
  50. package/package.json +6 -3
package/dist/compiler.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./compiler-Bxo7wIKY.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./compiler-1K7XytEa.js";
2
2
  export { c as DEFAULT_BODY_FONT_FAMILY, i as FORM_NON_CSS_STYLE_KEYS, o as collectResponsiveRule, n as compileToHTML, e as compileToHTMLWithStrataAuto, a as compileToPlainText, s as convertSectionRowToPlexoRow, t as getFormDefaultStyle, r as getInlineStylesImportant, l as injectStrataBundle };
@@ -1,31 +1,24 @@
1
- import { a as e, b as t, d as n, f as r, h as i, l as a, m as o, n as s, p as c, t as l } from "./iconSvgStatic-D5PrYZfC.js";
1
+ import { a as e, b as t, d as n, f as r, h as i, l as a, m as o, p as s, t as c, v as l } from "./iconSvgStatic-CUYMC8Am.js";
2
2
  //#region src/utilities/compilerClient.ts
3
- var u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = (e) => {
4
- let t = "";
5
- for (let n = 0; n < e.length; n += 3) {
6
- let r = e.charCodeAt(n), i = e.charCodeAt(n + 1), a = e.charCodeAt(n + 2), o = r << 16 | (Number.isNaN(i) ? 0 : i) << 8 | (Number.isNaN(a) ? 0 : a);
7
- t += u[o >> 18 & 63], t += u[o >> 12 & 63], t += Number.isNaN(i) ? "=" : u[o >> 6 & 63], t += Number.isNaN(a) ? "=" : u[o & 63];
8
- }
9
- return t;
10
- }, f = /* @__PURE__ */ new Set([
3
+ var u = "https://cdn.jsdelivr.net/npm/@charisol/plexo-sdk@latest/dist/social-icons", d = /* @__PURE__ */ new Set([
11
4
  "selectable",
12
5
  "draggable",
13
6
  "duplicatable",
14
7
  "deletable",
15
8
  "hideable",
16
9
  "locked"
17
- ]), p = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), m = (e = {}) => Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}:${String(t)};`).join(""), h = (...e) => e.map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), g = (e, t) => {
10
+ ]), f = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), p = (e = {}) => Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}:${String(t)};`).join(""), m = (...e) => e.map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), h = (e, t) => {
18
11
  let n = { ...e.attributes || {} };
19
- if (t === "email") for (let e of f) delete n[e];
12
+ if (t === "email") for (let e of d) delete n[e];
20
13
  return n;
21
- }, _ = (e, t) => {
22
- let n = g(e, t), r = m(e.style || {}), i = h(n.htmlClassNames, n.htmlClass, n.validationClass, n.validationClassName), a = p(n.name || n.fieldName || "field"), o = p(n.placeholder || ""), s = n.required ? " required" : "";
14
+ }, g = (e, t) => {
15
+ let n = h(e, t), r = p(e.style || {}), i = m(n.htmlClassNames, n.htmlClass, n.validationClass, n.validationClassName), a = f(n.name || n.fieldName || "field"), o = f(n.placeholder || ""), s = n.required ? " required" : "";
23
16
  if (t === "email") return `<mj-table><tr><td style="padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;color:#64748b;${r}">${o || a}</td></tr></mj-table>`;
24
- let c = p(n.inputType || n.type || (e.type === "input" ? n.kind || "text" : e.type)), l = n.htmlId ? ` id="${p(n.htmlId)}"` : "", u = i ? ` class="${p(i)}"` : "";
25
- return e.type === "textarea" ? `<textarea${l}${u} name="${a}" placeholder="${o}" style="${r}"${s}>${p(n.value || "")}</textarea>` : e.type === "select" ? `<select${l}${u} name="${a}" style="${r}"${s}>${(n.options || []).map((e) => `<option value="${p(e.value)}">${p(e.label)}</option>`).join("")}</select>` : `<input${l}${u} type="${c}" name="${a}" placeholder="${o}" value="${p(n.value || "")}" style="${r}"${s} />`;
26
- }, v = (e, t) => {
27
- let n = g(e, t), r = m(e.style || {}), i = h(n.htmlClassNames, n.htmlClass), a = n.htmlId ? ` id="${p(n.htmlId)}"` : "", o = i ? ` class="${p(i)}"` : "", s = p(n.actionUrl || n.action || "#"), c = p(n.method || "POST"), l = n.fields || [], u = p(n.submitLabel || "Submit");
28
- return t === "email" ? `<mj-table><tr><td style="${r}"><table role="presentation" width="100%">${l.map((e) => `<tr><td style="padding:8px 0;font-family:Arial,sans-serif;color:#334155;"><strong>${p(e.label || e.name || "Field")}</strong><br/><span style="display:inline-block;margin-top:4px;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;color:#64748b;">${p(e.placeholder || "") || "&nbsp;"}</span></td></tr>`).join("")}<tr><td style="padding-top:12px;"><a href="${p(n.href || n.submitHref || "#")}" style="display:inline-block;padding:10px 16px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:6px;">${u}</a></td></tr></table></td></tr></mj-table>` : `<form${a}${o} action="${s}" method="${c}" style="${r}">${l.map((t) => _({
17
+ let c = f(n.inputType || n.type || (e.type === "input" ? n.kind || "text" : e.type)), l = n.htmlId ? ` id="${f(n.htmlId)}"` : "", u = i ? ` class="${f(i)}"` : "";
18
+ return e.type === "textarea" ? `<textarea${l}${u} name="${a}" placeholder="${o}" style="${r}"${s}>${f(n.value || "")}</textarea>` : e.type === "select" ? `<select${l}${u} name="${a}" style="${r}"${s}>${(n.options || []).map((e) => `<option value="${f(e.value)}">${f(e.label)}</option>`).join("")}</select>` : `<input${l}${u} type="${c}" name="${a}" placeholder="${o}" value="${f(n.value || "")}" style="${r}"${s} />`;
19
+ }, _ = (e, t) => {
20
+ let n = h(e, t), r = p(e.style || {}), i = m(n.htmlClassNames, n.htmlClass), a = n.htmlId ? ` id="${f(n.htmlId)}"` : "", o = i ? ` class="${f(i)}"` : "", s = f(n.actionUrl || n.action || "#"), c = f(n.method || "POST"), l = n.fields || [], u = f(n.submitLabel || "Submit");
21
+ return t === "email" ? `<mj-table><tr><td style="${r}"><table role="presentation" width="100%">${l.map((e) => `<tr><td style="padding:8px 0;font-family:Arial,sans-serif;color:#334155;"><strong>${f(e.label || e.name || "Field")}</strong><br/><span style="display:inline-block;margin-top:4px;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;color:#64748b;">${f(e.placeholder || "") || "&nbsp;"}</span></td></tr>`).join("")}<tr><td style="padding-top:12px;"><a href="${f(n.href || n.submitHref || "#")}" style="display:inline-block;padding:10px 16px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:6px;">${u}</a></td></tr></table></td></tr></mj-table>` : `<form${a}${o} action="${s}" method="${c}" style="${r}">${l.map((t) => g({
29
22
  id: `${e.id}-${String(t.name || t.label || "field")}`,
30
23
  type: t.kind === "textarea" || t.kind === "select" ? t.kind : "input",
31
24
  style: {
@@ -34,83 +27,112 @@ var u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d =
34
27
  },
35
28
  attributes: t
36
29
  }, "landing_page")).join("")}<button type="submit">${u}</button></form>`;
37
- }, y = (e = {}, t = {}) => {
30
+ }, v = (e = {}, t = {}) => {
38
31
  let n = [], r = e.fontSize || t.fontSize, i = e.fontWeight || t.fontWeight;
39
- return r && n.push(`font-size="${p(String(r))}"`), i && n.push(`font-weight="${p(String(i))}"`), e.color && n.push(`color="${p(String(e.color))}"`), e.fontFamily && n.push(`font-family="${p(String(e.fontFamily))}"`), e.lineHeight && n.push(`line-height="${p(String(e.lineHeight))}"`), e.letterSpacing && n.push(`letter-spacing="${p(String(e.letterSpacing))}"`), e.textAlign && n.push(`align="${p(String(e.textAlign))}"`), e.backgroundColor && n.push(`container-background-color="${p(String(e.backgroundColor))}"`), n.join(" ");
40
- }, b = (e = {}) => {
32
+ return r && n.push(`font-size="${f(String(r))}"`), i && n.push(`font-weight="${f(String(i))}"`), e.color && n.push(`color="${f(String(e.color))}"`), e.fontFamily && n.push(`font-family="${f(String(e.fontFamily))}"`), e.lineHeight && n.push(`line-height="${f(String(e.lineHeight))}"`), e.letterSpacing && n.push(`letter-spacing="${f(String(e.letterSpacing))}"`), e.textAlign && n.push(`align="${f(String(e.textAlign))}"`), e.backgroundColor && n.push(`container-background-color="${f(String(e.backgroundColor))}"`), n.join(" ");
33
+ }, y = (e = {}) => {
41
34
  let t = e.backgroundColor || e.background;
42
- return t ? ` background-color="${p(String(t))}"` : "";
43
- }, x = (t, u) => {
44
- let f = g(t, u), b = m(t.style || {}), x = f.htmlId ? ` id="${p(f.htmlId)}"` : "", S = h(f.htmlClassNames, f.htmlClass, u === "landing_page" && f.hideOnMobile ? "hidden md:block" : ""), C = S ? ` class="${p(S)}"` : "", w = typeof f.customCss == "string" && f.customCss.trim() ? f.customCss.trim() : "", T = w && u === "landing_page" ? `<style>${w}</style>` : "";
45
- if (t.type === "form_container") return `${T}${v(t, u)}`;
46
- if (t.type === "input" || t.type === "select" || t.type === "textarea") return `${T}${_(t, u)}`;
47
- if (u === "email") {
35
+ return t ? ` background-color="${f(String(t))}"` : "";
36
+ }, b = (e, t, n) => {
37
+ if (e[t]) return String(e[t]);
38
+ let [r, i, a, o] = n;
39
+ if (e[r] || e[i] || e[a] || e[o]) return `${e[r] || "0px"} ${e[i] || "0px"} ${e[a] || "0px"} ${e[o] || "0px"}`;
40
+ }, x = (e = {}) => {
41
+ let t = [];
42
+ e.backgroundColor && t.push(`background-color="${f(String(e.backgroundColor))}"`), e.color && t.push(`color="${f(String(e.color))}"`), e.fontSize && t.push(`font-size="${f(String(e.fontSize))}"`), e.fontWeight && t.push(`font-weight="${f(String(e.fontWeight))}"`), e.fontFamily && t.push(`font-family="${f(String(e.fontFamily))}"`), e.lineHeight && t.push(`line-height="${f(String(e.lineHeight))}"`), e.letterSpacing && t.push(`letter-spacing="${f(String(e.letterSpacing))}"`), e.textAlign && t.push(`align="${f(String(e.textAlign))}"`);
43
+ let n = b(e, "borderRadius", [
44
+ "borderTopLeftRadius",
45
+ "borderTopRightRadius",
46
+ "borderBottomRightRadius",
47
+ "borderBottomLeftRadius"
48
+ ]);
49
+ return n && t.push(`border-radius="${f(n)}"`), t.join(" ");
50
+ }, S = (t, d) => {
51
+ let y = h(t, d), S = p(t.style || {}), C = y.htmlId ? ` id="${f(y.htmlId)}"` : "", w = m(y.htmlClassNames, y.htmlClass, d === "landing_page" && y.hideOnMobile ? "hidden md:block" : ""), T = w ? ` class="${f(w)}"` : "", E = typeof y.customCss == "string" && y.customCss.trim() ? y.customCss.trim() : "", D = E && d === "landing_page" ? `<style>${E}</style>` : "";
52
+ if (t.type === "form_container") return `${D}${_(t, d)}`;
53
+ if (t.type === "input" || t.type === "select" || t.type === "textarea") return `${D}${g(t, d)}`;
54
+ if (d === "email") {
48
55
  if (t.type === "button") {
49
- let n = p(f.href || "#"), r = p(f.text || "Button"), i = e(t).width, a = i === "auto" ? "" : ` width="${p(i)}"`;
50
- return `<mj-button href="${n}" css-class="${f.hideOnDesktop ? "desktop-hide" : ""}" padding="0" inner-padding="10px 16px"${a}>${r}</mj-button>`;
56
+ let n = f(y.href || "#"), r = f(y.text || "Button"), i = e(t).width, a = i === "auto" ? "" : ` width="${f(i)}"`, o = t.style || {}, s = x(o), c = b(o, "padding", [
57
+ "paddingTop",
58
+ "paddingRight",
59
+ "paddingBottom",
60
+ "paddingLeft"
61
+ ]) || "10px 16px";
62
+ return `<mj-button href="${n}" css-class="${y.hideOnDesktop ? "desktop-hide" : ""}" padding="0" inner-padding="${f(c)}"${a}${s ? ` ${s}` : ""}>${r}</mj-button>`;
51
63
  }
52
64
  if (t.type === "image") {
53
- let e = a(t), n = e.width && e.width !== "100%" ? ` width="${p(e.width)}"` : "", r = e.height && e.height !== "auto" ? ` height="${p(e.height)}"` : "";
54
- return `<mj-image src="${p(f.src || "")}" alt="${p(f.alt || "")}"${n}${r} />`;
65
+ let e = a(t), n = e.width && e.width !== "100%" ? ` width="${f(e.width)}"` : "", r = e.height && e.height !== "auto" ? ` height="${f(e.height)}"` : "";
66
+ return `<mj-image src="${f(y.src || "")}" alt="${f(y.alt || "")}"${n}${r} />`;
55
67
  }
56
68
  if (t.type === "social") {
57
69
  let e = r(t);
58
70
  if (!e.length) return "";
59
- let n = (e) => e === "square" ? "14px" : "9999px";
60
- return `<mj-social font-size="13px" mode="horizontal">${e.map((e) => {
61
- let t = `data:image/svg+xml;base64,${d(s(e.provider, e.color))}`;
62
- return `<mj-social-element href="${p(e.url)}" src="${t}" background-color="${p(e.backgroundColor)}" icon-size="${p(e.size)}" border-radius="${n(e.iconType)}"></mj-social-element>`;
63
- }).join("")}</mj-social>`;
71
+ let n = t.style || {}, i = n.textAlign === "center" ? "center" : n.textAlign === "right" ? "flex-end" : "flex-start", a = n.iconSpacing || "8px", o = b(n, "padding", [
72
+ "paddingTop",
73
+ "paddingRight",
74
+ "paddingBottom",
75
+ "paddingLeft"
76
+ ]) || "8px", s = b(n, "margin", [
77
+ "marginTop",
78
+ "marginRight",
79
+ "marginBottom",
80
+ "marginLeft"
81
+ ]), c = (e) => e === "square" ? "14px" : "9999px", d = e.map((e) => {
82
+ let t = `<img src="${`${u}/${l[e.provider] ? e.provider : "fallback"}.png`}" alt="" width="${parseInt(e.size, 10) || 36}" style="display:block;width:60%;height:60%;border:0;" />`;
83
+ return `<a href="${f(e.url)}" style="display:inline-flex;align-items:center;justify-content:center;width:${f(e.size)};height:${f(e.size)};background-color:${f(e.backgroundColor)};border-radius:${c(e.iconType)};text-decoration:none;">${t}</a>`;
84
+ }).join("");
85
+ return `<mj-raw><div style="${`display:flex;flex-wrap:wrap;justify-content:${i};gap:${f(String(a))};padding:${f(o)};${s ? `margin:${f(s)};` : ""}`}">${d}</div></mj-raw>`;
64
86
  }
65
- if (t.type === "menu") return `<mj-navbar hamburger="hamburger">${n(t).map((e) => `<mj-navbar-link href="${p(e.href)}">${p(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
87
+ if (t.type === "menu") return `<mj-navbar hamburger="hamburger">${n(t).map((e) => `<mj-navbar-link href="${f(e.href)}">${f(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
66
88
  if (t.type === "table") {
67
- let e = c(t), n = t.style || {}, r = `${n.borderWidth || "1px"} ${n.borderStyle || "solid"} ${n.borderColor || "#cbd5e1"}`, i = (t, i, a) => {
89
+ let e = s(t), n = t.style || {}, r = `${n.borderWidth || "1px"} ${n.borderStyle || "solid"} ${n.borderColor || "#cbd5e1"}`, i = (t, i, a) => {
68
90
  let o = a ? "th" : "td", s = a ? n.headerBgColor || "#f8fafc" : e.striped && i % 2 == 1 ? "#f8fafc" : n.contentBgColor || "#ffffff", c = a ? n.headerTextColor || "#1e293b" : n.contentTextColor || "#475569";
69
- return `<tr>${t.map((e) => `<${o} style="padding: ${n.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${p(e) || "&nbsp;"}</${o}>`).join("")}</tr>`;
91
+ return `<tr>${t.map((e) => `<${o} style="padding: ${n.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${f(e) || "&nbsp;"}</${o}>`).join("")}</tr>`;
70
92
  }, a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length;
71
93
  return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${e.enableHeader && e.cells.length > 0 ? `<thead>${i(e.cells[0], 0, !0)}</thead>` : ""}<tbody>${e.cells.slice(a, Math.max(a, o)).map((e, t) => i(e, t, !1)).join("")}</tbody>${e.enableFooter && e.cells.length > a ? `<tfoot>${i(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : ""}</table></mj-table>`;
72
94
  }
73
95
  if (t.type === "video") {
74
- let e = i(f.videoUrl), t = f.linkType === "email" ? `mailto:${f.href || ""}` : f.href || f.videoUrl || "#";
75
- return `<mj-image src="${p(e.thumbnailUrl)}" href="${p(t)}" alt="${p(f.alt || "Video preview")}" />`;
96
+ let e = i(y.videoUrl), t = y.linkType === "email" ? `mailto:${y.href || ""}` : y.href || y.videoUrl || "#";
97
+ return `<mj-image src="${f(e.thumbnailUrl)}" href="${f(t)}" alt="${f(y.alt || "Video preview")}" />`;
76
98
  }
77
99
  if (t.type === "timer") {
78
- let e = o(f.targetDate), t = f.showLabels !== !1;
79
- return `<mj-text align="center"><div style="font-size: 28px; font-weight: 800;">${e.days}d ${e.hours}h ${e.minutes}m ${e.seconds}s</div>${t ? `<div style="font-size: 12px; color: #64748b;">Countdown to ${p(f.targetDate || "")}</div>` : ""}</mj-text>`;
100
+ let e = o(y.targetDate), t = y.showLabels !== !1;
101
+ return `<mj-text align="center"><div style="font-size: 28px; font-weight: 800;">${e.days}d ${e.hours}h ${e.minutes}m ${e.seconds}s</div>${t ? `<div style="font-size: 12px; color: #64748b;">Countdown to ${f(y.targetDate || "")}</div>` : ""}</mj-text>`;
80
102
  }
81
103
  if (t.type === "carousel") {
82
- let e = Array.isArray(f.images) ? f.images : [];
83
- return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${p(e.src)}" alt="${p(e.alt || "")}" />`).join("")}</mj-carousel>`;
104
+ let e = Array.isArray(y.images) ? y.images : [];
105
+ return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${f(e.src)}" alt="${f(e.alt || "")}" />`).join("")}</mj-carousel>`;
84
106
  }
85
107
  if (t.type === "icon") {
86
- let e = parseInt(String(f.iconSize || 48), 10) || 48, n = t.style?.color || "#1e293b";
87
- return `<mj-text align="center">${l(f.iconName, e, n)}</mj-text>`;
108
+ let e = parseInt(String(y.iconSize || 48), 10) || 48, n = t.style?.color || "#1e293b";
109
+ return `<mj-text align="center">${c(y.iconName, e, n)}</mj-text>`;
88
110
  }
89
- let u = f.hideOnDesktop ? "desktop-hide" : "";
111
+ let d = y.hideOnDesktop ? "desktop-hide" : "";
90
112
  if (t.type === "heading" || t.type === "paragraph" || t.type === "text") {
91
113
  let e = t.type === "heading" ? {
92
114
  fontSize: "24px",
93
115
  fontWeight: "700"
94
- } : { fontSize: "14px" }, n = y(t.style || {}, e);
95
- return `<mj-text${n ? ` ${n}` : ""} css-class="${u}">${f.text || ""}</mj-text>`;
116
+ } : { fontSize: "14px" }, n = v(t.style || {}, e);
117
+ return `<mj-text${n ? ` ${n}` : ""} css-class="${d}">${y.text || ""}</mj-text>`;
96
118
  }
97
119
  if (t.type === "spacer") {
98
120
  let e = t.style?.height || "24px";
99
- return `<mj-spacer height="${p(String(e))}" />`;
121
+ return `<mj-spacer height="${f(String(e))}" />`;
100
122
  }
101
123
  if (t.type === "divider") {
102
124
  let e = t.style || {};
103
- return `<mj-divider border-width="${p(String(e.borderWidth || "1px"))}" border-style="${p(String(e.borderStyle || "solid"))}" border-color="${p(String(e.borderColor || "#334155"))}" />`;
125
+ return `<mj-divider border-width="${f(String(e.borderWidth || "1px"))}" border-style="${f(String(e.borderStyle || "solid"))}" border-color="${f(String(e.borderColor || "#334155"))}" />`;
104
126
  }
105
- return t.type === "card" ? `<mj-text css-class="${u}"><strong style="display:block;margin-bottom:8px;">${p(f.title || "Card Title")}</strong><span style="font-size:14px;color:#64748b;">${p(f.description || "Card description.")}</span></mj-text>` : t.type === "html" ? `<mj-text css-class="${u}">${f.htmlContent || f.text || ""}</mj-text>` : `<mj-text${x}${C} css-class="${u}">${p(f.text || f.htmlContent || "")}</mj-text>`;
127
+ return t.type === "card" ? `<mj-text css-class="${d}"><strong style="display:block;margin-bottom:8px;">${f(y.title || "Card Title")}</strong><span style="font-size:14px;color:#64748b;">${f(y.description || "Card description.")}</span></mj-text>` : t.type === "html" ? `<mj-text css-class="${d}">${y.htmlContent || y.text || ""}</mj-text>` : `<mj-text${C}${T} css-class="${d}">${f(y.text || y.htmlContent || "")}</mj-text>`;
106
128
  }
107
129
  switch (t.type) {
108
- case "heading": return `${T}<h2${x}${C} style="${b}">${p(f.text || "Heading")}</h2>`;
130
+ case "heading": return `${D}<h2${C}${T} style="${S}">${f(y.text || "Heading")}</h2>`;
109
131
  case "paragraph":
110
- case "text": return `${T}<p${x}${C} style="${b}">${p(f.text || "")}</p>`;
111
- case "button": return `${T}<a${x}${C} href="${p(f.href || "#")}" style="${b}">${p(f.text || "Button")}</a>`;
112
- case "image": return `${T}<img${x}${C} src="${p(f.src || "")}" alt="${p(f.alt || "")}" style="${b}" />`;
113
- case "html": return `${T}<div${x}${C} style="${b}">${String(f.htmlContent || "")}</div>`;
132
+ case "text": return `${D}<p${C}${T} style="${S}">${f(y.text || "")}</p>`;
133
+ case "button": return `${D}<a${C}${T} href="${f(y.href || "#")}" style="${S}">${f(y.text || "Button")}</a>`;
134
+ case "image": return `${D}<img${C}${T} src="${f(y.src || "")}" alt="${f(y.alt || "")}" style="${S}" />`;
135
+ case "html": return `${D}<div${C}${T} style="${S}">${String(y.htmlContent || "")}</div>`;
114
136
  case "blog_title":
115
137
  case "blog_content":
116
138
  case "blog_featured_image":
@@ -118,29 +140,29 @@ var u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d =
118
140
  case "blog_author":
119
141
  case "blog_categories":
120
142
  case "blog_comments":
121
- case "blog_post_list": return `${T}<div${x}${C} data-plexo-blog-${t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true"${f.prefix ? ` data-plexo-blog-prefix="${p(f.prefix)}"` : ""} style="${b}"></div>`;
122
- default: return `${T}<div${x}${C} style="${b}">${p(f.text || "")}</div>`;
143
+ case "blog_post_list": return `${D}<div${C}${T} data-plexo-blog-${t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true"${y.prefix ? ` data-plexo-blog-prefix="${f(y.prefix)}"` : ""} style="${S}"></div>`;
144
+ default: return `${D}<div${C}${T} style="${S}">${f(y.text || "")}</div>`;
123
145
  }
124
- }, S = (e, n) => {
146
+ }, C = (e, n) => {
125
147
  if (n === "email") {
126
148
  let r = new Map(e.elements.map((e) => [e.id, e])), i = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), a = t(e).map((e) => {
127
149
  let t = r.get(e);
128
- if (t) return x(t, n);
150
+ if (t) return S(t, n);
129
151
  let a = i.get(e);
130
- return a ? `<mj-raw>${C(a, "landing_page")}</mj-raw>` : "";
131
- }).join(""), o = b(e.styles || {});
132
- return `<mj-column width="${p(e.width || "100%")}"${o}>${a}</mj-column>`;
152
+ return a ? `<mj-raw>${w(a, "landing_page")}</mj-raw>` : "";
153
+ }).join(""), o = y(e.styles || {});
154
+ return `<mj-column width="${f(e.width || "100%")}"${o}>${a}</mj-column>`;
133
155
  }
134
- let r = m(e.styles || {}), i = new Map(e.elements.map((e) => [e.id, e])), a = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), o = t(e).map((e) => {
156
+ let r = p(e.styles || {}), i = new Map(e.elements.map((e) => [e.id, e])), a = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), o = t(e).map((e) => {
135
157
  let t = i.get(e);
136
- if (t) return x(t, n);
158
+ if (t) return S(t, n);
137
159
  let r = a.get(e);
138
- return r ? C(r, n) : "";
160
+ return r ? w(r, n) : "";
139
161
  }).join("");
140
- return `<div style="width:${p(e.width || "100%")};${r}">${o}</div>`;
141
- }, C = (e, t) => t === "email" ? `<mj-section css-class="${e.style?.hideOnDesktop ? "desktop-hide" : ""}"${b(e.style || {})}>${e.columns.map((e) => S(e, t)).join("")}</mj-section>` : `<section style="display:flex;flex-wrap:wrap;${m(e.style || {})}">${e.columns.map((e) => S(e, t)).join("")}</section>`, w = (e, t) => {
142
- let n = (e.body?.rows || []).map((e) => C(e, t)).join(""), r = m(e.body?.style || {});
162
+ return `<div style="width:${f(e.width || "100%")};${r}">${o}</div>`;
163
+ }, w = (e, t) => t === "email" ? `<mj-section css-class="${e.style?.hideOnDesktop ? "desktop-hide" : ""}"${y(e.style || {})}>${e.columns.map((e) => C(e, t)).join("")}</mj-section>` : `<section style="display:flex;flex-wrap:wrap;${p(e.style || {})}">${e.columns.map((e) => C(e, t)).join("")}</section>`, T = (e, t) => {
164
+ let n = (e.body?.rows || []).map((e) => w(e, t)).join(""), r = p(e.body?.style || {});
143
165
  return t === "email" ? `<mjml><mj-head><mj-style>.desktop-hide { display:none !important; max-height:0; overflow:hidden; }</mj-style></mj-head><mj-body><mj-section><mj-column><mj-text css-class="preheader" padding="0" font-size="1px" color="#ffffff">&nbsp;</mj-text></mj-column></mj-section>${n}</mj-body></mjml>`.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1") : `<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /></head><body style="${r}"><main>${n}</main></body></html>`;
144
166
  };
145
167
  //#endregion
146
- export { w as parseJsonToTargetFormat };
168
+ export { T as parseJsonToTargetFormat };