@charisol/plexo-sdk 1.0.40 → 1.0.42

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.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-CogJrihV.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-BEQo1civ.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,4 +1,4 @@
1
- import { d as e, f as t, l as n, p as r, r as i, s as a, t as o, u as s } from "./iconSvgStatic-DOyb-nIf.js";
1
+ import { c as e, d as t, f as n, i as r, m as i, p as a, t as o, u as s } from "./iconSvgStatic-DubpApuZ.js";
2
2
  //#region src/utilities/compilerClient.ts
3
3
  var c = {
4
4
  facebook: "facebook",
@@ -44,32 +44,32 @@ var c = {
44
44
  if (l.type === "input" || l.type === "select" || l.type === "textarea") return `${w}${m(l, _)}`;
45
45
  if (_ === "email") {
46
46
  if (l.type === "button") {
47
- let e = u(v.href || "#"), t = u(v.text || "Button"), n = i(l).width, r = n === "auto" ? "" : ` width="${u(n)}"`;
48
- return `<mj-button href="${e}" css-class="${v.hideOnDesktop ? "desktop-hide" : ""}" padding="0" inner-padding="10px 16px"${r}>${t}</mj-button>`;
47
+ let e = u(v.href || "#"), t = u(v.text || "Button"), n = r(l).width, i = n === "auto" ? "" : ` width="${u(n)}"`;
48
+ return `<mj-button href="${e}" css-class="${v.hideOnDesktop ? "desktop-hide" : ""}" padding="0" inner-padding="10px 16px"${i}>${t}</mj-button>`;
49
49
  }
50
50
  if (l.type === "image") {
51
- let e = a(l), t = e.width && e.width !== "100%" ? ` width="${u(e.width)}"` : "", n = e.height && e.height !== "auto" ? ` height="${u(e.height)}"` : "";
52
- return `<mj-image src="${u(v.src || "")}" alt="${u(v.alt || "")}"${t}${n} />`;
51
+ let t = e(l), n = t.width && t.width !== "100%" ? ` width="${u(t.width)}"` : "", r = t.height && t.height !== "auto" ? ` height="${u(t.height)}"` : "";
52
+ return `<mj-image src="${u(v.src || "")}" alt="${u(v.alt || "")}"${n}${r} />`;
53
53
  }
54
54
  if (l.type === "social") {
55
- let e = s(l), t = e.filter((e) => c[e.provider]), n = e.filter((e) => !c[e.provider]);
56
- return `${t.length ? `<mj-social font-size="13px" icon-size="30px" mode="horizontal">${t.map((e) => `<mj-social-element name="${c[e.provider]}" href="${u(e.url)}" background-color="${u(e.backgroundColor)}" color="${u(e.color)}"></mj-social-element>`).join("")}</mj-social>` : ""}${n.length ? `<mj-text align="center">${n.map((e) => `<a href="${u(e.url)}" style="color: ${u(e.color)}; text-decoration: none; margin: 0 6px;">${u(e.provider)}</a>`).join("")}</mj-text>` : ""}`;
55
+ let e = t(l), n = e.filter((e) => c[e.provider]), r = e.filter((e) => !c[e.provider]);
56
+ return `${n.length ? `<mj-social font-size="13px" icon-size="30px" mode="horizontal">${n.map((e) => `<mj-social-element name="${c[e.provider]}" href="${u(e.url)}" background-color="${u(e.backgroundColor)}" color="${u(e.color)}"></mj-social-element>`).join("")}</mj-social>` : ""}${r.length ? `<mj-text align="center">${r.map((e) => `<a href="${u(e.url)}" style="color: ${u(e.color)}; text-decoration: none; margin: 0 6px;">${u(e.provider)}</a>`).join("")}</mj-text>` : ""}`;
57
57
  }
58
- if (l.type === "menu") return `<mj-navbar hamburger="hamburger">${n(l).map((e) => `<mj-navbar-link href="${u(e.href)}">${u(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
58
+ if (l.type === "menu") return `<mj-navbar hamburger="hamburger">${s(l).map((e) => `<mj-navbar-link href="${u(e.href)}">${u(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
59
59
  if (l.type === "table") {
60
- let t = e(l), n = l.style || {}, r = `${n.borderWidth || "1px"} ${n.borderStyle || "solid"} ${n.borderColor || "#cbd5e1"}`, i = (e, i, a) => {
61
- 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";
62
- return `<tr>${e.map((e) => `<${o} style="padding: ${n.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${u(e) || "&nbsp;"}</${o}>`).join("")}</tr>`;
63
- }, a = +!!t.enableHeader, o = t.enableFooter ? t.cells.length - 1 : t.cells.length;
64
- 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>`;
60
+ let e = n(l), t = l.style || {}, r = `${t.borderWidth || "1px"} ${t.borderStyle || "solid"} ${t.borderColor || "#cbd5e1"}`, i = (n, i, a) => {
61
+ let o = a ? "th" : "td", s = a ? t.headerBgColor || "#f8fafc" : e.striped && i % 2 == 1 ? "#f8fafc" : t.contentBgColor || "#ffffff", c = a ? t.headerTextColor || "#1e293b" : t.contentTextColor || "#475569";
62
+ return `<tr>${n.map((e) => `<${o} style="padding: ${t.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${u(e) || "&nbsp;"}</${o}>`).join("")}</tr>`;
63
+ }, a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length;
64
+ 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>`;
65
65
  }
66
66
  if (l.type === "video") {
67
- let e = r(v.videoUrl), t = v.linkType === "email" ? `mailto:${v.href || ""}` : v.href || v.videoUrl || "#";
67
+ let e = i(v.videoUrl), t = v.linkType === "email" ? `mailto:${v.href || ""}` : v.href || v.videoUrl || "#";
68
68
  return `<mj-image src="${u(e.thumbnailUrl)}" href="${u(t)}" alt="${u(v.alt || "Video preview")}" />`;
69
69
  }
70
70
  if (l.type === "timer") {
71
- let e = t(v.targetDate), n = v.showLabels !== !1;
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>${n ? `<div style="font-size: 12px; color: #64748b;">Countdown to ${u(v.targetDate || "")}</div>` : ""}</mj-text>`;
71
+ let e = a(v.targetDate), t = v.showLabels !== !1;
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 ${u(v.targetDate || "")}</div>` : ""}</mj-text>`;
73
73
  }
74
74
  if (l.type === "carousel") {
75
75
  let e = Array.isArray(v.images) ? v.images : [];
@@ -0,0 +1,14 @@
1
+ /** Which edge of the currently-hovered sortable item the dragged item would land on. */
2
+ export type DropEdge = 'top' | 'bottom' | null;
3
+ export interface DragOverInfo {
4
+ overId: string | null;
5
+ edge: DropEdge;
6
+ }
7
+ export declare const DEFAULT_DRAG_OVER_INFO: DragOverInfo;
8
+ /**
9
+ * Broadcasts the live drag-over target/edge from PlexoBuilder's single onDragOver
10
+ * handler down to whichever SortableRow/SortableElement is currently hovered, so the
11
+ * drop indicator can render on the correct edge (top vs bottom) instead of always
12
+ * showing a top border regardless of drag direction.
13
+ */
14
+ export declare const DragOverContext: import("react").Context<DragOverInfo>;
@@ -8,6 +8,7 @@ interface BodyGlobalSettingsTabProps {
8
8
  notify?: (message: string) => void;
9
9
  ICONS: Record<string, React.ReactNode>;
10
10
  handleUploadMock: () => void;
11
+ handleUploadFavicon?: () => void;
11
12
  InlineColorPicker: React.ComponentType<any>;
12
13
  InlineAlignment: React.ComponentType<any>;
13
14
  InlineSelect: React.ComponentType<any>;
@@ -25,22 +25,38 @@ function r(e) {
25
25
  height: n.autoHeight === !1 && t.height || "auto"
26
26
  };
27
27
  }
28
- function i(e) {
28
+ function i(e, t, n, r) {
29
+ if (e) return e;
30
+ if (t) {
31
+ let e = t.trim().split(/\s+/).filter(Boolean);
32
+ if (e.length === 1) return e[0];
33
+ if (e.length === 2) return n === "top" || n === "bottom" ? e[0] : e[1];
34
+ if (e.length === 3) return n === "top" ? e[0] : n === "bottom" ? e[2] : e[1];
35
+ if (e.length >= 4) return e[{
36
+ top: 0,
37
+ right: 1,
38
+ bottom: 2,
39
+ left: 3
40
+ }[n]];
41
+ }
42
+ return r;
43
+ }
44
+ function a(e) {
29
45
  let t = e.style || {}, n = e.attributes || {};
30
46
  return {
31
47
  width: n.autoWidth === !1 ? t.width || "100%" : "auto",
32
48
  height: n.autoHeight === !1 && t.height || "auto"
33
49
  };
34
50
  }
35
- function a(e) {
51
+ function o(e) {
36
52
  let t = e.style || {};
37
53
  return (e.attributes || {}).autoHeight === !1 && t.height || "auto";
38
54
  }
39
- function o(e, t) {
55
+ function s(e, t) {
40
56
  let n = e.style || {};
41
57
  return (e.attributes || {}).autoHeight === !1 && n.height || t;
42
58
  }
43
- var s = [
59
+ var c = [
44
60
  "showLabel",
45
61
  "fontSize",
46
62
  "labelFontWeight",
@@ -51,16 +67,16 @@ var s = [
51
67
  "inputTextColor",
52
68
  "placeholderColor"
53
69
  ];
54
- function c(e) {
70
+ function l(e) {
55
71
  let t = null;
56
72
  return (Array.isArray(e) ? e : []).map((e) => {
57
73
  let n = e?.inheritStylesFromPrevious && t ? { ...e } : e;
58
- if (e?.inheritStylesFromPrevious && t) for (let e of s) n[e] = t[e];
74
+ if (e?.inheritStylesFromPrevious && t) for (let e of c) n[e] = t[e];
59
75
  return t = n, n;
60
76
  });
61
77
  }
62
- var l = (e) => String(Math.max(0, e)).padStart(2, "0");
63
- function u(e, t, n = Date.now()) {
78
+ var u = (e) => String(Math.max(0, e)).padStart(2, "0");
79
+ function d(e, t, n = Date.now()) {
64
80
  let r = e ? Date.parse(e) : NaN, i = Number.isNaN(r) ? n : r, a = i - n;
65
81
  if (a <= 0) return {
66
82
  days: "00",
@@ -70,33 +86,33 @@ function u(e, t, n = Date.now()) {
70
86
  isExpired: !0,
71
87
  targetTimestamp: i
72
88
  };
73
- let o = Math.floor(a / 1e3), s = Math.floor(o / 86400), c = Math.floor(o % 86400 / 3600), u = Math.floor(o % 3600 / 60), d = o % 60;
89
+ let o = Math.floor(a / 1e3), s = Math.floor(o / 86400), c = Math.floor(o % 86400 / 3600), l = Math.floor(o % 3600 / 60), d = o % 60;
74
90
  return {
75
- days: l(s),
76
- hours: l(c),
77
- minutes: l(u),
78
- seconds: l(d),
91
+ days: u(s),
92
+ hours: u(c),
93
+ minutes: u(l),
94
+ seconds: u(d),
79
95
  isExpired: !1,
80
96
  targetTimestamp: i
81
97
  };
82
98
  }
83
- var d = [
99
+ var f = [
84
100
  "youtube.com",
85
101
  "www.youtube.com",
86
102
  "youtu.be",
87
103
  "m.youtube.com"
88
104
  ];
89
- function f(e) {
105
+ function p(e) {
90
106
  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");
91
107
  }
92
- function p(e) {
108
+ function m(e) {
93
109
  let t = e.pathname.match(/(\d+)/);
94
110
  return t ? t[1] : null;
95
111
  }
96
- var m = "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";
97
- function h(e) {
112
+ var h = "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";
113
+ function g(e) {
98
114
  if (!e || typeof e != "string") return {
99
- thumbnailUrl: m,
115
+ thumbnailUrl: h,
100
116
  provider: "unknown"
101
117
  };
102
118
  let t;
@@ -104,34 +120,34 @@ function h(e) {
104
120
  t = new URL(e);
105
121
  } catch {
106
122
  return {
107
- thumbnailUrl: m,
123
+ thumbnailUrl: h,
108
124
  provider: "unknown"
109
125
  };
110
126
  }
111
- if (d.includes(t.hostname)) {
112
- let e = f(t);
127
+ if (f.includes(t.hostname)) {
128
+ let e = p(t);
113
129
  if (e) return {
114
130
  thumbnailUrl: `https://img.youtube.com/vi/${e}/hqdefault.jpg`,
115
131
  provider: "youtube"
116
132
  };
117
133
  }
118
134
  if (t.hostname === "vimeo.com" || t.hostname === "www.vimeo.com" || t.hostname === "player.vimeo.com") {
119
- let e = p(t);
135
+ let e = m(t);
120
136
  if (e) return {
121
137
  thumbnailUrl: `https://vumbnail.com/${e}.jpg`,
122
138
  provider: "vimeo"
123
139
  };
124
140
  }
125
141
  return {
126
- thumbnailUrl: m,
142
+ thumbnailUrl: h,
127
143
  provider: "unknown"
128
144
  };
129
145
  }
130
- function g(e, t) {
146
+ function _(e, t) {
131
147
  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, "");
132
148
  return t.includes(n) ? n : t.includes(r) ? r : t.includes(`${r}Icon`) ? `${r}Icon` : t.find((e) => e.toLowerCase().replace(/[-_]/g, "") === i) || "HelpCircle";
133
149
  }
134
- function _(e) {
150
+ function v(e) {
135
151
  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 = [];
136
152
  for (let e = 0; e < n; e++) {
137
153
  let t = Array.isArray(i[e]) ? i[e] : [], n = [];
@@ -147,29 +163,29 @@ function _(e) {
147
163
  striped: !!t.striped
148
164
  };
149
165
  }
150
- var v = 8;
151
- function y(e, t, n) {
152
- let r = n < v && Array.isArray(e?.children) ? e.children : [];
166
+ var y = 8;
167
+ function b(e, t, n) {
168
+ let r = n < y && Array.isArray(e?.children) ? e.children : [];
153
169
  return {
154
170
  id: typeof e?.id == "string" && e.id ? e.id : `item-${t}`,
155
171
  title: typeof e?.title == "string" && e.title.trim() ? e.title : `Item ${t + 1}`,
156
172
  content: typeof e?.content == "string" ? e.content : "",
157
173
  defaultOpen: !!e?.defaultOpen,
158
- children: r.map((e, t) => y(e, t, n + 1))
174
+ children: r.map((e, t) => b(e, t, n + 1))
159
175
  };
160
176
  }
161
- function b(e, t) {
177
+ function x(e, t) {
162
178
  if (t !== "multi") {
163
179
  let t = !1;
164
180
  for (let n of e) n.defaultOpen && (t ? n.defaultOpen = !1 : t = !0);
165
181
  }
166
- for (let n of e) b(n.children, t);
182
+ for (let n of e) x(n.children, t);
167
183
  }
168
- function x(e) {
169
- let t = e.attributes || {}, n = t.mode === "multi" ? "multi" : "single", r = (Array.isArray(t.items) ? t.items : []).map((e, t) => y(e, t, 0));
170
- return b(r, n), r;
184
+ function S(e) {
185
+ let t = e.attributes || {}, n = t.mode === "multi" ? "multi" : "single", r = (Array.isArray(t.items) ? t.items : []).map((e, t) => b(e, t, 0));
186
+ return x(r, n), r;
171
187
  }
172
- function S(e, t, n) {
188
+ function C(e, t, n) {
173
189
  let r = JSON.parse(JSON.stringify(Array.isArray(e) ? e : [])), i = (e, t) => {
174
190
  let [r, ...a] = t;
175
191
  if (e[r]) {
@@ -187,7 +203,7 @@ function S(e, t, n) {
187
203
  }
188
204
  //#endregion
189
205
  //#region src/utilities/iconSvgStatic.ts
190
- var C = {
206
+ var w = {
191
207
  "a-arrow-down": [
192
208
  ["path", { d: "m14 12 4 4 4-4" }],
193
209
  ["path", { d: "M18 16V7" }],
@@ -15007,18 +15023,18 @@ var C = {
15007
15023
  y2: "11"
15008
15024
  }]
15009
15025
  ]
15010
- }, w = "circle-help";
15011
- function T(e) {
15026
+ }, T = "circle-help";
15027
+ function E(e) {
15012
15028
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
15013
15029
  }
15014
- function E(e) {
15015
- let t = e || "HelpCircle", n = T(t.replace(/^\w/, (e) => e.toUpperCase()));
15016
- if (C[n]) return n;
15030
+ function D(e) {
15031
+ let t = e || "HelpCircle", n = E(t.replace(/^\w/, (e) => e.toUpperCase()));
15032
+ if (w[n]) return n;
15017
15033
  let r = t.toLowerCase().replace(/[-_\s]/g, "");
15018
- return Object.keys(C).find((e) => e.replace(/-/g, "") === r) || w;
15034
+ return Object.keys(w).find((e) => e.replace(/-/g, "") === r) || T;
15019
15035
  }
15020
- function D(e, t, n) {
15021
- 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">${(C[E(e)] || C[w] || []).map(([e, t]) => `<${e} ${Object.entries(t).map(([e, t]) => `${e}="${String(t)}"`).join(" ")}></${e}>`).join("")}</svg>`;
15036
+ function O(e, t, n) {
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">${(w[D(e)] || w[T] || []).map(([e, t]) => `<${e} ${Object.entries(t).map(([e, t]) => `${e}="${String(t)}"`).join(" ")}></${e}>`).join("")}</svg>`;
15022
15038
  }
15023
15039
  //#endregion
15024
- export { c as a, g as c, _ as d, u as f, a as i, n as l, S as m, x as n, o, h as p, i as r, r as s, D as t, t as u };
15040
+ export { o as a, r as c, t as d, v as f, C as h, a as i, _ as l, g as m, S as n, l as o, d as p, i as r, s, O as t, n as u };