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