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