@charisol/plexo-sdk 1.1.15 → 1.2.0

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.
Files changed (36) hide show
  1. package/dist/PlexoRenderer.d.ts +8 -0
  2. package/dist/{compiler-TjBEKCfw.js → compiler-nmaKKdLq.js} +245 -239
  3. package/dist/compiler.js +2 -2
  4. package/dist/compilerClient-DW7b0Ifk.js +215 -0
  5. package/dist/compilerClient.js +2 -168
  6. package/dist/components/CodeViewer.d.ts +7 -0
  7. package/dist/components/editor/frame/AccordionHeaderOverlay.d.ts +15 -0
  8. package/dist/components/editor/frame/CompiledCanvasEditorOverlay.d.ts +30 -0
  9. package/dist/components/editor/frame/CompiledCanvasFrame.d.ts +16 -0
  10. package/dist/components/editor/frame/DndOverlayNode.d.ts +59 -0
  11. package/dist/components/editor/frame/FrameTextToolbar.d.ts +29 -0
  12. package/dist/components/editor/frame/TableCellOverlay.d.ts +23 -0
  13. package/dist/components/editor/frame/useAccordionHeaderRects.d.ts +21 -0
  14. package/dist/components/editor/frame/useCanvasEngine.d.ts +25 -0
  15. package/dist/components/editor/frame/useCompiledCanvasHtml.d.ts +41 -0
  16. package/dist/components/editor/frame/useFrameNodeRects.d.ts +18 -0
  17. package/dist/components/editor/frame/useFrameTextEditing.d.ts +47 -0
  18. package/dist/components/editor/frame/useMeasuredFrameNodes.d.ts +13 -0
  19. package/dist/components/editor/frame/useTableCellRects.d.ts +29 -0
  20. package/dist/{iconSvgStatic-CA1z-vnh.js → iconSvgStatic-CGue7nyp.js} +81 -47
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +47631 -47240
  23. package/dist/mjmlBrowser-DFgIYJ2a.js +39283 -0
  24. package/dist/plexo-sdk.css +1 -1
  25. package/dist/sanitize.js +2 -0
  26. package/dist/sanitizeCompiledHtml-C_sPjL3B.js +5079 -0
  27. package/dist/utilities/compiler.d.ts +4 -1
  28. package/dist/utilities/compilerClient.d.ts +4 -1
  29. package/dist/utilities/elementResolvers.d.ts +27 -7
  30. package/dist/utilities/instrumentation.d.ts +54 -0
  31. package/dist/utilities/mjmlBrowser.d.ts +19 -0
  32. package/dist/utilities/playground.helpers.d.ts +0 -18
  33. package/dist/utilities/playground.interfaces.d.ts +13 -0
  34. package/dist/utilities/sanitizeCompiledHtml.d.ts +10 -0
  35. package/dist/utilities/useApiKeyValidation.d.ts +6 -0
  36. package/package.json +17 -2
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-TjBEKCfw.js";
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
+ 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-nmaKKdLq.js";
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,215 @@
1
+ import { d as e, f as t, g as n, h as r, m as i, o as a, p as o, t as s, u as c, x as l, y as u } from "./iconSvgStatic-CGue7nyp.js";
2
+ //#region src/utilities/instrumentation.ts
3
+ var d = "plexo-node";
4
+ function f(e) {
5
+ return `plexo-node-${e}`;
6
+ }
7
+ //#endregion
8
+ //#region src/utilities/compilerClient.ts
9
+ var p = "https://cdn.jsdelivr.net/npm/@charisol/plexo-sdk@latest/dist/social-icons", m = /* @__PURE__ */ new Set([
10
+ "selectable",
11
+ "draggable",
12
+ "duplicatable",
13
+ "deletable",
14
+ "hideable",
15
+ "locked"
16
+ ]), h = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), g = (e = {}) => Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}:${String(t)};`).join(""), _ = (...e) => e.map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), v = (e, t, n) => n ? _(e, d, f(t)) : e, y = (e, t) => {
17
+ let n = v("", e, t);
18
+ return n ? ` css-class="${h(n)}"` : "";
19
+ }, b = (e, t) => {
20
+ let n = v("", e, t);
21
+ return n ? ` class="${h(n)}"` : "";
22
+ }, x = (e, t) => {
23
+ let n = { ...e.attributes || {} };
24
+ if (t === "email") for (let e of m) delete n[e];
25
+ return n;
26
+ }, S = (e, t, n) => {
27
+ let r = x(e, t), i = g(e.style || {}), a = v(_(r.htmlClassNames, r.htmlClass, r.validationClass, r.validationClassName), e.id, t === "landing_page" && n), o = h(r.name || r.fieldName || "field"), s = h(r.placeholder || ""), c = r.required ? " required" : "";
28
+ if (t === "email") return `<mj-table${y(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 = h(r.inputType || r.type || (e.type === "input" ? r.kind || "text" : e.type)), u = r.htmlId ? ` id="${h(r.htmlId)}"` : "", d = a ? ` class="${h(a)}"` : "";
30
+ return e.type === "textarea" ? `<textarea${u}${d} name="${o}" placeholder="${s}" style="${i}"${c}>${h(r.value || "")}</textarea>` : e.type === "select" ? `<select${u}${d} name="${o}" style="${i}"${c}>${(r.options || []).map((e) => `<option value="${h(e.value)}">${h(e.label)}</option>`).join("")}</select>` : `<input${u}${d} type="${l}" name="${o}" placeholder="${s}" value="${h(r.value || "")}" style="${i}"${c} />`;
31
+ }, C = (e, t, n) => {
32
+ let r = x(e, t), i = g(e.style || {}), a = v(_(r.htmlClassNames, r.htmlClass), e.id, t === "landing_page" && n), o = r.htmlId ? ` id="${h(r.htmlId)}"` : "", s = a ? ` class="${h(a)}"` : "", c = h(r.actionUrl || r.action || "#"), l = h(r.method || "POST"), u = r.fields || [], d = h(r.submitLabel || "Submit");
33
+ return t === "email" ? `<mj-table${y(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>${h(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;">${h(e.placeholder || "") || "&nbsp;"}</span></td></tr>`).join("")}<tr><td style="padding-top:12px;"><a href="${h(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) => S({
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
+ }, w = [], T = !1, E = 148, D = [
43
+ ["borderRadius", "border-radius"],
44
+ ["borderWidth", "border-width"],
45
+ ["borderStyle", "border-style"],
46
+ ["borderColor", "border-color"],
47
+ ["boxShadow", "box-shadow"]
48
+ ], O = (e, t, n = []) => {
49
+ let r = [...D.filter(([t]) => e[t]).map(([t, n]) => `${n}: ${h(String(e[t]))}`), ...n];
50
+ if (r.length === 0) return "";
51
+ let i = `plexo-extra-style-${t}`;
52
+ return w.push(`.${i} { ${r.join("; ")}; }`), i;
53
+ }, k = (e = {}, t = {}) => {
54
+ let n = ["padding=\"0\""], r = e.fontSize || t.fontSize, i = e.fontWeight || t.fontWeight;
55
+ return r && n.push(`font-size="${h(String(r))}"`), i && n.push(`font-weight="${h(String(i))}"`), e.color && n.push(`color="${h(String(e.color))}"`), e.fontFamily && n.push(`font-family="${h(String(e.fontFamily))}"`), e.lineHeight && n.push(`line-height="${h(String(e.lineHeight))}"`), e.letterSpacing && n.push(`letter-spacing="${h(String(e.letterSpacing))}"`), e.textAlign && n.push(`align="${h(String(e.textAlign))}"`), n.join(" ");
56
+ }, A = (e = {}) => {
57
+ let t = e.backgroundColor || e.background;
58
+ return t ? ` background-color="${h(String(t))}"` : "";
59
+ }, j = (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
+ }, M = (e = {}) => {
64
+ let t = [];
65
+ e.backgroundColor && t.push(`background-color="${h(String(e.backgroundColor))}"`), e.color && t.push(`color="${h(String(e.color))}"`), e.fontSize && t.push(`font-size="${h(String(e.fontSize))}"`), e.fontWeight && t.push(`font-weight="${h(String(e.fontWeight))}"`), e.fontFamily && t.push(`font-family="${h(String(e.fontFamily))}"`), e.lineHeight && t.push(`line-height="${h(String(e.lineHeight))}"`), e.letterSpacing && t.push(`letter-spacing="${h(String(e.letterSpacing))}"`), e.textAlign && t.push(`align="${h(String(e.textAlign))}"`);
66
+ let n = j(e, "borderRadius", [
67
+ "borderTopLeftRadius",
68
+ "borderTopRightRadius",
69
+ "borderBottomRightRadius",
70
+ "borderBottomLeftRadius"
71
+ ]);
72
+ return n && t.push(`border-radius="${h(n)}"`), t.join(" ");
73
+ }, N = (l, d, f) => {
74
+ let m = x(l, d), T = g(l.style || {}), E = m.htmlId ? ` id="${h(m.htmlId)}"` : "", D = _(m.htmlClassNames, m.htmlClass, d === "landing_page" && m.hideOnMobile ? "hidden md:block" : ""), O = d === "landing_page" ? v(D, l.id, f) : D, A = O ? ` class="${h(O)}"` : "", N = typeof m.customCss == "string" && m.customCss.trim() ? m.customCss.trim() : "", P = N && d === "landing_page" ? `<style>${N}</style>` : "";
75
+ if (l.type === "form_container") return `${P}${C(l, d, f)}`;
76
+ if (l.type === "input" || l.type === "select" || l.type === "textarea") return `${P}${S(l, d, f)}`;
77
+ if (d === "email") {
78
+ if (l.type === "button") {
79
+ let e = h(m.href || "#"), t = h(m.text || "Button"), n = a(l).width, r = n === "auto" ? "" : ` width="${h(n)}"`, i = l.style || {}, o = M(i), s = j(i, "padding", [
80
+ "paddingTop",
81
+ "paddingRight",
82
+ "paddingBottom",
83
+ "paddingLeft"
84
+ ]) || "10px 16px";
85
+ return `<mj-button href="${e}" css-class="${v(m.hideOnDesktop ? "desktop-hide" : "", l.id, f)}" padding="0" inner-padding="${h(s)}"${r}${o ? ` ${o}` : ""}>${t}</mj-button>`;
86
+ }
87
+ if (l.type === "image") {
88
+ let e = c(l), t = e.width && e.width !== "100%" ? ` width="${h(e.width)}"` : "", n = e.height && e.height !== "auto" ? ` height="${h(e.height)}"` : "", r = y(l.id, f);
89
+ return `<mj-image src="${h(m.src || "")}" alt="${h(m.alt || "")}"${t}${n}${r} />`;
90
+ }
91
+ if (l.type === "social") {
92
+ let e = t(l);
93
+ if (!e.length) return "";
94
+ let n = l.style || {}, r = n.textAlign === "center" ? "center" : n.textAlign === "right" ? "flex-end" : "flex-start", i = n.iconSpacing || "8px", a = j(n, "padding", [
95
+ "paddingTop",
96
+ "paddingRight",
97
+ "paddingBottom",
98
+ "paddingLeft"
99
+ ]) || "8px", o = j(n, "margin", [
100
+ "marginTop",
101
+ "marginRight",
102
+ "marginBottom",
103
+ "marginLeft"
104
+ ]), s = (e) => e === "square" ? "14px" : "9999px", c = e.map((e) => {
105
+ let t = `<img src="${`${p}/${u[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="${h(e.url)}" style="display:inline-flex;align-items:center;justify-content:center;width:${h(e.size)};height:${h(e.size)};background-color:${h(e.backgroundColor)};border-radius:${s(e.iconType)};text-decoration:none;">${t}</a>`;
107
+ }).join(""), d = `display:flex;flex-wrap:wrap;justify-content:${r};gap:${h(String(i))};padding:${h(a)};${o ? `margin:${h(o)};` : ""}`;
108
+ return `<mj-raw><div${b(l.id, f)} style="${d}">${c}</div></mj-raw>`;
109
+ }
110
+ if (l.type === "menu") {
111
+ let t = e(l);
112
+ return `<mj-navbar hamburger="hamburger"${y(l.id, f)}>${t.map((e) => `<mj-navbar-link href="${h(e.href)}">${h(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
113
+ }
114
+ if (l.type === "table") {
115
+ let e = o(l), t = l.style || {}, n = `${t.borderWidth || "1px"} ${t.borderStyle || "solid"} ${t.borderColor || "#cbd5e1"}`, r = (r, i, a, o) => {
116
+ let s = o ? "th" : "td", c = o ? t.headerBgColor || "#f8fafc" : e.striped && i % 2 == 1 ? "#f8fafc" : t.contentBgColor || "#ffffff", u = o ? t.headerTextColor || "#1e293b" : t.contentTextColor || "#475569";
117
+ return `<tr>${r.map((e, r) => {
118
+ let i = f ? ` data-plexo-cell="${h(l.id)}|${a}-${r}"` : "";
119
+ return `<${s}${i} style="padding: ${t.cellPadding || "8px"}; border: ${n}; background-color: ${c}; color: ${u};">${h(e) || "&nbsp;"}</${s}>`;
120
+ }).join("")}</tr>`;
121
+ }, i = +!!e.enableHeader, a = 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>` : "", c = e.cells.slice(i, Math.max(i, a)).map((e, t) => r(e, t, i + t, !1)).join(""), u = e.enableFooter && e.cells.length > i ? `<tfoot>${r(e.cells[e.cells.length - 1], e.cells.length - 1, e.cells.length - 1, !1)}</tfoot>` : "";
122
+ return `<mj-table${y(l.id, f)}><table role="presentation" style="border-collapse: collapse; width: 100%;">${s}<tbody>${c}</tbody>${u}</table></mj-table>`;
123
+ }
124
+ if (l.type === "video") {
125
+ let e = n(m.videoUrl), t = m.linkType === "email" ? `mailto:${m.href || ""}` : m.href || m.videoUrl || "#", r = y(l.id, f);
126
+ return `<mj-image src="${h(e.thumbnailUrl)}" href="${h(t)}" alt="${h(m.alt || "Video preview")}"${r} />`;
127
+ }
128
+ if (l.type === "timer") {
129
+ let e = r(m.targetDate, m.timezone), t = m.showLabels !== !1;
130
+ return `<mj-text align="center"${y(l.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 ${h(m.targetDate || "")}</div>` : ""}</mj-text>`;
131
+ }
132
+ if (l.type === "carousel") {
133
+ let e = Array.isArray(m.images) ? m.images : [], t = y(l.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="${h(e.src)}" alt="${h(e.alt || "")}" />`).join("")}</mj-carousel>`;
135
+ }
136
+ if (l.type === "icon") {
137
+ let e = parseInt(String(m.iconSize || 48), 10) || 48, t = l.style?.color || "#1e293b", n = s(m.iconName, e, t);
138
+ return `<mj-text align="center"${y(l.id, f)}>${n}</mj-text>`;
139
+ }
140
+ let d = v(m.hideOnDesktop ? "desktop-hide" : "", l.id, f);
141
+ if (l.type === "heading" || l.type === "paragraph" || l.type === "text") {
142
+ let e = l.type === "heading" ? {
143
+ fontSize: "24px",
144
+ fontWeight: "700"
145
+ } : { fontSize: "14px" }, t = l.style || {}, n = k(t, e), r = i(l).autoWidth, a = /* @__PURE__ */ new Set([
146
+ "fontSize",
147
+ "fontWeight",
148
+ "color",
149
+ "fontFamily",
150
+ "lineHeight",
151
+ "letterSpacing",
152
+ "textAlign"
153
+ ]), o = Object.entries(t).filter(([e, t]) => !a.has(e) && e !== "width" && t != null && t !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${h(String(t))}`);
154
+ r ? o.push("display: inline-block") : t.width && o.push(`width: ${h(String(t.width))}`), t.height && o.push("overflow: hidden");
155
+ let s = "";
156
+ o.length > 0 && (s = `plexo-textbox-${l.id}`, w.push(`.${s} > div { ${o.join("; ")}; }`));
157
+ let c = _(s, d);
158
+ return `<mj-text${n ? ` ${n}` : ""} css-class="${c}">${m.text || ""}</mj-text>`;
159
+ }
160
+ if (l.type === "spacer") {
161
+ let e = l.style?.height || "24px", t = y(l.id, f);
162
+ return `<mj-spacer height="${h(String(e))}"${t} />`;
163
+ }
164
+ if (l.type === "divider") {
165
+ let e = l.style || {}, t = y(l.id, f);
166
+ return `<mj-divider border-width="${h(String(e.borderWidth || "1px"))}" border-style="${h(String(e.borderStyle || "solid"))}" border-color="${h(String(e.borderColor || "#334155"))}"${t} />`;
167
+ }
168
+ return l.type === "card" ? `<mj-text css-class="${d}"><strong style="display:block;margin-bottom:8px;">${h(m.title || "Card Title")}</strong><span style="font-size:14px;color:#64748b;">${h(m.description || "Card description.")}</span></mj-text>` : l.type === "html" ? `<mj-text css-class="${d}">${m.htmlContent || m.text || ""}</mj-text>` : `<mj-text${E}${A} css-class="${d}">${h(m.text || m.htmlContent || "")}</mj-text>`;
169
+ }
170
+ switch (l.type) {
171
+ case "heading": return `${P}<h2${E}${A} style="${T}">${h(m.text || "Heading")}</h2>`;
172
+ case "paragraph":
173
+ case "text": return `${P}<p${E}${A} style="${T}">${h(m.text || "")}</p>`;
174
+ case "button": return `${P}<a${E}${A} href="${h(m.href || "#")}" style="${T}">${h(m.text || "Button")}</a>`;
175
+ case "image": return `${P}<img${E}${A} src="${h(m.src || "")}" alt="${h(m.alt || "")}" style="${T}" />`;
176
+ case "html": return `${P}<div${E}${A} style="${T}">${String(m.htmlContent || "")}</div>`;
177
+ case "blog_title":
178
+ case "blog_content":
179
+ case "blog_featured_image":
180
+ case "blog_date":
181
+ case "blog_author":
182
+ case "blog_categories":
183
+ case "blog_comments":
184
+ case "blog_post_list": return `${P}<div${E}${A} data-plexo-blog-${l.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true"${m.prefix ? ` data-plexo-blog-prefix="${h(m.prefix)}"` : ""} style="${T}"></div>`;
185
+ default: return `${P}<div${E}${A} style="${T}">${h(m.text || "")}</div>`;
186
+ }
187
+ }, P = (e, t, n) => {
188
+ if (t === "email") {
189
+ let r = new Map(e.elements.map((e) => [e.id, e])), i = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), a = l(e).map((e) => {
190
+ let a = r.get(e);
191
+ if (a) return N(a, t, n);
192
+ let o = i.get(e);
193
+ return o ? `<mj-raw><tr><td style="font-size:16px;">${F(o, "landing_page", n)}</td></tr></mj-raw>` : "";
194
+ }).join(""), o = A(e.styles || {}), s = e.elements.length === 0 && (!Array.isArray(e.nestedRows) || e.nestedRows.length === 0), c = _(T && s ? O({}, e.id, [`min-height: ${E}px`]) : "", v("", e.id, n)), u = c ? ` css-class="${h(c)}"` : "";
195
+ return `<mj-column width="${h(e.width || "100%")}"${o}${u}>${a}</mj-column>`;
196
+ }
197
+ let r = g(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 = l(e).map((e) => {
198
+ let r = i.get(e);
199
+ if (r) return N(r, t, n);
200
+ let o = a.get(e);
201
+ return o ? F(o, t, n) : "";
202
+ }).join(""), s = b(e.id, n), c = e.elements.length === 0 && (!Array.isArray(e.nestedRows) || e.nestedRows.length === 0), u = T && c ? `min-height: ${E}px;` : "";
203
+ return `<div${s} style="width:${h(e.width || "100%")};${u}${r}">${o}</div>`;
204
+ }, F = (e, t, n) => {
205
+ if (t === "email") return `<mj-section css-class="${v(e.style?.hideOnDesktop ? "desktop-hide" : "", e.id, n)}"${A(e.style || {})}>${e.columns.map((e) => P(e, t, n)).join("")}</mj-section>`;
206
+ let r = g(e.style || {}), i = e.columns.map((e) => P(e, t, n)).join("");
207
+ return `<section${b(e.id, n)} style="display:flex;flex-wrap:wrap;${r}">${i}</section>`;
208
+ }, I = (e, t, n) => {
209
+ let r = n?.instrument ?? !1;
210
+ w = [], T = n?.canvasEditorPadding ?? !1;
211
+ let i = (e.body?.rows || []).map((e) => F(e, t, r)).join(""), a = g(e.body?.style || {});
212
+ return t === "email" ? `<mjml><mj-head><mj-style>.desktop-hide { display:none !important; max-height:0; overflow:hidden; }${w.length > 0 ? ` ${w.join(" ")}` : ""}</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") : `<!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>`;
213
+ };
214
+ //#endregion
215
+ export { I as t };
@@ -1,168 +1,2 @@
1
- import { a as e, b as t, d as n, f as r, h as i, l as a, m as o, p as s, t as c, v as l } from "./iconSvgStatic-CA1z-vnh.js";
2
- //#region src/utilities/compilerClient.ts
3
- var u = "https://cdn.jsdelivr.net/npm/@charisol/plexo-sdk@latest/dist/social-icons", d = /* @__PURE__ */ new Set([
4
- "selectable",
5
- "draggable",
6
- "duplicatable",
7
- "deletable",
8
- "hideable",
9
- "locked"
10
- ]), f = (e) => String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), p = (e = {}) => Object.entries(e).filter(([, e]) => e != null && String(e).trim() !== "").map(([e, t]) => `${e.replace(/([A-Z])/g, "-$1").toLowerCase()}:${String(t)};`).join(""), m = (...e) => e.map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), h = (e, t) => {
11
- let n = { ...e.attributes || {} };
12
- if (t === "email") for (let e of d) delete n[e];
13
- return n;
14
- }, g = (e, t) => {
15
- let n = h(e, t), r = p(e.style || {}), i = m(n.htmlClassNames, n.htmlClass, n.validationClass, n.validationClassName), a = f(n.name || n.fieldName || "field"), o = f(n.placeholder || ""), s = n.required ? " required" : "";
16
- if (t === "email") return `<mj-table><tr><td style="padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;color:#64748b;${r}">${o || a}</td></tr></mj-table>`;
17
- let c = f(n.inputType || n.type || (e.type === "input" ? n.kind || "text" : e.type)), l = n.htmlId ? ` id="${f(n.htmlId)}"` : "", u = i ? ` class="${f(i)}"` : "";
18
- return e.type === "textarea" ? `<textarea${l}${u} name="${a}" placeholder="${o}" style="${r}"${s}>${f(n.value || "")}</textarea>` : e.type === "select" ? `<select${l}${u} name="${a}" style="${r}"${s}>${(n.options || []).map((e) => `<option value="${f(e.value)}">${f(e.label)}</option>`).join("")}</select>` : `<input${l}${u} type="${c}" name="${a}" placeholder="${o}" value="${f(n.value || "")}" style="${r}"${s} />`;
19
- }, _ = (e, t) => {
20
- let n = h(e, t), r = p(e.style || {}), i = m(n.htmlClassNames, n.htmlClass), a = n.htmlId ? ` id="${f(n.htmlId)}"` : "", o = i ? ` class="${f(i)}"` : "", s = f(n.actionUrl || n.action || "#"), c = f(n.method || "POST"), l = n.fields || [], u = f(n.submitLabel || "Submit");
21
- return t === "email" ? `<mj-table><tr><td style="${r}"><table role="presentation" width="100%">${l.map((e) => `<tr><td style="padding:8px 0;font-family:Arial,sans-serif;color:#334155;"><strong>${f(e.label || e.name || "Field")}</strong><br/><span style="display:inline-block;margin-top:4px;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;color:#64748b;">${f(e.placeholder || "") || "&nbsp;"}</span></td></tr>`).join("")}<tr><td style="padding-top:12px;"><a href="${f(n.href || n.submitHref || "#")}" style="display:inline-block;padding:10px 16px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:6px;">${u}</a></td></tr></table></td></tr></mj-table>` : `<form${a}${o} action="${s}" method="${c}" style="${r}">${l.map((t) => g({
22
- id: `${e.id}-${String(t.name || t.label || "field")}`,
23
- type: t.kind === "textarea" || t.kind === "select" ? t.kind : "input",
24
- style: {
25
- ...e.style || {},
26
- ...t.style || {}
27
- },
28
- attributes: t
29
- }, "landing_page")).join("")}<button type="submit">${u}</button></form>`;
30
- }, v = (e = {}, t = {}) => {
31
- let n = [], r = e.fontSize || t.fontSize, i = e.fontWeight || t.fontWeight;
32
- return r && n.push(`font-size="${f(String(r))}"`), i && n.push(`font-weight="${f(String(i))}"`), e.color && n.push(`color="${f(String(e.color))}"`), e.fontFamily && n.push(`font-family="${f(String(e.fontFamily))}"`), e.lineHeight && n.push(`line-height="${f(String(e.lineHeight))}"`), e.letterSpacing && n.push(`letter-spacing="${f(String(e.letterSpacing))}"`), e.textAlign && n.push(`align="${f(String(e.textAlign))}"`), e.backgroundColor && n.push(`container-background-color="${f(String(e.backgroundColor))}"`), n.join(" ");
33
- }, y = (e = {}) => {
34
- let t = e.backgroundColor || e.background;
35
- return t ? ` background-color="${f(String(t))}"` : "";
36
- }, b = (e, t, n) => {
37
- if (e[t]) return String(e[t]);
38
- let [r, i, a, o] = n;
39
- if (e[r] || e[i] || e[a] || e[o]) return `${e[r] || "0px"} ${e[i] || "0px"} ${e[a] || "0px"} ${e[o] || "0px"}`;
40
- }, x = (e = {}) => {
41
- let t = [];
42
- e.backgroundColor && t.push(`background-color="${f(String(e.backgroundColor))}"`), e.color && t.push(`color="${f(String(e.color))}"`), e.fontSize && t.push(`font-size="${f(String(e.fontSize))}"`), e.fontWeight && t.push(`font-weight="${f(String(e.fontWeight))}"`), e.fontFamily && t.push(`font-family="${f(String(e.fontFamily))}"`), e.lineHeight && t.push(`line-height="${f(String(e.lineHeight))}"`), e.letterSpacing && t.push(`letter-spacing="${f(String(e.letterSpacing))}"`), e.textAlign && t.push(`align="${f(String(e.textAlign))}"`);
43
- let n = b(e, "borderRadius", [
44
- "borderTopLeftRadius",
45
- "borderTopRightRadius",
46
- "borderBottomRightRadius",
47
- "borderBottomLeftRadius"
48
- ]);
49
- return n && t.push(`border-radius="${f(n)}"`), t.join(" ");
50
- }, S = (t, d) => {
51
- let y = h(t, d), S = p(t.style || {}), C = y.htmlId ? ` id="${f(y.htmlId)}"` : "", w = m(y.htmlClassNames, y.htmlClass, d === "landing_page" && y.hideOnMobile ? "hidden md:block" : ""), T = w ? ` class="${f(w)}"` : "", E = typeof y.customCss == "string" && y.customCss.trim() ? y.customCss.trim() : "", D = E && d === "landing_page" ? `<style>${E}</style>` : "";
52
- if (t.type === "form_container") return `${D}${_(t, d)}`;
53
- if (t.type === "input" || t.type === "select" || t.type === "textarea") return `${D}${g(t, d)}`;
54
- if (d === "email") {
55
- if (t.type === "button") {
56
- let n = f(y.href || "#"), r = f(y.text || "Button"), i = e(t).width, a = i === "auto" ? "" : ` width="${f(i)}"`, o = t.style || {}, s = x(o), c = b(o, "padding", [
57
- "paddingTop",
58
- "paddingRight",
59
- "paddingBottom",
60
- "paddingLeft"
61
- ]) || "10px 16px";
62
- return `<mj-button href="${n}" css-class="${y.hideOnDesktop ? "desktop-hide" : ""}" padding="0" inner-padding="${f(c)}"${a}${s ? ` ${s}` : ""}>${r}</mj-button>`;
63
- }
64
- if (t.type === "image") {
65
- let e = a(t), n = e.width && e.width !== "100%" ? ` width="${f(e.width)}"` : "", r = e.height && e.height !== "auto" ? ` height="${f(e.height)}"` : "";
66
- return `<mj-image src="${f(y.src || "")}" alt="${f(y.alt || "")}"${n}${r} />`;
67
- }
68
- if (t.type === "social") {
69
- let e = r(t);
70
- if (!e.length) return "";
71
- let n = t.style || {}, i = n.textAlign === "center" ? "center" : n.textAlign === "right" ? "flex-end" : "flex-start", a = n.iconSpacing || "8px", o = b(n, "padding", [
72
- "paddingTop",
73
- "paddingRight",
74
- "paddingBottom",
75
- "paddingLeft"
76
- ]) || "8px", s = b(n, "margin", [
77
- "marginTop",
78
- "marginRight",
79
- "marginBottom",
80
- "marginLeft"
81
- ]), c = (e) => e === "square" ? "14px" : "9999px", d = e.map((e) => {
82
- let t = `<img src="${`${u}/${l[e.provider] ? e.provider : "fallback"}.png`}" alt="" width="${parseInt(e.size, 10) || 36}" style="display:block;width:60%;height:60%;border:0;" />`;
83
- return `<a href="${f(e.url)}" style="display:inline-flex;align-items:center;justify-content:center;width:${f(e.size)};height:${f(e.size)};background-color:${f(e.backgroundColor)};border-radius:${c(e.iconType)};text-decoration:none;">${t}</a>`;
84
- }).join("");
85
- return `<mj-raw><div style="${`display:flex;flex-wrap:wrap;justify-content:${i};gap:${f(String(a))};padding:${f(o)};${s ? `margin:${f(s)};` : ""}`}">${d}</div></mj-raw>`;
86
- }
87
- if (t.type === "menu") return `<mj-navbar hamburger="hamburger">${n(t).map((e) => `<mj-navbar-link href="${f(e.href)}">${f(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
88
- if (t.type === "table") {
89
- let e = s(t), n = t.style || {}, r = `${n.borderWidth || "1px"} ${n.borderStyle || "solid"} ${n.borderColor || "#cbd5e1"}`, i = (t, i, a) => {
90
- let o = a ? "th" : "td", s = a ? n.headerBgColor || "#f8fafc" : e.striped && i % 2 == 1 ? "#f8fafc" : n.contentBgColor || "#ffffff", c = a ? n.headerTextColor || "#1e293b" : n.contentTextColor || "#475569";
91
- return `<tr>${t.map((e) => `<${o} style="padding: ${n.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${f(e) || "&nbsp;"}</${o}>`).join("")}</tr>`;
92
- }, a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length;
93
- return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${e.enableHeader && e.cells.length > 0 ? `<thead>${i(e.cells[0], 0, !0)}</thead>` : ""}<tbody>${e.cells.slice(a, Math.max(a, o)).map((e, t) => i(e, t, !1)).join("")}</tbody>${e.enableFooter && e.cells.length > a ? `<tfoot>${i(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : ""}</table></mj-table>`;
94
- }
95
- if (t.type === "video") {
96
- let e = i(y.videoUrl), t = y.linkType === "email" ? `mailto:${y.href || ""}` : y.href || y.videoUrl || "#";
97
- return `<mj-image src="${f(e.thumbnailUrl)}" href="${f(t)}" alt="${f(y.alt || "Video preview")}" />`;
98
- }
99
- if (t.type === "timer") {
100
- let e = o(y.targetDate), t = y.showLabels !== !1;
101
- return `<mj-text align="center"><div style="font-size: 28px; font-weight: 800;">${e.days}d ${e.hours}h ${e.minutes}m ${e.seconds}s</div>${t ? `<div style="font-size: 12px; color: #64748b;">Countdown to ${f(y.targetDate || "")}</div>` : ""}</mj-text>`;
102
- }
103
- if (t.type === "carousel") {
104
- let e = Array.isArray(y.images) ? y.images : [];
105
- return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${f(e.src)}" alt="${f(e.alt || "")}" />`).join("")}</mj-carousel>`;
106
- }
107
- if (t.type === "icon") {
108
- let e = parseInt(String(y.iconSize || 48), 10) || 48, n = t.style?.color || "#1e293b";
109
- return `<mj-text align="center">${c(y.iconName, e, n)}</mj-text>`;
110
- }
111
- let d = y.hideOnDesktop ? "desktop-hide" : "";
112
- if (t.type === "heading" || t.type === "paragraph" || t.type === "text") {
113
- let e = t.type === "heading" ? {
114
- fontSize: "24px",
115
- fontWeight: "700"
116
- } : { fontSize: "14px" }, n = v(t.style || {}, e);
117
- return `<mj-text${n ? ` ${n}` : ""} css-class="${d}">${y.text || ""}</mj-text>`;
118
- }
119
- if (t.type === "spacer") {
120
- let e = t.style?.height || "24px";
121
- return `<mj-spacer height="${f(String(e))}" />`;
122
- }
123
- if (t.type === "divider") {
124
- let e = t.style || {};
125
- return `<mj-divider border-width="${f(String(e.borderWidth || "1px"))}" border-style="${f(String(e.borderStyle || "solid"))}" border-color="${f(String(e.borderColor || "#334155"))}" />`;
126
- }
127
- return t.type === "card" ? `<mj-text css-class="${d}"><strong style="display:block;margin-bottom:8px;">${f(y.title || "Card Title")}</strong><span style="font-size:14px;color:#64748b;">${f(y.description || "Card description.")}</span></mj-text>` : t.type === "html" ? `<mj-text css-class="${d}">${y.htmlContent || y.text || ""}</mj-text>` : `<mj-text${C}${T} css-class="${d}">${f(y.text || y.htmlContent || "")}</mj-text>`;
128
- }
129
- switch (t.type) {
130
- case "heading": return `${D}<h2${C}${T} style="${S}">${f(y.text || "Heading")}</h2>`;
131
- case "paragraph":
132
- case "text": return `${D}<p${C}${T} style="${S}">${f(y.text || "")}</p>`;
133
- case "button": return `${D}<a${C}${T} href="${f(y.href || "#")}" style="${S}">${f(y.text || "Button")}</a>`;
134
- case "image": return `${D}<img${C}${T} src="${f(y.src || "")}" alt="${f(y.alt || "")}" style="${S}" />`;
135
- case "html": return `${D}<div${C}${T} style="${S}">${String(y.htmlContent || "")}</div>`;
136
- case "blog_title":
137
- case "blog_content":
138
- case "blog_featured_image":
139
- case "blog_date":
140
- case "blog_author":
141
- case "blog_categories":
142
- case "blog_comments":
143
- case "blog_post_list": return `${D}<div${C}${T} data-plexo-blog-${t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true"${y.prefix ? ` data-plexo-blog-prefix="${f(y.prefix)}"` : ""} style="${S}"></div>`;
144
- default: return `${D}<div${C}${T} style="${S}">${f(y.text || "")}</div>`;
145
- }
146
- }, C = (e, n) => {
147
- if (n === "email") {
148
- let r = new Map(e.elements.map((e) => [e.id, e])), i = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), a = t(e).map((e) => {
149
- let t = r.get(e);
150
- if (t) return S(t, n);
151
- let a = i.get(e);
152
- return a ? `<mj-raw>${w(a, "landing_page")}</mj-raw>` : "";
153
- }).join(""), o = y(e.styles || {});
154
- return `<mj-column width="${f(e.width || "100%")}"${o}>${a}</mj-column>`;
155
- }
156
- let r = p(e.styles || {}), i = new Map(e.elements.map((e) => [e.id, e])), a = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), o = t(e).map((e) => {
157
- let t = i.get(e);
158
- if (t) return S(t, n);
159
- let r = a.get(e);
160
- return r ? w(r, n) : "";
161
- }).join("");
162
- return `<div style="width:${f(e.width || "100%")};${r}">${o}</div>`;
163
- }, w = (e, t) => t === "email" ? `<mj-section css-class="${e.style?.hideOnDesktop ? "desktop-hide" : ""}"${y(e.style || {})}>${e.columns.map((e) => C(e, t)).join("")}</mj-section>` : `<section style="display:flex;flex-wrap:wrap;${p(e.style || {})}">${e.columns.map((e) => C(e, t)).join("")}</section>`, T = (e, t) => {
164
- let n = (e.body?.rows || []).map((e) => w(e, t)).join(""), r = p(e.body?.style || {});
165
- return t === "email" ? `<mjml><mj-head><mj-style>.desktop-hide { display:none !important; max-height:0; overflow:hidden; }</mj-style></mj-head><mj-body><mj-section><mj-column><mj-text css-class="preheader" padding="0" font-size="1px" color="#ffffff">&nbsp;</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>`;
166
- };
167
- //#endregion
168
- export { T as parseJsonToTargetFormat };
1
+ import { t as e } from "./compilerClient-DW7b0Ifk.js";
2
+ export { e as parseJsonToTargetFormat };
@@ -6,6 +6,13 @@ interface CodeViewerProps {
6
6
  template: TemplateJSON;
7
7
  compiledHtml: string;
8
8
  compiledText: string;
9
+ /** True while an email-mode template's real server-compiled preview is being fetched — the
10
+ * html/text shown alongside this is the last-known-good (or the local flexbox fallback on
11
+ * first load), not yet the fresh compile. Ignored for landing_page mode, which compiles
12
+ * synchronously and never sets this. */
13
+ isCompilingEmailPreview?: boolean;
14
+ /** Set when the email-mode server compile fails — the html/text shown is stale/fallback. */
15
+ emailPreviewError?: string | null;
9
16
  onNotify?: (message: string) => void;
10
17
  onImportJson?: (jsonText: string) => ImportResult;
11
18
  onImportHtml?: (htmlText: string) => ImportResult;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { AccordionHeaderRect } from './useAccordionHeaderRects';
3
+ /**
4
+ * Per-header click-to-toggle hit-boxes for EVERY accordion on the page, regardless of
5
+ * selection -- mirrors SortableElement.tsx's handleToggle, which works whether or not the
6
+ * accordion element is currently selected, and only toggles (never selects the element).
7
+ * Layered above the base overlay (row/column/element hit-boxes) so a header's toggle wins
8
+ * over its containing element's own click-to-select.
9
+ */
10
+ export interface AccordionHeaderOverlayProps {
11
+ headerRects: Map<string, AccordionHeaderRect>;
12
+ disabled: boolean;
13
+ onToggle: (elementId: string, path: number[]) => void;
14
+ }
15
+ export declare const AccordionHeaderOverlay: React.FC<AccordionHeaderOverlayProps>;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import type { FrameNodeKind, FrameNodeRect } from './useFrameNodeRects';
3
+ import type { TemplateJSON } from '../../../utilities/types';
4
+ export interface CompiledCanvasEditorOverlayProps {
5
+ template: TemplateJSON;
6
+ rects: Map<string, FrameNodeRect>;
7
+ selectedId: string | null;
8
+ hoveredId: string | null;
9
+ /** The element node currently in in-frame text-edit mode, or null. That node's own hit-box
10
+ * is deliberately NOT rendered while editing — the real contentEditable element underneath
11
+ * needs every pointer event itself (click-to-position-caret, drag-to-select-text), which an
12
+ * overlay hit-box sitting on top of it would otherwise intercept. */
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;
18
+ /** True in preview/read-only mode — hit-boxes render nothing interactive at all. */
19
+ disabled: boolean;
20
+ onSelect: (id: string, kind: FrameNodeKind, event: React.MouseEvent) => void;
21
+ onDeselect: () => void;
22
+ onHoverChange: (id: string | null) => void;
23
+ /** Fired from an empty column's "Drop content here" quick-insert buttons -- mirrors
24
+ * DroppableColumn.tsx's own empty-state buttons exactly (same three kinds, same intent:
25
+ * add a starter element and select it immediately). */
26
+ onEmptyColumnInsert: (rowId: string, columnId: string, kind: 'heading' | 'image' | 'button') => void;
27
+ className?: string;
28
+ style?: React.CSSProperties;
29
+ }
30
+ export declare const CompiledCanvasEditorOverlay: React.FC<CompiledCanvasEditorOverlayProps>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export interface CompiledCanvasFrameProps {
3
+ /** The compiled+sanitized HTML to display — the actual output for the current target/mode. */
4
+ html: string;
5
+ /** True in the editing canvas (suppresses native interactivity — see EDITOR_INERT_STYLESHEET);
6
+ * false for a true preview/publish-equivalent render. */
7
+ editable: boolean;
8
+ /** Called once per (re)write of the frame's document, after `load` fires — this is the hook
9
+ * point for a future overlay layer to start querying/measuring nodes. Receives null on
10
+ * unmount/cleanup so callers can safely drop any references they held. */
11
+ onDocumentReady?: (doc: Document | null, win: Window | null) => void;
12
+ className?: string;
13
+ style?: React.CSSProperties;
14
+ title?: string;
15
+ }
16
+ export declare const CompiledCanvasFrame: React.ForwardRefExoticComponent<CompiledCanvasFrameProps & React.RefAttributes<HTMLIFrameElement>>;
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import type { FrameNodeKind, FrameNodeRect } from './useFrameNodeRects';
3
+ export type DndOverlayNodeData = {
4
+ type: 'row';
5
+ id: string;
6
+ parentRowId?: string;
7
+ parentColId?: string;
8
+ } | {
9
+ type: 'column';
10
+ id: string;
11
+ rowId: string;
12
+ parentRowId?: string;
13
+ parentColId?: string;
14
+ width?: string;
15
+ } | {
16
+ type: 'element';
17
+ id: string;
18
+ columnId: string;
19
+ rowId: string;
20
+ };
21
+ export interface EmptyColumnQuickInsert {
22
+ onInsert: (kind: 'heading' | 'image' | 'button') => void;
23
+ }
24
+ export interface DndOverlayNodeProps {
25
+ nodeRect: FrameNodeRect;
26
+ data: DndOverlayNodeData;
27
+ isSelected: boolean;
28
+ isHovered: boolean;
29
+ disabled: boolean;
30
+ onSelect: (id: string, kind: FrameNodeKind, event: React.MouseEvent) => void;
31
+ onHoverChange: (id: string | null) => void;
32
+ /** Present only for element nodes whose type is actually text-editable (see
33
+ * CompiledCanvasEditorOverlay's TEXT_EDITABLE_TYPES) -- wires a double-click to enter
34
+ * in-frame text editing. Absent (not just disabled) for every other node, so double-
35
+ * clicking a row/column/non-text element does nothing, matching the legacy canvas. */
36
+ onEditRequest?: (id: string) => void;
37
+ /** Small tag shown above the hit-box when selected -- "Row"/"Nested Row"/"Column (60%)",
38
+ * matching SortableRow.tsx's/DroppableColumn.tsx's own selected-state label exactly.
39
+ * Absent for elements (their type already shows in the properties panel's own header). */
40
+ label?: string;
41
+ /** Column-only: present when this column has no elements/nested rows of its own, matching
42
+ * DroppableColumn's "Drop content here" empty state (same three quick-insert buttons,
43
+ * same store actions) instead of leaving an empty column looking merely blank. An empty
44
+ * column's REAL compiled height already reserves enough room for this (see compiler.ts's/
45
+ * compilerClient.ts's own `canvasEditorPadding` option) -- the hit-box just measures that
46
+ * real height directly, same as every other node; it doesn't need or want a height of its
47
+ * own that could drift from it. */
48
+ emptyPlaceholder?: EmptyColumnQuickInsert;
49
+ }
50
+ /**
51
+ * One interactive hit-box over a compiled-frame node, wired into the SAME `DndContext` as the
52
+ * legacy canvas (see PlexoBuilder's `handleDragStart`/`handleDragOver`/`handleDragEnd`, which
53
+ * dispatch purely on `active.data.current`/`over.data.current` and never touch the DOM — so an
54
+ * 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.
58
+ */
59
+ export declare const DndOverlayNode: React.FC<DndOverlayNodeProps>;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { MergeTag } from '../../../utilities/playground.interfaces';
3
+ /**
4
+ * A formatting toolbar for the compiled canvas's in-frame text editing -- bold/italic/
5
+ * underline/strikethrough/subscript/superscript/lists/text-color/highlight-color/link, plus
6
+ * merge-tag pill insertion, running `execCommand` against the IFRAME's document (not the
7
+ * parent document SortableElement.tsx's own toolbar assumes). Matches that toolbar's exact
8
+ * execCommand strings (see its toggleTextFormatting/list/color button onClick handlers) so
9
+ * the two toolbars produce identical markup for the same action.
10
+ *
11
+ * Deliberately still smaller in one respect: the link/color pickers are native
12
+ * `window.prompt`/`<input type="color">` rather than SortableElement.tsx's own modal/
13
+ * swatch-palette UI -- presentational choices for that toolbar's own local-state
14
+ * button-pressed-highlighting, not anything this toolbar's execCommand calls depend on.
15
+ */
16
+ export interface FrameTextToolbarProps {
17
+ /** In the SAME coordinate space as CompiledCanvasEditorOverlay's hit-boxes (the iframe's
18
+ * own local coordinates) -- render this as an absolutely-positioned sibling inside the
19
+ * same `position: relative` wrapper as the frame/overlay. */
20
+ rect: DOMRect;
21
+ frameDoc: Document;
22
+ frameWin: Window;
23
+ /** Re-focuses the edited node and restores its last selection Range -- MUST be called
24
+ * synchronously at the start of every command, since clicking into this toolbar (living in
25
+ * the parent document) blurs the iframe's active element the instant the click lands. */
26
+ restoreSelection: () => void;
27
+ mergeTags: MergeTag[];
28
+ }
29
+ export declare const FrameTextToolbar: React.FC<FrameTextToolbarProps>;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { TableCellRect } from './useTableCellRects';
3
+ /**
4
+ * Per-cell hit-boxes for the currently-selected table element only (see PlexoBuilder's own
5
+ * wiring: `useTableCellRects` is scoped to `selectedElementId` when it's a 'table' element,
6
+ * empty otherwise) -- layered on top of that table's own whole-element hit-box (z-index 3 in
7
+ * DndOverlayNode) so a cell can be double-clicked into edit mode without the element hit-box
8
+ * intercepting the click first. A plain (non-double) click still just re-confirms the table's
9
+ * own selection via `onCellClick`, mirroring the legacy canvas: clicking into a
10
+ * contentEditable cell there ALSO selects the containing element, since the cell doesn't
11
+ * stop the click from bubbling to SortableElement's own onClick.
12
+ */
13
+ export interface TableCellOverlayProps {
14
+ cellRects: Map<string, TableCellRect>;
15
+ /** The cell key (from useTableCellRects, "<tableId>:<row>-<col>") currently being edited --
16
+ * that one cell renders NO hit-box, so the real contentEditable node underneath gets every
17
+ * pointer event itself (caret placement, text selection). */
18
+ editingKey: string | null;
19
+ disabled: boolean;
20
+ onCellClick: (event: React.MouseEvent) => void;
21
+ onCellEditRequest: (key: string) => void;
22
+ }
23
+ export declare const TableCellOverlay: React.FC<TableCellOverlayProps>;