@charisol/plexo-sdk 1.1.3 → 1.1.5
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-Do7SiKdp.js → compiler-BUxk_f8d.js} +185 -189
- package/dist/compiler.js +1 -1
- package/dist/compilerClient.js +102 -90
- package/dist/components/icons.d.ts +8 -0
- package/dist/components/sidebarTabs/ContentTab.d.ts +2 -0
- package/dist/{iconSvgStatic-DKNX8fUj.js → iconSvgStatic-CeiuMavi.js} +62 -50
- package/dist/index.js +1801 -1484
- package/dist/plexo-sdk.css +1 -1
- package/dist/utilities/elementResolvers.d.ts +8 -0
- package/dist/utilities/playground.helpers.d.ts +108 -0
- package/dist/utilities/playground.interfaces.d.ts +9 -0
- package/dist/utilities/types.d.ts +1 -1
- package/package.json +1 -1
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-BUxk_f8d.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,32 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as e, a 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-CeiuMavi.js";
|
|
2
2
|
//#region src/utilities/compilerClient.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, u = /* @__PURE__ */ new Set([
|
|
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([
|
|
12
11
|
"selectable",
|
|
13
12
|
"draggable",
|
|
14
13
|
"duplicatable",
|
|
15
14
|
"deletable",
|
|
16
15
|
"hideable",
|
|
17
16
|
"locked"
|
|
18
|
-
]),
|
|
17
|
+
]), p = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), 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) => {
|
|
19
18
|
let n = { ...e.attributes || {} };
|
|
20
|
-
if (t === "email") for (let e of
|
|
19
|
+
if (t === "email") for (let e of f) delete n[e];
|
|
21
20
|
return n;
|
|
22
|
-
},
|
|
23
|
-
let 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" : "";
|
|
24
23
|
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>`;
|
|
25
|
-
let c =
|
|
26
|
-
return e.type === "textarea" ? `<textarea${l}${u} name="${a}" placeholder="${o}" style="${r}"${s}>${
|
|
27
|
-
},
|
|
28
|
-
let n =
|
|
29
|
-
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>${
|
|
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 || "") || " "}</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) => _({
|
|
30
29
|
id: `${e.id}-${String(t.name || t.label || "field")}`,
|
|
31
30
|
type: t.kind === "textarea" || t.kind === "select" ? t.kind : "input",
|
|
32
31
|
style: {
|
|
@@ -35,100 +34,113 @@ var l = {
|
|
|
35
34
|
},
|
|
36
35
|
attributes: t
|
|
37
36
|
}, "landing_page")).join("")}<button type="submit">${u}</button></form>`;
|
|
38
|
-
},
|
|
37
|
+
}, y = (e = {}, t = {}) => {
|
|
39
38
|
let n = [], r = e.fontSize || t.fontSize, i = e.fontWeight || t.fontWeight;
|
|
40
|
-
return r && n.push(`font-size="${
|
|
41
|
-
},
|
|
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 = {}) => {
|
|
42
41
|
let t = e.backgroundColor || e.background;
|
|
43
|
-
return t ? ` background-color="${
|
|
44
|
-
},
|
|
45
|
-
let
|
|
46
|
-
if (
|
|
47
|
-
if (
|
|
42
|
+
return t ? ` background-color="${p(String(t))}"` : "";
|
|
43
|
+
}, x = (e, u) => {
|
|
44
|
+
let f = g(e, u), b = m(e.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 (e.type === "form_container") return `${T}${v(e, u)}`;
|
|
46
|
+
if (e.type === "input" || e.type === "select" || e.type === "textarea") return `${T}${_(e, u)}`;
|
|
48
47
|
if (u === "email") {
|
|
49
|
-
if (
|
|
50
|
-
let
|
|
51
|
-
return `<mj-button href="${
|
|
48
|
+
if (e.type === "button") {
|
|
49
|
+
let n = p(f.href || "#"), r = p(f.text || "Button"), i = t(e).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>`;
|
|
52
51
|
}
|
|
53
|
-
if (
|
|
54
|
-
let t = e
|
|
55
|
-
return `<mj-image src="${
|
|
52
|
+
if (e.type === "image") {
|
|
53
|
+
let t = a(e), n = t.width && t.width !== "100%" ? ` width="${p(t.width)}"` : "", r = t.height && t.height !== "auto" ? ` height="${p(t.height)}"` : "";
|
|
54
|
+
return `<mj-image src="${p(f.src || "")}" alt="${p(f.alt || "")}"${n}${r} />`;
|
|
56
55
|
}
|
|
57
|
-
if (
|
|
58
|
-
let
|
|
59
|
-
|
|
56
|
+
if (e.type === "social") {
|
|
57
|
+
let t = r(e);
|
|
58
|
+
if (!t.length) return "";
|
|
59
|
+
let n = (e) => e === "square" ? "14px" : "9999px";
|
|
60
|
+
return `<mj-social font-size="13px" mode="horizontal">${t.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>`;
|
|
60
64
|
}
|
|
61
|
-
if (
|
|
62
|
-
if (
|
|
63
|
-
let
|
|
64
|
-
let o = a ? "th" : "td", s = a ?
|
|
65
|
-
return `<tr>${
|
|
66
|
-
},
|
|
67
|
-
return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${
|
|
65
|
+
if (e.type === "menu") return `<mj-navbar hamburger="hamburger">${n(e).map((e) => `<mj-navbar-link href="${p(e.href)}">${p(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
|
|
66
|
+
if (e.type === "table") {
|
|
67
|
+
let t = c(e), n = e.style || {}, r = `${n.borderWidth || "1px"} ${n.borderStyle || "solid"} ${n.borderColor || "#cbd5e1"}`, i = (e, i, a) => {
|
|
68
|
+
let o = a ? "th" : "td", s = a ? n.headerBgColor || "#f8fafc" : t.striped && i % 2 == 1 ? "#f8fafc" : n.contentBgColor || "#ffffff", c = a ? n.headerTextColor || "#1e293b" : n.contentTextColor || "#475569";
|
|
69
|
+
return `<tr>${e.map((e) => `<${o} style="padding: ${n.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${p(e) || " "}</${o}>`).join("")}</tr>`;
|
|
70
|
+
}, a = +!!t.enableHeader, o = t.enableFooter ? t.cells.length - 1 : t.cells.length;
|
|
71
|
+
return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${t.enableHeader && t.cells.length > 0 ? `<thead>${i(t.cells[0], 0, !0)}</thead>` : ""}<tbody>${t.cells.slice(a, Math.max(a, o)).map((e, t) => i(e, t, !1)).join("")}</tbody>${t.enableFooter && t.cells.length > a ? `<tfoot>${i(t.cells[t.cells.length - 1], t.cells.length - 1, !1)}</tfoot>` : ""}</table></mj-table>`;
|
|
68
72
|
}
|
|
69
|
-
if (
|
|
70
|
-
let e =
|
|
71
|
-
return `<mj-image src="${
|
|
73
|
+
if (e.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")}" />`;
|
|
72
76
|
}
|
|
73
|
-
if (
|
|
74
|
-
let e = o(
|
|
75
|
-
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 ${
|
|
77
|
+
if (e.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>`;
|
|
76
80
|
}
|
|
77
|
-
if (
|
|
78
|
-
let e = Array.isArray(
|
|
79
|
-
return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${
|
|
81
|
+
if (e.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>`;
|
|
80
84
|
}
|
|
81
|
-
if (
|
|
82
|
-
let
|
|
83
|
-
return `<mj-text align="center">${
|
|
85
|
+
if (e.type === "icon") {
|
|
86
|
+
let t = parseInt(String(f.iconSize || 48), 10) || 48, n = e.style?.color || "#1e293b";
|
|
87
|
+
return `<mj-text align="center">${l(f.iconName, t, n)}</mj-text>`;
|
|
84
88
|
}
|
|
85
|
-
let u =
|
|
86
|
-
if (
|
|
87
|
-
let
|
|
89
|
+
let u = f.hideOnDesktop ? "desktop-hide" : "";
|
|
90
|
+
if (e.type === "heading" || e.type === "paragraph" || e.type === "text") {
|
|
91
|
+
let t = e.type === "heading" ? {
|
|
88
92
|
fontSize: "24px",
|
|
89
93
|
fontWeight: "700"
|
|
90
|
-
} : { fontSize: "14px" },
|
|
91
|
-
return `<mj-text${
|
|
94
|
+
} : { fontSize: "14px" }, n = y(e.style || {}, t);
|
|
95
|
+
return `<mj-text${n ? ` ${n}` : ""} css-class="${u}">${f.text || ""}</mj-text>`;
|
|
92
96
|
}
|
|
93
|
-
if (
|
|
94
|
-
let
|
|
95
|
-
return `<mj-spacer height="${
|
|
97
|
+
if (e.type === "spacer") {
|
|
98
|
+
let t = e.style?.height || "24px";
|
|
99
|
+
return `<mj-spacer height="${p(String(t))}" />`;
|
|
96
100
|
}
|
|
97
|
-
if (
|
|
98
|
-
let
|
|
99
|
-
return `<mj-divider border-width="${
|
|
101
|
+
if (e.type === "divider") {
|
|
102
|
+
let t = e.style || {};
|
|
103
|
+
return `<mj-divider border-width="${p(String(t.borderWidth || "1px"))}" border-style="${p(String(t.borderStyle || "solid"))}" border-color="${p(String(t.borderColor || "#334155"))}" />`;
|
|
100
104
|
}
|
|
101
|
-
return
|
|
105
|
+
return e.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>` : e.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>`;
|
|
102
106
|
}
|
|
103
|
-
switch (
|
|
104
|
-
case "heading": return `${
|
|
107
|
+
switch (e.type) {
|
|
108
|
+
case "heading": return `${T}<h2${x}${C} style="${b}">${p(f.text || "Heading")}</h2>`;
|
|
105
109
|
case "paragraph":
|
|
106
|
-
case "text": return `${
|
|
107
|
-
case "button": return `${
|
|
108
|
-
case "image": return `${
|
|
109
|
-
case "html": return `${
|
|
110
|
-
|
|
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>`;
|
|
114
|
+
case "blog_title":
|
|
115
|
+
case "blog_content":
|
|
116
|
+
case "blog_featured_image":
|
|
117
|
+
case "blog_date":
|
|
118
|
+
case "blog_author":
|
|
119
|
+
case "blog_categories":
|
|
120
|
+
case "blog_comments":
|
|
121
|
+
case "blog_post_list": return `${T}<div${x}${C} data-plexo-blog-${e.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true" style="${b}"></div>`;
|
|
122
|
+
default: return `${T}<div${x}${C} style="${b}">${p(f.text || "")}</div>`;
|
|
111
123
|
}
|
|
112
|
-
},
|
|
113
|
-
if (
|
|
114
|
-
let
|
|
115
|
-
let
|
|
116
|
-
if (
|
|
124
|
+
}, S = (t, n) => {
|
|
125
|
+
if (n === "email") {
|
|
126
|
+
let r = new Map(t.elements.map((e) => [e.id, e])), i = new Map((Array.isArray(t.nestedRows) ? t.nestedRows : []).map((e) => [e.id, e])), a = e(t).map((e) => {
|
|
127
|
+
let t = r.get(e);
|
|
128
|
+
if (t) return x(t, n);
|
|
117
129
|
let a = i.get(e);
|
|
118
|
-
return a ? `<mj-raw>${
|
|
119
|
-
}).join(""), o =
|
|
120
|
-
return `<mj-column width="${
|
|
130
|
+
return a ? `<mj-raw>${C(a, "landing_page")}</mj-raw>` : "";
|
|
131
|
+
}).join(""), o = b(t.styles || {});
|
|
132
|
+
return `<mj-column width="${p(t.width || "100%")}"${o}>${a}</mj-column>`;
|
|
121
133
|
}
|
|
122
|
-
let
|
|
123
|
-
let
|
|
124
|
-
if (
|
|
134
|
+
let r = m(t.styles || {}), i = new Map(t.elements.map((e) => [e.id, e])), a = new Map((Array.isArray(t.nestedRows) ? t.nestedRows : []).map((e) => [e.id, e])), o = e(t).map((e) => {
|
|
135
|
+
let t = i.get(e);
|
|
136
|
+
if (t) return x(t, n);
|
|
125
137
|
let r = a.get(e);
|
|
126
|
-
return r ?
|
|
138
|
+
return r ? C(r, n) : "";
|
|
127
139
|
}).join("");
|
|
128
|
-
return `<div style="width:${
|
|
129
|
-
},
|
|
130
|
-
let n = (e.body?.rows || []).map((e) =>
|
|
140
|
+
return `<div style="width:${p(t.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 || {});
|
|
131
143
|
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>`;
|
|
132
144
|
};
|
|
133
145
|
//#endregion
|
|
134
|
-
export {
|
|
146
|
+
export { w as parseJsonToTargetFormat };
|
|
@@ -59,4 +59,12 @@ export declare const ICONS: {
|
|
|
59
59
|
accessibility: React.JSX.Element;
|
|
60
60
|
settings: React.JSX.Element;
|
|
61
61
|
strataTab: React.JSX.Element;
|
|
62
|
+
blogTitle: React.JSX.Element;
|
|
63
|
+
blogContent: React.JSX.Element;
|
|
64
|
+
blogFeaturedImage: React.JSX.Element;
|
|
65
|
+
blogDate: React.JSX.Element;
|
|
66
|
+
blogAuthor: React.JSX.Element;
|
|
67
|
+
blogCategories: React.JSX.Element;
|
|
68
|
+
blogComments: React.JSX.Element;
|
|
69
|
+
blogPostList: React.JSX.Element;
|
|
62
70
|
};
|
|
@@ -5,6 +5,8 @@ interface ContentTabProps {
|
|
|
5
5
|
ICONS: Record<string, React.ReactNode>;
|
|
6
6
|
tierFeatures?: SdkTierFeatures;
|
|
7
7
|
templateKind?: "landing_page" | "email" | string;
|
|
8
|
+
/** Shows the "Blog" block group below the regular palette — see PlexoBuilderProps.isBlogLayout. */
|
|
9
|
+
isBlogLayout?: boolean;
|
|
8
10
|
onTapAdd?: (data: any) => void;
|
|
9
11
|
}
|
|
10
12
|
export declare const ContentTab: React.FC<ContentTabProps>;
|
|
@@ -9,8 +9,20 @@ function t(e, t, n) {
|
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/utilities/elementResolvers.ts
|
|
12
|
-
var n = (e) => e === "twitter" ? "x" : e
|
|
13
|
-
|
|
12
|
+
var n = (e) => e === "twitter" ? "x" : e, r = (e, t = "currentColor") => {
|
|
13
|
+
switch (n(e)) {
|
|
14
|
+
case "facebook": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M14 8h2V4h-2c-2.2 0-4 1.8-4 4v2H8v4h2v6h4v-6h2.5l.5-4H14V8c0-.55.45-1 1-1Z"/></svg>`;
|
|
15
|
+
case "instagram": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="4" y="4" width="16" height="16" rx="5" ry="5" fill="none" stroke="${t}" stroke-width="2"/><circle cx="12" cy="12" r="3.5" fill="none" stroke="${t}" stroke-width="2"/><circle cx="17" cy="7" r="1" fill="${t}"/></svg>`;
|
|
16
|
+
case "linkedin": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><circle cx="8" cy="9" r="1.25" fill="${t}"/><path fill="${t}" d="M7 11h2v6H7zM11 11h2v.9c.5-.7 1.34-1.15 2.4-1.15 2 0 3.1 1.25 3.1 3.6V17h-2v-2.2c0-1.3-.45-2.05-1.55-2.05-1.2 0-1.85.8-1.85 2.05V17h-2z"/></svg>`;
|
|
17
|
+
case "x": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M6 5h3.1l3 4.2L15.7 5H18l-4.8 5.5L18.4 18h-3.1l-3.3-4.7L8 18H5.6l5-5.8z"/></svg>`;
|
|
18
|
+
case "youtube": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="3" y="6.5" width="18" height="11" rx="3" fill="${t}"/><path fill="#fff" d="m10 9 5 3-5 3z"/></svg>`;
|
|
19
|
+
case "pinterest": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M12 4a8 8 0 0 0-2.9 15.46c-.04-1.17 0-2.58.3-3.82l1.1-4.6s-.27-.56-.27-1.4c0-1.3.75-2.27 1.68-2.27.8 0 1.18.6 1.18 1.3 0 .8-.5 2-.77 3.12-.22.94.47 1.7 1.4 1.7 1.67 0 2.8-2.15 2.8-4.7 0-1.93-1.3-3.37-3.67-3.37-2.68 0-4.35 2-4.35 4.23 0 .77.23 1.34.6 1.77.17.2.2.29.13.53l-.2.8c-.07.25-.3.34-.56.25-1.55-.63-2.27-2.32-2.27-4.22 0-3.14 2.64-6.9 7.89-6.9 4.21 0 6.98 3.05 6.98 6.32 0 4.32-2.4 7.54-5.93 7.54-1.18 0-2.28-.64-2.65-1.37l-.73 2.78c-.26.95-.77 2.14-1.22 2.96A8 8 0 1 0 12 4Z"/></svg>`;
|
|
20
|
+
case "whatsapp": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M12 4a8 8 0 0 0-6.9 12.04L4 20l4.11-1.06A8 8 0 1 0 12 4Zm4.55 11.36c-.2.56-1.14 1.04-1.57 1.1-.4.06-.92.09-1.48-.08-.34-.11-.78-.25-1.35-.5-2.37-1.03-3.92-3.45-4.04-3.6-.11-.15-.96-1.27-.96-2.42s.6-1.72.8-1.96c.2-.24.45-.3.6-.3h.43c.14 0 .33-.05.51.38.2.48.7 1.67.75 1.79.06.12.1.26.02.42-.07.15-.11.26-.22.39-.11.13-.23.29-.33.39-.11.11-.22.23-.1.45.11.22.52.86 1.11 1.39.76.68 1.4.89 1.62.99.22.11.35.09.48-.06.13-.15.56-.65.72-.88.15-.22.31-.18.52-.11.22.08 1.36.64 1.6.76.23.11.38.17.44.27.06.1.06.61-.14 1.17Z"/></svg>`;
|
|
21
|
+
case "tiktok": return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${t}" d="M14.4 4c.24 1.12.9 2.08 1.86 2.67.7.42 1.52.64 2.35.63V10a6.5 6.5 0 0 1-4.2-1.52v5.24A4.72 4.72 0 1 1 9.7 9v2.6a2.12 2.12 0 1 0 2.1 2.12V4z"/></svg>`;
|
|
22
|
+
default: return `<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><circle cx="12" cy="12" r="4" fill="${t}"/></svg>`;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function i(e) {
|
|
14
26
|
let t = e.attributes || {}, r = e.style || {};
|
|
15
27
|
return (Array.isArray(t.links) ? t.links : []).filter((e) => e && typeof e == "object").map((e) => ({
|
|
16
28
|
provider: n(String(e.provider || "")),
|
|
@@ -21,21 +33,21 @@ function r(e) {
|
|
|
21
33
|
iconType: (e.iconType || t.iconType) === "square" ? "square" : "circle"
|
|
22
34
|
}));
|
|
23
35
|
}
|
|
24
|
-
function
|
|
36
|
+
function a(e) {
|
|
25
37
|
let t = e.attributes || {};
|
|
26
38
|
return (Array.isArray(t.links) ? t.links : []).filter((e) => e && typeof e == "object").map((e) => ({
|
|
27
39
|
label: typeof e.label == "string" && e.label.trim() ? e.label : "Link",
|
|
28
40
|
href: typeof e.href == "string" && e.href.trim() ? e.href : "#"
|
|
29
41
|
}));
|
|
30
42
|
}
|
|
31
|
-
function
|
|
43
|
+
function o(e) {
|
|
32
44
|
let t = e.style || {}, n = e.attributes || {};
|
|
33
45
|
return {
|
|
34
46
|
width: t.width || "100%",
|
|
35
47
|
height: n.autoHeight === !1 && t.height || "auto"
|
|
36
48
|
};
|
|
37
49
|
}
|
|
38
|
-
function
|
|
50
|
+
function s(e, t, n, r) {
|
|
39
51
|
if (e) return e;
|
|
40
52
|
if (t) {
|
|
41
53
|
let e = t.trim().split(/\s+/).filter(Boolean);
|
|
@@ -51,22 +63,22 @@ function o(e, t, n, r) {
|
|
|
51
63
|
}
|
|
52
64
|
return r;
|
|
53
65
|
}
|
|
54
|
-
function
|
|
66
|
+
function c(e) {
|
|
55
67
|
let t = e.style || {}, n = e.attributes || {};
|
|
56
68
|
return {
|
|
57
69
|
width: n.autoWidth === !1 ? t.width || "100%" : "auto",
|
|
58
70
|
height: n.autoHeight === !1 && t.height || "auto"
|
|
59
71
|
};
|
|
60
72
|
}
|
|
61
|
-
function
|
|
73
|
+
function l(e) {
|
|
62
74
|
let t = e.style || {};
|
|
63
75
|
return (e.attributes || {}).autoHeight === !1 && t.height || "auto";
|
|
64
76
|
}
|
|
65
|
-
function
|
|
77
|
+
function u(e, t) {
|
|
66
78
|
let n = e.style || {};
|
|
67
79
|
return (e.attributes || {}).autoHeight === !1 && n.height || t;
|
|
68
80
|
}
|
|
69
|
-
var
|
|
81
|
+
var d = [
|
|
70
82
|
"showLabel",
|
|
71
83
|
"fontSize",
|
|
72
84
|
"labelFontWeight",
|
|
@@ -77,16 +89,16 @@ var u = [
|
|
|
77
89
|
"inputTextColor",
|
|
78
90
|
"placeholderColor"
|
|
79
91
|
];
|
|
80
|
-
function
|
|
92
|
+
function f(e) {
|
|
81
93
|
let t = null;
|
|
82
94
|
return (Array.isArray(e) ? e : []).map((e) => {
|
|
83
95
|
let n = e?.inheritStylesFromPrevious && t ? { ...e } : e;
|
|
84
|
-
if (e?.inheritStylesFromPrevious && t) for (let e of
|
|
96
|
+
if (e?.inheritStylesFromPrevious && t) for (let e of d) n[e] = t[e];
|
|
85
97
|
return t = n, n;
|
|
86
98
|
});
|
|
87
99
|
}
|
|
88
|
-
var
|
|
89
|
-
function
|
|
100
|
+
var p = (e) => String(Math.max(0, e)).padStart(2, "0");
|
|
101
|
+
function m(e, t, n = Date.now()) {
|
|
90
102
|
let r = e ? Date.parse(e) : NaN, i = Number.isNaN(r) ? n : r, a = i - n;
|
|
91
103
|
if (a <= 0) return {
|
|
92
104
|
days: "00",
|
|
@@ -98,31 +110,31 @@ function p(e, t, n = Date.now()) {
|
|
|
98
110
|
};
|
|
99
111
|
let o = Math.floor(a / 1e3), s = Math.floor(o / 86400), c = Math.floor(o % 86400 / 3600), l = Math.floor(o % 3600 / 60), u = o % 60;
|
|
100
112
|
return {
|
|
101
|
-
days:
|
|
102
|
-
hours:
|
|
103
|
-
minutes:
|
|
104
|
-
seconds:
|
|
113
|
+
days: p(s),
|
|
114
|
+
hours: p(c),
|
|
115
|
+
minutes: p(l),
|
|
116
|
+
seconds: p(u),
|
|
105
117
|
isExpired: !1,
|
|
106
118
|
targetTimestamp: i
|
|
107
119
|
};
|
|
108
120
|
}
|
|
109
|
-
var
|
|
121
|
+
var h = [
|
|
110
122
|
"youtube.com",
|
|
111
123
|
"www.youtube.com",
|
|
112
124
|
"youtu.be",
|
|
113
125
|
"m.youtube.com"
|
|
114
126
|
];
|
|
115
|
-
function
|
|
127
|
+
function g(e) {
|
|
116
128
|
return e.hostname === "youtu.be" ? e.pathname.slice(1).split("/")[0] || null : e.pathname.startsWith("/embed/") ? e.pathname.slice(7).split("/")[0] || null : e.pathname.startsWith("/shorts/") ? e.pathname.slice(8).split("/")[0] || null : e.searchParams.get("v");
|
|
117
129
|
}
|
|
118
|
-
function
|
|
130
|
+
function _(e) {
|
|
119
131
|
let t = e.pathname.match(/(\d+)/);
|
|
120
132
|
return t ? t[1] : null;
|
|
121
133
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
134
|
+
var v = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22640%22%20height%3D%22360%22%20viewBox%3D%220%200%20640%20360%22%3E%3Crect%20width%3D%22640%22%20height%3D%22360%22%20fill%3D%22%230f172a%22%2F%3E%3Ccircle%20cx%3D%22320%22%20cy%3D%22180%22%20r%3D%2248%22%20fill%3D%22%23ffffff%22%20opacity%3D%220.9%22%2F%3E%3Cpath%20d%3D%22M304%20156%20L356%20180%20L304%20204%20Z%22%20fill%3D%22%230f172a%22%2F%3E%3C%2Fsvg%3E";
|
|
135
|
+
function y(e) {
|
|
124
136
|
if (!e || typeof e != "string") return {
|
|
125
|
-
thumbnailUrl:
|
|
137
|
+
thumbnailUrl: v,
|
|
126
138
|
provider: "unknown"
|
|
127
139
|
};
|
|
128
140
|
let t;
|
|
@@ -130,34 +142,34 @@ function v(e) {
|
|
|
130
142
|
t = new URL(e);
|
|
131
143
|
} catch {
|
|
132
144
|
return {
|
|
133
|
-
thumbnailUrl:
|
|
145
|
+
thumbnailUrl: v,
|
|
134
146
|
provider: "unknown"
|
|
135
147
|
};
|
|
136
148
|
}
|
|
137
|
-
if (
|
|
138
|
-
let e =
|
|
149
|
+
if (h.includes(t.hostname)) {
|
|
150
|
+
let e = g(t);
|
|
139
151
|
if (e) return {
|
|
140
152
|
thumbnailUrl: `https://img.youtube.com/vi/${e}/hqdefault.jpg`,
|
|
141
153
|
provider: "youtube"
|
|
142
154
|
};
|
|
143
155
|
}
|
|
144
156
|
if (t.hostname === "vimeo.com" || t.hostname === "www.vimeo.com" || t.hostname === "player.vimeo.com") {
|
|
145
|
-
let e =
|
|
157
|
+
let e = _(t);
|
|
146
158
|
if (e) return {
|
|
147
159
|
thumbnailUrl: `https://vumbnail.com/${e}.jpg`,
|
|
148
160
|
provider: "vimeo"
|
|
149
161
|
};
|
|
150
162
|
}
|
|
151
163
|
return {
|
|
152
|
-
thumbnailUrl:
|
|
164
|
+
thumbnailUrl: v,
|
|
153
165
|
provider: "unknown"
|
|
154
166
|
};
|
|
155
167
|
}
|
|
156
|
-
function
|
|
168
|
+
function b(e, t) {
|
|
157
169
|
let n = e || "Star", r = n.replace(/[-_]([a-z0-9])/gi, (e, t) => t.toUpperCase()).replace(/^\w/, (e) => e.toUpperCase()), i = n.toLowerCase().replace(/[-_]/g, "");
|
|
158
170
|
return t.includes(n) ? n : t.includes(r) ? r : t.includes(`${r}Icon`) ? `${r}Icon` : t.find((e) => e.toLowerCase().replace(/[-_]/g, "") === i) || "HelpCircle";
|
|
159
171
|
}
|
|
160
|
-
function
|
|
172
|
+
function x(e) {
|
|
161
173
|
let t = e.attributes || {}, n = Math.max(1, Number(t.rowCount) || 2), r = Math.max(1, Number(t.colCount) || 2), i = Array.isArray(t.cells) ? t.cells : [], a = [];
|
|
162
174
|
for (let e = 0; e < n; e++) {
|
|
163
175
|
let t = Array.isArray(i[e]) ? i[e] : [], n = [];
|
|
@@ -173,29 +185,29 @@ function b(e) {
|
|
|
173
185
|
striped: !!t.striped
|
|
174
186
|
};
|
|
175
187
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
178
|
-
let r = n <
|
|
188
|
+
var S = 8;
|
|
189
|
+
function C(e, t, n) {
|
|
190
|
+
let r = n < S && Array.isArray(e?.children) ? e.children : [];
|
|
179
191
|
return {
|
|
180
192
|
id: typeof e?.id == "string" && e.id ? e.id : `item-${t}`,
|
|
181
193
|
title: typeof e?.title == "string" && e.title.trim() ? e.title : `Item ${t + 1}`,
|
|
182
194
|
content: typeof e?.content == "string" ? e.content : "",
|
|
183
195
|
defaultOpen: !!e?.defaultOpen,
|
|
184
|
-
children: r.map((e, t) =>
|
|
196
|
+
children: r.map((e, t) => C(e, t, n + 1))
|
|
185
197
|
};
|
|
186
198
|
}
|
|
187
|
-
function
|
|
199
|
+
function w(e, t) {
|
|
188
200
|
if (t !== "multi") {
|
|
189
201
|
let t = !1;
|
|
190
202
|
for (let n of e) n.defaultOpen && (t ? n.defaultOpen = !1 : t = !0);
|
|
191
203
|
}
|
|
192
|
-
for (let n of e)
|
|
204
|
+
for (let n of e) w(n.children, t);
|
|
193
205
|
}
|
|
194
|
-
function
|
|
195
|
-
let t = e.attributes || {}, n = t.mode === "multi" ? "multi" : "single", r = (Array.isArray(t.items) ? t.items : []).map((e, t) =>
|
|
196
|
-
return
|
|
206
|
+
function T(e) {
|
|
207
|
+
let t = e.attributes || {}, n = t.mode === "multi" ? "multi" : "single", r = (Array.isArray(t.items) ? t.items : []).map((e, t) => C(e, t, 0));
|
|
208
|
+
return w(r, n), r;
|
|
197
209
|
}
|
|
198
|
-
function
|
|
210
|
+
function E(e, t, n) {
|
|
199
211
|
let r = JSON.parse(JSON.stringify(Array.isArray(e) ? e : [])), i = (e, t) => {
|
|
200
212
|
let [r, ...a] = t;
|
|
201
213
|
if (e[r]) {
|
|
@@ -213,7 +225,7 @@ function T(e, t, n) {
|
|
|
213
225
|
}
|
|
214
226
|
//#endregion
|
|
215
227
|
//#region src/utilities/iconSvgStatic.ts
|
|
216
|
-
var
|
|
228
|
+
var D = {
|
|
217
229
|
"a-arrow-down": [
|
|
218
230
|
["path", { d: "m14 12 4 4 4-4" }],
|
|
219
231
|
["path", { d: "M18 16V7" }],
|
|
@@ -15033,18 +15045,18 @@ var E = {
|
|
|
15033
15045
|
y2: "11"
|
|
15034
15046
|
}]
|
|
15035
15047
|
]
|
|
15036
|
-
},
|
|
15037
|
-
function
|
|
15048
|
+
}, O = "circle-help";
|
|
15049
|
+
function k(e) {
|
|
15038
15050
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
15039
15051
|
}
|
|
15040
|
-
function
|
|
15041
|
-
let t = e || "HelpCircle", n =
|
|
15042
|
-
if (
|
|
15052
|
+
function A(e) {
|
|
15053
|
+
let t = e || "HelpCircle", n = k(t.replace(/^\w/, (e) => e.toUpperCase()));
|
|
15054
|
+
if (D[n]) return n;
|
|
15043
15055
|
let r = t.toLowerCase().replace(/[-_\s]/g, "");
|
|
15044
|
-
return Object.keys(
|
|
15056
|
+
return Object.keys(D).find((e) => e.replace(/-/g, "") === r) || O;
|
|
15045
15057
|
}
|
|
15046
|
-
function
|
|
15047
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="${n}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${(
|
|
15058
|
+
function j(e, t, n) {
|
|
15059
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="${n}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${(D[A(e)] || D[O] || []).map(([e, t]) => `<${e} ${Object.entries(t).map(([e, t]) => `${e}="${String(t)}"`).join(" ")}></${e}>`).join("")}</svg>`;
|
|
15048
15060
|
}
|
|
15049
15061
|
//#endregion
|
|
15050
|
-
export {
|
|
15062
|
+
export { e as _, c as a, u as c, a as d, i as f, E as g, y as h, s as i, o as l, m, r as n, l as o, x as p, T as r, f as s, j as t, b as u, t as v };
|