brick-pdf 0.2.2 → 0.3.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/dist/brick-pdf.js +701 -644
- package/dist/brick-pdf.umd.cjs +4 -4
- package/dist/fonts/notoSansJp.d.ts +11 -0
- package/package.json +1 -1
package/dist/brick-pdf.js
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import { defineComponent as _, openBlock as s, createElementBlock as
|
|
2
|
-
import { useMagicKeys as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
1
|
+
import { defineComponent as _, openBlock as s, 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 j, onMounted as me, onBeforeUnmount as ye, unref as k, resolveComponent as Te, withDirectives as K, vModelSelect as se, createVNode as B, vModelText as De, watch as Le } from "vue";
|
|
2
|
+
import { useMagicKeys as Me, whenever as ae } from "@vueuse/core";
|
|
3
|
+
import ce from "sortablejs";
|
|
4
|
+
function ne() {
|
|
5
5
|
return {
|
|
6
6
|
pageSize: "A4",
|
|
7
7
|
pageOrientation: "portrait",
|
|
8
8
|
pageMargins: [40, 60, 40, 60],
|
|
9
9
|
defaultStyle: {
|
|
10
|
+
font: "NotoSansJP",
|
|
10
11
|
fontSize: 12
|
|
11
12
|
},
|
|
12
13
|
styles: {},
|
|
13
14
|
content: []
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
|
|
17
|
+
const Y = /* @__PURE__ */ new Map();
|
|
18
|
+
function z(e) {
|
|
19
|
+
Y.set(e.type, e);
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
21
|
+
function U(e) {
|
|
22
|
+
return Y.get(e);
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return Array.from(
|
|
24
|
+
function Be() {
|
|
25
|
+
return Array.from(Y.values());
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
27
|
+
function rr(e) {
|
|
28
|
+
return Y.delete(e);
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function Oe() {
|
|
30
31
|
return { text: "New Text" };
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function Ae() {
|
|
33
34
|
return { fontSize: 12 };
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function Ve(e) {
|
|
36
37
|
const t = { text: e.props.text }, n = e.style;
|
|
37
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;
|
|
38
39
|
}
|
|
39
|
-
const
|
|
40
|
+
const Fe = /* @__PURE__ */ _({
|
|
40
41
|
__name: "TextRenderer",
|
|
41
42
|
props: {
|
|
42
43
|
node: {}
|
|
43
44
|
},
|
|
44
45
|
setup(e) {
|
|
45
|
-
return (t, n) => (s(),
|
|
46
|
+
return (t, n) => (s(), c("div", {
|
|
46
47
|
class: "brick-el-text",
|
|
47
|
-
style:
|
|
48
|
+
style: N({
|
|
48
49
|
fontSize: (e.node.style.fontSize ?? 12) + "px",
|
|
49
50
|
fontWeight: e.node.style.bold ? "bold" : "normal",
|
|
50
51
|
fontStyle: e.node.style.italics ? "italic" : "normal",
|
|
@@ -59,26 +60,26 @@ const Be = /* @__PURE__ */ _({
|
|
|
59
60
|
}
|
|
60
61
|
}), x = (e, t) => {
|
|
61
62
|
const n = e.__vccOpts || e;
|
|
62
|
-
for (const [
|
|
63
|
-
n[
|
|
63
|
+
for (const [l, a] of t)
|
|
64
|
+
n[l] = a;
|
|
64
65
|
return n;
|
|
65
|
-
},
|
|
66
|
+
}, He = /* @__PURE__ */ x(Fe, [["__scopeId", "data-v-a7cd1565"]]), Je = { class: "brick-text-editor" }, Ue = /* @__PURE__ */ _({
|
|
66
67
|
__name: "TextPropertyEditor",
|
|
67
68
|
props: {
|
|
68
69
|
node: {}
|
|
69
70
|
},
|
|
70
71
|
setup(e) {
|
|
71
|
-
return (t, n) => (s(),
|
|
72
|
+
return (t, n) => (s(), c("div", Je));
|
|
72
73
|
}
|
|
73
|
-
}),
|
|
74
|
+
}), We = {
|
|
74
75
|
type: "text",
|
|
75
76
|
label: "Text",
|
|
76
77
|
icon: "T",
|
|
77
78
|
isContainer: !1,
|
|
78
|
-
defaultProps:
|
|
79
|
-
defaultStyle:
|
|
80
|
-
rendererComponent:
|
|
81
|
-
propertyEditorComponent:
|
|
79
|
+
defaultProps: Oe,
|
|
80
|
+
defaultStyle: Ae,
|
|
81
|
+
rendererComponent: He,
|
|
82
|
+
propertyEditorComponent: Ue,
|
|
82
83
|
propertyFields: [
|
|
83
84
|
{ key: "props.text", label: "Text Content", section: "content", type: "textarea", defaultValue: "New Text" },
|
|
84
85
|
{ key: "style.fontSize", label: "Font Size", section: "style", type: "number", min: 6, max: 72, step: 1, defaultValue: 12 },
|
|
@@ -103,110 +104,110 @@ const Be = /* @__PURE__ */ _({
|
|
|
103
104
|
{ key: "style.link", label: "Link URL", section: "advanced", type: "text" },
|
|
104
105
|
{ key: "style.opacity", label: "Opacity", section: "advanced", type: "slider", min: 0, max: 1, step: 0.1, defaultValue: 1 }
|
|
105
106
|
],
|
|
106
|
-
toPdfmake:
|
|
107
|
+
toPdfmake: Ve
|
|
107
108
|
};
|
|
108
|
-
function
|
|
109
|
+
function je() {
|
|
109
110
|
return {};
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function Ye() {
|
|
112
113
|
return {};
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
+
function qe(e, t) {
|
|
115
116
|
const n = {
|
|
116
117
|
stack: t(e.children)
|
|
117
118
|
};
|
|
118
119
|
return e.style.margin && (n.margin = e.style.margin), e.style.fillColor && (n.fillColor = e.style.fillColor), n;
|
|
119
120
|
}
|
|
120
|
-
const
|
|
121
|
+
const Ge = /* @__PURE__ */ _({
|
|
121
122
|
__name: "StackRenderer",
|
|
122
123
|
props: {
|
|
123
124
|
node: {},
|
|
124
125
|
path: {}
|
|
125
126
|
},
|
|
126
127
|
setup(e) {
|
|
127
|
-
return (t, n) => (s(),
|
|
128
|
+
return (t, n) => (s(), c("div", {
|
|
128
129
|
class: "brick-el-stack",
|
|
129
|
-
style:
|
|
130
|
+
style: N({ backgroundColor: e.node.style.fillColor })
|
|
130
131
|
}, [
|
|
131
|
-
|
|
132
|
+
Z(t.$slots, "default", {}, void 0, !0)
|
|
132
133
|
], 4));
|
|
133
134
|
}
|
|
134
|
-
}),
|
|
135
|
+
}), Xe = /* @__PURE__ */ x(Ge, [["__scopeId", "data-v-c59e7405"]]), Ke = { class: "brick-stack-editor" }, Qe = /* @__PURE__ */ _({
|
|
135
136
|
__name: "StackPropertyEditor",
|
|
136
137
|
props: {
|
|
137
138
|
node: {}
|
|
138
139
|
},
|
|
139
140
|
setup(e) {
|
|
140
|
-
return (t, n) => (s(),
|
|
141
|
+
return (t, n) => (s(), c("div", Ke));
|
|
141
142
|
}
|
|
142
|
-
}),
|
|
143
|
+
}), Ze = {
|
|
143
144
|
type: "stack",
|
|
144
145
|
label: "Stack",
|
|
145
146
|
icon: "☰",
|
|
146
147
|
isContainer: !0,
|
|
147
148
|
acceptsChildTypes: null,
|
|
148
|
-
defaultProps:
|
|
149
|
-
defaultStyle:
|
|
150
|
-
rendererComponent:
|
|
151
|
-
propertyEditorComponent:
|
|
149
|
+
defaultProps: je,
|
|
150
|
+
defaultStyle: Ye,
|
|
151
|
+
rendererComponent: Xe,
|
|
152
|
+
propertyEditorComponent: Qe,
|
|
152
153
|
propertyFields: [
|
|
153
154
|
{ key: "style.fillColor", label: "Fill Color", section: "style", type: "color" },
|
|
154
155
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] }
|
|
155
156
|
],
|
|
156
|
-
toPdfmake:
|
|
157
|
+
toPdfmake: qe
|
|
157
158
|
};
|
|
158
|
-
function
|
|
159
|
+
function et() {
|
|
159
160
|
return { columnGap: 10 };
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
+
function tt() {
|
|
162
163
|
return {};
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
+
function nt(e, t) {
|
|
165
166
|
const n = {
|
|
166
167
|
columns: t(e.children),
|
|
167
168
|
columnGap: e.props.columnGap ?? 10
|
|
168
169
|
};
|
|
169
170
|
return e.style.margin && (n.margin = e.style.margin), n;
|
|
170
171
|
}
|
|
171
|
-
const
|
|
172
|
+
const ot = /* @__PURE__ */ _({
|
|
172
173
|
__name: "ColumnsRenderer",
|
|
173
174
|
props: {
|
|
174
175
|
node: {},
|
|
175
176
|
path: {}
|
|
176
177
|
},
|
|
177
178
|
setup(e) {
|
|
178
|
-
return (t, n) => (s(),
|
|
179
|
+
return (t, n) => (s(), c("div", {
|
|
179
180
|
class: "brick-el-columns",
|
|
180
|
-
style:
|
|
181
|
+
style: N({ "--column-gap": (e.node.props.columnGap ?? 10) + "px" })
|
|
181
182
|
}, [
|
|
182
|
-
|
|
183
|
+
Z(t.$slots, "default", {}, void 0, !0)
|
|
183
184
|
], 4));
|
|
184
185
|
}
|
|
185
|
-
}),
|
|
186
|
+
}), rt = /* @__PURE__ */ x(ot, [["__scopeId", "data-v-217dd721"]]), lt = { class: "brick-columns-editor" }, it = /* @__PURE__ */ _({
|
|
186
187
|
__name: "ColumnsPropertyEditor",
|
|
187
188
|
props: {
|
|
188
189
|
node: {}
|
|
189
190
|
},
|
|
190
191
|
setup(e) {
|
|
191
|
-
return (t, n) => (s(),
|
|
192
|
+
return (t, n) => (s(), c("div", lt));
|
|
192
193
|
}
|
|
193
|
-
}),
|
|
194
|
+
}), st = {
|
|
194
195
|
type: "columns",
|
|
195
196
|
label: "Columns",
|
|
196
197
|
icon: "▥",
|
|
197
198
|
isContainer: !0,
|
|
198
199
|
acceptsChildTypes: null,
|
|
199
|
-
defaultProps:
|
|
200
|
-
defaultStyle:
|
|
201
|
-
rendererComponent:
|
|
202
|
-
propertyEditorComponent:
|
|
200
|
+
defaultProps: et,
|
|
201
|
+
defaultStyle: tt,
|
|
202
|
+
rendererComponent: rt,
|
|
203
|
+
propertyEditorComponent: it,
|
|
203
204
|
propertyFields: [
|
|
204
205
|
{ key: "props.columnGap", label: "Column Gap", section: "layout", type: "number", min: 0, max: 50, step: 1, defaultValue: 10 },
|
|
205
206
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] }
|
|
206
207
|
],
|
|
207
|
-
toPdfmake:
|
|
208
|
+
toPdfmake: nt
|
|
208
209
|
};
|
|
209
|
-
function
|
|
210
|
+
function at() {
|
|
210
211
|
return {
|
|
211
212
|
headerRows: 1,
|
|
212
213
|
widths: ["*", "*"],
|
|
@@ -217,52 +218,52 @@ function rt() {
|
|
|
217
218
|
layout: "lightHorizontalLines"
|
|
218
219
|
};
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
+
function ct() {
|
|
221
222
|
return { fontSize: 12 };
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
+
function dt(e) {
|
|
224
225
|
const t = e.props.body, n = {
|
|
225
226
|
table: {
|
|
226
227
|
headerRows: e.props.headerRows,
|
|
227
228
|
widths: e.props.widths,
|
|
228
229
|
body: t.map(
|
|
229
|
-
(
|
|
230
|
+
(a) => a.map((o) => ({ text: o }))
|
|
230
231
|
)
|
|
231
232
|
}
|
|
232
|
-
},
|
|
233
|
-
return
|
|
233
|
+
}, l = e.props.layout;
|
|
234
|
+
return l && l !== "none" && (n.layout = l), 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;
|
|
234
235
|
}
|
|
235
|
-
const
|
|
236
|
+
const ut = /* @__PURE__ */ _({
|
|
236
237
|
__name: "TableRenderer",
|
|
237
238
|
props: {
|
|
238
239
|
node: {}
|
|
239
240
|
},
|
|
240
241
|
setup(e) {
|
|
241
|
-
return (t, n) => (s(),
|
|
242
|
-
class:
|
|
243
|
-
style:
|
|
242
|
+
return (t, n) => (s(), c("div", {
|
|
243
|
+
class: ee(["brick-el-table", "brick-el-table--" + (e.node.props.layout ?? "lightHorizontalLines")]),
|
|
244
|
+
style: N({ fontSize: (e.node.style.fontSize ?? 12) + "px", color: e.node.style.color })
|
|
244
245
|
}, [
|
|
245
246
|
m("table", null, [
|
|
246
247
|
m("thead", null, [
|
|
247
|
-
(s(!0),
|
|
248
|
-
key: "h" +
|
|
248
|
+
(s(!0), c(C, null, P(e.node.props.body.slice(0, e.node.props.headerRows), (l, a) => (s(), c("tr", {
|
|
249
|
+
key: "h" + a
|
|
249
250
|
}, [
|
|
250
|
-
(s(!0),
|
|
251
|
+
(s(!0), c(C, null, P(l, (o, u) => (s(), c("th", { key: u }, w(o), 1))), 128))
|
|
251
252
|
]))), 128))
|
|
252
253
|
]),
|
|
253
254
|
m("tbody", null, [
|
|
254
|
-
(s(!0),
|
|
255
|
-
key: "b" +
|
|
255
|
+
(s(!0), c(C, null, P(e.node.props.body.slice(e.node.props.headerRows), (l, a) => (s(), c("tr", {
|
|
256
|
+
key: "b" + a
|
|
256
257
|
}, [
|
|
257
|
-
(s(!0),
|
|
258
|
+
(s(!0), c(C, null, P(l, (o, u) => (s(), c("td", { key: u }, w(o), 1))), 128))
|
|
258
259
|
]))), 128))
|
|
259
260
|
])
|
|
260
261
|
])
|
|
261
262
|
], 6));
|
|
262
263
|
}
|
|
263
|
-
}),
|
|
264
|
-
function
|
|
265
|
-
const t =
|
|
264
|
+
}), pt = /* @__PURE__ */ x(ut, [["__scopeId", "data-v-b863b05d"]]), ge = /* @__PURE__ */ Symbol("brick-pdf-document-store");
|
|
265
|
+
function de(e) {
|
|
266
|
+
const t = ne();
|
|
266
267
|
return {
|
|
267
268
|
pageSize: e.pageSize ?? t.pageSize,
|
|
268
269
|
pageOrientation: e.pageOrientation ?? t.pageOrientation,
|
|
@@ -272,180 +273,180 @@ function ae(e) {
|
|
|
272
273
|
content: e.content ?? t.content
|
|
273
274
|
};
|
|
274
275
|
}
|
|
275
|
-
function
|
|
276
|
+
function Q(e) {
|
|
276
277
|
e.props = e.props ?? {}, e.style = e.style ?? {}, e.children = e.children ?? [];
|
|
277
|
-
for (const t of e.children)
|
|
278
|
+
for (const t of e.children) Q(t);
|
|
278
279
|
return e;
|
|
279
280
|
}
|
|
280
|
-
function
|
|
281
|
-
const t = e ?
|
|
282
|
-
for (const
|
|
283
|
-
const n =
|
|
284
|
-
function
|
|
285
|
-
const
|
|
286
|
-
for (let y = 0; y <
|
|
287
|
-
const g =
|
|
281
|
+
function ft(e) {
|
|
282
|
+
const t = e ? de(e) : ne();
|
|
283
|
+
for (const d of t.content) Q(d);
|
|
284
|
+
const n = ze(t);
|
|
285
|
+
function l(d, r) {
|
|
286
|
+
const i = r ?? n.content;
|
|
287
|
+
for (let y = 0; y < i.length; y++) {
|
|
288
|
+
const g = i[y];
|
|
288
289
|
if (g) {
|
|
289
|
-
if (g.id ===
|
|
290
|
-
return { node: g, parent:
|
|
290
|
+
if (g.id === d)
|
|
291
|
+
return { node: g, parent: i, index: y };
|
|
291
292
|
if (g.children.length > 0) {
|
|
292
|
-
const f =
|
|
293
|
+
const f = l(d, g.children);
|
|
293
294
|
if (f) return f;
|
|
294
295
|
}
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
298
|
return null;
|
|
298
299
|
}
|
|
299
|
-
function
|
|
300
|
-
n.content.splice(0, n.content.length, ...
|
|
300
|
+
function a(d) {
|
|
301
|
+
n.content.splice(0, n.content.length, ...d);
|
|
301
302
|
}
|
|
302
303
|
function o() {
|
|
303
|
-
return JSON.parse(JSON.stringify(
|
|
304
|
+
return JSON.parse(JSON.stringify(J(n.content)));
|
|
304
305
|
}
|
|
305
|
-
function u(
|
|
306
|
-
const r =
|
|
307
|
-
for (const
|
|
306
|
+
function u(d) {
|
|
307
|
+
const r = de(d);
|
|
308
|
+
for (const i of r.content) Q(i);
|
|
308
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);
|
|
309
310
|
}
|
|
310
311
|
function p() {
|
|
311
|
-
return JSON.parse(JSON.stringify(
|
|
312
|
+
return JSON.parse(JSON.stringify(J(n)));
|
|
312
313
|
}
|
|
313
|
-
return { document: n, findNodeById:
|
|
314
|
+
return { document: n, findNodeById: l, replaceContent: a, snapshotContent: o, loadDocument: u, exportDocument: p };
|
|
314
315
|
}
|
|
315
|
-
function
|
|
316
|
-
D(
|
|
316
|
+
function mt(e) {
|
|
317
|
+
D(ge, e);
|
|
317
318
|
}
|
|
318
|
-
function
|
|
319
|
-
const e = L(
|
|
319
|
+
function oe() {
|
|
320
|
+
const e = L(ge);
|
|
320
321
|
if (!e)
|
|
321
322
|
throw new Error("useDocumentStore() requires a BrickPdf ancestor component");
|
|
322
323
|
return e;
|
|
323
324
|
}
|
|
324
|
-
const
|
|
325
|
-
function
|
|
326
|
-
const t =
|
|
327
|
-
function
|
|
325
|
+
const be = /* @__PURE__ */ Symbol("brick-pdf-selection");
|
|
326
|
+
function yt(e) {
|
|
327
|
+
const t = E(null), n = I(() => t.value ? e.findNodeById(t.value)?.node ?? null : null);
|
|
328
|
+
function l(o) {
|
|
328
329
|
t.value = o;
|
|
329
330
|
}
|
|
330
|
-
function
|
|
331
|
+
function a() {
|
|
331
332
|
t.value = null;
|
|
332
333
|
}
|
|
333
|
-
return { selectedId: t, selectedNode: n, select:
|
|
334
|
+
return { selectedId: t, selectedNode: n, select: l, deselect: a };
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
-
D(
|
|
336
|
+
function gt(e) {
|
|
337
|
+
D(be, e);
|
|
337
338
|
}
|
|
338
|
-
function
|
|
339
|
-
const e = L(
|
|
339
|
+
function W() {
|
|
340
|
+
const e = L(be);
|
|
340
341
|
if (!e)
|
|
341
342
|
throw new Error("useSelection() requires a BrickPdf ancestor component");
|
|
342
343
|
return e;
|
|
343
344
|
}
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
function
|
|
347
|
-
return `el-${Date.now()}-${++
|
|
345
|
+
const he = /* @__PURE__ */ Symbol("brick-pdf-element-actions");
|
|
346
|
+
let bt = 0;
|
|
347
|
+
function ve() {
|
|
348
|
+
return `el-${Date.now()}-${++bt}`;
|
|
348
349
|
}
|
|
349
|
-
function
|
|
350
|
+
function _e(e) {
|
|
350
351
|
return {
|
|
351
352
|
...e,
|
|
352
|
-
id:
|
|
353
|
+
id: ve(),
|
|
353
354
|
props: structuredClone(e.props),
|
|
354
355
|
style: structuredClone(e.style),
|
|
355
|
-
children: e.children.map(
|
|
356
|
+
children: e.children.map(_e)
|
|
356
357
|
};
|
|
357
358
|
}
|
|
358
|
-
function
|
|
359
|
-
function n(
|
|
360
|
-
const y =
|
|
359
|
+
function ht(e, t) {
|
|
360
|
+
function n(d, r, i) {
|
|
361
|
+
const y = U(d);
|
|
361
362
|
if (!y) return null;
|
|
362
363
|
t.record();
|
|
363
364
|
const g = {
|
|
364
|
-
id:
|
|
365
|
-
type:
|
|
365
|
+
id: ve(),
|
|
366
|
+
type: d,
|
|
366
367
|
props: y.defaultProps(),
|
|
367
368
|
style: y.defaultStyle(),
|
|
368
369
|
children: []
|
|
369
370
|
}, f = r ? e.findNodeById(r)?.node.children : e.document.content;
|
|
370
371
|
if (!f) return null;
|
|
371
|
-
const b =
|
|
372
|
+
const b = i ?? f.length;
|
|
372
373
|
return f.splice(b, 0, g), g;
|
|
373
374
|
}
|
|
374
|
-
function
|
|
375
|
-
const r = e.findNodeById(
|
|
375
|
+
function l(d) {
|
|
376
|
+
const r = e.findNodeById(d);
|
|
376
377
|
r && (t.record(), r.parent.splice(r.index, 1));
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
-
const y = e.findNodeById(
|
|
379
|
+
function a(d, r, i) {
|
|
380
|
+
const y = e.findNodeById(d);
|
|
380
381
|
if (!y) return;
|
|
381
382
|
t.record();
|
|
382
383
|
const g = y.parent.splice(y.index, 1)[0];
|
|
383
384
|
if (!g) return;
|
|
384
385
|
const f = r ? e.findNodeById(r)?.node.children : e.document.content;
|
|
385
|
-
f && f.splice(
|
|
386
|
+
f && f.splice(i, 0, g);
|
|
386
387
|
}
|
|
387
|
-
function o(
|
|
388
|
-
const r = e.findNodeById(
|
|
388
|
+
function o(d) {
|
|
389
|
+
const r = e.findNodeById(d);
|
|
389
390
|
if (!r) return null;
|
|
390
391
|
t.record();
|
|
391
|
-
const
|
|
392
|
-
return r.parent.splice(r.index + 1, 0,
|
|
392
|
+
const i = _e(r.node);
|
|
393
|
+
return r.parent.splice(r.index + 1, 0, i), i;
|
|
393
394
|
}
|
|
394
|
-
function u(
|
|
395
|
-
const
|
|
396
|
-
|
|
395
|
+
function u(d, r) {
|
|
396
|
+
const i = e.findNodeById(d);
|
|
397
|
+
i && (t.record(), Object.assign(i.node.props, r));
|
|
397
398
|
}
|
|
398
|
-
function p(
|
|
399
|
-
const
|
|
400
|
-
|
|
399
|
+
function p(d, r) {
|
|
400
|
+
const i = e.findNodeById(d);
|
|
401
|
+
i && (t.record(), Object.assign(i.node.style, r));
|
|
401
402
|
}
|
|
402
|
-
return { addElement: n, removeElement:
|
|
403
|
+
return { addElement: n, removeElement: l, moveElement: a, duplicateElement: o, updateProps: u, updateStyle: p };
|
|
403
404
|
}
|
|
404
|
-
function
|
|
405
|
-
D(
|
|
405
|
+
function vt(e) {
|
|
406
|
+
D(he, e);
|
|
406
407
|
}
|
|
407
|
-
function
|
|
408
|
-
const e = L(
|
|
408
|
+
function q() {
|
|
409
|
+
const e = L(he);
|
|
409
410
|
if (!e)
|
|
410
411
|
throw new Error("useElementActions() requires a BrickPdf ancestor component");
|
|
411
412
|
return e;
|
|
412
413
|
}
|
|
413
|
-
const
|
|
414
|
-
function
|
|
415
|
-
const t =
|
|
416
|
-
let
|
|
417
|
-
const
|
|
414
|
+
const ke = /* @__PURE__ */ Symbol("brick-pdf-history"), _t = 50;
|
|
415
|
+
function kt(e) {
|
|
416
|
+
const t = E([]), n = E([]);
|
|
417
|
+
let l = 0;
|
|
418
|
+
const a = I(() => t.value.length > 0), o = I(() => n.value.length > 0);
|
|
418
419
|
function u() {
|
|
419
420
|
const r = Date.now();
|
|
420
|
-
if (r -
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
t.value.push(
|
|
421
|
+
if (r - l < 100) return;
|
|
422
|
+
l = r;
|
|
423
|
+
const i = e.snapshotContent();
|
|
424
|
+
t.value.push(i), t.value.length > _t && t.value.shift(), n.value = [];
|
|
424
425
|
}
|
|
425
426
|
function p() {
|
|
426
427
|
const r = t.value.pop();
|
|
427
428
|
r && (n.value.push(e.snapshotContent()), e.replaceContent(r));
|
|
428
429
|
}
|
|
429
|
-
function
|
|
430
|
+
function d() {
|
|
430
431
|
const r = n.value.pop();
|
|
431
432
|
r && (t.value.push(e.snapshotContent()), e.replaceContent(r));
|
|
432
433
|
}
|
|
433
|
-
return { canUndo:
|
|
434
|
+
return { canUndo: a, canRedo: o, record: u, undo: p, redo: d };
|
|
434
435
|
}
|
|
435
|
-
function
|
|
436
|
-
D(
|
|
436
|
+
function St(e) {
|
|
437
|
+
D(ke, e);
|
|
437
438
|
}
|
|
438
|
-
function
|
|
439
|
-
const e = L(
|
|
439
|
+
function xt() {
|
|
440
|
+
const e = L(ke);
|
|
440
441
|
if (!e)
|
|
441
442
|
throw new Error("useHistory() requires a BrickPdf ancestor component");
|
|
442
443
|
return e;
|
|
443
444
|
}
|
|
444
|
-
const
|
|
445
|
-
function
|
|
446
|
-
const n =
|
|
447
|
-
function
|
|
448
|
-
return
|
|
445
|
+
const Se = /* @__PURE__ */ Symbol("brick-pdf-drag-drop");
|
|
446
|
+
function Ct(e, t) {
|
|
447
|
+
const n = E(!1);
|
|
448
|
+
function l(o) {
|
|
449
|
+
return ce.create(o, {
|
|
449
450
|
group: { name: "brick-elements", pull: "clone", put: !1 },
|
|
450
451
|
sort: !1,
|
|
451
452
|
animation: 150,
|
|
@@ -457,8 +458,8 @@ function _t(e, t) {
|
|
|
457
458
|
}
|
|
458
459
|
});
|
|
459
460
|
}
|
|
460
|
-
function
|
|
461
|
-
return
|
|
461
|
+
function a(o, u) {
|
|
462
|
+
return ce.create(o, {
|
|
462
463
|
group: { name: "brick-elements", put: !0 },
|
|
463
464
|
animation: 150,
|
|
464
465
|
fallbackOnBody: !0,
|
|
@@ -469,140 +470,196 @@ function _t(e, t) {
|
|
|
469
470
|
n.value = !0;
|
|
470
471
|
},
|
|
471
472
|
onAdd(p) {
|
|
472
|
-
const
|
|
473
|
+
const d = p.item, r = d.dataset.elementId, i = d.dataset.elementType, y = (g) => {
|
|
473
474
|
if (!u || !g) return !1;
|
|
474
475
|
const f = e.findNodeById(u);
|
|
475
476
|
if (!f) return !1;
|
|
476
|
-
const b =
|
|
477
|
+
const b = U(f.node.type);
|
|
477
478
|
return !!(b?.acceptsChildTypes && !b.acceptsChildTypes.includes(g));
|
|
478
479
|
};
|
|
479
480
|
if (r) {
|
|
480
|
-
if (
|
|
481
|
+
if (d.parentNode?.removeChild(d), y(i)) return;
|
|
481
482
|
t.moveElement(r, u, p.newIndex ?? 0);
|
|
482
483
|
return;
|
|
483
484
|
}
|
|
484
|
-
|
|
485
|
+
i && (d.parentNode?.removeChild(d), !y(i) && t.addElement(i, u, p.newIndex));
|
|
485
486
|
},
|
|
486
487
|
onEnd(p) {
|
|
487
488
|
if (n.value = !1, p.from === p.to && p.oldIndex !== void 0 && p.newIndex !== void 0 && p.oldIndex !== p.newIndex && p.item.dataset.elementId) {
|
|
488
|
-
const
|
|
489
|
-
if (!
|
|
490
|
-
const r =
|
|
491
|
-
r &&
|
|
489
|
+
const d = u ? e.findNodeById(u)?.node.children : e.document.content;
|
|
490
|
+
if (!d) return;
|
|
491
|
+
const r = d.splice(p.oldIndex, 1)[0];
|
|
492
|
+
r && d.splice(p.newIndex, 0, r);
|
|
492
493
|
}
|
|
493
494
|
}
|
|
494
495
|
});
|
|
495
496
|
}
|
|
496
|
-
return { initToolbar:
|
|
497
|
+
return { initToolbar: l, initContainer: a, isDragging: n };
|
|
497
498
|
}
|
|
498
|
-
function
|
|
499
|
-
D(
|
|
499
|
+
function wt(e) {
|
|
500
|
+
D(Se, e);
|
|
500
501
|
}
|
|
501
|
-
function
|
|
502
|
-
const e = L(
|
|
502
|
+
function xe() {
|
|
503
|
+
const e = L(Se);
|
|
503
504
|
if (!e)
|
|
504
505
|
throw new Error("useDragDrop() requires a BrickPdf ancestor component");
|
|
505
506
|
return e;
|
|
506
507
|
}
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
|
|
508
|
+
const ue = {
|
|
509
|
+
regular: "https://cdn.jsdelivr.net/npm/@expo-google-fonts/noto-sans-jp/NotoSansJP_400Regular.ttf",
|
|
510
|
+
bold: "https://cdn.jsdelivr.net/npm/@expo-google-fonts/noto-sans-jp/NotoSansJP_700Bold.ttf"
|
|
511
|
+
}, A = {
|
|
512
|
+
regular: "NotoSansJP-Regular.ttf",
|
|
513
|
+
bold: "NotoSansJP-Bold.ttf"
|
|
514
|
+
}, Pt = "NotoSansJP";
|
|
515
|
+
function Et(e) {
|
|
516
|
+
const t = new Uint8Array(e), n = 32768;
|
|
517
|
+
let l = "";
|
|
518
|
+
for (let a = 0; a < t.length; a += n) {
|
|
519
|
+
const o = t.subarray(a, a + n);
|
|
520
|
+
l += String.fromCharCode.apply(null, Array.from(o));
|
|
521
|
+
}
|
|
522
|
+
return btoa(l);
|
|
523
|
+
}
|
|
524
|
+
async function pe(e) {
|
|
525
|
+
const t = await fetch(e);
|
|
526
|
+
if (!t.ok)
|
|
527
|
+
throw new Error(`Failed to load font ${e}: HTTP ${t.status}`);
|
|
528
|
+
const n = await t.arrayBuffer();
|
|
529
|
+
return Et(n);
|
|
530
|
+
}
|
|
531
|
+
let H = null;
|
|
532
|
+
function It() {
|
|
533
|
+
return H || (H = (async () => {
|
|
534
|
+
const [e, t] = await Promise.all([
|
|
535
|
+
pe(ue.regular),
|
|
536
|
+
pe(ue.bold)
|
|
537
|
+
]);
|
|
538
|
+
return {
|
|
539
|
+
vfs: {
|
|
540
|
+
[A.regular]: e,
|
|
541
|
+
[A.bold]: t
|
|
542
|
+
},
|
|
543
|
+
fonts: {
|
|
544
|
+
[Pt]: {
|
|
545
|
+
normal: A.regular,
|
|
546
|
+
bold: A.bold,
|
|
547
|
+
italics: A.regular,
|
|
548
|
+
bolditalics: A.bold
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
})().catch((e) => {
|
|
553
|
+
throw H = null, e;
|
|
554
|
+
}), H);
|
|
510
555
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
return
|
|
556
|
+
const Ce = /* @__PURE__ */ Symbol("brick-pdf-export");
|
|
557
|
+
function $t(e) {
|
|
558
|
+
return e.map(we);
|
|
514
559
|
}
|
|
515
|
-
function
|
|
560
|
+
function we(e) {
|
|
561
|
+
const t = U(e.type);
|
|
562
|
+
return t ? t.toPdfmake(e, $t) : { text: `[Unknown: ${e.type}]` };
|
|
563
|
+
}
|
|
564
|
+
function Rt(e) {
|
|
516
565
|
function t() {
|
|
517
566
|
const o = e.document;
|
|
518
567
|
return {
|
|
519
568
|
pageSize: o.pageSize,
|
|
520
569
|
pageOrientation: o.pageOrientation,
|
|
521
570
|
pageMargins: o.pageMargins,
|
|
522
|
-
defaultStyle: JSON.parse(JSON.stringify(
|
|
523
|
-
styles: JSON.parse(JSON.stringify(
|
|
524
|
-
content: o.content.map(
|
|
571
|
+
defaultStyle: JSON.parse(JSON.stringify(J(o.defaultStyle))),
|
|
572
|
+
styles: JSON.parse(JSON.stringify(J(o.styles))),
|
|
573
|
+
content: o.content.map(we)
|
|
525
574
|
};
|
|
526
575
|
}
|
|
527
576
|
async function n() {
|
|
528
|
-
const o = await import("pdfmake/build/pdfmake"), u = await import("pdfmake/build/vfs_fonts"), p = o.default || o,
|
|
529
|
-
return
|
|
577
|
+
const o = await import("pdfmake/build/pdfmake"), u = await import("pdfmake/build/vfs_fonts"), p = o.default || o, d = u.pdfMake?.vfs ?? u.default ?? {}, r = await It();
|
|
578
|
+
return p.addVirtualFileSystem({ ...d, ...r.vfs }), p.setFonts({
|
|
579
|
+
Roboto: {
|
|
580
|
+
normal: "Roboto-Regular.ttf",
|
|
581
|
+
bold: "Roboto-Medium.ttf",
|
|
582
|
+
italics: "Roboto-Italic.ttf",
|
|
583
|
+
bolditalics: "Roboto-MediumItalic.ttf"
|
|
584
|
+
},
|
|
585
|
+
...r.fonts
|
|
586
|
+
}), p;
|
|
530
587
|
}
|
|
531
|
-
function
|
|
588
|
+
function l(o) {
|
|
532
589
|
const u = t();
|
|
533
590
|
n().then((p) => {
|
|
534
591
|
p.createPdf(u).download(o ?? "document.pdf");
|
|
535
592
|
});
|
|
536
593
|
}
|
|
537
|
-
function
|
|
594
|
+
function a() {
|
|
538
595
|
const o = t();
|
|
539
596
|
n().then((u) => {
|
|
540
597
|
u.createPdf(o).open();
|
|
541
598
|
});
|
|
542
599
|
}
|
|
543
|
-
return { toDocumentDefinition: t, exportPdf:
|
|
600
|
+
return { toDocumentDefinition: t, exportPdf: l, openPdf: a };
|
|
544
601
|
}
|
|
545
|
-
function
|
|
546
|
-
D(
|
|
602
|
+
function Nt(e) {
|
|
603
|
+
D(Ce, e);
|
|
547
604
|
}
|
|
548
|
-
function
|
|
549
|
-
const e = L(
|
|
605
|
+
function zt() {
|
|
606
|
+
const e = L(Ce);
|
|
550
607
|
if (!e)
|
|
551
608
|
throw new Error("usePdfExport() requires a BrickPdf ancestor component");
|
|
552
609
|
return e;
|
|
553
610
|
}
|
|
554
|
-
const
|
|
555
|
-
let
|
|
556
|
-
function
|
|
557
|
-
return `el-${Date.now()}-${++
|
|
611
|
+
const Pe = /* @__PURE__ */ Symbol("brick-pdf-clipboard");
|
|
612
|
+
let Tt = 0;
|
|
613
|
+
function Dt() {
|
|
614
|
+
return `el-${Date.now()}-${++Tt}`;
|
|
558
615
|
}
|
|
559
|
-
function
|
|
616
|
+
function Ee(e) {
|
|
560
617
|
return {
|
|
561
618
|
...e,
|
|
562
|
-
id:
|
|
619
|
+
id: Dt(),
|
|
563
620
|
props: structuredClone(e.props),
|
|
564
621
|
style: structuredClone(e.style),
|
|
565
|
-
children: e.children.map(
|
|
622
|
+
children: e.children.map(Ee)
|
|
566
623
|
};
|
|
567
624
|
}
|
|
568
|
-
function
|
|
569
|
-
const n =
|
|
625
|
+
function Lt(e, t) {
|
|
626
|
+
const n = E(null), l = E(!1), a = E(null), o = E(!1);
|
|
570
627
|
function u(r) {
|
|
571
|
-
const
|
|
572
|
-
|
|
628
|
+
const i = e.findNodeById(r);
|
|
629
|
+
i && (n.value = structuredClone(i.node), l.value = !1, a.value = null, o.value = !0);
|
|
573
630
|
}
|
|
574
631
|
function p(r) {
|
|
575
|
-
const
|
|
576
|
-
|
|
632
|
+
const i = e.findNodeById(r);
|
|
633
|
+
i && (n.value = structuredClone(i.node), l.value = !0, a.value = r, o.value = !0);
|
|
577
634
|
}
|
|
578
|
-
function
|
|
635
|
+
function d(r) {
|
|
579
636
|
if (!n.value) return;
|
|
580
|
-
|
|
581
|
-
const
|
|
582
|
-
y && (y.push(
|
|
637
|
+
l.value && a.value && (t.removeElement(a.value), l.value = !1, a.value = null);
|
|
638
|
+
const i = Ee(n.value), y = r ? e.findNodeById(r)?.node.children : e.document.content;
|
|
639
|
+
y && (y.push(i), l.value && (n.value = null, o.value = !1));
|
|
583
640
|
}
|
|
584
|
-
return { hasClipboard: o, copy: u, cut: p, paste:
|
|
641
|
+
return { hasClipboard: o, copy: u, cut: p, paste: d };
|
|
585
642
|
}
|
|
586
|
-
function
|
|
587
|
-
D(
|
|
643
|
+
function Mt(e) {
|
|
644
|
+
D(Pe, e);
|
|
588
645
|
}
|
|
589
|
-
function
|
|
590
|
-
const e = L(
|
|
646
|
+
function lr() {
|
|
647
|
+
const e = L(Pe);
|
|
591
648
|
if (!e)
|
|
592
649
|
throw new Error("useClipboard() requires a BrickPdf ancestor component");
|
|
593
650
|
return e;
|
|
594
651
|
}
|
|
595
|
-
const
|
|
596
|
-
function
|
|
597
|
-
const t =
|
|
598
|
-
function n(
|
|
652
|
+
const Ie = /* @__PURE__ */ Symbol("brick-pdf-resize");
|
|
653
|
+
function Bt(e) {
|
|
654
|
+
const t = E(!1);
|
|
655
|
+
function n(l, a, o, u) {
|
|
599
656
|
t.value = !0;
|
|
600
|
-
const p = u.clientX,
|
|
657
|
+
const p = u.clientX, d = u.clientY, r = o.width, i = o.height;
|
|
601
658
|
function y(f) {
|
|
602
|
-
const b = f.clientX - p,
|
|
603
|
-
let
|
|
604
|
-
|
|
605
|
-
width: Math.round(
|
|
659
|
+
const b = f.clientX - p, h = f.clientY - d;
|
|
660
|
+
let v = r, S = i;
|
|
661
|
+
a.includes("e") && (v = r + b), a.includes("w") && (v = r - b), a.includes("s") && (S = i + h), a.includes("n") && (S = i - h), v = Math.max(20, v), S = Math.max(20, S), e.updateStyle(l, {
|
|
662
|
+
width: Math.round(v),
|
|
606
663
|
height: Math.round(S)
|
|
607
664
|
});
|
|
608
665
|
}
|
|
@@ -613,55 +670,55 @@ function zt(e) {
|
|
|
613
670
|
}
|
|
614
671
|
return { isResizing: t, startResize: n };
|
|
615
672
|
}
|
|
616
|
-
function
|
|
617
|
-
D(
|
|
673
|
+
function Ot(e) {
|
|
674
|
+
D(Ie, e);
|
|
618
675
|
}
|
|
619
|
-
function
|
|
620
|
-
const e = L(
|
|
676
|
+
function ir() {
|
|
677
|
+
const e = L(Ie);
|
|
621
678
|
if (!e)
|
|
622
679
|
throw new Error("useResize() requires a BrickPdf ancestor component");
|
|
623
680
|
return e;
|
|
624
681
|
}
|
|
625
|
-
const
|
|
682
|
+
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__ */ _({
|
|
626
683
|
__name: "TablePropertyEditor",
|
|
627
684
|
props: {
|
|
628
685
|
node: {}
|
|
629
686
|
},
|
|
630
687
|
setup(e) {
|
|
631
|
-
const t = e, n =
|
|
632
|
-
function
|
|
688
|
+
const t = e, n = q();
|
|
689
|
+
function l() {
|
|
633
690
|
return t.node.props.body ?? [];
|
|
634
691
|
}
|
|
635
|
-
function
|
|
692
|
+
function a() {
|
|
636
693
|
return t.node.props.widths ?? [];
|
|
637
694
|
}
|
|
638
|
-
function o(
|
|
639
|
-
const f =
|
|
640
|
-
f[
|
|
695
|
+
function o(i, y, g) {
|
|
696
|
+
const f = l().map((b) => [...b]);
|
|
697
|
+
f[i][y] = g, n.updateProps(t.node.id, { body: f });
|
|
641
698
|
}
|
|
642
699
|
function u() {
|
|
643
|
-
const
|
|
644
|
-
|
|
700
|
+
const i = l().map((g) => [...g]), y = i[0]?.length ?? 2;
|
|
701
|
+
i.push(Array(y).fill("")), n.updateProps(t.node.id, { body: i });
|
|
645
702
|
}
|
|
646
|
-
function p(
|
|
647
|
-
const y =
|
|
703
|
+
function p(i) {
|
|
704
|
+
const y = l().map((f) => [...f]);
|
|
648
705
|
if (y.length <= 1) return;
|
|
649
|
-
y.splice(
|
|
706
|
+
y.splice(i, 1), t.node.props.headerRows > y.length ? n.updateProps(t.node.id, { body: y, headerRows: y.length }) : n.updateProps(t.node.id, { body: y });
|
|
650
707
|
}
|
|
651
|
-
function
|
|
652
|
-
const
|
|
653
|
-
n.updateProps(t.node.id, { body:
|
|
708
|
+
function d() {
|
|
709
|
+
const i = l().map((g) => [...g, ""]), y = [...a(), "*"];
|
|
710
|
+
n.updateProps(t.node.id, { body: i, widths: y });
|
|
654
711
|
}
|
|
655
|
-
function r(
|
|
656
|
-
const y =
|
|
712
|
+
function r(i) {
|
|
713
|
+
const y = l().map((f) => {
|
|
657
714
|
const b = [...f];
|
|
658
|
-
return b.splice(
|
|
715
|
+
return b.splice(i, 1), b;
|
|
659
716
|
});
|
|
660
717
|
if ((y[0]?.length ?? 0) < 1) return;
|
|
661
|
-
const g = [...
|
|
662
|
-
g.splice(
|
|
718
|
+
const g = [...a()];
|
|
719
|
+
g.splice(i, 1), n.updateProps(t.node.id, { body: y, widths: g });
|
|
663
720
|
}
|
|
664
|
-
return (
|
|
721
|
+
return (i, y) => (s(), c("div", At, [
|
|
665
722
|
m("div", { class: "brick-table-editor__actions" }, [
|
|
666
723
|
m("button", {
|
|
667
724
|
class: "brick-table-editor__btn",
|
|
@@ -669,46 +726,46 @@ const Tt = { class: "brick-table-editor" }, Nt = { class: "brick-table-editor__g
|
|
|
669
726
|
}, "+ Row"),
|
|
670
727
|
m("button", {
|
|
671
728
|
class: "brick-table-editor__btn",
|
|
672
|
-
onClick:
|
|
729
|
+
onClick: d
|
|
673
730
|
}, "+ Column")
|
|
674
731
|
]),
|
|
675
|
-
m("div",
|
|
732
|
+
m("div", Vt, [
|
|
676
733
|
m("table", null, [
|
|
677
734
|
m("thead", null, [
|
|
678
735
|
m("tr", null, [
|
|
679
736
|
y[0] || (y[0] = m("th", { class: "brick-table-editor__corner" }, null, -1)),
|
|
680
|
-
(s(!0),
|
|
737
|
+
(s(!0), c(C, null, P(l()[0] ?? [], (g, f) => (s(), c("th", {
|
|
681
738
|
key: f,
|
|
682
739
|
class: "brick-table-editor__col-header"
|
|
683
740
|
}, [
|
|
684
|
-
|
|
685
|
-
(
|
|
741
|
+
ie(" Col " + w(f + 1) + " ", 1),
|
|
742
|
+
(l()[0]?.length ?? 0) > 1 ? (s(), c("button", {
|
|
686
743
|
key: 0,
|
|
687
744
|
class: "brick-table-editor__remove-btn",
|
|
688
745
|
title: "Remove column",
|
|
689
746
|
onClick: (b) => r(f)
|
|
690
|
-
}, "x", 8,
|
|
747
|
+
}, "x", 8, Ft)) : $("", !0)
|
|
691
748
|
]))), 128))
|
|
692
749
|
])
|
|
693
750
|
]),
|
|
694
751
|
m("tbody", null, [
|
|
695
|
-
(s(!0),
|
|
696
|
-
m("td",
|
|
697
|
-
|
|
698
|
-
|
|
752
|
+
(s(!0), c(C, null, P(l(), (g, f) => (s(), c("tr", { key: f }, [
|
|
753
|
+
m("td", Ht, [
|
|
754
|
+
ie(w(f + 1) + " ", 1),
|
|
755
|
+
l().length > 1 ? (s(), c("button", {
|
|
699
756
|
key: 0,
|
|
700
757
|
class: "brick-table-editor__remove-btn",
|
|
701
758
|
title: "Remove row",
|
|
702
759
|
onClick: (b) => p(f)
|
|
703
|
-
}, "x", 8,
|
|
760
|
+
}, "x", 8, Jt)) : $("", !0)
|
|
704
761
|
]),
|
|
705
|
-
(s(!0),
|
|
762
|
+
(s(!0), c(C, null, P(g, (b, h) => (s(), c("td", { key: h }, [
|
|
706
763
|
m("input", {
|
|
707
764
|
class: "brick-table-editor__cell",
|
|
708
765
|
type: "text",
|
|
709
766
|
value: b,
|
|
710
|
-
onInput: (
|
|
711
|
-
}, null, 40,
|
|
767
|
+
onInput: (v) => o(f, h, v.target.value)
|
|
768
|
+
}, null, 40, Ut)
|
|
712
769
|
]))), 128))
|
|
713
770
|
]))), 128))
|
|
714
771
|
])
|
|
@@ -716,15 +773,15 @@ const Tt = { class: "brick-table-editor" }, Nt = { class: "brick-table-editor__g
|
|
|
716
773
|
])
|
|
717
774
|
]));
|
|
718
775
|
}
|
|
719
|
-
}),
|
|
776
|
+
}), jt = /* @__PURE__ */ x(Wt, [["__scopeId", "data-v-4895020c"]]), Yt = {
|
|
720
777
|
type: "table",
|
|
721
778
|
label: "Table",
|
|
722
779
|
icon: "▦",
|
|
723
780
|
isContainer: !1,
|
|
724
|
-
defaultProps:
|
|
725
|
-
defaultStyle:
|
|
726
|
-
rendererComponent:
|
|
727
|
-
propertyEditorComponent:
|
|
781
|
+
defaultProps: at,
|
|
782
|
+
defaultStyle: ct,
|
|
783
|
+
rendererComponent: pt,
|
|
784
|
+
propertyEditorComponent: jt,
|
|
728
785
|
propertyFields: [
|
|
729
786
|
{ key: "props.headerRows", label: "Header Rows", section: "content", type: "number", min: 0, max: 10, step: 1, defaultValue: 1 },
|
|
730
787
|
{ key: "props.layout", label: "Border Style", section: "style", type: "select", options: [
|
|
@@ -738,59 +795,59 @@ const Tt = { class: "brick-table-editor" }, Nt = { class: "brick-table-editor__g
|
|
|
738
795
|
{ key: "style.color", label: "Text Color", section: "style", type: "color", defaultValue: "#000000" },
|
|
739
796
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] }
|
|
740
797
|
],
|
|
741
|
-
toPdfmake:
|
|
798
|
+
toPdfmake: dt
|
|
742
799
|
};
|
|
743
|
-
function
|
|
800
|
+
function qt() {
|
|
744
801
|
return { src: "", width: 200, height: 150, fit: null };
|
|
745
802
|
}
|
|
746
|
-
function
|
|
803
|
+
function Gt() {
|
|
747
804
|
return {};
|
|
748
805
|
}
|
|
749
|
-
function
|
|
806
|
+
function Xt(e) {
|
|
750
807
|
const t = {
|
|
751
808
|
image: e.props.src
|
|
752
809
|
};
|
|
753
810
|
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;
|
|
754
811
|
}
|
|
755
|
-
const
|
|
812
|
+
const Kt = { class: "brick-el-image" }, Qt = ["src"], Zt = {
|
|
756
813
|
key: 1,
|
|
757
814
|
class: "brick-el-image__placeholder"
|
|
758
|
-
},
|
|
815
|
+
}, en = /* @__PURE__ */ _({
|
|
759
816
|
__name: "ImageRenderer",
|
|
760
817
|
props: {
|
|
761
818
|
node: {}
|
|
762
819
|
},
|
|
763
820
|
setup(e) {
|
|
764
|
-
return (t, n) => (s(),
|
|
765
|
-
e.node.props.src ? (s(),
|
|
821
|
+
return (t, n) => (s(), c("div", Kt, [
|
|
822
|
+
e.node.props.src ? (s(), c("img", {
|
|
766
823
|
key: 0,
|
|
767
824
|
src: e.node.props.src,
|
|
768
|
-
style:
|
|
825
|
+
style: N({
|
|
769
826
|
width: e.node.props.width + "px",
|
|
770
827
|
height: e.node.props.height + "px",
|
|
771
828
|
objectFit: "contain",
|
|
772
829
|
opacity: e.node.style.opacity
|
|
773
830
|
})
|
|
774
|
-
}, null, 12,
|
|
831
|
+
}, null, 12, Qt)) : (s(), c("div", Zt, " No image selected "))
|
|
775
832
|
]));
|
|
776
833
|
}
|
|
777
|
-
}),
|
|
834
|
+
}), tn = /* @__PURE__ */ x(en, [["__scopeId", "data-v-38184258"]]), nn = { class: "brick-image-editor" }, on = /* @__PURE__ */ _({
|
|
778
835
|
__name: "ImagePropertyEditor",
|
|
779
836
|
props: {
|
|
780
837
|
node: {}
|
|
781
838
|
},
|
|
782
839
|
setup(e) {
|
|
783
|
-
return (t, n) => (s(),
|
|
840
|
+
return (t, n) => (s(), c("div", nn));
|
|
784
841
|
}
|
|
785
|
-
}),
|
|
842
|
+
}), rn = {
|
|
786
843
|
type: "image",
|
|
787
844
|
label: "Image",
|
|
788
845
|
icon: "🖼",
|
|
789
846
|
isContainer: !1,
|
|
790
|
-
defaultProps:
|
|
791
|
-
defaultStyle:
|
|
792
|
-
rendererComponent:
|
|
793
|
-
propertyEditorComponent:
|
|
847
|
+
defaultProps: qt,
|
|
848
|
+
defaultStyle: Gt,
|
|
849
|
+
rendererComponent: tn,
|
|
850
|
+
propertyEditorComponent: on,
|
|
794
851
|
propertyFields: [
|
|
795
852
|
{ key: "props.src", label: "Image (Base64)", section: "content", type: "file" },
|
|
796
853
|
{ key: "props.width", label: "Width", section: "layout", type: "number", min: 10, max: 1e3, step: 10, defaultValue: 200 },
|
|
@@ -803,53 +860,53 @@ const Wt = { class: "brick-el-image" }, Jt = ["src"], Yt = {
|
|
|
803
860
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] },
|
|
804
861
|
{ key: "style.opacity", label: "Opacity", section: "advanced", type: "slider", min: 0, max: 1, step: 0.1, defaultValue: 1 }
|
|
805
862
|
],
|
|
806
|
-
toPdfmake:
|
|
863
|
+
toPdfmake: Xt
|
|
807
864
|
};
|
|
808
|
-
function
|
|
865
|
+
function ln() {
|
|
809
866
|
return { ordered: !1, items: ["Item 1", "Item 2", "Item 3"] };
|
|
810
867
|
}
|
|
811
|
-
function
|
|
868
|
+
function sn() {
|
|
812
869
|
return { fontSize: 12 };
|
|
813
870
|
}
|
|
814
|
-
function
|
|
815
|
-
const t = e.props.items,
|
|
816
|
-
return e.style.fontSize && (
|
|
871
|
+
function an(e) {
|
|
872
|
+
const t = e.props.items, l = e.props.ordered ? { ol: t } : { ul: t };
|
|
873
|
+
return e.style.fontSize && (l.fontSize = e.style.fontSize), e.style.color && (l.color = e.style.color), e.style.margin && (l.margin = e.style.margin), l;
|
|
817
874
|
}
|
|
818
|
-
const
|
|
875
|
+
const cn = /* @__PURE__ */ _({
|
|
819
876
|
__name: "ListRenderer",
|
|
820
877
|
props: {
|
|
821
878
|
node: {}
|
|
822
879
|
},
|
|
823
880
|
setup(e) {
|
|
824
|
-
return (t, n) => (s(),
|
|
881
|
+
return (t, n) => (s(), c("div", {
|
|
825
882
|
class: "brick-el-list",
|
|
826
|
-
style:
|
|
883
|
+
style: N({ fontSize: (e.node.style.fontSize ?? 12) + "px", color: e.node.style.color })
|
|
827
884
|
}, [
|
|
828
|
-
(s(), M(
|
|
829
|
-
default:
|
|
830
|
-
(s(!0),
|
|
885
|
+
(s(), M(te(e.node.props.ordered ? "ol" : "ul"), null, {
|
|
886
|
+
default: j(() => [
|
|
887
|
+
(s(!0), c(C, null, P(e.node.props.items, (l, a) => (s(), c("li", { key: a }, w(l), 1))), 128))
|
|
831
888
|
]),
|
|
832
889
|
_: 1
|
|
833
890
|
}))
|
|
834
891
|
], 4));
|
|
835
892
|
}
|
|
836
|
-
}),
|
|
893
|
+
}), dn = /* @__PURE__ */ x(cn, [["__scopeId", "data-v-8107f859"]]), un = { class: "brick-list-editor" }, pn = /* @__PURE__ */ _({
|
|
837
894
|
__name: "ListPropertyEditor",
|
|
838
895
|
props: {
|
|
839
896
|
node: {}
|
|
840
897
|
},
|
|
841
898
|
setup(e) {
|
|
842
|
-
return (t, n) => (s(),
|
|
899
|
+
return (t, n) => (s(), c("div", un));
|
|
843
900
|
}
|
|
844
|
-
}),
|
|
901
|
+
}), fn = {
|
|
845
902
|
type: "list",
|
|
846
903
|
label: "List",
|
|
847
904
|
icon: "☰",
|
|
848
905
|
isContainer: !1,
|
|
849
|
-
defaultProps:
|
|
850
|
-
defaultStyle:
|
|
851
|
-
rendererComponent:
|
|
852
|
-
propertyEditorComponent:
|
|
906
|
+
defaultProps: ln,
|
|
907
|
+
defaultStyle: sn,
|
|
908
|
+
rendererComponent: dn,
|
|
909
|
+
propertyEditorComponent: pn,
|
|
853
910
|
propertyFields: [
|
|
854
911
|
{ key: "props.ordered", label: "Ordered", section: "content", type: "toggle", defaultValue: !1 },
|
|
855
912
|
{ key: "props.items", label: "Items", section: "content", type: "textarea", defaultValue: `Item 1
|
|
@@ -859,54 +916,54 @@ Item 3` },
|
|
|
859
916
|
{ key: "style.color", label: "Color", section: "style", type: "color", defaultValue: "#000000" },
|
|
860
917
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] }
|
|
861
918
|
],
|
|
862
|
-
toPdfmake:
|
|
919
|
+
toPdfmake: an
|
|
863
920
|
};
|
|
864
|
-
function
|
|
921
|
+
function mn() {
|
|
865
922
|
return { data: "https://example.com", fit: 100 };
|
|
866
923
|
}
|
|
867
|
-
function
|
|
924
|
+
function yn() {
|
|
868
925
|
return {};
|
|
869
926
|
}
|
|
870
|
-
function
|
|
927
|
+
function gn(e) {
|
|
871
928
|
const t = {
|
|
872
929
|
qr: e.props.data,
|
|
873
930
|
fit: e.props.fit ?? 100
|
|
874
931
|
};
|
|
875
932
|
return e.style.alignment && (t.alignment = e.style.alignment), e.style.margin && (t.margin = e.style.margin), t;
|
|
876
933
|
}
|
|
877
|
-
const
|
|
934
|
+
const bn = { class: "brick-el-qr__preview" }, hn = /* @__PURE__ */ _({
|
|
878
935
|
__name: "QrRenderer",
|
|
879
936
|
props: {
|
|
880
937
|
node: {}
|
|
881
938
|
},
|
|
882
939
|
setup(e) {
|
|
883
|
-
return (t, n) => (s(),
|
|
940
|
+
return (t, n) => (s(), c("div", {
|
|
884
941
|
class: "brick-el-qr",
|
|
885
|
-
style:
|
|
942
|
+
style: N({
|
|
886
943
|
width: (e.node.props.fit ?? 100) + "px",
|
|
887
944
|
height: (e.node.props.fit ?? 100) + "px"
|
|
888
945
|
})
|
|
889
946
|
}, [
|
|
890
|
-
m("div",
|
|
947
|
+
m("div", bn, "QR: " + w(e.node.props.data), 1)
|
|
891
948
|
], 4));
|
|
892
949
|
}
|
|
893
|
-
}),
|
|
950
|
+
}), vn = /* @__PURE__ */ x(hn, [["__scopeId", "data-v-f106ba48"]]), _n = { class: "brick-qr-editor" }, kn = /* @__PURE__ */ _({
|
|
894
951
|
__name: "QrPropertyEditor",
|
|
895
952
|
props: {
|
|
896
953
|
node: {}
|
|
897
954
|
},
|
|
898
955
|
setup(e) {
|
|
899
|
-
return (t, n) => (s(),
|
|
956
|
+
return (t, n) => (s(), c("div", _n));
|
|
900
957
|
}
|
|
901
|
-
}),
|
|
958
|
+
}), Sn = {
|
|
902
959
|
type: "qr",
|
|
903
960
|
label: "QR Code",
|
|
904
961
|
icon: "⊞",
|
|
905
962
|
isContainer: !1,
|
|
906
|
-
defaultProps:
|
|
907
|
-
defaultStyle:
|
|
908
|
-
rendererComponent:
|
|
909
|
-
propertyEditorComponent:
|
|
963
|
+
defaultProps: mn,
|
|
964
|
+
defaultStyle: yn,
|
|
965
|
+
rendererComponent: vn,
|
|
966
|
+
propertyEditorComponent: kn,
|
|
910
967
|
propertyFields: [
|
|
911
968
|
{ key: "props.data", label: "QR Data", section: "content", type: "text", defaultValue: "https://example.com" },
|
|
912
969
|
{ key: "props.fit", label: "Size (px)", section: "layout", type: "number", min: 50, max: 500, step: 10, defaultValue: 100 },
|
|
@@ -917,56 +974,56 @@ const dn = { class: "brick-el-qr__preview" }, un = /* @__PURE__ */ _({
|
|
|
917
974
|
] },
|
|
918
975
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] }
|
|
919
976
|
],
|
|
920
|
-
toPdfmake:
|
|
977
|
+
toPdfmake: gn
|
|
921
978
|
};
|
|
922
|
-
function
|
|
979
|
+
function xn() {
|
|
923
980
|
return {
|
|
924
981
|
svg: '<svg viewBox="0 0 100 100"><rect width="100" height="100" fill="#eee" /><text x="50" y="55" text-anchor="middle" font-size="12">SVG</text></svg>',
|
|
925
982
|
width: 200,
|
|
926
983
|
height: 200
|
|
927
984
|
};
|
|
928
985
|
}
|
|
929
|
-
function
|
|
986
|
+
function Cn() {
|
|
930
987
|
return {};
|
|
931
988
|
}
|
|
932
|
-
function
|
|
989
|
+
function wn(e) {
|
|
933
990
|
const t = {
|
|
934
991
|
svg: e.props.svg
|
|
935
992
|
};
|
|
936
993
|
return e.props.width && (t.width = e.props.width), e.props.height && (t.height = e.props.height), e.style.margin && (t.margin = e.style.margin), e.style.alignment && (t.alignment = e.style.alignment), t;
|
|
937
994
|
}
|
|
938
|
-
const
|
|
995
|
+
const Pn = ["innerHTML"], En = /* @__PURE__ */ _({
|
|
939
996
|
__name: "SvgRenderer",
|
|
940
997
|
props: {
|
|
941
998
|
node: {}
|
|
942
999
|
},
|
|
943
1000
|
setup(e) {
|
|
944
|
-
return (t, n) => (s(),
|
|
1001
|
+
return (t, n) => (s(), c("div", {
|
|
945
1002
|
class: "brick-el-svg",
|
|
946
|
-
style:
|
|
1003
|
+
style: N({
|
|
947
1004
|
width: e.node.props.width + "px",
|
|
948
1005
|
height: e.node.props.height + "px"
|
|
949
1006
|
}),
|
|
950
1007
|
innerHTML: e.node.props.svg
|
|
951
|
-
}, null, 12,
|
|
1008
|
+
}, null, 12, Pn));
|
|
952
1009
|
}
|
|
953
|
-
}),
|
|
1010
|
+
}), In = /* @__PURE__ */ x(En, [["__scopeId", "data-v-5e9f3319"]]), $n = { class: "brick-svg-editor" }, Rn = /* @__PURE__ */ _({
|
|
954
1011
|
__name: "SvgPropertyEditor",
|
|
955
1012
|
props: {
|
|
956
1013
|
node: {}
|
|
957
1014
|
},
|
|
958
1015
|
setup(e) {
|
|
959
|
-
return (t, n) => (s(),
|
|
1016
|
+
return (t, n) => (s(), c("div", $n));
|
|
960
1017
|
}
|
|
961
|
-
}),
|
|
1018
|
+
}), Nn = {
|
|
962
1019
|
type: "svg",
|
|
963
1020
|
label: "SVG",
|
|
964
1021
|
icon: "◇",
|
|
965
1022
|
isContainer: !1,
|
|
966
|
-
defaultProps:
|
|
967
|
-
defaultStyle:
|
|
968
|
-
rendererComponent:
|
|
969
|
-
propertyEditorComponent:
|
|
1023
|
+
defaultProps: xn,
|
|
1024
|
+
defaultStyle: Cn,
|
|
1025
|
+
rendererComponent: In,
|
|
1026
|
+
propertyEditorComponent: Rn,
|
|
970
1027
|
propertyFields: [
|
|
971
1028
|
{ key: "props.svg", label: "SVG Markup", section: "content", type: "textarea" },
|
|
972
1029
|
{ key: "props.width", label: "Width", section: "layout", type: "number", min: 10, max: 1e3, step: 10, defaultValue: 200 },
|
|
@@ -978,140 +1035,140 @@ const hn = ["innerHTML"], _n = /* @__PURE__ */ _({
|
|
|
978
1035
|
] },
|
|
979
1036
|
{ key: "style.margin", label: "Margin", section: "layout", type: "margin", defaultValue: [0, 0, 0, 0] }
|
|
980
1037
|
],
|
|
981
|
-
toPdfmake:
|
|
1038
|
+
toPdfmake: wn
|
|
982
1039
|
};
|
|
983
|
-
function
|
|
1040
|
+
function zn() {
|
|
984
1041
|
return {};
|
|
985
1042
|
}
|
|
986
|
-
function
|
|
1043
|
+
function Tn() {
|
|
987
1044
|
return {};
|
|
988
1045
|
}
|
|
989
|
-
function
|
|
1046
|
+
function Dn(e) {
|
|
990
1047
|
return { text: "", pageBreak: "after" };
|
|
991
1048
|
}
|
|
992
|
-
const
|
|
1049
|
+
const Ln = { class: "brick-el-pagebreak" }, Mn = /* @__PURE__ */ _({
|
|
993
1050
|
__name: "PageBreakRenderer",
|
|
994
1051
|
props: {
|
|
995
1052
|
node: {}
|
|
996
1053
|
},
|
|
997
1054
|
setup(e) {
|
|
998
|
-
return (t, n) => (s(),
|
|
1055
|
+
return (t, n) => (s(), c("div", Ln, [...n[0] || (n[0] = [
|
|
999
1056
|
m("hr", null, null, -1),
|
|
1000
1057
|
m("span", null, "Page Break", -1),
|
|
1001
1058
|
m("hr", null, null, -1)
|
|
1002
1059
|
])]));
|
|
1003
1060
|
}
|
|
1004
|
-
}),
|
|
1061
|
+
}), Bn = /* @__PURE__ */ x(Mn, [["__scopeId", "data-v-60c05148"]]), On = { class: "brick-pagebreak-editor" }, An = /* @__PURE__ */ _({
|
|
1005
1062
|
__name: "PageBreakPropertyEditor",
|
|
1006
1063
|
props: {
|
|
1007
1064
|
node: {}
|
|
1008
1065
|
},
|
|
1009
1066
|
setup(e) {
|
|
1010
|
-
return (t, n) => (s(),
|
|
1067
|
+
return (t, n) => (s(), c("div", On, [...n[0] || (n[0] = [
|
|
1011
1068
|
m("p", { style: { color: "#999", "font-size": "12px" } }, "No configurable properties.", -1)
|
|
1012
1069
|
])]));
|
|
1013
1070
|
}
|
|
1014
|
-
}),
|
|
1071
|
+
}), Vn = {
|
|
1015
1072
|
type: "pageBreak",
|
|
1016
1073
|
label: "Page Break",
|
|
1017
1074
|
icon: "⏎",
|
|
1018
1075
|
isContainer: !1,
|
|
1019
|
-
defaultProps:
|
|
1020
|
-
defaultStyle:
|
|
1021
|
-
rendererComponent:
|
|
1022
|
-
propertyEditorComponent:
|
|
1076
|
+
defaultProps: zn,
|
|
1077
|
+
defaultStyle: Tn,
|
|
1078
|
+
rendererComponent: Bn,
|
|
1079
|
+
propertyEditorComponent: An,
|
|
1023
1080
|
propertyFields: [],
|
|
1024
|
-
toPdfmake:
|
|
1081
|
+
toPdfmake: Dn
|
|
1025
1082
|
};
|
|
1026
|
-
let
|
|
1027
|
-
function
|
|
1028
|
-
|
|
1083
|
+
let fe = !1;
|
|
1084
|
+
function Fn() {
|
|
1085
|
+
fe || (fe = !0, z(We), z(Ze), z(st), z(Yt), z(rn), z(fn), z(Sn), z(Nn), z(Vn));
|
|
1029
1086
|
}
|
|
1030
|
-
const
|
|
1087
|
+
const Hn = {
|
|
1031
1088
|
key: 0,
|
|
1032
1089
|
class: "brick-dropzone__empty"
|
|
1033
|
-
},
|
|
1090
|
+
}, Jn = /* @__PURE__ */ _({
|
|
1034
1091
|
__name: "DropZone",
|
|
1035
1092
|
props: {
|
|
1036
1093
|
parentId: {},
|
|
1037
1094
|
layout: {}
|
|
1038
1095
|
},
|
|
1039
1096
|
setup(e) {
|
|
1040
|
-
const t = e, n =
|
|
1041
|
-
let
|
|
1042
|
-
const
|
|
1043
|
-
return
|
|
1044
|
-
n.value && (
|
|
1045
|
-
}),
|
|
1046
|
-
|
|
1047
|
-
}), (u, p) => (s(),
|
|
1097
|
+
const t = e, n = E(null);
|
|
1098
|
+
let l = null;
|
|
1099
|
+
const a = xe(), { isDragging: o } = a;
|
|
1100
|
+
return me(() => {
|
|
1101
|
+
n.value && (l = a.initContainer(n.value, t.parentId));
|
|
1102
|
+
}), ye(() => {
|
|
1103
|
+
l?.destroy();
|
|
1104
|
+
}), (u, p) => (s(), c("div", {
|
|
1048
1105
|
ref_key: "el",
|
|
1049
1106
|
ref: n,
|
|
1050
|
-
class:
|
|
1107
|
+
class: ee(["brick-dropzone", { "brick-dropzone--horizontal": e.layout === "horizontal", "brick-dropzone--drag-active": k(o) && e.layout === "horizontal" }])
|
|
1051
1108
|
}, [
|
|
1052
|
-
|
|
1053
|
-
u.$slots.default ?
|
|
1109
|
+
Z(u.$slots, "default", {}, void 0, !0),
|
|
1110
|
+
u.$slots.default ? $("", !0) : (s(), c("div", Hn, " Drop elements here "))
|
|
1054
1111
|
], 2));
|
|
1055
1112
|
}
|
|
1056
|
-
}),
|
|
1113
|
+
}), $e = /* @__PURE__ */ x(Jn, [["__scopeId", "data-v-b9596dad"]]), Un = ["data-element-id", "data-element-type"], Wn = {
|
|
1057
1114
|
key: 1,
|
|
1058
1115
|
class: "brick-canvas-element__unknown"
|
|
1059
|
-
},
|
|
1116
|
+
}, jn = /* @__PURE__ */ _({
|
|
1060
1117
|
__name: "CanvasElement",
|
|
1061
1118
|
props: {
|
|
1062
1119
|
node: {},
|
|
1063
1120
|
path: {}
|
|
1064
1121
|
},
|
|
1065
1122
|
setup(e) {
|
|
1066
|
-
const t = e, n =
|
|
1123
|
+
const t = e, n = W(), l = q(), a = E(null), o = I(() => U(t.node.type)), u = I(() => n.selectedId.value === t.node.id), p = I(() => o.value ? o.value.propertyFields.some((f) => f.key === "props.width" || f.key === "style.width") : !1), d = I(() => o.value ? o.value.propertyFields.some((f) => f.key === "props.height" || f.key === "style.height") : !1);
|
|
1067
1124
|
function r(f) {
|
|
1068
1125
|
f.stopPropagation(), n.select(t.node.id);
|
|
1069
1126
|
}
|
|
1070
|
-
function
|
|
1127
|
+
function i(f) {
|
|
1071
1128
|
f.stopPropagation(), f.preventDefault();
|
|
1072
|
-
const b = f.clientX,
|
|
1073
|
-
function
|
|
1074
|
-
const O =
|
|
1075
|
-
o.value?.propertyFields.some((
|
|
1129
|
+
const b = f.clientX, h = a.value?.offsetWidth ?? 200;
|
|
1130
|
+
function v(R) {
|
|
1131
|
+
const O = R.clientX - b, T = Math.max(20, h + O);
|
|
1132
|
+
o.value?.propertyFields.some((F) => F.key === "props.width") ? l.updateProps(t.node.id, { width: Math.round(T) }) : l.updateStyle(t.node.id, { width: Math.round(T) });
|
|
1076
1133
|
}
|
|
1077
1134
|
function S() {
|
|
1078
|
-
document.removeEventListener("pointermove",
|
|
1135
|
+
document.removeEventListener("pointermove", v), document.removeEventListener("pointerup", S), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1079
1136
|
}
|
|
1080
|
-
document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove",
|
|
1137
|
+
document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", v), document.addEventListener("pointerup", S);
|
|
1081
1138
|
}
|
|
1082
1139
|
function y(f) {
|
|
1083
1140
|
f.stopPropagation(), f.preventDefault();
|
|
1084
|
-
const b = f.clientY,
|
|
1085
|
-
function
|
|
1086
|
-
const O =
|
|
1087
|
-
o.value?.propertyFields.some((
|
|
1141
|
+
const b = f.clientY, h = a.value?.offsetHeight ?? 100;
|
|
1142
|
+
function v(R) {
|
|
1143
|
+
const O = R.clientY - b, T = Math.max(20, h + O);
|
|
1144
|
+
o.value?.propertyFields.some((F) => F.key === "props.height") ? l.updateProps(t.node.id, { height: Math.round(T) }) : l.updateStyle(t.node.id, { height: Math.round(T) });
|
|
1088
1145
|
}
|
|
1089
1146
|
function S() {
|
|
1090
|
-
document.removeEventListener("pointermove",
|
|
1147
|
+
document.removeEventListener("pointermove", v), document.removeEventListener("pointerup", S), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1091
1148
|
}
|
|
1092
|
-
document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove",
|
|
1149
|
+
document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", v), document.addEventListener("pointerup", S);
|
|
1093
1150
|
}
|
|
1094
1151
|
function g(f) {
|
|
1095
1152
|
f.stopPropagation(), f.preventDefault();
|
|
1096
|
-
const b = f.clientX,
|
|
1097
|
-
function
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1153
|
+
const b = f.clientX, h = f.clientY, v = a.value?.offsetWidth ?? 200, S = a.value?.offsetHeight ?? 100;
|
|
1154
|
+
function R(T) {
|
|
1155
|
+
const G = T.clientX - b, F = T.clientY - h, re = Math.max(20, v + G), le = Math.max(20, S + F), Re = o.value?.propertyFields.some((X) => X.key === "props.width"), Ne = o.value?.propertyFields.some((X) => X.key === "props.height");
|
|
1156
|
+
Re ? l.updateProps(t.node.id, { width: Math.round(re) }) : l.updateStyle(t.node.id, { width: Math.round(re) }), Ne ? l.updateProps(t.node.id, { height: Math.round(le) }) : l.updateStyle(t.node.id, { height: Math.round(le) });
|
|
1100
1157
|
}
|
|
1101
1158
|
function O() {
|
|
1102
|
-
document.removeEventListener("pointermove",
|
|
1159
|
+
document.removeEventListener("pointermove", R), document.removeEventListener("pointerup", O), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1103
1160
|
}
|
|
1104
|
-
document.body.style.cursor = "nwse-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove",
|
|
1161
|
+
document.body.style.cursor = "nwse-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", R), document.addEventListener("pointerup", O);
|
|
1105
1162
|
}
|
|
1106
1163
|
return (f, b) => {
|
|
1107
|
-
const
|
|
1108
|
-
return s(),
|
|
1164
|
+
const h = Te("CanvasElement", !0);
|
|
1165
|
+
return s(), c("div", {
|
|
1109
1166
|
ref_key: "elRef",
|
|
1110
|
-
ref:
|
|
1111
|
-
class:
|
|
1167
|
+
ref: a,
|
|
1168
|
+
class: ee(["brick-canvas-element", { "brick-canvas-element--selected": u.value }]),
|
|
1112
1169
|
"data-element-id": e.node.id,
|
|
1113
1170
|
"data-element-type": e.node.type,
|
|
1114
|
-
style:
|
|
1171
|
+
style: N({
|
|
1115
1172
|
width: typeof e.node.style.width == "number" ? e.node.style.width + "px" : e.node.props.width ? e.node.props.width + "px" : e.node.style.width,
|
|
1116
1173
|
height: e.node.style.height ? e.node.style.height + "px" : e.node.props.height ? e.node.props.height + "px" : void 0,
|
|
1117
1174
|
marginTop: e.node.style.margin?.[1] + "px",
|
|
@@ -1122,102 +1179,102 @@ const Ln = {
|
|
|
1122
1179
|
}),
|
|
1123
1180
|
onClick: r
|
|
1124
1181
|
}, [
|
|
1125
|
-
o.value ? (s(), M(
|
|
1182
|
+
o.value ? (s(), M(te(o.value.rendererComponent), {
|
|
1126
1183
|
key: 0,
|
|
1127
1184
|
node: e.node,
|
|
1128
1185
|
path: e.path
|
|
1129
1186
|
}, {
|
|
1130
|
-
default:
|
|
1131
|
-
o.value.isContainer ? (s(), M(
|
|
1187
|
+
default: j(() => [
|
|
1188
|
+
o.value.isContainer ? (s(), M($e, {
|
|
1132
1189
|
key: 0,
|
|
1133
1190
|
"parent-id": e.node.id,
|
|
1134
1191
|
layout: e.node.type === "columns" ? "horizontal" : "vertical"
|
|
1135
1192
|
}, {
|
|
1136
|
-
default:
|
|
1137
|
-
(s(!0),
|
|
1138
|
-
key:
|
|
1139
|
-
node:
|
|
1193
|
+
default: j(() => [
|
|
1194
|
+
(s(!0), c(C, null, P(e.node.children, (v, S) => (s(), M(h, {
|
|
1195
|
+
key: v.id,
|
|
1196
|
+
node: v,
|
|
1140
1197
|
path: [...e.path, S]
|
|
1141
1198
|
}, null, 8, ["node", "path"]))), 128))
|
|
1142
1199
|
]),
|
|
1143
1200
|
_: 1
|
|
1144
|
-
}, 8, ["parent-id", "layout"])) :
|
|
1201
|
+
}, 8, ["parent-id", "layout"])) : $("", !0)
|
|
1145
1202
|
]),
|
|
1146
1203
|
_: 1
|
|
1147
|
-
}, 8, ["node", "path"])) : (s(),
|
|
1148
|
-
u.value ? (s(),
|
|
1149
|
-
p.value ? (s(),
|
|
1204
|
+
}, 8, ["node", "path"])) : (s(), c("div", Wn, " Unknown element: " + w(e.node.type), 1)),
|
|
1205
|
+
u.value ? (s(), c(C, { key: 2 }, [
|
|
1206
|
+
p.value ? (s(), c("div", {
|
|
1150
1207
|
key: 0,
|
|
1151
1208
|
class: "brick-resize-handle brick-resize-handle--e",
|
|
1152
|
-
onPointerdown:
|
|
1153
|
-
}, null, 32)) :
|
|
1154
|
-
|
|
1209
|
+
onPointerdown: i
|
|
1210
|
+
}, null, 32)) : $("", !0),
|
|
1211
|
+
d.value ? (s(), c("div", {
|
|
1155
1212
|
key: 1,
|
|
1156
1213
|
class: "brick-resize-handle brick-resize-handle--s",
|
|
1157
1214
|
onPointerdown: y
|
|
1158
|
-
}, null, 32)) :
|
|
1159
|
-
p.value &&
|
|
1215
|
+
}, null, 32)) : $("", !0),
|
|
1216
|
+
p.value && d.value ? (s(), c("div", {
|
|
1160
1217
|
key: 2,
|
|
1161
1218
|
class: "brick-resize-handle brick-resize-handle--se",
|
|
1162
1219
|
onPointerdown: g
|
|
1163
|
-
}, null, 32)) :
|
|
1164
|
-
], 64)) :
|
|
1165
|
-
], 14,
|
|
1220
|
+
}, null, 32)) : $("", !0)
|
|
1221
|
+
], 64)) : $("", !0)
|
|
1222
|
+
], 14, Un);
|
|
1166
1223
|
};
|
|
1167
1224
|
}
|
|
1168
|
-
}),
|
|
1225
|
+
}), Yn = /* @__PURE__ */ x(jn, [["__scopeId", "data-v-6b9cadc1"]]), qn = { class: "brick-doc-bar" }, Gn = { class: "brick-doc-bar__field" }, Xn = ["value"], Kn = { 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__ */ _({
|
|
1169
1226
|
__name: "DocumentSettings",
|
|
1170
1227
|
setup(e) {
|
|
1171
|
-
const t =
|
|
1228
|
+
const t = oe(), n = [
|
|
1172
1229
|
{ label: "A3", value: "A3" },
|
|
1173
1230
|
{ label: "A4", value: "A4" },
|
|
1174
1231
|
{ label: "A5", value: "A5" },
|
|
1175
1232
|
{ label: "Letter", value: "LETTER" },
|
|
1176
1233
|
{ label: "Legal", value: "LEGAL" }
|
|
1177
1234
|
];
|
|
1178
|
-
function
|
|
1235
|
+
function l(a, o) {
|
|
1179
1236
|
const u = [...t.document.pageMargins];
|
|
1180
|
-
u[
|
|
1237
|
+
u[a] = o, t.document.pageMargins = u;
|
|
1181
1238
|
}
|
|
1182
|
-
return (
|
|
1183
|
-
m("div",
|
|
1239
|
+
return (a, o) => (s(), c("div", qn, [
|
|
1240
|
+
m("div", Gn, [
|
|
1184
1241
|
o[3] || (o[3] = m("label", null, "Size", -1)),
|
|
1185
|
-
|
|
1242
|
+
K(m("select", {
|
|
1186
1243
|
"onUpdate:modelValue": o[0] || (o[0] = (u) => k(t).document.pageSize = u)
|
|
1187
1244
|
}, [
|
|
1188
|
-
(s(),
|
|
1245
|
+
(s(), c(C, null, P(n, (u) => m("option", {
|
|
1189
1246
|
key: u.value,
|
|
1190
1247
|
value: u.value
|
|
1191
|
-
}, w(u.label), 9,
|
|
1248
|
+
}, w(u.label), 9, Xn)), 64))
|
|
1192
1249
|
], 512), [
|
|
1193
|
-
[
|
|
1250
|
+
[se, k(t).document.pageSize]
|
|
1194
1251
|
])
|
|
1195
1252
|
]),
|
|
1196
|
-
m("div",
|
|
1253
|
+
m("div", Kn, [
|
|
1197
1254
|
o[5] || (o[5] = m("label", null, "Orientation", -1)),
|
|
1198
|
-
|
|
1255
|
+
K(m("select", {
|
|
1199
1256
|
"onUpdate:modelValue": o[1] || (o[1] = (u) => k(t).document.pageOrientation = u)
|
|
1200
1257
|
}, [...o[4] || (o[4] = [
|
|
1201
1258
|
m("option", { value: "portrait" }, "Portrait", -1),
|
|
1202
1259
|
m("option", { value: "landscape" }, "Landscape", -1)
|
|
1203
1260
|
])], 512), [
|
|
1204
|
-
[
|
|
1261
|
+
[se, k(t).document.pageOrientation]
|
|
1205
1262
|
])
|
|
1206
1263
|
]),
|
|
1207
|
-
m("div",
|
|
1264
|
+
m("div", Qn, [
|
|
1208
1265
|
o[6] || (o[6] = m("label", null, "Margins", -1)),
|
|
1209
|
-
m("div",
|
|
1210
|
-
(s(),
|
|
1266
|
+
m("div", Zn, [
|
|
1267
|
+
(s(), c(C, null, P(["L", "T", "R", "B"], (u, p) => m("input", {
|
|
1211
1268
|
key: p,
|
|
1212
1269
|
type: "number",
|
|
1213
1270
|
placeholder: u,
|
|
1214
1271
|
title: u,
|
|
1215
1272
|
value: k(t).document.pageMargins[p],
|
|
1216
|
-
onInput: (
|
|
1217
|
-
}, null, 40,
|
|
1273
|
+
onInput: (d) => l(p, Number(d.target.value))
|
|
1274
|
+
}, null, 40, eo)), 64))
|
|
1218
1275
|
])
|
|
1219
1276
|
]),
|
|
1220
|
-
m("div",
|
|
1277
|
+
m("div", to, [
|
|
1221
1278
|
o[7] || (o[7] = m("label", null, "Font Size", -1)),
|
|
1222
1279
|
m("input", {
|
|
1223
1280
|
type: "number",
|
|
@@ -1225,52 +1282,52 @@ const Ln = {
|
|
|
1225
1282
|
min: "6",
|
|
1226
1283
|
max: "72",
|
|
1227
1284
|
onInput: o[2] || (o[2] = (u) => (k(t).document.defaultStyle ??= {}).fontSize = Number(u.target.value))
|
|
1228
|
-
}, null, 40,
|
|
1285
|
+
}, null, 40, no)
|
|
1229
1286
|
])
|
|
1230
1287
|
]));
|
|
1231
1288
|
}
|
|
1232
|
-
}),
|
|
1289
|
+
}), ro = /* @__PURE__ */ x(oo, [["__scopeId", "data-v-39a2b54f"]]), lo = { class: "brick-canvas" }, V = 0.75, io = /* @__PURE__ */ _({
|
|
1233
1290
|
__name: "DesignCanvas",
|
|
1234
1291
|
setup(e) {
|
|
1235
|
-
const t =
|
|
1292
|
+
const t = oe(), n = W(), l = {
|
|
1236
1293
|
A3: [841.89, 1190.55],
|
|
1237
1294
|
A4: [595.28, 841.89],
|
|
1238
1295
|
A5: [419.53, 595.28],
|
|
1239
1296
|
LETTER: [612, 792],
|
|
1240
1297
|
LEGAL: [612, 1008]
|
|
1241
|
-
},
|
|
1242
|
-
const [p,
|
|
1243
|
-
return Math.round(r *
|
|
1244
|
-
}), o =
|
|
1245
|
-
const [p,
|
|
1246
|
-
return Math.round(r *
|
|
1298
|
+
}, a = I(() => {
|
|
1299
|
+
const [p, d] = l[t.document.pageSize] ?? l.A4, r = t.document.pageOrientation === "landscape" ? d : p;
|
|
1300
|
+
return Math.round(r * V);
|
|
1301
|
+
}), o = I(() => {
|
|
1302
|
+
const [p, d] = l[t.document.pageSize] ?? l.A4, r = t.document.pageOrientation === "landscape" ? p : d;
|
|
1303
|
+
return Math.round(r * V);
|
|
1247
1304
|
});
|
|
1248
1305
|
function u(p) {
|
|
1249
1306
|
(p.target === p.currentTarget || p.target.classList.contains("brick-canvas__page")) && n.deselect();
|
|
1250
1307
|
}
|
|
1251
|
-
return (p,
|
|
1252
|
-
B(
|
|
1308
|
+
return (p, d) => (s(), c("div", lo, [
|
|
1309
|
+
B(ro),
|
|
1253
1310
|
m("div", {
|
|
1254
1311
|
class: "brick-canvas__scroll",
|
|
1255
1312
|
onClick: u
|
|
1256
1313
|
}, [
|
|
1257
1314
|
m("div", {
|
|
1258
1315
|
class: "brick-canvas__page",
|
|
1259
|
-
style:
|
|
1260
|
-
width:
|
|
1316
|
+
style: N({
|
|
1317
|
+
width: a.value + "px",
|
|
1261
1318
|
minHeight: o.value + "px",
|
|
1262
|
-
paddingTop: k(t).document.pageMargins[1] *
|
|
1263
|
-
paddingRight: k(t).document.pageMargins[2] *
|
|
1264
|
-
paddingBottom: k(t).document.pageMargins[3] *
|
|
1265
|
-
paddingLeft: k(t).document.pageMargins[0] *
|
|
1319
|
+
paddingTop: k(t).document.pageMargins[1] * V + "px",
|
|
1320
|
+
paddingRight: k(t).document.pageMargins[2] * V + "px",
|
|
1321
|
+
paddingBottom: k(t).document.pageMargins[3] * V + "px",
|
|
1322
|
+
paddingLeft: k(t).document.pageMargins[0] * V + "px"
|
|
1266
1323
|
})
|
|
1267
1324
|
}, [
|
|
1268
|
-
B(
|
|
1269
|
-
default:
|
|
1270
|
-
(s(!0),
|
|
1325
|
+
B($e, { "parent-id": null }, {
|
|
1326
|
+
default: j(() => [
|
|
1327
|
+
(s(!0), c(C, null, P(k(t).document.content, (r, i) => (s(), M(Yn, {
|
|
1271
1328
|
key: r.id,
|
|
1272
1329
|
node: r,
|
|
1273
|
-
path: [
|
|
1330
|
+
path: [i]
|
|
1274
1331
|
}, null, 8, ["node", "path"]))), 128))
|
|
1275
1332
|
]),
|
|
1276
1333
|
_: 1
|
|
@@ -1279,278 +1336,278 @@ const Ln = {
|
|
|
1279
1336
|
])
|
|
1280
1337
|
]));
|
|
1281
1338
|
}
|
|
1282
|
-
}),
|
|
1339
|
+
}), so = /* @__PURE__ */ x(io, [["__scopeId", "data-v-364329ec"]]), ao = ["data-element-type"], co = { class: "brick-element-list__icon" }, uo = { class: "brick-element-list__label" }, po = /* @__PURE__ */ _({
|
|
1283
1340
|
__name: "ToolbarElementList",
|
|
1284
1341
|
setup(e) {
|
|
1285
|
-
const t =
|
|
1342
|
+
const t = E(null);
|
|
1286
1343
|
let n = null;
|
|
1287
|
-
const
|
|
1288
|
-
return
|
|
1289
|
-
t.value && (n =
|
|
1290
|
-
}),
|
|
1344
|
+
const l = xe(), a = Be();
|
|
1345
|
+
return me(() => {
|
|
1346
|
+
t.value && (n = l.initToolbar(t.value));
|
|
1347
|
+
}), ye(() => {
|
|
1291
1348
|
n?.destroy();
|
|
1292
|
-
}), (o, u) => (s(),
|
|
1349
|
+
}), (o, u) => (s(), c("div", {
|
|
1293
1350
|
ref_key: "el",
|
|
1294
1351
|
ref: t,
|
|
1295
1352
|
class: "brick-element-list"
|
|
1296
1353
|
}, [
|
|
1297
|
-
(s(!0),
|
|
1354
|
+
(s(!0), c(C, null, P(k(a), (p) => (s(), c("div", {
|
|
1298
1355
|
key: p.type,
|
|
1299
1356
|
class: "brick-element-list__item",
|
|
1300
1357
|
"data-element-type": p.type
|
|
1301
1358
|
}, [
|
|
1302
|
-
m("span",
|
|
1303
|
-
m("span",
|
|
1304
|
-
], 8,
|
|
1359
|
+
m("span", co, w(p.icon), 1),
|
|
1360
|
+
m("span", uo, w(p.label), 1)
|
|
1361
|
+
], 8, ao))), 128))
|
|
1305
1362
|
], 512));
|
|
1306
1363
|
}
|
|
1307
|
-
}),
|
|
1364
|
+
}), fo = /* @__PURE__ */ x(po, [["__scopeId", "data-v-2d0b1dbf"]]), mo = { class: "brick-field" }, yo = { class: "brick-field__label" }, go = ["value"], bo = ["value"], ho = ["value", "min", "max", "step"], vo = ["value"], _o = ["value"], ko = ["value"], So = {
|
|
1308
1365
|
key: 5,
|
|
1309
1366
|
class: "brick-field__toggle"
|
|
1310
|
-
},
|
|
1367
|
+
}, xo = ["checked"], Co = {
|
|
1311
1368
|
key: 6,
|
|
1312
1369
|
class: "brick-field__margin"
|
|
1313
|
-
},
|
|
1370
|
+
}, wo = ["placeholder", "value", "onInput"], Po = {
|
|
1314
1371
|
key: 7,
|
|
1315
1372
|
class: "brick-field__slider"
|
|
1316
|
-
},
|
|
1373
|
+
}, Eo = ["value", "min", "max", "step"], Io = { class: "brick-field__slider-value" }, $o = /* @__PURE__ */ _({
|
|
1317
1374
|
__name: "PropertyField",
|
|
1318
1375
|
props: {
|
|
1319
1376
|
descriptor: {},
|
|
1320
1377
|
node: {}
|
|
1321
1378
|
},
|
|
1322
1379
|
setup(e) {
|
|
1323
|
-
const t = e, n =
|
|
1324
|
-
const
|
|
1380
|
+
const t = e, n = q(), l = I(() => {
|
|
1381
|
+
const d = t.descriptor.key.split("."), r = d[0], i = d[1];
|
|
1325
1382
|
if (r === "props")
|
|
1326
|
-
return t.node.props[
|
|
1383
|
+
return t.node.props[i];
|
|
1327
1384
|
if (r === "style")
|
|
1328
|
-
return t.node.style[
|
|
1329
|
-
}),
|
|
1330
|
-
const
|
|
1331
|
-
return t.descriptor.type === "textarea" && Array.isArray(
|
|
1332
|
-
`) :
|
|
1385
|
+
return t.node.style[i];
|
|
1386
|
+
}), a = I(() => {
|
|
1387
|
+
const d = l.value;
|
|
1388
|
+
return t.descriptor.type === "textarea" && Array.isArray(d) ? d.join(`
|
|
1389
|
+
`) : d;
|
|
1333
1390
|
});
|
|
1334
|
-
function o(
|
|
1335
|
-
const r = t.descriptor.key.split("."),
|
|
1336
|
-
let g =
|
|
1337
|
-
t.descriptor.type === "textarea" && Array.isArray(
|
|
1338
|
-
`)),
|
|
1391
|
+
function o(d) {
|
|
1392
|
+
const r = t.descriptor.key.split("."), i = r[0], y = r[1];
|
|
1393
|
+
let g = d;
|
|
1394
|
+
t.descriptor.type === "textarea" && Array.isArray(l.value) && (g = d.split(`
|
|
1395
|
+
`)), i === "props" ? n.updateProps(t.node.id, { [y]: g }) : i === "style" && n.updateStyle(t.node.id, { [y]: g });
|
|
1339
1396
|
}
|
|
1340
|
-
function u(
|
|
1341
|
-
const y = [...
|
|
1342
|
-
y[
|
|
1397
|
+
function u(d, r) {
|
|
1398
|
+
const y = [...a.value ?? [0, 0, 0, 0]];
|
|
1399
|
+
y[d] = r, o(y);
|
|
1343
1400
|
}
|
|
1344
|
-
function p(
|
|
1345
|
-
const
|
|
1346
|
-
if (!
|
|
1401
|
+
function p(d) {
|
|
1402
|
+
const i = d.target.files?.[0];
|
|
1403
|
+
if (!i) return;
|
|
1347
1404
|
const y = new FileReader();
|
|
1348
1405
|
y.onload = () => {
|
|
1349
1406
|
o(y.result);
|
|
1350
|
-
}, y.readAsDataURL(
|
|
1407
|
+
}, y.readAsDataURL(i);
|
|
1351
1408
|
}
|
|
1352
|
-
return (
|
|
1353
|
-
m("label",
|
|
1354
|
-
e.descriptor.type === "text" ? (s(),
|
|
1409
|
+
return (d, r) => (s(), c("div", mo, [
|
|
1410
|
+
m("label", yo, w(e.descriptor.label), 1),
|
|
1411
|
+
e.descriptor.type === "text" ? (s(), c("input", {
|
|
1355
1412
|
key: 0,
|
|
1356
1413
|
type: "text",
|
|
1357
1414
|
class: "brick-field__input",
|
|
1358
|
-
value:
|
|
1359
|
-
onInput: r[0] || (r[0] = (
|
|
1360
|
-
}, null, 40,
|
|
1415
|
+
value: a.value,
|
|
1416
|
+
onInput: r[0] || (r[0] = (i) => o(i.target.value))
|
|
1417
|
+
}, null, 40, go)) : e.descriptor.type === "textarea" ? (s(), c("textarea", {
|
|
1361
1418
|
key: 1,
|
|
1362
1419
|
class: "brick-field__textarea",
|
|
1363
|
-
value:
|
|
1420
|
+
value: a.value,
|
|
1364
1421
|
rows: "3",
|
|
1365
|
-
onInput: r[1] || (r[1] = (
|
|
1366
|
-
}, null, 40,
|
|
1422
|
+
onInput: r[1] || (r[1] = (i) => o(i.target.value))
|
|
1423
|
+
}, null, 40, bo)) : e.descriptor.type === "number" ? (s(), c("input", {
|
|
1367
1424
|
key: 2,
|
|
1368
1425
|
type: "number",
|
|
1369
1426
|
class: "brick-field__input",
|
|
1370
|
-
value:
|
|
1427
|
+
value: a.value,
|
|
1371
1428
|
min: e.descriptor.min,
|
|
1372
1429
|
max: e.descriptor.max,
|
|
1373
1430
|
step: e.descriptor.step,
|
|
1374
|
-
onInput: r[2] || (r[2] = (
|
|
1375
|
-
}, null, 40,
|
|
1431
|
+
onInput: r[2] || (r[2] = (i) => o(Number(i.target.value)))
|
|
1432
|
+
}, null, 40, ho)) : e.descriptor.type === "color" ? (s(), c("input", {
|
|
1376
1433
|
key: 3,
|
|
1377
1434
|
type: "color",
|
|
1378
1435
|
class: "brick-field__color",
|
|
1379
|
-
value:
|
|
1380
|
-
onInput: r[3] || (r[3] = (
|
|
1381
|
-
}, null, 40,
|
|
1436
|
+
value: a.value ?? "#000000",
|
|
1437
|
+
onInput: r[3] || (r[3] = (i) => o(i.target.value))
|
|
1438
|
+
}, null, 40, vo)) : e.descriptor.type === "select" ? (s(), c("select", {
|
|
1382
1439
|
key: 4,
|
|
1383
1440
|
class: "brick-field__select",
|
|
1384
|
-
value:
|
|
1385
|
-
onChange: r[4] || (r[4] = (
|
|
1441
|
+
value: a.value,
|
|
1442
|
+
onChange: r[4] || (r[4] = (i) => o(i.target.value || void 0))
|
|
1386
1443
|
}, [
|
|
1387
|
-
(s(!0),
|
|
1388
|
-
key: String(
|
|
1389
|
-
value:
|
|
1390
|
-
}, w(
|
|
1391
|
-
], 40,
|
|
1444
|
+
(s(!0), c(C, null, P(e.descriptor.options, (i) => (s(), c("option", {
|
|
1445
|
+
key: String(i.value),
|
|
1446
|
+
value: i.value
|
|
1447
|
+
}, w(i.label), 9, ko))), 128))
|
|
1448
|
+
], 40, _o)) : e.descriptor.type === "toggle" ? (s(), c("label", So, [
|
|
1392
1449
|
m("input", {
|
|
1393
1450
|
type: "checkbox",
|
|
1394
|
-
checked:
|
|
1395
|
-
onChange: r[5] || (r[5] = (
|
|
1396
|
-
}, null, 40,
|
|
1397
|
-
m("span", null, w(
|
|
1398
|
-
])) : e.descriptor.type === "margin" ? (s(),
|
|
1399
|
-
(s(),
|
|
1400
|
-
key:
|
|
1451
|
+
checked: a.value,
|
|
1452
|
+
onChange: r[5] || (r[5] = (i) => o(i.target.checked))
|
|
1453
|
+
}, null, 40, xo),
|
|
1454
|
+
m("span", null, w(a.value ? "On" : "Off"), 1)
|
|
1455
|
+
])) : e.descriptor.type === "margin" ? (s(), c("div", Co, [
|
|
1456
|
+
(s(), c(C, null, P(["L", "T", "R", "B"], (i, y) => m("input", {
|
|
1457
|
+
key: i,
|
|
1401
1458
|
type: "number",
|
|
1402
1459
|
class: "brick-field__margin-input",
|
|
1403
|
-
placeholder:
|
|
1404
|
-
value: (
|
|
1460
|
+
placeholder: i,
|
|
1461
|
+
value: (a.value ?? [0, 0, 0, 0])[y],
|
|
1405
1462
|
onInput: (g) => u(y, Number(g.target.value))
|
|
1406
|
-
}, null, 40,
|
|
1407
|
-
])) : e.descriptor.type === "slider" ? (s(),
|
|
1463
|
+
}, null, 40, wo)), 64))
|
|
1464
|
+
])) : e.descriptor.type === "slider" ? (s(), c("div", Po, [
|
|
1408
1465
|
m("input", {
|
|
1409
1466
|
type: "range",
|
|
1410
|
-
value:
|
|
1467
|
+
value: a.value,
|
|
1411
1468
|
min: e.descriptor.min,
|
|
1412
1469
|
max: e.descriptor.max,
|
|
1413
1470
|
step: e.descriptor.step,
|
|
1414
|
-
onInput: r[6] || (r[6] = (
|
|
1415
|
-
}, null, 40,
|
|
1416
|
-
m("span",
|
|
1417
|
-
])) : e.descriptor.type === "file" ? (s(),
|
|
1471
|
+
onInput: r[6] || (r[6] = (i) => o(Number(i.target.value)))
|
|
1472
|
+
}, null, 40, Eo),
|
|
1473
|
+
m("span", Io, w(a.value), 1)
|
|
1474
|
+
])) : e.descriptor.type === "file" ? (s(), c("input", {
|
|
1418
1475
|
key: 8,
|
|
1419
1476
|
type: "file",
|
|
1420
1477
|
accept: "image/*",
|
|
1421
1478
|
class: "brick-field__file",
|
|
1422
1479
|
onChange: p
|
|
1423
|
-
}, null, 32)) :
|
|
1480
|
+
}, null, 32)) : $("", !0)
|
|
1424
1481
|
]));
|
|
1425
1482
|
}
|
|
1426
|
-
}),
|
|
1483
|
+
}), Ro = /* @__PURE__ */ x($o, [["__scopeId", "data-v-5a3bec1b"]]), No = {
|
|
1427
1484
|
key: 0,
|
|
1428
1485
|
class: "brick-property-editor"
|
|
1429
|
-
},
|
|
1486
|
+
}, zo = { class: "brick-property-editor__type" }, To = {
|
|
1430
1487
|
key: 0,
|
|
1431
1488
|
class: "brick-property-editor__group"
|
|
1432
|
-
},
|
|
1489
|
+
}, Do = { class: "brick-property-editor__group-title" }, Lo = /* @__PURE__ */ _({
|
|
1433
1490
|
__name: "PropertyEditor",
|
|
1434
1491
|
setup(e) {
|
|
1435
|
-
const t =
|
|
1492
|
+
const t = W(), n = I(() => {
|
|
1436
1493
|
const u = t.selectedNode.value;
|
|
1437
|
-
return u ?
|
|
1438
|
-
}),
|
|
1494
|
+
return u ? U(u.type) : null;
|
|
1495
|
+
}), l = I(() => {
|
|
1439
1496
|
if (!n.value) return {};
|
|
1440
1497
|
const u = {};
|
|
1441
1498
|
for (const p of n.value.propertyFields)
|
|
1442
1499
|
u[p.section] || (u[p.section] = []), u[p.section].push(p);
|
|
1443
1500
|
return u;
|
|
1444
|
-
}),
|
|
1501
|
+
}), a = {
|
|
1445
1502
|
content: "Content",
|
|
1446
1503
|
style: "Style",
|
|
1447
1504
|
layout: "Layout",
|
|
1448
1505
|
advanced: "Advanced"
|
|
1449
1506
|
}, o = ["content", "style", "layout", "advanced"];
|
|
1450
|
-
return (u, p) => k(t).selectedNode.value && n.value ? (s(),
|
|
1451
|
-
m("div",
|
|
1452
|
-
(s(),
|
|
1453
|
-
|
|
1454
|
-
m("div",
|
|
1455
|
-
(s(!0),
|
|
1507
|
+
return (u, p) => k(t).selectedNode.value && n.value ? (s(), c("div", No, [
|
|
1508
|
+
m("div", zo, w(n.value.icon) + " " + w(n.value.label), 1),
|
|
1509
|
+
(s(), c(C, null, P(o, (d) => (s(), c(C, { key: d }, [
|
|
1510
|
+
l.value[d] ? (s(), c("div", To, [
|
|
1511
|
+
m("div", Do, w(a[d]), 1),
|
|
1512
|
+
(s(!0), c(C, null, P(l.value[d], (r) => (s(), M(Ro, {
|
|
1456
1513
|
key: r.key,
|
|
1457
1514
|
descriptor: r,
|
|
1458
1515
|
node: k(t).selectedNode.value
|
|
1459
1516
|
}, null, 8, ["descriptor", "node"]))), 128))
|
|
1460
|
-
])) :
|
|
1517
|
+
])) : $("", !0)
|
|
1461
1518
|
], 64))), 64)),
|
|
1462
|
-
(s(), M(
|
|
1519
|
+
(s(), M(te(n.value.propertyEditorComponent), {
|
|
1463
1520
|
node: k(t).selectedNode.value
|
|
1464
1521
|
}, null, 8, ["node"]))
|
|
1465
|
-
])) :
|
|
1522
|
+
])) : $("", !0);
|
|
1466
1523
|
}
|
|
1467
|
-
}),
|
|
1524
|
+
}), Mo = /* @__PURE__ */ x(Lo, [["__scopeId", "data-v-4d129dac"]]), Bo = { class: "brick-toolbar" }, Oo = { class: "brick-toolbar__section" }, Ao = {
|
|
1468
1525
|
key: 0,
|
|
1469
1526
|
class: "brick-toolbar__section"
|
|
1470
|
-
},
|
|
1527
|
+
}, Vo = /* @__PURE__ */ _({
|
|
1471
1528
|
__name: "Toolbar",
|
|
1472
1529
|
setup(e) {
|
|
1473
|
-
const t =
|
|
1474
|
-
return (n,
|
|
1475
|
-
m("div",
|
|
1476
|
-
|
|
1477
|
-
B(
|
|
1530
|
+
const t = W();
|
|
1531
|
+
return (n, l) => (s(), c("div", Bo, [
|
|
1532
|
+
m("div", Oo, [
|
|
1533
|
+
l[0] || (l[0] = m("h3", { class: "brick-toolbar__title" }, "Elements", -1)),
|
|
1534
|
+
B(fo)
|
|
1478
1535
|
]),
|
|
1479
|
-
k(t).selectedNode.value ? (s(),
|
|
1480
|
-
|
|
1481
|
-
B(
|
|
1482
|
-
])) :
|
|
1536
|
+
k(t).selectedNode.value ? (s(), c("div", Ao, [
|
|
1537
|
+
l[1] || (l[1] = m("h3", { class: "brick-toolbar__title" }, "Properties", -1)),
|
|
1538
|
+
B(Mo)
|
|
1539
|
+
])) : $("", !0)
|
|
1483
1540
|
]));
|
|
1484
1541
|
}
|
|
1485
|
-
}),
|
|
1542
|
+
}), Fo = /* @__PURE__ */ x(Vo, [["__scopeId", "data-v-0174c069"]]), Ho = { class: "brick-actionbar" }, Jo = { class: "brick-actionbar__group" }, Uo = { class: "brick-actionbar__group" }, Wo = ["disabled"], jo = ["disabled"], Yo = ["disabled"], qo = { class: "brick-actionbar__group" }, Go = /* @__PURE__ */ _({
|
|
1486
1543
|
__name: "ActionBar",
|
|
1487
1544
|
setup(e) {
|
|
1488
|
-
const t =
|
|
1489
|
-
function
|
|
1490
|
-
const f =
|
|
1491
|
-
f && (
|
|
1545
|
+
const t = xt(), n = zt(), l = W(), a = q(), o = oe(), u = E("document"), p = E(null);
|
|
1546
|
+
function d() {
|
|
1547
|
+
const f = l.selectedId.value;
|
|
1548
|
+
f && (l.deselect(), a.removeElement(f));
|
|
1492
1549
|
}
|
|
1493
1550
|
function r() {
|
|
1494
1551
|
const f = u.value.trim() || "document", b = f.endsWith(".pdf") ? f : f + ".pdf";
|
|
1495
1552
|
n.exportPdf(b);
|
|
1496
1553
|
}
|
|
1497
|
-
function
|
|
1498
|
-
const f = o.exportDocument(), b = JSON.stringify(f, null, 2),
|
|
1499
|
-
S.href =
|
|
1554
|
+
function i() {
|
|
1555
|
+
const f = o.exportDocument(), b = JSON.stringify(f, null, 2), h = new Blob([b], { type: "application/json" }), v = URL.createObjectURL(h), S = document.createElement("a"), R = u.value.trim() || "document";
|
|
1556
|
+
S.href = v, S.download = R.endsWith(".json") ? R : R + ".json", S.click(), URL.revokeObjectURL(v);
|
|
1500
1557
|
}
|
|
1501
1558
|
function y() {
|
|
1502
1559
|
p.value?.click();
|
|
1503
1560
|
}
|
|
1504
1561
|
function g(f) {
|
|
1505
|
-
const b = f.target,
|
|
1506
|
-
if (!
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1562
|
+
const b = f.target, h = b.files?.[0];
|
|
1563
|
+
if (!h) return;
|
|
1564
|
+
const v = new FileReader();
|
|
1565
|
+
v.onload = () => {
|
|
1509
1566
|
try {
|
|
1510
|
-
const S = JSON.parse(
|
|
1567
|
+
const S = JSON.parse(v.result);
|
|
1511
1568
|
if (!S.content || !S.pageSize) {
|
|
1512
1569
|
alert("Invalid brick-pdf JSON file.");
|
|
1513
1570
|
return;
|
|
1514
1571
|
}
|
|
1515
|
-
|
|
1572
|
+
l.deselect(), o.loadDocument(S);
|
|
1516
1573
|
} catch {
|
|
1517
1574
|
alert("Failed to parse JSON file.");
|
|
1518
1575
|
}
|
|
1519
|
-
},
|
|
1576
|
+
}, v.readAsText(h), b.value = "";
|
|
1520
1577
|
}
|
|
1521
|
-
return (f, b) => (s(),
|
|
1522
|
-
m("div",
|
|
1523
|
-
|
|
1524
|
-
"onUpdate:modelValue": b[0] || (b[0] = (
|
|
1578
|
+
return (f, b) => (s(), c("div", Ho, [
|
|
1579
|
+
m("div", Jo, [
|
|
1580
|
+
K(m("input", {
|
|
1581
|
+
"onUpdate:modelValue": b[0] || (b[0] = (h) => u.value = h),
|
|
1525
1582
|
class: "brick-actionbar__name",
|
|
1526
1583
|
type: "text",
|
|
1527
1584
|
placeholder: "Document name",
|
|
1528
1585
|
title: "Document name (used for export filename)"
|
|
1529
1586
|
}, null, 512), [
|
|
1530
|
-
[
|
|
1587
|
+
[De, u.value]
|
|
1531
1588
|
])
|
|
1532
1589
|
]),
|
|
1533
|
-
m("div",
|
|
1590
|
+
m("div", Uo, [
|
|
1534
1591
|
m("button", {
|
|
1535
1592
|
class: "brick-actionbar__btn",
|
|
1536
1593
|
disabled: !k(t).canUndo.value,
|
|
1537
1594
|
title: "Undo",
|
|
1538
|
-
onClick: b[1] || (b[1] = (
|
|
1539
|
-
}, " Undo ", 8,
|
|
1595
|
+
onClick: b[1] || (b[1] = (h) => k(t).undo())
|
|
1596
|
+
}, " Undo ", 8, Wo),
|
|
1540
1597
|
m("button", {
|
|
1541
1598
|
class: "brick-actionbar__btn",
|
|
1542
1599
|
disabled: !k(t).canRedo.value,
|
|
1543
1600
|
title: "Redo",
|
|
1544
|
-
onClick: b[2] || (b[2] = (
|
|
1545
|
-
}, " Redo ", 8,
|
|
1601
|
+
onClick: b[2] || (b[2] = (h) => k(t).redo())
|
|
1602
|
+
}, " Redo ", 8, jo),
|
|
1546
1603
|
m("button", {
|
|
1547
1604
|
class: "brick-actionbar__btn brick-actionbar__btn--danger",
|
|
1548
|
-
disabled: !k(
|
|
1605
|
+
disabled: !k(l).selectedId.value,
|
|
1549
1606
|
title: "Delete selected element",
|
|
1550
|
-
onClick:
|
|
1551
|
-
}, " Delete ", 8,
|
|
1607
|
+
onClick: d
|
|
1608
|
+
}, " Delete ", 8, Yo)
|
|
1552
1609
|
]),
|
|
1553
|
-
m("div",
|
|
1610
|
+
m("div", qo, [
|
|
1554
1611
|
m("button", {
|
|
1555
1612
|
class: "brick-actionbar__btn",
|
|
1556
1613
|
title: "Import JSON",
|
|
@@ -1559,7 +1616,7 @@ const Ln = {
|
|
|
1559
1616
|
m("button", {
|
|
1560
1617
|
class: "brick-actionbar__btn",
|
|
1561
1618
|
title: "Export JSON",
|
|
1562
|
-
onClick:
|
|
1619
|
+
onClick: i
|
|
1563
1620
|
}, " Export JSON "),
|
|
1564
1621
|
m("button", {
|
|
1565
1622
|
class: "brick-actionbar__btn brick-actionbar__btn--primary",
|
|
@@ -1567,7 +1624,7 @@ const Ln = {
|
|
|
1567
1624
|
}, " Export PDF "),
|
|
1568
1625
|
m("button", {
|
|
1569
1626
|
class: "brick-actionbar__btn",
|
|
1570
|
-
onClick: b[3] || (b[3] = (
|
|
1627
|
+
onClick: b[3] || (b[3] = (h) => k(n).openPdf())
|
|
1571
1628
|
}, " Preview ")
|
|
1572
1629
|
]),
|
|
1573
1630
|
m("input", {
|
|
@@ -1580,77 +1637,77 @@ const Ln = {
|
|
|
1580
1637
|
}, null, 544)
|
|
1581
1638
|
]));
|
|
1582
1639
|
}
|
|
1583
|
-
}),
|
|
1640
|
+
}), Xo = /* @__PURE__ */ x(Go, [["__scopeId", "data-v-be915a0f"]]), Ko = { class: "brick-pdf" }, Qo = { class: "brick-pdf__workspace" }, Zo = /* @__PURE__ */ _({
|
|
1584
1641
|
__name: "BrickPdf",
|
|
1585
1642
|
props: {
|
|
1586
1643
|
modelValue: {}
|
|
1587
1644
|
},
|
|
1588
1645
|
emits: ["update:modelValue"],
|
|
1589
1646
|
setup(e, { emit: t }) {
|
|
1590
|
-
const n = e,
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1594
|
-
const o =
|
|
1595
|
-
|
|
1596
|
-
const u =
|
|
1597
|
-
|
|
1598
|
-
const p =
|
|
1599
|
-
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
const r =
|
|
1603
|
-
|
|
1604
|
-
const
|
|
1605
|
-
|
|
1606
|
-
const y =
|
|
1607
|
-
|
|
1608
|
-
const g =
|
|
1609
|
-
return
|
|
1647
|
+
const n = e, l = t;
|
|
1648
|
+
Fn();
|
|
1649
|
+
const a = ft(n.modelValue ?? ne());
|
|
1650
|
+
mt(a);
|
|
1651
|
+
const o = yt(a);
|
|
1652
|
+
gt(o);
|
|
1653
|
+
const u = kt(a);
|
|
1654
|
+
St(u);
|
|
1655
|
+
const p = ht(a, u);
|
|
1656
|
+
vt(p);
|
|
1657
|
+
const d = Ct(a, p);
|
|
1658
|
+
wt(d);
|
|
1659
|
+
const r = Rt(a);
|
|
1660
|
+
Nt(r);
|
|
1661
|
+
const i = Lt(a, p);
|
|
1662
|
+
Mt(i);
|
|
1663
|
+
const y = Bt(p);
|
|
1664
|
+
Ot(y);
|
|
1665
|
+
const g = Me(), f = g.Delete, b = g.Backspace;
|
|
1666
|
+
return ae(f, () => {
|
|
1610
1667
|
if (!o.selectedId.value) return;
|
|
1611
|
-
const
|
|
1612
|
-
if (
|
|
1613
|
-
const
|
|
1614
|
-
o.deselect(), p.removeElement(
|
|
1615
|
-
}),
|
|
1668
|
+
const h = document.activeElement;
|
|
1669
|
+
if (h && (h.tagName === "INPUT" || h.tagName === "TEXTAREA" || h.tagName === "SELECT")) return;
|
|
1670
|
+
const v = o.selectedId.value;
|
|
1671
|
+
o.deselect(), p.removeElement(v);
|
|
1672
|
+
}), ae(b, () => {
|
|
1616
1673
|
if (!o.selectedId.value) return;
|
|
1617
|
-
const
|
|
1618
|
-
if (
|
|
1619
|
-
const
|
|
1620
|
-
o.deselect(), p.removeElement(
|
|
1621
|
-
}),
|
|
1622
|
-
() =>
|
|
1674
|
+
const h = document.activeElement;
|
|
1675
|
+
if (h && (h.tagName === "INPUT" || h.tagName === "TEXTAREA" || h.tagName === "SELECT")) return;
|
|
1676
|
+
const v = o.selectedId.value;
|
|
1677
|
+
o.deselect(), p.removeElement(v);
|
|
1678
|
+
}), Le(
|
|
1679
|
+
() => a.document,
|
|
1623
1680
|
() => {
|
|
1624
|
-
|
|
1681
|
+
l("update:modelValue", JSON.parse(JSON.stringify(J(a.document))));
|
|
1625
1682
|
},
|
|
1626
1683
|
{ deep: !0 }
|
|
1627
|
-
), (
|
|
1628
|
-
B(
|
|
1629
|
-
m("div",
|
|
1630
|
-
B(
|
|
1631
|
-
B(
|
|
1684
|
+
), (h, v) => (s(), c("div", Ko, [
|
|
1685
|
+
B(Xo),
|
|
1686
|
+
m("div", Qo, [
|
|
1687
|
+
B(so),
|
|
1688
|
+
B(Fo)
|
|
1632
1689
|
])
|
|
1633
1690
|
]));
|
|
1634
1691
|
}
|
|
1635
|
-
}),
|
|
1692
|
+
}), er = /* @__PURE__ */ x(Zo, [["__scopeId", "data-v-f9b95ad8"]]), sr = {
|
|
1636
1693
|
install(e) {
|
|
1637
|
-
e.component("BrickPdf",
|
|
1694
|
+
e.component("BrickPdf", er);
|
|
1638
1695
|
}
|
|
1639
1696
|
};
|
|
1640
1697
|
export {
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1698
|
+
er as BrickPdf,
|
|
1699
|
+
ne as createDefaultDocument,
|
|
1700
|
+
sr as default,
|
|
1701
|
+
Be as getAllElementDefinitions,
|
|
1702
|
+
U as getElementDefinition,
|
|
1703
|
+
z as registerElement,
|
|
1704
|
+
rr as unregisterElement,
|
|
1705
|
+
lr as useClipboard,
|
|
1706
|
+
oe as useDocumentStore,
|
|
1707
|
+
xe as useDragDrop,
|
|
1708
|
+
q as useElementActions,
|
|
1709
|
+
xt as useHistory,
|
|
1710
|
+
zt as usePdfExport,
|
|
1711
|
+
ir as useResize,
|
|
1712
|
+
W as useSelection
|
|
1656
1713
|
};
|