@charisol/plexo-sdk 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{compiler-BgBUwMe0.js → compiler-TjBEKCfw.js} +116 -146
- package/dist/compiler.js +1 -1
- package/dist/compilerClient.js +94 -72
- package/dist/components/icons.d.ts +65 -66
- package/dist/{iconSvgStatic-D5PrYZfC.js → iconSvgStatic-CA1z-vnh.js} +251 -149
- package/dist/index.js +4963 -4954
- package/dist/social-icons/applemusic.png +0 -0
- package/dist/social-icons/applepodcasts.png +0 -0
- package/dist/social-icons/behance.png +0 -0
- package/dist/social-icons/bluesky.png +0 -0
- package/dist/social-icons/buymeacoffee.png +0 -0
- package/dist/social-icons/clubhouse.png +0 -0
- package/dist/social-icons/discord.png +0 -0
- package/dist/social-icons/dribbble.png +0 -0
- package/dist/social-icons/facebook.png +0 -0
- package/dist/social-icons/fallback.png +0 -0
- package/dist/social-icons/goodreads.png +0 -0
- package/dist/social-icons/instagram.png +0 -0
- package/dist/social-icons/kakaotalk.png +0 -0
- package/dist/social-icons/kofi.png +0 -0
- package/dist/social-icons/line.png +0 -0
- package/dist/social-icons/linkedin.png +0 -0
- package/dist/social-icons/mastodon.png +0 -0
- package/dist/social-icons/messenger.png +0 -0
- package/dist/social-icons/patreon.png +0 -0
- package/dist/social-icons/pinterest.png +0 -0
- package/dist/social-icons/producthunt.png +0 -0
- package/dist/social-icons/quora.png +0 -0
- package/dist/social-icons/reddit.png +0 -0
- package/dist/social-icons/signal.png +0 -0
- package/dist/social-icons/snapchat.png +0 -0
- package/dist/social-icons/soundcloud.png +0 -0
- package/dist/social-icons/spotify.png +0 -0
- package/dist/social-icons/substack.png +0 -0
- package/dist/social-icons/telegram.png +0 -0
- package/dist/social-icons/threads.png +0 -0
- package/dist/social-icons/tiktok.png +0 -0
- package/dist/social-icons/tripadvisor.png +0 -0
- package/dist/social-icons/tumblr.png +0 -0
- package/dist/social-icons/twitch.png +0 -0
- package/dist/social-icons/viber.png +0 -0
- package/dist/social-icons/vimeo.png +0 -0
- package/dist/social-icons/vk.png +0 -0
- package/dist/social-icons/wechat.png +0 -0
- package/dist/social-icons/whatsapp.png +0 -0
- package/dist/social-icons/x.png +0 -0
- package/dist/social-icons/yelp.png +0 -0
- package/dist/social-icons/youtube.png +0 -0
- package/dist/utilities/elementResolvers.d.ts +16 -4
- package/dist/utilities/playground.constants.d.ts +1 -0
- package/dist/utilities/socialBrandIcons.d.ts +9 -6
- package/dist/utilities/strataTokenMapping.d.ts +1 -1
- 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-
|
|
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-TjBEKCfw.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 };
|
package/dist/compilerClient.js
CHANGED
|
@@ -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,
|
|
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-CA1z-vnh.js";
|
|
2
2
|
//#region src/utilities/compilerClient.ts
|
|
3
|
-
var u = "
|
|
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
|
-
]),
|
|
10
|
+
]), f = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), 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
|
|
12
|
+
if (t === "email") for (let e of d) delete n[e];
|
|
20
13
|
return n;
|
|
21
|
-
},
|
|
22
|
-
let n =
|
|
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 =
|
|
25
|
-
return e.type === "textarea" ? `<textarea${l}${u} name="${a}" placeholder="${o}" style="${r}"${s}>${
|
|
26
|
-
},
|
|
27
|
-
let n =
|
|
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>${
|
|
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 || "") || " "}</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
|
-
},
|
|
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="${
|
|
40
|
-
},
|
|
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="${
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
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 =
|
|
50
|
-
|
|
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="${
|
|
54
|
-
return `<mj-image src="${
|
|
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 =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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="${
|
|
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 =
|
|
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};">${
|
|
91
|
+
return `<tr>${t.map((e) => `<${o} style="padding: ${n.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${f(e) || " "}</${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(
|
|
75
|
-
return `<mj-image src="${
|
|
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(
|
|
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 ${
|
|
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(
|
|
83
|
-
return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${
|
|
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(
|
|
87
|
-
return `<mj-text align="center">${
|
|
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
|
|
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 =
|
|
95
|
-
return `<mj-text${n ? ` ${n}` : ""} css-class="${
|
|
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="${
|
|
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="${
|
|
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="${
|
|
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 `${
|
|
130
|
+
case "heading": return `${D}<h2${C}${T} style="${S}">${f(y.text || "Heading")}</h2>`;
|
|
109
131
|
case "paragraph":
|
|
110
|
-
case "text": return `${
|
|
111
|
-
case "button": return `${
|
|
112
|
-
case "image": return `${
|
|
113
|
-
case "html": return `${
|
|
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 `${
|
|
122
|
-
default: return `${
|
|
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
|
-
},
|
|
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
|
|
150
|
+
if (t) return S(t, n);
|
|
129
151
|
let a = i.get(e);
|
|
130
|
-
return a ? `<mj-raw>${
|
|
131
|
-
}).join(""), o =
|
|
132
|
-
return `<mj-column width="${
|
|
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 =
|
|
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
|
|
158
|
+
if (t) return S(t, n);
|
|
137
159
|
let r = a.get(e);
|
|
138
|
-
return r ?
|
|
160
|
+
return r ? w(r, n) : "";
|
|
139
161
|
}).join("");
|
|
140
|
-
return `<div style="width:${
|
|
141
|
-
},
|
|
142
|
-
let n = (e.body?.rows || []).map((e) =>
|
|
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"> </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 {
|
|
168
|
+
export { T as parseJsonToTargetFormat };
|
|
@@ -1,70 +1,69 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare const normalizeSocialProvider: (provider: string) => string;
|
|
3
|
-
export declare const renderSocialIcon: (provider: string, className?: string) =>
|
|
2
|
+
export declare const renderSocialIcon: (provider: string, className?: string) => import("react").JSX.Element;
|
|
4
3
|
export declare const isElementHiddenForView: (attrs: Record<string, any>, deviceView: "desktop" | "tablet" | "mobile" | "custom") => boolean;
|
|
5
4
|
export declare const ICONS: {
|
|
6
|
-
heading:
|
|
7
|
-
paragraph:
|
|
8
|
-
button:
|
|
9
|
-
image:
|
|
10
|
-
divider:
|
|
11
|
-
spacer:
|
|
12
|
-
carousel:
|
|
13
|
-
video:
|
|
14
|
-
social:
|
|
15
|
-
menu:
|
|
16
|
-
html:
|
|
17
|
-
table:
|
|
18
|
-
timer:
|
|
19
|
-
form:
|
|
20
|
-
accordion:
|
|
21
|
-
columns:
|
|
22
|
-
icon:
|
|
23
|
-
row1:
|
|
24
|
-
row2:
|
|
25
|
-
row3:
|
|
26
|
-
contentTab:
|
|
27
|
-
blocksTab:
|
|
28
|
-
bodyTab:
|
|
29
|
-
imagesTab:
|
|
30
|
-
uploadsTab:
|
|
31
|
-
auditTab:
|
|
32
|
-
designTab:
|
|
33
|
-
jsonTab:
|
|
34
|
-
htmlTab:
|
|
35
|
-
plainTab:
|
|
36
|
-
desktop:
|
|
37
|
-
tablet:
|
|
38
|
-
mobile:
|
|
39
|
-
custom:
|
|
40
|
-
trash:
|
|
41
|
-
copy:
|
|
42
|
-
close:
|
|
43
|
-
undo:
|
|
44
|
-
redo:
|
|
45
|
-
eye:
|
|
46
|
-
chevronDown:
|
|
47
|
-
chevronUp:
|
|
48
|
-
alignLeft:
|
|
49
|
-
alignCenter:
|
|
50
|
-
alignRight:
|
|
51
|
-
alignJustify:
|
|
52
|
-
chevron:
|
|
53
|
-
sun:
|
|
54
|
-
moon:
|
|
55
|
-
search:
|
|
56
|
-
alertCircle:
|
|
57
|
-
arrowRight:
|
|
58
|
-
link:
|
|
59
|
-
accessibility:
|
|
60
|
-
settings:
|
|
61
|
-
strataTab:
|
|
62
|
-
blogTitle:
|
|
63
|
-
blogContent:
|
|
64
|
-
blogFeaturedImage:
|
|
65
|
-
blogDate:
|
|
66
|
-
blogAuthor:
|
|
67
|
-
blogCategories:
|
|
68
|
-
blogComments:
|
|
69
|
-
blogPostList:
|
|
5
|
+
heading: import("react").JSX.Element;
|
|
6
|
+
paragraph: import("react").JSX.Element;
|
|
7
|
+
button: import("react").JSX.Element;
|
|
8
|
+
image: import("react").JSX.Element;
|
|
9
|
+
divider: import("react").JSX.Element;
|
|
10
|
+
spacer: import("react").JSX.Element;
|
|
11
|
+
carousel: import("react").JSX.Element;
|
|
12
|
+
video: import("react").JSX.Element;
|
|
13
|
+
social: import("react").JSX.Element;
|
|
14
|
+
menu: import("react").JSX.Element;
|
|
15
|
+
html: import("react").JSX.Element;
|
|
16
|
+
table: import("react").JSX.Element;
|
|
17
|
+
timer: import("react").JSX.Element;
|
|
18
|
+
form: import("react").JSX.Element;
|
|
19
|
+
accordion: import("react").JSX.Element;
|
|
20
|
+
columns: import("react").JSX.Element;
|
|
21
|
+
icon: import("react").JSX.Element;
|
|
22
|
+
row1: import("react").JSX.Element;
|
|
23
|
+
row2: import("react").JSX.Element;
|
|
24
|
+
row3: import("react").JSX.Element;
|
|
25
|
+
contentTab: import("react").JSX.Element;
|
|
26
|
+
blocksTab: import("react").JSX.Element;
|
|
27
|
+
bodyTab: import("react").JSX.Element;
|
|
28
|
+
imagesTab: import("react").JSX.Element;
|
|
29
|
+
uploadsTab: import("react").JSX.Element;
|
|
30
|
+
auditTab: import("react").JSX.Element;
|
|
31
|
+
designTab: import("react").JSX.Element;
|
|
32
|
+
jsonTab: import("react").JSX.Element;
|
|
33
|
+
htmlTab: import("react").JSX.Element;
|
|
34
|
+
plainTab: import("react").JSX.Element;
|
|
35
|
+
desktop: import("react").JSX.Element;
|
|
36
|
+
tablet: import("react").JSX.Element;
|
|
37
|
+
mobile: import("react").JSX.Element;
|
|
38
|
+
custom: import("react").JSX.Element;
|
|
39
|
+
trash: import("react").JSX.Element;
|
|
40
|
+
copy: import("react").JSX.Element;
|
|
41
|
+
close: import("react").JSX.Element;
|
|
42
|
+
undo: import("react").JSX.Element;
|
|
43
|
+
redo: import("react").JSX.Element;
|
|
44
|
+
eye: import("react").JSX.Element;
|
|
45
|
+
chevronDown: import("react").JSX.Element;
|
|
46
|
+
chevronUp: import("react").JSX.Element;
|
|
47
|
+
alignLeft: import("react").JSX.Element;
|
|
48
|
+
alignCenter: import("react").JSX.Element;
|
|
49
|
+
alignRight: import("react").JSX.Element;
|
|
50
|
+
alignJustify: import("react").JSX.Element;
|
|
51
|
+
chevron: import("react").JSX.Element;
|
|
52
|
+
sun: import("react").JSX.Element;
|
|
53
|
+
moon: import("react").JSX.Element;
|
|
54
|
+
search: import("react").JSX.Element;
|
|
55
|
+
alertCircle: import("react").JSX.Element;
|
|
56
|
+
arrowRight: import("react").JSX.Element;
|
|
57
|
+
link: import("react").JSX.Element;
|
|
58
|
+
accessibility: import("react").JSX.Element;
|
|
59
|
+
settings: import("react").JSX.Element;
|
|
60
|
+
strataTab: import("react").JSX.Element;
|
|
61
|
+
blogTitle: import("react").JSX.Element;
|
|
62
|
+
blogContent: import("react").JSX.Element;
|
|
63
|
+
blogFeaturedImage: import("react").JSX.Element;
|
|
64
|
+
blogDate: import("react").JSX.Element;
|
|
65
|
+
blogAuthor: import("react").JSX.Element;
|
|
66
|
+
blogCategories: import("react").JSX.Element;
|
|
67
|
+
blogComments: import("react").JSX.Element;
|
|
68
|
+
blogPostList: import("react").JSX.Element;
|
|
70
69
|
};
|