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