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