better-react-email-editor 0.1.4 → 0.1.7

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/index.js CHANGED
@@ -1,28 +1,29 @@
1
- import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useImperativeHandle as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l, useSyncExternalStore as u } from "react";
2
- import { Placeholder as d } from "@tiptap/extension-placeholder";
3
- import { EditorContent as f, EditorContext as p, useEditor as m, useEditorState as h } from "@tiptap/react";
4
- import { EmailNode as g, composeReactEmail as _ } from "@react-email/editor/core";
5
- import { Button as v, StarterKit as y } from "@react-email/editor/extensions";
6
- import { EmailTheming as b, extendTheme as x, useEditorImage as S } from "@react-email/editor/plugins";
7
- import { Fragment as C } from "@tiptap/pm/model";
8
- import { NodeSelection as w, Plugin as T, PluginKey as E, Selection as D, TextSelection as O } from "@tiptap/pm/state";
1
+ import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useId as a, useImperativeHandle as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
2
+ import { Placeholder as f } from "@tiptap/extension-placeholder";
3
+ import { EditorContent as p, EditorContext as m, useEditor as h, useEditorState as g } from "@tiptap/react";
4
+ import { EmailNode as _, composeReactEmail as v } from "@react-email/editor/core";
5
+ import { Button as y, StarterKit as b } from "@react-email/editor/extensions";
6
+ import { EmailTheming as x, extendTheme as S, getEmailTheming as C, setGlobalStyles as w, useEditorImage as T } from "@react-email/editor/plugins";
7
+ import { Fragment as E } from "@tiptap/pm/model";
8
+ import { NodeSelection as D, Plugin as O, PluginKey as k, Selection as A, TextSelection as j } from "@tiptap/pm/state";
9
9
  import { generateJSON as ee } from "@tiptap/html";
10
- import { Extension as k, mergeAttributes as te } from "@tiptap/core";
11
- import { ReplaceStep as ne } from "@tiptap/pm/transform";
12
- import { AlignCenterIcon as re, AlignLeftIcon as ie, AlignRightIcon as ae, BoldIcon as oe, BubbleMenu as se, CodeIcon as A, Columns2Icon as ce, Columns3Icon as le, Columns4Icon as ue, EditorFocusScope as j, Heading1Icon as de, ImageIcon as fe, Inspector as M, ItalicIcon as pe, LayoutIcon as me, LinkIcon as he, ListIcon as ge, ListOrderedIcon as _e, MinusIcon as ve, MousePointerClickIcon as ye, PanelLeftIcon as be, PanelTopIcon as xe, PlusIcon as N, SlashCommand as Se, SquareCodeIcon as Ce, StrikethroughIcon as P, TableIcon as we, TextQuoteIcon as Te, TypeIcon as Ee, UnderlineIcon as De, XIcon as Oe, defaultSlashCommands as ke } from "@react-email/editor/ui";
13
- import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
14
- import * as Ae from "@radix-ui/react-popover";
15
- import { HexColorInput as je, HexColorPicker as Me } from "react-colorful";
16
- import { Column as Ne, Img as Pe, Link as Fe, Row as Ie, Section as Le } from "react-email";
17
- import { createPortal as Re } from "react-dom";
10
+ import { Extension as te, mergeAttributes as ne } from "@tiptap/core";
11
+ import { ReplaceStep as re } from "@tiptap/pm/transform";
12
+ import { Decoration as ie, DecorationSet as ae } from "@tiptap/pm/view";
13
+ import { AlignCenterIcon as oe, AlignLeftIcon as se, AlignRightIcon as ce, BoldIcon as le, BubbleMenu as ue, CodeIcon as de, Columns2Icon as fe, Columns3Icon as pe, Columns4Icon as me, EditorFocusScope as M, Heading1Icon as he, ImageIcon as ge, Inspector as N, ItalicIcon as _e, LayoutIcon as ve, LinkIcon as ye, ListIcon as be, ListOrderedIcon as xe, MinusIcon as Se, MousePointerClickIcon as P, PanelLeftIcon as Ce, PanelTopIcon as we, PlusIcon as F, SlashCommand as Te, SquareCodeIcon as Ee, StrikethroughIcon as De, TableIcon as Oe, TextQuoteIcon as ke, TypeIcon as Ae, UnderlineIcon as je, XIcon as Me, defaultSlashCommands as Ne } from "@react-email/editor/ui";
14
+ import { Fragment as Pe, jsx as I, jsxs as L } from "react/jsx-runtime";
15
+ import * as Fe from "@radix-ui/react-popover";
16
+ import { HexColorInput as Ie, HexColorPicker as Le } from "react-colorful";
17
+ import { Column as Re, Img as ze, Link as Be, Row as Ve, Section as He } from "react-email";
18
+ import { createPortal as Ue } from "react-dom";
18
19
  //#region \0rolldown/runtime.js
19
- var ze = Object.defineProperty, Be = (e, t) => {
20
+ var We = Object.defineProperty, Ge = (e, t) => {
20
21
  let n = {};
21
- for (var r in e) ze(n, r, {
22
+ for (var r in e) We(n, r, {
22
23
  get: e[r],
23
24
  enumerable: !0
24
25
  });
25
- return t || ze(n, Symbol.toStringTag, { value: "Module" }), n;
26
+ return t || We(n, Symbol.toStringTag, { value: "Module" }), n;
26
27
  };
27
28
  //#endregion
28
29
  //#region src/core/cx.ts
@@ -31,23 +32,23 @@ function R(...e) {
31
32
  }
32
33
  //#endregion
33
34
  //#region src/core/dnd.ts
34
- var Ve = /* @__PURE__ */ new Set([
35
+ var Ke = /* @__PURE__ */ new Set([
35
36
  "container",
36
37
  "section",
37
38
  "columnsColumn"
38
- ]), He = /* @__PURE__ */ new Set([
39
+ ]), qe = /* @__PURE__ */ new Set([
39
40
  "twoColumns",
40
41
  "threeColumns",
41
42
  "fourColumns"
42
- ]), Ue = "application/x-email-block";
43
- function We(e, t) {
43
+ ]), Je = "application/x-email-block";
44
+ function Ye(e, t) {
44
45
  let n = e.nodeDOM(t);
45
46
  return n instanceof HTMLElement ? n.getBoundingClientRect() : null;
46
47
  }
47
- function Ge(e, t, n) {
48
+ function Xe(e, t, n) {
48
49
  let r = [];
49
50
  return t.forEach((t, i) => {
50
- let a = n + 1 + i, o = We(e, a);
51
+ let a = n + 1 + i, o = Ye(e, a);
51
52
  o && r.push({
52
53
  node: t,
53
54
  pos: a,
@@ -55,10 +56,10 @@ function Ge(e, t, n) {
55
56
  });
56
57
  }), r;
57
58
  }
58
- function Ke(e) {
59
+ function Ze(e) {
59
60
  return e.type.name === "paragraph" && e.childCount === 0;
60
61
  }
61
- function qe(e) {
62
+ function Qe(e) {
62
63
  let t = null;
63
64
  return e.forEach((e, n) => {
64
65
  !t && e.type.name === "container" && (t = {
@@ -67,28 +68,28 @@ function qe(e) {
67
68
  });
68
69
  }), t;
69
70
  }
70
- function Je(e, t, n, r, i) {
71
- let a = qe(e.state.doc);
71
+ function $e(e, t, n, r, i) {
72
+ let a = Qe(e.state.doc);
72
73
  if (!a) return null;
73
74
  let o = (e) => !!i && e >= i.from && e < i.to, s = (i, a) => {
74
- let c = Ge(e, i, a), l = We(e, a);
75
+ let c = Xe(e, i, a), l = Ye(e, a);
75
76
  if (!l) return null;
76
77
  for (let r of c) {
77
78
  let { rect: i } = r, a = Math.min(12, i.height / 4), c = n > i.top + a && n < i.bottom - a, l = t >= i.left && t <= i.right;
78
79
  if (!c || !l || o(r.pos)) continue;
79
80
  let u = r.node.type.name;
80
- if (Ve.has(u)) {
81
+ if (Ke.has(u)) {
81
82
  let e = s(r.node, r.pos);
82
83
  if (e) return e;
83
- } else if (He.has(u)) {
84
- let n = Ge(e, r.node, r.pos), i = n.find((e) => t >= e.rect.left && t <= e.rect.right) ?? (t < n[0]?.rect.left ? n[0] : n[n.length - 1]);
84
+ } else if (qe.has(u)) {
85
+ let n = Xe(e, r.node, r.pos), i = n.find((e) => t >= e.rect.left && t <= e.rect.right) ?? (t < n[0]?.rect.left ? n[0] : n[n.length - 1]);
85
86
  if (i && !o(i.pos)) {
86
87
  let e = s(i.node, i.pos);
87
88
  if (e) return e;
88
89
  }
89
90
  }
90
91
  }
91
- if (c.length === 1 && Ke(c[0].node) && !o(c[0].pos)) {
92
+ if (c.length === 1 && Ze(c[0].node) && !o(c[0].pos)) {
92
93
  let e = c[0];
93
94
  return i.type.validContent(r) ? {
94
95
  pos: e.pos,
@@ -133,57 +134,57 @@ function Je(e, t, n, r, i) {
133
134
  };
134
135
  return s(a.node, a.pos);
135
136
  }
136
- function Ye(e, t) {
137
+ function et(e, t) {
137
138
  let { schema: n, doc: r } = e.state;
138
139
  if (t.kind === "new") try {
139
- return C.fromArray(t.content().map((e) => n.nodeFromJSON(e)));
140
+ return E.fromArray(t.content().map((e) => n.nodeFromJSON(e)));
140
141
  } catch (e) {
141
142
  return console.error("Invalid block content", e), null;
142
143
  }
143
144
  let i = r.nodeAt(t.pos);
144
- return i ? C.from(i) : null;
145
+ return i ? E.from(i) : null;
145
146
  }
146
- function Xe(e, t) {
147
+ function tt(e, t) {
147
148
  let n = e.doc.nodeAt(t);
148
- n && (n.isAtom || n.type.name === "horizontalRule" ? e.setSelection(w.create(e.doc, t)) : e.setSelection(O.near(e.doc.resolve(t + 1))));
149
+ n && (n.isAtom || n.type.name === "horizontalRule" ? e.setSelection(D.create(e.doc, t)) : e.setSelection(j.near(e.doc.resolve(t + 1))));
149
150
  }
150
- function Ze(e) {
151
+ function nt(e) {
151
152
  let { selection: t, doc: n } = e.state;
152
- t instanceof w && e.dispatch(e.state.tr.setSelection(D.near(n.resolve(t.from))));
153
+ t instanceof D && e.dispatch(e.state.tr.setSelection(A.near(n.resolve(t.from))));
153
154
  }
154
- function Qe(e, t) {
155
+ function rt(e, t) {
155
156
  if (t.replaceTo !== void 0) return t;
156
157
  let n = e.resolve(t.pos), r = n.parent, i = r.lastChild;
157
- return n.index() !== r.childCount || !i || r.childCount < 2 || !Ke(i) ? t : {
158
+ return n.index() !== r.childCount || !i || r.childCount < 2 || !Ze(i) ? t : {
158
159
  ...t,
159
160
  pos: t.pos - i.nodeSize
160
161
  };
161
162
  }
162
- function $e(e, t, n) {
163
+ function it(e, t, n) {
163
164
  let { view: r } = e;
164
- Ze(r);
165
- let i = Ye(r, t);
165
+ nt(r);
166
+ let i = et(r, t);
166
167
  if (!i) return !1;
167
- let a = Qe(r.state.doc, n), o = r.state.tr;
168
- if (t.kind === "new") a.replaceTo === void 0 ? o.insert(a.pos, i) : o.replaceWith(a.pos, a.replaceTo, i), Xe(o, a.pos);
168
+ let a = rt(r.state.doc, n), o = r.state.tr;
169
+ if (t.kind === "new") a.replaceTo === void 0 ? o.insert(a.pos, i) : o.replaceWith(a.pos, a.replaceTo, i), tt(o, a.pos);
169
170
  else {
170
171
  let e = r.state.doc.nodeAt(t.pos);
171
172
  if (!e) return !1;
172
173
  let n = t.pos, i = n + e.nodeSize;
173
174
  if (a.replaceTo === void 0 && (a.pos === n || a.pos === i)) return !1;
174
- et(o, n, i);
175
+ at(o, n, i);
175
176
  let s = o.mapping.map(a.pos, -1);
176
177
  if (a.replaceTo !== void 0) {
177
178
  let t = o.mapping.map(a.replaceTo, 1);
178
179
  o.replaceWith(s, t, e);
179
180
  } else o.insert(s, e);
180
- Xe(o, s);
181
+ tt(o, s);
181
182
  }
182
183
  return r.dispatch(o.scrollIntoView()), r.focus(), !0;
183
184
  }
184
- function et(e, t, n) {
185
+ function at(e, t, n) {
185
186
  let r = e.doc.resolve(t).parent;
186
- r.childCount === 1 && Ve.has(r.type.name) ? e.replaceWith(t, n, e.doc.type.schema.nodes.paragraph.create()) : e.delete(t, n);
187
+ r.childCount === 1 && Ke.has(r.type.name) ? e.replaceWith(t, n, e.doc.type.schema.nodes.paragraph.create()) : e.delete(t, n);
187
188
  }
188
189
  function z(e, t, n = !0) {
189
190
  if (t < 0 || t > e.content.size) return null;
@@ -199,14 +200,14 @@ function z(e, t, n = !0) {
199
200
  });
200
201
  for (let t of r) {
201
202
  let n = e.resolve(t.pos).parent.type.name;
202
- if (Ve.has(n) || He.has(n)) return t;
203
+ if (Ke.has(n) || qe.has(n)) return t;
203
204
  }
204
205
  return null;
205
206
  }
206
- function tt(e) {
207
+ function ot(e) {
207
208
  return e.node.type.name === "columnsColumn";
208
209
  }
209
- function nt(e, t) {
210
+ function st(e, t) {
210
211
  let n = e.resolve(t.pos);
211
212
  for (let r = n.depth; r > 0; r--) {
212
213
  let i = z(e, n.before(r));
@@ -214,40 +215,40 @@ function nt(e, t) {
214
215
  }
215
216
  return null;
216
217
  }
217
- function rt(e) {
218
+ function ct(e) {
218
219
  let { selection: t, doc: n } = e.state;
219
- return t instanceof w ? z(n, t.from) ?? {
220
+ return t instanceof D ? z(n, t.from) ?? {
220
221
  pos: t.from,
221
222
  node: t.node
222
223
  } : z(n, t.from, !1);
223
224
  }
224
- function it(e, t) {
225
- let { view: n } = e, r = n.state.tr.setSelection(w.create(n.state.doc, t.pos));
225
+ function lt(e, t) {
226
+ let { view: n } = e, r = n.state.tr.setSelection(D.create(n.state.doc, t.pos));
226
227
  n.dispatch(r), n.focus();
227
228
  }
228
- function at(e, t) {
229
+ function ut(e, t) {
229
230
  let { view: n } = e;
230
- Ze(n);
231
+ nt(n);
231
232
  let r = n.state.doc.nodeAt(t.pos);
232
233
  if (!r) return;
233
234
  let i = t.pos + r.nodeSize, a = n.state.tr.insert(i, r.copy(r.content));
234
- a.setSelection(w.create(a.doc, i)), n.dispatch(a.scrollIntoView()), n.focus();
235
+ a.setSelection(D.create(a.doc, i)), n.dispatch(a.scrollIntoView()), n.focus();
235
236
  }
236
- function ot(e, t) {
237
+ function dt(e, t) {
237
238
  let { view: n } = e, r = n.state.doc.nodeAt(t.pos);
238
239
  if (!r) return;
239
240
  let i = n.state.tr;
240
- et(i, t.pos, t.pos + r.nodeSize), n.dispatch(i);
241
+ at(i, t.pos, t.pos + r.nodeSize), n.dispatch(i);
241
242
  }
242
- function st(e, t) {
243
- let n = qe(e.state.doc);
243
+ function ft(e, t) {
244
+ let n = Qe(e.state.doc);
244
245
  if (!n) return;
245
246
  let r = n.node.lastChild, i = n.pos + n.node.nodeSize - 1;
246
- $e(e, {
247
+ it(e, {
247
248
  kind: "new",
248
249
  label: "",
249
250
  content: () => t
250
- }, r && Ke(r) && n.node.childCount > 1 ? {
251
+ }, r && Ze(r) && n.node.childCount > 1 ? {
251
252
  pos: i - r.nodeSize,
252
253
  replaceTo: i,
253
254
  line: {
@@ -266,7 +267,7 @@ function st(e, t) {
266
267
  }
267
268
  //#endregion
268
269
  //#region src/core/paste.ts
269
- var ct = v.extend({ parseHTML() {
270
+ var pt = y.extend({ parseHTML() {
270
271
  return [{
271
272
  tag: "a[data-id=\"react-email-button\"]",
272
273
  getAttrs: (e) => {
@@ -281,29 +282,29 @@ var ct = v.extend({ parseHTML() {
281
282
  }
282
283
  }];
283
284
  } });
284
- function lt(e, t) {
285
+ function mt(e, t) {
285
286
  let n = t.clipboardData?.getData("text/html") ?? "", r = n.includes("data-pm-slice");
286
287
  if ((t.clipboardData?.files?.length ?? 0) > 0) return !1;
287
288
  let { view: i } = e, { state: a } = i, { selection: o } = a;
288
- if (o instanceof w && o.node.isBlock) {
289
+ if (o instanceof D && o.node.isBlock) {
289
290
  let e = o.node, t = e.type.name === "columnsColumn" ? o.from + e.nodeSize - 1 : o.from + e.nodeSize, n = a.doc.resolve(t), r = a.schema.nodes.paragraph;
290
- if (He.has(n.parent.type.name) || !n.parent.canReplaceWith(n.index(), n.index(), r)) return !1;
291
- i.dispatch(a.tr.setSelection(O.near(n)));
291
+ if (qe.has(n.parent.type.name) || !n.parent.canReplaceWith(n.index(), n.index(), r)) return !1;
292
+ i.dispatch(a.tr.setSelection(j.near(n)));
292
293
  let s = i.state.tr.insert(t, r.create());
293
- s.setSelection(O.create(s.doc, t + 1)), i.dispatch(s);
294
+ s.setSelection(j.create(s.doc, t + 1)), i.dispatch(s);
294
295
  }
295
296
  return r ? (t.preventDefault(), t.stopPropagation(), i.pasteHTML(n), !0) : !1;
296
297
  }
297
298
  //#endregion
298
299
  //#region src/core/paste-handler.ts
299
- var ut = /class="[^"]*node-/, dt = [
300
+ var ht = /class="[^"]*node-/, gt = [
300
301
  "script",
301
302
  "iframe",
302
303
  "object",
303
304
  "embed",
304
305
  "meta",
305
306
  "base"
306
- ], ft = ["href", "src"], pt = {
307
+ ], _t = ["href", "src"], vt = {
307
308
  a: [
308
309
  "href",
309
310
  "target",
@@ -328,49 +329,49 @@ var ut = /class="[^"]*node-/, dt = [
328
329
  ],
329
330
  "*": ["id"]
330
331
  };
331
- function mt(e, t) {
332
+ function yt(e, t) {
332
333
  let n = e.trim().toLowerCase();
333
334
  return n.startsWith("javascript:") || n.startsWith("vbscript:") ? !1 : !n.startsWith("data:") || t && n.startsWith("data:image/");
334
335
  }
335
- function ht(e) {
336
- let t = /* @__PURE__ */ new Set([...pt[e.tagName.toLowerCase()] ?? [], ...pt["*"]]);
336
+ function bt(e) {
337
+ let t = /* @__PURE__ */ new Set([...vt[e.tagName.toLowerCase()] ?? [], ...vt["*"]]);
337
338
  for (let n of Array.from(e.attributes)) (n.name.startsWith("data-") || !t.has(n.name)) && e.removeAttribute(n.name);
338
339
  }
339
- function gt(e) {
340
- e.nodeType === Node.ELEMENT_NODE && ht(e);
341
- for (let t of Array.from(e.childNodes)) gt(t);
340
+ function xt(e) {
341
+ e.nodeType === Node.ELEMENT_NODE && bt(e);
342
+ for (let t of Array.from(e.childNodes)) xt(t);
342
343
  }
343
- function _t(e) {
344
+ function St(e) {
344
345
  let t = new DOMParser().parseFromString(e, "text/html");
345
- for (let e of dt) for (let n of Array.from(t.body.getElementsByTagName(e))) n.remove();
346
+ for (let e of gt) for (let n of Array.from(t.body.getElementsByTagName(e))) n.remove();
346
347
  for (let e of Array.from(t.body.querySelectorAll("[href], [src]"))) {
347
348
  let t = e.tagName.toLowerCase() === "img";
348
- for (let n of ft) {
349
+ for (let n of _t) {
349
350
  let r = e.getAttribute(n);
350
- r !== null && !mt(r, t) && e.removeAttribute(n);
351
+ r !== null && !yt(r, t) && e.removeAttribute(n);
351
352
  }
352
353
  }
353
- return ut.test(e) || gt(t.body), t.body.innerHTML;
354
+ return ht.test(e) || xt(t.body), t.body.innerHTML;
354
355
  }
355
- function vt(e) {
356
+ function Ct(e) {
356
357
  return (t, n, r) => {
357
358
  if (r.content.childCount === 1) return !1;
358
359
  let i = n.clipboardData?.getData?.("text/html");
359
360
  if (!i) return !1;
360
361
  n.preventDefault();
361
- let a = ee(_t(i), e), o = t.state.schema.nodeFromJSON(a);
362
+ let a = ee(St(i), e), o = t.state.schema.nodeFromJSON(a);
362
363
  return t.dispatch(t.state.tr.replaceSelectionWith(o, !1)), !0;
363
364
  };
364
365
  }
365
366
  //#endregion
366
367
  //#region src/core/select-all.ts
367
- var yt = /* @__PURE__ */ new Set(["columnsColumn", "codeBlock"]), bt = k.create({
368
+ var wt = /* @__PURE__ */ new Set(["columnsColumn", "codeBlock"]), Tt = te.create({
368
369
  name: "selectAllFix",
369
370
  priority: 101,
370
371
  addKeyboardShortcuts() {
371
372
  return { "Mod-a": ({ editor: e }) => {
372
373
  let { state: t } = e, { $from: n } = t.selection;
373
- for (let e = n.depth; e > 0; e--) if (yt.has(n.node(e).type.name) && (t.selection.from !== n.start(e) || t.selection.to !== n.end(e))) return !1;
374
+ for (let e = n.depth; e > 0; e--) if (wt.has(n.node(e).type.name) && (t.selection.from !== n.start(e) || t.selection.to !== n.end(e))) return !1;
374
375
  let r = -1;
375
376
  t.doc.forEach((e, t) => {
376
377
  r < 0 && e.type.name === "container" && (r = t);
@@ -378,28 +379,87 @@ var yt = /* @__PURE__ */ new Set(["columnsColumn", "codeBlock"]), bt = k.create(
378
379
  let i = r < 0 ? null : t.doc.nodeAt(r);
379
380
  if (!i) return !1;
380
381
  let a = r + 1, o = r + i.nodeSize - 1;
381
- return (t.selection.from !== a || t.selection.to !== o) && e.view.dispatch(t.tr.setSelection(O.create(t.doc, a, o))), !0;
382
+ return (t.selection.from !== a || t.selection.to !== o) && e.view.dispatch(t.tr.setSelection(j.create(t.doc, a, o))), !0;
382
383
  } };
383
384
  },
384
385
  addProseMirrorPlugins() {
385
- return [new T({
386
- key: new E("selectAllFix"),
386
+ return [new O({
387
+ key: new k("selectAllFix"),
387
388
  appendTransaction(e, t, n) {
388
389
  let r = t.selection;
389
- if (!(r instanceof O) || r.$from.parent.inlineContent && r.$to.parent.inlineContent || !e.some((e) => e.steps.some((e) => e instanceof ne && e.from === r.from && e.to === r.to))) return null;
390
+ if (!(r instanceof j) || r.$from.parent.inlineContent && r.$to.parent.inlineContent || !e.some((e) => e.steps.some((e) => e instanceof re && e.from === r.from && e.to === r.to))) return null;
390
391
  let i = r.from, a = r.to;
391
392
  for (let t of e) i = t.mapping.map(i, -1), a = t.mapping.map(a, 1);
392
393
  let { selection: o } = n;
393
- if (o instanceof O && o.from >= i && o.to <= a) return null;
394
+ if (o instanceof j && o.from >= i && o.to <= a) return null;
394
395
  let s = n.doc.resolve(i);
395
- return n.tr.setSelection(D.findFrom(s, 1, !0) ?? D.near(s));
396
+ return n.tr.setSelection(A.findFrom(s, 1, !0) ?? A.near(s));
396
397
  }
397
398
  })];
398
399
  }
399
- });
400
+ }), Et = te.create({
401
+ name: "focusedSpellcheck",
402
+ addProseMirrorPlugins() {
403
+ let { editor: e } = this;
404
+ return [new O({
405
+ key: new k("focusedSpellcheck"),
406
+ props: {
407
+ attributes: { spellcheck: "false" },
408
+ decorations: (t) => {
409
+ if (!e.isFocused) return ae.empty;
410
+ let { from: n, to: r, $from: i } = t.selection, a = [];
411
+ return t.doc.nodesBetween(n, r, (e, t) => !e.isTextblock || (a.push(ie.node(t, t + e.nodeSize, { spellcheck: "true" })), !1)), !a.length && i.parent.isTextblock && i.depth > 0 && a.push(ie.node(i.before(), i.after(), { spellcheck: "true" })), ae.create(t.doc, a);
412
+ }
413
+ }
414
+ })];
415
+ }
416
+ }), Dt = [
417
+ {
418
+ label: "Inter",
419
+ value: "Inter, Arial, Helvetica, sans-serif",
420
+ href: "https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap"
421
+ },
422
+ {
423
+ label: "Arial",
424
+ value: "Arial, Helvetica, sans-serif"
425
+ },
426
+ {
427
+ label: "Verdana",
428
+ value: "Verdana, Geneva, sans-serif"
429
+ },
430
+ {
431
+ label: "Tahoma",
432
+ value: "Tahoma, Verdana, Segoe, sans-serif"
433
+ },
434
+ {
435
+ label: "Georgia",
436
+ value: "Georgia, 'Times New Roman', Times, serif"
437
+ },
438
+ {
439
+ label: "Times New Roman",
440
+ value: "'Times New Roman', Times, serif"
441
+ }
442
+ ];
443
+ function Ot(e) {
444
+ return e.split(",")[0].trim().replace(/^['"]|['"]$/g, "").toLowerCase();
445
+ }
446
+ function kt(e, t) {
447
+ if (!t) return;
448
+ let n = Ot(t);
449
+ return e.find((e) => Ot(e.value) === n);
450
+ }
451
+ function At(e, t) {
452
+ let n = /* @__PURE__ */ new Set();
453
+ for (let t of e.matchAll(/font-family:\s*([^;"]+)/gi)) n.add(Ot(t[1].replace(/&#x27;|&quot;/g, "'")));
454
+ return t.filter((e) => e.href && n.has(Ot(e.value)));
455
+ }
456
+ function jt(e, t) {
457
+ let n = At(e, t).map((e) => `<link href="${e.href.replace(/&/g, "&amp;")}" rel="stylesheet" />`).join("");
458
+ return n ? e.replace("</head>", `${n}</head>`) : e;
459
+ }
400
460
  //#endregion
401
461
  //#region src/core/stores.ts
402
- function xt() {
462
+ function Mt() {
403
463
  let e = null;
404
464
  return {
405
465
  get: () => e,
@@ -411,7 +471,7 @@ function xt() {
411
471
  }
412
472
  };
413
473
  }
414
- function St() {
474
+ function Nt() {
415
475
  let e = null, t = /* @__PURE__ */ new Set();
416
476
  return {
417
477
  get: () => e,
@@ -428,7 +488,7 @@ function St() {
428
488
  }
429
489
  //#endregion
430
490
  //#region src/i18n/en.ts
431
- var Ct = {
491
+ var Pt = {
432
492
  topBar: {
433
493
  layers: "Layers",
434
494
  toggleLayers: "Show / hide layers",
@@ -473,6 +533,12 @@ var Ct = {
473
533
  breadcrumb: "Hierarchy",
474
534
  selectedText: "Selected text"
475
535
  },
536
+ emailHeader: {
537
+ subject: "Subject",
538
+ subjectPlaceholder: "Subject line",
539
+ previewText: "Preview",
540
+ previewTextPlaceholder: "Shown after the subject line in the inbox"
541
+ },
476
542
  body: {
477
543
  general: "General",
478
544
  previewText: "Preview text",
@@ -486,6 +552,8 @@ var Ct = {
486
552
  innerPadding: "Inner padding",
487
553
  radius: "Corner radius",
488
554
  defaultStyles: "Default styles",
555
+ font: "Font",
556
+ fontDefault: "Default (system font)",
489
557
  text: "Text",
490
558
  headings: "Headings",
491
559
  links: "Links",
@@ -494,6 +562,8 @@ var Ct = {
494
562
  },
495
563
  inspector: {
496
564
  typography: "Typography",
565
+ font: "Font",
566
+ fontDefault: "Default (email font)",
497
567
  color: "Color",
498
568
  size: "Size",
499
569
  weight: "Weight",
@@ -697,7 +767,7 @@ var Ct = {
697
767
  starterTitle: "Our favourites"
698
768
  },
699
769
  slashCommands: {}
700
- }, wt = {
770
+ }, Ft = {
701
771
  topBar: {
702
772
  layers: "Calques",
703
773
  toggleLayers: "Afficher / masquer les calques",
@@ -742,6 +812,12 @@ var Ct = {
742
812
  breadcrumb: "Hiérarchie",
743
813
  selectedText: "Texte sélectionné"
744
814
  },
815
+ emailHeader: {
816
+ subject: "Objet",
817
+ subjectPlaceholder: "Objet de l’email",
818
+ previewText: "Aperçu",
819
+ previewTextPlaceholder: "Affiché après l’objet dans la boîte de réception"
820
+ },
745
821
  body: {
746
822
  general: "Général",
747
823
  previewText: "Texte d’aperçu",
@@ -755,6 +831,8 @@ var Ct = {
755
831
  innerPadding: "Marge intérieure",
756
832
  radius: "Arrondi",
757
833
  defaultStyles: "Styles par défaut",
834
+ font: "Police",
835
+ fontDefault: "Par défaut (police système)",
758
836
  text: "Texte",
759
837
  headings: "Titres",
760
838
  links: "Liens",
@@ -763,6 +841,8 @@ var Ct = {
763
841
  },
764
842
  inspector: {
765
843
  typography: "Typographie",
844
+ font: "Police",
845
+ fontDefault: "Par défaut (police de l’email)",
766
846
  color: "Couleur",
767
847
  size: "Taille",
768
848
  weight: "Graisse",
@@ -1023,43 +1103,43 @@ var Ct = {
1023
1103
  description: "Mise en page sur quatre colonnes"
1024
1104
  }
1025
1105
  }
1026
- }, Tt = {
1027
- en: Ct,
1028
- fr: wt
1106
+ }, It = {
1107
+ en: Pt,
1108
+ fr: Ft
1029
1109
  };
1030
- function Et(e, t) {
1110
+ function Lt(e, t) {
1031
1111
  return typeof e == "function" ? e(t) : e;
1032
1112
  }
1033
- function Dt(e) {
1113
+ function Rt(e) {
1034
1114
  return typeof e == "object" && !!e && !Array.isArray(e);
1035
1115
  }
1036
- function Ot(e, t) {
1037
- if (!Dt(t) || !Dt(e)) return t ?? e;
1116
+ function zt(e, t) {
1117
+ if (!Rt(t) || !Rt(e)) return t ?? e;
1038
1118
  let n = { ...e };
1039
- for (let [e, r] of Object.entries(t)) r !== void 0 && (n[e] = Dt(r) && Dt(n[e]) ? Ot(n[e], r) : r);
1119
+ for (let [e, r] of Object.entries(t)) r !== void 0 && (n[e] = Rt(r) && Rt(n[e]) ? zt(n[e], r) : r);
1040
1120
  return n;
1041
1121
  }
1042
- function kt(e, t) {
1043
- let n = Tt[e] ?? Ct;
1044
- return t ? Ot(n, t) : n;
1122
+ function Bt(e, t) {
1123
+ let n = It[e] ?? Pt;
1124
+ return t ? zt(n, t) : n;
1045
1125
  }
1046
1126
  //#endregion
1047
1127
  //#region src/components/icons.tsx
1048
- var At = /* @__PURE__ */ Be({
1049
- CopyIcon: () => Mt,
1050
- DesktopIcon: () => Lt,
1051
- GripIcon: () => jt,
1052
- LayersIcon: () => zt,
1053
- MobileIcon: () => Rt,
1054
- OneColumnIcon: () => Wt,
1055
- ParentIcon: () => Pt,
1056
- PipetteIcon: () => Bt,
1057
- RedoIcon: () => It,
1058
- SocialIcon: () => Ut,
1059
- SpacerIcon: () => Vt,
1060
- SpacerTileIcon: () => Ht,
1061
- TrashIcon: () => Nt,
1062
- UndoIcon: () => Ft
1128
+ var Vt = /* @__PURE__ */ Ge({
1129
+ CopyIcon: () => Ut,
1130
+ DesktopIcon: () => Jt,
1131
+ GripIcon: () => Ht,
1132
+ LayersIcon: () => Xt,
1133
+ MobileIcon: () => Yt,
1134
+ OneColumnIcon: () => tn,
1135
+ ParentIcon: () => Gt,
1136
+ PipetteIcon: () => Zt,
1137
+ RedoIcon: () => qt,
1138
+ SocialIcon: () => en,
1139
+ SpacerIcon: () => Qt,
1140
+ SpacerTileIcon: () => $t,
1141
+ TrashIcon: () => Wt,
1142
+ UndoIcon: () => Kt
1063
1143
  }), B = (e, t = 2) => ({
1064
1144
  viewBox: "0 0 24 24",
1065
1145
  width: e,
@@ -1070,7 +1150,7 @@ var At = /* @__PURE__ */ Be({
1070
1150
  strokeLinecap: "round",
1071
1151
  strokeLinejoin: "round",
1072
1152
  "aria-hidden": !0
1073
- }), jt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1153
+ }), Ht = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1074
1154
  viewBox: "0 0 24 24",
1075
1155
  width: e,
1076
1156
  height: e,
@@ -1089,7 +1169,7 @@ var At = /* @__PURE__ */ Be({
1089
1169
  cy: e,
1090
1170
  r: "1.6"
1091
1171
  })] }, e))
1092
- }), Mt = ({ size: e = 14 }) => /* @__PURE__ */ L("svg", {
1172
+ }), Ut = ({ size: e = 14 }) => /* @__PURE__ */ L("svg", {
1093
1173
  ...B(e),
1094
1174
  children: [/* @__PURE__ */ I("rect", {
1095
1175
  x: "8",
@@ -1098,19 +1178,19 @@ var At = /* @__PURE__ */ Be({
1098
1178
  height: "12",
1099
1179
  rx: "2"
1100
1180
  }), /* @__PURE__ */ I("path", { d: "M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" })]
1101
- }), Nt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1181
+ }), Wt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1102
1182
  ...B(e),
1103
1183
  children: /* @__PURE__ */ I("path", { d: "M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3" })
1104
- }), Pt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1184
+ }), Gt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1105
1185
  ...B(e),
1106
1186
  children: /* @__PURE__ */ I("path", { d: "M12 19V5M6 11l6-6 6 6" })
1107
- }), Ft = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1187
+ }), Kt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1108
1188
  ...B(e),
1109
1189
  children: [/* @__PURE__ */ I("path", { d: "M9 14 4 9l5-5" }), /* @__PURE__ */ I("path", { d: "M4 9h10.5a5.5 5.5 0 0 1 0 11H11" })]
1110
- }), It = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1190
+ }), qt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1111
1191
  ...B(e),
1112
1192
  children: [/* @__PURE__ */ I("path", { d: "m15 14 5-5-5-5" }), /* @__PURE__ */ I("path", { d: "M20 9H9.5a5.5 5.5 0 0 0 0 11H13" })]
1113
- }), Lt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1193
+ }), Jt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1114
1194
  ...B(e),
1115
1195
  children: [/* @__PURE__ */ I("rect", {
1116
1196
  x: "3",
@@ -1119,7 +1199,7 @@ var At = /* @__PURE__ */ Be({
1119
1199
  height: "12",
1120
1200
  rx: "2"
1121
1201
  }), /* @__PURE__ */ I("path", { d: "M8 20h8M12 16v4" })]
1122
- }), Rt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1202
+ }), Yt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1123
1203
  ...B(e),
1124
1204
  children: [/* @__PURE__ */ I("rect", {
1125
1205
  x: "7",
@@ -1128,23 +1208,23 @@ var At = /* @__PURE__ */ Be({
1128
1208
  height: "20",
1129
1209
  rx: "2"
1130
1210
  }), /* @__PURE__ */ I("path", { d: "M11 18h2" })]
1131
- }), zt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1211
+ }), Xt = ({ size: e = 16 }) => /* @__PURE__ */ L("svg", {
1132
1212
  ...B(e),
1133
1213
  children: [/* @__PURE__ */ I("path", { d: "m12 3 9 5-9 5-9-5 9-5Z" }), /* @__PURE__ */ I("path", { d: "m3 13 9 5 9-5" })]
1134
- }), Bt = ({ size: e = 15 }) => /* @__PURE__ */ L("svg", {
1214
+ }), Zt = ({ size: e = 15 }) => /* @__PURE__ */ L("svg", {
1135
1215
  ...B(e),
1136
1216
  children: [
1137
1217
  /* @__PURE__ */ I("path", { d: "m2 22 1-1h3l9-9" }),
1138
1218
  /* @__PURE__ */ I("path", { d: "M3 21v-3l9-9" }),
1139
1219
  /* @__PURE__ */ I("path", { d: "m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" })
1140
1220
  ]
1141
- }), Vt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1221
+ }), Qt = ({ size: e = 14 }) => /* @__PURE__ */ I("svg", {
1142
1222
  ...B(e),
1143
1223
  children: /* @__PURE__ */ I("path", { d: "M4 4h16M4 20h16M12 8v8" })
1144
- }), Ht = ({ size: e = 22 }) => /* @__PURE__ */ I("svg", {
1224
+ }), $t = ({ size: e = 22 }) => /* @__PURE__ */ I("svg", {
1145
1225
  ...B(e, 1.8),
1146
1226
  children: /* @__PURE__ */ I("path", { d: "M4 4h16M4 20h16M12 7v10M9 9.5 12 7l3 2.5M9 14.5l3 2.5 3-2.5" })
1147
- }), Ut = ({ size: e = 22 }) => /* @__PURE__ */ L("svg", {
1227
+ }), en = ({ size: e = 22 }) => /* @__PURE__ */ L("svg", {
1148
1228
  ...B(e, 1.8),
1149
1229
  children: [
1150
1230
  /* @__PURE__ */ I("circle", {
@@ -1164,7 +1244,7 @@ var At = /* @__PURE__ */ Be({
1164
1244
  }),
1165
1245
  /* @__PURE__ */ I("path", { d: "m8.2 10.8 7.6-3.6M8.2 13.2l7.6 3.6" })
1166
1246
  ]
1167
- }), Wt = ({ size: e = 22 }) => /* @__PURE__ */ I("svg", {
1247
+ }), tn = ({ size: e = 22 }) => /* @__PURE__ */ I("svg", {
1168
1248
  ...B(e, 1.8),
1169
1249
  children: /* @__PURE__ */ I("rect", {
1170
1250
  x: "4",
@@ -1177,7 +1257,7 @@ var At = /* @__PURE__ */ Be({
1177
1257
  //#endregion
1178
1258
  //#region src/components/fields.tsx
1179
1259
  function V({ title: e, children: t, defaultOpen: n = !0, className: r, style: i }) {
1180
- let [a, o] = l(n);
1260
+ let [a, o] = u(n);
1181
1261
  return /* @__PURE__ */ L("section", {
1182
1262
  className: R("bree-group", r),
1183
1263
  style: i,
@@ -1210,12 +1290,12 @@ function H({ label: e, children: t, stacked: n, className: r, style: i }) {
1210
1290
  })]
1211
1291
  });
1212
1292
  }
1213
- function Gt(e) {
1214
- let [t, n] = l(e), [r, i] = l(e);
1293
+ function nn(e) {
1294
+ let [t, n] = u(e), [r, i] = u(e);
1215
1295
  return Object.is(e, r) || (i(e), n(e)), [t, n];
1216
1296
  }
1217
1297
  function U({ value: e, onChange: t, placeholder: n, type: r = "text", className: i, style: a }) {
1218
- let [o, s] = Gt(e);
1298
+ let [o, s] = nn(e);
1219
1299
  return /* @__PURE__ */ I("input", {
1220
1300
  className: R("bree-input", i),
1221
1301
  style: a,
@@ -1229,8 +1309,8 @@ function U({ value: e, onChange: t, placeholder: n, type: r = "text", className:
1229
1309
  }
1230
1310
  });
1231
1311
  }
1232
- function Kt({ value: e, onChange: t, rows: n = 8, className: r, style: i }) {
1233
- let [a, o] = Gt(e);
1312
+ function rn({ value: e, onChange: t, rows: n = 8, className: r, style: i }) {
1313
+ let [a, o] = nn(e);
1234
1314
  return /* @__PURE__ */ I("textarea", {
1235
1315
  className: R("bree-input bree-textarea", r),
1236
1316
  style: i,
@@ -1241,13 +1321,13 @@ function Kt({ value: e, onChange: t, rows: n = 8, className: r, style: i }) {
1241
1321
  onBlur: () => a !== e && t(a)
1242
1322
  });
1243
1323
  }
1244
- function qt(e) {
1324
+ function an(e) {
1245
1325
  if (e == null || e === "" || e === "auto") return "";
1246
1326
  let t = Number.parseFloat(String(e));
1247
1327
  return Number.isFinite(t) ? t : "";
1248
1328
  }
1249
1329
  function W({ value: e, onChange: t, unit: n = "px", min: r = 0, max: i, step: a = 1, placeholder: o, className: s, style: c }) {
1250
- let l = $(), [u, d] = Gt(String(qt(e))), f = (e) => {
1330
+ let l = $(), [u, d] = nn(String(an(e))), f = (e) => {
1251
1331
  if (e.trim() === "") return t("");
1252
1332
  let n = Number.parseFloat(e);
1253
1333
  Number.isFinite(n) && t(Math.max(r, i === void 0 ? n : Math.min(i, n)));
@@ -1265,7 +1345,7 @@ function W({ value: e, onChange: t, unit: n = "px", min: r = 0, max: i, step: a
1265
1345
  onKeyDown: (e) => {
1266
1346
  if (e.key === "Enter" && f(u), e.key === "ArrowUp" || e.key === "ArrowDown") {
1267
1347
  e.preventDefault();
1268
- let t = (qt(u) || 0) + (e.key === "ArrowUp" ? a : -a) * (e.shiftKey ? 10 : 1);
1348
+ let t = (an(u) || 0) + (e.key === "ArrowUp" ? a : -a) * (e.shiftKey ? 10 : 1);
1269
1349
  d(String(t)), f(String(t));
1270
1350
  }
1271
1351
  }
@@ -1275,8 +1355,8 @@ function W({ value: e, onChange: t, unit: n = "px", min: r = 0, max: i, step: a
1275
1355
  })]
1276
1356
  });
1277
1357
  }
1278
- function Jt({ value: e, onChange: t, min: n, max: r, unit: i = "px", className: a, style: o }) {
1279
- let s = qt(e) || n;
1358
+ function on({ value: e, onChange: t, min: n, max: r, unit: i = "px", className: a, style: o }) {
1359
+ let s = an(e) || n;
1280
1360
  return /* @__PURE__ */ L("span", {
1281
1361
  className: R("bree-range", a),
1282
1362
  style: o,
@@ -1292,7 +1372,7 @@ function Jt({ value: e, onChange: t, min: n, max: r, unit: i = "px", className:
1292
1372
  })]
1293
1373
  });
1294
1374
  }
1295
- var Yt = [
1375
+ var sn = [
1296
1376
  "#111827",
1297
1377
  "#374151",
1298
1378
  "#6b7280",
@@ -1312,26 +1392,26 @@ var Yt = [
1312
1392
  "#ecfdf5",
1313
1393
  "#fef3c7"
1314
1394
  ];
1315
- function Xt(e) {
1395
+ function cn(e) {
1316
1396
  let t = e.trim().toLowerCase();
1317
1397
  if (/^#[0-9a-f]{6}$/.test(t)) return t;
1318
1398
  if (/^#[0-9a-f]{3}$/.test(t)) return `#${[...t.slice(1)].map((e) => e + e).join("")}`;
1319
1399
  let n = t.match(/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/);
1320
1400
  return n ? `#${n.slice(1, 4).map((e) => Number(e).toString(16).padStart(2, "0")).join("")}` : null;
1321
1401
  }
1322
- function G({ value: e, onChange: t, presets: n = [], swatches: r = Yt, placeholder: a, className: o, style: s, popoverClassName: u }) {
1323
- let d = $(), f = a ?? d.fields.colorDefault, p = typeof e == "string" ? e : "", m = Xt(p), [h, g] = l(!1), [_, v] = l(m ?? "#ffffff"), y = c(t);
1402
+ function G({ value: e, onChange: t, presets: n = [], swatches: r = sn, placeholder: a, className: o, style: s, popoverClassName: c }) {
1403
+ let d = $(), f = a ?? d.fields.colorDefault, p = typeof e == "string" ? e : "", m = cn(p), [h, g] = u(!1), [_, v] = u(m ?? "#ffffff"), y = l(t);
1324
1404
  i(() => {
1325
1405
  y.current = t;
1326
1406
  });
1327
- let b = c(null), x = c(0), S = () => {
1407
+ let b = l(null), x = l(0), S = () => {
1328
1408
  window.clearTimeout(x.current), x.current = 0, b.current && y.current(b.current), b.current = null;
1329
1409
  }, C = (e) => {
1330
1410
  v(e), b.current = e, x.current ||= window.setTimeout(S, 60);
1331
1411
  }, w = (e) => {
1332
- b.current = null, window.clearTimeout(x.current), x.current = 0, v(Xt(e) ?? _), y.current(e);
1333
- }, T = typeof window < "u" ? window.EyeDropper : void 0, E = [...new Set(n.map((e) => Xt(e)).filter((e) => !!e))].slice(0, 9);
1334
- return /* @__PURE__ */ L(Ae.Root, {
1412
+ b.current = null, window.clearTimeout(x.current), x.current = 0, v(cn(e) ?? _), y.current(e);
1413
+ }, T = typeof window < "u" ? window.EyeDropper : void 0, E = [...new Set(n.map((e) => cn(e)).filter((e) => !!e))].slice(0, 9);
1414
+ return /* @__PURE__ */ L(Fe.Root, {
1335
1415
  open: h,
1336
1416
  onOpenChange: (e) => {
1337
1417
  e ? v(m ?? "#ffffff") : S(), g(e);
@@ -1339,7 +1419,7 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Yt, placehold
1339
1419
  children: [/* @__PURE__ */ L("span", {
1340
1420
  className: R("bree-color-field", o),
1341
1421
  style: s,
1342
- children: [/* @__PURE__ */ I(Ae.Trigger, {
1422
+ children: [/* @__PURE__ */ I(Fe.Trigger, {
1343
1423
  asChild: !0,
1344
1424
  children: /* @__PURE__ */ I("button", {
1345
1425
  type: "button",
@@ -1352,15 +1432,15 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Yt, placehold
1352
1432
  onChange: t,
1353
1433
  placeholder: f
1354
1434
  })]
1355
- }), /* @__PURE__ */ I(Ae.Portal, { children: /* @__PURE__ */ I(j, { children: /* @__PURE__ */ L(Ae.Content, {
1356
- className: R("bree bree-color-popover", u),
1435
+ }), /* @__PURE__ */ I(Fe.Portal, { children: /* @__PURE__ */ I(M, { children: /* @__PURE__ */ L(Fe.Content, {
1436
+ className: R("bree bree-color-popover", c),
1357
1437
  side: "left",
1358
1438
  align: "start",
1359
1439
  sideOffset: 10,
1360
1440
  collisionPadding: 12,
1361
1441
  onOpenAutoFocus: (e) => e.preventDefault(),
1362
1442
  children: [
1363
- /* @__PURE__ */ I(Me, {
1443
+ /* @__PURE__ */ I(Le, {
1364
1444
  color: _,
1365
1445
  onChange: C
1366
1446
  }),
@@ -1373,7 +1453,7 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Yt, placehold
1373
1453
  }),
1374
1454
  /* @__PURE__ */ L("label", {
1375
1455
  className: "bree-hex-field",
1376
- children: [/* @__PURE__ */ I("span", { children: "#" }), /* @__PURE__ */ I(je, {
1456
+ children: [/* @__PURE__ */ I("span", { children: "#" }), /* @__PURE__ */ I(Ie, {
1377
1457
  color: _,
1378
1458
  onChange: w,
1379
1459
  "aria-label": d.fields.hexCode
@@ -1384,11 +1464,11 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Yt, placehold
1384
1464
  className: "bree-icon-button",
1385
1465
  title: d.fields.eyedropper,
1386
1466
  onClick: () => new T().open().then((e) => w(e.sRGBHex)).catch(() => {}),
1387
- children: /* @__PURE__ */ I(Bt, {})
1467
+ children: /* @__PURE__ */ I(Zt, {})
1388
1468
  })
1389
1469
  ]
1390
1470
  }),
1391
- E.length > 0 && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("span", {
1471
+ E.length > 0 && /* @__PURE__ */ L(Pe, { children: [/* @__PURE__ */ I("span", {
1392
1472
  className: "bree-color-popover-title",
1393
1473
  children: d.fields.documentColors
1394
1474
  }), /* @__PURE__ */ I("div", {
@@ -1427,7 +1507,7 @@ function G({ value: e, onChange: t, presets: n = [], swatches: r = Yt, placehold
1427
1507
  }) }) })]
1428
1508
  });
1429
1509
  }
1430
- function Zt({ value: e, onChange: t, options: n, className: r, style: i }) {
1510
+ function ln({ value: e, onChange: t, options: n, className: r, style: i }) {
1431
1511
  return /* @__PURE__ */ I("select", {
1432
1512
  className: R("bree-input bree-select", r),
1433
1513
  style: i,
@@ -1439,7 +1519,30 @@ function Zt({ value: e, onChange: t, options: n, className: r, style: i }) {
1439
1519
  }, e))
1440
1520
  });
1441
1521
  }
1442
- function Qt({ value: e, onChange: t, options: n, ariaLabel: r, className: i, style: a }) {
1522
+ function un({ value: e, onChange: t, emptyLabel: n, className: r, style: i }) {
1523
+ let a = nr()?.fonts ?? Dt, o = kt(a, e), s = e && !o ? {
1524
+ label: e.split(",")[0].replace(/['"]/g, "").trim(),
1525
+ value: e
1526
+ } : null, c = s ? [...a, s] : a;
1527
+ return /* @__PURE__ */ L("select", {
1528
+ className: R("bree-input bree-select", r),
1529
+ style: {
1530
+ fontFamily: e || void 0,
1531
+ ...i
1532
+ },
1533
+ value: o?.value ?? e ?? "",
1534
+ onChange: (e) => t(e.target.value),
1535
+ children: [(n !== void 0 || !e) && /* @__PURE__ */ I("option", {
1536
+ value: "",
1537
+ children: n ?? ""
1538
+ }), c.map((e) => /* @__PURE__ */ I("option", {
1539
+ value: e.value,
1540
+ style: { fontFamily: e.value },
1541
+ children: e.label
1542
+ }, e.value))]
1543
+ });
1544
+ }
1545
+ function dn({ value: e, onChange: t, options: n, ariaLabel: r, className: i, style: a }) {
1443
1546
  return /* @__PURE__ */ I("span", {
1444
1547
  className: R("bree-segmented", i),
1445
1548
  style: a,
@@ -1456,9 +1559,9 @@ function Qt({ value: e, onChange: t, options: n, ariaLabel: r, className: i, sty
1456
1559
  }, n.value))
1457
1560
  });
1458
1561
  }
1459
- function $t({ value: e, onChange: t, className: n, style: r }) {
1562
+ function fn({ value: e, onChange: t, className: n, style: r }) {
1460
1563
  let i = $();
1461
- return /* @__PURE__ */ I(Qt, {
1564
+ return /* @__PURE__ */ I(dn, {
1462
1565
  className: n,
1463
1566
  style: r,
1464
1567
  value: e || "left",
@@ -1466,29 +1569,29 @@ function $t({ value: e, onChange: t, className: n, style: r }) {
1466
1569
  options: [
1467
1570
  {
1468
1571
  value: "left",
1469
- label: /* @__PURE__ */ I(ie, { size: 14 }),
1572
+ label: /* @__PURE__ */ I(se, { size: 14 }),
1470
1573
  title: i.fields.alignLeft
1471
1574
  },
1472
1575
  {
1473
1576
  value: "center",
1474
- label: /* @__PURE__ */ I(re, { size: 14 }),
1577
+ label: /* @__PURE__ */ I(oe, { size: 14 }),
1475
1578
  title: i.fields.alignCenter
1476
1579
  },
1477
1580
  {
1478
1581
  value: "right",
1479
- label: /* @__PURE__ */ I(ae, { size: 14 }),
1582
+ label: /* @__PURE__ */ I(ce, { size: 14 }),
1480
1583
  title: i.fields.alignRight
1481
1584
  }
1482
1585
  ]
1483
1586
  });
1484
1587
  }
1485
- function en({ get: e, set: t, className: n, style: r }) {
1588
+ function pn({ get: e, set: t, className: n, style: r }) {
1486
1589
  let i = $(), a = [
1487
1590
  "Top",
1488
1591
  "Right",
1489
1592
  "Bottom",
1490
1593
  "Left"
1491
- ], o = a.map((t) => qt(e(t))), s = o.every((e) => e === o[0]), [c, u] = l(!s), d = {
1594
+ ], o = a.map((t) => an(e(t))), s = o.every((e) => e === o[0]), [c, l] = u(!s), d = {
1492
1595
  Top: i.fields.top,
1493
1596
  Right: i.fields.right,
1494
1597
  Bottom: i.fields.bottom,
@@ -1514,7 +1617,7 @@ function en({ get: e, set: t, className: n, style: r }) {
1514
1617
  children: [/* @__PURE__ */ I("input", {
1515
1618
  type: "checkbox",
1516
1619
  checked: c,
1517
- onChange: (e) => u(e.target.checked)
1620
+ onChange: (e) => l(e.target.checked)
1518
1621
  }), i.fields.moreOptions]
1519
1622
  })]
1520
1623
  });
@@ -1522,13 +1625,21 @@ function en({ get: e, set: t, className: n, style: r }) {
1522
1625
  //#endregion
1523
1626
  //#region src/components/inspectors/groups.tsx
1524
1627
  var K = (e) => e;
1525
- function tn({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
1628
+ function mn({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
1526
1629
  let a = $().inspector;
1527
1630
  return /* @__PURE__ */ L(V, {
1528
1631
  title: a.typography,
1529
1632
  className: r,
1530
1633
  style: i,
1531
1634
  children: [
1635
+ /* @__PURE__ */ I(H, {
1636
+ label: a.font,
1637
+ children: /* @__PURE__ */ I(un, {
1638
+ value: e.getStyle(K("fontFamily")),
1639
+ emptyLabel: a.fontDefault,
1640
+ onChange: (t) => e.setStyle(K("fontFamily"), t)
1641
+ })
1642
+ }),
1532
1643
  /* @__PURE__ */ I(H, {
1533
1644
  label: a.color,
1534
1645
  stacked: !0,
@@ -1549,7 +1660,7 @@ function tn({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
1549
1660
  }),
1550
1661
  /* @__PURE__ */ I(H, {
1551
1662
  label: a.weight,
1552
- children: /* @__PURE__ */ I(Zt, {
1663
+ children: /* @__PURE__ */ I(ln, {
1553
1664
  value: String(e.getStyle(K("fontWeight")) ?? "400"),
1554
1665
  onChange: (t) => e.setStyle(K("fontWeight"), t),
1555
1666
  options: [
@@ -1574,7 +1685,7 @@ function tn({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
1574
1685
  }),
1575
1686
  n && /* @__PURE__ */ I(H, {
1576
1687
  label: a.alignment,
1577
- children: /* @__PURE__ */ I($t, {
1688
+ children: /* @__PURE__ */ I(fn, {
1578
1689
  value: t ?? "left",
1579
1690
  onChange: n
1580
1691
  })
@@ -1582,7 +1693,7 @@ function tn({ ctx: e, alignment: t, setAlignment: n, className: r, style: i }) {
1582
1693
  ]
1583
1694
  });
1584
1695
  }
1585
- function nn({ ctx: e, title: t, className: n, style: r }) {
1696
+ function q({ ctx: e, title: t, className: n, style: r }) {
1586
1697
  let i = $();
1587
1698
  return /* @__PURE__ */ I(V, {
1588
1699
  title: t ?? i.inspector.spacing,
@@ -1591,7 +1702,7 @@ function nn({ ctx: e, title: t, className: n, style: r }) {
1591
1702
  children: /* @__PURE__ */ I(H, {
1592
1703
  label: i.inspector.padding,
1593
1704
  stacked: !0,
1594
- children: /* @__PURE__ */ I(en, {
1705
+ children: /* @__PURE__ */ I(pn, {
1595
1706
  get: (t) => e.getStyle(K(`padding${t}`)) ?? e.getStyle(K("padding")),
1596
1707
  set: (t) => e.batchSetStyle([{
1597
1708
  prop: K("padding"),
@@ -1604,7 +1715,7 @@ function nn({ ctx: e, title: t, className: n, style: r }) {
1604
1715
  })
1605
1716
  });
1606
1717
  }
1607
- function rn({ ctx: e, className: t, style: n }) {
1718
+ function hn({ ctx: e, className: t, style: n }) {
1608
1719
  let r = $().inspector;
1609
1720
  return /* @__PURE__ */ L(V, {
1610
1721
  title: r.box,
@@ -1654,7 +1765,7 @@ function rn({ ctx: e, className: t, style: n }) {
1654
1765
  }
1655
1766
  //#endregion
1656
1767
  //#region src/components/inspectors/ButtonInspector.tsx
1657
- function an({ ctx: e, className: t, style: n }) {
1768
+ function gn({ ctx: e, className: t, style: n }) {
1658
1769
  let r = $().inspector;
1659
1770
  return /* @__PURE__ */ L("div", {
1660
1771
  className: R("bree-inspector", t),
@@ -1677,7 +1788,7 @@ function an({ ctx: e, className: t, style: n }) {
1677
1788
  children: [
1678
1789
  /* @__PURE__ */ I(H, {
1679
1790
  label: r.alignment,
1680
- children: /* @__PURE__ */ I($t, {
1791
+ children: /* @__PURE__ */ I(fn, {
1681
1792
  value: String(e.getAttr("alignment") ?? "left"),
1682
1793
  onChange: (t) => e.setAttr("alignment", t)
1683
1794
  })
@@ -1718,7 +1829,7 @@ function an({ ctx: e, className: t, style: n }) {
1718
1829
  })
1719
1830
  ]
1720
1831
  }),
1721
- /* @__PURE__ */ I(nn, {
1832
+ /* @__PURE__ */ I(q, {
1722
1833
  ctx: e,
1723
1834
  title: r.buttonPadding
1724
1835
  })
@@ -1727,7 +1838,7 @@ function an({ ctx: e, className: t, style: n }) {
1727
1838
  }
1728
1839
  //#endregion
1729
1840
  //#region src/components/inspectors/ColumnsInspector.tsx
1730
- function on({ ctx: e, className: t, style: n }) {
1841
+ function _n({ ctx: e, className: t, style: n }) {
1731
1842
  let { editor: r, t: i } = Q(), a = i.inspector, o = {
1732
1843
  twoColumns: 2,
1733
1844
  threeColumns: 3,
@@ -1760,7 +1871,7 @@ function on({ ctx: e, className: t, style: n }) {
1760
1871
  ...n.attrs,
1761
1872
  style: `${s ? `${s};` : ""}width:${t[i]}%`
1762
1873
  });
1763
- }), n.selection instanceof w && a.setSelection(w.create(a.doc, e.nodePos.pos)), r.view.dispatch(a);
1874
+ }), n.selection instanceof D && a.setSelection(D.create(a.doc, e.nodePos.pos)), r.view.dispatch(a);
1764
1875
  };
1765
1876
  return /* @__PURE__ */ I("div", {
1766
1877
  className: R("bree-inspector", t),
@@ -1801,7 +1912,7 @@ function on({ ctx: e, className: t, style: n }) {
1801
1912
  }
1802
1913
  //#endregion
1803
1914
  //#region src/components/inspectors/HeadingInspector.tsx
1804
- function sn({ ctx: e, className: t, style: n }) {
1915
+ function vn({ ctx: e, className: t, style: n }) {
1805
1916
  let r = $();
1806
1917
  return /* @__PURE__ */ L("div", {
1807
1918
  className: R("bree-inspector", t),
@@ -1811,7 +1922,7 @@ function sn({ ctx: e, className: t, style: n }) {
1811
1922
  title: r.inspector.heading,
1812
1923
  children: /* @__PURE__ */ I(H, {
1813
1924
  label: r.inspector.level,
1814
- children: /* @__PURE__ */ I(Qt, {
1925
+ children: /* @__PURE__ */ I(dn, {
1815
1926
  value: String(e.getAttr("level") ?? 1),
1816
1927
  onChange: (t) => e.setAttr("level", Number(t)),
1817
1928
  options: [
@@ -1831,19 +1942,19 @@ function sn({ ctx: e, className: t, style: n }) {
1831
1942
  })
1832
1943
  })
1833
1944
  }),
1834
- /* @__PURE__ */ I(tn, {
1945
+ /* @__PURE__ */ I(mn, {
1835
1946
  ctx: e,
1836
1947
  alignment: String(e.getAttr("alignment") ?? "left"),
1837
1948
  setAlignment: (t) => e.setAttr("alignment", t)
1838
1949
  }),
1839
- /* @__PURE__ */ I(nn, { ctx: e }),
1840
- /* @__PURE__ */ I(rn, { ctx: e })
1950
+ /* @__PURE__ */ I(q, { ctx: e }),
1951
+ /* @__PURE__ */ I(hn, { ctx: e })
1841
1952
  ]
1842
1953
  });
1843
1954
  }
1844
1955
  //#endregion
1845
1956
  //#region src/components/inspectors/ImageInspector.tsx
1846
- function cn({ ctx: e, className: t, style: n }) {
1957
+ function yn({ ctx: e, className: t, style: n }) {
1847
1958
  let { t: r, uploadImage: i } = Q(), a = r.inspector, o = String(e.getAttr("width") ?? "auto");
1848
1959
  return /* @__PURE__ */ L("div", {
1849
1960
  className: R("bree-inspector", t),
@@ -1903,7 +2014,7 @@ function cn({ ctx: e, className: t, style: n }) {
1903
2014
  }),
1904
2015
  o !== "auto" && /* @__PURE__ */ I(H, {
1905
2016
  label: a.width,
1906
- children: /* @__PURE__ */ I(Jt, {
2017
+ children: /* @__PURE__ */ I(on, {
1907
2018
  value: o,
1908
2019
  min: 20,
1909
2020
  max: 900,
@@ -1912,7 +2023,7 @@ function cn({ ctx: e, className: t, style: n }) {
1912
2023
  }),
1913
2024
  /* @__PURE__ */ I(H, {
1914
2025
  label: a.alignment,
1915
- children: /* @__PURE__ */ I($t, {
2026
+ children: /* @__PURE__ */ I(fn, {
1916
2027
  value: String(e.getAttr("alignment") ?? "center"),
1917
2028
  onChange: (t) => e.setAttr("alignment", t)
1918
2029
  })
@@ -1938,13 +2049,13 @@ function cn({ ctx: e, className: t, style: n }) {
1938
2049
  })
1939
2050
  })
1940
2051
  }),
1941
- /* @__PURE__ */ I(nn, { ctx: e })
2052
+ /* @__PURE__ */ I(q, { ctx: e })
1942
2053
  ]
1943
2054
  });
1944
2055
  }
1945
2056
  //#endregion
1946
2057
  //#region src/components/inspectors/SimpleInspectors.tsx
1947
- function ln({ ctx: e, className: t, style: n }) {
2058
+ function bn({ ctx: e, className: t, style: n }) {
1948
2059
  let r = $();
1949
2060
  return /* @__PURE__ */ I("div", {
1950
2061
  className: R("bree-inspector", t),
@@ -1953,7 +2064,7 @@ function ln({ ctx: e, className: t, style: n }) {
1953
2064
  title: r.inspector.spacer,
1954
2065
  children: /* @__PURE__ */ I(H, {
1955
2066
  label: r.inspector.height,
1956
- children: /* @__PURE__ */ I(Jt, {
2067
+ children: /* @__PURE__ */ I(on, {
1957
2068
  value: e.getAttr("height"),
1958
2069
  min: 4,
1959
2070
  max: 160,
@@ -1963,14 +2074,14 @@ function ln({ ctx: e, className: t, style: n }) {
1963
2074
  })
1964
2075
  });
1965
2076
  }
1966
- function un({ ctx: e, className: t, style: n }) {
2077
+ function xn({ ctx: e, className: t, style: n }) {
1967
2078
  let r = $();
1968
2079
  return /* @__PURE__ */ I("div", {
1969
2080
  className: R("bree-inspector", t),
1970
2081
  style: n,
1971
2082
  children: /* @__PURE__ */ L(V, {
1972
2083
  title: r.inspector.htmlCode,
1973
- children: [/* @__PURE__ */ I(Kt, {
2084
+ children: [/* @__PURE__ */ I(rn, {
1974
2085
  value: String(e.getAttr("html") ?? ""),
1975
2086
  onChange: (t) => e.setAttr("html", t),
1976
2087
  rows: 14
@@ -1981,7 +2092,7 @@ function un({ ctx: e, className: t, style: n }) {
1981
2092
  })
1982
2093
  });
1983
2094
  }
1984
- function dn({ ctx: e, className: t, style: n }) {
2095
+ function Sn({ ctx: e, className: t, style: n }) {
1985
2096
  let r = $().inspector;
1986
2097
  return /* @__PURE__ */ I("div", {
1987
2098
  className: R("bree-inspector", t),
@@ -2015,7 +2126,7 @@ function dn({ ctx: e, className: t, style: n }) {
2015
2126
  }),
2016
2127
  /* @__PURE__ */ I(H, {
2017
2128
  label: r.lineStyle,
2018
- children: /* @__PURE__ */ I(Qt, {
2129
+ children: /* @__PURE__ */ I(dn, {
2019
2130
  value: String(e.getStyle(K("borderTopStyle")) ?? "solid"),
2020
2131
  onChange: (t) => e.setStyle(K("borderTopStyle"), t),
2021
2132
  options: [
@@ -2038,16 +2149,16 @@ function dn({ ctx: e, className: t, style: n }) {
2038
2149
  })
2039
2150
  });
2040
2151
  }
2041
- function fn({ ctx: e, className: t, style: n }) {
2152
+ function Cn({ ctx: e, className: t, style: n }) {
2042
2153
  return /* @__PURE__ */ L("div", {
2043
2154
  className: R("bree-inspector", t),
2044
2155
  style: n,
2045
- children: [/* @__PURE__ */ I(rn, { ctx: e }), /* @__PURE__ */ I(nn, { ctx: e })]
2156
+ children: [/* @__PURE__ */ I(hn, { ctx: e }), /* @__PURE__ */ I(q, { ctx: e })]
2046
2157
  });
2047
2158
  }
2048
2159
  //#endregion
2049
2160
  //#region src/core/style-utils.ts
2050
- function pn(e) {
2161
+ function wn(e) {
2051
2162
  if (typeof e != "string" || !e.trim()) return {};
2052
2163
  let t = {};
2053
2164
  for (let n of e.split(";")) {
@@ -2060,18 +2171,18 @@ function pn(e) {
2060
2171
  }
2061
2172
  //#endregion
2062
2173
  //#region src/nodes/custom-nodes.tsx
2063
- var mn = { style: {
2174
+ var Tn = { style: {
2064
2175
  default: null,
2065
2176
  parseHTML: (e) => e.getAttribute("style"),
2066
2177
  renderHTML: (e) => e.style ? { style: e.style } : {}
2067
- } }, hn = g.create({
2178
+ } }, En = _.create({
2068
2179
  name: "spacer",
2069
2180
  group: "block",
2070
2181
  atom: !0,
2071
2182
  selectable: !0,
2072
2183
  addAttributes() {
2073
2184
  return {
2074
- ...mn,
2185
+ ...Tn,
2075
2186
  height: {
2076
2187
  default: 32,
2077
2188
  parseHTML: (e) => Number(e.dataset.height) || 32,
@@ -2083,7 +2194,7 @@ var mn = { style: {
2083
2194
  return [{ tag: "div[data-type=\"spacer\"]" }];
2084
2195
  },
2085
2196
  renderHTML({ node: e, HTMLAttributes: t }) {
2086
- return ["div", te(t, {
2197
+ return ["div", ne(t, {
2087
2198
  "data-type": "spacer",
2088
2199
  class: "node-spacer",
2089
2200
  style: `height:${Number(e.attrs.height)}px`
@@ -2091,17 +2202,17 @@ var mn = { style: {
2091
2202
  },
2092
2203
  renderToReactEmail({ node: e }) {
2093
2204
  let t = Number(e.attrs?.height ?? 32);
2094
- return /* @__PURE__ */ I(Le, {
2205
+ return /* @__PURE__ */ I(He, {
2095
2206
  style: {
2096
2207
  height: t,
2097
2208
  lineHeight: `${t}px`,
2098
2209
  fontSize: "1px",
2099
- ...pn(e.attrs?.style)
2210
+ ...wn(e.attrs?.style)
2100
2211
  },
2101
2212
  children: "\xA0"
2102
2213
  });
2103
2214
  }
2104
- }), gn = {
2215
+ }), Dn = {
2105
2216
  facebook: {
2106
2217
  label: "Facebook",
2107
2218
  slug: "facebook",
@@ -2137,13 +2248,13 @@ var mn = { style: {
2137
2248
  slug: "github",
2138
2249
  color: "181717"
2139
2250
  }
2140
- }, _n = { linkedin: "https://cdn.jsdelivr.net/npm/simple-icons@9.21.0/icons/linkedin.svg" };
2141
- function vn(e) {
2142
- if (_n[e]) return _n[e];
2143
- let t = gn[e] ?? gn.facebook;
2251
+ }, On = { linkedin: "https://cdn.jsdelivr.net/npm/simple-icons@9.21.0/icons/linkedin.svg" };
2252
+ function kn(e) {
2253
+ if (On[e]) return On[e];
2254
+ let t = Dn[e] ?? Dn.facebook;
2144
2255
  return `https://cdn.simpleicons.org/${t.slug}/${t.color}`;
2145
2256
  }
2146
- function yn(e) {
2257
+ function An(e) {
2147
2258
  if (Array.isArray(e)) return e;
2148
2259
  if (typeof e == "string") try {
2149
2260
  return JSON.parse(e);
@@ -2152,14 +2263,14 @@ function yn(e) {
2152
2263
  }
2153
2264
  return [];
2154
2265
  }
2155
- var bn = g.create({
2266
+ var jn = _.create({
2156
2267
  name: "socialLinks",
2157
2268
  group: "block",
2158
2269
  atom: !0,
2159
2270
  selectable: !0,
2160
2271
  addAttributes() {
2161
2272
  return {
2162
- ...mn,
2273
+ ...Tn,
2163
2274
  links: {
2164
2275
  default: [
2165
2276
  {
@@ -2179,7 +2290,7 @@ var bn = g.create({
2179
2290
  url: "https://linkedin.com/"
2180
2291
  }
2181
2292
  ],
2182
- parseHTML: (e) => yn(e.dataset.links),
2293
+ parseHTML: (e) => An(e.dataset.links),
2183
2294
  renderHTML: (e) => ({ "data-links": JSON.stringify(e.links ?? []) })
2184
2295
  },
2185
2296
  size: { default: 28 },
@@ -2191,10 +2302,10 @@ var bn = g.create({
2191
2302
  return [{ tag: "div[data-type=\"social-links\"]" }];
2192
2303
  },
2193
2304
  renderHTML({ node: e, HTMLAttributes: t }) {
2194
- let n = Number(e.attrs.size), r = Number(e.attrs.gap), i = yn(e.attrs.links);
2305
+ let n = Number(e.attrs.size), r = Number(e.attrs.gap), i = An(e.attrs.links);
2195
2306
  return [
2196
2307
  "div",
2197
- te(t, {
2308
+ ne(t, {
2198
2309
  "data-type": "social-links",
2199
2310
  class: "node-socialLinks",
2200
2311
  alignment: e.attrs.alignment
@@ -2206,37 +2317,37 @@ var bn = g.create({
2206
2317
  style: `margin-left:${t === 0 ? 0 : r}px`
2207
2318
  },
2208
2319
  ["img", {
2209
- src: vn(e.network),
2320
+ src: kn(e.network),
2210
2321
  width: String(n),
2211
2322
  height: String(n),
2212
- alt: gn[e.network]?.label ?? e.network
2323
+ alt: Dn[e.network]?.label ?? e.network
2213
2324
  }]
2214
2325
  ])
2215
2326
  ];
2216
2327
  },
2217
2328
  renderToReactEmail({ node: e }) {
2218
- let t = Number(e.attrs?.size ?? 28), n = Number(e.attrs?.gap ?? 12), r = yn(e.attrs?.links), i = e.attrs?.alignment ?? "center";
2219
- return /* @__PURE__ */ I(Le, {
2220
- style: pn(e.attrs?.style),
2221
- children: /* @__PURE__ */ I(Ie, { children: /* @__PURE__ */ I(Ne, {
2329
+ let t = Number(e.attrs?.size ?? 28), n = Number(e.attrs?.gap ?? 12), r = An(e.attrs?.links), i = e.attrs?.alignment ?? "center";
2330
+ return /* @__PURE__ */ I(He, {
2331
+ style: wn(e.attrs?.style),
2332
+ children: /* @__PURE__ */ I(Ve, { children: /* @__PURE__ */ I(Re, {
2222
2333
  align: i,
2223
- children: r.map((e, r) => /* @__PURE__ */ I(Fe, {
2334
+ children: r.map((e, r) => /* @__PURE__ */ I(Be, {
2224
2335
  href: e.url,
2225
2336
  style: {
2226
2337
  display: "inline-block",
2227
2338
  marginLeft: r === 0 ? 0 : n
2228
2339
  },
2229
- children: /* @__PURE__ */ I(Pe, {
2230
- src: vn(e.network),
2340
+ children: /* @__PURE__ */ I(ze, {
2341
+ src: kn(e.network),
2231
2342
  width: t,
2232
2343
  height: t,
2233
- alt: gn[e.network]?.label ?? e.network
2344
+ alt: Dn[e.network]?.label ?? e.network
2234
2345
  })
2235
2346
  }, `${e.network}-${r}`))
2236
2347
  }) })
2237
2348
  });
2238
2349
  }
2239
- }), xn = g.create({
2350
+ }), Mn = _.create({
2240
2351
  name: "htmlBlock",
2241
2352
  group: "block",
2242
2353
  atom: !0,
@@ -2252,7 +2363,7 @@ var bn = g.create({
2252
2363
  return [{ tag: "div[data-type=\"html-block\"]" }];
2253
2364
  },
2254
2365
  renderHTML({ node: e, HTMLAttributes: t }) {
2255
- return ["div", te(t, {
2366
+ return ["div", ne(t, {
2256
2367
  "data-type": "html-block",
2257
2368
  class: "node-htmlBlock",
2258
2369
  "data-html": e.attrs.html
@@ -2276,7 +2387,7 @@ var bn = g.create({
2276
2387
  });
2277
2388
  //#endregion
2278
2389
  //#region src/components/inspectors/SocialLinksInspector.tsx
2279
- function Sn({ ctx: e, className: t, style: n }) {
2390
+ function Nn({ ctx: e, className: t, style: n }) {
2280
2391
  let r = $().inspector, i = e.getAttr("links"), a = Array.isArray(i) ? i : [], o = (t) => e.setAttr("links", t);
2281
2392
  return /* @__PURE__ */ L("div", {
2282
2393
  className: R("bree-inspector", t),
@@ -2289,13 +2400,13 @@ function Sn({ ctx: e, className: t, style: n }) {
2289
2400
  children: a.map((e, t) => /* @__PURE__ */ L("div", {
2290
2401
  className: "bree-social-row",
2291
2402
  children: [
2292
- /* @__PURE__ */ I(Zt, {
2403
+ /* @__PURE__ */ I(ln, {
2293
2404
  value: e.network,
2294
2405
  onChange: (e) => o(a.map((n, r) => r === t ? {
2295
2406
  ...n,
2296
2407
  network: e
2297
2408
  } : n)),
2298
- options: Object.entries(gn).map(([e, t]) => [e, t.label])
2409
+ options: Object.entries(Dn).map(([e, t]) => [e, t.label])
2299
2410
  }),
2300
2411
  /* @__PURE__ */ I(U, {
2301
2412
  value: e.url,
@@ -2309,7 +2420,7 @@ function Sn({ ctx: e, className: t, style: n }) {
2309
2420
  className: "bree-icon-button",
2310
2421
  title: r.removeNetwork,
2311
2422
  onClick: () => o(a.filter((e, n) => n !== t)),
2312
- children: /* @__PURE__ */ I(Oe, { size: 14 })
2423
+ children: /* @__PURE__ */ I(Me, { size: 14 })
2313
2424
  })
2314
2425
  ]
2315
2426
  }, t))
@@ -2328,7 +2439,7 @@ function Sn({ ctx: e, className: t, style: n }) {
2328
2439
  children: [
2329
2440
  /* @__PURE__ */ I(H, {
2330
2441
  label: r.iconSize,
2331
- children: /* @__PURE__ */ I(Jt, {
2442
+ children: /* @__PURE__ */ I(on, {
2332
2443
  value: e.getAttr("size"),
2333
2444
  min: 16,
2334
2445
  max: 64,
@@ -2337,7 +2448,7 @@ function Sn({ ctx: e, className: t, style: n }) {
2337
2448
  }),
2338
2449
  /* @__PURE__ */ I(H, {
2339
2450
  label: r.gap,
2340
- children: /* @__PURE__ */ I(Jt, {
2451
+ children: /* @__PURE__ */ I(on, {
2341
2452
  value: e.getAttr("gap"),
2342
2453
  min: 0,
2343
2454
  max: 40,
@@ -2346,45 +2457,45 @@ function Sn({ ctx: e, className: t, style: n }) {
2346
2457
  }),
2347
2458
  /* @__PURE__ */ I(H, {
2348
2459
  label: r.alignment,
2349
- children: /* @__PURE__ */ I($t, {
2460
+ children: /* @__PURE__ */ I(fn, {
2350
2461
  value: String(e.getAttr("alignment") ?? "center"),
2351
2462
  onChange: (t) => e.setAttr("alignment", t)
2352
2463
  })
2353
2464
  })
2354
2465
  ]
2355
2466
  }),
2356
- /* @__PURE__ */ I(nn, { ctx: e })
2467
+ /* @__PURE__ */ I(q, { ctx: e })
2357
2468
  ]
2358
2469
  });
2359
2470
  }
2360
2471
  //#endregion
2361
2472
  //#region src/registry/default-nodes.tsx
2362
- function Cn(e, t = 36) {
2473
+ function Pn(e, t = 36) {
2363
2474
  let n = e.replace(/\s+/g, " ").trim();
2364
2475
  return n.length > t ? `${n.slice(0, t)}…` : n;
2365
2476
  }
2366
- var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En = [
2477
+ var Fn = (e, { t }) => Pn(e.textContent) || t.layers.empty, In = () => "", Ln = [
2367
2478
  {
2368
2479
  type: "paragraph",
2369
- icon: Ee
2480
+ icon: Ae
2370
2481
  },
2371
2482
  {
2372
2483
  type: "heading",
2373
- icon: de,
2374
- inspector: sn
2484
+ icon: he,
2485
+ inspector: vn
2375
2486
  },
2376
2487
  {
2377
2488
  type: "image",
2378
- icon: fe,
2379
- inspector: cn,
2489
+ icon: ge,
2490
+ inspector: yn,
2380
2491
  preview: (e, { t }) => {
2381
2492
  let { attrs: n } = e;
2382
- if (n.alt) return Cn(n.alt);
2493
+ if (n.alt) return Pn(n.alt);
2383
2494
  let r = String(n.src ?? "");
2384
2495
  if (r.startsWith("data:")) return t.layers.uploadedImage;
2385
2496
  try {
2386
2497
  let e = new URL(r);
2387
- return Cn(e.searchParams.get("text") ?? decodeURIComponent(e.pathname.split("/").pop() ?? ""));
2498
+ return Pn(e.searchParams.get("text") ?? decodeURIComponent(e.pathname.split("/").pop() ?? ""));
2388
2499
  } catch {
2389
2500
  return "";
2390
2501
  }
@@ -2392,124 +2503,124 @@ var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En =
2392
2503
  },
2393
2504
  {
2394
2505
  type: "button",
2395
- icon: ye,
2396
- inspector: an
2506
+ icon: P,
2507
+ inspector: gn
2397
2508
  },
2398
2509
  {
2399
2510
  type: "horizontalRule",
2400
- icon: ve,
2401
- inspector: dn,
2402
- preview: Tn
2511
+ icon: Se,
2512
+ inspector: Sn,
2513
+ preview: In
2403
2514
  },
2404
2515
  {
2405
2516
  type: "spacer",
2406
- icon: Vt,
2407
- inspector: ln,
2517
+ icon: Qt,
2518
+ inspector: bn,
2408
2519
  preview: (e) => `${e.attrs.height}px`,
2409
- extensions: [hn]
2520
+ extensions: [En]
2410
2521
  },
2411
2522
  {
2412
2523
  type: "socialLinks",
2413
- icon: he,
2414
- inspector: Sn,
2524
+ icon: ye,
2525
+ inspector: Nn,
2415
2526
  preview: (e) => Array.isArray(e.attrs.links) ? e.attrs.links.map((e) => e.network).join(", ") : "",
2416
- extensions: [bn]
2527
+ extensions: [jn]
2417
2528
  },
2418
2529
  {
2419
2530
  type: "htmlBlock",
2420
- icon: Ce,
2421
- inspector: un,
2422
- preview: (e) => Cn(String(e.attrs.html ?? "").replace(/<[^>]+>/g, " ")),
2423
- extensions: [xn]
2531
+ icon: Ee,
2532
+ inspector: xn,
2533
+ preview: (e) => Pn(String(e.attrs.html ?? "").replace(/<[^>]+>/g, " ")),
2534
+ extensions: [Mn]
2424
2535
  },
2425
2536
  {
2426
2537
  type: "section",
2427
- icon: me,
2428
- inspector: fn,
2429
- preview: Tn
2538
+ icon: ve,
2539
+ inspector: Cn,
2540
+ preview: In
2430
2541
  },
2431
2542
  {
2432
2543
  type: "columnsColumn",
2433
- icon: be,
2434
- inspector: fn,
2435
- preview: Tn
2544
+ icon: Ce,
2545
+ inspector: Cn,
2546
+ preview: In
2436
2547
  },
2437
2548
  {
2438
2549
  type: "twoColumns",
2439
- icon: ce,
2440
- inspector: on,
2441
- preview: Tn
2550
+ icon: fe,
2551
+ inspector: _n,
2552
+ preview: In
2442
2553
  },
2443
2554
  {
2444
2555
  type: "threeColumns",
2445
- icon: le,
2446
- inspector: on,
2447
- preview: Tn
2556
+ icon: pe,
2557
+ inspector: _n,
2558
+ preview: In
2448
2559
  },
2449
2560
  {
2450
2561
  type: "fourColumns",
2451
- icon: ue,
2452
- inspector: on,
2453
- preview: Tn
2562
+ icon: me,
2563
+ inspector: _n,
2564
+ preview: In
2454
2565
  },
2455
2566
  {
2456
2567
  type: "bulletList",
2457
- icon: ge
2568
+ icon: be
2458
2569
  },
2459
2570
  {
2460
2571
  type: "orderedList",
2461
- icon: _e
2572
+ icon: xe
2462
2573
  },
2463
2574
  {
2464
2575
  type: "blockquote",
2465
- icon: Te
2576
+ icon: ke
2466
2577
  },
2467
2578
  {
2468
2579
  type: "codeBlock",
2469
- icon: A
2580
+ icon: de
2470
2581
  },
2471
2582
  {
2472
2583
  type: "table",
2473
- icon: we
2584
+ icon: Oe
2474
2585
  }
2475
- ], Dn = /* @__PURE__ */ Be({
2476
- button: () => On,
2477
- column: () => An,
2586
+ ], Rn = /* @__PURE__ */ Ge({
2587
+ button: () => Bn,
2588
+ column: () => Hn,
2478
2589
  columns: () => X,
2479
- doc: () => In,
2480
- heading: () => Y,
2481
- image: () => kn,
2482
- link: () => Pn,
2483
- padding: () => Nn,
2484
- paragraph: () => J,
2485
- placeholderImage: () => Fn,
2486
- section: () => Mn,
2487
- sized: () => jn,
2488
- text: () => q
2489
- }), q = (e, t) => ({
2590
+ doc: () => Jn,
2591
+ heading: () => zn,
2592
+ image: () => Vn,
2593
+ link: () => Kn,
2594
+ padding: () => Gn,
2595
+ paragraph: () => Y,
2596
+ placeholderImage: () => qn,
2597
+ section: () => Wn,
2598
+ sized: () => Un,
2599
+ text: () => J
2600
+ }), J = (e, t) => ({
2490
2601
  type: "text",
2491
2602
  text: e,
2492
2603
  ...t ? { marks: t } : {}
2493
- }), J = (e = "", t = {}) => ({
2604
+ }), Y = (e = "", t = {}) => ({
2494
2605
  type: "paragraph",
2495
2606
  attrs: t,
2496
- content: typeof e == "string" ? e ? [q(e)] : [] : e
2497
- }), Y = (e, t, n = {}) => ({
2607
+ content: typeof e == "string" ? e ? [J(e)] : [] : e
2608
+ }), zn = (e, t, n = {}) => ({
2498
2609
  type: "heading",
2499
2610
  attrs: {
2500
2611
  level: e,
2501
2612
  ...n
2502
2613
  },
2503
- content: [q(t)]
2504
- }), On = (e, t = {}) => ({
2614
+ content: [J(t)]
2615
+ }), Bn = (e, t = {}) => ({
2505
2616
  type: "button",
2506
2617
  attrs: {
2507
2618
  href: "https://example.com",
2508
2619
  alignment: "center",
2509
2620
  ...t
2510
2621
  },
2511
- content: [q(e)]
2512
- }), kn = (e, t = {}) => ({
2622
+ content: [J(e)]
2623
+ }), Vn = (e, t = {}) => ({
2513
2624
  type: "image",
2514
2625
  attrs: {
2515
2626
  src: e,
@@ -2517,10 +2628,10 @@ var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En =
2517
2628
  alignment: "center",
2518
2629
  ...t
2519
2630
  }
2520
- }), An = (...e) => ({
2631
+ }), Hn = (...e) => ({
2521
2632
  type: "columnsColumn",
2522
- content: e.length ? e : [J()]
2523
- }), jn = (e, t) => ({
2633
+ content: e.length ? e : [Y()]
2634
+ }), Un = (e, t) => ({
2524
2635
  ...e,
2525
2636
  attrs: {
2526
2637
  ...e.attrs,
@@ -2533,100 +2644,100 @@ var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En =
2533
2644
  4: "fourColumns"
2534
2645
  }[e],
2535
2646
  ...n ? { attrs: n } : {},
2536
- content: t ?? Array.from({ length: e }, () => An())
2537
- }), Mn = (e, ...t) => ({
2647
+ content: t ?? Array.from({ length: e }, () => Hn())
2648
+ }), Wn = (e, ...t) => ({
2538
2649
  type: "section",
2539
2650
  attrs: { style: e },
2540
2651
  content: t
2541
- }), Nn = (e, t = e) => `padding-top:${e}px;padding-right:${t}px;padding-bottom:${e}px;padding-left:${t}px`, Pn = (e) => [{
2652
+ }), Gn = (e, t = e) => `padding-top:${e}px;padding-right:${t}px;padding-bottom:${e}px;padding-left:${t}px`, Kn = (e) => [{
2542
2653
  type: "link",
2543
2654
  attrs: { href: e }
2544
- }], Fn = (e, t, n = "Image") => `https://placehold.co/${e}x${t}/e2e8f0/64748b/png?text=${encodeURIComponent(n)}`, In = (...e) => ({
2655
+ }], qn = (e, t, n = "Image") => `https://placehold.co/${e}x${t}/e2e8f0/64748b/png?text=${encodeURIComponent(n)}`, Jn = (...e) => ({
2545
2656
  type: "doc",
2546
2657
  content: e
2547
- }), Ln = ({ t: e }, t = "center") => J([
2548
- q(e.content.menuHome, Pn("https://example.com")),
2549
- q(" · "),
2550
- q(e.content.menuShop, Pn("https://example.com/shop")),
2551
- q(" · "),
2552
- q(e.content.menuBlog, Pn("https://example.com/blog")),
2553
- q(" · "),
2554
- q(e.content.menuContact, Pn("https://example.com/contact"))
2555
- ], { alignment: t }), Rn = [{
2658
+ }), Yn = ({ t: e }, t = "center") => Y([
2659
+ J(e.content.menuHome, Kn("https://example.com")),
2660
+ J(" · "),
2661
+ J(e.content.menuShop, Kn("https://example.com/shop")),
2662
+ J(" · "),
2663
+ J(e.content.menuBlog, Kn("https://example.com/blog")),
2664
+ J(" · "),
2665
+ J(e.content.menuContact, Kn("https://example.com/contact"))
2666
+ ], { alignment: t }), Xn = [{
2556
2667
  id: "layout",
2557
2668
  title: ({ t: e }) => e.sidebar.layoutTitle
2558
2669
  }, {
2559
2670
  id: "content",
2560
2671
  title: ({ t: e }) => e.sidebar.contentTitle
2561
- }], zn = [
2672
+ }], Zn = [
2562
2673
  {
2563
2674
  id: "section",
2564
2675
  group: "layout",
2565
2676
  label: ({ t: e }) => e.palette.oneColumn,
2566
- icon: /* @__PURE__ */ I(Wt, {}),
2567
- content: () => [Mn(Nn(16), J())]
2677
+ icon: /* @__PURE__ */ I(tn, {}),
2678
+ content: () => [Wn(Gn(16), Y())]
2568
2679
  },
2569
2680
  {
2570
2681
  id: "columns-2",
2571
2682
  group: "layout",
2572
2683
  label: ({ t: e }) => e.palette.twoColumns,
2573
- icon: /* @__PURE__ */ I(ce, { size: 22 }),
2684
+ icon: /* @__PURE__ */ I(fe, { size: 22 }),
2574
2685
  content: () => [X(2)]
2575
2686
  },
2576
2687
  {
2577
2688
  id: "columns-3",
2578
2689
  group: "layout",
2579
2690
  label: ({ t: e }) => e.palette.threeColumns,
2580
- icon: /* @__PURE__ */ I(le, { size: 22 }),
2691
+ icon: /* @__PURE__ */ I(pe, { size: 22 }),
2581
2692
  content: () => [X(3)]
2582
2693
  },
2583
2694
  {
2584
2695
  id: "columns-4",
2585
2696
  group: "layout",
2586
2697
  label: ({ t: e }) => e.palette.fourColumns,
2587
- icon: /* @__PURE__ */ I(ue, { size: 22 }),
2698
+ icon: /* @__PURE__ */ I(me, { size: 22 }),
2588
2699
  content: () => [X(4)]
2589
2700
  },
2590
2701
  {
2591
2702
  id: "heading",
2592
2703
  group: "content",
2593
2704
  label: ({ t: e }) => e.palette.heading,
2594
- icon: /* @__PURE__ */ I(de, { size: 22 }),
2595
- content: ({ t: e }) => [Y(2, e.content.heading)]
2705
+ icon: /* @__PURE__ */ I(he, { size: 22 }),
2706
+ content: ({ t: e }) => [zn(2, e.content.heading)]
2596
2707
  },
2597
2708
  {
2598
2709
  id: "text",
2599
2710
  group: "content",
2600
2711
  label: ({ t: e }) => e.palette.text,
2601
- icon: /* @__PURE__ */ I(Ee, { size: 22 }),
2602
- content: ({ t: e }) => [J(e.content.text)]
2712
+ icon: /* @__PURE__ */ I(Ae, { size: 22 }),
2713
+ content: ({ t: e }) => [Y(e.content.text)]
2603
2714
  },
2604
2715
  {
2605
2716
  id: "button",
2606
2717
  group: "content",
2607
2718
  label: ({ t: e }) => e.palette.button,
2608
- icon: /* @__PURE__ */ I(ye, { size: 22 }),
2609
- content: ({ t: e }) => [On(e.content.button)]
2719
+ icon: /* @__PURE__ */ I(P, { size: 22 }),
2720
+ content: ({ t: e }) => [Bn(e.content.button)]
2610
2721
  },
2611
2722
  {
2612
2723
  id: "image",
2613
2724
  group: "content",
2614
2725
  label: ({ t: e }) => e.palette.image,
2615
- icon: /* @__PURE__ */ I(fe, { size: 22 }),
2616
- content: ({ t: e }) => [kn(Fn(600, 300, e.content.image))]
2726
+ icon: /* @__PURE__ */ I(ge, { size: 22 }),
2727
+ content: ({ t: e }) => [Vn(qn(600, 300, e.content.image))]
2617
2728
  },
2618
2729
  {
2619
2730
  id: "divider",
2620
2731
  group: "content",
2621
2732
  label: ({ t: e }) => e.palette.divider,
2622
- icon: /* @__PURE__ */ I(ve, { size: 22 }),
2733
+ icon: /* @__PURE__ */ I(Se, { size: 22 }),
2623
2734
  content: () => [{ type: "horizontalRule" }]
2624
2735
  },
2625
2736
  {
2626
2737
  id: "spacer",
2627
2738
  group: "content",
2628
2739
  label: ({ t: e }) => e.palette.spacer,
2629
- icon: /* @__PURE__ */ I(Ht, {}),
2740
+ icon: /* @__PURE__ */ I($t, {}),
2630
2741
  content: () => [{
2631
2742
  type: "spacer",
2632
2743
  attrs: { height: 32 }
@@ -2636,26 +2747,26 @@ var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En =
2636
2747
  id: "social",
2637
2748
  group: "content",
2638
2749
  label: ({ t: e }) => e.palette.social,
2639
- icon: /* @__PURE__ */ I(Ut, {}),
2750
+ icon: /* @__PURE__ */ I(en, {}),
2640
2751
  content: () => [{ type: "socialLinks" }]
2641
2752
  },
2642
2753
  {
2643
2754
  id: "menu",
2644
2755
  group: "content",
2645
2756
  label: ({ t: e }) => e.palette.menu,
2646
- icon: /* @__PURE__ */ I(xe, { size: 22 }),
2647
- content: (e) => [Ln(e)]
2757
+ icon: /* @__PURE__ */ I(we, { size: 22 }),
2758
+ content: (e) => [Yn(e)]
2648
2759
  },
2649
2760
  {
2650
2761
  id: "list",
2651
2762
  group: "content",
2652
2763
  label: ({ t: e }) => e.palette.list,
2653
- icon: /* @__PURE__ */ I(ge, { size: 22 }),
2764
+ icon: /* @__PURE__ */ I(be, { size: 22 }),
2654
2765
  content: ({ t: e }) => [{
2655
2766
  type: "bulletList",
2656
2767
  content: e.content.listItems.map((e) => ({
2657
2768
  type: "listItem",
2658
- content: [J(e)]
2769
+ content: [Y(e)]
2659
2770
  }))
2660
2771
  }]
2661
2772
  },
@@ -2663,17 +2774,17 @@ var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En =
2663
2774
  id: "quote",
2664
2775
  group: "content",
2665
2776
  label: ({ t: e }) => e.palette.quote,
2666
- icon: /* @__PURE__ */ I(Te, { size: 22 }),
2777
+ icon: /* @__PURE__ */ I(ke, { size: 22 }),
2667
2778
  content: ({ t: e }) => [{
2668
2779
  type: "blockquote",
2669
- content: [J(e.content.quote)]
2780
+ content: [Y(e.content.quote)]
2670
2781
  }]
2671
2782
  },
2672
2783
  {
2673
2784
  id: "html",
2674
2785
  group: "content",
2675
2786
  label: ({ t: e }) => e.palette.html,
2676
- icon: /* @__PURE__ */ I(Ce, { size: 22 }),
2787
+ icon: /* @__PURE__ */ I(Ee, { size: 22 }),
2677
2788
  content: ({ t: e }) => [{
2678
2789
  type: "htmlBlock",
2679
2790
  attrs: { html: e.content.html }
@@ -2683,8 +2794,8 @@ var wn = (e, { t }) => Cn(e.textContent) || t.layers.empty, Tn = () => "", En =
2683
2794
  id: "card",
2684
2795
  group: "content",
2685
2796
  label: ({ t: e }) => e.palette.card,
2686
- icon: /* @__PURE__ */ I(me, { size: 22 }),
2687
- content: ({ t: e }) => [Mn(`${Nn(24)};background-color:#f1f5f9;border-radius:12px`, Y(3, e.content.cardTitle), J(e.content.cardText))]
2797
+ icon: /* @__PURE__ */ I(ve, { size: 22 }),
2798
+ content: ({ t: e }) => [Wn(`${Gn(24)};background-color:#f1f5f9;border-radius:12px`, zn(3, e.content.cardTitle), Y(e.content.cardText))]
2688
2799
  }
2689
2800
  ];
2690
2801
  //#endregion
@@ -2700,47 +2811,47 @@ function Z({ variant: e }) {
2700
2811
  ]
2701
2812
  });
2702
2813
  }
2703
- var Bn = [
2814
+ var Qn = [
2704
2815
  {
2705
2816
  id: "header",
2706
2817
  label: ({ t: e }) => e.templates.header,
2707
2818
  description: ({ t: e }) => e.templates.headerDescription,
2708
2819
  thumbnail: /* @__PURE__ */ I(Z, { variant: "header" }),
2709
- content: (e) => [X(2, [jn(An(kn(Fn(140, 40, e.t.content.logo), {
2820
+ content: (e) => [X(2, [Un(Hn(Vn(qn(140, 40, e.t.content.logo), {
2710
2821
  alignment: "left",
2711
2822
  width: "140"
2712
- })), 33), jn(An(Ln(e, "right")), 67)])]
2823
+ })), 33), Un(Hn(Yn(e, "right")), 67)])]
2713
2824
  },
2714
2825
  {
2715
2826
  id: "hero",
2716
2827
  label: ({ t: e }) => e.templates.hero,
2717
2828
  description: ({ t: e }) => e.templates.heroDescription,
2718
2829
  thumbnail: /* @__PURE__ */ I(Z, { variant: "hero" }),
2719
- content: ({ t: e }) => [Mn(`${Nn(40, 24)};background-color:#eef2ff;border-radius:12px`, Y(1, e.content.heroTitle, { alignment: "center" }), J(e.content.heroText, { alignment: "center" }), On(e.content.heroButton, { style: `background-color:#4f46e5;color:#ffffff;${Nn(12, 24)};border-radius:8px` }))]
2830
+ content: ({ t: e }) => [Wn(`${Gn(40, 24)};background-color:#eef2ff;border-radius:12px`, zn(1, e.content.heroTitle, { alignment: "center" }), Y(e.content.heroText, { alignment: "center" }), Bn(e.content.heroButton, { style: `background-color:#4f46e5;color:#ffffff;${Gn(12, 24)};border-radius:8px` }))]
2720
2831
  },
2721
2832
  {
2722
2833
  id: "products",
2723
2834
  label: ({ t: e }) => e.templates.products,
2724
2835
  description: ({ t: e }) => e.templates.productsDescription,
2725
2836
  thumbnail: /* @__PURE__ */ I(Z, { variant: "products" }),
2726
- content: ({ t: e }) => [X(2, [e.content.productA, e.content.productB].map((t) => An(kn(Fn(280, 200, t)), Y(3, t, { alignment: "center" }), J(e.content.productText, { alignment: "center" }), On(e.content.productButton))), { cellspacing: 16 })]
2837
+ content: ({ t: e }) => [X(2, [e.content.productA, e.content.productB].map((t) => Hn(Vn(qn(280, 200, t)), zn(3, t, { alignment: "center" }), Y(e.content.productText, { alignment: "center" }), Bn(e.content.productButton))), { cellspacing: 16 })]
2727
2838
  },
2728
2839
  {
2729
2840
  id: "features",
2730
2841
  label: ({ t: e }) => e.templates.features,
2731
2842
  description: ({ t: e }) => e.templates.featuresDescription,
2732
2843
  thumbnail: /* @__PURE__ */ I(Z, { variant: "features" }),
2733
- content: ({ t: e }) => [X(3, e.content.features.map((t) => An(Y(3, t, { alignment: "center" }), J(e.content.featureText, { alignment: "center" }))))]
2844
+ content: ({ t: e }) => [X(3, e.content.features.map((t) => Hn(zn(3, t, { alignment: "center" }), Y(e.content.featureText, { alignment: "center" }))))]
2734
2845
  },
2735
2846
  {
2736
2847
  id: "testimonial",
2737
2848
  label: ({ t: e }) => e.templates.testimonial,
2738
2849
  description: ({ t: e }) => e.templates.testimonialDescription,
2739
2850
  thumbnail: /* @__PURE__ */ I(Z, { variant: "testimonial" }),
2740
- content: ({ t: e }) => [Mn(`${Nn(24)};background-color:#f8fafc;border-radius:12px`, {
2851
+ content: ({ t: e }) => [Wn(`${Gn(24)};background-color:#f8fafc;border-radius:12px`, {
2741
2852
  type: "blockquote",
2742
- content: [J(e.content.testimonialQuote)]
2743
- }, J(e.content.testimonialAuthor, {
2853
+ content: [Y(e.content.testimonialQuote)]
2854
+ }, Y(e.content.testimonialAuthor, {
2744
2855
  alignment: "right",
2745
2856
  style: "color:#64748b"
2746
2857
  }))]
@@ -2753,18 +2864,18 @@ var Bn = [
2753
2864
  content: ({ t: e }) => [
2754
2865
  { type: "horizontalRule" },
2755
2866
  { type: "socialLinks" },
2756
- J(e.content.footerAddress, {
2867
+ Y(e.content.footerAddress, {
2757
2868
  alignment: "center",
2758
2869
  style: "color:#94a3b8;font-size:12px"
2759
2870
  }),
2760
- J([q(e.content.unsubscribe, Pn("https://example.com/unsubscribe"))], {
2871
+ Y([J(e.content.unsubscribe, Kn("https://example.com/unsubscribe"))], {
2761
2872
  alignment: "center",
2762
2873
  style: "font-size:12px"
2763
2874
  })
2764
2875
  ]
2765
2876
  }
2766
- ], Vn = (e, t) => Bn.find((t) => t.id === e)?.content(t) ?? [];
2767
- function Hn(e) {
2877
+ ], $n = (e, t) => Qn.find((t) => t.id === e)?.content(t) ?? [];
2878
+ function er(e) {
2768
2879
  let t = {
2769
2880
  type: "spacer",
2770
2881
  attrs: { height: 16 }
@@ -2772,39 +2883,39 @@ function Hn(e) {
2772
2883
  return {
2773
2884
  type: "doc",
2774
2885
  content: [
2775
- ...Vn("header", e),
2886
+ ...$n("header", e),
2776
2887
  t,
2777
- ...Vn("hero", e),
2888
+ ...$n("hero", e),
2778
2889
  t,
2779
- Y(2, e.t.content.starterTitle, { alignment: "center" }),
2780
- ...Vn("products", e),
2890
+ zn(2, e.t.content.starterTitle, { alignment: "center" }),
2891
+ ...$n("products", e),
2781
2892
  t,
2782
- ...Vn("footer", e)
2893
+ ...$n("footer", e)
2783
2894
  ]
2784
2895
  };
2785
2896
  }
2786
2897
  //#endregion
2787
2898
  //#region src/context.tsx
2788
- var Un = e(null);
2899
+ var tr = e(null);
2789
2900
  function Q() {
2790
- let e = r(Un);
2901
+ let e = r(tr);
2791
2902
  if (!e) throw Error("useEmailEditor must be used inside <EditorRoot> or <BetterEmailEditor>.");
2792
2903
  return e;
2793
2904
  }
2794
- function Wn() {
2795
- return r(Un);
2905
+ function nr() {
2906
+ return r(tr);
2796
2907
  }
2797
2908
  function $() {
2798
- return r(Un)?.t ?? Ct;
2909
+ return r(tr)?.t ?? Pt;
2799
2910
  }
2800
- function Gn() {
2911
+ function rr() {
2801
2912
  let { locale: e, t } = Q();
2802
- return s(() => ({
2913
+ return c(() => ({
2803
2914
  locale: e,
2804
2915
  t
2805
2916
  }), [e, t]);
2806
2917
  }
2807
- var Kn = x("basic", {
2918
+ var ir = S("basic", {
2808
2919
  body: {
2809
2920
  backgroundColor: "#eef1f5",
2810
2921
  padding: "32px 16px"
@@ -2814,185 +2925,207 @@ var Kn = x("basic", {
2814
2925
  padding: "24px",
2815
2926
  borderRadius: "12px"
2816
2927
  }
2817
- }), qn = (e) => new Promise((t, n) => {
2928
+ }), ar = (e) => new Promise((t, n) => {
2818
2929
  let r = new FileReader();
2819
2930
  r.onload = () => t({ url: String(r.result) }), r.onerror = n, r.readAsDataURL(e);
2820
- }), Jn = {
2931
+ }), or = {
2821
2932
  type: "doc",
2822
2933
  content: [{ type: "paragraph" }]
2823
2934
  };
2824
- function Yn(e) {
2935
+ function sr(e) {
2825
2936
  return typeof e == "object" && !!e && "doc" in e;
2826
2937
  }
2827
- function Xn(e) {
2828
- return e ? Yn(e) ? {
2938
+ function cr(e) {
2939
+ let t = {
2940
+ subject: "",
2941
+ previewText: ""
2942
+ };
2943
+ return e ? sr(e) ? {
2829
2944
  doc: e.doc,
2830
2945
  settings: {
2946
+ ...t,
2831
2947
  ...e.settings,
2832
2948
  previewText: e.settings?.previewText ?? ""
2833
2949
  }
2834
2950
  } : {
2835
2951
  doc: e,
2836
- settings: { previewText: "" }
2952
+ settings: t
2837
2953
  } : {
2838
- doc: Jn,
2839
- settings: { previewText: "" }
2954
+ doc: or,
2955
+ settings: t
2840
2956
  };
2841
2957
  }
2842
- function Zn(e, t, r) {
2843
- let [i, a] = l(t);
2958
+ function lr(e, t, r) {
2959
+ let [i, a] = u(t);
2844
2960
  return [e === void 0 ? i : e, n((t) => {
2845
2961
  e === void 0 && a(t), r?.(t);
2846
2962
  }, [e, r])];
2847
2963
  }
2848
- var Qn = t(function({ defaultValue: e, onChange: t, onReady: r, locale: u = "en", messages: f, nodes: h = En, palette: g = zn, paletteGroups: v = Rn, templates: x = Bn, starterDocument: C = Hn, extensions: w, theme: T = Kn, uploadImage: E = qn, editable: D = !0, device: O, defaultDevice: ee = "desktop", onDeviceChange: k, layersOpen: te, defaultLayersOpen: ne = !0, onLayersOpenChange: re, className: ie, style: ae, children: oe }, se) {
2849
- let A = s(() => kt(u, f), [u, f]), [ce] = l(() => Xn(e)), [le, ue] = l(ce.settings), j = c(le), de = c(A), fe = c(t), M = c(r), pe = c(E);
2850
- o(() => {
2851
- de.current = A, fe.current = t, M.current = r, pe.current = E;
2964
+ var ur = t(function({ defaultValue: e, onChange: t, onReady: r, locale: a = "en", messages: d, nodes: p = Ln, palette: g = Zn, paletteGroups: _ = Xn, templates: y = Qn, fonts: S = Dt, starterDocument: C = er, extensions: w, theme: E = ir, uploadImage: D = ar, editable: O = !0, device: k, defaultDevice: A = "desktop", onDeviceChange: j, layersOpen: ee, defaultLayersOpen: te = !0, onLayersOpenChange: ne, className: re, style: ie, children: ae }, oe) {
2965
+ let se = c(() => Bt(a, d), [a, d]), [ce] = u(() => cr(e)), [le, ue] = u(ce.settings), de = l(le), fe = l(se), pe = l(t), me = l(r), M = l(D), he = l(S);
2966
+ s(() => {
2967
+ fe.current = se, pe.current = t, me.current = r, M.current = D, he.current = S;
2852
2968
  });
2853
- let [me, he] = Zn(O, ee, k), [ge, _e] = Zn(te, ne, re), [ve] = l(() => ({
2854
- dragSession: xt(),
2855
- hoverStore: St()
2856
- })), ye = n((e) => pe.current(e), []), be = S({ uploadImage: ye }), [xe] = l(() => [
2857
- y.configure({
2969
+ let [ge, N] = lr(k, A, j), [_e, ve] = lr(ee, te, ne), [ye] = u(() => ({
2970
+ dragSession: Mt(),
2971
+ hoverStore: Nt()
2972
+ })), be = n((e) => M.current(e), []), xe = T({ uploadImage: be }), [Se] = u(() => [
2973
+ b.configure({
2858
2974
  TiptapStarterKit: { dropcursor: !1 },
2859
2975
  Button: !1
2860
2976
  }),
2861
- ct,
2862
- bt,
2863
- d.configure({
2864
- placeholder: ({ node: e }) => e.type.name === "heading" ? de.current.placeholder.heading : de.current.placeholder.paragraph,
2977
+ pt,
2978
+ Tt,
2979
+ Et,
2980
+ f.configure({
2981
+ placeholder: ({ node: e }) => e.type.name === "heading" ? fe.current.placeholder.heading : fe.current.placeholder.paragraph,
2865
2982
  includeChildren: !0
2866
2983
  }),
2867
- b.configure({ theme: T }),
2868
- ...h.flatMap((e) => e.extensions ?? []),
2984
+ x.configure({ theme: E }),
2985
+ ...p.flatMap((e) => e.extensions ?? []),
2869
2986
  ...w ?? [],
2870
- be
2871
- ]), N = m({
2872
- extensions: xe,
2987
+ xe
2988
+ ]), P = h({
2989
+ extensions: Se,
2873
2990
  content: ce.doc,
2874
- editable: D,
2991
+ editable: O,
2875
2992
  immediatelyRender: !1,
2876
- editorProps: { handlePaste: vt(xe) }
2993
+ editorProps: { handlePaste: Ct(Se) }
2877
2994
  }, []);
2878
2995
  i(() => {
2879
- N?.setEditable(D);
2880
- }, [N, D]);
2881
- let Se = n(() => ({
2882
- doc: N?.getJSON() ?? Jn,
2883
- settings: j.current
2884
- }), [N]), Ce = n((e) => {
2996
+ P?.setEditable(O);
2997
+ }, [P, O]);
2998
+ let Ce = n(() => ({
2999
+ doc: P?.getJSON() ?? or,
3000
+ settings: de.current
3001
+ }), [P]), we = n((e) => {
2885
3002
  let t = {
2886
- ...j.current,
3003
+ ...de.current,
2887
3004
  ...e
2888
3005
  };
2889
- j.current = t, ue(t), N && fe.current?.({
2890
- doc: N.getJSON(),
3006
+ de.current = t, ue(t), P && pe.current?.({
3007
+ doc: P.getJSON(),
2891
3008
  settings: t
2892
3009
  });
2893
- }, [N]), P = s(() => {
2894
- let e = async () => N ? _({
2895
- editor: N,
2896
- preview: j.current.previewText || void 0
2897
- }) : {
2898
- html: "",
2899
- text: "",
2900
- unformattedHtml: ""
3010
+ }, [P]), F = c(() => {
3011
+ let e = async () => {
3012
+ if (!P) return {
3013
+ html: "",
3014
+ text: "",
3015
+ unformattedHtml: ""
3016
+ };
3017
+ let e = await v({
3018
+ editor: P,
3019
+ preview: de.current.previewText || void 0
3020
+ });
3021
+ return {
3022
+ ...e,
3023
+ html: jt(e.html, he.current),
3024
+ unformattedHtml: jt(e.unformattedHtml, he.current)
3025
+ };
2901
3026
  };
2902
3027
  return {
2903
- editor: N,
2904
- getValue: Se,
2905
- getJSON: () => N?.getJSON() ?? Jn,
3028
+ editor: P,
3029
+ getValue: Ce,
3030
+ getJSON: () => P?.getJSON() ?? or,
2906
3031
  setValue: (e) => {
2907
- let t = Xn(e);
2908
- j.current = t.settings, ue(t.settings), N?.commands.setContent(t.doc, { emitUpdate: !0 });
3032
+ let t = cr(e);
3033
+ de.current = t.settings, ue(t.settings), P?.commands.setContent(t.doc, { emitUpdate: !0 });
2909
3034
  },
2910
3035
  exportEmail: e,
2911
3036
  getHtml: async () => (await e()).html,
2912
3037
  getText: async () => (await e()).text,
2913
3038
  insertBlocks: (e) => {
2914
- N && st(N, e);
3039
+ P && ft(P, e);
2915
3040
  }
2916
3041
  };
2917
- }, [N, Se]);
2918
- a(se, () => P, [P]), i(() => {
2919
- if (!N) return;
2920
- M.current?.(P);
2921
- let e = () => fe.current?.(Se());
2922
- return N.on("update", e), () => {
2923
- N.off("update", e);
3042
+ }, [P, Ce]);
3043
+ o(oe, () => F, [F]), i(() => {
3044
+ if (!P) return;
3045
+ me.current?.(F);
3046
+ let e = () => pe.current?.(Ce());
3047
+ return P.on("update", e), () => {
3048
+ P.off("update", e);
2924
3049
  };
2925
3050
  }, [
2926
- N,
2927
3051
  P,
2928
- Se
2929
- ]);
2930
- let we = s(() => new Map(h.map((e) => [e.type, e])), [h]), Te = s(() => {
2931
- if (!N) return null;
3052
+ F,
3053
+ Ce
3054
+ ]), i(() => {
3055
+ for (let { href: e } of S) {
3056
+ if (!e || document.querySelector(`link[data-bree-font="${CSS.escape(e)}"]`)) continue;
3057
+ let t = document.createElement("link");
3058
+ t.rel = "stylesheet", t.href = e, t.dataset.breeFont = e, document.head.appendChild(t);
3059
+ }
3060
+ }, [S]);
3061
+ let Te = c(() => new Map(p.map((e) => [e.type, e])), [p]), Ee = c(() => {
3062
+ if (!P) return null;
2932
3063
  let e = {
2933
- locale: u,
2934
- t: A
3064
+ locale: a,
3065
+ t: se
2935
3066
  };
2936
3067
  return {
2937
3068
  ...e,
2938
- editor: N,
2939
- handle: P,
2940
- nodes: we,
3069
+ editor: P,
3070
+ handle: F,
3071
+ nodes: Te,
2941
3072
  nodeLabel: (t) => {
2942
- let n = we.get(t)?.label;
2943
- return n ? Et(n, e) : A.nodes[t] ?? t;
3073
+ let n = Te.get(t)?.label;
3074
+ return n ? Lt(n, e) : se.nodes[t] ?? t;
2944
3075
  },
2945
3076
  palette: g,
2946
- paletteGroups: v,
2947
- templates: x,
3077
+ paletteGroups: _,
3078
+ templates: y,
3079
+ fonts: S,
2948
3080
  starterDocument: C,
2949
- uploadImage: ye,
2950
- ...ve,
2951
- device: me,
2952
- setDevice: he,
2953
- layersOpen: ge,
2954
- setLayersOpen: _e,
3081
+ uploadImage: be,
3082
+ ...ye,
3083
+ device: ge,
3084
+ setDevice: N,
3085
+ layersOpen: _e,
3086
+ setLayersOpen: ve,
2955
3087
  settings: le,
2956
- updateSettings: Ce
3088
+ updateSettings: we
2957
3089
  };
2958
3090
  }, [
2959
- N,
2960
- u,
2961
- A,
2962
3091
  P,
2963
- we,
3092
+ a,
3093
+ se,
3094
+ F,
3095
+ Te,
2964
3096
  g,
2965
- v,
2966
- x,
3097
+ _,
3098
+ y,
3099
+ S,
2967
3100
  C,
3101
+ be,
2968
3102
  ye,
2969
- ve,
2970
- me,
2971
- he,
2972
3103
  ge,
3104
+ N,
2973
3105
  _e,
3106
+ ve,
2974
3107
  le,
2975
- Ce
2976
- ]), Ee = s(() => ({ editor: N }), [N]), De = {
2977
- "--bree-empty-zone-label": JSON.stringify(A.canvas.emptyZone),
2978
- ...ae
3108
+ we
3109
+ ]), De = c(() => ({ editor: P }), [P]), Oe = {
3110
+ "--bree-empty-zone-label": JSON.stringify(se.canvas.emptyZone),
3111
+ ...ie
2979
3112
  };
2980
3113
  return /* @__PURE__ */ I("div", {
2981
- className: R("bree bree-root", ie),
2982
- style: De,
2983
- lang: u,
2984
- children: Te && /* @__PURE__ */ I(p.Provider, {
2985
- value: Ee,
2986
- children: /* @__PURE__ */ I(Un.Provider, {
2987
- value: Te,
2988
- children: oe
3114
+ className: R("bree bree-root", re),
3115
+ style: Oe,
3116
+ lang: a,
3117
+ children: Ee && /* @__PURE__ */ I(m.Provider, {
3118
+ value: De,
3119
+ children: /* @__PURE__ */ I(tr.Provider, {
3120
+ value: Ee,
3121
+ children: ae
2989
3122
  })
2990
3123
  })
2991
3124
  });
2992
3125
  });
2993
3126
  //#endregion
2994
3127
  //#region src/components/CanvasOverlay.tsx
2995
- function $n(e, t) {
3128
+ function dr(e, t) {
2996
3129
  let n = e.getBoundingClientRect();
2997
3130
  return {
2998
3131
  top: t.top - n.top + e.scrollTop,
@@ -3001,38 +3134,38 @@ function $n(e, t) {
3001
3134
  height: t.height ?? 0
3002
3135
  };
3003
3136
  }
3004
- function er(e, t, n) {
3137
+ function fr(e, t, n) {
3005
3138
  if (!n) return null;
3006
3139
  let r = e.view.nodeDOM(n.pos);
3007
- return r instanceof HTMLElement ? $n(t, r.getBoundingClientRect()) : null;
3140
+ return r instanceof HTMLElement ? dr(t, r.getBoundingClientRect()) : null;
3008
3141
  }
3009
- function tr(e, t, n) {
3142
+ function pr(e, t, n) {
3010
3143
  let r = e.view.posAtCoords({
3011
3144
  left: t,
3012
3145
  top: n
3013
3146
  });
3014
3147
  return r && r.inside >= 0 ? z(e.state.doc, r.inside) : null;
3015
3148
  }
3016
- function nr(e) {
3149
+ function mr(e) {
3017
3150
  let t = e.node.type.name;
3018
- return Ve.has(t) || He.has(t);
3151
+ return Ke.has(t) || qe.has(t);
3019
3152
  }
3020
- function rr({ editor: e, host: t }) {
3021
- let { dragSession: r, hoverStore: a, nodeLabel: s, t: d } = Q(), f = c(s);
3022
- o(() => {
3023
- f.current = s;
3153
+ function hr({ editor: e, host: t }) {
3154
+ let { dragSession: r, hoverStore: a, nodeLabel: o, t: c } = Q(), f = l(o);
3155
+ s(() => {
3156
+ f.current = o;
3024
3157
  });
3025
- let p = u(a.subscribe, a.get), m = p === null ? null : e.state.doc.nodeAt(p), g = p !== null && m ? {
3158
+ let p = d(a.subscribe, a.get), m = p === null ? null : e.state.doc.nodeAt(p), h = p !== null && m ? {
3026
3159
  pos: p,
3027
3160
  node: m
3028
- } : null, [_, v] = l(null), [y, b] = l(null), [, x] = l(0), S = n(() => x((e) => e + 1), []), C = h({
3161
+ } : null, [_, v] = u(null), [y, b] = u(null), [, x] = u(0), S = n(() => x((e) => e + 1), []), C = g({
3029
3162
  editor: e,
3030
3163
  selector: ({ editor: e }) => {
3031
3164
  if (!e?.isFocused) return null;
3032
- let t = rt(e);
3165
+ let t = ct(e);
3033
3166
  return t ? `${t.pos}:${t.node.type.name}:${e.state.doc.content.size}` : null;
3034
3167
  }
3035
- }) ? rt(e) : null;
3168
+ }) ? ct(e) : null;
3036
3169
  i(() => {
3037
3170
  let n = () => S(), r = () => {
3038
3171
  a.set(null), S();
@@ -3050,7 +3183,7 @@ function rr({ editor: e, host: t }) {
3050
3183
  ]), i(() => {
3051
3184
  let n = 0, i = (t) => {
3052
3185
  r.get() || t.target.closest(".bree-ov-toolbar, .bree-ov-handle, .bree-ov-tag") || (cancelAnimationFrame(n), n = requestAnimationFrame(() => {
3053
- a.set(tr(e, t.clientX, t.clientY)?.pos ?? null);
3186
+ a.set(pr(e, t.clientX, t.clientY)?.pos ?? null);
3054
3187
  }));
3055
3188
  }, o = () => a.set(null);
3056
3189
  return t.addEventListener("mousemove", i), t.addEventListener("mouseleave", o), () => {
@@ -3063,7 +3196,7 @@ function rr({ editor: e, host: t }) {
3063
3196
  a
3064
3197
  ]), i(() => {
3065
3198
  let n = (n) => {
3066
- if (n.button !== 0 || n.shiftKey || n.metaKey || n.ctrlKey || n.target.closest(".bree-ov-layer")) return;
3199
+ if (n.button !== 0 || n.shiftKey || n.metaKey || n.ctrlKey || n.target.closest(".bree-ov-layer, .bree-canvas-header")) return;
3067
3200
  if ([
3068
3201
  t,
3069
3202
  e.view.dom,
@@ -3074,14 +3207,14 @@ function rr({ editor: e, host: t }) {
3074
3207
  t instanceof HTMLElement && t.blur(), e.commands.blur();
3075
3208
  return;
3076
3209
  }
3077
- let r = tr(e, n.clientX, n.clientY);
3078
- if (r && nr(r)) {
3079
- n.preventDefault(), it(e, r);
3210
+ let r = pr(e, n.clientX, n.clientY);
3211
+ if (r && mr(r)) {
3212
+ n.preventDefault(), lt(e, r);
3080
3213
  return;
3081
3214
  }
3082
- !e.isFocused && e.state.selection instanceof w && e.view.focus();
3215
+ !e.isFocused && e.state.selection instanceof D && e.view.focus();
3083
3216
  }, r = (t) => {
3084
- e.view.dom.contains(t.target) && lt(e, t);
3217
+ e.view.dom.contains(t.target) && mt(e, t);
3085
3218
  };
3086
3219
  return t.addEventListener("mousedown", n, !0), t.addEventListener("paste", r, !0), () => {
3087
3220
  t.removeEventListener("mousedown", n, !0), t.removeEventListener("paste", r, !0);
@@ -3089,12 +3222,12 @@ function rr({ editor: e, host: t }) {
3089
3222
  }, [e, t]), i(() => {
3090
3223
  let n = 0, i = null, o = null, s = (t) => {
3091
3224
  let n = r.get();
3092
- if (!n || (i !== n && (i = n, o = Ye(e.view, n)), !o)) return null;
3225
+ if (!n || (i !== n && (i = n, o = et(e.view, n)), !o)) return null;
3093
3226
  let a = n.kind === "move" ? {
3094
3227
  from: n.pos,
3095
3228
  to: n.pos + (e.state.doc.nodeAt(n.pos)?.nodeSize ?? 0)
3096
3229
  } : void 0;
3097
- return Je(e.view, t.clientX, t.clientY, o, a);
3230
+ return $e(e.view, t.clientX, t.clientY, o, a);
3098
3231
  }, c = (e) => {
3099
3232
  let t = r.get();
3100
3233
  t && (e.preventDefault(), e.stopPropagation(), e.dataTransfer && (e.dataTransfer.dropEffect = t.kind === "move" ? "move" : "copy"), cancelAnimationFrame(n), n = requestAnimationFrame(() => v(s(e))));
@@ -3103,7 +3236,7 @@ function rr({ editor: e, host: t }) {
3103
3236
  if (!i) return;
3104
3237
  t.preventDefault(), t.stopPropagation(), cancelAnimationFrame(n);
3105
3238
  let o = s(t);
3106
- o && $e(e, i, o), e.view.dragging = null, r.end(), v(null), b(null), a.set(null);
3239
+ o && it(e, i, o), e.view.dragging = null, r.end(), v(null), b(null), a.set(null);
3107
3240
  }, u = (e) => {
3108
3241
  r.get() && (t.contains(e.relatedTarget) || (cancelAnimationFrame(n), v(null)));
3109
3242
  }, d = () => {
@@ -3112,15 +3245,15 @@ function rr({ editor: e, host: t }) {
3112
3245
  let n = t.target;
3113
3246
  if (r.get() || n.tagName !== "IMG" || !e.view.dom.contains(n)) return;
3114
3247
  let i = e.view.posAtDOM(n, 0), a = z(e.state.doc, i);
3115
- a && !tt(a) && (r.start({
3248
+ a && !ot(a) && (r.start({
3116
3249
  kind: "move",
3117
3250
  pos: a.pos,
3118
3251
  label: f.current(a.node.type.name)
3119
3252
  }), requestAnimationFrame(() => b(a.pos)));
3120
3253
  }, m = (t) => {
3121
3254
  if (t.key !== "Escape" || !e.isFocused) return;
3122
- let n = rt(e), r = n ? nt(e.state.doc, n) : null;
3123
- if (t.preventDefault(), r) it(e, r);
3255
+ let n = ct(e), r = n ? st(e.state.doc, n) : null;
3256
+ if (t.preventDefault(), r) lt(e, r);
3124
3257
  else {
3125
3258
  let t = document.activeElement;
3126
3259
  t instanceof HTMLElement && t.blur(), e.commands.blur();
@@ -3135,104 +3268,104 @@ function rr({ editor: e, host: t }) {
3135
3268
  r,
3136
3269
  a
3137
3270
  ]);
3138
- let T = (t, n) => {
3271
+ let w = (t, n) => {
3139
3272
  let i = e.view.nodeDOM(n.pos);
3140
3273
  if (r.start({
3141
3274
  kind: "move",
3142
3275
  pos: n.pos,
3143
- label: s(n.node.type.name)
3144
- }), t.dataTransfer.setData(Ue, "move"), t.dataTransfer.effectAllowed = "move", i instanceof HTMLElement) {
3276
+ label: o(n.node.type.name)
3277
+ }), t.dataTransfer.setData(Je, "move"), t.dataTransfer.effectAllowed = "move", i instanceof HTMLElement) {
3145
3278
  let e = i.getBoundingClientRect();
3146
3279
  t.dataTransfer.setDragImage(i, Math.min(24, e.width / 2), Math.min(24, e.height / 2));
3147
3280
  }
3148
3281
  requestAnimationFrame(() => b(n.pos));
3149
- }, E = y !== null, D = g && g.pos !== C?.pos ? er(e, t, g) : null, O = er(e, t, C), ee = E ? er(e, t, z(e.state.doc, y)) : null, k = C ? nt(e.state.doc, C) : null;
3282
+ }, T = y !== null, E = h && h.pos !== C?.pos ? fr(e, t, h) : null, O = fr(e, t, C), k = T ? fr(e, t, z(e.state.doc, y)) : null, A = C ? st(e.state.doc, C) : null;
3150
3283
  return /* @__PURE__ */ L("div", {
3151
3284
  className: "bree-ov-layer",
3152
3285
  children: [
3153
- D && g && /* @__PURE__ */ I("div", {
3154
- className: R("bree-ov-frame bree-ov-hover", E && "bree-ov-ghost"),
3155
- style: D,
3286
+ E && h && /* @__PURE__ */ I("div", {
3287
+ className: R("bree-ov-frame bree-ov-hover", T && "bree-ov-ghost"),
3288
+ style: E,
3156
3289
  children: /* @__PURE__ */ I("button", {
3157
3290
  type: "button",
3158
3291
  className: "bree-ov-tag",
3159
3292
  onMouseDown: (t) => {
3160
- t.preventDefault(), it(e, g);
3293
+ t.preventDefault(), lt(e, h);
3161
3294
  },
3162
- children: s(g.node.type.name)
3295
+ children: o(h.node.type.name)
3163
3296
  })
3164
3297
  }),
3165
3298
  O && C && /* @__PURE__ */ L("div", {
3166
- className: R("bree-ov-frame bree-ov-selected", E && "bree-ov-ghost"),
3299
+ className: R("bree-ov-frame bree-ov-selected", T && "bree-ov-ghost"),
3167
3300
  style: O,
3168
3301
  children: [
3169
3302
  /* @__PURE__ */ I("span", {
3170
3303
  className: "bree-ov-tag bree-ov-tag-selected",
3171
- children: s(C.node.type.name)
3304
+ children: o(C.node.type.name)
3172
3305
  }),
3173
- !tt(C) && /* @__PURE__ */ I(j, { children: /* @__PURE__ */ I("span", {
3306
+ !ot(C) && /* @__PURE__ */ I(M, { children: /* @__PURE__ */ I("span", {
3174
3307
  className: "bree-ov-handle",
3175
3308
  role: "button",
3176
3309
  tabIndex: -1,
3177
3310
  draggable: !0,
3178
- title: d.canvas.move,
3179
- "aria-label": d.canvas.moveLabel(s(C.node.type.name)),
3180
- onDragStart: (e) => T(e, C),
3181
- children: /* @__PURE__ */ I(jt, {})
3311
+ title: c.canvas.move,
3312
+ "aria-label": c.canvas.moveLabel(o(C.node.type.name)),
3313
+ onDragStart: (e) => w(e, C),
3314
+ children: /* @__PURE__ */ I(Ht, {})
3182
3315
  }) }),
3183
- /* @__PURE__ */ I(j, { children: /* @__PURE__ */ L("div", {
3316
+ /* @__PURE__ */ I(M, { children: /* @__PURE__ */ L("div", {
3184
3317
  className: "bree-ov-toolbar",
3185
3318
  onMouseDown: (e) => e.preventDefault(),
3186
- children: [k && /* @__PURE__ */ I("button", {
3319
+ children: [A && /* @__PURE__ */ I("button", {
3187
3320
  type: "button",
3188
3321
  className: "bree-ov-tool",
3189
- title: d.canvas.selectParent(s(k.node.type.name)),
3190
- onClick: () => it(e, k),
3191
- children: /* @__PURE__ */ I(Pt, {})
3192
- }), !tt(C) && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("button", {
3322
+ title: c.canvas.selectParent(o(A.node.type.name)),
3323
+ onClick: () => lt(e, A),
3324
+ children: /* @__PURE__ */ I(Gt, {})
3325
+ }), !ot(C) && /* @__PURE__ */ L(Pe, { children: [/* @__PURE__ */ I("button", {
3193
3326
  type: "button",
3194
3327
  className: "bree-ov-tool",
3195
- title: d.canvas.duplicate,
3196
- onClick: () => at(e, C),
3197
- children: /* @__PURE__ */ I(Mt, {})
3328
+ title: c.canvas.duplicate,
3329
+ onClick: () => ut(e, C),
3330
+ children: /* @__PURE__ */ I(Ut, {})
3198
3331
  }), /* @__PURE__ */ I("button", {
3199
3332
  type: "button",
3200
3333
  className: "bree-ov-tool bree-ov-danger",
3201
- title: d.canvas.delete,
3202
- onClick: () => ot(e, C),
3203
- children: /* @__PURE__ */ I(Nt, {})
3334
+ title: c.canvas.delete,
3335
+ onClick: () => dt(e, C),
3336
+ children: /* @__PURE__ */ I(Wt, {})
3204
3337
  })] })]
3205
3338
  }) })
3206
3339
  ]
3207
3340
  }),
3208
- ee && /* @__PURE__ */ I("div", {
3341
+ k && /* @__PURE__ */ I("div", {
3209
3342
  className: "bree-ov-frame bree-ov-source",
3210
- style: ee
3343
+ style: k
3211
3344
  }),
3212
- _ && /* @__PURE__ */ I(ir, {
3345
+ _ && /* @__PURE__ */ I(gr, {
3213
3346
  host: t,
3214
3347
  target: _,
3215
3348
  label: r.get()?.label ?? "",
3216
- messages: d
3349
+ messages: c
3217
3350
  })
3218
3351
  ]
3219
3352
  });
3220
3353
  }
3221
- function ir({ host: e, target: t, label: n, messages: r }) {
3354
+ function gr({ host: e, target: t, label: n, messages: r }) {
3222
3355
  if (t.emptyZone) {
3223
- let i = $n(e, t.emptyZone);
3356
+ let i = dr(e, t.emptyZone);
3224
3357
  return /* @__PURE__ */ I("div", {
3225
3358
  className: "bree-ov-dropzone",
3226
3359
  style: i,
3227
3360
  children: /* @__PURE__ */ L("span", { children: [
3228
- /* @__PURE__ */ I(N, { size: 14 }),
3361
+ /* @__PURE__ */ I(F, { size: 14 }),
3229
3362
  " ",
3230
3363
  r.canvas.dropLabel(n)
3231
3364
  ] })
3232
3365
  });
3233
3366
  }
3234
3367
  if (!t.line) return null;
3235
- let i = $n(e, {
3368
+ let i = dr(e, {
3236
3369
  ...t.line,
3237
3370
  height: 0
3238
3371
  });
@@ -3250,72 +3383,149 @@ function ir({ host: e, target: t, label: n, messages: r }) {
3250
3383
  });
3251
3384
  }
3252
3385
  //#endregion
3386
+ //#region src/components/EmailHeader.tsx
3387
+ function _r({ className: e, style: t }) {
3388
+ let { settings: n, updateSettings: r, t: i } = Q(), o = i.emailHeader, s = a();
3389
+ return /* @__PURE__ */ L("div", {
3390
+ className: R("bree-email-header", e),
3391
+ style: t,
3392
+ children: [/* @__PURE__ */ L("div", {
3393
+ className: "bree-email-header-row",
3394
+ children: [/* @__PURE__ */ I("label", {
3395
+ htmlFor: `${s}-subject`,
3396
+ children: o.subject
3397
+ }), /* @__PURE__ */ I("input", {
3398
+ id: `${s}-subject`,
3399
+ className: "bree-email-header-subject",
3400
+ value: n.subject ?? "",
3401
+ placeholder: o.subjectPlaceholder,
3402
+ onChange: (e) => r({ subject: e.target.value })
3403
+ })]
3404
+ }), /* @__PURE__ */ L("div", {
3405
+ className: "bree-email-header-row",
3406
+ children: [/* @__PURE__ */ I("label", {
3407
+ htmlFor: `${s}-preview`,
3408
+ children: o.previewText
3409
+ }), /* @__PURE__ */ I("input", {
3410
+ id: `${s}-preview`,
3411
+ value: n.previewText,
3412
+ placeholder: o.previewTextPlaceholder,
3413
+ onChange: (e) => r({ previewText: e.target.value })
3414
+ })]
3415
+ })]
3416
+ });
3417
+ }
3418
+ //#endregion
3253
3419
  //#region src/components/Canvas.tsx
3254
- function ar({ overlay: e = !0, bubbleMenu: t = !0, slashCommands: n = !0, className: r, style: i, children: a }) {
3255
- let { editor: o, device: c, t: u } = Q(), [d, p] = l(null), m = s(() => Array.isArray(n) ? n : ke.map((e) => ({
3420
+ function vr(e, t, n) {
3421
+ let [r, a] = u(null);
3422
+ return i(() => {
3423
+ if (!t || !n) return;
3424
+ let r = 0, i = null, o = () => {
3425
+ t.style.setProperty("--bree-email-header-height", `${n.offsetHeight}px`);
3426
+ let r = e.view.dom.querySelector(":scope > .node-container");
3427
+ if (r !== i && (i && c.unobserve(i), r && c.observe(r), i = r), !(r instanceof HTMLElement)) {
3428
+ a(null);
3429
+ return;
3430
+ }
3431
+ let o = t.getBoundingClientRect(), s = r.getBoundingClientRect(), l = {
3432
+ top: s.top - o.top + t.scrollTop - n.offsetHeight,
3433
+ left: s.left - o.left + t.scrollLeft,
3434
+ width: s.width,
3435
+ radius: getComputedStyle(r).borderBottomLeftRadius
3436
+ };
3437
+ a((e) => e && e.top === l.top && e.left === l.left && e.width === l.width && e.radius === l.radius ? e : l);
3438
+ }, s = () => {
3439
+ cancelAnimationFrame(r), r = requestAnimationFrame(o);
3440
+ }, c = new ResizeObserver(s);
3441
+ return c.observe(t), c.observe(n), o(), e.on("update", s), () => {
3442
+ cancelAnimationFrame(r), c.disconnect(), e.off("update", s), t.style.removeProperty("--bree-email-header-height");
3443
+ };
3444
+ }, [
3445
+ e,
3446
+ t,
3447
+ n
3448
+ ]), n ? r : null;
3449
+ }
3450
+ function yr({ overlay: e = !0, bubbleMenu: t = !0, slashCommands: n = !0, header: r = !1, className: i, style: a, children: o }) {
3451
+ let { editor: s, device: l, t: d } = Q(), [f, m] = u(null), [h, g] = u(null), _ = vr(s, f, r ? h : null), v = c(() => Array.isArray(n) ? n : Ne.map((e) => ({
3256
3452
  ...e,
3257
- ...u.slashCommands[e.title]
3258
- })), [n, u]);
3453
+ ...d.slashCommands[e.title]
3454
+ })), [n, d]);
3259
3455
  return /* @__PURE__ */ L("div", {
3260
- ref: p,
3261
- className: R("bree-canvas", r),
3262
- style: i,
3263
- "data-device": c,
3456
+ ref: m,
3457
+ className: R("bree-canvas", i),
3458
+ style: a,
3459
+ "data-device": l,
3460
+ "data-email-header": r || void 0,
3264
3461
  children: [
3265
- /* @__PURE__ */ I(f, {
3266
- editor: o,
3462
+ r && /* @__PURE__ */ I("div", {
3463
+ ref: g,
3464
+ className: "bree-canvas-header",
3465
+ "data-placed": _ ? "" : void 0,
3466
+ style: _ ? {
3467
+ position: "absolute",
3468
+ top: _.top,
3469
+ left: _.left,
3470
+ width: _.width,
3471
+ "--bree-email-header-radius": _.radius
3472
+ } : void 0,
3473
+ children: /* @__PURE__ */ I(_r, {})
3474
+ }),
3475
+ /* @__PURE__ */ I(p, {
3476
+ editor: s,
3267
3477
  className: "bree-canvas-content"
3268
3478
  }),
3269
- t && /* @__PURE__ */ L(F, { children: [
3270
- /* @__PURE__ */ I(se, {
3479
+ t && /* @__PURE__ */ L(Pe, { children: [
3480
+ /* @__PURE__ */ I(ue, {
3271
3481
  hideWhenActiveNodes: ["button", "horizontalRule"],
3272
3482
  hideWhenActiveMarks: ["link"]
3273
3483
  }),
3274
- /* @__PURE__ */ I(se.LinkDefault, {}),
3275
- /* @__PURE__ */ I(se.ButtonDefault, {}),
3276
- /* @__PURE__ */ I(se.ImageDefault, {})
3484
+ /* @__PURE__ */ I(ue.LinkDefault, {}),
3485
+ /* @__PURE__ */ I(ue.ButtonDefault, {}),
3486
+ /* @__PURE__ */ I(ue.ImageDefault, {})
3277
3487
  ] }),
3278
- n !== !1 && /* @__PURE__ */ I(Se, { items: m }),
3279
- e && d && /* @__PURE__ */ I(rr, {
3280
- editor: o,
3281
- host: d
3488
+ n !== !1 && /* @__PURE__ */ I(Te, { items: v }),
3489
+ e && f && /* @__PURE__ */ I(hr, {
3490
+ editor: s,
3491
+ host: f
3282
3492
  }),
3283
- a
3493
+ o
3284
3494
  ]
3285
3495
  });
3286
3496
  }
3287
3497
  //#endregion
3288
3498
  //#region src/core/layers.ts
3289
- function or(e, t) {
3499
+ function br(e, t) {
3290
3500
  let n = e.child(t);
3291
- return t === e.childCount - 1 && e.childCount > 1 && Ke(n) && e.child(t - 1).type.name !== "paragraph";
3501
+ return t === e.childCount - 1 && e.childCount > 1 && Ze(n) && e.child(t - 1).type.name !== "paragraph";
3292
3502
  }
3293
- function sr(e, t, n, r) {
3503
+ function xr(e, t, n, r) {
3294
3504
  let i = [];
3295
3505
  return e.forEach((a, o, s) => {
3296
- if (or(e, s)) return;
3297
- let c = t + 1 + o, l = a.type.name, u = `${r}${s}`, d = Ve.has(l), f = d && a.childCount === 1 && Ke(a.firstChild), p = d || He.has(l);
3506
+ if (br(e, s)) return;
3507
+ let c = t + 1 + o, l = a.type.name, u = `${r}${s}`, d = Ke.has(l), f = d && a.childCount === 1 && Ze(a.firstChild), p = d || qe.has(l);
3298
3508
  i.push({
3299
3509
  key: u,
3300
3510
  pos: c,
3301
3511
  node: a,
3302
3512
  depth: n,
3303
3513
  index: s + 1,
3304
- children: p && !f ? sr(a, c, n + 1, `${u}.`) : [],
3514
+ children: p && !f ? xr(a, c, n + 1, `${u}.`) : [],
3305
3515
  accepts: d,
3306
3516
  fixed: l === "columnsColumn",
3307
3517
  empty: f
3308
3518
  });
3309
3519
  }), i;
3310
3520
  }
3311
- function cr(e) {
3312
- let t = qe(e);
3313
- return t ? sr(t.node, t.pos, 0, "") : [];
3521
+ function Sr(e) {
3522
+ let t = Qe(e);
3523
+ return t ? xr(t.node, t.pos, 0, "") : [];
3314
3524
  }
3315
- function lr(e, t) {
3525
+ function Cr(e, t) {
3316
3526
  return e.fixed ? "inside" : e.accepts ? t < .25 ? "before" : t > .75 ? "after" : "inside" : t < .5 ? "before" : "after";
3317
3527
  }
3318
- function ur(e, t, n, r, i) {
3528
+ function wr(e, t, n, r, i) {
3319
3529
  let a, o;
3320
3530
  if (n === "inside") {
3321
3531
  if (!t.accepts) return null;
@@ -3333,26 +3543,26 @@ function ur(e, t, n, r, i) {
3333
3543
  }
3334
3544
  //#endregion
3335
3545
  //#region src/components/LayersPanel.tsx
3336
- function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r, style: a }) {
3337
- let { editor: o, t: d, locale: f, nodes: p, nodeLabel: m, dragSession: g, hoverStore: _ } = Q(), v = (e) => e.node.type.name === "columnsColumn" ? d.layers.column(e.index) : m(e.node.type.name), y = (e) => (p.get(e.node.type.name)?.preview ?? wn)(e.node, {
3546
+ function Tr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r, style: a }) {
3547
+ let { editor: o, t: s, locale: f, nodes: p, nodeLabel: m, dragSession: h, hoverStore: _ } = Q(), v = (e) => e.node.type.name === "columnsColumn" ? s.layers.column(e.index) : m(e.node.type.name), y = (e) => (p.get(e.node.type.name)?.preview ?? Fn)(e.node, {
3338
3548
  locale: f,
3339
- t: d
3340
- }), b = h({
3549
+ t: s
3550
+ }), b = g({
3341
3551
  editor: o,
3342
3552
  selector: ({ editor: e }) => e?.state.doc ?? null,
3343
3553
  equalityFn: (e, t) => e === t
3344
- }), x = h({
3554
+ }), x = g({
3345
3555
  editor: o,
3346
- selector: ({ editor: e }) => e?.isFocused ? rt(e)?.pos ?? null : null
3347
- }), S = u(_.subscribe, _.get), C = s(() => b ? cr(b) : [], [b]), [w, T] = l(() => /* @__PURE__ */ new Set()), [E, D] = l(null), O = c(null);
3556
+ selector: ({ editor: e }) => e?.isFocused ? ct(e)?.pos ?? null : null
3557
+ }), S = d(_.subscribe, _.get), C = c(() => b ? Sr(b) : [], [b]), [w, T] = u(() => /* @__PURE__ */ new Set()), [E, D] = u(null), O = l(null);
3348
3558
  i(() => {
3349
3559
  x !== null && O.current?.querySelector("[aria-selected=\"true\"]")?.scrollIntoView({ block: "nearest" });
3350
3560
  }, [x]);
3351
- let ee = (e) => T((t) => {
3561
+ let k = (e) => T((t) => {
3352
3562
  let n = new Set(t);
3353
3563
  return n.has(e) ? n.delete(e) : n.add(e), n;
3354
- }), k = (e) => {
3355
- it(o, {
3564
+ }), A = (e) => {
3565
+ lt(o, {
3356
3566
  pos: e.pos,
3357
3567
  node: e.node
3358
3568
  });
@@ -3361,24 +3571,24 @@ function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
3361
3571
  block: "nearest",
3362
3572
  behavior: "smooth"
3363
3573
  });
3364
- }, te = (e, t) => {
3365
- let n = g.get();
3574
+ }, j = (e, t) => {
3575
+ let n = h.get();
3366
3576
  if (!n) return null;
3367
- let r = Ye(o.view, n);
3577
+ let r = et(o.view, n);
3368
3578
  if (!r) return null;
3369
- let i = e.currentTarget.getBoundingClientRect(), a = lr(t, (e.clientY - i.top) / i.height), s = n.kind === "move" ? o.state.doc.nodeAt(n.pos) : null, c = n.kind === "move" && s ? {
3579
+ let i = e.currentTarget.getBoundingClientRect(), a = Cr(t, (e.clientY - i.top) / i.height), s = n.kind === "move" ? o.state.doc.nodeAt(n.pos) : null, c = n.kind === "move" && s ? {
3370
3580
  from: n.pos,
3371
3581
  to: n.pos + s.nodeSize
3372
- } : void 0, l = ur(o.state.doc, t, a, r, c);
3582
+ } : void 0, l = wr(o.state.doc, t, a, r, c);
3373
3583
  return l ? {
3374
3584
  zone: a,
3375
3585
  target: l,
3376
3586
  payload: n
3377
3587
  } : null;
3378
- }, ne = () => {
3379
- g.end(), D(null);
3380
- }, re = (e) => e.map((e) => {
3381
- let t = p.get(e.node.type.name)?.icon ?? me, n = e.children.length > 0, r = w.has(e.key), i = y(e), a = E?.key === e.key ? E.zone : null;
3588
+ }, ee = () => {
3589
+ h.end(), D(null);
3590
+ }, te = (e) => e.map((e) => {
3591
+ let t = p.get(e.node.type.name)?.icon ?? ve, n = e.children.length > 0, r = w.has(e.key), i = y(e), a = E?.key === e.key ? E.zone : null;
3382
3592
  return /* @__PURE__ */ L("div", {
3383
3593
  role: "none",
3384
3594
  children: [
@@ -3391,11 +3601,11 @@ function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
3391
3601
  className: R("bree-layer", x === e.pos && "bree-selected", S === e.pos && "bree-hovered", a && `bree-drop-${a}`, e.fixed && "bree-fixed"),
3392
3602
  style: { paddingLeft: 6 + e.depth * 16 },
3393
3603
  draggable: !e.fixed,
3394
- title: e.fixed ? d.layers.fixedHint : d.layers.itemHint,
3395
- onClick: () => k(e),
3604
+ title: e.fixed ? s.layers.fixedHint : s.layers.itemHint,
3605
+ onClick: () => A(e),
3396
3606
  onKeyDown: (t) => {
3397
- if (t.key === "Enter" || t.key === " ") t.preventDefault(), k(e);
3398
- else if (t.key === "ArrowLeft" && n && !r || t.key === "ArrowRight" && r) ee(e.key);
3607
+ if (t.key === "Enter" || t.key === " ") t.preventDefault(), A(e);
3608
+ else if (t.key === "ArrowLeft" && n && !r || t.key === "ArrowRight" && r) k(e.key);
3399
3609
  else if (t.key === "ArrowDown" || t.key === "ArrowUp") {
3400
3610
  t.preventDefault();
3401
3611
  let e = [...O.current?.querySelectorAll("[role=\"treeitem\"]") ?? []];
@@ -3405,15 +3615,15 @@ function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
3405
3615
  onMouseEnter: () => _.set(e.pos),
3406
3616
  onMouseLeave: () => _.set(null),
3407
3617
  onDragStart: (t) => {
3408
- t.stopPropagation(), g.start({
3618
+ t.stopPropagation(), h.start({
3409
3619
  kind: "move",
3410
3620
  pos: e.pos,
3411
3621
  label: v(e)
3412
- }), t.dataTransfer.setData(Ue, "move"), t.dataTransfer.effectAllowed = "move";
3622
+ }), t.dataTransfer.setData(Je, "move"), t.dataTransfer.effectAllowed = "move";
3413
3623
  },
3414
- onDragEnd: ne,
3624
+ onDragEnd: ee,
3415
3625
  onDragOver: (t) => {
3416
- let n = te(t, e);
3626
+ let n = j(t, e);
3417
3627
  if (!n) {
3418
3628
  E?.key === e.key && D(null);
3419
3629
  return;
@@ -3424,17 +3634,17 @@ function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
3424
3634
  });
3425
3635
  },
3426
3636
  onDrop: (t) => {
3427
- let n = te(t, e);
3428
- t.preventDefault(), n && $e(o, n.payload, n.target), ne();
3637
+ let n = j(t, e);
3638
+ t.preventDefault(), n && it(o, n.payload, n.target), ee();
3429
3639
  },
3430
3640
  children: [
3431
3641
  n ? /* @__PURE__ */ I("button", {
3432
3642
  type: "button",
3433
3643
  className: R("bree-layer-caret", !r && "bree-open"),
3434
- "aria-label": r ? d.layers.expand : d.layers.collapse,
3644
+ "aria-label": r ? s.layers.expand : s.layers.collapse,
3435
3645
  tabIndex: -1,
3436
3646
  onClick: (t) => {
3437
- t.stopPropagation(), ee(e.key);
3647
+ t.stopPropagation(), k(e.key);
3438
3648
  },
3439
3649
  children: "›"
3440
3650
  }) : /* @__PURE__ */ I("span", { className: "bree-layer-caret-spacer" }),
@@ -3455,35 +3665,35 @@ function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
3455
3665
  e.empty && /* @__PURE__ */ I("div", {
3456
3666
  className: "bree-layer-empty",
3457
3667
  style: { paddingLeft: 6 + (e.depth + 1) * 16 + 18 },
3458
- children: d.layers.emptyZone
3668
+ children: s.layers.emptyZone
3459
3669
  }),
3460
3670
  n && !r && /* @__PURE__ */ I("div", {
3461
3671
  role: "group",
3462
- children: re(e.children)
3672
+ children: te(e.children)
3463
3673
  })
3464
3674
  ]
3465
3675
  }, e.key);
3466
3676
  });
3467
- return /* @__PURE__ */ I(j, { children: /* @__PURE__ */ L("aside", {
3677
+ return /* @__PURE__ */ I(M, { children: /* @__PURE__ */ L("aside", {
3468
3678
  className: R("bree-layers", r),
3469
3679
  style: a,
3470
- "aria-label": t ?? d.layers.title,
3680
+ "aria-label": t ?? s.layers.title,
3471
3681
  tabIndex: -1,
3472
3682
  onDragLeave: (e) => !e.currentTarget.contains(e.relatedTarget) && D(null),
3473
3683
  children: [/* @__PURE__ */ L("header", {
3474
3684
  className: "bree-layers-header",
3475
- children: [/* @__PURE__ */ I("h2", { children: t ?? d.layers.title }), /* @__PURE__ */ L("div", {
3685
+ children: [/* @__PURE__ */ I("h2", { children: t ?? s.layers.title }), /* @__PURE__ */ L("div", {
3476
3686
  className: "bree-layers-actions",
3477
- children: [n && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("button", {
3687
+ children: [n && /* @__PURE__ */ L(Pe, { children: [/* @__PURE__ */ I("button", {
3478
3688
  type: "button",
3479
3689
  className: "bree-icon-button bree-small",
3480
- title: d.layers.expandAll,
3690
+ title: s.layers.expandAll,
3481
3691
  onClick: () => T(/* @__PURE__ */ new Set()),
3482
3692
  children: "⊞"
3483
3693
  }), /* @__PURE__ */ I("button", {
3484
3694
  type: "button",
3485
3695
  className: "bree-icon-button bree-small",
3486
- title: d.layers.collapseAll,
3696
+ title: s.layers.collapseAll,
3487
3697
  onClick: () => {
3488
3698
  let e = /* @__PURE__ */ new Set(), t = (n) => n.forEach((n) => {
3489
3699
  n.children.length && e.add(n.key), t(n.children);
@@ -3494,51 +3704,51 @@ function dr({ onClose: e, title: t, expandCollapseButtons: n = !0, className: r,
3494
3704
  })] }), e && /* @__PURE__ */ I("button", {
3495
3705
  type: "button",
3496
3706
  className: "bree-icon-button bree-small",
3497
- title: d.layers.close,
3707
+ title: s.layers.close,
3498
3708
  onClick: e,
3499
- children: /* @__PURE__ */ I(Oe, { size: 14 })
3709
+ children: /* @__PURE__ */ I(Me, { size: 14 })
3500
3710
  })]
3501
3711
  })]
3502
3712
  }), /* @__PURE__ */ I("div", {
3503
3713
  className: "bree-layers-list",
3504
3714
  role: "tree",
3505
- "aria-label": d.layers.tree,
3715
+ "aria-label": s.layers.tree,
3506
3716
  ref: O,
3507
- children: C.length ? re(C) : /* @__PURE__ */ I("p", {
3717
+ children: C.length ? te(C) : /* @__PURE__ */ I("p", {
3508
3718
  className: "bree-hint",
3509
- children: d.layers.emptyEmail
3719
+ children: s.layers.emptyEmail
3510
3720
  })
3511
3721
  })]
3512
3722
  }) });
3513
3723
  }
3514
3724
  //#endregion
3515
3725
  //#region src/components/inspectors/DefaultInspector.tsx
3516
- function fr({ ctx: e, className: t, style: n }) {
3726
+ function Er({ ctx: e, className: t, style: n }) {
3517
3727
  return /* @__PURE__ */ L("div", {
3518
3728
  className: R("bree-inspector", t),
3519
3729
  style: n,
3520
3730
  children: [
3521
- /* @__PURE__ */ I(tn, {
3731
+ /* @__PURE__ */ I(mn, {
3522
3732
  ctx: e,
3523
3733
  alignment: String(e.getAttr("alignment") ?? "left"),
3524
3734
  setAlignment: (t) => e.setAttr("alignment", t)
3525
3735
  }),
3526
- /* @__PURE__ */ I(nn, { ctx: e }),
3527
- /* @__PURE__ */ I(rn, { ctx: e })
3736
+ /* @__PURE__ */ I(q, { ctx: e }),
3737
+ /* @__PURE__ */ I(hn, { ctx: e })
3528
3738
  ]
3529
3739
  });
3530
3740
  }
3531
3741
  //#endregion
3532
3742
  //#region src/components/PropertiesPanel.tsx
3533
- function pr() {
3743
+ function Dr() {
3534
3744
  let { editor: e } = Q();
3535
3745
  return () => {
3536
3746
  let t = document.activeElement;
3537
3747
  t instanceof HTMLElement && t.blur(), e.commands.blur();
3538
3748
  };
3539
3749
  }
3540
- function mr({ title: e, children: t, breadcrumb: n = !0, className: r, style: i }) {
3541
- let { t: a, nodeLabel: o } = Q(), s = pr();
3750
+ function Or({ title: e, children: t, breadcrumb: n = !0, className: r, style: i }) {
3751
+ let { t: a, nodeLabel: o } = Q(), s = Dr();
3542
3752
  return /* @__PURE__ */ L("div", {
3543
3753
  className: R("bree-properties", r),
3544
3754
  style: i,
@@ -3553,10 +3763,10 @@ function mr({ title: e, children: t, breadcrumb: n = !0, className: r, style: i
3553
3763
  className: "bree-icon-button",
3554
3764
  title: a.sidebar.closeProperties,
3555
3765
  onClick: s,
3556
- children: /* @__PURE__ */ I(Oe, { size: 16 })
3766
+ children: /* @__PURE__ */ I(Me, { size: 16 })
3557
3767
  })]
3558
3768
  }),
3559
- n && /* @__PURE__ */ I(M.Breadcrumb, { children: (e) => e.length > 1 && /* @__PURE__ */ I("nav", {
3769
+ n && /* @__PURE__ */ I(N.Breadcrumb, { children: (e) => e.length > 1 && /* @__PURE__ */ I("nav", {
3560
3770
  className: "bree-breadcrumb",
3561
3771
  "aria-label": a.sidebar.breadcrumb,
3562
3772
  children: e.map((t, n) => /* @__PURE__ */ L("span", {
@@ -3581,9 +3791,9 @@ function mr({ title: e, children: t, breadcrumb: n = !0, className: r, style: i
3581
3791
  }
3582
3792
  //#endregion
3583
3793
  //#region src/components/BlockProperties.tsx
3584
- function hr({ ctx: e, className: t, style: n }) {
3585
- let { nodes: r, nodeLabel: i } = Q(), a = r.get(e.nodeType)?.inspector ?? fr;
3586
- return /* @__PURE__ */ I(mr, {
3794
+ function kr({ ctx: e, className: t, style: n }) {
3795
+ let { nodes: r, nodeLabel: i } = Q(), a = r.get(e.nodeType)?.inspector ?? Er;
3796
+ return /* @__PURE__ */ I(Or, {
3587
3797
  title: i(e.nodeType),
3588
3798
  className: t,
3589
3799
  style: n,
@@ -3592,7 +3802,7 @@ function hr({ ctx: e, className: t, style: n }) {
3592
3802
  }
3593
3803
  //#endregion
3594
3804
  //#region src/components/useDraggableBlock.ts
3595
- function gr(e, t) {
3805
+ function Ar(e, t) {
3596
3806
  let { editor: n, dragSession: r } = Q();
3597
3807
  return {
3598
3808
  draggable: !0,
@@ -3601,16 +3811,16 @@ function gr(e, t) {
3601
3811
  kind: "new",
3602
3812
  label: e,
3603
3813
  content: t
3604
- }), n.dataTransfer.setData(Ue, e), n.dataTransfer.effectAllowed = "copy";
3814
+ }), n.dataTransfer.setData(Je, e), n.dataTransfer.effectAllowed = "copy";
3605
3815
  },
3606
3816
  onDragEnd: () => r.end(),
3607
- onClick: () => st(n, t())
3817
+ onClick: () => ft(n, t())
3608
3818
  };
3609
3819
  }
3610
3820
  //#endregion
3611
3821
  //#region src/components/BlocksTab.tsx
3612
- function _r({ template: e, className: t, style: n }) {
3613
- let r = Gn(), i = Et(e.label, r), a = gr(i, () => e.content(r));
3822
+ function jr({ template: e, className: t, style: n }) {
3823
+ let r = rr(), i = Lt(e.label, r), a = Ar(i, () => e.content(r));
3614
3824
  return /* @__PURE__ */ L("button", {
3615
3825
  type: "button",
3616
3826
  className: R("bree-block-card", t),
@@ -3618,107 +3828,143 @@ function _r({ template: e, className: t, style: n }) {
3618
3828
  ...a,
3619
3829
  children: [e.thumbnail ?? /* @__PURE__ */ I(Z, { variant: "default" }), /* @__PURE__ */ L("span", {
3620
3830
  className: "bree-block-text",
3621
- children: [/* @__PURE__ */ I("strong", { children: i }), e.description && /* @__PURE__ */ I("span", { children: Et(e.description, r) })]
3831
+ children: [/* @__PURE__ */ I("strong", { children: i }), e.description && /* @__PURE__ */ I("span", { children: Lt(e.description, r) })]
3622
3832
  })]
3623
3833
  });
3624
3834
  }
3625
- function vr({ templates: e, className: t, style: n }) {
3835
+ function Mr({ templates: e, className: t, style: n }) {
3626
3836
  let r = Q();
3627
3837
  return /* @__PURE__ */ I("div", {
3628
3838
  className: R("bree-block-list", t),
3629
3839
  style: n,
3630
- children: (e ?? r.templates).map((e) => /* @__PURE__ */ I(_r, { template: e }, e.id))
3840
+ children: (e ?? r.templates).map((e) => /* @__PURE__ */ I(jr, { template: e }, e.id))
3841
+ });
3842
+ }
3843
+ //#endregion
3844
+ //#region src/core/email-font.ts
3845
+ var Nr = ["body", "blockquote"];
3846
+ function Pr(e) {
3847
+ let { styles: t } = C(e), n = t.flatMap((e) => e.inputs).find((e) => e.prop === "fontFamily" && e.classReference === "body");
3848
+ return String(n?.value ?? "");
3849
+ }
3850
+ function Fr(e, t) {
3851
+ let { styles: n } = C(e), r = (e) => e.prop === "fontFamily" && Nr.includes(e.classReference ?? ""), i = Math.max(0, n.findIndex((e) => e.id === "body")), a = n.map((e, n) => {
3852
+ let a = e.inputs.filter((e) => !r(e));
3853
+ if (n !== i || !t) return {
3854
+ ...e,
3855
+ inputs: a
3856
+ };
3857
+ let o = Nr.map((e) => ({
3858
+ label: "Font",
3859
+ type: "text",
3860
+ prop: "fontFamily",
3861
+ classReference: e,
3862
+ value: t
3863
+ }));
3864
+ return {
3865
+ ...e,
3866
+ inputs: [...a, ...o]
3867
+ };
3631
3868
  });
3869
+ w(e, a);
3632
3870
  }
3633
3871
  //#endregion
3634
3872
  //#region src/components/BodyTab.tsx
3635
- function yr({ ctx: e, className: t, style: n }) {
3636
- let { settings: r, updateSettings: i, t: a } = Q(), o = a.body, { findStyleValue: s, setGlobalStyle: c } = e;
3873
+ function Ir({ ctx: e, className: t, style: n }) {
3874
+ let { editor: r, settings: i, updateSettings: a, t: o } = Q(), s = o.body, { findStyleValue: c, setGlobalStyle: l } = e;
3637
3875
  return /* @__PURE__ */ L("div", {
3638
3876
  className: R("bree-body-tab", t),
3639
3877
  style: n,
3640
3878
  children: [
3641
3879
  /* @__PURE__ */ I(V, {
3642
- title: o.general,
3880
+ title: s.general,
3643
3881
  children: /* @__PURE__ */ I(H, {
3644
- label: o.previewText,
3882
+ label: s.previewText,
3645
3883
  stacked: !0,
3646
3884
  children: /* @__PURE__ */ I(U, {
3647
- value: r.previewText,
3648
- onChange: (e) => i({ previewText: e }),
3649
- placeholder: o.previewTextPlaceholder
3885
+ value: i.previewText,
3886
+ onChange: (e) => a({ previewText: e }),
3887
+ placeholder: s.previewTextPlaceholder
3650
3888
  })
3651
3889
  })
3652
3890
  }),
3653
3891
  /* @__PURE__ */ L(V, {
3654
- title: o.background,
3892
+ title: s.background,
3655
3893
  children: [/* @__PURE__ */ I(H, {
3656
- label: o.backgroundColor,
3894
+ label: s.backgroundColor,
3657
3895
  stacked: !0,
3658
3896
  children: /* @__PURE__ */ I(G, {
3659
- value: s("body", "backgroundColor"),
3660
- onChange: (e) => c("body", "backgroundColor", e)
3897
+ value: c("body", "backgroundColor"),
3898
+ onChange: (e) => l("body", "backgroundColor", e)
3661
3899
  })
3662
3900
  }), /* @__PURE__ */ I(H, {
3663
- label: o.outerPadding,
3901
+ label: s.outerPadding,
3664
3902
  children: /* @__PURE__ */ I(W, {
3665
- value: s("body", "padding"),
3666
- onChange: (e) => c("body", "padding", e)
3903
+ value: c("body", "padding"),
3904
+ onChange: (e) => l("body", "padding", e)
3667
3905
  })
3668
3906
  })]
3669
3907
  }),
3670
3908
  /* @__PURE__ */ L(V, {
3671
- title: o.content,
3909
+ title: s.content,
3672
3910
  children: [
3673
3911
  /* @__PURE__ */ I(H, {
3674
- label: o.width,
3912
+ label: s.width,
3675
3913
  children: /* @__PURE__ */ I(W, {
3676
- value: s("container", "width"),
3677
- onChange: (e) => c("container", "width", e),
3914
+ value: c("container", "width"),
3915
+ onChange: (e) => l("container", "width", e),
3678
3916
  min: 320,
3679
3917
  max: 900
3680
3918
  })
3681
3919
  }),
3682
3920
  /* @__PURE__ */ I(H, {
3683
- label: o.contentColor,
3921
+ label: s.contentColor,
3684
3922
  stacked: !0,
3685
3923
  children: /* @__PURE__ */ I(G, {
3686
- value: s("container", "backgroundColor"),
3687
- onChange: (e) => c("container", "backgroundColor", e)
3924
+ value: c("container", "backgroundColor"),
3925
+ onChange: (e) => l("container", "backgroundColor", e)
3688
3926
  })
3689
3927
  }),
3690
3928
  /* @__PURE__ */ I(H, {
3691
- label: o.innerPadding,
3929
+ label: s.innerPadding,
3692
3930
  children: /* @__PURE__ */ I(W, {
3693
- value: s("container", "padding"),
3694
- onChange: (e) => c("container", "padding", e)
3931
+ value: c("container", "padding"),
3932
+ onChange: (e) => l("container", "padding", e)
3695
3933
  })
3696
3934
  }),
3697
3935
  /* @__PURE__ */ I(H, {
3698
- label: o.radius,
3936
+ label: s.radius,
3699
3937
  children: /* @__PURE__ */ I(W, {
3700
- value: s("container", "borderRadius"),
3701
- onChange: (e) => c("container", "borderRadius", e)
3938
+ value: c("container", "borderRadius"),
3939
+ onChange: (e) => l("container", "borderRadius", e)
3702
3940
  })
3703
3941
  })
3704
3942
  ]
3705
3943
  }),
3706
3944
  /* @__PURE__ */ L(V, {
3707
- title: o.defaultStyles,
3945
+ title: s.defaultStyles,
3708
3946
  children: [
3709
3947
  /* @__PURE__ */ I(H, {
3710
- label: o.text,
3948
+ label: s.font,
3949
+ children: /* @__PURE__ */ I(un, {
3950
+ value: Pr(r),
3951
+ emptyLabel: s.fontDefault,
3952
+ onChange: (e) => Fr(r, e)
3953
+ })
3954
+ }),
3955
+ /* @__PURE__ */ I(H, {
3956
+ label: s.text,
3711
3957
  stacked: !0,
3712
3958
  children: /* @__PURE__ */ I(G, {
3713
- value: s("paragraph", "color"),
3714
- onChange: (e) => c("paragraph", "color", e)
3959
+ value: c("paragraph", "color"),
3960
+ onChange: (e) => l("paragraph", "color", e)
3715
3961
  })
3716
3962
  }),
3717
3963
  /* @__PURE__ */ I(H, {
3718
- label: o.headings,
3964
+ label: s.headings,
3719
3965
  stacked: !0,
3720
3966
  children: /* @__PURE__ */ I(G, {
3721
- value: s("h1", "color"),
3967
+ value: c("h1", "color"),
3722
3968
  onChange: (t) => e.batchSetGlobalStyle([
3723
3969
  "h1",
3724
3970
  "h2",
@@ -3731,27 +3977,27 @@ function yr({ ctx: e, className: t, style: n }) {
3731
3977
  })
3732
3978
  }),
3733
3979
  /* @__PURE__ */ I(H, {
3734
- label: o.links,
3980
+ label: s.links,
3735
3981
  stacked: !0,
3736
3982
  children: /* @__PURE__ */ I(G, {
3737
- value: s("link", "color"),
3738
- onChange: (e) => c("link", "color", e)
3983
+ value: c("link", "color"),
3984
+ onChange: (e) => l("link", "color", e)
3739
3985
  })
3740
3986
  }),
3741
3987
  /* @__PURE__ */ I(H, {
3742
- label: o.buttonBackground,
3988
+ label: s.buttonBackground,
3743
3989
  stacked: !0,
3744
3990
  children: /* @__PURE__ */ I(G, {
3745
- value: s("button", "backgroundColor"),
3746
- onChange: (e) => c("button", "backgroundColor", e)
3991
+ value: c("button", "backgroundColor"),
3992
+ onChange: (e) => l("button", "backgroundColor", e)
3747
3993
  })
3748
3994
  }),
3749
3995
  /* @__PURE__ */ I(H, {
3750
- label: o.buttonText,
3996
+ label: s.buttonText,
3751
3997
  stacked: !0,
3752
3998
  children: /* @__PURE__ */ I(G, {
3753
- value: s("button", "color"),
3754
- onChange: (e) => c("button", "color", e)
3999
+ value: c("button", "color"),
4000
+ onChange: (e) => l("button", "color", e)
3755
4001
  })
3756
4002
  })
3757
4003
  ]
@@ -3761,8 +4007,8 @@ function yr({ ctx: e, className: t, style: n }) {
3761
4007
  }
3762
4008
  //#endregion
3763
4009
  //#region src/components/ContentTab.tsx
3764
- function br({ item: e, className: t, style: n }) {
3765
- let r = Gn(), i = Et(e.label, r), a = gr(i, () => e.content(r));
4010
+ function Lr({ item: e, className: t, style: n }) {
4011
+ let r = rr(), i = Lt(e.label, r), a = Ar(i, () => e.content(r));
3766
4012
  return /* @__PURE__ */ L("button", {
3767
4013
  type: "button",
3768
4014
  className: R("bree-tile", t),
@@ -3778,7 +4024,7 @@ function br({ item: e, className: t, style: n }) {
3778
4024
  })]
3779
4025
  });
3780
4026
  }
3781
- function xr({ items: e, groups: t, hint: n, className: r, style: i }) {
4027
+ function Rr({ items: e, groups: t, hint: n, className: r, style: i }) {
3782
4028
  let a = Q(), o = e ?? a.palette, s = t ?? a.paletteGroups, c = [...s, ...[...new Set(o.map((e) => e.group))].filter((e) => !s.some((t) => t.id === e)).map((e) => ({
3783
4029
  id: e,
3784
4030
  title: e
@@ -3790,10 +4036,10 @@ function xr({ items: e, groups: t, hint: n, className: r, style: i }) {
3790
4036
  let t = o.filter((t) => t.group === e.id);
3791
4037
  return t.length ? /* @__PURE__ */ L("section", { children: [/* @__PURE__ */ I("h3", {
3792
4038
  className: "bree-panel-title",
3793
- children: Et(e.title, a)
4039
+ children: Lt(e.title, a)
3794
4040
  }), /* @__PURE__ */ I("div", {
3795
4041
  className: "bree-tiles",
3796
- children: t.map((e) => /* @__PURE__ */ I(br, { item: e }, e.id))
4042
+ children: t.map((e) => /* @__PURE__ */ I(Lr, { item: e }, e.id))
3797
4043
  })] }, e.id) : null;
3798
4044
  }), n !== null && /* @__PURE__ */ I("p", {
3799
4045
  className: "bree-hint",
@@ -3803,7 +4049,7 @@ function xr({ items: e, groups: t, hint: n, className: r, style: i }) {
3803
4049
  }
3804
4050
  //#endregion
3805
4051
  //#region src/components/ContentPanel.tsx
3806
- function Sr({ ctx: e, tabs: t = [
4052
+ function zr({ ctx: e, tabs: t = [
3807
4053
  "content",
3808
4054
  "blocks",
3809
4055
  "body"
@@ -3812,19 +4058,19 @@ function Sr({ ctx: e, tabs: t = [
3812
4058
  content: {
3813
4059
  id: "content",
3814
4060
  label: a.sidebar.tabContent,
3815
- render: () => /* @__PURE__ */ I(xr, {})
4061
+ render: () => /* @__PURE__ */ I(Rr, {})
3816
4062
  },
3817
4063
  blocks: {
3818
4064
  id: "blocks",
3819
4065
  label: a.sidebar.tabBlocks,
3820
- render: () => /* @__PURE__ */ I(vr, {})
4066
+ render: () => /* @__PURE__ */ I(Mr, {})
3821
4067
  },
3822
4068
  body: {
3823
4069
  id: "body",
3824
4070
  label: a.sidebar.tabBody,
3825
- render: (e) => /* @__PURE__ */ I(yr, { ctx: e })
4071
+ render: (e) => /* @__PURE__ */ I(Ir, { ctx: e })
3826
4072
  }
3827
- }, s = t.map((e) => typeof e == "string" ? o[e] : e), [c, u] = l(n ?? s[0]?.id), d = s.find((e) => e.id === c) ?? s[0];
4073
+ }, s = t.map((e) => typeof e == "string" ? o[e] : e), [c, l] = u(n ?? s[0]?.id), d = s.find((e) => e.id === c) ?? s[0];
3828
4074
  return /* @__PURE__ */ L("div", {
3829
4075
  className: R("bree-content-panel", r),
3830
4076
  style: i,
@@ -3836,7 +4082,7 @@ function Sr({ ctx: e, tabs: t = [
3836
4082
  role: "tab",
3837
4083
  "aria-selected": e.id === d?.id,
3838
4084
  className: R(e.id === d?.id && "bree-active"),
3839
- onClick: () => u(e.id),
4085
+ onClick: () => l(e.id),
3840
4086
  children: e.label
3841
4087
  }, e.id))
3842
4088
  }), /* @__PURE__ */ I("div", {
@@ -3847,30 +4093,30 @@ function Sr({ ctx: e, tabs: t = [
3847
4093
  }
3848
4094
  //#endregion
3849
4095
  //#region src/components/TextProperties.tsx
3850
- function Cr({ ctx: e, className: t, style: n }) {
4096
+ function Br({ ctx: e, className: t, style: n }) {
3851
4097
  let r = $(), i = r.inspector, a = [
3852
4098
  {
3853
4099
  mark: "bold",
3854
- Icon: oe,
4100
+ Icon: le,
3855
4101
  title: i.bold
3856
4102
  },
3857
4103
  {
3858
4104
  mark: "italic",
3859
- Icon: pe,
4105
+ Icon: _e,
3860
4106
  title: i.italic
3861
4107
  },
3862
4108
  {
3863
4109
  mark: "underline",
3864
- Icon: De,
4110
+ Icon: je,
3865
4111
  title: i.underline
3866
4112
  },
3867
4113
  {
3868
4114
  mark: "strike",
3869
- Icon: P,
4115
+ Icon: De,
3870
4116
  title: i.strike
3871
4117
  }
3872
4118
  ];
3873
- return /* @__PURE__ */ L(mr, {
4119
+ return /* @__PURE__ */ L(Or, {
3874
4120
  title: r.sidebar.selectedText,
3875
4121
  className: t,
3876
4122
  style: n,
@@ -3889,7 +4135,7 @@ function Cr({ ctx: e, className: t, style: n }) {
3889
4135
  }, t))
3890
4136
  })
3891
4137
  }),
3892
- /* @__PURE__ */ I(tn, {
4138
+ /* @__PURE__ */ I(mn, {
3893
4139
  ctx: e,
3894
4140
  alignment: e.alignment,
3895
4141
  setAlignment: e.setAlignment
@@ -3918,32 +4164,32 @@ function Cr({ ctx: e, className: t, style: n }) {
3918
4164
  }
3919
4165
  //#endregion
3920
4166
  //#region src/components/Sidebar.tsx
3921
- function wr({ renderDocument: e = (e) => /* @__PURE__ */ I(Sr, { ctx: e }), renderNode: t = (e) => /* @__PURE__ */ I(hr, { ctx: e }), renderText: n = (e) => /* @__PURE__ */ I(Cr, { ctx: e }), className: r, style: i }) {
4167
+ function Vr({ renderDocument: e = (e) => /* @__PURE__ */ I(zr, { ctx: e }), renderNode: t = (e) => /* @__PURE__ */ I(kr, { ctx: e }), renderText: n = (e) => /* @__PURE__ */ I(Br, { ctx: e }), className: r, style: i }) {
3922
4168
  let { t: a } = Q();
3923
- return /* @__PURE__ */ L(M.Root, {
4169
+ return /* @__PURE__ */ L(N.Root, {
3924
4170
  className: R("bree-sidebar", r),
3925
4171
  style: i,
3926
4172
  "aria-label": a.sidebar.label,
3927
4173
  children: [
3928
- /* @__PURE__ */ I(M.Document, { children: e }),
3929
- /* @__PURE__ */ I(M.Node, { children: t }),
3930
- /* @__PURE__ */ I(M.Text, { children: n })
4174
+ /* @__PURE__ */ I(N.Document, { children: e }),
4175
+ /* @__PURE__ */ I(N.Node, { children: t }),
4176
+ /* @__PURE__ */ I(N.Text, { children: n })
3931
4177
  ]
3932
4178
  });
3933
4179
  }
3934
4180
  //#endregion
3935
4181
  //#region src/components/PreviewDialog.tsx
3936
- function Tr(e, t, n) {
4182
+ function Hr(e, t, n) {
3937
4183
  let r = URL.createObjectURL(new Blob([t], { type: n })), i = document.createElement("a");
3938
4184
  i.href = r, i.download = e, i.click(), URL.revokeObjectURL(r);
3939
4185
  }
3940
- function Er({ onClose: e, defaultView: t = "desktop", views: n = [
4186
+ function Ur({ onClose: e, defaultView: t = "desktop", views: n = [
3941
4187
  "desktop",
3942
4188
  "mobile",
3943
4189
  "html",
3944
4190
  "text"
3945
4191
  ], filename: r = "email.html", className: a, style: o }) {
3946
- let { handle: s, settings: c, t: u } = Q(), [d, f] = l(t), [p, m] = l(null), [h, g] = l(null), [_, v] = l(!1);
4192
+ let { handle: s, settings: c, t: l } = Q(), [d, f] = u(t), [p, m] = u(null), [h, g] = u(null), [_, v] = u(!1);
3947
4193
  i(() => {
3948
4194
  let e = !1;
3949
4195
  return s.exportEmail().then((t) => !e && m(t)).catch((t) => !e && g(t instanceof Error ? t.message : String(t))), () => {
@@ -3955,8 +4201,8 @@ function Er({ onClose: e, defaultView: t = "desktop", views: n = [
3955
4201
  }, [e]);
3956
4202
  let y = async () => {
3957
4203
  p && (await navigator.clipboard.writeText(d === "text" ? p.text : p.html), v(!0), setTimeout(() => v(!1), 1500));
3958
- }, b = u.preview;
3959
- return Re(/* @__PURE__ */ I(j, { children: /* @__PURE__ */ I("div", {
4204
+ }, b = l.preview;
4205
+ return Ue(/* @__PURE__ */ I(M, { children: /* @__PURE__ */ I("div", {
3960
4206
  className: "bree bree-modal-backdrop",
3961
4207
  onMouseDown: (t) => t.target === t.currentTarget && e(),
3962
4208
  children: /* @__PURE__ */ L("div", {
@@ -3990,7 +4236,7 @@ function Er({ onClose: e, defaultView: t = "desktop", views: n = [
3990
4236
  p && /* @__PURE__ */ I("button", {
3991
4237
  type: "button",
3992
4238
  className: "bree-btn bree-primary",
3993
- onClick: () => Tr(r, p.unformattedHtml, "text/html"),
4239
+ onClick: () => Hr(r, p.unformattedHtml, "text/html"),
3994
4240
  children: b.download
3995
4241
  }),
3996
4242
  /* @__PURE__ */ I("button", {
@@ -3998,7 +4244,7 @@ function Er({ onClose: e, defaultView: t = "desktop", views: n = [
3998
4244
  className: "bree-icon-button",
3999
4245
  onClick: e,
4000
4246
  title: b.close,
4001
- children: /* @__PURE__ */ I(Oe, { size: 18 })
4247
+ children: /* @__PURE__ */ I(Me, { size: 18 })
4002
4248
  })
4003
4249
  ]
4004
4250
  })]
@@ -4036,7 +4282,7 @@ function Er({ onClose: e, defaultView: t = "desktop", views: n = [
4036
4282
  }
4037
4283
  //#endregion
4038
4284
  //#region src/components/TopBar.tsx
4039
- function Dr({ className: e, style: t }) {
4285
+ function Wr({ className: e, style: t }) {
4040
4286
  let { layersOpen: n, setLayersOpen: r, t: i } = Q();
4041
4287
  return /* @__PURE__ */ L("button", {
4042
4288
  type: "button",
@@ -4046,14 +4292,14 @@ function Dr({ className: e, style: t }) {
4046
4292
  onClick: () => r(!n),
4047
4293
  title: i.topBar.toggleLayers,
4048
4294
  children: [
4049
- /* @__PURE__ */ I(zt, {}),
4295
+ /* @__PURE__ */ I(Xt, {}),
4050
4296
  " ",
4051
4297
  i.topBar.layers
4052
4298
  ]
4053
4299
  });
4054
4300
  }
4055
- function Or({ className: e, style: t }) {
4056
- let { editor: n, t: r } = Q(), i = h({
4301
+ function Gr({ className: e, style: t }) {
4302
+ let { editor: n, t: r } = Q(), i = g({
4057
4303
  editor: n,
4058
4304
  selector: ({ editor: e }) => ({
4059
4305
  undo: !!e?.can().undo(),
@@ -4069,26 +4315,26 @@ function Or({ className: e, style: t }) {
4069
4315
  title: r.topBar.undo,
4070
4316
  disabled: !i?.undo,
4071
4317
  onClick: () => n.chain().focus().undo().run(),
4072
- children: /* @__PURE__ */ I(Ft, {})
4318
+ children: /* @__PURE__ */ I(Kt, {})
4073
4319
  }), /* @__PURE__ */ I("button", {
4074
4320
  type: "button",
4075
4321
  className: "bree-icon-button",
4076
4322
  title: r.topBar.redo,
4077
4323
  disabled: !i?.redo,
4078
4324
  onClick: () => n.chain().focus().redo().run(),
4079
- children: /* @__PURE__ */ I(It, {})
4325
+ children: /* @__PURE__ */ I(qt, {})
4080
4326
  })]
4081
4327
  });
4082
4328
  }
4083
- function kr({ className: e, style: t }) {
4329
+ function Kr({ className: e, style: t }) {
4084
4330
  let { device: n, setDevice: r, t: i } = Q(), a = [{
4085
4331
  id: "desktop",
4086
4332
  label: i.topBar.desktop,
4087
- Icon: Lt
4333
+ Icon: Jt
4088
4334
  }, {
4089
4335
  id: "mobile",
4090
4336
  label: i.topBar.mobile,
4091
- Icon: Rt
4337
+ Icon: Yt
4092
4338
  }];
4093
4339
  return /* @__PURE__ */ I("div", {
4094
4340
  className: R("bree-segmented bree-device-toggle", e),
@@ -4106,7 +4352,7 @@ function kr({ className: e, style: t }) {
4106
4352
  }, e))
4107
4353
  });
4108
4354
  }
4109
- function Ar({ className: e, style: t }) {
4355
+ function qr({ className: e, style: t }) {
4110
4356
  let { editor: n, starterDocument: r, locale: i, t: a } = Q();
4111
4357
  return /* @__PURE__ */ I("button", {
4112
4358
  type: "button",
@@ -4121,15 +4367,15 @@ function Ar({ className: e, style: t }) {
4121
4367
  children: a.topBar.template
4122
4368
  });
4123
4369
  }
4124
- function jr({ className: e, style: t }) {
4125
- let { handle: n, t: r } = Q(), i = c(null), a = async (e) => {
4370
+ function Jr({ className: e, style: t }) {
4371
+ let { handle: n, t: r } = Q(), i = l(null), a = async (e) => {
4126
4372
  try {
4127
4373
  n.setValue(JSON.parse(await e.text()));
4128
4374
  } catch (e) {
4129
4375
  alert(r.topBar.invalidFile(e instanceof Error ? e.message : String(e)));
4130
4376
  }
4131
4377
  };
4132
- return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("button", {
4378
+ return /* @__PURE__ */ L(Pe, { children: [/* @__PURE__ */ I("button", {
4133
4379
  type: "button",
4134
4380
  className: R("bree-btn bree-ghost", e),
4135
4381
  style: t,
@@ -4146,82 +4392,86 @@ function jr({ className: e, style: t }) {
4146
4392
  }
4147
4393
  })] });
4148
4394
  }
4149
- function Mr({ className: e, style: t, filename: n = "email.json" }) {
4395
+ function Yr({ className: e, style: t, filename: n = "email.json" }) {
4150
4396
  let { handle: r, t: i } = Q();
4151
4397
  return /* @__PURE__ */ I("button", {
4152
4398
  type: "button",
4153
4399
  className: R("bree-btn bree-ghost", e),
4154
4400
  style: t,
4155
- onClick: () => Tr(n, JSON.stringify(r.getValue(), null, 2), "application/json"),
4401
+ onClick: () => Hr(n, JSON.stringify(r.getValue(), null, 2), "application/json"),
4156
4402
  children: i.topBar.exportJson
4157
4403
  });
4158
4404
  }
4159
- function Nr({ view: e = "desktop", variant: t = "default", children: n, className: r, style: i }) {
4160
- let { t: a } = Q(), [o, s] = l(!1);
4161
- return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("button", {
4405
+ function Xr({ view: e = "desktop", variant: t = "default", children: n, className: r, style: i }) {
4406
+ let { t: a } = Q(), [o, s] = u(!1);
4407
+ return /* @__PURE__ */ L(Pe, { children: [/* @__PURE__ */ I("button", {
4162
4408
  type: "button",
4163
4409
  className: R("bree-btn", t !== "default" && `bree-${t}`, r),
4164
4410
  style: i,
4165
4411
  onClick: () => s(!0),
4166
4412
  children: n ?? a.topBar.preview
4167
- }), o && /* @__PURE__ */ I(Er, {
4413
+ }), o && /* @__PURE__ */ I(Ur, {
4168
4414
  defaultView: e,
4169
4415
  onClose: () => s(!1)
4170
4416
  })] });
4171
4417
  }
4172
- function Pr(e) {
4418
+ function Zr(e) {
4173
4419
  let { t } = Q();
4174
- return /* @__PURE__ */ I(Nr, {
4420
+ return /* @__PURE__ */ I(Xr, {
4175
4421
  view: "html",
4176
4422
  variant: "primary",
4177
4423
  ...e,
4178
4424
  children: t.topBar.exportHtml
4179
4425
  });
4180
4426
  }
4181
- function Fr({ brand: e, actions: t, children: n, className: r, style: i }) {
4182
- return /* @__PURE__ */ I(j, { children: /* @__PURE__ */ L("header", {
4427
+ function Qr({ brand: e, actions: t, children: n, className: r, style: i }) {
4428
+ return /* @__PURE__ */ I(M, { children: /* @__PURE__ */ L("header", {
4183
4429
  className: R("bree-topbar", r),
4184
4430
  style: i,
4185
4431
  children: [/* @__PURE__ */ I("div", {
4186
4432
  className: "bree-topbar-start",
4187
4433
  children: e
4188
- }), n ?? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
4434
+ }), n ?? /* @__PURE__ */ L(Pe, { children: [/* @__PURE__ */ I("div", {
4189
4435
  className: "bree-topbar-center",
4190
- children: /* @__PURE__ */ I(kr, {})
4436
+ children: /* @__PURE__ */ I(Kr, {})
4191
4437
  }), /* @__PURE__ */ L("div", {
4192
4438
  className: "bree-topbar-actions",
4193
- children: [t, /* @__PURE__ */ I(Pr, {})]
4439
+ children: [t, /* @__PURE__ */ I(Zr, {})]
4194
4440
  })] })]
4195
4441
  }) });
4196
4442
  }
4197
4443
  //#endregion
4198
4444
  //#region src/components/BetterEmailEditor.tsx
4199
- function Ir({ showTopBar: e = !0, showLayers: t = !0, showSidebar: n = !0, components: r = {}, slotProps: i = {} }) {
4200
- let { layersOpen: a } = Q(), { TopBar: o = Fr, LayersPanel: s = dr, Canvas: c = ar, Sidebar: l = wr } = r, u = t && a;
4445
+ function $r({ showTopBar: e = !0, showLayers: t = !0, showSidebar: n = !0, showEmailHeader: r = !1, components: i = {}, slotProps: a = {} }) {
4446
+ let { layersOpen: o } = Q(), { TopBar: s = Qr, LayersPanel: c = Tr, Canvas: l = yr, Sidebar: u = Vr } = i, d = t && o;
4201
4447
  return /* @__PURE__ */ L("div", {
4202
- className: R("bree-layout", e && "bree-with-topbar", u && "bree-with-layers", n && "bree-with-sidebar"),
4448
+ className: R("bree-layout", e && "bree-with-topbar", d && "bree-with-layers", n && "bree-with-sidebar"),
4203
4449
  children: [
4204
- e && /* @__PURE__ */ I(o, { ...i.topBar }),
4205
- u && /* @__PURE__ */ I(s, { ...i.layersPanel }),
4206
- /* @__PURE__ */ I(c, { ...i.canvas }),
4207
- n && /* @__PURE__ */ I(l, { ...i.sidebar })
4450
+ e && /* @__PURE__ */ I(s, { ...a.topBar }),
4451
+ d && /* @__PURE__ */ I(c, { ...a.layersPanel }),
4452
+ /* @__PURE__ */ I(l, {
4453
+ header: r,
4454
+ ...a.canvas
4455
+ }),
4456
+ n && /* @__PURE__ */ I(u, { ...a.sidebar })
4208
4457
  ]
4209
4458
  });
4210
4459
  }
4211
- var Lr = t(function({ showTopBar: e, showLayers: t, showSidebar: n, components: r, slotProps: i, ...a }, o) {
4212
- return /* @__PURE__ */ I(Qn, {
4213
- ref: o,
4214
- ...a,
4215
- children: /* @__PURE__ */ I(Ir, {
4460
+ var ei = t(function({ showTopBar: e, showLayers: t, showSidebar: n, showEmailHeader: r, components: i, slotProps: a, ...o }, s) {
4461
+ return /* @__PURE__ */ I(ur, {
4462
+ ref: s,
4463
+ ...o,
4464
+ children: /* @__PURE__ */ I($r, {
4216
4465
  showTopBar: e,
4217
4466
  showLayers: t,
4218
4467
  showSidebar: n,
4219
- components: r,
4220
- slotProps: i
4468
+ showEmailHeader: r,
4469
+ components: i,
4470
+ slotProps: a
4221
4471
  })
4222
4472
  });
4223
4473
  });
4224
4474
  //#endregion
4225
- export { $t as AlignInput, Ve as BLOCK_CONTAINERS, Lr as BetterEmailEditor, hr as BlockProperties, vr as BlocksTab, yr as BodyTab, rn as BoxGroup, an as ButtonInspector, He as COLUMN_PARENTS, ar as Canvas, rr as CanvasOverlay, G as ColorInput, on as ColumnsInspector, fn as ContainerInspector, Sr as ContentPanel, xr as ContentTab, Yt as DEFAULT_SWATCHES, fr as DefaultInspector, kr as DeviceToggle, dn as DividerInspector, Qn as EditorRoot, ct as EmailButton, Pr as ExportHtmlButton, Mr as ExportJsonButton, H as Field, V as Group, sn as HeadingInspector, xn as HtmlBlock, un as HtmlInspector, cn as ImageInspector, jr as ImportButton, dr as LayersPanel, Dr as LayersToggle, W as NumberInput, en as PaddingInput, br as PaletteTile, Nr as PreviewButton, Er as PreviewDialog, mr as PropertiesPanel, Jt as RangeInput, gn as SOCIAL_NETWORKS, Qt as Segmented, Zt as Select, wr as Sidebar, bn as SocialLinks, Sn as SocialLinksInspector, hn as Spacer, ln as SpacerInspector, nn as SpacingGroup, Ar as TemplateButton, _r as TemplateCard, Z as TemplateThumbnail, Kt as TextArea, U as TextInput, Cr as TextProperties, Fr as TopBar, tn as TypographyGroup, Or as UndoRedo, st as appendBlocks, $e as applyDrop, Dn as content, Hn as createStarterDocument, K as css, R as cx, En as defaultNodes, zn as defaultPalette, Rn as defaultPaletteGroups, Bn as defaultTemplates, Kn as defaultTheme, ot as deleteUnit, Tr as download, at as duplicateUnit, Ct as en, Je as findDropTarget, wt as fr, vn as iconUrl, At as icons, pn as inlineStyleToObject, Tt as locales, Ln as menuParagraph, nt as parentUnit, qn as readFileAsDataUrl, Et as resolveLabel, kt as resolveMessages, it as selectUnit, rt as selectedUnit, wn as textPreview, Xt as toHex, Cn as truncate, z as unitAt, pr as useDeselect, gr as useDraggableBlock, Q as useEmailEditor, Gn as useI18n, $ as useMessages, Wn as useOptionalEmailEditor };
4475
+ export { fn as AlignInput, Ke as BLOCK_CONTAINERS, ei as BetterEmailEditor, kr as BlockProperties, Mr as BlocksTab, Ir as BodyTab, hn as BoxGroup, gn as ButtonInspector, qe as COLUMN_PARENTS, yr as Canvas, hr as CanvasOverlay, G as ColorInput, _n as ColumnsInspector, Cn as ContainerInspector, zr as ContentPanel, Rr as ContentTab, sn as DEFAULT_SWATCHES, Er as DefaultInspector, Kr as DeviceToggle, Sn as DividerInspector, ur as EditorRoot, pt as EmailButton, _r as EmailHeader, Zr as ExportHtmlButton, Yr as ExportJsonButton, H as Field, un as FontInput, V as Group, vn as HeadingInspector, Mn as HtmlBlock, xn as HtmlInspector, yn as ImageInspector, Jr as ImportButton, Tr as LayersPanel, Wr as LayersToggle, W as NumberInput, pn as PaddingInput, Lr as PaletteTile, Xr as PreviewButton, Ur as PreviewDialog, Or as PropertiesPanel, on as RangeInput, Dn as SOCIAL_NETWORKS, dn as Segmented, ln as Select, Vr as Sidebar, jn as SocialLinks, Nn as SocialLinksInspector, En as Spacer, bn as SpacerInspector, q as SpacingGroup, qr as TemplateButton, jr as TemplateCard, Z as TemplateThumbnail, rn as TextArea, U as TextInput, Br as TextProperties, Qr as TopBar, mn as TypographyGroup, Gr as UndoRedo, ft as appendBlocks, it as applyDrop, Rn as content, er as createStarterDocument, K as css, R as cx, Dt as defaultFonts, Ln as defaultNodes, Zn as defaultPalette, Xn as defaultPaletteGroups, Qn as defaultTemplates, ir as defaultTheme, dt as deleteUnit, Hr as download, ut as duplicateUnit, Pt as en, $e as findDropTarget, kt as findFont, Ft as fr, kn as iconUrl, Vt as icons, wn as inlineStyleToObject, jt as linkWebFonts, It as locales, Yn as menuParagraph, st as parentUnit, ar as readFileAsDataUrl, Lt as resolveLabel, Bt as resolveMessages, lt as selectUnit, ct as selectedUnit, Fn as textPreview, cn as toHex, Pn as truncate, z as unitAt, Dr as useDeselect, Ar as useDraggableBlock, Q as useEmailEditor, rr as useI18n, $ as useMessages, nr as useOptionalEmailEditor, At as usedWebFonts };
4226
4476
 
4227
4477
  //# sourceMappingURL=index.js.map