@charisol/plexo-sdk 1.0.43 → 1.0.45
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-BEQo1civ.js → compiler-Do7SiKdp.js} +85 -78
- package/dist/compiler.js +1 -1
- package/dist/compilerClient.js +87 -74
- package/dist/{iconSvgStatic-DubpApuZ.js → iconSvgStatic-DKNX8fUj.js} +69 -59
- package/dist/index.js +14430 -14370
- package/dist/plexo-sdk.css +1 -1
- package/dist/store.d.ts +1 -1
- package/dist/utilities/columnOrder.d.ts +17 -0
- package/dist/utilities/dndCollision.d.ts +0 -16
- package/dist/utilities/types.d.ts +10 -0
- package/package.json +1 -1
package/dist/compilerClient.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as e, d as t, f as n,
|
|
1
|
+
import { c as e, d as t, f as n, g as r, i, m as a, p as o, t as s, u as c } from "./iconSvgStatic-DKNX8fUj.js";
|
|
2
2
|
//#region src/utilities/compilerClient.ts
|
|
3
|
-
var
|
|
3
|
+
var l = {
|
|
4
4
|
facebook: "facebook",
|
|
5
5
|
x: "twitter",
|
|
6
6
|
twitter: "twitter",
|
|
@@ -8,25 +8,25 @@ var c = {
|
|
|
8
8
|
instagram: "instagram",
|
|
9
9
|
youtube: "youtube",
|
|
10
10
|
pinterest: "pinterest"
|
|
11
|
-
},
|
|
11
|
+
}, u = /* @__PURE__ */ new Set([
|
|
12
12
|
"selectable",
|
|
13
13
|
"draggable",
|
|
14
14
|
"duplicatable",
|
|
15
15
|
"deletable",
|
|
16
16
|
"hideable",
|
|
17
17
|
"locked"
|
|
18
|
-
]),
|
|
18
|
+
]), d = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), f = (e = {}) => Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}:${String(t)};`).join(""), p = (...e) => e.map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), m = (e, t) => {
|
|
19
19
|
let n = { ...e.attributes || {} };
|
|
20
|
-
if (t === "email") for (let e of
|
|
20
|
+
if (t === "email") for (let e of u) delete n[e];
|
|
21
21
|
return n;
|
|
22
|
-
}, m = (e, t) => {
|
|
23
|
-
let n = p(e, t), r = d(e.style || {}), i = f(n.htmlClassNames, n.htmlClass, n.validationClass, n.validationClassName), a = u(n.name || n.fieldName || "field"), o = u(n.placeholder || ""), s = n.required ? " required" : "";
|
|
24
|
-
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 = u(n.inputType || n.type || (e.type === "input" ? n.kind || "text" : e.type)), l = n.htmlId ? ` id="${u(n.htmlId)}"` : "", m = i ? ` class="${u(i)}"` : "";
|
|
26
|
-
return e.type === "textarea" ? `<textarea${l}${m} name="${a}" placeholder="${o}" style="${r}"${s}>${u(n.value || "")}</textarea>` : e.type === "select" ? `<select${l}${m} name="${a}" style="${r}"${s}>${(n.options || []).map((e) => `<option value="${u(e.value)}">${u(e.label)}</option>`).join("")}</select>` : `<input${l}${m} type="${c}" name="${a}" placeholder="${o}" value="${u(n.value || "")}" style="${r}"${s} />`;
|
|
27
22
|
}, h = (e, t) => {
|
|
28
|
-
let n =
|
|
29
|
-
|
|
23
|
+
let n = m(e, t), r = f(e.style || {}), i = p(n.htmlClassNames, n.htmlClass, n.validationClass, n.validationClassName), a = d(n.name || n.fieldName || "field"), o = d(n.placeholder || ""), s = n.required ? " required" : "";
|
|
24
|
+
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 = d(n.inputType || n.type || (e.type === "input" ? n.kind || "text" : e.type)), l = n.htmlId ? ` id="${d(n.htmlId)}"` : "", u = i ? ` class="${d(i)}"` : "";
|
|
26
|
+
return e.type === "textarea" ? `<textarea${l}${u} name="${a}" placeholder="${o}" style="${r}"${s}>${d(n.value || "")}</textarea>` : e.type === "select" ? `<select${l}${u} name="${a}" style="${r}"${s}>${(n.options || []).map((e) => `<option value="${d(e.value)}">${d(e.label)}</option>`).join("")}</select>` : `<input${l}${u} type="${c}" name="${a}" placeholder="${o}" value="${d(n.value || "")}" style="${r}"${s} />`;
|
|
27
|
+
}, g = (e, t) => {
|
|
28
|
+
let n = m(e, t), r = f(e.style || {}), i = p(n.htmlClassNames, n.htmlClass), a = n.htmlId ? ` id="${d(n.htmlId)}"` : "", o = i ? ` class="${d(i)}"` : "", s = d(n.actionUrl || n.action || "#"), c = d(n.method || "POST"), l = n.fields || [], u = d(n.submitLabel || "Submit");
|
|
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>${d(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;">${d(e.placeholder || "") || " "}</span></td></tr>`).join("")}<tr><td style="padding-top:12px;"><a href="${d(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) => h({
|
|
30
30
|
id: `${e.id}-${String(t.name || t.label || "field")}`,
|
|
31
31
|
type: t.kind === "textarea" || t.kind === "select" ? t.kind : "input",
|
|
32
32
|
style: {
|
|
@@ -34,88 +34,101 @@ var c = {
|
|
|
34
34
|
...t.style || {}
|
|
35
35
|
},
|
|
36
36
|
attributes: t
|
|
37
|
-
}, "landing_page")).join("")}<button type="submit">${
|
|
38
|
-
},
|
|
37
|
+
}, "landing_page")).join("")}<button type="submit">${u}</button></form>`;
|
|
38
|
+
}, _ = (e = {}, t = {}) => {
|
|
39
39
|
let n = [], r = e.fontSize || t.fontSize, i = e.fontWeight || t.fontWeight;
|
|
40
|
-
return r && n.push(`font-size="${
|
|
41
|
-
},
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
return r && n.push(`font-size="${d(String(r))}"`), i && n.push(`font-weight="${d(String(i))}"`), e.color && n.push(`color="${d(String(e.color))}"`), e.fontFamily && n.push(`font-family="${d(String(e.fontFamily))}"`), e.lineHeight && n.push(`line-height="${d(String(e.lineHeight))}"`), e.letterSpacing && n.push(`letter-spacing="${d(String(e.letterSpacing))}"`), e.textAlign && n.push(`align="${d(String(e.textAlign))}"`), e.backgroundColor && n.push(`container-background-color="${d(String(e.backgroundColor))}"`), n.join(" ");
|
|
41
|
+
}, v = (e = {}) => {
|
|
42
|
+
let t = e.backgroundColor || e.background;
|
|
43
|
+
return t ? ` background-color="${d(String(t))}"` : "";
|
|
44
|
+
}, y = (r, u) => {
|
|
45
|
+
let v = m(r, u), y = f(r.style || {}), b = v.htmlId ? ` id="${d(v.htmlId)}"` : "", x = p(v.htmlClassNames, v.htmlClass, u === "landing_page" && v.hideOnMobile ? "hidden md:block" : ""), S = x ? ` class="${d(x)}"` : "", C = typeof v.customCss == "string" && v.customCss.trim() ? v.customCss.trim() : "", w = C && u === "landing_page" ? `<style>${C}</style>` : "";
|
|
46
|
+
if (r.type === "form_container") return `${w}${g(r, u)}`;
|
|
47
|
+
if (r.type === "input" || r.type === "select" || r.type === "textarea") return `${w}${h(r, u)}`;
|
|
48
|
+
if (u === "email") {
|
|
49
|
+
if (r.type === "button") {
|
|
50
|
+
let e = d(v.href || "#"), t = d(v.text || "Button"), n = i(r).width, a = n === "auto" ? "" : ` width="${d(n)}"`;
|
|
51
|
+
return `<mj-button href="${e}" css-class="${v.hideOnDesktop ? "desktop-hide" : ""}" padding="0" inner-padding="10px 16px"${a}>${t}</mj-button>`;
|
|
49
52
|
}
|
|
50
|
-
if (
|
|
51
|
-
let t = e(
|
|
52
|
-
return `<mj-image src="${
|
|
53
|
+
if (r.type === "image") {
|
|
54
|
+
let t = e(r), n = t.width && t.width !== "100%" ? ` width="${d(t.width)}"` : "", i = t.height && t.height !== "auto" ? ` height="${d(t.height)}"` : "";
|
|
55
|
+
return `<mj-image src="${d(v.src || "")}" alt="${d(v.alt || "")}"${n}${i} />`;
|
|
53
56
|
}
|
|
54
|
-
if (
|
|
55
|
-
let e = t(
|
|
56
|
-
return `${n.length ? `<mj-social font-size="13px" icon-size="30px" mode="horizontal">${n.map((e) => `<mj-social-element name="${
|
|
57
|
+
if (r.type === "social") {
|
|
58
|
+
let e = t(r), n = e.filter((e) => l[e.provider]), i = e.filter((e) => !l[e.provider]);
|
|
59
|
+
return `${n.length ? `<mj-social font-size="13px" icon-size="30px" mode="horizontal">${n.map((e) => `<mj-social-element name="${l[e.provider]}" href="${d(e.url)}" background-color="${d(e.backgroundColor)}" color="${d(e.color)}"></mj-social-element>`).join("")}</mj-social>` : ""}${i.length ? `<mj-text align="center">${i.map((e) => `<a href="${d(e.url)}" style="color: ${d(e.color)}; text-decoration: none; margin: 0 6px;">${d(e.provider)}</a>`).join("")}</mj-text>` : ""}`;
|
|
57
60
|
}
|
|
58
|
-
if (
|
|
59
|
-
if (
|
|
60
|
-
let e = n(
|
|
61
|
-
let o = a ? "th" : "td", s = a ? t.headerBgColor || "#f8fafc" : e.striped &&
|
|
62
|
-
return `<tr>${n.map((e) => `<${o} style="padding: ${t.cellPadding || "8px"}; border: ${
|
|
63
|
-
},
|
|
64
|
-
return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${e.enableHeader && e.cells.length > 0 ? `<thead>${
|
|
61
|
+
if (r.type === "menu") return `<mj-navbar hamburger="hamburger">${c(r).map((e) => `<mj-navbar-link href="${d(e.href)}">${d(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
|
|
62
|
+
if (r.type === "table") {
|
|
63
|
+
let e = n(r), t = r.style || {}, i = `${t.borderWidth || "1px"} ${t.borderStyle || "solid"} ${t.borderColor || "#cbd5e1"}`, a = (n, r, a) => {
|
|
64
|
+
let o = a ? "th" : "td", s = a ? t.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : t.contentBgColor || "#ffffff", c = a ? t.headerTextColor || "#1e293b" : t.contentTextColor || "#475569";
|
|
65
|
+
return `<tr>${n.map((e) => `<${o} style="padding: ${t.cellPadding || "8px"}; border: ${i}; background-color: ${s}; color: ${c};">${d(e) || " "}</${o}>`).join("")}</tr>`;
|
|
66
|
+
}, o = +!!e.enableHeader, s = e.enableFooter ? e.cells.length - 1 : e.cells.length;
|
|
67
|
+
return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${e.enableHeader && e.cells.length > 0 ? `<thead>${a(e.cells[0], 0, !0)}</thead>` : ""}<tbody>${e.cells.slice(o, Math.max(o, s)).map((e, t) => a(e, t, !1)).join("")}</tbody>${e.enableFooter && e.cells.length > o ? `<tfoot>${a(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : ""}</table></mj-table>`;
|
|
65
68
|
}
|
|
66
|
-
if (
|
|
67
|
-
let e =
|
|
68
|
-
return `<mj-image src="${
|
|
69
|
+
if (r.type === "video") {
|
|
70
|
+
let e = a(v.videoUrl), t = v.linkType === "email" ? `mailto:${v.href || ""}` : v.href || v.videoUrl || "#";
|
|
71
|
+
return `<mj-image src="${d(e.thumbnailUrl)}" href="${d(t)}" alt="${d(v.alt || "Video preview")}" />`;
|
|
69
72
|
}
|
|
70
|
-
if (
|
|
71
|
-
let e =
|
|
72
|
-
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 ${
|
|
73
|
+
if (r.type === "timer") {
|
|
74
|
+
let e = o(v.targetDate), t = v.showLabels !== !1;
|
|
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 ${d(v.targetDate || "")}</div>` : ""}</mj-text>`;
|
|
73
76
|
}
|
|
74
|
-
if (
|
|
77
|
+
if (r.type === "carousel") {
|
|
75
78
|
let e = Array.isArray(v.images) ? v.images : [];
|
|
76
|
-
return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${
|
|
79
|
+
return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${d(e.src)}" alt="${d(e.alt || "")}" />`).join("")}</mj-carousel>`;
|
|
77
80
|
}
|
|
78
|
-
if (
|
|
79
|
-
let e = parseInt(String(v.iconSize || 48), 10) || 48, t =
|
|
80
|
-
return `<mj-text align="center">${
|
|
81
|
+
if (r.type === "icon") {
|
|
82
|
+
let e = parseInt(String(v.iconSize || 48), 10) || 48, t = r.style?.color || "#1e293b";
|
|
83
|
+
return `<mj-text align="center">${s(v.iconName, e, t)}</mj-text>`;
|
|
81
84
|
}
|
|
82
|
-
let
|
|
83
|
-
if (
|
|
84
|
-
let e =
|
|
85
|
+
let u = v.hideOnDesktop ? "desktop-hide" : "";
|
|
86
|
+
if (r.type === "heading" || r.type === "paragraph" || r.type === "text") {
|
|
87
|
+
let e = r.type === "heading" ? {
|
|
85
88
|
fontSize: "24px",
|
|
86
89
|
fontWeight: "700"
|
|
87
|
-
} : { fontSize: "14px" }, t =
|
|
88
|
-
return `<mj-text${t ? ` ${t}` : ""} css-class="${
|
|
90
|
+
} : { fontSize: "14px" }, t = _(r.style || {}, e);
|
|
91
|
+
return `<mj-text${t ? ` ${t}` : ""} css-class="${u}">${v.text || ""}</mj-text>`;
|
|
89
92
|
}
|
|
90
|
-
if (
|
|
91
|
-
let e =
|
|
92
|
-
return `<mj-spacer height="${
|
|
93
|
+
if (r.type === "spacer") {
|
|
94
|
+
let e = r.style?.height || "24px";
|
|
95
|
+
return `<mj-spacer height="${d(String(e))}" />`;
|
|
93
96
|
}
|
|
94
|
-
if (
|
|
95
|
-
let e =
|
|
96
|
-
return `<mj-divider border-width="${
|
|
97
|
+
if (r.type === "divider") {
|
|
98
|
+
let e = r.style || {};
|
|
99
|
+
return `<mj-divider border-width="${d(String(e.borderWidth || "1px"))}" border-style="${d(String(e.borderStyle || "solid"))}" border-color="${d(String(e.borderColor || "#334155"))}" />`;
|
|
97
100
|
}
|
|
98
|
-
return
|
|
101
|
+
return r.type === "card" ? `<mj-text css-class="${u}"><strong style="display:block;margin-bottom:8px;">${d(v.title || "Card Title")}</strong><span style="font-size:14px;color:#64748b;">${d(v.description || "Card description.")}</span></mj-text>` : r.type === "html" ? `<mj-text css-class="${u}">${v.htmlContent || v.text || ""}</mj-text>` : `<mj-text${b}${S} css-class="${u}">${d(v.text || v.htmlContent || "")}</mj-text>`;
|
|
99
102
|
}
|
|
100
|
-
switch (
|
|
101
|
-
case "heading": return `${w}<h2${b}${S} style="${y}">${
|
|
103
|
+
switch (r.type) {
|
|
104
|
+
case "heading": return `${w}<h2${b}${S} style="${y}">${d(v.text || "Heading")}</h2>`;
|
|
102
105
|
case "paragraph":
|
|
103
|
-
case "text": return `${w}<p${b}${S} style="${y}">${
|
|
104
|
-
case "button": return `${w}<a${b}${S} href="${
|
|
105
|
-
case "image": return `${w}<img${b}${S} src="${
|
|
106
|
+
case "text": return `${w}<p${b}${S} style="${y}">${d(v.text || "")}</p>`;
|
|
107
|
+
case "button": return `${w}<a${b}${S} href="${d(v.href || "#")}" style="${y}">${d(v.text || "Button")}</a>`;
|
|
108
|
+
case "image": return `${w}<img${b}${S} src="${d(v.src || "")}" alt="${d(v.alt || "")}" style="${y}" />`;
|
|
106
109
|
case "html": return `${w}<div${b}${S} style="${y}">${String(v.htmlContent || "")}</div>`;
|
|
107
|
-
default: return `${w}<div${b}${S} style="${y}">${
|
|
110
|
+
default: return `${w}<div${b}${S} style="${y}">${d(v.text || "")}</div>`;
|
|
108
111
|
}
|
|
109
|
-
},
|
|
112
|
+
}, b = (e, t) => {
|
|
110
113
|
if (t === "email") {
|
|
111
|
-
let n = e.elements.map((e) =>
|
|
112
|
-
|
|
114
|
+
let n = new Map(e.elements.map((e) => [e.id, e])), i = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), a = r(e).map((e) => {
|
|
115
|
+
let r = n.get(e);
|
|
116
|
+
if (r) return y(r, t);
|
|
117
|
+
let a = i.get(e);
|
|
118
|
+
return a ? `<mj-raw>${x(a, "landing_page")}</mj-raw>` : "";
|
|
119
|
+
}).join(""), o = v(e.styles || {});
|
|
120
|
+
return `<mj-column width="${d(e.width || "100%")}"${o}>${a}</mj-column>`;
|
|
113
121
|
}
|
|
114
|
-
let n =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
let n = f(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 = r(e).map((e) => {
|
|
123
|
+
let n = i.get(e);
|
|
124
|
+
if (n) return y(n, t);
|
|
125
|
+
let r = a.get(e);
|
|
126
|
+
return r ? x(r, t) : "";
|
|
127
|
+
}).join("");
|
|
128
|
+
return `<div style="width:${d(e.width || "100%")};${n}">${o}</div>`;
|
|
129
|
+
}, x = (e, t) => t === "email" ? `<mj-section css-class="${e.style?.hideOnDesktop ? "desktop-hide" : ""}"${v(e.style || {})}>${e.columns.map((e) => b(e, t)).join("")}</mj-section>` : `<section style="display:flex;flex-wrap:wrap;${f(e.style || {})}">${e.columns.map((e) => b(e, t)).join("")}</section>`, S = (e, t) => {
|
|
130
|
+
let n = (e.body?.rows || []).map((e) => x(e, t)).join(""), r = f(e.body?.style || {});
|
|
131
|
+
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>`;
|
|
119
132
|
};
|
|
120
133
|
//#endregion
|
|
121
|
-
export {
|
|
134
|
+
export { S as parseJsonToTargetFormat };
|
|
@@ -1,31 +1,41 @@
|
|
|
1
|
+
//#region src/utilities/columnOrder.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = /* @__PURE__ */ new Set([...e.elements.map((e) => e.id), ...(e.nestedRows || []).map((e) => e.id)]), n = (e.childOrder || []).filter((e) => t.has(e)), r = new Set(n), i = [...e.elements.map((e) => e.id), ...(e.nestedRows || []).map((e) => e.id)].filter((e) => !r.has(e));
|
|
4
|
+
return [...n, ...i];
|
|
5
|
+
}
|
|
6
|
+
function t(e, t, n) {
|
|
7
|
+
let r = [...e], i = typeof n == "number" ? Math.max(0, Math.min(n, r.length)) : r.length;
|
|
8
|
+
return r.splice(i, 0, t), r;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
1
11
|
//#region src/utilities/elementResolvers.ts
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
let
|
|
5
|
-
return (Array.isArray(
|
|
6
|
-
provider:
|
|
7
|
-
url: typeof
|
|
8
|
-
color:
|
|
9
|
-
backgroundColor:
|
|
10
|
-
size:
|
|
11
|
-
iconType: (
|
|
12
|
+
var n = (e) => e === "twitter" ? "x" : e;
|
|
13
|
+
function r(e) {
|
|
14
|
+
let t = e.attributes || {}, r = e.style || {};
|
|
15
|
+
return (Array.isArray(t.links) ? t.links : []).filter((e) => e && typeof e == "object").map((e) => ({
|
|
16
|
+
provider: n(String(e.provider || "")),
|
|
17
|
+
url: typeof e.url == "string" && e.url.trim() ? e.url : "#",
|
|
18
|
+
color: e.color || r.iconColor || "#475569",
|
|
19
|
+
backgroundColor: e.backgroundColor || r.iconBackgroundColor || "#f8fafc",
|
|
20
|
+
size: e.size || r.iconSize || "36px",
|
|
21
|
+
iconType: (e.iconType || t.iconType) === "square" ? "square" : "circle"
|
|
12
22
|
}));
|
|
13
23
|
}
|
|
14
|
-
function
|
|
24
|
+
function i(e) {
|
|
15
25
|
let t = e.attributes || {};
|
|
16
26
|
return (Array.isArray(t.links) ? t.links : []).filter((e) => e && typeof e == "object").map((e) => ({
|
|
17
27
|
label: typeof e.label == "string" && e.label.trim() ? e.label : "Link",
|
|
18
28
|
href: typeof e.href == "string" && e.href.trim() ? e.href : "#"
|
|
19
29
|
}));
|
|
20
30
|
}
|
|
21
|
-
function
|
|
31
|
+
function a(e) {
|
|
22
32
|
let t = e.style || {}, n = e.attributes || {};
|
|
23
33
|
return {
|
|
24
34
|
width: t.width || "100%",
|
|
25
35
|
height: n.autoHeight === !1 && t.height || "auto"
|
|
26
36
|
};
|
|
27
37
|
}
|
|
28
|
-
function
|
|
38
|
+
function o(e, t, n, r) {
|
|
29
39
|
if (e) return e;
|
|
30
40
|
if (t) {
|
|
31
41
|
let e = t.trim().split(/\s+/).filter(Boolean);
|
|
@@ -41,22 +51,22 @@ function i(e, t, n, r) {
|
|
|
41
51
|
}
|
|
42
52
|
return r;
|
|
43
53
|
}
|
|
44
|
-
function
|
|
54
|
+
function s(e) {
|
|
45
55
|
let t = e.style || {}, n = e.attributes || {};
|
|
46
56
|
return {
|
|
47
57
|
width: n.autoWidth === !1 ? t.width || "100%" : "auto",
|
|
48
58
|
height: n.autoHeight === !1 && t.height || "auto"
|
|
49
59
|
};
|
|
50
60
|
}
|
|
51
|
-
function
|
|
61
|
+
function c(e) {
|
|
52
62
|
let t = e.style || {};
|
|
53
63
|
return (e.attributes || {}).autoHeight === !1 && t.height || "auto";
|
|
54
64
|
}
|
|
55
|
-
function
|
|
65
|
+
function l(e, t) {
|
|
56
66
|
let n = e.style || {};
|
|
57
67
|
return (e.attributes || {}).autoHeight === !1 && n.height || t;
|
|
58
68
|
}
|
|
59
|
-
var
|
|
69
|
+
var u = [
|
|
60
70
|
"showLabel",
|
|
61
71
|
"fontSize",
|
|
62
72
|
"labelFontWeight",
|
|
@@ -67,16 +77,16 @@ var c = [
|
|
|
67
77
|
"inputTextColor",
|
|
68
78
|
"placeholderColor"
|
|
69
79
|
];
|
|
70
|
-
function
|
|
80
|
+
function d(e) {
|
|
71
81
|
let t = null;
|
|
72
82
|
return (Array.isArray(e) ? e : []).map((e) => {
|
|
73
83
|
let n = e?.inheritStylesFromPrevious && t ? { ...e } : e;
|
|
74
|
-
if (e?.inheritStylesFromPrevious && t) for (let e of
|
|
84
|
+
if (e?.inheritStylesFromPrevious && t) for (let e of u) n[e] = t[e];
|
|
75
85
|
return t = n, n;
|
|
76
86
|
});
|
|
77
87
|
}
|
|
78
|
-
var
|
|
79
|
-
function
|
|
88
|
+
var f = (e) => String(Math.max(0, e)).padStart(2, "0");
|
|
89
|
+
function p(e, t, n = Date.now()) {
|
|
80
90
|
let r = e ? Date.parse(e) : NaN, i = Number.isNaN(r) ? n : r, a = i - n;
|
|
81
91
|
if (a <= 0) return {
|
|
82
92
|
days: "00",
|
|
@@ -86,33 +96,33 @@ function d(e, t, n = Date.now()) {
|
|
|
86
96
|
isExpired: !0,
|
|
87
97
|
targetTimestamp: i
|
|
88
98
|
};
|
|
89
|
-
let o = Math.floor(a / 1e3), s = Math.floor(o / 86400), c = Math.floor(o % 86400 / 3600), l = Math.floor(o % 3600 / 60),
|
|
99
|
+
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;
|
|
90
100
|
return {
|
|
91
|
-
days:
|
|
92
|
-
hours:
|
|
93
|
-
minutes:
|
|
94
|
-
seconds: u
|
|
101
|
+
days: f(s),
|
|
102
|
+
hours: f(c),
|
|
103
|
+
minutes: f(l),
|
|
104
|
+
seconds: f(u),
|
|
95
105
|
isExpired: !1,
|
|
96
106
|
targetTimestamp: i
|
|
97
107
|
};
|
|
98
108
|
}
|
|
99
|
-
var
|
|
109
|
+
var m = [
|
|
100
110
|
"youtube.com",
|
|
101
111
|
"www.youtube.com",
|
|
102
112
|
"youtu.be",
|
|
103
113
|
"m.youtube.com"
|
|
104
114
|
];
|
|
105
|
-
function
|
|
115
|
+
function h(e) {
|
|
106
116
|
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");
|
|
107
117
|
}
|
|
108
|
-
function
|
|
118
|
+
function g(e) {
|
|
109
119
|
let t = e.pathname.match(/(\d+)/);
|
|
110
120
|
return t ? t[1] : null;
|
|
111
121
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
122
|
+
var _ = "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";
|
|
123
|
+
function v(e) {
|
|
114
124
|
if (!e || typeof e != "string") return {
|
|
115
|
-
thumbnailUrl:
|
|
125
|
+
thumbnailUrl: _,
|
|
116
126
|
provider: "unknown"
|
|
117
127
|
};
|
|
118
128
|
let t;
|
|
@@ -120,34 +130,34 @@ function g(e) {
|
|
|
120
130
|
t = new URL(e);
|
|
121
131
|
} catch {
|
|
122
132
|
return {
|
|
123
|
-
thumbnailUrl:
|
|
133
|
+
thumbnailUrl: _,
|
|
124
134
|
provider: "unknown"
|
|
125
135
|
};
|
|
126
136
|
}
|
|
127
|
-
if (
|
|
128
|
-
let e =
|
|
137
|
+
if (m.includes(t.hostname)) {
|
|
138
|
+
let e = h(t);
|
|
129
139
|
if (e) return {
|
|
130
140
|
thumbnailUrl: `https://img.youtube.com/vi/${e}/hqdefault.jpg`,
|
|
131
141
|
provider: "youtube"
|
|
132
142
|
};
|
|
133
143
|
}
|
|
134
144
|
if (t.hostname === "vimeo.com" || t.hostname === "www.vimeo.com" || t.hostname === "player.vimeo.com") {
|
|
135
|
-
let e =
|
|
145
|
+
let e = g(t);
|
|
136
146
|
if (e) return {
|
|
137
147
|
thumbnailUrl: `https://vumbnail.com/${e}.jpg`,
|
|
138
148
|
provider: "vimeo"
|
|
139
149
|
};
|
|
140
150
|
}
|
|
141
151
|
return {
|
|
142
|
-
thumbnailUrl:
|
|
152
|
+
thumbnailUrl: _,
|
|
143
153
|
provider: "unknown"
|
|
144
154
|
};
|
|
145
155
|
}
|
|
146
|
-
function
|
|
156
|
+
function y(e, t) {
|
|
147
157
|
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, "");
|
|
148
158
|
return t.includes(n) ? n : t.includes(r) ? r : t.includes(`${r}Icon`) ? `${r}Icon` : t.find((e) => e.toLowerCase().replace(/[-_]/g, "") === i) || "HelpCircle";
|
|
149
159
|
}
|
|
150
|
-
function
|
|
160
|
+
function b(e) {
|
|
151
161
|
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 = [];
|
|
152
162
|
for (let e = 0; e < n; e++) {
|
|
153
163
|
let t = Array.isArray(i[e]) ? i[e] : [], n = [];
|
|
@@ -163,29 +173,29 @@ function v(e) {
|
|
|
163
173
|
striped: !!t.striped
|
|
164
174
|
};
|
|
165
175
|
}
|
|
166
|
-
var
|
|
167
|
-
function
|
|
168
|
-
let r = n <
|
|
176
|
+
var x = 8;
|
|
177
|
+
function S(e, t, n) {
|
|
178
|
+
let r = n < x && Array.isArray(e?.children) ? e.children : [];
|
|
169
179
|
return {
|
|
170
180
|
id: typeof e?.id == "string" && e.id ? e.id : `item-${t}`,
|
|
171
181
|
title: typeof e?.title == "string" && e.title.trim() ? e.title : `Item ${t + 1}`,
|
|
172
182
|
content: typeof e?.content == "string" ? e.content : "",
|
|
173
183
|
defaultOpen: !!e?.defaultOpen,
|
|
174
|
-
children: r.map((e, t) =>
|
|
184
|
+
children: r.map((e, t) => S(e, t, n + 1))
|
|
175
185
|
};
|
|
176
186
|
}
|
|
177
|
-
function
|
|
187
|
+
function C(e, t) {
|
|
178
188
|
if (t !== "multi") {
|
|
179
189
|
let t = !1;
|
|
180
190
|
for (let n of e) n.defaultOpen && (t ? n.defaultOpen = !1 : t = !0);
|
|
181
191
|
}
|
|
182
|
-
for (let n of e)
|
|
192
|
+
for (let n of e) C(n.children, t);
|
|
183
193
|
}
|
|
184
|
-
function
|
|
185
|
-
let t = e.attributes || {}, n = t.mode === "multi" ? "multi" : "single", r = (Array.isArray(t.items) ? t.items : []).map((e, t) =>
|
|
186
|
-
return
|
|
194
|
+
function w(e) {
|
|
195
|
+
let t = e.attributes || {}, n = t.mode === "multi" ? "multi" : "single", r = (Array.isArray(t.items) ? t.items : []).map((e, t) => S(e, t, 0));
|
|
196
|
+
return C(r, n), r;
|
|
187
197
|
}
|
|
188
|
-
function
|
|
198
|
+
function T(e, t, n) {
|
|
189
199
|
let r = JSON.parse(JSON.stringify(Array.isArray(e) ? e : [])), i = (e, t) => {
|
|
190
200
|
let [r, ...a] = t;
|
|
191
201
|
if (e[r]) {
|
|
@@ -203,7 +213,7 @@ function C(e, t, n) {
|
|
|
203
213
|
}
|
|
204
214
|
//#endregion
|
|
205
215
|
//#region src/utilities/iconSvgStatic.ts
|
|
206
|
-
var
|
|
216
|
+
var E = {
|
|
207
217
|
"a-arrow-down": [
|
|
208
218
|
["path", { d: "m14 12 4 4 4-4" }],
|
|
209
219
|
["path", { d: "M18 16V7" }],
|
|
@@ -15023,18 +15033,18 @@ var w = {
|
|
|
15023
15033
|
y2: "11"
|
|
15024
15034
|
}]
|
|
15025
15035
|
]
|
|
15026
|
-
},
|
|
15027
|
-
function
|
|
15036
|
+
}, D = "circle-help";
|
|
15037
|
+
function O(e) {
|
|
15028
15038
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
15029
15039
|
}
|
|
15030
|
-
function
|
|
15031
|
-
let t = e || "HelpCircle", n =
|
|
15032
|
-
if (
|
|
15040
|
+
function k(e) {
|
|
15041
|
+
let t = e || "HelpCircle", n = O(t.replace(/^\w/, (e) => e.toUpperCase()));
|
|
15042
|
+
if (E[n]) return n;
|
|
15033
15043
|
let r = t.toLowerCase().replace(/[-_\s]/g, "");
|
|
15034
|
-
return Object.keys(
|
|
15044
|
+
return Object.keys(E).find((e) => e.replace(/-/g, "") === r) || D;
|
|
15035
15045
|
}
|
|
15036
|
-
function
|
|
15037
|
-
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">${(
|
|
15046
|
+
function A(e, t, n) {
|
|
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">${(E[k(e)] || E[D] || []).map(([e, t]) => `<${e} ${Object.entries(t).map(([e, t]) => `${e}="${String(t)}"`).join(" ")}></${e}>`).join("")}</svg>`;
|
|
15038
15048
|
}
|
|
15039
15049
|
//#endregion
|
|
15040
|
-
export {
|
|
15050
|
+
export { t as _, c as a, a as c, r as d, b as f, e as g, T as h, s as i, y as l, v as m, w as n, d as o, p, o as r, l as s, A as t, i as u };
|