brick-pdf 0.2.1 → 0.3.0

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