brick-pdf 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brick-pdf.css +1 -1
- package/dist/brick-pdf.js +498 -481
- package/dist/brick-pdf.umd.cjs +4 -4
- package/dist/composables/useElementActions.d.ts +1 -0
- package/dist/types/element.d.ts +1 -0
- package/package.json +1 -1
package/dist/brick-pdf.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _, openBlock as
|
|
1
|
+
import { defineComponent as _, openBlock as a, createElementBlock as c, normalizeStyle as N, toDisplayString as w, renderSlot as Z, normalizeClass as ee, createElementVNode as m, Fragment as C, renderList as P, reactive as ze, provide as D, inject as L, toRaw as J, ref as E, computed as I, createTextVNode as ie, createCommentVNode as $, createBlock as M, resolveDynamicComponent as te, withCtx as Y, onMounted as ye, onBeforeUnmount as me, unref as k, resolveComponent as Te, withDirectives as X, vModelSelect as se, createVNode as B, vModelText as De, watch as Le } from "vue";
|
|
2
2
|
import { useMagicKeys as Me, whenever as ae } from "@vueuse/core";
|
|
3
3
|
import ce from "sortablejs";
|
|
4
4
|
function ne() {
|
|
@@ -14,18 +14,18 @@ function ne() {
|
|
|
14
14
|
content: []
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const q = /* @__PURE__ */ new Map();
|
|
18
18
|
function z(e) {
|
|
19
|
-
|
|
19
|
+
q.set(e.type, e);
|
|
20
20
|
}
|
|
21
21
|
function U(e) {
|
|
22
|
-
return
|
|
22
|
+
return q.get(e);
|
|
23
23
|
}
|
|
24
24
|
function Be() {
|
|
25
|
-
return Array.from(
|
|
25
|
+
return Array.from(q.values());
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
27
|
+
function ir(e) {
|
|
28
|
+
return q.delete(e);
|
|
29
29
|
}
|
|
30
30
|
function Oe() {
|
|
31
31
|
return { text: "New Text" };
|
|
@@ -37,13 +37,13 @@ function Ve(e) {
|
|
|
37
37
|
const t = { text: e.props.text }, n = e.style;
|
|
38
38
|
return n.fontSize && (t.fontSize = n.fontSize), n.bold && (t.bold = n.bold), n.italics && (t.italics = n.italics), n.color && (t.color = n.color), n.alignment && (t.alignment = n.alignment), n.margin && (t.margin = n.margin), n.font && (t.font = n.font), n.lineHeight && (t.lineHeight = n.lineHeight), n.characterSpacing && (t.characterSpacing = n.characterSpacing), n.decoration && (t.decoration = n.decoration), n.decorationStyle && (t.decorationStyle = n.decorationStyle), n.decorationColor && (t.decorationColor = n.decorationColor), n.background && (t.background = n.background), n.link && (t.link = n.link), n.opacity !== void 0 && (t.opacity = n.opacity), t;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const Fe = /* @__PURE__ */ _({
|
|
41
41
|
__name: "TextRenderer",
|
|
42
42
|
props: {
|
|
43
43
|
node: {}
|
|
44
44
|
},
|
|
45
45
|
setup(e) {
|
|
46
|
-
return (t, n) => (
|
|
46
|
+
return (t, n) => (a(), c("div", {
|
|
47
47
|
class: "brick-el-text",
|
|
48
48
|
style: N({
|
|
49
49
|
fontSize: (e.node.style.fontSize ?? 12) + "px",
|
|
@@ -60,16 +60,16 @@ const He = /* @__PURE__ */ _({
|
|
|
60
60
|
}
|
|
61
61
|
}), x = (e, t) => {
|
|
62
62
|
const n = e.__vccOpts || e;
|
|
63
|
-
for (const [
|
|
64
|
-
n[
|
|
63
|
+
for (const [i, s] of t)
|
|
64
|
+
n[i] = s;
|
|
65
65
|
return n;
|
|
66
|
-
},
|
|
66
|
+
}, He = /* @__PURE__ */ x(Fe, [["__scopeId", "data-v-a7cd1565"]]), Je = { class: "brick-text-editor" }, Ue = /* @__PURE__ */ _({
|
|
67
67
|
__name: "TextPropertyEditor",
|
|
68
68
|
props: {
|
|
69
69
|
node: {}
|
|
70
70
|
},
|
|
71
71
|
setup(e) {
|
|
72
|
-
return (t, n) => (
|
|
72
|
+
return (t, n) => (a(), c("div", Je));
|
|
73
73
|
}
|
|
74
74
|
}), We = {
|
|
75
75
|
type: "text",
|
|
@@ -78,7 +78,7 @@ const He = /* @__PURE__ */ _({
|
|
|
78
78
|
isContainer: !1,
|
|
79
79
|
defaultProps: Oe,
|
|
80
80
|
defaultStyle: Ae,
|
|
81
|
-
rendererComponent:
|
|
81
|
+
rendererComponent: He,
|
|
82
82
|
propertyEditorComponent: Ue,
|
|
83
83
|
propertyFields: [
|
|
84
84
|
{ key: "props.text", label: "Text Content", section: "content", type: "textarea", defaultValue: "New Text" },
|
|
@@ -118,27 +118,27 @@ function qe(e, t) {
|
|
|
118
118
|
};
|
|
119
119
|
return e.style.margin && (n.margin = e.style.margin), e.style.fillColor && (n.fillColor = e.style.fillColor), n;
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const Ke = /* @__PURE__ */ _({
|
|
122
122
|
__name: "StackRenderer",
|
|
123
123
|
props: {
|
|
124
124
|
node: {},
|
|
125
125
|
path: {}
|
|
126
126
|
},
|
|
127
127
|
setup(e) {
|
|
128
|
-
return (t, n) => (
|
|
128
|
+
return (t, n) => (a(), c("div", {
|
|
129
129
|
class: "brick-el-stack",
|
|
130
130
|
style: N({ backgroundColor: e.node.style.fillColor })
|
|
131
131
|
}, [
|
|
132
132
|
Z(t.$slots, "default", {}, void 0, !0)
|
|
133
133
|
], 4));
|
|
134
134
|
}
|
|
135
|
-
}),
|
|
135
|
+
}), Ge = /* @__PURE__ */ x(Ke, [["__scopeId", "data-v-c59e7405"]]), Xe = { class: "brick-stack-editor" }, Qe = /* @__PURE__ */ _({
|
|
136
136
|
__name: "StackPropertyEditor",
|
|
137
137
|
props: {
|
|
138
138
|
node: {}
|
|
139
139
|
},
|
|
140
140
|
setup(e) {
|
|
141
|
-
return (t, n) => (
|
|
141
|
+
return (t, n) => (a(), c("div", Xe));
|
|
142
142
|
}
|
|
143
143
|
}), Ze = {
|
|
144
144
|
type: "stack",
|
|
@@ -148,7 +148,7 @@ const Ge = /* @__PURE__ */ _({
|
|
|
148
148
|
acceptsChildTypes: null,
|
|
149
149
|
defaultProps: je,
|
|
150
150
|
defaultStyle: Ye,
|
|
151
|
-
rendererComponent:
|
|
151
|
+
rendererComponent: Ge,
|
|
152
152
|
propertyEditorComponent: Qe,
|
|
153
153
|
propertyFields: [
|
|
154
154
|
{ key: "style.fillColor", label: "Fill Color", section: "style", type: "color" },
|
|
@@ -176,7 +176,7 @@ const ot = /* @__PURE__ */ _({
|
|
|
176
176
|
path: {}
|
|
177
177
|
},
|
|
178
178
|
setup(e) {
|
|
179
|
-
return (t, n) => (
|
|
179
|
+
return (t, n) => (a(), c("div", {
|
|
180
180
|
class: "brick-el-columns",
|
|
181
181
|
style: N({ "--column-gap": (e.node.props.columnGap ?? 10) + "px" })
|
|
182
182
|
}, [
|
|
@@ -189,7 +189,7 @@ const ot = /* @__PURE__ */ _({
|
|
|
189
189
|
node: {}
|
|
190
190
|
},
|
|
191
191
|
setup(e) {
|
|
192
|
-
return (t, n) => (
|
|
192
|
+
return (t, n) => (a(), c("div", lt));
|
|
193
193
|
}
|
|
194
194
|
}), st = {
|
|
195
195
|
type: "columns",
|
|
@@ -227,11 +227,11 @@ function dt(e) {
|
|
|
227
227
|
headerRows: e.props.headerRows,
|
|
228
228
|
widths: e.props.widths,
|
|
229
229
|
body: t.map(
|
|
230
|
-
(
|
|
230
|
+
(s) => s.map((o) => ({ text: o }))
|
|
231
231
|
)
|
|
232
232
|
}
|
|
233
|
-
},
|
|
234
|
-
return
|
|
233
|
+
}, i = e.props.layout;
|
|
234
|
+
return i && i !== "none" && (n.layout = i), e.style.fontSize && (n.fontSize = e.style.fontSize), e.style.color && (n.color = e.style.color), e.style.margin && (n.margin = e.style.margin), n;
|
|
235
235
|
}
|
|
236
236
|
const ut = /* @__PURE__ */ _({
|
|
237
237
|
__name: "TableRenderer",
|
|
@@ -239,23 +239,23 @@ const ut = /* @__PURE__ */ _({
|
|
|
239
239
|
node: {}
|
|
240
240
|
},
|
|
241
241
|
setup(e) {
|
|
242
|
-
return (t, n) => (
|
|
242
|
+
return (t, n) => (a(), c("div", {
|
|
243
243
|
class: ee(["brick-el-table", "brick-el-table--" + (e.node.props.layout ?? "lightHorizontalLines")]),
|
|
244
244
|
style: N({ fontSize: (e.node.style.fontSize ?? 12) + "px", color: e.node.style.color })
|
|
245
245
|
}, [
|
|
246
246
|
m("table", null, [
|
|
247
247
|
m("thead", null, [
|
|
248
|
-
(
|
|
249
|
-
key: "h" +
|
|
248
|
+
(a(!0), c(C, null, P(e.node.props.body.slice(0, e.node.props.headerRows), (i, s) => (a(), c("tr", {
|
|
249
|
+
key: "h" + s
|
|
250
250
|
}, [
|
|
251
|
-
(
|
|
251
|
+
(a(!0), c(C, null, P(i, (o, p) => (a(), c("th", { key: p }, w(o), 1))), 128))
|
|
252
252
|
]))), 128))
|
|
253
253
|
]),
|
|
254
254
|
m("tbody", null, [
|
|
255
|
-
(
|
|
256
|
-
key: "b" +
|
|
255
|
+
(a(!0), c(C, null, P(e.node.props.body.slice(e.node.props.headerRows), (i, s) => (a(), c("tr", {
|
|
256
|
+
key: "b" + s
|
|
257
257
|
}, [
|
|
258
|
-
(
|
|
258
|
+
(a(!0), c(C, null, P(i, (o, p) => (a(), c("td", { key: p }, w(o), 1))), 128))
|
|
259
259
|
]))), 128))
|
|
260
260
|
])
|
|
261
261
|
])
|
|
@@ -280,40 +280,40 @@ function Q(e) {
|
|
|
280
280
|
}
|
|
281
281
|
function ft(e) {
|
|
282
282
|
const t = e ? de(e) : ne();
|
|
283
|
-
for (const
|
|
283
|
+
for (const d of t.content) Q(d);
|
|
284
284
|
const n = ze(t);
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
for (let
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
if (
|
|
291
|
-
return { node:
|
|
292
|
-
if (
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
285
|
+
function i(d, r) {
|
|
286
|
+
const l = r ?? n.content;
|
|
287
|
+
for (let u = 0; u < l.length; u++) {
|
|
288
|
+
const b = l[u];
|
|
289
|
+
if (b) {
|
|
290
|
+
if (b.id === d)
|
|
291
|
+
return { node: b, parent: l, index: u };
|
|
292
|
+
if (b.children.length > 0) {
|
|
293
|
+
const y = i(d, b.children);
|
|
294
|
+
if (y) return y;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
return null;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
n.content.splice(0, n.content.length, ...
|
|
300
|
+
function s(d) {
|
|
301
|
+
n.content.splice(0, n.content.length, ...d);
|
|
302
302
|
}
|
|
303
303
|
function o() {
|
|
304
304
|
return JSON.parse(JSON.stringify(J(n.content)));
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
const r = de(
|
|
308
|
-
for (const
|
|
306
|
+
function p(d) {
|
|
307
|
+
const r = de(d);
|
|
308
|
+
for (const l of r.content) Q(l);
|
|
309
309
|
n.pageSize = r.pageSize, n.pageOrientation = r.pageOrientation, n.pageMargins = r.pageMargins, n.defaultStyle = r.defaultStyle, n.styles = r.styles, n.content.splice(0, n.content.length, ...r.content);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function f() {
|
|
312
312
|
return JSON.parse(JSON.stringify(J(n)));
|
|
313
313
|
}
|
|
314
|
-
return { document: n, findNodeById:
|
|
314
|
+
return { document: n, findNodeById: i, replaceContent: s, snapshotContent: o, loadDocument: p, exportDocument: f };
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function yt(e) {
|
|
317
317
|
D(ge, e);
|
|
318
318
|
}
|
|
319
319
|
function oe() {
|
|
@@ -323,15 +323,15 @@ function oe() {
|
|
|
323
323
|
return e;
|
|
324
324
|
}
|
|
325
325
|
const be = /* @__PURE__ */ Symbol("brick-pdf-selection");
|
|
326
|
-
function
|
|
326
|
+
function mt(e) {
|
|
327
327
|
const t = E(null), n = I(() => t.value ? e.findNodeById(t.value)?.node ?? null : null);
|
|
328
|
-
function
|
|
328
|
+
function i(o) {
|
|
329
329
|
t.value = o;
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function s() {
|
|
332
332
|
t.value = null;
|
|
333
333
|
}
|
|
334
|
-
return { selectedId: t, selectedNode: n, select:
|
|
334
|
+
return { selectedId: t, selectedNode: n, select: i, deselect: s };
|
|
335
335
|
}
|
|
336
336
|
function gt(e) {
|
|
337
337
|
D(be, e);
|
|
@@ -357,55 +357,59 @@ function _e(e) {
|
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
359
|
function vt(e, t) {
|
|
360
|
-
function n(
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
360
|
+
function n(r, l, u) {
|
|
361
|
+
const b = U(r);
|
|
362
|
+
if (!b) return null;
|
|
363
363
|
t.record();
|
|
364
|
-
const
|
|
364
|
+
const y = {
|
|
365
365
|
id: he(),
|
|
366
|
-
type:
|
|
367
|
-
props:
|
|
368
|
-
style:
|
|
366
|
+
type: r,
|
|
367
|
+
props: b.defaultProps(),
|
|
368
|
+
style: b.defaultStyle(),
|
|
369
369
|
children: []
|
|
370
|
-
},
|
|
371
|
-
if (!
|
|
372
|
-
const
|
|
373
|
-
return
|
|
370
|
+
}, g = l ? e.findNodeById(l)?.node.children : e.document.content;
|
|
371
|
+
if (!g) return null;
|
|
372
|
+
const v = u ?? g.length;
|
|
373
|
+
return g.splice(v, 0, y), y;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
const
|
|
377
|
-
|
|
375
|
+
function i(r) {
|
|
376
|
+
const l = e.findNodeById(r);
|
|
377
|
+
l && (t.record(), l.parent.splice(l.index, 1));
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
const
|
|
381
|
-
if (!
|
|
379
|
+
function s(r, l, u) {
|
|
380
|
+
const b = e.findNodeById(r);
|
|
381
|
+
if (!b) return;
|
|
382
382
|
t.record();
|
|
383
|
-
const
|
|
384
|
-
if (!
|
|
385
|
-
const
|
|
386
|
-
|
|
383
|
+
const y = b.parent.splice(b.index, 1)[0];
|
|
384
|
+
if (!y) return;
|
|
385
|
+
const g = l ? e.findNodeById(l)?.node.children : e.document.content;
|
|
386
|
+
g && g.splice(u, 0, y);
|
|
387
387
|
}
|
|
388
|
-
function o(
|
|
389
|
-
const
|
|
390
|
-
if (!
|
|
388
|
+
function o(r) {
|
|
389
|
+
const l = e.findNodeById(r);
|
|
390
|
+
if (!l) return null;
|
|
391
391
|
t.record();
|
|
392
|
-
const
|
|
393
|
-
return
|
|
392
|
+
const u = _e(l.node);
|
|
393
|
+
return l.parent.splice(l.index + 1, 0, u), u;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
const
|
|
397
|
-
|
|
395
|
+
function p(r, l) {
|
|
396
|
+
const u = e.findNodeById(r);
|
|
397
|
+
u && (t.record(), Object.assign(u.node.props, l));
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
const
|
|
401
|
-
|
|
399
|
+
function f(r, l) {
|
|
400
|
+
const u = e.findNodeById(r);
|
|
401
|
+
u && (t.record(), Object.assign(u.node.style, l));
|
|
402
402
|
}
|
|
403
|
-
|
|
403
|
+
function d(r, l) {
|
|
404
|
+
const u = e.findNodeById(r);
|
|
405
|
+
u && (t.record(), l ? u.node.key = l : delete u.node.key);
|
|
406
|
+
}
|
|
407
|
+
return { addElement: n, removeElement: i, moveElement: s, duplicateElement: o, updateProps: p, updateStyle: f, updateKey: d };
|
|
404
408
|
}
|
|
405
409
|
function ht(e) {
|
|
406
410
|
D(ve, e);
|
|
407
411
|
}
|
|
408
|
-
function
|
|
412
|
+
function j() {
|
|
409
413
|
const e = L(ve);
|
|
410
414
|
if (!e)
|
|
411
415
|
throw new Error("useElementActions() requires a BrickPdf ancestor component");
|
|
@@ -414,24 +418,24 @@ function q() {
|
|
|
414
418
|
const ke = /* @__PURE__ */ Symbol("brick-pdf-history"), _t = 50;
|
|
415
419
|
function kt(e) {
|
|
416
420
|
const t = E([]), n = E([]);
|
|
417
|
-
let
|
|
418
|
-
const
|
|
419
|
-
function
|
|
421
|
+
let i = 0;
|
|
422
|
+
const s = I(() => t.value.length > 0), o = I(() => n.value.length > 0);
|
|
423
|
+
function p() {
|
|
420
424
|
const r = Date.now();
|
|
421
|
-
if (r -
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
t.value.push(
|
|
425
|
+
if (r - i < 100) return;
|
|
426
|
+
i = r;
|
|
427
|
+
const l = e.snapshotContent();
|
|
428
|
+
t.value.push(l), t.value.length > _t && t.value.shift(), n.value = [];
|
|
425
429
|
}
|
|
426
|
-
function
|
|
430
|
+
function f() {
|
|
427
431
|
const r = t.value.pop();
|
|
428
432
|
r && (n.value.push(e.snapshotContent()), e.replaceContent(r));
|
|
429
433
|
}
|
|
430
|
-
function
|
|
434
|
+
function d() {
|
|
431
435
|
const r = n.value.pop();
|
|
432
436
|
r && (t.value.push(e.snapshotContent()), e.replaceContent(r));
|
|
433
437
|
}
|
|
434
|
-
return { canUndo:
|
|
438
|
+
return { canUndo: s, canRedo: o, record: p, undo: f, redo: d };
|
|
435
439
|
}
|
|
436
440
|
function St(e) {
|
|
437
441
|
D(ke, e);
|
|
@@ -445,7 +449,7 @@ function xt() {
|
|
|
445
449
|
const Se = /* @__PURE__ */ Symbol("brick-pdf-drag-drop");
|
|
446
450
|
function Ct(e, t) {
|
|
447
451
|
const n = E(!1);
|
|
448
|
-
function
|
|
452
|
+
function i(o) {
|
|
449
453
|
return ce.create(o, {
|
|
450
454
|
group: { name: "brick-elements", pull: "clone", put: !1 },
|
|
451
455
|
sort: !1,
|
|
@@ -458,7 +462,7 @@ function Ct(e, t) {
|
|
|
458
462
|
}
|
|
459
463
|
});
|
|
460
464
|
}
|
|
461
|
-
function
|
|
465
|
+
function s(o, p) {
|
|
462
466
|
return ce.create(o, {
|
|
463
467
|
group: { name: "brick-elements", put: !0 },
|
|
464
468
|
animation: 150,
|
|
@@ -469,32 +473,32 @@ function Ct(e, t) {
|
|
|
469
473
|
onStart() {
|
|
470
474
|
n.value = !0;
|
|
471
475
|
},
|
|
472
|
-
onAdd(
|
|
473
|
-
const
|
|
474
|
-
if (!
|
|
475
|
-
const
|
|
476
|
-
if (!
|
|
477
|
-
const
|
|
478
|
-
return !!(
|
|
476
|
+
onAdd(f) {
|
|
477
|
+
const d = f.item, r = d.dataset.elementId, l = d.dataset.elementType, u = (b) => {
|
|
478
|
+
if (!p || !b) return !1;
|
|
479
|
+
const y = e.findNodeById(p);
|
|
480
|
+
if (!y) return !1;
|
|
481
|
+
const g = U(y.node.type);
|
|
482
|
+
return !!(g?.acceptsChildTypes && !g.acceptsChildTypes.includes(b));
|
|
479
483
|
};
|
|
480
484
|
if (r) {
|
|
481
|
-
if (
|
|
482
|
-
t.moveElement(r,
|
|
485
|
+
if (d.parentNode?.removeChild(d), u(l)) return;
|
|
486
|
+
t.moveElement(r, p, f.newIndex ?? 0);
|
|
483
487
|
return;
|
|
484
488
|
}
|
|
485
|
-
|
|
489
|
+
l && (d.parentNode?.removeChild(d), !u(l) && t.addElement(l, p, f.newIndex));
|
|
486
490
|
},
|
|
487
|
-
onEnd(
|
|
488
|
-
if (n.value = !1,
|
|
489
|
-
const
|
|
490
|
-
if (!
|
|
491
|
-
const r =
|
|
492
|
-
r &&
|
|
491
|
+
onEnd(f) {
|
|
492
|
+
if (n.value = !1, f.from === f.to && f.oldIndex !== void 0 && f.newIndex !== void 0 && f.oldIndex !== f.newIndex && f.item.dataset.elementId) {
|
|
493
|
+
const d = p ? e.findNodeById(p)?.node.children : e.document.content;
|
|
494
|
+
if (!d) return;
|
|
495
|
+
const r = d.splice(f.oldIndex, 1)[0];
|
|
496
|
+
r && d.splice(f.newIndex, 0, r);
|
|
493
497
|
}
|
|
494
498
|
}
|
|
495
499
|
});
|
|
496
500
|
}
|
|
497
|
-
return { initToolbar:
|
|
501
|
+
return { initToolbar: i, initContainer: s, isDragging: n };
|
|
498
502
|
}
|
|
499
503
|
function wt(e) {
|
|
500
504
|
D(Se, e);
|
|
@@ -514,12 +518,12 @@ const ue = {
|
|
|
514
518
|
}, Pt = "NotoSansJP";
|
|
515
519
|
function Et(e) {
|
|
516
520
|
const t = new Uint8Array(e), n = 32768;
|
|
517
|
-
let
|
|
518
|
-
for (let
|
|
519
|
-
const o = t.subarray(
|
|
520
|
-
|
|
521
|
+
let i = "";
|
|
522
|
+
for (let s = 0; s < t.length; s += n) {
|
|
523
|
+
const o = t.subarray(s, s + n);
|
|
524
|
+
i += String.fromCharCode.apply(null, Array.from(o));
|
|
521
525
|
}
|
|
522
|
-
return btoa(
|
|
526
|
+
return btoa(i);
|
|
523
527
|
}
|
|
524
528
|
async function pe(e) {
|
|
525
529
|
const t = await fetch(e);
|
|
@@ -528,9 +532,9 @@ async function pe(e) {
|
|
|
528
532
|
const n = await t.arrayBuffer();
|
|
529
533
|
return Et(n);
|
|
530
534
|
}
|
|
531
|
-
let
|
|
535
|
+
let H = null;
|
|
532
536
|
function It() {
|
|
533
|
-
return
|
|
537
|
+
return H || (H = (async () => {
|
|
534
538
|
const [e, t] = await Promise.all([
|
|
535
539
|
pe(ue.regular),
|
|
536
540
|
pe(ue.bold)
|
|
@@ -550,8 +554,8 @@ function It() {
|
|
|
550
554
|
}
|
|
551
555
|
};
|
|
552
556
|
})().catch((e) => {
|
|
553
|
-
throw
|
|
554
|
-
}),
|
|
557
|
+
throw H = null, e;
|
|
558
|
+
}), H);
|
|
555
559
|
}
|
|
556
560
|
const Ce = /* @__PURE__ */ Symbol("brick-pdf-export");
|
|
557
561
|
function $t(e) {
|
|
@@ -574,10 +578,8 @@ function Rt(e) {
|
|
|
574
578
|
};
|
|
575
579
|
}
|
|
576
580
|
async function n() {
|
|
577
|
-
const o = await import("pdfmake/build/pdfmake"),
|
|
578
|
-
|
|
579
|
-
const r = await It();
|
|
580
|
-
return p.vfs = { ...p.vfs, ...r.vfs }, p.fonts = {
|
|
581
|
+
const o = await import("pdfmake/build/pdfmake"), p = await import("pdfmake/build/vfs_fonts"), f = o.default || o, d = p.pdfMake?.vfs ?? p.default ?? {}, r = await It();
|
|
582
|
+
return f.addVirtualFileSystem({ ...d, ...r.vfs }), f.setFonts({
|
|
581
583
|
Roboto: {
|
|
582
584
|
normal: "Roboto-Regular.ttf",
|
|
583
585
|
bold: "Roboto-Medium.ttf",
|
|
@@ -585,21 +587,21 @@ function Rt(e) {
|
|
|
585
587
|
bolditalics: "Roboto-MediumItalic.ttf"
|
|
586
588
|
},
|
|
587
589
|
...r.fonts
|
|
588
|
-
},
|
|
590
|
+
}), f;
|
|
589
591
|
}
|
|
590
|
-
function
|
|
591
|
-
const
|
|
592
|
-
n().then((
|
|
593
|
-
|
|
592
|
+
function i(o) {
|
|
593
|
+
const p = t();
|
|
594
|
+
n().then((f) => {
|
|
595
|
+
f.createPdf(p).download(o ?? "document.pdf");
|
|
594
596
|
});
|
|
595
597
|
}
|
|
596
|
-
function
|
|
598
|
+
function s() {
|
|
597
599
|
const o = t();
|
|
598
|
-
n().then((
|
|
599
|
-
|
|
600
|
+
n().then((p) => {
|
|
601
|
+
p.createPdf(o).open();
|
|
600
602
|
});
|
|
601
603
|
}
|
|
602
|
-
return { toDocumentDefinition: t, exportPdf:
|
|
604
|
+
return { toDocumentDefinition: t, exportPdf: i, openPdf: s };
|
|
603
605
|
}
|
|
604
606
|
function Nt(e) {
|
|
605
607
|
D(Ce, e);
|
|
@@ -625,27 +627,27 @@ function Ee(e) {
|
|
|
625
627
|
};
|
|
626
628
|
}
|
|
627
629
|
function Lt(e, t) {
|
|
628
|
-
const n = E(null),
|
|
629
|
-
function u(r) {
|
|
630
|
-
const i = e.findNodeById(r);
|
|
631
|
-
i && (n.value = structuredClone(i.node), l.value = !1, a.value = null, o.value = !0);
|
|
632
|
-
}
|
|
630
|
+
const n = E(null), i = E(!1), s = E(null), o = E(!1);
|
|
633
631
|
function p(r) {
|
|
634
|
-
const
|
|
635
|
-
|
|
632
|
+
const l = e.findNodeById(r);
|
|
633
|
+
l && (n.value = structuredClone(l.node), i.value = !1, s.value = null, o.value = !0);
|
|
636
634
|
}
|
|
637
|
-
function
|
|
635
|
+
function f(r) {
|
|
636
|
+
const l = e.findNodeById(r);
|
|
637
|
+
l && (n.value = structuredClone(l.node), i.value = !0, s.value = r, o.value = !0);
|
|
638
|
+
}
|
|
639
|
+
function d(r) {
|
|
638
640
|
if (!n.value) return;
|
|
639
|
-
|
|
640
|
-
const
|
|
641
|
-
|
|
641
|
+
i.value && s.value && (t.removeElement(s.value), i.value = !1, s.value = null);
|
|
642
|
+
const l = Ee(n.value), u = r ? e.findNodeById(r)?.node.children : e.document.content;
|
|
643
|
+
u && (u.push(l), i.value && (n.value = null, o.value = !1));
|
|
642
644
|
}
|
|
643
|
-
return { hasClipboard: o, copy:
|
|
645
|
+
return { hasClipboard: o, copy: p, cut: f, paste: d };
|
|
644
646
|
}
|
|
645
647
|
function Mt(e) {
|
|
646
648
|
D(Pe, e);
|
|
647
649
|
}
|
|
648
|
-
function
|
|
650
|
+
function sr() {
|
|
649
651
|
const e = L(Pe);
|
|
650
652
|
if (!e)
|
|
651
653
|
throw new Error("useClipboard() requires a BrickPdf ancestor component");
|
|
@@ -654,119 +656,119 @@ function lr() {
|
|
|
654
656
|
const Ie = /* @__PURE__ */ Symbol("brick-pdf-resize");
|
|
655
657
|
function Bt(e) {
|
|
656
658
|
const t = E(!1);
|
|
657
|
-
function n(
|
|
659
|
+
function n(i, s, o, p) {
|
|
658
660
|
t.value = !0;
|
|
659
|
-
const
|
|
660
|
-
function y
|
|
661
|
-
const
|
|
662
|
-
let h = r, S =
|
|
663
|
-
|
|
661
|
+
const f = p.clientX, d = p.clientY, r = o.width, l = o.height;
|
|
662
|
+
function u(y) {
|
|
663
|
+
const g = y.clientX - f, v = y.clientY - d;
|
|
664
|
+
let h = r, S = l;
|
|
665
|
+
s.includes("e") && (h = r + g), s.includes("w") && (h = r - g), s.includes("s") && (S = l + v), s.includes("n") && (S = l - v), h = Math.max(20, h), S = Math.max(20, S), e.updateStyle(i, {
|
|
664
666
|
width: Math.round(h),
|
|
665
667
|
height: Math.round(S)
|
|
666
668
|
});
|
|
667
669
|
}
|
|
668
|
-
function
|
|
669
|
-
t.value = !1, document.removeEventListener("pointermove",
|
|
670
|
+
function b() {
|
|
671
|
+
t.value = !1, document.removeEventListener("pointermove", u), document.removeEventListener("pointerup", b);
|
|
670
672
|
}
|
|
671
|
-
document.addEventListener("pointermove",
|
|
673
|
+
document.addEventListener("pointermove", u), document.addEventListener("pointerup", b);
|
|
672
674
|
}
|
|
673
675
|
return { isResizing: t, startResize: n };
|
|
674
676
|
}
|
|
675
677
|
function Ot(e) {
|
|
676
678
|
D(Ie, e);
|
|
677
679
|
}
|
|
678
|
-
function
|
|
680
|
+
function ar() {
|
|
679
681
|
const e = L(Ie);
|
|
680
682
|
if (!e)
|
|
681
683
|
throw new Error("useResize() requires a BrickPdf ancestor component");
|
|
682
684
|
return e;
|
|
683
685
|
}
|
|
684
|
-
const At = { class: "brick-table-editor" }, Vt = { class: "brick-table-editor__grid" },
|
|
686
|
+
const At = { class: "brick-table-editor" }, Vt = { class: "brick-table-editor__grid" }, Ft = ["onClick"], Ht = { class: "brick-table-editor__row-header" }, Jt = ["onClick"], Ut = ["value", "onInput"], Wt = /* @__PURE__ */ _({
|
|
685
687
|
__name: "TablePropertyEditor",
|
|
686
688
|
props: {
|
|
687
689
|
node: {}
|
|
688
690
|
},
|
|
689
691
|
setup(e) {
|
|
690
|
-
const t = e, n =
|
|
691
|
-
function
|
|
692
|
+
const t = e, n = j();
|
|
693
|
+
function i() {
|
|
692
694
|
return t.node.props.body ?? [];
|
|
693
695
|
}
|
|
694
|
-
function
|
|
696
|
+
function s() {
|
|
695
697
|
return t.node.props.widths ?? [];
|
|
696
698
|
}
|
|
697
|
-
function o(
|
|
698
|
-
const
|
|
699
|
-
|
|
699
|
+
function o(l, u, b) {
|
|
700
|
+
const y = i().map((g) => [...g]);
|
|
701
|
+
y[l][u] = b, n.updateProps(t.node.id, { body: y });
|
|
700
702
|
}
|
|
701
|
-
function
|
|
702
|
-
const
|
|
703
|
-
|
|
703
|
+
function p() {
|
|
704
|
+
const l = i().map((b) => [...b]), u = l[0]?.length ?? 2;
|
|
705
|
+
l.push(Array(u).fill("")), n.updateProps(t.node.id, { body: l });
|
|
704
706
|
}
|
|
705
|
-
function
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
708
|
-
|
|
707
|
+
function f(l) {
|
|
708
|
+
const u = i().map((y) => [...y]);
|
|
709
|
+
if (u.length <= 1) return;
|
|
710
|
+
u.splice(l, 1), t.node.props.headerRows > u.length ? n.updateProps(t.node.id, { body: u, headerRows: u.length }) : n.updateProps(t.node.id, { body: u });
|
|
709
711
|
}
|
|
710
|
-
function
|
|
711
|
-
const
|
|
712
|
-
n.updateProps(t.node.id, { body:
|
|
712
|
+
function d() {
|
|
713
|
+
const l = i().map((b) => [...b, ""]), u = [...s(), "*"];
|
|
714
|
+
n.updateProps(t.node.id, { body: l, widths: u });
|
|
713
715
|
}
|
|
714
|
-
function r(
|
|
715
|
-
const
|
|
716
|
-
const
|
|
717
|
-
return
|
|
716
|
+
function r(l) {
|
|
717
|
+
const u = i().map((y) => {
|
|
718
|
+
const g = [...y];
|
|
719
|
+
return g.splice(l, 1), g;
|
|
718
720
|
});
|
|
719
|
-
if ((
|
|
720
|
-
const
|
|
721
|
-
|
|
721
|
+
if ((u[0]?.length ?? 0) < 1) return;
|
|
722
|
+
const b = [...s()];
|
|
723
|
+
b.splice(l, 1), n.updateProps(t.node.id, { body: u, widths: b });
|
|
722
724
|
}
|
|
723
|
-
return (
|
|
725
|
+
return (l, u) => (a(), c("div", At, [
|
|
724
726
|
m("div", { class: "brick-table-editor__actions" }, [
|
|
725
727
|
m("button", {
|
|
726
728
|
class: "brick-table-editor__btn",
|
|
727
|
-
onClick:
|
|
729
|
+
onClick: p
|
|
728
730
|
}, "+ Row"),
|
|
729
731
|
m("button", {
|
|
730
732
|
class: "brick-table-editor__btn",
|
|
731
|
-
onClick:
|
|
733
|
+
onClick: d
|
|
732
734
|
}, "+ Column")
|
|
733
735
|
]),
|
|
734
736
|
m("div", Vt, [
|
|
735
737
|
m("table", null, [
|
|
736
738
|
m("thead", null, [
|
|
737
739
|
m("tr", null, [
|
|
738
|
-
|
|
739
|
-
(
|
|
740
|
-
key:
|
|
740
|
+
u[0] || (u[0] = m("th", { class: "brick-table-editor__corner" }, null, -1)),
|
|
741
|
+
(a(!0), c(C, null, P(i()[0] ?? [], (b, y) => (a(), c("th", {
|
|
742
|
+
key: y,
|
|
741
743
|
class: "brick-table-editor__col-header"
|
|
742
744
|
}, [
|
|
743
|
-
ie(" Col " + w(
|
|
744
|
-
(
|
|
745
|
+
ie(" Col " + w(y + 1) + " ", 1),
|
|
746
|
+
(i()[0]?.length ?? 0) > 1 ? (a(), c("button", {
|
|
745
747
|
key: 0,
|
|
746
748
|
class: "brick-table-editor__remove-btn",
|
|
747
749
|
title: "Remove column",
|
|
748
|
-
onClick: (
|
|
749
|
-
}, "x", 8,
|
|
750
|
+
onClick: (g) => r(y)
|
|
751
|
+
}, "x", 8, Ft)) : $("", !0)
|
|
750
752
|
]))), 128))
|
|
751
753
|
])
|
|
752
754
|
]),
|
|
753
755
|
m("tbody", null, [
|
|
754
|
-
(
|
|
755
|
-
m("td",
|
|
756
|
-
ie(w(
|
|
757
|
-
|
|
756
|
+
(a(!0), c(C, null, P(i(), (b, y) => (a(), c("tr", { key: y }, [
|
|
757
|
+
m("td", Ht, [
|
|
758
|
+
ie(w(y + 1) + " ", 1),
|
|
759
|
+
i().length > 1 ? (a(), c("button", {
|
|
758
760
|
key: 0,
|
|
759
761
|
class: "brick-table-editor__remove-btn",
|
|
760
762
|
title: "Remove row",
|
|
761
|
-
onClick: (
|
|
763
|
+
onClick: (g) => f(y)
|
|
762
764
|
}, "x", 8, Jt)) : $("", !0)
|
|
763
765
|
]),
|
|
764
|
-
(
|
|
766
|
+
(a(!0), c(C, null, P(b, (g, v) => (a(), c("td", { key: v }, [
|
|
765
767
|
m("input", {
|
|
766
768
|
class: "brick-table-editor__cell",
|
|
767
769
|
type: "text",
|
|
768
|
-
value:
|
|
769
|
-
onInput: (h) => o(
|
|
770
|
+
value: g,
|
|
771
|
+
onInput: (h) => o(y, v, h.target.value)
|
|
770
772
|
}, null, 40, Ut)
|
|
771
773
|
]))), 128))
|
|
772
774
|
]))), 128))
|
|
@@ -802,16 +804,16 @@ const At = { class: "brick-table-editor" }, Vt = { class: "brick-table-editor__g
|
|
|
802
804
|
function qt() {
|
|
803
805
|
return { src: "", width: 200, height: 150, fit: null };
|
|
804
806
|
}
|
|
805
|
-
function
|
|
807
|
+
function Kt() {
|
|
806
808
|
return {};
|
|
807
809
|
}
|
|
808
|
-
function
|
|
810
|
+
function Gt(e) {
|
|
809
811
|
const t = {
|
|
810
812
|
image: e.props.src
|
|
811
813
|
};
|
|
812
814
|
return e.props.width && (t.width = e.props.width), e.props.height && (t.height = e.props.height), e.props.fit && (t.fit = e.props.fit), e.style.margin && (t.margin = e.style.margin), e.style.alignment && (t.alignment = e.style.alignment), e.style.opacity !== void 0 && (t.opacity = e.style.opacity), t;
|
|
813
815
|
}
|
|
814
|
-
const
|
|
816
|
+
const Xt = { class: "brick-el-image" }, Qt = ["src"], Zt = {
|
|
815
817
|
key: 1,
|
|
816
818
|
class: "brick-el-image__placeholder"
|
|
817
819
|
}, en = /* @__PURE__ */ _({
|
|
@@ -820,8 +822,8 @@ const Kt = { class: "brick-el-image" }, Qt = ["src"], Zt = {
|
|
|
820
822
|
node: {}
|
|
821
823
|
},
|
|
822
824
|
setup(e) {
|
|
823
|
-
return (t, n) => (
|
|
824
|
-
e.node.props.src ? (
|
|
825
|
+
return (t, n) => (a(), c("div", Xt, [
|
|
826
|
+
e.node.props.src ? (a(), c("img", {
|
|
825
827
|
key: 0,
|
|
826
828
|
src: e.node.props.src,
|
|
827
829
|
style: N({
|
|
@@ -830,7 +832,7 @@ const Kt = { class: "brick-el-image" }, Qt = ["src"], Zt = {
|
|
|
830
832
|
objectFit: "contain",
|
|
831
833
|
opacity: e.node.style.opacity
|
|
832
834
|
})
|
|
833
|
-
}, null, 12, Qt)) : (
|
|
835
|
+
}, null, 12, Qt)) : (a(), c("div", Zt, " No image selected "))
|
|
834
836
|
]));
|
|
835
837
|
}
|
|
836
838
|
}), tn = /* @__PURE__ */ x(en, [["__scopeId", "data-v-38184258"]]), nn = { class: "brick-image-editor" }, on = /* @__PURE__ */ _({
|
|
@@ -839,7 +841,7 @@ const Kt = { class: "brick-el-image" }, Qt = ["src"], Zt = {
|
|
|
839
841
|
node: {}
|
|
840
842
|
},
|
|
841
843
|
setup(e) {
|
|
842
|
-
return (t, n) => (
|
|
844
|
+
return (t, n) => (a(), c("div", nn));
|
|
843
845
|
}
|
|
844
846
|
}), rn = {
|
|
845
847
|
type: "image",
|
|
@@ -847,7 +849,7 @@ const Kt = { class: "brick-el-image" }, Qt = ["src"], Zt = {
|
|
|
847
849
|
icon: "🖼",
|
|
848
850
|
isContainer: !1,
|
|
849
851
|
defaultProps: qt,
|
|
850
|
-
defaultStyle:
|
|
852
|
+
defaultStyle: Kt,
|
|
851
853
|
rendererComponent: tn,
|
|
852
854
|
propertyEditorComponent: on,
|
|
853
855
|
propertyFields: [
|
|
@@ -862,7 +864,7 @@ const Kt = { class: "brick-el-image" }, Qt = ["src"], Zt = {
|
|
|
862
864
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] },
|
|
863
865
|
{ key: "style.opacity", label: "Opacity", section: "advanced", type: "slider", min: 0, max: 1, step: 0.1, defaultValue: 1 }
|
|
864
866
|
],
|
|
865
|
-
toPdfmake:
|
|
867
|
+
toPdfmake: Gt
|
|
866
868
|
};
|
|
867
869
|
function ln() {
|
|
868
870
|
return { ordered: !1, items: ["Item 1", "Item 2", "Item 3"] };
|
|
@@ -871,8 +873,8 @@ function sn() {
|
|
|
871
873
|
return { fontSize: 12 };
|
|
872
874
|
}
|
|
873
875
|
function an(e) {
|
|
874
|
-
const t = e.props.items,
|
|
875
|
-
return e.style.fontSize && (
|
|
876
|
+
const t = e.props.items, i = e.props.ordered ? { ol: t } : { ul: t };
|
|
877
|
+
return e.style.fontSize && (i.fontSize = e.style.fontSize), e.style.color && (i.color = e.style.color), e.style.margin && (i.margin = e.style.margin), i;
|
|
876
878
|
}
|
|
877
879
|
const cn = /* @__PURE__ */ _({
|
|
878
880
|
__name: "ListRenderer",
|
|
@@ -880,13 +882,13 @@ const cn = /* @__PURE__ */ _({
|
|
|
880
882
|
node: {}
|
|
881
883
|
},
|
|
882
884
|
setup(e) {
|
|
883
|
-
return (t, n) => (
|
|
885
|
+
return (t, n) => (a(), c("div", {
|
|
884
886
|
class: "brick-el-list",
|
|
885
887
|
style: N({ fontSize: (e.node.style.fontSize ?? 12) + "px", color: e.node.style.color })
|
|
886
888
|
}, [
|
|
887
|
-
(
|
|
888
|
-
default:
|
|
889
|
-
(
|
|
889
|
+
(a(), M(te(e.node.props.ordered ? "ol" : "ul"), null, {
|
|
890
|
+
default: Y(() => [
|
|
891
|
+
(a(!0), c(C, null, P(e.node.props.items, (i, s) => (a(), c("li", { key: s }, w(i), 1))), 128))
|
|
890
892
|
]),
|
|
891
893
|
_: 1
|
|
892
894
|
}))
|
|
@@ -898,7 +900,7 @@ const cn = /* @__PURE__ */ _({
|
|
|
898
900
|
node: {}
|
|
899
901
|
},
|
|
900
902
|
setup(e) {
|
|
901
|
-
return (t, n) => (
|
|
903
|
+
return (t, n) => (a(), c("div", un));
|
|
902
904
|
}
|
|
903
905
|
}), fn = {
|
|
904
906
|
type: "list",
|
|
@@ -920,10 +922,10 @@ Item 3` },
|
|
|
920
922
|
],
|
|
921
923
|
toPdfmake: an
|
|
922
924
|
};
|
|
923
|
-
function
|
|
925
|
+
function yn() {
|
|
924
926
|
return { data: "https://example.com", fit: 100 };
|
|
925
927
|
}
|
|
926
|
-
function
|
|
928
|
+
function mn() {
|
|
927
929
|
return {};
|
|
928
930
|
}
|
|
929
931
|
function gn(e) {
|
|
@@ -939,7 +941,7 @@ const bn = { class: "brick-el-qr__preview" }, vn = /* @__PURE__ */ _({
|
|
|
939
941
|
node: {}
|
|
940
942
|
},
|
|
941
943
|
setup(e) {
|
|
942
|
-
return (t, n) => (
|
|
944
|
+
return (t, n) => (a(), c("div", {
|
|
943
945
|
class: "brick-el-qr",
|
|
944
946
|
style: N({
|
|
945
947
|
width: (e.node.props.fit ?? 100) + "px",
|
|
@@ -955,15 +957,15 @@ const bn = { class: "brick-el-qr__preview" }, vn = /* @__PURE__ */ _({
|
|
|
955
957
|
node: {}
|
|
956
958
|
},
|
|
957
959
|
setup(e) {
|
|
958
|
-
return (t, n) => (
|
|
960
|
+
return (t, n) => (a(), c("div", _n));
|
|
959
961
|
}
|
|
960
962
|
}), Sn = {
|
|
961
963
|
type: "qr",
|
|
962
964
|
label: "QR Code",
|
|
963
965
|
icon: "⊞",
|
|
964
966
|
isContainer: !1,
|
|
965
|
-
defaultProps:
|
|
966
|
-
defaultStyle:
|
|
967
|
+
defaultProps: yn,
|
|
968
|
+
defaultStyle: mn,
|
|
967
969
|
rendererComponent: hn,
|
|
968
970
|
propertyEditorComponent: kn,
|
|
969
971
|
propertyFields: [
|
|
@@ -1000,7 +1002,7 @@ const Pn = ["innerHTML"], En = /* @__PURE__ */ _({
|
|
|
1000
1002
|
node: {}
|
|
1001
1003
|
},
|
|
1002
1004
|
setup(e) {
|
|
1003
|
-
return (t, n) => (
|
|
1005
|
+
return (t, n) => (a(), c("div", {
|
|
1004
1006
|
class: "brick-el-svg",
|
|
1005
1007
|
style: N({
|
|
1006
1008
|
width: e.node.props.width + "px",
|
|
@@ -1015,7 +1017,7 @@ const Pn = ["innerHTML"], En = /* @__PURE__ */ _({
|
|
|
1015
1017
|
node: {}
|
|
1016
1018
|
},
|
|
1017
1019
|
setup(e) {
|
|
1018
|
-
return (t, n) => (
|
|
1020
|
+
return (t, n) => (a(), c("div", $n));
|
|
1019
1021
|
}
|
|
1020
1022
|
}), Nn = {
|
|
1021
1023
|
type: "svg",
|
|
@@ -1054,7 +1056,7 @@ const Ln = { class: "brick-el-pagebreak" }, Mn = /* @__PURE__ */ _({
|
|
|
1054
1056
|
node: {}
|
|
1055
1057
|
},
|
|
1056
1058
|
setup(e) {
|
|
1057
|
-
return (t, n) => (
|
|
1059
|
+
return (t, n) => (a(), c("div", Ln, [...n[0] || (n[0] = [
|
|
1058
1060
|
m("hr", null, null, -1),
|
|
1059
1061
|
m("span", null, "Page Break", -1),
|
|
1060
1062
|
m("hr", null, null, -1)
|
|
@@ -1066,7 +1068,7 @@ const Ln = { class: "brick-el-pagebreak" }, Mn = /* @__PURE__ */ _({
|
|
|
1066
1068
|
node: {}
|
|
1067
1069
|
},
|
|
1068
1070
|
setup(e) {
|
|
1069
|
-
return (t, n) => (
|
|
1071
|
+
return (t, n) => (a(), c("div", On, [...n[0] || (n[0] = [
|
|
1070
1072
|
m("p", { style: { color: "#999", "font-size": "12px" } }, "No configurable properties.", -1)
|
|
1071
1073
|
])]));
|
|
1072
1074
|
}
|
|
@@ -1083,10 +1085,10 @@ const Ln = { class: "brick-el-pagebreak" }, Mn = /* @__PURE__ */ _({
|
|
|
1083
1085
|
toPdfmake: Dn
|
|
1084
1086
|
};
|
|
1085
1087
|
let fe = !1;
|
|
1086
|
-
function
|
|
1088
|
+
function Fn() {
|
|
1087
1089
|
fe || (fe = !0, z(We), z(Ze), z(st), z(Yt), z(rn), z(fn), z(Sn), z(Nn), z(Vn));
|
|
1088
1090
|
}
|
|
1089
|
-
const
|
|
1091
|
+
const Hn = {
|
|
1090
1092
|
key: 0,
|
|
1091
1093
|
class: "brick-dropzone__empty"
|
|
1092
1094
|
}, Jn = /* @__PURE__ */ _({
|
|
@@ -1097,19 +1099,19 @@ const Fn = {
|
|
|
1097
1099
|
},
|
|
1098
1100
|
setup(e) {
|
|
1099
1101
|
const t = e, n = E(null);
|
|
1100
|
-
let
|
|
1101
|
-
const
|
|
1102
|
-
return
|
|
1103
|
-
n.value && (
|
|
1104
|
-
}),
|
|
1105
|
-
|
|
1106
|
-
}), (
|
|
1102
|
+
let i = null;
|
|
1103
|
+
const s = xe(), { isDragging: o } = s;
|
|
1104
|
+
return ye(() => {
|
|
1105
|
+
n.value && (i = s.initContainer(n.value, t.parentId));
|
|
1106
|
+
}), me(() => {
|
|
1107
|
+
i?.destroy();
|
|
1108
|
+
}), (p, f) => (a(), c("div", {
|
|
1107
1109
|
ref_key: "el",
|
|
1108
1110
|
ref: n,
|
|
1109
1111
|
class: ee(["brick-dropzone", { "brick-dropzone--horizontal": e.layout === "horizontal", "brick-dropzone--drag-active": k(o) && e.layout === "horizontal" }])
|
|
1110
1112
|
}, [
|
|
1111
|
-
Z(
|
|
1112
|
-
|
|
1113
|
+
Z(p.$slots, "default", {}, void 0, !0),
|
|
1114
|
+
p.$slots.default ? $("", !0) : (a(), c("div", Hn, " Drop elements here "))
|
|
1113
1115
|
], 2));
|
|
1114
1116
|
}
|
|
1115
1117
|
}), $e = /* @__PURE__ */ x(Jn, [["__scopeId", "data-v-b9596dad"]]), Un = ["data-element-id", "data-element-type"], Wn = {
|
|
@@ -1122,52 +1124,52 @@ const Fn = {
|
|
|
1122
1124
|
path: {}
|
|
1123
1125
|
},
|
|
1124
1126
|
setup(e) {
|
|
1125
|
-
const t = e, n = W(),
|
|
1126
|
-
function r(
|
|
1127
|
-
|
|
1127
|
+
const t = e, n = W(), i = j(), s = E(null), o = I(() => U(t.node.type)), p = I(() => n.selectedId.value === t.node.id), f = I(() => o.value ? o.value.propertyFields.some((y) => y.key === "props.width" || y.key === "style.width") : !1), d = I(() => o.value ? o.value.propertyFields.some((y) => y.key === "props.height" || y.key === "style.height") : !1);
|
|
1128
|
+
function r(y) {
|
|
1129
|
+
y.stopPropagation(), n.select(t.node.id);
|
|
1128
1130
|
}
|
|
1129
|
-
function
|
|
1130
|
-
|
|
1131
|
-
const
|
|
1131
|
+
function l(y) {
|
|
1132
|
+
y.stopPropagation(), y.preventDefault();
|
|
1133
|
+
const g = y.clientX, v = s.value?.offsetWidth ?? 200;
|
|
1132
1134
|
function h(R) {
|
|
1133
|
-
const O = R.clientX -
|
|
1134
|
-
o.value?.propertyFields.some((
|
|
1135
|
+
const O = R.clientX - g, T = Math.max(20, v + O);
|
|
1136
|
+
o.value?.propertyFields.some((F) => F.key === "props.width") ? i.updateProps(t.node.id, { width: Math.round(T) }) : i.updateStyle(t.node.id, { width: Math.round(T) });
|
|
1135
1137
|
}
|
|
1136
1138
|
function S() {
|
|
1137
1139
|
document.removeEventListener("pointermove", h), document.removeEventListener("pointerup", S), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1138
1140
|
}
|
|
1139
1141
|
document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", h), document.addEventListener("pointerup", S);
|
|
1140
1142
|
}
|
|
1141
|
-
function y
|
|
1142
|
-
|
|
1143
|
-
const
|
|
1143
|
+
function u(y) {
|
|
1144
|
+
y.stopPropagation(), y.preventDefault();
|
|
1145
|
+
const g = y.clientY, v = s.value?.offsetHeight ?? 100;
|
|
1144
1146
|
function h(R) {
|
|
1145
|
-
const O = R.clientY -
|
|
1146
|
-
o.value?.propertyFields.some((
|
|
1147
|
+
const O = R.clientY - g, T = Math.max(20, v + O);
|
|
1148
|
+
o.value?.propertyFields.some((F) => F.key === "props.height") ? i.updateProps(t.node.id, { height: Math.round(T) }) : i.updateStyle(t.node.id, { height: Math.round(T) });
|
|
1147
1149
|
}
|
|
1148
1150
|
function S() {
|
|
1149
1151
|
document.removeEventListener("pointermove", h), document.removeEventListener("pointerup", S), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1150
1152
|
}
|
|
1151
1153
|
document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", h), document.addEventListener("pointerup", S);
|
|
1152
1154
|
}
|
|
1153
|
-
function
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1155
|
+
function b(y) {
|
|
1156
|
+
y.stopPropagation(), y.preventDefault();
|
|
1157
|
+
const g = y.clientX, v = y.clientY, h = s.value?.offsetWidth ?? 200, S = s.value?.offsetHeight ?? 100;
|
|
1156
1158
|
function R(T) {
|
|
1157
|
-
const
|
|
1158
|
-
Re ?
|
|
1159
|
+
const K = T.clientX - g, F = T.clientY - v, re = Math.max(20, h + K), le = Math.max(20, S + F), Re = o.value?.propertyFields.some((G) => G.key === "props.width"), Ne = o.value?.propertyFields.some((G) => G.key === "props.height");
|
|
1160
|
+
Re ? i.updateProps(t.node.id, { width: Math.round(re) }) : i.updateStyle(t.node.id, { width: Math.round(re) }), Ne ? i.updateProps(t.node.id, { height: Math.round(le) }) : i.updateStyle(t.node.id, { height: Math.round(le) });
|
|
1159
1161
|
}
|
|
1160
1162
|
function O() {
|
|
1161
1163
|
document.removeEventListener("pointermove", R), document.removeEventListener("pointerup", O), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1162
1164
|
}
|
|
1163
1165
|
document.body.style.cursor = "nwse-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", R), document.addEventListener("pointerup", O);
|
|
1164
1166
|
}
|
|
1165
|
-
return (
|
|
1167
|
+
return (y, g) => {
|
|
1166
1168
|
const v = Te("CanvasElement", !0);
|
|
1167
|
-
return
|
|
1169
|
+
return a(), c("div", {
|
|
1168
1170
|
ref_key: "elRef",
|
|
1169
|
-
ref:
|
|
1170
|
-
class: ee(["brick-canvas-element", { "brick-canvas-element--selected":
|
|
1171
|
+
ref: s,
|
|
1172
|
+
class: ee(["brick-canvas-element", { "brick-canvas-element--selected": p.value }]),
|
|
1171
1173
|
"data-element-id": e.node.id,
|
|
1172
1174
|
"data-element-type": e.node.type,
|
|
1173
1175
|
style: N({
|
|
@@ -1181,19 +1183,19 @@ const Fn = {
|
|
|
1181
1183
|
}),
|
|
1182
1184
|
onClick: r
|
|
1183
1185
|
}, [
|
|
1184
|
-
o.value ? (
|
|
1186
|
+
o.value ? (a(), M(te(o.value.rendererComponent), {
|
|
1185
1187
|
key: 0,
|
|
1186
1188
|
node: e.node,
|
|
1187
1189
|
path: e.path
|
|
1188
1190
|
}, {
|
|
1189
|
-
default:
|
|
1190
|
-
o.value.isContainer ? (
|
|
1191
|
+
default: Y(() => [
|
|
1192
|
+
o.value.isContainer ? (a(), M($e, {
|
|
1191
1193
|
key: 0,
|
|
1192
1194
|
"parent-id": e.node.id,
|
|
1193
1195
|
layout: e.node.type === "columns" ? "horizontal" : "vertical"
|
|
1194
1196
|
}, {
|
|
1195
|
-
default:
|
|
1196
|
-
(
|
|
1197
|
+
default: Y(() => [
|
|
1198
|
+
(a(!0), c(C, null, P(e.node.children, (h, S) => (a(), M(v, {
|
|
1197
1199
|
key: h.id,
|
|
1198
1200
|
node: h,
|
|
1199
1201
|
path: [...e.path, S]
|
|
@@ -1203,28 +1205,28 @@ const Fn = {
|
|
|
1203
1205
|
}, 8, ["parent-id", "layout"])) : $("", !0)
|
|
1204
1206
|
]),
|
|
1205
1207
|
_: 1
|
|
1206
|
-
}, 8, ["node", "path"])) : (
|
|
1207
|
-
|
|
1208
|
-
|
|
1208
|
+
}, 8, ["node", "path"])) : (a(), c("div", Wn, " Unknown element: " + w(e.node.type), 1)),
|
|
1209
|
+
p.value ? (a(), c(C, { key: 2 }, [
|
|
1210
|
+
f.value ? (a(), c("div", {
|
|
1209
1211
|
key: 0,
|
|
1210
1212
|
class: "brick-resize-handle brick-resize-handle--e",
|
|
1211
|
-
onPointerdown:
|
|
1213
|
+
onPointerdown: l
|
|
1212
1214
|
}, null, 32)) : $("", !0),
|
|
1213
|
-
|
|
1215
|
+
d.value ? (a(), c("div", {
|
|
1214
1216
|
key: 1,
|
|
1215
1217
|
class: "brick-resize-handle brick-resize-handle--s",
|
|
1216
|
-
onPointerdown:
|
|
1218
|
+
onPointerdown: u
|
|
1217
1219
|
}, null, 32)) : $("", !0),
|
|
1218
|
-
|
|
1220
|
+
f.value && d.value ? (a(), c("div", {
|
|
1219
1221
|
key: 2,
|
|
1220
1222
|
class: "brick-resize-handle brick-resize-handle--se",
|
|
1221
|
-
onPointerdown:
|
|
1223
|
+
onPointerdown: b
|
|
1222
1224
|
}, null, 32)) : $("", !0)
|
|
1223
1225
|
], 64)) : $("", !0)
|
|
1224
1226
|
], 14, Un);
|
|
1225
1227
|
};
|
|
1226
1228
|
}
|
|
1227
|
-
}), Yn = /* @__PURE__ */ x(jn, [["__scopeId", "data-v-6b9cadc1"]]), qn = { class: "brick-doc-bar" },
|
|
1229
|
+
}), Yn = /* @__PURE__ */ x(jn, [["__scopeId", "data-v-6b9cadc1"]]), qn = { class: "brick-doc-bar" }, Kn = { class: "brick-doc-bar__field" }, Gn = ["value"], Xn = { class: "brick-doc-bar__field" }, Qn = { class: "brick-doc-bar__field brick-doc-bar__field--margins" }, Zn = { class: "brick-doc-bar__margins" }, eo = ["placeholder", "title", "value", "onInput"], to = { class: "brick-doc-bar__field" }, no = ["value"], oo = /* @__PURE__ */ _({
|
|
1228
1230
|
__name: "DocumentSettings",
|
|
1229
1231
|
setup(e) {
|
|
1230
1232
|
const t = oe(), n = [
|
|
@@ -1234,28 +1236,28 @@ const Fn = {
|
|
|
1234
1236
|
{ label: "Letter", value: "LETTER" },
|
|
1235
1237
|
{ label: "Legal", value: "LEGAL" }
|
|
1236
1238
|
];
|
|
1237
|
-
function
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1239
|
+
function i(s, o) {
|
|
1240
|
+
const p = [...t.document.pageMargins];
|
|
1241
|
+
p[s] = o, t.document.pageMargins = p;
|
|
1240
1242
|
}
|
|
1241
|
-
return (
|
|
1242
|
-
m("div",
|
|
1243
|
+
return (s, o) => (a(), c("div", qn, [
|
|
1244
|
+
m("div", Kn, [
|
|
1243
1245
|
o[3] || (o[3] = m("label", null, "Size", -1)),
|
|
1244
|
-
|
|
1245
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1246
|
+
X(m("select", {
|
|
1247
|
+
"onUpdate:modelValue": o[0] || (o[0] = (p) => k(t).document.pageSize = p)
|
|
1246
1248
|
}, [
|
|
1247
|
-
(
|
|
1248
|
-
key:
|
|
1249
|
-
value:
|
|
1250
|
-
}, w(
|
|
1249
|
+
(a(), c(C, null, P(n, (p) => m("option", {
|
|
1250
|
+
key: p.value,
|
|
1251
|
+
value: p.value
|
|
1252
|
+
}, w(p.label), 9, Gn)), 64))
|
|
1251
1253
|
], 512), [
|
|
1252
1254
|
[se, k(t).document.pageSize]
|
|
1253
1255
|
])
|
|
1254
1256
|
]),
|
|
1255
|
-
m("div",
|
|
1257
|
+
m("div", Xn, [
|
|
1256
1258
|
o[5] || (o[5] = m("label", null, "Orientation", -1)),
|
|
1257
|
-
|
|
1258
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
1259
|
+
X(m("select", {
|
|
1260
|
+
"onUpdate:modelValue": o[1] || (o[1] = (p) => k(t).document.pageOrientation = p)
|
|
1259
1261
|
}, [...o[4] || (o[4] = [
|
|
1260
1262
|
m("option", { value: "portrait" }, "Portrait", -1),
|
|
1261
1263
|
m("option", { value: "landscape" }, "Landscape", -1)
|
|
@@ -1266,13 +1268,13 @@ const Fn = {
|
|
|
1266
1268
|
m("div", Qn, [
|
|
1267
1269
|
o[6] || (o[6] = m("label", null, "Margins", -1)),
|
|
1268
1270
|
m("div", Zn, [
|
|
1269
|
-
(
|
|
1270
|
-
key:
|
|
1271
|
+
(a(), c(C, null, P(["L", "T", "R", "B"], (p, f) => m("input", {
|
|
1272
|
+
key: f,
|
|
1271
1273
|
type: "number",
|
|
1272
|
-
placeholder:
|
|
1273
|
-
title:
|
|
1274
|
-
value: k(t).document.pageMargins[
|
|
1275
|
-
onInput: (
|
|
1274
|
+
placeholder: p,
|
|
1275
|
+
title: p,
|
|
1276
|
+
value: k(t).document.pageMargins[f],
|
|
1277
|
+
onInput: (d) => i(f, Number(d.target.value))
|
|
1276
1278
|
}, null, 40, eo)), 64))
|
|
1277
1279
|
])
|
|
1278
1280
|
]),
|
|
@@ -1283,7 +1285,7 @@ const Fn = {
|
|
|
1283
1285
|
value: k(t).document.defaultStyle?.fontSize ?? 12,
|
|
1284
1286
|
min: "6",
|
|
1285
1287
|
max: "72",
|
|
1286
|
-
onInput: o[2] || (o[2] = (
|
|
1288
|
+
onInput: o[2] || (o[2] = (p) => (k(t).document.defaultStyle ??= {}).fontSize = Number(p.target.value))
|
|
1287
1289
|
}, null, 40, no)
|
|
1288
1290
|
])
|
|
1289
1291
|
]));
|
|
@@ -1291,32 +1293,32 @@ const Fn = {
|
|
|
1291
1293
|
}), ro = /* @__PURE__ */ x(oo, [["__scopeId", "data-v-39a2b54f"]]), lo = { class: "brick-canvas" }, V = 0.75, io = /* @__PURE__ */ _({
|
|
1292
1294
|
__name: "DesignCanvas",
|
|
1293
1295
|
setup(e) {
|
|
1294
|
-
const t = oe(), n = W(),
|
|
1296
|
+
const t = oe(), n = W(), i = {
|
|
1295
1297
|
A3: [841.89, 1190.55],
|
|
1296
1298
|
A4: [595.28, 841.89],
|
|
1297
1299
|
A5: [419.53, 595.28],
|
|
1298
1300
|
LETTER: [612, 792],
|
|
1299
1301
|
LEGAL: [612, 1008]
|
|
1300
|
-
},
|
|
1301
|
-
const [
|
|
1302
|
+
}, s = I(() => {
|
|
1303
|
+
const [f, d] = i[t.document.pageSize] ?? i.A4, r = t.document.pageOrientation === "landscape" ? d : f;
|
|
1302
1304
|
return Math.round(r * V);
|
|
1303
1305
|
}), o = I(() => {
|
|
1304
|
-
const [
|
|
1306
|
+
const [f, d] = i[t.document.pageSize] ?? i.A4, r = t.document.pageOrientation === "landscape" ? f : d;
|
|
1305
1307
|
return Math.round(r * V);
|
|
1306
1308
|
});
|
|
1307
|
-
function
|
|
1308
|
-
(
|
|
1309
|
+
function p(f) {
|
|
1310
|
+
(f.target === f.currentTarget || f.target.classList.contains("brick-canvas__page")) && n.deselect();
|
|
1309
1311
|
}
|
|
1310
|
-
return (
|
|
1312
|
+
return (f, d) => (a(), c("div", lo, [
|
|
1311
1313
|
B(ro),
|
|
1312
1314
|
m("div", {
|
|
1313
1315
|
class: "brick-canvas__scroll",
|
|
1314
|
-
onClick:
|
|
1316
|
+
onClick: p
|
|
1315
1317
|
}, [
|
|
1316
1318
|
m("div", {
|
|
1317
1319
|
class: "brick-canvas__page",
|
|
1318
1320
|
style: N({
|
|
1319
|
-
width:
|
|
1321
|
+
width: s.value + "px",
|
|
1320
1322
|
minHeight: o.value + "px",
|
|
1321
1323
|
paddingTop: k(t).document.pageMargins[1] * V + "px",
|
|
1322
1324
|
paddingRight: k(t).document.pageMargins[2] * V + "px",
|
|
@@ -1325,11 +1327,11 @@ const Fn = {
|
|
|
1325
1327
|
})
|
|
1326
1328
|
}, [
|
|
1327
1329
|
B($e, { "parent-id": null }, {
|
|
1328
|
-
default:
|
|
1329
|
-
(
|
|
1330
|
+
default: Y(() => [
|
|
1331
|
+
(a(!0), c(C, null, P(k(t).document.content, (r, l) => (a(), M(Yn, {
|
|
1330
1332
|
key: r.id,
|
|
1331
1333
|
node: r,
|
|
1332
|
-
path: [
|
|
1334
|
+
path: [l]
|
|
1333
1335
|
}, null, 8, ["node", "path"]))), 128))
|
|
1334
1336
|
]),
|
|
1335
1337
|
_: 1
|
|
@@ -1343,27 +1345,27 @@ const Fn = {
|
|
|
1343
1345
|
setup(e) {
|
|
1344
1346
|
const t = E(null);
|
|
1345
1347
|
let n = null;
|
|
1346
|
-
const
|
|
1347
|
-
return
|
|
1348
|
-
t.value && (n =
|
|
1349
|
-
}),
|
|
1348
|
+
const i = xe(), s = Be();
|
|
1349
|
+
return ye(() => {
|
|
1350
|
+
t.value && (n = i.initToolbar(t.value));
|
|
1351
|
+
}), me(() => {
|
|
1350
1352
|
n?.destroy();
|
|
1351
|
-
}), (o,
|
|
1353
|
+
}), (o, p) => (a(), c("div", {
|
|
1352
1354
|
ref_key: "el",
|
|
1353
1355
|
ref: t,
|
|
1354
1356
|
class: "brick-element-list"
|
|
1355
1357
|
}, [
|
|
1356
|
-
(
|
|
1357
|
-
key:
|
|
1358
|
+
(a(!0), c(C, null, P(k(s), (f) => (a(), c("div", {
|
|
1359
|
+
key: f.type,
|
|
1358
1360
|
class: "brick-element-list__item",
|
|
1359
|
-
"data-element-type":
|
|
1361
|
+
"data-element-type": f.type
|
|
1360
1362
|
}, [
|
|
1361
|
-
m("span", co, w(
|
|
1362
|
-
m("span", uo, w(
|
|
1363
|
+
m("span", co, w(f.icon), 1),
|
|
1364
|
+
m("span", uo, w(f.label), 1)
|
|
1363
1365
|
], 8, ao))), 128))
|
|
1364
1366
|
], 512));
|
|
1365
1367
|
}
|
|
1366
|
-
}), fo = /* @__PURE__ */ x(po, [["__scopeId", "data-v-2d0b1dbf"]]),
|
|
1368
|
+
}), fo = /* @__PURE__ */ x(po, [["__scopeId", "data-v-2d0b1dbf"]]), yo = { class: "brick-field" }, mo = { class: "brick-field__label" }, go = ["value"], bo = ["value"], vo = ["value", "min", "max", "step"], ho = ["value"], _o = ["value"], ko = ["value"], So = {
|
|
1367
1369
|
key: 5,
|
|
1368
1370
|
class: "brick-field__toggle"
|
|
1369
1371
|
}, xo = ["checked"], Co = {
|
|
@@ -1379,189 +1381,204 @@ const Fn = {
|
|
|
1379
1381
|
node: {}
|
|
1380
1382
|
},
|
|
1381
1383
|
setup(e) {
|
|
1382
|
-
const t = e, n =
|
|
1383
|
-
const
|
|
1384
|
+
const t = e, n = j(), i = I(() => {
|
|
1385
|
+
const d = t.descriptor.key.split("."), r = d[0], l = d[1];
|
|
1384
1386
|
if (r === "props")
|
|
1385
|
-
return t.node.props[
|
|
1387
|
+
return t.node.props[l];
|
|
1386
1388
|
if (r === "style")
|
|
1387
|
-
return t.node.style[
|
|
1388
|
-
}),
|
|
1389
|
-
const
|
|
1390
|
-
return t.descriptor.type === "textarea" && Array.isArray(
|
|
1391
|
-
`) :
|
|
1389
|
+
return t.node.style[l];
|
|
1390
|
+
}), s = I(() => {
|
|
1391
|
+
const d = i.value;
|
|
1392
|
+
return t.descriptor.type === "textarea" && Array.isArray(d) ? d.join(`
|
|
1393
|
+
`) : d;
|
|
1392
1394
|
});
|
|
1393
|
-
function o(
|
|
1394
|
-
const r = t.descriptor.key.split("."),
|
|
1395
|
-
let
|
|
1396
|
-
t.descriptor.type === "textarea" && Array.isArray(
|
|
1397
|
-
`)),
|
|
1395
|
+
function o(d) {
|
|
1396
|
+
const r = t.descriptor.key.split("."), l = r[0], u = r[1];
|
|
1397
|
+
let b = d;
|
|
1398
|
+
t.descriptor.type === "textarea" && Array.isArray(i.value) && (b = d.split(`
|
|
1399
|
+
`)), l === "props" ? n.updateProps(t.node.id, { [u]: b }) : l === "style" && n.updateStyle(t.node.id, { [u]: b });
|
|
1398
1400
|
}
|
|
1399
|
-
function
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1401
|
+
function p(d, r) {
|
|
1402
|
+
const u = [...s.value ?? [0, 0, 0, 0]];
|
|
1403
|
+
u[d] = r, o(u);
|
|
1402
1404
|
}
|
|
1403
|
-
function
|
|
1404
|
-
const
|
|
1405
|
-
if (!
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1408
|
-
o(
|
|
1409
|
-
},
|
|
1405
|
+
function f(d) {
|
|
1406
|
+
const l = d.target.files?.[0];
|
|
1407
|
+
if (!l) return;
|
|
1408
|
+
const u = new FileReader();
|
|
1409
|
+
u.onload = () => {
|
|
1410
|
+
o(u.result);
|
|
1411
|
+
}, u.readAsDataURL(l);
|
|
1410
1412
|
}
|
|
1411
|
-
return (
|
|
1412
|
-
m("label",
|
|
1413
|
-
e.descriptor.type === "text" ? (
|
|
1413
|
+
return (d, r) => (a(), c("div", yo, [
|
|
1414
|
+
m("label", mo, w(e.descriptor.label), 1),
|
|
1415
|
+
e.descriptor.type === "text" ? (a(), c("input", {
|
|
1414
1416
|
key: 0,
|
|
1415
1417
|
type: "text",
|
|
1416
1418
|
class: "brick-field__input",
|
|
1417
|
-
value:
|
|
1418
|
-
onInput: r[0] || (r[0] = (
|
|
1419
|
-
}, null, 40, go)) : e.descriptor.type === "textarea" ? (
|
|
1419
|
+
value: s.value,
|
|
1420
|
+
onInput: r[0] || (r[0] = (l) => o(l.target.value))
|
|
1421
|
+
}, null, 40, go)) : e.descriptor.type === "textarea" ? (a(), c("textarea", {
|
|
1420
1422
|
key: 1,
|
|
1421
1423
|
class: "brick-field__textarea",
|
|
1422
|
-
value:
|
|
1424
|
+
value: s.value,
|
|
1423
1425
|
rows: "3",
|
|
1424
|
-
onInput: r[1] || (r[1] = (
|
|
1425
|
-
}, null, 40, bo)) : e.descriptor.type === "number" ? (
|
|
1426
|
+
onInput: r[1] || (r[1] = (l) => o(l.target.value))
|
|
1427
|
+
}, null, 40, bo)) : e.descriptor.type === "number" ? (a(), c("input", {
|
|
1426
1428
|
key: 2,
|
|
1427
1429
|
type: "number",
|
|
1428
1430
|
class: "brick-field__input",
|
|
1429
|
-
value:
|
|
1431
|
+
value: s.value,
|
|
1430
1432
|
min: e.descriptor.min,
|
|
1431
1433
|
max: e.descriptor.max,
|
|
1432
1434
|
step: e.descriptor.step,
|
|
1433
|
-
onInput: r[2] || (r[2] = (
|
|
1434
|
-
}, null, 40, vo)) : e.descriptor.type === "color" ? (
|
|
1435
|
+
onInput: r[2] || (r[2] = (l) => o(Number(l.target.value)))
|
|
1436
|
+
}, null, 40, vo)) : e.descriptor.type === "color" ? (a(), c("input", {
|
|
1435
1437
|
key: 3,
|
|
1436
1438
|
type: "color",
|
|
1437
1439
|
class: "brick-field__color",
|
|
1438
|
-
value:
|
|
1439
|
-
onInput: r[3] || (r[3] = (
|
|
1440
|
-
}, null, 40, ho)) : e.descriptor.type === "select" ? (
|
|
1440
|
+
value: s.value ?? "#000000",
|
|
1441
|
+
onInput: r[3] || (r[3] = (l) => o(l.target.value))
|
|
1442
|
+
}, null, 40, ho)) : e.descriptor.type === "select" ? (a(), c("select", {
|
|
1441
1443
|
key: 4,
|
|
1442
1444
|
class: "brick-field__select",
|
|
1443
|
-
value:
|
|
1444
|
-
onChange: r[4] || (r[4] = (
|
|
1445
|
+
value: s.value,
|
|
1446
|
+
onChange: r[4] || (r[4] = (l) => o(l.target.value || void 0))
|
|
1445
1447
|
}, [
|
|
1446
|
-
(
|
|
1447
|
-
key: String(
|
|
1448
|
-
value:
|
|
1449
|
-
}, w(
|
|
1450
|
-
], 40, _o)) : e.descriptor.type === "toggle" ? (
|
|
1448
|
+
(a(!0), c(C, null, P(e.descriptor.options, (l) => (a(), c("option", {
|
|
1449
|
+
key: String(l.value),
|
|
1450
|
+
value: l.value
|
|
1451
|
+
}, w(l.label), 9, ko))), 128))
|
|
1452
|
+
], 40, _o)) : e.descriptor.type === "toggle" ? (a(), c("label", So, [
|
|
1451
1453
|
m("input", {
|
|
1452
1454
|
type: "checkbox",
|
|
1453
|
-
checked:
|
|
1454
|
-
onChange: r[5] || (r[5] = (
|
|
1455
|
+
checked: s.value,
|
|
1456
|
+
onChange: r[5] || (r[5] = (l) => o(l.target.checked))
|
|
1455
1457
|
}, null, 40, xo),
|
|
1456
|
-
m("span", null, w(
|
|
1457
|
-
])) : e.descriptor.type === "margin" ? (
|
|
1458
|
-
(
|
|
1459
|
-
key:
|
|
1458
|
+
m("span", null, w(s.value ? "On" : "Off"), 1)
|
|
1459
|
+
])) : e.descriptor.type === "margin" ? (a(), c("div", Co, [
|
|
1460
|
+
(a(), c(C, null, P(["L", "T", "R", "B"], (l, u) => m("input", {
|
|
1461
|
+
key: l,
|
|
1460
1462
|
type: "number",
|
|
1461
1463
|
class: "brick-field__margin-input",
|
|
1462
|
-
placeholder:
|
|
1463
|
-
value: (
|
|
1464
|
-
onInput: (
|
|
1464
|
+
placeholder: l,
|
|
1465
|
+
value: (s.value ?? [0, 0, 0, 0])[u],
|
|
1466
|
+
onInput: (b) => p(u, Number(b.target.value))
|
|
1465
1467
|
}, null, 40, wo)), 64))
|
|
1466
|
-
])) : e.descriptor.type === "slider" ? (
|
|
1468
|
+
])) : e.descriptor.type === "slider" ? (a(), c("div", Po, [
|
|
1467
1469
|
m("input", {
|
|
1468
1470
|
type: "range",
|
|
1469
|
-
value:
|
|
1471
|
+
value: s.value,
|
|
1470
1472
|
min: e.descriptor.min,
|
|
1471
1473
|
max: e.descriptor.max,
|
|
1472
1474
|
step: e.descriptor.step,
|
|
1473
|
-
onInput: r[6] || (r[6] = (
|
|
1475
|
+
onInput: r[6] || (r[6] = (l) => o(Number(l.target.value)))
|
|
1474
1476
|
}, null, 40, Eo),
|
|
1475
|
-
m("span", Io, w(
|
|
1476
|
-
])) : e.descriptor.type === "file" ? (
|
|
1477
|
+
m("span", Io, w(s.value), 1)
|
|
1478
|
+
])) : e.descriptor.type === "file" ? (a(), c("input", {
|
|
1477
1479
|
key: 8,
|
|
1478
1480
|
type: "file",
|
|
1479
1481
|
accept: "image/*",
|
|
1480
1482
|
class: "brick-field__file",
|
|
1481
|
-
onChange:
|
|
1483
|
+
onChange: f
|
|
1482
1484
|
}, null, 32)) : $("", !0)
|
|
1483
1485
|
]));
|
|
1484
1486
|
}
|
|
1485
1487
|
}), Ro = /* @__PURE__ */ x($o, [["__scopeId", "data-v-5a3bec1b"]]), No = {
|
|
1486
1488
|
key: 0,
|
|
1487
1489
|
class: "brick-property-editor"
|
|
1488
|
-
}, zo = { class: "brick-property-editor__type" }, To = {
|
|
1490
|
+
}, zo = { class: "brick-property-editor__type" }, To = { class: "brick-property-editor__key" }, Do = ["value"], Lo = {
|
|
1489
1491
|
key: 0,
|
|
1490
1492
|
class: "brick-property-editor__group"
|
|
1491
|
-
},
|
|
1493
|
+
}, Mo = { class: "brick-property-editor__group-title" }, Bo = /* @__PURE__ */ _({
|
|
1492
1494
|
__name: "PropertyEditor",
|
|
1493
1495
|
setup(e) {
|
|
1494
|
-
const t = W(), n =
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1496
|
+
const t = W(), n = j();
|
|
1497
|
+
function i(d) {
|
|
1498
|
+
const r = t.selectedNode.value;
|
|
1499
|
+
r && n.updateKey(r.id, d.target.value);
|
|
1500
|
+
}
|
|
1501
|
+
const s = I(() => {
|
|
1502
|
+
const d = t.selectedNode.value;
|
|
1503
|
+
return d ? U(d.type) : null;
|
|
1504
|
+
}), o = I(() => {
|
|
1505
|
+
if (!s.value) return {};
|
|
1506
|
+
const d = {};
|
|
1507
|
+
for (const r of s.value.propertyFields)
|
|
1508
|
+
d[r.section] || (d[r.section] = []), d[r.section].push(r);
|
|
1509
|
+
return d;
|
|
1510
|
+
}), p = {
|
|
1504
1511
|
content: "Content",
|
|
1505
1512
|
style: "Style",
|
|
1506
1513
|
layout: "Layout",
|
|
1507
1514
|
advanced: "Advanced"
|
|
1508
|
-
},
|
|
1509
|
-
return (
|
|
1510
|
-
m("div", zo, w(
|
|
1511
|
-
(
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1515
|
+
}, f = ["content", "style", "layout", "advanced"];
|
|
1516
|
+
return (d, r) => k(t).selectedNode.value && s.value ? (a(), c("div", No, [
|
|
1517
|
+
m("div", zo, w(s.value.icon) + " " + w(s.value.label), 1),
|
|
1518
|
+
m("div", To, [
|
|
1519
|
+
r[0] || (r[0] = m("label", { class: "brick-property-editor__key-label" }, "Key", -1)),
|
|
1520
|
+
m("input", {
|
|
1521
|
+
type: "text",
|
|
1522
|
+
class: "brick-property-editor__key-input",
|
|
1523
|
+
value: k(t).selectedNode.value.key ?? "",
|
|
1524
|
+
placeholder: "(optional identifier)",
|
|
1525
|
+
onInput: i
|
|
1526
|
+
}, null, 40, Do)
|
|
1527
|
+
]),
|
|
1528
|
+
(a(), c(C, null, P(f, (l) => (a(), c(C, { key: l }, [
|
|
1529
|
+
o.value[l] ? (a(), c("div", Lo, [
|
|
1530
|
+
m("div", Mo, w(p[l]), 1),
|
|
1531
|
+
(a(!0), c(C, null, P(o.value[l], (u) => (a(), M(Ro, {
|
|
1532
|
+
key: u.key,
|
|
1533
|
+
descriptor: u,
|
|
1517
1534
|
node: k(t).selectedNode.value
|
|
1518
1535
|
}, null, 8, ["descriptor", "node"]))), 128))
|
|
1519
1536
|
])) : $("", !0)
|
|
1520
1537
|
], 64))), 64)),
|
|
1521
|
-
(
|
|
1538
|
+
(a(), M(te(s.value.propertyEditorComponent), {
|
|
1522
1539
|
node: k(t).selectedNode.value
|
|
1523
1540
|
}, null, 8, ["node"]))
|
|
1524
1541
|
])) : $("", !0);
|
|
1525
1542
|
}
|
|
1526
|
-
}),
|
|
1543
|
+
}), Oo = /* @__PURE__ */ x(Bo, [["__scopeId", "data-v-e49ddc4f"]]), Ao = { class: "brick-toolbar" }, Vo = { class: "brick-toolbar__section" }, Fo = {
|
|
1527
1544
|
key: 0,
|
|
1528
1545
|
class: "brick-toolbar__section"
|
|
1529
|
-
},
|
|
1546
|
+
}, Ho = /* @__PURE__ */ _({
|
|
1530
1547
|
__name: "Toolbar",
|
|
1531
1548
|
setup(e) {
|
|
1532
1549
|
const t = W();
|
|
1533
|
-
return (n,
|
|
1534
|
-
m("div",
|
|
1535
|
-
|
|
1550
|
+
return (n, i) => (a(), c("div", Ao, [
|
|
1551
|
+
m("div", Vo, [
|
|
1552
|
+
i[0] || (i[0] = m("h3", { class: "brick-toolbar__title" }, "Elements", -1)),
|
|
1536
1553
|
B(fo)
|
|
1537
1554
|
]),
|
|
1538
|
-
k(t).selectedNode.value ? (
|
|
1539
|
-
|
|
1540
|
-
B(
|
|
1555
|
+
k(t).selectedNode.value ? (a(), c("div", Fo, [
|
|
1556
|
+
i[1] || (i[1] = m("h3", { class: "brick-toolbar__title" }, "Properties", -1)),
|
|
1557
|
+
B(Oo)
|
|
1541
1558
|
])) : $("", !0)
|
|
1542
1559
|
]));
|
|
1543
1560
|
}
|
|
1544
|
-
}),
|
|
1561
|
+
}), Jo = /* @__PURE__ */ x(Ho, [["__scopeId", "data-v-0174c069"]]), Uo = { class: "brick-actionbar" }, Wo = { class: "brick-actionbar__group" }, jo = { class: "brick-actionbar__group" }, Yo = ["disabled"], qo = ["disabled"], Ko = ["disabled"], Go = { class: "brick-actionbar__group" }, Xo = /* @__PURE__ */ _({
|
|
1545
1562
|
__name: "ActionBar",
|
|
1546
1563
|
setup(e) {
|
|
1547
|
-
const t = xt(), n = zt(),
|
|
1548
|
-
function
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1564
|
+
const t = xt(), n = zt(), i = W(), s = j(), o = oe(), p = E("document"), f = E(null);
|
|
1565
|
+
function d() {
|
|
1566
|
+
const y = i.selectedId.value;
|
|
1567
|
+
y && (i.deselect(), s.removeElement(y));
|
|
1551
1568
|
}
|
|
1552
1569
|
function r() {
|
|
1553
|
-
const
|
|
1554
|
-
n.exportPdf(
|
|
1570
|
+
const y = p.value.trim() || "document", g = y.endsWith(".pdf") ? y : y + ".pdf";
|
|
1571
|
+
n.exportPdf(g);
|
|
1555
1572
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const
|
|
1573
|
+
function l() {
|
|
1574
|
+
const y = o.exportDocument(), g = JSON.stringify(y, null, 2), v = new Blob([g], { type: "application/json" }), h = URL.createObjectURL(v), S = document.createElement("a"), R = p.value.trim() || "document";
|
|
1558
1575
|
S.href = h, S.download = R.endsWith(".json") ? R : R + ".json", S.click(), URL.revokeObjectURL(h);
|
|
1559
1576
|
}
|
|
1560
|
-
function
|
|
1561
|
-
|
|
1577
|
+
function u() {
|
|
1578
|
+
f.value?.click();
|
|
1562
1579
|
}
|
|
1563
|
-
function
|
|
1564
|
-
const
|
|
1580
|
+
function b(y) {
|
|
1581
|
+
const g = y.target, v = g.files?.[0];
|
|
1565
1582
|
if (!v) return;
|
|
1566
1583
|
const h = new FileReader();
|
|
1567
1584
|
h.onload = () => {
|
|
@@ -1571,54 +1588,54 @@ const Fn = {
|
|
|
1571
1588
|
alert("Invalid brick-pdf JSON file.");
|
|
1572
1589
|
return;
|
|
1573
1590
|
}
|
|
1574
|
-
|
|
1591
|
+
i.deselect(), o.loadDocument(S);
|
|
1575
1592
|
} catch {
|
|
1576
1593
|
alert("Failed to parse JSON file.");
|
|
1577
1594
|
}
|
|
1578
|
-
}, h.readAsText(v),
|
|
1595
|
+
}, h.readAsText(v), g.value = "";
|
|
1579
1596
|
}
|
|
1580
|
-
return (
|
|
1581
|
-
m("div",
|
|
1582
|
-
|
|
1583
|
-
"onUpdate:modelValue":
|
|
1597
|
+
return (y, g) => (a(), c("div", Uo, [
|
|
1598
|
+
m("div", Wo, [
|
|
1599
|
+
X(m("input", {
|
|
1600
|
+
"onUpdate:modelValue": g[0] || (g[0] = (v) => p.value = v),
|
|
1584
1601
|
class: "brick-actionbar__name",
|
|
1585
1602
|
type: "text",
|
|
1586
1603
|
placeholder: "Document name",
|
|
1587
1604
|
title: "Document name (used for export filename)"
|
|
1588
1605
|
}, null, 512), [
|
|
1589
|
-
[De,
|
|
1606
|
+
[De, p.value]
|
|
1590
1607
|
])
|
|
1591
1608
|
]),
|
|
1592
|
-
m("div",
|
|
1609
|
+
m("div", jo, [
|
|
1593
1610
|
m("button", {
|
|
1594
1611
|
class: "brick-actionbar__btn",
|
|
1595
1612
|
disabled: !k(t).canUndo.value,
|
|
1596
1613
|
title: "Undo",
|
|
1597
|
-
onClick:
|
|
1598
|
-
}, " Undo ", 8,
|
|
1614
|
+
onClick: g[1] || (g[1] = (v) => k(t).undo())
|
|
1615
|
+
}, " Undo ", 8, Yo),
|
|
1599
1616
|
m("button", {
|
|
1600
1617
|
class: "brick-actionbar__btn",
|
|
1601
1618
|
disabled: !k(t).canRedo.value,
|
|
1602
1619
|
title: "Redo",
|
|
1603
|
-
onClick:
|
|
1604
|
-
}, " Redo ", 8,
|
|
1620
|
+
onClick: g[2] || (g[2] = (v) => k(t).redo())
|
|
1621
|
+
}, " Redo ", 8, qo),
|
|
1605
1622
|
m("button", {
|
|
1606
1623
|
class: "brick-actionbar__btn brick-actionbar__btn--danger",
|
|
1607
|
-
disabled: !k(
|
|
1624
|
+
disabled: !k(i).selectedId.value,
|
|
1608
1625
|
title: "Delete selected element",
|
|
1609
|
-
onClick:
|
|
1610
|
-
}, " Delete ", 8,
|
|
1626
|
+
onClick: d
|
|
1627
|
+
}, " Delete ", 8, Ko)
|
|
1611
1628
|
]),
|
|
1612
|
-
m("div",
|
|
1629
|
+
m("div", Go, [
|
|
1613
1630
|
m("button", {
|
|
1614
1631
|
class: "brick-actionbar__btn",
|
|
1615
1632
|
title: "Import JSON",
|
|
1616
|
-
onClick:
|
|
1633
|
+
onClick: u
|
|
1617
1634
|
}, " Import JSON "),
|
|
1618
1635
|
m("button", {
|
|
1619
1636
|
class: "brick-actionbar__btn",
|
|
1620
1637
|
title: "Export JSON",
|
|
1621
|
-
onClick:
|
|
1638
|
+
onClick: l
|
|
1622
1639
|
}, " Export JSON "),
|
|
1623
1640
|
m("button", {
|
|
1624
1641
|
class: "brick-actionbar__btn brick-actionbar__btn--primary",
|
|
@@ -1626,90 +1643,90 @@ const Fn = {
|
|
|
1626
1643
|
}, " Export PDF "),
|
|
1627
1644
|
m("button", {
|
|
1628
1645
|
class: "brick-actionbar__btn",
|
|
1629
|
-
onClick:
|
|
1646
|
+
onClick: g[3] || (g[3] = (v) => k(n).openPdf())
|
|
1630
1647
|
}, " Preview ")
|
|
1631
1648
|
]),
|
|
1632
1649
|
m("input", {
|
|
1633
1650
|
ref_key: "fileInput",
|
|
1634
|
-
ref:
|
|
1651
|
+
ref: f,
|
|
1635
1652
|
type: "file",
|
|
1636
1653
|
accept: ".json",
|
|
1637
1654
|
style: { display: "none" },
|
|
1638
|
-
onChange:
|
|
1655
|
+
onChange: b
|
|
1639
1656
|
}, null, 544)
|
|
1640
1657
|
]));
|
|
1641
1658
|
}
|
|
1642
|
-
}),
|
|
1659
|
+
}), Qo = /* @__PURE__ */ x(Xo, [["__scopeId", "data-v-be915a0f"]]), Zo = { class: "brick-pdf" }, er = { class: "brick-pdf__workspace" }, tr = /* @__PURE__ */ _({
|
|
1643
1660
|
__name: "BrickPdf",
|
|
1644
1661
|
props: {
|
|
1645
1662
|
modelValue: {}
|
|
1646
1663
|
},
|
|
1647
1664
|
emits: ["update:modelValue"],
|
|
1648
1665
|
setup(e, { emit: t }) {
|
|
1649
|
-
const n = e,
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1653
|
-
const o =
|
|
1666
|
+
const n = e, i = t;
|
|
1667
|
+
Fn();
|
|
1668
|
+
const s = ft(n.modelValue ?? ne());
|
|
1669
|
+
yt(s);
|
|
1670
|
+
const o = mt(s);
|
|
1654
1671
|
gt(o);
|
|
1655
|
-
const
|
|
1656
|
-
St(
|
|
1657
|
-
const
|
|
1658
|
-
ht(
|
|
1659
|
-
const
|
|
1660
|
-
wt(
|
|
1661
|
-
const r = Rt(
|
|
1672
|
+
const p = kt(s);
|
|
1673
|
+
St(p);
|
|
1674
|
+
const f = vt(s, p);
|
|
1675
|
+
ht(f);
|
|
1676
|
+
const d = Ct(s, f);
|
|
1677
|
+
wt(d);
|
|
1678
|
+
const r = Rt(s);
|
|
1662
1679
|
Nt(r);
|
|
1663
|
-
const
|
|
1664
|
-
Mt(
|
|
1665
|
-
const
|
|
1666
|
-
Ot(
|
|
1667
|
-
const
|
|
1668
|
-
return ae(
|
|
1680
|
+
const l = Lt(s, f);
|
|
1681
|
+
Mt(l);
|
|
1682
|
+
const u = Bt(f);
|
|
1683
|
+
Ot(u);
|
|
1684
|
+
const b = Me(), y = b.Delete, g = b.Backspace;
|
|
1685
|
+
return ae(y, () => {
|
|
1669
1686
|
if (!o.selectedId.value) return;
|
|
1670
1687
|
const v = document.activeElement;
|
|
1671
1688
|
if (v && (v.tagName === "INPUT" || v.tagName === "TEXTAREA" || v.tagName === "SELECT")) return;
|
|
1672
1689
|
const h = o.selectedId.value;
|
|
1673
|
-
o.deselect(),
|
|
1674
|
-
}), ae(
|
|
1690
|
+
o.deselect(), f.removeElement(h);
|
|
1691
|
+
}), ae(g, () => {
|
|
1675
1692
|
if (!o.selectedId.value) return;
|
|
1676
1693
|
const v = document.activeElement;
|
|
1677
1694
|
if (v && (v.tagName === "INPUT" || v.tagName === "TEXTAREA" || v.tagName === "SELECT")) return;
|
|
1678
1695
|
const h = o.selectedId.value;
|
|
1679
|
-
o.deselect(),
|
|
1696
|
+
o.deselect(), f.removeElement(h);
|
|
1680
1697
|
}), Le(
|
|
1681
|
-
() =>
|
|
1698
|
+
() => s.document,
|
|
1682
1699
|
() => {
|
|
1683
|
-
|
|
1700
|
+
i("update:modelValue", JSON.parse(JSON.stringify(J(s.document))));
|
|
1684
1701
|
},
|
|
1685
1702
|
{ deep: !0 }
|
|
1686
|
-
), (v, h) => (
|
|
1687
|
-
B(
|
|
1688
|
-
m("div",
|
|
1703
|
+
), (v, h) => (a(), c("div", Zo, [
|
|
1704
|
+
B(Qo),
|
|
1705
|
+
m("div", er, [
|
|
1689
1706
|
B(so),
|
|
1690
|
-
B(
|
|
1707
|
+
B(Jo)
|
|
1691
1708
|
])
|
|
1692
1709
|
]));
|
|
1693
1710
|
}
|
|
1694
|
-
}),
|
|
1711
|
+
}), nr = /* @__PURE__ */ x(tr, [["__scopeId", "data-v-f9b95ad8"]]), cr = {
|
|
1695
1712
|
install(e) {
|
|
1696
|
-
e.component("BrickPdf",
|
|
1713
|
+
e.component("BrickPdf", nr);
|
|
1697
1714
|
}
|
|
1698
1715
|
};
|
|
1699
1716
|
export {
|
|
1700
|
-
|
|
1717
|
+
nr as BrickPdf,
|
|
1701
1718
|
ne as createDefaultDocument,
|
|
1702
|
-
|
|
1719
|
+
cr as default,
|
|
1703
1720
|
Be as getAllElementDefinitions,
|
|
1704
1721
|
U as getElementDefinition,
|
|
1705
1722
|
z as registerElement,
|
|
1706
|
-
|
|
1707
|
-
|
|
1723
|
+
ir as unregisterElement,
|
|
1724
|
+
sr as useClipboard,
|
|
1708
1725
|
oe as useDocumentStore,
|
|
1709
1726
|
xe as useDragDrop,
|
|
1710
|
-
|
|
1727
|
+
j as useElementActions,
|
|
1711
1728
|
xt as useHistory,
|
|
1712
1729
|
zt as usePdfExport,
|
|
1713
|
-
|
|
1730
|
+
ar as useResize,
|
|
1714
1731
|
W as useSelection
|
|
1715
1732
|
};
|