@charisol/plexo-sdk 1.4.1 → 1.4.3

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, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./compiler-JKW4O9Mv.js";
1
+ import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./compiler-Zh5KObm4.js";
2
2
  export { l as DEFAULT_BODY_FONT_FAMILY, a as FORM_NON_CSS_STYLE_KEYS, s as collectResponsiveRule, r as compileToHTML, e as compileToHTMLWithStrataAuto, o as compileToPlainText, c as convertSectionRowToPlexoRow, t as getFormDefaultStyle, i as getInlineStylesImportant, u as htmlToPlainText, n as injectStrataBundle };
@@ -0,0 +1,254 @@
1
+ import { d as e, f as t, g as n, h as r, j as i, k as a, m as o, o as s, p as c, t as l, u, v as d, y as f } from "./iconSvgStatic-DEgDUD68.js";
2
+ //#region src/utilities/instrumentation.ts
3
+ var p = "plexo-node", m = "plexo-row", h = "plexo-col";
4
+ function g(e) {
5
+ return `plexo-node-${e}`;
6
+ }
7
+ //#endregion
8
+ //#region src/utilities/compilerClient.ts
9
+ var _ = "https://cdn.jsdelivr.net/npm/@charisol/plexo-sdk@latest/dist/social-icons", v = /* @__PURE__ */ new Set([
10
+ "selectable",
11
+ "draggable",
12
+ "duplicatable",
13
+ "deletable",
14
+ "hideable",
15
+ "locked"
16
+ ]), y = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), b = (e = {}) => Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}:${String(t)};`).join(""), x = (...e) => e.map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), S = (e, t, n, r) => n ? x(e, p, g(t), r) : e, C = (e, t, n) => {
17
+ let r = S("", e, t, n);
18
+ return r ? ` css-class="${y(r)}"` : "";
19
+ }, w = (e, t, n) => {
20
+ let r = S("", e, t, n);
21
+ return r ? ` class="${y(r)}"` : "";
22
+ }, T = (e, t) => {
23
+ let n = { ...e.attributes || {} };
24
+ if (t === "email") for (let e of v) delete n[e];
25
+ return n;
26
+ }, E = (e, t, n) => {
27
+ let r = T(e, t), i = b(e.style || {}), a = S(x(r.htmlClassNames, r.htmlClass, r.validationClass, r.validationClassName), e.id, t === "landing_page" && n), o = y(r.name || r.fieldName || "field"), s = y(r.placeholder || ""), c = r.required ? " required" : "";
28
+ if (t === "email") return `<mj-table${C(e.id, n)}><tr><td style="padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;color:#64748b;${i}">${s || o}</td></tr></mj-table>`;
29
+ let l = y(r.inputType || r.type || (e.type === "input" ? r.kind || "text" : e.type)), u = r.htmlId ? ` id="${y(r.htmlId)}"` : "", d = a ? ` class="${y(a)}"` : "";
30
+ return e.type === "textarea" ? `<textarea${u}${d} name="${o}" placeholder="${s}" style="${i}"${c}>${y(r.value || "")}</textarea>` : e.type === "select" ? `<select${u}${d} name="${o}" style="${i}"${c}>${(r.options || []).map((e) => `<option value="${y(e.value)}">${y(e.label)}</option>`).join("")}</select>` : `<input${u}${d} type="${l}" name="${o}" placeholder="${s}" value="${y(r.value || "")}" style="${i}"${c} />`;
31
+ }, D = (e, t, n) => {
32
+ let r = T(e, t), i = b(e.style || {}), a = S(x(r.htmlClassNames, r.htmlClass), e.id, t === "landing_page" && n), o = r.htmlId ? ` id="${y(r.htmlId)}"` : "", s = a ? ` class="${y(a)}"` : "", c = y(r.actionUrl || r.action || "#"), l = y(r.method || "POST"), u = r.fields || [], d = y(r.submitLabel || "Submit");
33
+ return t === "email" ? `<mj-table${C(e.id, n)}><tr><td style="${i}"><table role="presentation" width="100%">${u.map((e) => `<tr><td style="padding:8px 0;font-family:Arial,sans-serif;color:#334155;"><strong>${y(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;">${y(e.placeholder || "") || "&nbsp;"}</span></td></tr>`).join("")}<tr><td style="padding-top:12px;"><a href="${y(r.href || r.submitHref || "#")}" style="display:inline-block;padding:10px 16px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:6px;">${d}</a></td></tr></table></td></tr></mj-table>` : `<form${o}${s} action="${c}" method="${l}" style="${i}">${u.map((t) => E({
34
+ id: `${e.id}-${String(t.name || t.label || "field")}`,
35
+ type: t.kind === "textarea" || t.kind === "select" ? t.kind : "input",
36
+ style: {
37
+ ...e.style || {},
38
+ ...t.style || {}
39
+ },
40
+ attributes: t
41
+ }, "landing_page", n)).join("")}<button type="submit">${d}</button></form>`;
42
+ }, O = [], k = !1, A = 148, j = [
43
+ ["borderRadius", "border-radius"],
44
+ ["borderWidth", "border-width"],
45
+ ["borderStyle", "border-style"],
46
+ ["borderColor", "border-color"],
47
+ ["boxShadow", "box-shadow"]
48
+ ], M = (e, t, n = []) => {
49
+ let r = [...j.filter(([t]) => e[t]).map(([t, n]) => `${n}: ${y(String(e[t]))}`), ...n];
50
+ if (r.length === 0) return "";
51
+ let i = `plexo-extra-style-${t}`;
52
+ return O.push(`.${i} { ${r.join("; ")}; }`), i;
53
+ }, N = (e = {}, t = {}) => {
54
+ let n = ["padding=\"0\""], r = e.fontSize || t.fontSize, i = e.fontWeight || t.fontWeight;
55
+ return r && n.push(`font-size="${y(String(r))}"`), i && n.push(`font-weight="${y(String(i))}"`), e.color && n.push(`color="${y(String(e.color))}"`), e.fontFamily && n.push(`font-family="${y(String(e.fontFamily))}"`), e.lineHeight && n.push(`line-height="${y(String(e.lineHeight))}"`), e.letterSpacing && n.push(`letter-spacing="${y(String(e.letterSpacing))}"`), n.join(" ");
56
+ }, P = (e = {}) => {
57
+ let t = e.backgroundColor || e.background;
58
+ return t ? ` background-color="${y(String(t))}"` : "";
59
+ }, F = (e, t, n) => {
60
+ if (e[t]) return String(e[t]);
61
+ let [r, i, a, o] = n;
62
+ if (e[r] || e[i] || e[a] || e[o]) return `${e[r] || "0px"} ${e[i] || "0px"} ${e[a] || "0px"} ${e[o] || "0px"}`;
63
+ }, I = (e = {}) => {
64
+ let t = [];
65
+ e.backgroundColor && t.push(`background-color="${y(String(e.backgroundColor))}"`), e.color && t.push(`color="${y(String(e.color))}"`), e.fontSize && t.push(`font-size="${y(String(e.fontSize))}"`), e.fontWeight && t.push(`font-weight="${y(String(e.fontWeight))}"`), e.fontFamily && t.push(`font-family="${y(String(e.fontFamily))}"`), e.lineHeight && t.push(`line-height="${y(String(e.lineHeight))}"`), e.letterSpacing && t.push(`letter-spacing="${y(String(e.letterSpacing))}"`), e.textAlign && t.push(`align="${y(String(e.textAlign))}"`);
66
+ let n = F(e, "borderRadius", [
67
+ "borderTopLeftRadius",
68
+ "borderTopRightRadius",
69
+ "borderBottomRightRadius",
70
+ "borderBottomLeftRadius"
71
+ ]);
72
+ return n && t.push(`border-radius="${y(n)}"`), t.join(" ");
73
+ }, L = (i, d, f) => {
74
+ let p = T(i, d), m = b(i.style || {}), h = p.htmlId ? ` id="${y(p.htmlId)}"` : "", g = x(p.htmlClassNames, p.htmlClass, d === "landing_page" && p.hideOnMobile ? "hidden md:block" : ""), v = d === "landing_page" ? S(g, i.id, f) : g, k = v ? ` class="${y(v)}"` : "", A = typeof p.customCss == "string" && p.customCss.trim() ? p.customCss.trim() : "", j = A && d === "landing_page" ? `<style>${A}</style>` : "";
75
+ if (i.type === "form_container") return `${j}${D(i, d, f)}`;
76
+ if (i.type === "input" || i.type === "select" || i.type === "textarea") return `${j}${E(i, d, f)}`;
77
+ if (d === "email") {
78
+ if (i.type === "button") {
79
+ let e = y(p.href || "#"), t = y(p.text || "Button"), n = s(i).width, r = n === "auto" ? "" : ` width="${y(n)}"`, a = i.style || {}, o = I(a), c = F(a, "padding", [
80
+ "paddingTop",
81
+ "paddingRight",
82
+ "paddingBottom",
83
+ "paddingLeft"
84
+ ]) || "10px 16px";
85
+ return `<mj-button href="${e}" css-class="${S(p.hideOnDesktop ? "desktop-hide" : "", i.id, f)}" padding="0" inner-padding="${y(c)}"${r}${o ? ` ${o}` : ""}>${t}</mj-button>`;
86
+ }
87
+ if (i.type === "image") {
88
+ let e = u(i), t = e.width && e.width !== "100%" ? ` width="${y(e.width)}"` : "", n = e.height && e.height !== "auto" ? ` height="${y(e.height)}"` : "", r = C(i.id, f);
89
+ return `<mj-image src="${y(p.src || "")}" alt="${y(p.alt || "")}"${t}${n}${r} />`;
90
+ }
91
+ if (i.type === "social") {
92
+ let e = t(i);
93
+ if (!e.length) return "";
94
+ let n = i.style || {}, r = n.textAlign === "center" ? "center" : n.textAlign === "right" ? "flex-end" : "flex-start", o = n.iconSpacing || "8px", s = F(n, "padding", [
95
+ "paddingTop",
96
+ "paddingRight",
97
+ "paddingBottom",
98
+ "paddingLeft"
99
+ ]) || "8px", c = F(n, "margin", [
100
+ "marginTop",
101
+ "marginRight",
102
+ "marginBottom",
103
+ "marginLeft"
104
+ ]), l = (e) => e === "square" ? "14px" : "9999px", u = e.map((e) => {
105
+ let t = `<img src="${`${_}/${a[e.provider] ? e.provider : "fallback"}.png`}" alt="" width="${parseInt(e.size, 10) || 36}" style="display:block;width:60%;height:60%;border:0;" />`;
106
+ return `<a href="${y(e.url)}" style="display:inline-flex;align-items:center;justify-content:center;width:${y(e.size)};height:${y(e.size)};background-color:${y(e.backgroundColor)};border-radius:${l(e.iconType)};text-decoration:none;">${t}</a>`;
107
+ }).join(""), d = `display:flex;flex-wrap:wrap;justify-content:${r};gap:${y(String(o))};padding:${y(s)};${c ? `margin:${y(c)};` : ""}`;
108
+ return `<mj-raw><tr><td style="font-size:16px;"><div${w(i.id, f)} style="${d}">${u}</div></td></tr></mj-raw>`;
109
+ }
110
+ if (i.type === "menu") {
111
+ let t = e(i);
112
+ return `<mj-navbar hamburger="hamburger"${C(i.id, f)}>${t.map((e) => `<mj-navbar-link href="${y(e.href)}">${y(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
113
+ }
114
+ if (i.type === "table") {
115
+ let e = c(i), t = i.style || {}, n = `${t.borderWidth || "1px"} ${t.borderStyle || "solid"} ${t.borderColor || "#cbd5e1"}`, r = (r, a, o, s) => {
116
+ let c = s ? "th" : "td", l = s ? t.headerBgColor || "#f8fafc" : e.striped && a % 2 == 1 ? "#f8fafc" : t.contentBgColor || "#ffffff", u = s ? t.headerTextColor || "#1e293b" : t.contentTextColor || "#475569";
117
+ return `<tr>${r.map((e, r) => {
118
+ let a = f ? ` data-plexo-cell="${y(i.id)}|${o}-${r}"` : "";
119
+ return `<${c}${a} style="padding: ${t.cellPadding || "8px"}; border: ${n}; background-color: ${l}; color: ${u};">${y(e) || "&nbsp;"}</${c}>`;
120
+ }).join("")}</tr>`;
121
+ }, a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length, s = e.enableHeader && e.cells.length > 0 ? `<thead>${r(e.cells[0], 0, 0, !0)}</thead>` : "", l = e.cells.slice(a, Math.max(a, o)).map((e, t) => r(e, t, a + t, !1)).join(""), u = e.enableFooter && e.cells.length > a ? `<tfoot>${r(e.cells[e.cells.length - 1], e.cells.length - 1, e.cells.length - 1, !1)}</tfoot>` : "";
122
+ return `<mj-table${C(i.id, f)}><table role="presentation" style="border-collapse: collapse; width: 100%;">${s}<tbody>${l}</tbody>${u}</table></mj-table>`;
123
+ }
124
+ if (i.type === "video") {
125
+ let e = n(p.videoUrl), t = p.linkType === "email" ? `mailto:${p.href || ""}` : p.href || p.videoUrl || "#", r = C(i.id, f);
126
+ return `<mj-image src="${y(e.thumbnailUrl)}" href="${y(t)}" alt="${y(p.alt || "Video preview")}"${r} />`;
127
+ }
128
+ if (i.type === "timer") {
129
+ let e = r(p.targetDate, p.timezone), t = p.showLabels !== !1;
130
+ return `<mj-text align="center"${C(i.id, f)}><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 ${y(p.targetDate || "")}</div>` : ""}</mj-text>`;
131
+ }
132
+ if (i.type === "carousel") {
133
+ let e = Array.isArray(p.images) ? p.images : [], t = C(i.id, f);
134
+ return e.length === 0 ? `<mj-text align="center"${t}>No images in carousel</mj-text>` : `<mj-carousel${t}>${e.map((e) => `<mj-carousel-image src="${y(e.src)}" alt="${y(e.alt || "")}" />`).join("")}</mj-carousel>`;
135
+ }
136
+ if (i.type === "icon") {
137
+ let e = parseInt(String(p.iconSize || 48), 10) || 48, t = i.style?.color || "#1e293b", n = l(p.iconName, e, t);
138
+ return `<mj-text align="center"${C(i.id, f)}>${n}</mj-text>`;
139
+ }
140
+ let d = S(p.hideOnDesktop ? "desktop-hide" : "", i.id, f);
141
+ if (i.type === "heading" || i.type === "paragraph" || i.type === "text") {
142
+ let e = i.type === "heading" ? {
143
+ fontSize: "24px",
144
+ fontWeight: "700"
145
+ } : { fontSize: "14px" }, t = i.style || {}, n = N(t, e), r = o(i).autoWidth, a = String(p.boxAlign || "left"), s = /* @__PURE__ */ new Set([
146
+ "fontSize",
147
+ "fontWeight",
148
+ "color",
149
+ "fontFamily",
150
+ "lineHeight",
151
+ "letterSpacing",
152
+ "textAlign"
153
+ ]), c = Object.entries(t).filter(([e, t]) => !s.has(e) && e !== "width" && t != null && t !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${y(String(t))}`);
154
+ r ? c.push("display: inline-block") : t.width && c.push(`width: ${y(String(t.width))}`), t.height && c.push("overflow: hidden"), (t.textAlign || a !== "left") && c.push(`text-align: ${y(String(t.textAlign || "left"))} !important`);
155
+ let l = "";
156
+ c.length > 0 && (l = `plexo-textbox-${i.id}`, O.push(`.${l} > div { ${c.join("; ")}; }`));
157
+ let u = x(l, d);
158
+ return `<mj-text${n ? ` ${n}` : ""} align="${y(a)}" css-class="${u}">${p.text || ""}</mj-text>`;
159
+ }
160
+ if (i.type === "spacer") {
161
+ let e = i.style?.height || "24px", t = C(i.id, f);
162
+ return `<mj-spacer height="${y(String(e))}"${t} />`;
163
+ }
164
+ if (i.type === "divider") {
165
+ let e = i.style || {}, t = C(i.id, f);
166
+ return `<mj-divider border-width="${y(String(e.borderWidth || "1px"))}" border-style="${y(String(e.borderStyle || "solid"))}" border-color="${y(String(e.borderColor || "#334155"))}"${t} />`;
167
+ }
168
+ return i.type === "card" ? `<mj-text css-class="${d}"><strong style="display:block;margin-bottom:8px;">${y(p.title || "Card Title")}</strong><span style="font-size:14px;color:#64748b;">${y(p.description || "Card description.")}</span></mj-text>` : i.type === "html" ? `<mj-text css-class="${d}">${p.htmlContent || p.text || ""}</mj-text>` : `<mj-text${h}${k} css-class="${d}">${y(p.text || p.htmlContent || "")}</mj-text>`;
169
+ }
170
+ if (i.type === "heading" || i.type === "paragraph" || i.type === "text") {
171
+ let e = i.style || {}, t = o(i).autoWidth, n = String(p.boxAlign || "left"), r = b(t ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== "width")) : e), a = t || !!e.width, s = a ? "display:inline-block;" : "", c = i.type === "heading" ? "h2" : "p", l = i.type === "heading" ? "Heading" : "", u = `${j}<${c}${h}${k} style="${s}${r}">${y(p.text || l)}</${c}>`;
172
+ return a ? `<div style="text-align:${y(n)};">${u}</div>` : u;
173
+ }
174
+ switch (i.type) {
175
+ case "button": return `${j}<a${h}${k} href="${y(p.href || "#")}" style="${m}">${y(p.text || "Button")}</a>`;
176
+ case "image": return `${j}<img${h}${k} src="${y(p.src || "")}" alt="${y(p.alt || "")}" style="${m}" />`;
177
+ case "html": return `${j}<div${h}${k} style="${m}">${String(p.htmlContent || "")}</div>`;
178
+ case "social": {
179
+ let e = i.style || {}, n = t(i), r = e.textAlign === "center" ? "center" : e.textAlign === "right" ? "flex-end" : "flex-start";
180
+ return `${j}<div${h}${k} style="${b({
181
+ padding: e.padding,
182
+ margin: e.margin,
183
+ display: "flex",
184
+ flexWrap: "wrap",
185
+ gap: e.iconSpacing || "8px",
186
+ justifyContent: r
187
+ })}">${n.map((e) => {
188
+ let t = `${_}/${a[e.provider] ? e.provider : "fallback"}.png`, n = b({
189
+ width: e.size,
190
+ height: e.size,
191
+ padding: "8px",
192
+ borderRadius: e.iconType === "square" ? "14px" : "9999px",
193
+ backgroundColor: e.backgroundColor,
194
+ display: "inline-flex",
195
+ alignItems: "center",
196
+ justifyContent: "center",
197
+ overflow: "hidden"
198
+ }), r = `<img src="${y(t)}" alt="" width="${parseInt(e.size, 10) || 36}" style="display:block;width:60%;height:60%;border:0;" />`;
199
+ return `<a href="${y(e.url)}" style="${n}text-decoration:none;">${r}</a>`;
200
+ }).join("")}</div>`;
201
+ }
202
+ case "menu": {
203
+ let t = i.style || {}, n = e(i), r = t.textAlign === "center" ? "center" : t.textAlign === "right" ? "flex-end" : "flex-start";
204
+ return `${j}<div${h}${k} style="${b({
205
+ ...t,
206
+ display: "flex",
207
+ flexWrap: "wrap",
208
+ gap: "16px",
209
+ justifyContent: r
210
+ })}">${n.map((e) => `<a href="${y(e.href)}" style="text-decoration:none;color:inherit;font-weight:${y(String(t.fontWeight || 600))};">${y(e.label)}</a>`).join("")}</div>`;
211
+ }
212
+ case "blog_title":
213
+ case "blog_content":
214
+ case "blog_featured_image":
215
+ case "blog_date":
216
+ case "blog_author":
217
+ case "blog_categories":
218
+ case "blog_comments":
219
+ case "blog_post_list": return `${j}<div${h}${k} data-plexo-blog-${i.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true"${p.prefix ? ` data-plexo-blog-prefix="${y(p.prefix)}"` : ""} style="${m}"></div>`;
220
+ default: return `${j}<div${h}${k} style="${m}">${y(p.text || "")}</div>`;
221
+ }
222
+ }, R = (e, t, n) => {
223
+ if (t === "email") {
224
+ let r = new Map(e.elements.map((e) => [e.id, e])), a = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), o = i(e).map((e) => {
225
+ let i = r.get(e);
226
+ if (i) return L(i, t, n);
227
+ let o = a.get(e);
228
+ return o ? `<mj-raw><tr><td style="font-size:16px;">${z(o, "landing_page", n)}</td></tr></mj-raw>` : "";
229
+ }).join(""), s = P(e.styles || {}), c = e.elements.length === 0 && (!Array.isArray(e.nestedRows) || e.nestedRows.length === 0), l = x(k && c ? M({}, e.id, [`min-height: ${A}px`]) : "", S("", e.id, n, h)), u = l ? ` css-class="${y(l)}"` : "";
230
+ return `<mj-column width="${y(e.width || "100%")}" padding="0"${s}${u}>${o}</mj-column>`;
231
+ }
232
+ let r = b(e.styles || {}), a = new Map(e.elements.map((e) => [e.id, e])), o = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), s = i(e).map((e) => {
233
+ let r = a.get(e);
234
+ if (r) return L(r, t, n);
235
+ let i = o.get(e);
236
+ return i ? z(i, t, n) : "";
237
+ }).join(""), c = w(e.id, n, h), l = e.elements.length === 0 && (!Array.isArray(e.nestedRows) || e.nestedRows.length === 0), u = k && l ? `min-height: ${A}px;` : "";
238
+ return `<div${c} style="width:${y(e.width || "100%")};${u}${r}">${s}</div>`;
239
+ }, z = (e, t, n) => {
240
+ if (t === "email") return `<mj-section css-class="${S(e.style?.hideOnDesktop ? "desktop-hide" : "", e.id, n, m)}"${P(e.style || {})} padding="0">${e.columns.map((e) => R(e, t, n)).join("")}</mj-section>`;
241
+ let r = b(e.style || {}), i = e.columns.map((e) => R(e, t, n)).join("");
242
+ return `<section${w(e.id, n, m)} style="display:flex;flex-wrap:wrap;${r}">${i}</section>`;
243
+ }, B = (e, t, n) => {
244
+ let r = n?.instrument ?? !1;
245
+ O = [], k = n?.canvasEditorPadding ?? !1;
246
+ let i = (e.body?.rows || []).map((e) => z(e, t, r)).join(""), a = b(e.body?.style || {});
247
+ if (t === "email") {
248
+ let t = O.length > 0 ? ` ${O.join(" ")}` : "", n = d(f(e.body?.rows, [e.body?.style?.fontFamily]));
249
+ return `<mjml><mj-head>${n ? `<mj-font name="PlexoGoogleFonts" href="${y(n)}" />` : ""}<mj-style>.desktop-hide { display:none !important; max-height:0; overflow:hidden; }${t}</mj-style></mj-head><mj-body><mj-section><mj-column><mj-text css-class="preheader" padding="0" font-size="1px" color="#ffffff">&nbsp;</mj-text></mj-column></mj-section>${i}</mj-body></mjml>`.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1");
250
+ }
251
+ return `<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /></head><body style="${a}"><main>${i}</main></body></html>`;
252
+ };
253
+ //#endregion
254
+ export { B as t };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./compilerClient-CZG4B3cC.js";
1
+ import { t as e } from "./compilerClient-BwRHkl-b.js";
2
2
  export { e as parseJsonToTargetFormat };
@@ -1,5 +1,7 @@
1
- /** Which edge of the currently-hovered sortable item the dragged item would land on. */
2
- export type DropEdge = 'top' | 'bottom' | null;
1
+ /** Which edge of the currently-hovered sortable item the dragged item would land on --
2
+ * top/bottom for vertically-stacked items (rows, elements), left/right for columns, which
3
+ * sit side by side instead. */
4
+ export type DropEdge = 'top' | 'bottom' | 'left' | 'right' | null;
3
5
  export interface DragOverInfo {
4
6
  overId: string | null;
5
7
  edge: DropEdge;
@@ -11,10 +11,13 @@ export interface CompiledCanvasEditorOverlayProps {
11
11
  * needs every pointer event itself (click-to-position-caret, drag-to-select-text), which an
12
12
  * overlay hit-box sitting on top of it would otherwise intercept. */
13
13
  editingId: string | null;
14
- /** Fired on double-click of a text-editable element node. Absent for row/column nodes and
15
- * for element types not in TEXT_EDITABLE_TYPES (DndOverlayNode never wires the double-click
16
- * handler at all in that case, rather than wiring it to a no-op). */
17
- onEditRequest: (id: string) => void;
14
+ /** Fired on double-click of a text-editable element node, with the click's own viewport
15
+ * coordinates -- the real node lives inside the iframe and never sees this click itself,
16
+ * so this is the only way to place the caret where the user actually clicked (see
17
+ * useFrameTextEditing's beginEditing). Absent for row/column nodes and for element types
18
+ * not in TEXT_EDITABLE_TYPES (DndOverlayNode never wires the double-click handler at all
19
+ * in that case, rather than wiring it to a no-op). */
20
+ onEditRequest: (id: string, clientX: number, clientY: number) => void;
18
21
  /** True in preview/read-only mode — hit-boxes render nothing interactive at all. */
19
22
  disabled: boolean;
20
23
  onSelect: (id: string, kind: FrameNodeKind, event: React.MouseEvent) => void;
@@ -9,6 +9,13 @@ export interface CompiledCanvasFrameProps {
9
9
  * point for a future overlay layer to start querying/measuring nodes. Receives null on
10
10
  * unmount/cleanup so callers can safely drop any references they held. */
11
11
  onDocumentReady?: (doc: Document | null, win: Window | null) => void;
12
+ /** Node ids (data-plexo-id / plexo-node-<id>) that must never be touched by a morph, however
13
+ * much their compiled markup has changed -- the one node actively being edited (see
14
+ * useFrameTextEditing), so an UNRELATED edit elsewhere in the template (a totally different
15
+ * row's background color, say) can't silently reset the live contentEditable state,
16
+ * selection, or in-progress uncommitted typing on this one out from under the user. Every
17
+ * other node updates normally regardless. */
18
+ protectedNodeIds?: string[];
12
19
  className?: string;
13
20
  style?: React.CSSProperties;
14
21
  title?: string;
@@ -24,6 +24,10 @@ export interface EmptyColumnQuickInsert {
24
24
  export interface DndOverlayNodeProps {
25
25
  nodeRect: FrameNodeRect;
26
26
  data: DndOverlayNodeData;
27
+ /** Nesting depth (0 = top-level row and its own direct columns/elements, +1 for each level
28
+ * of nested row) -- see overlayNodeStyle's own zIndex comment for why this has to factor
29
+ * into stacking order, not just `kind` alone. */
30
+ depth: number;
27
31
  isSelected: boolean;
28
32
  isHovered: boolean;
29
33
  disabled: boolean;
@@ -33,7 +37,7 @@ export interface DndOverlayNodeProps {
33
37
  * CompiledCanvasEditorOverlay's TEXT_EDITABLE_TYPES) -- wires a double-click to enter
34
38
  * in-frame text editing. Absent (not just disabled) for every other node, so double-
35
39
  * clicking a row/column/non-text element does nothing, matching the legacy canvas. */
36
- onEditRequest?: (id: string) => void;
40
+ onEditRequest?: (id: string, clientX: number, clientY: number) => void;
37
41
  /** Small tag shown above the hit-box when selected -- "Row"/"Nested Row"/"Column (60%)",
38
42
  * matching SortableRow.tsx's/DroppableColumn.tsx's own selected-state label exactly.
39
43
  * Absent for elements (their type already shows in the properties panel's own header). */
@@ -52,8 +56,6 @@ export interface DndOverlayNodeProps {
52
56
  * legacy canvas (see PlexoBuilder's `handleDragStart`/`handleDragOver`/`handleDragEnd`, which
53
57
  * dispatch purely on `active.data.current`/`over.data.current` and never touch the DOM — so an
54
58
  * overlay-registered draggable/droppable using the same `id`/`data` shape is handled identically,
55
- * with zero changes to that logic). Dispatches to a droppable-only or sortable variant based on
56
- * `data.type` — calling both `useDroppable` and `useSortable` (which itself registers a
57
- * droppable) for the same id would double-register that id in dnd-kit's droppable registry.
59
+ * with zero changes to that logic).
58
60
  */
59
61
  export declare const DndOverlayNode: React.FC<DndOverlayNodeProps>;
@@ -18,6 +18,9 @@ export interface TableCellOverlayProps {
18
18
  editingKey: string | null;
19
19
  disabled: boolean;
20
20
  onCellClick: (event: React.MouseEvent) => void;
21
- onCellEditRequest: (key: string) => void;
21
+ /** Fired on double-click, with the click's own viewport coordinates -- the real cell lives
22
+ * inside the iframe and never sees this click itself, so this is the only way to place the
23
+ * caret where the user actually clicked (see useFrameTextEditing's beginEditing). */
24
+ onCellEditRequest: (key: string, clientX: number, clientY: number) => void;
22
25
  }
23
26
  export declare const TableCellOverlay: React.FC<TableCellOverlayProps>;
@@ -9,6 +9,10 @@ export interface FrameNodeRect {
9
9
  rect: DOMRect;
10
10
  el: HTMLElement;
11
11
  }
12
+ /** Exported for CompiledCanvasFrame's own morph-time use (protecting the actively-edited node
13
+ * from being touched by an unrelated recompile) -- same identity mechanism, no reason to
14
+ * duplicate the two-selector matching logic a second time. */
15
+ export declare function extractNodeId(el: Element): string | null;
12
16
  /**
13
17
  * Tracks the on-screen (iframe-local) position of every identifiable row/column/element node
14
18
  * in a compiled-canvas-frame's document, re-measuring whenever the document's layout could
@@ -24,8 +24,15 @@ export interface FrameTextEditingApi {
24
24
  /** The node id currently in edit mode, or null. Only ever an 'element'-kind node. */
25
25
  editingId: string | null;
26
26
  /** Puts `id`'s real iframe DOM node into contentEditable mode and focuses it, committing
27
- * whatever was previously being edited first (if anything, and if it's a different node). */
28
- beginEditing: (id: string) => void;
27
+ * whatever was previously being edited first (if anything, and if it's a different node).
28
+ * `point` (iframe-local coordinates) places the caret exactly where the triggering click
29
+ * landed -- see beginEditing's own comment for why that has to be passed in explicitly
30
+ * rather than read off a live browser selection. Omit it (e.g. an edit entered some other
31
+ * way than a click) to fall back to a caret at the end of the content. */
32
+ beginEditing: (id: string, point?: {
33
+ x: number;
34
+ y: number;
35
+ }) => void;
29
36
  /** Commits and exits edit mode. Safe to call when nothing is being edited (no-op). */
30
37
  endEditing: () => void;
31
38
  /** Re-focuses the node being edited and restores its last known selection Range, for a
@@ -33,6 +40,13 @@ export interface FrameTextEditingApi {
33
40
  * into the parent document blurs the iframe's active element, so the selection has to be
34
41
  * explicitly restored immediately before every formatting command, not just read live. */
35
42
  restoreSelection: () => void;
43
+ /** True from the moment a mousedown starts inside the node being edited until the next
44
+ * mouseup anywhere -- i.e. "a drag-to-select gesture is in progress". Callers should AND
45
+ * this into every overlay layer's own `disabled` prop for as long as it's true (see this
46
+ * flag's own effect below for why: without it, dragging a selection past the edited node's
47
+ * own bounds hands every further mousemove to whatever overlay hit-box the cursor is now
48
+ * over instead of the iframe, silently freezing the selection). */
49
+ isDragSelecting: boolean;
36
50
  }
37
51
  /**
38
52
  * Owns the compiled canvas's in-frame text editing lifecycle: turning a node's real DOM