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