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