@snowcone-app/canvas 0.17.3 → 0.18.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.
Files changed (65) hide show
  1. package/dist/{ImportManager-C_wBjWaV.js → CanvasRenderer-DUc-MOeR.js} +586 -806
  2. package/dist/CanvasRenderer-DUc-MOeR.js.map +1 -0
  3. package/dist/{CanvasStateV1-BG2hEc3-.js → CanvasStateV1-Bq48qhv5.js} +3 -3
  4. package/dist/{CanvasStateV1-BG2hEc3-.js.map → CanvasStateV1-Bq48qhv5.js.map} +1 -1
  5. package/dist/ContextualToolbars-CkLjHNPn.js +5833 -0
  6. package/dist/ContextualToolbars-CkLjHNPn.js.map +1 -0
  7. package/dist/EditorCanvasImpl-Bv4yagew.js +81 -0
  8. package/dist/EditorCanvasImpl-Bv4yagew.js.map +1 -0
  9. package/dist/EditorContext-5QpqAhjh.js +1184 -0
  10. package/dist/{EditorContext-CGkfmbgo.js.map → EditorContext-5QpqAhjh.js.map} +1 -1
  11. package/dist/{FontAnalyzer-CLv7_msL.js → FontAnalyzer-DIlqmyuf.js} +35 -35
  12. package/dist/FontAnalyzer-DIlqmyuf.js.map +1 -0
  13. package/dist/{ElementFactory-CuHSAPfg.js → ImportManager-D--7JnvW.js} +699 -476
  14. package/dist/ImportManager-D--7JnvW.js.map +1 -0
  15. package/dist/MenuButton-CeoEAtzP.js +7444 -0
  16. package/dist/MenuButton-CeoEAtzP.js.map +1 -0
  17. package/dist/SnowconeCanvas-C_O-aeaQ.js +1166 -0
  18. package/dist/SnowconeCanvas-C_O-aeaQ.js.map +1 -0
  19. package/dist/advanced.mjs +266 -264
  20. package/dist/advanced.mjs.map +1 -1
  21. package/dist/api/embed.d.ts +1 -1
  22. package/dist/components/ContextualToolbars.d.ts +8 -0
  23. package/dist/components/editor/EditorAdd.d.ts +11 -0
  24. package/dist/components/editor/EditorCanvasImpl.d.ts +6 -0
  25. package/dist/components/editor/EditorControls.d.ts +14 -0
  26. package/dist/components/editor/EditorHistory.d.ts +11 -0
  27. package/dist/components/editor/EditorLayers.d.ts +16 -0
  28. package/dist/components/editor/EditorMenu.d.ts +11 -0
  29. package/dist/components/editor/RootInternals.d.ts +7 -0
  30. package/dist/components/editor/index.d.ts +20 -0
  31. package/dist/components/embed/addElementTypes.d.ts +9 -0
  32. package/dist/contexts/EditorContext.d.ts +38 -0
  33. package/dist/core/preview-registry.d.ts +34 -0
  34. package/dist/{editorErrors-BY4Pdg7a.js → editorErrors-DXNfVXtD.js} +2 -2
  35. package/dist/{editorErrors-BY4Pdg7a.js.map → editorErrors-DXNfVXtD.js.map} +1 -1
  36. package/dist/embed-Cdbjay9i.js +961 -0
  37. package/dist/embed-Cdbjay9i.js.map +1 -0
  38. package/dist/embed.mjs +5 -5
  39. package/dist/index.mjs +7 -7
  40. package/dist/internals.mjs +12 -12
  41. package/dist/{template-fields-Z9x13sjM.js → template-fields-DgoBtajp.js} +266 -240
  42. package/dist/template-fields-DgoBtajp.js.map +1 -0
  43. package/dist/testing.mjs +3 -3
  44. package/dist/{usePieceGuideBundle-C1ipFnZd.js → usePieceGuideBundle-DVOISsB1.js} +2 -2
  45. package/dist/{usePieceGuideBundle-C1ipFnZd.js.map → usePieceGuideBundle-DVOISsB1.js.map} +1 -1
  46. package/dist/validation-0IscSfRb.js +9304 -0
  47. package/dist/validation-0IscSfRb.js.map +1 -0
  48. package/package.json +1 -1
  49. package/dist/EditorCanvasImpl-DQxqdgpq.js +0 -70
  50. package/dist/EditorCanvasImpl-DQxqdgpq.js.map +0 -1
  51. package/dist/EditorContext-CGkfmbgo.js +0 -1178
  52. package/dist/ElementFactory-CuHSAPfg.js.map +0 -1
  53. package/dist/FontAnalyzer-CLv7_msL.js.map +0 -1
  54. package/dist/ImportManager-C_wBjWaV.js.map +0 -1
  55. package/dist/SnowconeCanvas-DBbmx9qW.js +0 -1187
  56. package/dist/SnowconeCanvas-DBbmx9qW.js.map +0 -1
  57. package/dist/UnifiedFontService-Dsu5cwfT.js +0 -1478
  58. package/dist/UnifiedFontService-Dsu5cwfT.js.map +0 -1
  59. package/dist/embed--B8ot6Lj.js +0 -746
  60. package/dist/embed--B8ot6Lj.js.map +0 -1
  61. package/dist/iconify-D6eVIEy4.js +0 -1089
  62. package/dist/iconify-D6eVIEy4.js.map +0 -1
  63. package/dist/template-fields-Z9x13sjM.js.map +0 -1
  64. package/dist/validation-C795COGQ.js +0 -19959
  65. package/dist/validation-C795COGQ.js.map +0 -1
package/dist/advanced.mjs CHANGED
@@ -1,23 +1,25 @@
1
- import { e as te } from "./UnifiedFontService-Dsu5cwfT.js";
2
- import { D as re, T as D, a as M, B as ne, b as I, r as se, v as ae, c as oe, d as ie, e as ce, f as le } from "./validation-C795COGQ.js";
3
- import { g as ot, h as it, i as ct, j as lt, k as dt, l as ut, m as mt, n as ft, o as ht, p as pt, q as xt, s as gt, t as bt, u as yt, F as vt, w as wt, G as St, I as Ct, x as Et, y as Tt, K as $t, z as kt, L as At, H as Ft, J as Pt, N as Nt, O as Rt, Q as Bt, S as Dt, R as Mt, U as It, V as zt, W as Ot, X as Lt, Y as Wt, Z as Kt, _ as _t, $ as Gt, a0 as Ut, a1 as jt, a2 as Jt, a3 as qt, a4 as Vt, a5 as Xt, a6 as Yt, a7 as Zt, a8 as Ht, a9 as Qt, aa as er, ab as tr, ac as rr, ad as nr, ae as sr, af as ar } from "./validation-C795COGQ.js";
4
- import { u as q } from "./EditorContext-CGkfmbgo.js";
5
- import { E as ir, P as cr, p as lr, s as dr, b as ur, c as mr, d as fr, e as hr, f as pr, a as xr } from "./EditorContext-CGkfmbgo.js";
6
- import { T as br, u as yr } from "./ThemeContext-Rjz25x9X.js";
7
- import { c as de, G as ue, F as me, g as fe, r as he, u as pe } from "./FontAnalyzer-CLv7_msL.js";
8
- import { A as wr, B as Sr, I as Cr, P as Er, R as Tr, S as $r, T as kr, h as Ar, a as Fr, b as Pr, i as Nr, d as Rr, e as Br, f as Dr, j as Mr, k as Ir, l as zr, m as Or, n as Lr, o as Wr, p as Kr, q as _r, s as Gr, t as Ur, v as jr, w as Jr, x as qr } from "./FontAnalyzer-CLv7_msL.js";
9
- import { I as xe } from "./ImportManager-C_wBjWaV.js";
10
- import { i as Xr, a as Yr, b as Zr, c as Hr, d as Qr } from "./ImportManager-C_wBjWaV.js";
11
- import { useState as A, useCallback as y, useEffect as V, useMemo as X, useRef as B, memo as ge } from "react";
1
+ import { D as te, T as M, h as D, B as re, I as q, i as I, j as ne, e as se } from "./MenuButton-CeoEAtzP.js";
2
+ import { k as at, L as it, M as ct, l as lt, S as dt, m as ut, s as mt, n as ft } from "./MenuButton-CeoEAtzP.js";
3
+ import { r as oe, v as ae } from "./validation-0IscSfRb.js";
4
+ import { a as pt, b as xt, c as gt, d as bt, D as yt, e as vt, f as wt, G as St, I as Ct, K as Tt, g as Et, L as $t, S as kt, T as At, Z as Ft, h as Pt, i as Nt, j as Rt, k as Bt, l as Mt, m as Dt, n as It, u as zt, o as Ot, p as Lt } from "./validation-0IscSfRb.js";
5
+ import { P as ie, a as ce, b as le } from "./ContextualToolbars-CkLjHNPn.js";
6
+ import { A as Kt, B as Gt, c as _t, C as Ut, d as jt, e as Jt, F as qt, f as Zt, I as Vt, g as Xt, M as Yt, h as Ht, S as Qt, T as er, i as tr, j as rr, k as nr, U as sr, l as or, u as ar, m as ir } from "./ContextualToolbars-CkLjHNPn.js";
7
+ import { u as Z } from "./EditorContext-5QpqAhjh.js";
8
+ import { E as lr, P as dr, p as ur, s as mr, b as fr, c as hr, d as pr, e as xr, f as gr, a as br } from "./EditorContext-5QpqAhjh.js";
9
+ import { T as vr, u as wr } from "./ThemeContext-Rjz25x9X.js";
10
+ import { c as de, G as ue, F as me, g as fe, r as he, u as pe } from "./FontAnalyzer-DIlqmyuf.js";
11
+ import { A as Cr, B as Tr, I as Er, P as $r, R as kr, S as Ar, T as Fr, h as Pr, a as Nr, b as Rr, i as Br, d as Mr, e as Dr, f as Ir, j as zr, k as Or, l as Lr, m as Wr, n as Kr, o as Gr, p as _r, q as Ur, s as jr, t as Jr, v as qr, w as Zr, x as Vr } from "./FontAnalyzer-DIlqmyuf.js";
12
+ import { i as Yr, a as Hr, b as Qr, c as en, d as tn } from "./CanvasRenderer-DUc-MOeR.js";
13
+ import { useState as A, useCallback as y, useEffect as V, useMemo as X, useRef as B, memo as xe } from "react";
14
+ import { I as ge } from "./ImportManager-D--7JnvW.js";
12
15
  import { e as be, c as ye } from "./compose-DtQL_oit.js";
13
- import { jsxs as b, jsx as o, Fragment as ve } from "react/jsx-runtime";
14
- import { P as tn, p as rn, u as nn } from "./usePieceGuideBundle-C1ipFnZd.js";
15
- import { Icon as Y } from "./iconify-D6eVIEy4.js";
16
+ import { jsxs as b, jsx as a, Fragment as ve } from "react/jsx-runtime";
17
+ import { P as nn, p as sn, u as on } from "./usePieceGuideBundle-DVOISsB1.js";
16
18
  const ze = ({
17
19
  title: e,
18
20
  icon: t,
19
21
  children: r,
20
- enableable: a = !1,
22
+ enableable: o = !1,
21
23
  enabled: n = !1,
22
24
  onEnabledChange: s,
23
25
  collapsible: i = !1,
@@ -25,7 +27,7 @@ const ze = ({
25
27
  onExpandChange: l,
26
28
  className: f = ""
27
29
  }) => {
28
- const w = a ? n && m : i ? m : !0, h = a && n || i, d = () => {
30
+ const w = o ? n && m : i ? m : !0, h = o && n || i, d = () => {
29
31
  s && s(!n);
30
32
  }, c = () => {
31
33
  l && l(!m);
@@ -33,7 +35,7 @@ const ze = ({
33
35
  return /* @__PURE__ */ b("div", { className: `sc:rounded-xl sc:border sc:border-border-primary sc:bg-bg-secondary sc:p-xl ${f}`, children: [
34
36
  /* @__PURE__ */ b("div", { className: "sc:flex sc:items-center sc:justify-between", children: [
35
37
  /* @__PURE__ */ b("div", { className: "sc:flex sc:items-center sc:gap-md", children: [
36
- a && /* @__PURE__ */ o("label", { className: "sc:flex sc:cursor-pointer sc:items-center", children: /* @__PURE__ */ o(
38
+ o && /* @__PURE__ */ a("label", { className: "sc:flex sc:cursor-pointer sc:items-center", children: /* @__PURE__ */ a(
37
39
  "input",
38
40
  {
39
41
  type: "checkbox",
@@ -43,11 +45,11 @@ const ze = ({
43
45
  }
44
46
  ) }),
45
47
  /* @__PURE__ */ b("div", { className: "sc:flex sc:items-center sc:gap-md", children: [
46
- t && /* @__PURE__ */ o("span", { className: "sc:flex sc:items-center sc:text-text-secondary", children: t }),
47
- /* @__PURE__ */ o("h3", { className: "sc:text-xl sc:font-semibold sc:text-text-primary", children: e })
48
+ t && /* @__PURE__ */ a("span", { className: "sc:flex sc:items-center sc:text-text-secondary", children: t }),
49
+ /* @__PURE__ */ a("h3", { className: "sc:text-xl sc:font-semibold sc:text-text-primary", children: e })
48
50
  ] })
49
51
  ] }),
50
- h && /* @__PURE__ */ o(
52
+ h && /* @__PURE__ */ a(
51
53
  "button",
52
54
  {
53
55
  onClick: c,
@@ -57,29 +59,29 @@ const ze = ({
57
59
  }
58
60
  )
59
61
  ] }),
60
- w && /* @__PURE__ */ o("div", { className: "sc:mt-xl sc:flex sc:flex-col sc:gap-xl", children: r })
62
+ w && /* @__PURE__ */ a("div", { className: "sc:mt-xl sc:flex sc:flex-col sc:gap-xl", children: r })
61
63
  ] });
62
64
  }, Oe = ({
63
65
  label: e,
64
66
  labelSuffix: t,
65
67
  children: r,
66
- inline: a = !1,
68
+ inline: o = !1,
67
69
  className: n = ""
68
- }) => /* @__PURE__ */ b("div", { className: `sc:flex ${a ? "sc:items-center sc:justify-between" : "sc:flex-col"} sc:gap-sm ${n}`, children: [
70
+ }) => /* @__PURE__ */ b("div", { className: `sc:flex ${o ? "sc:items-center sc:justify-between" : "sc:flex-col"} sc:gap-sm ${n}`, children: [
69
71
  /* @__PURE__ */ b("label", { className: "sc:flex sc:items-center sc:justify-between sc:text-base sc:font-medium sc:text-text-secondary", children: [
70
- /* @__PURE__ */ o("span", { children: e }),
71
- t && /* @__PURE__ */ o("span", { className: "sc:font-semibold sc:text-accent-primary", children: t })
72
+ /* @__PURE__ */ a("span", { children: e }),
73
+ t && /* @__PURE__ */ a("span", { className: "sc:font-semibold sc:text-accent-primary", children: t })
72
74
  ] }),
73
- /* @__PURE__ */ o("div", { className: a ? "sc:flex-shrink-0" : "", children: r })
75
+ /* @__PURE__ */ a("div", { className: o ? "sc:flex-shrink-0" : "", children: r })
74
76
  ] });
75
77
  function Le({
76
78
  options: e,
77
79
  value: t,
78
80
  onChange: r,
79
- fullWidth: a = !0,
81
+ fullWidth: o = !0,
80
82
  className: n = ""
81
83
  }) {
82
- return /* @__PURE__ */ o("div", { className: `sc:flex sc:gap-sm ${n}`, children: e.map((s) => {
84
+ return /* @__PURE__ */ a("div", { className: `sc:flex sc:gap-sm ${n}`, children: e.map((s) => {
83
85
  const i = s.value === t;
84
86
  return /* @__PURE__ */ b(
85
87
  "button",
@@ -87,26 +89,26 @@ function Le({
87
89
  onClick: () => !s.disabled && r(s.value),
88
90
  disabled: s.disabled,
89
91
  title: s.tooltip,
90
- className: ` ${a ? "sc:flex-1" : ""} sc:flex sc:items-center sc:justify-center sc:gap-xs sc:rounded-lg sc:border sc:px-md sc:py-sm sc:text-base sc:font-medium sc:transition-all sc:duration-fast ${i ? "sc:border-accent-primary sc:bg-accent-primary sc:text-text-on-accent" : "sc:border-border-primary sc:bg-bg-tertiary sc:text-text-secondary sc:hover:border-border-secondary sc:hover:bg-bg-hover sc:hover:text-text-primary"} ${s.disabled ? "sc:cursor-not-allowed sc:opacity-disabled" : "sc:cursor-pointer"} `,
92
+ className: ` ${o ? "sc:flex-1" : ""} sc:flex sc:items-center sc:justify-center sc:gap-xs sc:rounded-lg sc:border sc:px-md sc:py-sm sc:text-base sc:font-medium sc:transition-all sc:duration-fast ${i ? "sc:border-accent-primary sc:bg-accent-primary sc:text-text-on-accent" : "sc:border-border-primary sc:bg-bg-tertiary sc:text-text-secondary sc:hover:border-border-secondary sc:hover:bg-bg-hover sc:hover:text-text-primary"} ${s.disabled ? "sc:cursor-not-allowed sc:opacity-disabled" : "sc:cursor-pointer"} `,
91
93
  children: [
92
- s.icon && /* @__PURE__ */ o("span", { className: "sc:flex sc:items-center", children: s.icon }),
93
- /* @__PURE__ */ o("span", { children: s.label })
94
+ s.icon && /* @__PURE__ */ a("span", { className: "sc:flex sc:items-center", children: s.icon }),
95
+ /* @__PURE__ */ a("span", { children: s.label })
94
96
  ]
95
97
  },
96
98
  String(s.value)
97
99
  );
98
100
  }) });
99
101
  }
100
- const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, className: s = "" }) => {
102
+ const We = ({ label: e, icon: t, checked: r, onChange: o, disabled: n = !1, className: s = "" }) => {
101
103
  const i = (m) => {
102
- a(m.target.checked);
104
+ o(m.target.checked);
103
105
  };
104
106
  return /* @__PURE__ */ b(
105
107
  "label",
106
108
  {
107
109
  className: `sc:flex sc:cursor-pointer sc:items-center sc:gap-md ${n ? "sc:cursor-not-allowed sc:opacity-disabled" : ""} ${s}`,
108
110
  children: [
109
- /* @__PURE__ */ o(
111
+ /* @__PURE__ */ a(
110
112
  "input",
111
113
  {
112
114
  type: "checkbox",
@@ -117,8 +119,8 @@ const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
117
119
  }
118
120
  ),
119
121
  /* @__PURE__ */ b("span", { className: "sc:flex sc:items-center sc:gap-sm sc:text-base sc:font-medium sc:text-text-primary", children: [
120
- t && /* @__PURE__ */ o("span", { className: "sc:flex sc:items-center sc:text-text-secondary", children: t }),
121
- /* @__PURE__ */ o("span", { children: e })
122
+ t && /* @__PURE__ */ a("span", { className: "sc:flex sc:items-center sc:text-text-secondary", children: t }),
123
+ /* @__PURE__ */ a("span", { children: e })
122
124
  ] })
123
125
  ]
124
126
  }
@@ -127,28 +129,28 @@ const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
127
129
  checked: e,
128
130
  onChange: t,
129
131
  label: r,
130
- disabled: a = !1,
132
+ disabled: o = !1,
131
133
  className: n = ""
132
134
  }) => {
133
135
  const s = () => {
134
- a || t(!e);
136
+ o || t(!e);
135
137
  };
136
138
  return /* @__PURE__ */ b(
137
139
  "label",
138
140
  {
139
- className: `sc:flex sc:items-center sc:gap-md sc:cursor-pointer sc:select-none ${a ? "sc:opacity-50 sc:cursor-not-allowed" : ""} ${n}`.trim(),
141
+ className: `sc:flex sc:items-center sc:gap-md sc:cursor-pointer sc:select-none ${o ? "sc:opacity-50 sc:cursor-not-allowed" : ""} ${n}`.trim(),
140
142
  children: [
141
- /* @__PURE__ */ o(
143
+ /* @__PURE__ */ a(
142
144
  "input",
143
145
  {
144
146
  type: "checkbox",
145
147
  checked: e,
146
148
  onChange: s,
147
- disabled: a,
149
+ disabled: o,
148
150
  className: "sc:absolute sc:opacity-0 sc:w-0 sc:h-0 sc:peer"
149
151
  }
150
152
  ),
151
- /* @__PURE__ */ o(
153
+ /* @__PURE__ */ a(
152
154
  "span",
153
155
  {
154
156
  className: `
@@ -161,41 +163,41 @@ const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
161
163
  `.trim()
162
164
  }
163
165
  ),
164
- r && /* @__PURE__ */ o("span", { className: "sc:text-md sc:text-text-primary sc:font-medium", children: r })
166
+ r && /* @__PURE__ */ a("span", { className: "sc:text-md sc:text-text-primary sc:font-medium", children: r })
165
167
  ]
166
168
  }
167
169
  );
168
- }, _e = ({
170
+ }, Ge = ({
169
171
  isOpen: e,
170
172
  onToggle: t,
171
173
  trigger: r,
172
- children: a
173
- }) => /* @__PURE__ */ o(
174
- re,
174
+ children: o
175
+ }) => /* @__PURE__ */ a(
176
+ te,
175
177
  {
176
178
  isOpen: e,
177
179
  onToggle: t,
178
- trigger: r || /* @__PURE__ */ b(D, { delayDuration: 0, children: [
179
- /* @__PURE__ */ o(M, { asChild: !0, children: /* @__PURE__ */ o(
180
- ne,
180
+ trigger: r || /* @__PURE__ */ b(M, { delayDuration: 0, children: [
181
+ /* @__PURE__ */ a(D, { asChild: !0, children: /* @__PURE__ */ a(
182
+ re,
181
183
  {
182
184
  variant: "ghost",
183
185
  size: "toolbar",
184
186
  onClick: (s) => {
185
187
  s.stopPropagation(), t(!e);
186
188
  },
187
- children: /* @__PURE__ */ o(Y, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" })
189
+ children: /* @__PURE__ */ a(q, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" })
188
190
  }
189
191
  ) }),
190
- /* @__PURE__ */ o(I, { children: /* @__PURE__ */ o("p", { children: "More" }) })
192
+ /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a("p", { children: "More" }) })
191
193
  ] }),
192
194
  position: "bottom",
193
195
  align: "end",
194
196
  offset: 4,
195
- children: /* @__PURE__ */ o("div", { className: "sc:flex sc:items-center sc:gap-sm sc:bg-bg-primary sc:border sc:border-border-primary sc:rounded-xl sc:px-xl sc:py-md sc:shadow-sm sc:h-[52px]", children: a })
197
+ children: /* @__PURE__ */ a("div", { className: "sc:flex sc:items-center sc:gap-sm sc:bg-bg-primary sc:border sc:border-border-primary sc:rounded-xl sc:px-xl sc:py-md sc:shadow-sm sc:h-[52px]", children: o })
196
198
  }
197
199
  );
198
- function Ge(e) {
200
+ function _e(e) {
199
201
  const t = {
200
202
  name: e.name,
201
203
  capabilities: {
@@ -227,18 +229,18 @@ function Ue(e) {
227
229
  e.capabilities && (t.capabilities = e.capabilities), e.behavior && (t.behavior = e.behavior), e.layout && (t.layout = e.layout), e.style && (t.style = e.style), e.content && (t.content = e.content);
228
230
  let r;
229
231
  if (e.extends) {
230
- const n = se(e.extends);
232
+ const n = oe(e.extends);
231
233
  r = be(n, { name: e.name, ...t });
232
234
  } else
233
235
  r = ye({ name: e.name, ...t });
234
- const a = ae(r);
235
- if (a.warnings.length > 0)
236
- for (const n of a.warnings)
236
+ const o = ae(r);
237
+ if (o.warnings.length > 0)
238
+ for (const n of o.warnings)
237
239
  console.warn(`[loadKitFromJSON] Warning: ${n}`);
238
- if (!a.valid)
240
+ if (!o.valid)
239
241
  throw new Error(
240
242
  `[loadKitFromJSON] Kit "${e.name}" failed validation:
241
- ${a.errors.join(`
243
+ ${o.errors.join(`
242
244
  `)}`
243
245
  );
244
246
  return r;
@@ -247,13 +249,13 @@ const L = de("useProjectLoader");
247
249
  function je() {
248
250
  const {
249
251
  handleLoadWorkspace: e
250
- } = q(), [t, r] = A(!1), [a, n] = A(null), [s, i] = A(null), [m, l] = A(null), f = y(async (d) => {
252
+ } = Z(), [t, r] = A(!1), [o, n] = A(null), [s, i] = A(null), [m, l] = A(null), f = y(async (d) => {
251
253
  r(!0), n(null);
252
254
  try {
253
255
  const c = typeof d == "string" ? JSON.parse(d) : d;
254
256
  if (!c.artboards || !Array.isArray(c.artboards))
255
257
  throw new Error("Invalid document format: missing artboards array");
256
- const x = JSON.stringify(c), S = new Blob([x], { type: "application/json" }), C = new File([S], "project.json", { type: "application/json" }), g = await xe.importFromJSON(C);
258
+ const x = JSON.stringify(c), S = new Blob([x], { type: "application/json" }), C = new File([S], "project.json", { type: "application/json" }), g = await ge.importFromJSON(C);
257
259
  if (!g.success || !g.artboards || !g.elements)
258
260
  throw new Error(g.error || "Failed to import project");
259
261
  e(g.artboards, g.elements, g.activeArtboardId || null), i(c);
@@ -316,7 +318,7 @@ function je() {
316
318
  loadFromFile: w,
317
319
  loadTemplate: h,
318
320
  isLoading: t,
319
- loadError: a,
321
+ loadError: o,
320
322
  currentProject: s,
321
323
  projectMetadata: m
322
324
  };
@@ -336,11 +338,11 @@ function Je(e) {
336
338
  const t = {
337
339
  ...U,
338
340
  ...e
339
- }, [r, a] = A(() => typeof window < "u" ? window.innerWidth : U.lg);
341
+ }, [r, o] = A(() => typeof window < "u" ? window.innerWidth : U.lg);
340
342
  V(() => {
341
343
  if (typeof window > "u") return;
342
344
  const x = () => {
343
- a(window.innerWidth);
345
+ o(window.innerWidth);
344
346
  };
345
347
  return window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
346
348
  }, []);
@@ -377,7 +379,7 @@ const j = {
377
379
  avgExportTime: 0
378
380
  };
379
381
  function qe() {
380
- const [e, t] = A(j), [r, a] = A(!1), n = B([]), s = B([]), i = B([]), m = B(performance.now()), l = B(null), f = y((u) => u.length === 0 ? 0 : 1e3 / (u.reduce((k, v) => k + v, 0) / u.length), []), w = y((u) => u.length === 0 ? 0 : u.reduce((p, k) => p + k, 0) / u.length, []), h = y(() => "memory" in performance && performance.memory ? performance.memory.usedJSHeapSize / (1024 * 1024) : 0, []), d = y(() => {
382
+ const [e, t] = A(j), [r, o] = A(!1), n = B([]), s = B([]), i = B([]), m = B(performance.now()), l = B(null), f = y((u) => u.length === 0 ? 0 : 1e3 / (u.reduce((k, v) => k + v, 0) / u.length), []), w = y((u) => u.length === 0 ? 0 : u.reduce((p, k) => p + k, 0) / u.length, []), h = y(() => "memory" in performance && performance.memory ? performance.memory.usedJSHeapSize / (1024 * 1024) : 0, []), d = y(() => {
381
383
  const u = {
382
384
  fps: f(n.current),
383
385
  avgRenderTime: w(s.current),
@@ -393,9 +395,9 @@ function qe() {
393
395
  const u = performance.now(), p = u - m.current;
394
396
  m.current = u, n.current.push(p), n.current.length > 60 && n.current.shift(), n.current.length % 30 === 0 && d(), r && (l.current = requestAnimationFrame(c));
395
397
  }, [r, d]), x = y(() => {
396
- a(!0), m.current = performance.now(), l.current = requestAnimationFrame(c);
398
+ o(!0), m.current = performance.now(), l.current = requestAnimationFrame(c);
397
399
  }, [c]), S = y(() => {
398
- a(!1), l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
400
+ o(!1), l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
399
401
  }, []), C = y(() => {
400
402
  n.current = [], s.current = [], i.current = [], t(j);
401
403
  }, []), g = y(() => `
@@ -420,15 +422,15 @@ Avg Export Time: ${e.avgExportTime.toFixed(2)}ms
420
422
  isProfiling: r
421
423
  };
422
424
  }
423
- function Ve(e) {
424
- const { getElementById: t } = q();
425
+ function Ze(e) {
426
+ const { getElementById: t } = Z();
425
427
  return e ? t(e) ?? null : null;
426
428
  }
427
- function Xe(e) {
429
+ function Ve(e) {
428
430
  const {
429
431
  onReorder: t,
430
432
  onGroupReorder: r,
431
- onDropIntoGroup: a,
433
+ onDropIntoGroup: o,
432
434
  onDropIntoGroupAtPosition: n,
433
435
  findElement: s,
434
436
  findParentGroup: i
@@ -453,7 +455,7 @@ function Xe(e) {
453
455
  return;
454
456
  }
455
457
  if (h === "into")
456
- a && a(m, u);
458
+ o && o(m, u);
457
459
  else {
458
460
  const p = i == null ? void 0 : i(m), k = i == null ? void 0 : i(u), v = h === "before" ? "after" : "before";
459
461
  p && k && p.id === k.id ? r && r(m, u, v, p.id) : !p && k && n ? n(m, k.id, u, v) : t(m, u, v);
@@ -465,7 +467,7 @@ function Xe(e) {
465
467
  h,
466
468
  t,
467
469
  r,
468
- a,
470
+ o,
469
471
  n,
470
472
  i,
471
473
  S
@@ -483,8 +485,8 @@ function Xe(e) {
483
485
  }
484
486
  };
485
487
  }
486
- function Ye(e) {
487
- const { selectedId: t, multiSelection: r, onSelectionChange: a, onMultiSelectionChange: n } = e, s = y(
488
+ function Xe(e) {
489
+ const { selectedId: t, multiSelection: r, onSelectionChange: o, onMultiSelectionChange: n } = e, s = y(
488
490
  (m) => m === t || r.includes(m),
489
491
  [t, r]
490
492
  ), i = y(
@@ -494,28 +496,28 @@ function Ye(e) {
494
496
  if (r.length > 0)
495
497
  if (f) {
496
498
  const h = r.filter((d) => d !== l);
497
- h.length === 1 ? (n([]), a(h[0])) : h.length === 0 ? (n([]), a(null)) : n(h);
499
+ h.length === 1 ? (n([]), o(h[0])) : h.length === 0 ? (n([]), o(null)) : n(h);
498
500
  } else
499
501
  n([...r, l]);
500
502
  else {
501
503
  if (w)
502
504
  return;
503
- t !== null ? (n([t, l]), a(null)) : a(l);
505
+ t !== null ? (n([t, l]), o(null)) : o(l);
504
506
  }
505
507
  } else
506
- a(l), n([]);
508
+ o(l), n([]);
507
509
  },
508
- [t, r, a, n]
510
+ [t, r, o, n]
509
511
  );
510
512
  return { isSelected: s, handleClick: i };
511
513
  }
512
- const Se = ge(({ value: e, onChange: t, fontSizes: r, isOpen: a, onToggle: n }) => {
514
+ const Se = xe(({ value: e, onChange: t, fontSizes: r, isOpen: o, onToggle: n }) => {
513
515
  const s = (i) => {
514
516
  t(i), n(!1);
515
517
  };
516
- return /* @__PURE__ */ b(oe, { open: a, onOpenChange: n, children: [
517
- /* @__PURE__ */ o(ie, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "sc-toolbar-btn", "aria-label": "Font size", children: /* @__PURE__ */ o(Y, { icon: "radix-icons:font-size", className: "sc:size-5" }) }) }),
518
- /* @__PURE__ */ o(ce, { className: "sc:w-[120px] sc:max-h-[300px] sc:overflow-y-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ o("div", { className: "sc:flex sc:flex-col sc:gap-0.5", children: r.map((i) => /* @__PURE__ */ o(
518
+ return /* @__PURE__ */ b(ie, { open: o, onOpenChange: n, children: [
519
+ /* @__PURE__ */ a(ce, { asChild: !0, children: /* @__PURE__ */ a("button", { className: "sc-toolbar-btn", "aria-label": "Font size", children: /* @__PURE__ */ a(q, { icon: "radix-icons:font-size", className: "sc:size-5" }) }) }),
520
+ /* @__PURE__ */ a(le, { className: "sc:w-[120px] sc:max-h-[300px] sc:overflow-y-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ a("div", { className: "sc:flex sc:flex-col sc:gap-0.5", children: r.map((i) => /* @__PURE__ */ a(
519
521
  "button",
520
522
  {
521
523
  onClick: () => s(i),
@@ -527,26 +529,26 @@ const Se = ge(({ value: e, onChange: t, fontSizes: r, isOpen: a, onToggle: n })
527
529
  ] });
528
530
  });
529
531
  Se.displayName = "FontSizeDropdown";
530
- function Ze({ toolbar: e }) {
531
- const { fontSize: t, handleFontSizeIncrement: r, handleFontSizeChange: a } = e, [n, s] = A(!1);
532
+ function Ye({ toolbar: e }) {
533
+ const { fontSize: t, handleFontSizeIncrement: r, handleFontSizeChange: o } = e, [n, s] = A(!1);
532
534
  return /* @__PURE__ */ b("div", { className: "sc-toolbar-group", children: [
533
- /* @__PURE__ */ b(D, { delayDuration: 300, children: [
534
- /* @__PURE__ */ o(M, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "sc-toolbar-btn-sm", onClick: () => r(-1), children: "-" }) }),
535
- /* @__PURE__ */ o(I, { children: "Decrease Font Size" })
535
+ /* @__PURE__ */ b(M, { delayDuration: 300, children: [
536
+ /* @__PURE__ */ a(D, { asChild: !0, children: /* @__PURE__ */ a("button", { className: "sc-toolbar-btn-sm", onClick: () => r(-1), children: "-" }) }),
537
+ /* @__PURE__ */ a(I, { children: "Decrease Font Size" })
536
538
  ] }),
537
- /* @__PURE__ */ b(D, { delayDuration: 300, children: [
538
- /* @__PURE__ */ o(M, { asChild: !0, children: /* @__PURE__ */ b("div", { style: { position: "relative" }, children: [
539
- /* @__PURE__ */ o(
539
+ /* @__PURE__ */ b(M, { delayDuration: 300, children: [
540
+ /* @__PURE__ */ a(D, { asChild: !0, children: /* @__PURE__ */ b("div", { style: { position: "relative" }, children: [
541
+ /* @__PURE__ */ a(
540
542
  "button",
541
543
  {
542
544
  className: "sc-toolbar-font-size-display",
543
545
  onClick: () => {
544
- le.protectNextClick(), s(!n);
546
+ ne.protectNextClick(), s(!n);
545
547
  },
546
548
  children: t
547
549
  }
548
550
  ),
549
- n && /* @__PURE__ */ o(
551
+ n && /* @__PURE__ */ a(
550
552
  "div",
551
553
  {
552
554
  className: "font-dropdown",
@@ -561,12 +563,12 @@ function Ze({ toolbar: e }) {
561
563
  }, 0);
562
564
  }
563
565
  },
564
- children: me.map((i) => /* @__PURE__ */ o(
566
+ children: me.map((i) => /* @__PURE__ */ a(
565
567
  "button",
566
568
  {
567
569
  className: `font-dropdown-option ${t === i ? "selected" : ""}`,
568
570
  onClick: () => {
569
- a(i), s(!1);
571
+ o(i), s(!1);
570
572
  },
571
573
  children: i
572
574
  },
@@ -575,15 +577,15 @@ function Ze({ toolbar: e }) {
575
577
  }
576
578
  )
577
579
  ] }) }),
578
- /* @__PURE__ */ o(I, { children: "Font Size" })
580
+ /* @__PURE__ */ a(I, { children: "Font Size" })
579
581
  ] }),
580
- /* @__PURE__ */ b(D, { delayDuration: 300, children: [
581
- /* @__PURE__ */ o(M, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "sc-toolbar-btn-sm", onClick: () => r(1), children: "+" }) }),
582
- /* @__PURE__ */ o(I, { children: "Increase Font Size" })
582
+ /* @__PURE__ */ b(M, { delayDuration: 300, children: [
583
+ /* @__PURE__ */ a(D, { asChild: !0, children: /* @__PURE__ */ a("button", { className: "sc-toolbar-btn-sm", onClick: () => r(1), children: "+" }) }),
584
+ /* @__PURE__ */ a(I, { children: "Increase Font Size" })
583
585
  ] })
584
586
  ] });
585
587
  }
586
- const _ = /* @__PURE__ */ new Map();
588
+ const G = /* @__PURE__ */ new Map();
587
589
  function He(e) {
588
590
  if (!e.type || typeof e.type != "string")
589
591
  throw new Error('ElementTypeRegistration requires a non-empty "type" string');
@@ -599,13 +601,13 @@ function He(e) {
599
601
  id: e.type,
600
602
  label: e.label,
601
603
  Component: e.Component
602
- }), _.set(e.type, { ...e });
604
+ }), G.set(e.type, { ...e });
603
605
  }
604
606
  function Qe(e) {
605
- pe(e), _.delete(e);
607
+ pe(e), G.delete(e);
606
608
  }
607
609
  function et() {
608
- return Array.from(_.values());
610
+ return Array.from(G.values());
609
611
  }
610
612
  function tt(e) {
611
613
  return fe(e) !== void 0;
@@ -625,9 +627,9 @@ class Ce {
625
627
  * @returns An unsubscribe function -- call it to remove this handler
626
628
  */
627
629
  on(t, r) {
628
- let a = this.listeners.get(t);
629
- return a || (a = /* @__PURE__ */ new Set(), this.listeners.set(t, a)), a.add(r), () => {
630
- a.delete(r), a.size === 0 && this.listeners.delete(t);
630
+ let o = this.listeners.get(t);
631
+ return o || (o = /* @__PURE__ */ new Set(), this.listeners.set(t, o)), o.add(r), () => {
632
+ o.delete(r), o.size === 0 && this.listeners.delete(t);
631
633
  };
632
634
  }
633
635
  /**
@@ -642,9 +644,9 @@ class Ce {
642
644
  * @returns An unsubscribe function
643
645
  */
644
646
  once(t, r) {
645
- const a = (s) => {
647
+ const o = (s) => {
646
648
  n(), r(s);
647
- }, n = this.on(t, a);
649
+ }, n = this.on(t, o);
648
650
  return n;
649
651
  }
650
652
  // -----------------------------------------------------------------------
@@ -660,9 +662,9 @@ class Ce {
660
662
  * @param data - The payload to pass to each handler
661
663
  */
662
664
  emit(t, r) {
663
- const a = this.listeners.get(t);
664
- if (a)
665
- for (const n of [...a])
665
+ const o = this.listeners.get(t);
666
+ if (o)
667
+ for (const n of [...o])
666
668
  try {
667
669
  n(r);
668
670
  } catch (s) {
@@ -700,9 +702,9 @@ class Ce {
700
702
  return ((r = this.listeners.get(t)) == null ? void 0 : r.size) ?? 0;
701
703
  }
702
704
  }
703
- const Ee = new Ce();
705
+ const Te = new Ce();
704
706
  function rt() {
705
- return Ee;
707
+ return Te;
706
708
  }
707
709
  const W = {
708
710
  bleedFill: "#ffffff",
@@ -757,7 +759,7 @@ const W = {
757
759
  // pin via `style.labelFontSize`.
758
760
  labelFontSize: 14,
759
761
  labelFontFamily: "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif"
760
- }, Te = {
762
+ }, Ee = {
761
763
  // SVG `dominant-baseline` has no "baseline" keyword; "alphabetic" is the
762
764
  // bottom/baseline alignment (and React's typed union enforces this).
763
765
  tl: { textAnchor: "start", dominantBaseline: "hanging" },
@@ -771,7 +773,7 @@ const W = {
771
773
  br: { textAnchor: "end", dominantBaseline: "alphabetic" }
772
774
  };
773
775
  function K(e, t) {
774
- return e.kind === "rect" ? /* @__PURE__ */ o(
776
+ return e.kind === "rect" ? /* @__PURE__ */ a(
775
777
  "rect",
776
778
  {
777
779
  x: e.x,
@@ -780,7 +782,7 @@ function K(e, t) {
780
782
  height: e.height,
781
783
  ...t
782
784
  }
783
- ) : e.kind === "roundedRect" ? /* @__PURE__ */ o(
785
+ ) : e.kind === "roundedRect" ? /* @__PURE__ */ a(
784
786
  "rect",
785
787
  {
786
788
  x: e.x,
@@ -791,7 +793,7 @@ function K(e, t) {
791
793
  ry: e.ry,
792
794
  ...t
793
795
  }
794
- ) : /* @__PURE__ */ o(
796
+ ) : /* @__PURE__ */ a(
795
797
  "path",
796
798
  {
797
799
  d: e.d,
@@ -815,9 +817,9 @@ function J(e) {
815
817
  const t = e.rx ?? e.ry ?? 0, r = e.ry ?? e.rx ?? 0;
816
818
  if (t <= 0 && r <= 0)
817
819
  return `M ${e.x} ${e.y} h ${e.width} v ${e.height} h ${-e.width} Z`;
818
- const { x: a, y: n, width: s, height: i } = e;
820
+ const { x: o, y: n, width: s, height: i } = e;
819
821
  return [
820
- `M ${a + t} ${n}`,
822
+ `M ${o + t} ${n}`,
821
823
  `h ${s - 2 * t}`,
822
824
  `a ${t} ${r} 0 0 1 ${t} ${r}`,
823
825
  `v ${i - 2 * r}`,
@@ -831,7 +833,7 @@ function J(e) {
831
833
  }
832
834
  return e.d;
833
835
  }
834
- function ke(e, t, r, a) {
836
+ function ke(e, t, r, o) {
835
837
  if (e != null && e.safeArea) return e.safeArea;
836
838
  if (t.safeAreaInsetPx && t.safeAreaInsetPx > 0) {
837
839
  const n = t.safeAreaInsetPx;
@@ -840,7 +842,7 @@ function ke(e, t, r, a) {
840
842
  x: n,
841
843
  y: n,
842
844
  width: Math.max(0, r - n * 2),
843
- height: Math.max(0, a - n * 2)
845
+ height: Math.max(0, o - n * 2)
844
846
  };
845
847
  }
846
848
  return null;
@@ -849,7 +851,7 @@ function nt({
849
851
  artboardWidth: e,
850
852
  artboardHeight: t,
851
853
  canvasPadding: r = 0,
852
- pieces: a,
854
+ pieces: o,
853
855
  pieceGuides: n,
854
856
  show: s,
855
857
  style: i,
@@ -873,7 +875,7 @@ function nt({
873
875
  safeArea: (s == null ? void 0 : s.safeArea) ?? !0,
874
876
  labels: (s == null ? void 0 : s.labels) ?? !0
875
877
  }, w = e + r * 2, h = t + r * 2;
876
- return /* @__PURE__ */ o(
878
+ return /* @__PURE__ */ a(
877
879
  "svg",
878
880
  {
879
881
  xmlns: "http://www.w3.org/2000/svg",
@@ -881,7 +883,7 @@ function nt({
881
883
  preserveAspectRatio: "xMidYMid meet",
882
884
  className: m,
883
885
  style: { pointerEvents: "none", width: "100%", height: "100%" },
884
- children: /* @__PURE__ */ o("g", { transform: `translate(${r} ${r})`, children: a.map((d) => {
886
+ children: /* @__PURE__ */ a("g", { transform: `translate(${r} ${r})`, children: o.map((d) => {
885
887
  const c = n == null ? void 0 : n[d.id], x = (c == null ? void 0 : c.zones) ?? [], S = (c == null ? void 0 : c.labels) ?? [], C = d.rotation ?? 0, g = C === 90 || C === 270, u = g ? d.height : d.width, p = g ? d.width : d.height, k = $e(c, u, p), v = ke(c, d, u, p), F = `translate(${d.x} ${d.y})`;
886
888
  let N = "";
887
889
  C === 90 ? N = `translate(${d.width} 0) rotate(90)` : C === 180 ? N = `translate(${d.width} ${d.height}) rotate(180)` : C === 270 && (N = `translate(0 ${d.height}) rotate(270)`);
@@ -907,7 +909,7 @@ function nt({
907
909
  y: 0,
908
910
  width: u,
909
911
  height: p
910
- }, G = `bleed-blur-${d.id}`, Z = {
912
+ }, _ = `bleed-blur-${d.id}`, Y = {
911
913
  kind: "rect",
912
914
  x: 0,
913
915
  y: 0,
@@ -917,15 +919,15 @@ function nt({
917
919
  return /* @__PURE__ */ b("g", { transform: z, children: [
918
920
  f.safeArea && H && /* @__PURE__ */ b(ve, { children: [
919
921
  /* @__PURE__ */ b("defs", { children: [
920
- /* @__PURE__ */ o(
922
+ /* @__PURE__ */ a(
921
923
  "filter",
922
924
  {
923
- id: G,
925
+ id: _,
924
926
  x: "-20%",
925
927
  y: "-20%",
926
928
  width: "140%",
927
929
  height: "140%",
928
- children: /* @__PURE__ */ o(
930
+ children: /* @__PURE__ */ a(
929
931
  "feGaussianBlur",
930
932
  {
931
933
  in: "SourceGraphic",
@@ -946,7 +948,7 @@ function nt({
946
948
  )
947
949
  }
948
950
  ),
949
- /* @__PURE__ */ o("clipPath", { id: `piece-clip-${d.id}`, children: /* @__PURE__ */ o(
951
+ /* @__PURE__ */ a("clipPath", { id: `piece-clip-${d.id}`, children: /* @__PURE__ */ a(
950
952
  "rect",
951
953
  {
952
954
  x: 0,
@@ -956,15 +958,15 @@ function nt({
956
958
  }
957
959
  ) })
958
960
  ] }),
959
- /* @__PURE__ */ o(
961
+ /* @__PURE__ */ a(
960
962
  "g",
961
963
  {
962
964
  clipPath: `url(#piece-clip-${d.id})`,
963
- filter: `url(#${G})`,
964
- children: /* @__PURE__ */ o(
965
+ filter: `url(#${_})`,
966
+ children: /* @__PURE__ */ a(
965
967
  "path",
966
968
  {
967
- d: `${J(Z)} ${J(O)}`,
969
+ d: `${J(Y)} ${J(O)}`,
968
970
  style: {
969
971
  // Honor `style.bleedFill` / `style.bleedOpacity`
970
972
  // overrides — previously hardcoded, which silently
@@ -979,26 +981,26 @@ function nt({
979
981
  }
980
982
  )
981
983
  ] }),
982
- f.zones && x.filter((E) => E.kind !== "dieCut").map((E, R) => /* @__PURE__ */ o("g", { children: K(E.path, {
983
- fill: l.zoneFill[E.kind],
984
- stroke: l.zoneStroke[E.kind],
984
+ f.zones && x.filter((T) => T.kind !== "dieCut").map((T, R) => /* @__PURE__ */ a("g", { children: K(T.path, {
985
+ fill: l.zoneFill[T.kind],
986
+ stroke: l.zoneStroke[T.kind],
985
987
  strokeWidth: 1.5,
986
- strokeDasharray: E.kind === "wrap" ? "4 3" : void 0,
988
+ strokeDasharray: T.kind === "wrap" ? "4 3" : void 0,
987
989
  vectorEffect: "non-scaling-stroke"
988
990
  }) }, `zone-${R}`)),
989
- f.zones && x.filter((E) => E.kind === "dieCut").map((E, R) => {
990
- const T = E.path;
991
- if (T.kind !== "rect" && T.kind !== "roundedRect")
991
+ f.zones && x.filter((T) => T.kind === "dieCut").map((T, R) => {
992
+ const E = T.path;
993
+ if (E.kind !== "rect" && E.kind !== "roundedRect")
992
994
  return null;
993
- const Q = T.kind === "roundedRect" ? T.rx ?? T.ry ?? 0 : 0, ee = T.kind === "roundedRect" ? T.ry ?? T.rx ?? 0 : 0;
994
- return /* @__PURE__ */ o(
995
+ const Q = E.kind === "roundedRect" ? E.rx ?? E.ry ?? 0 : 0, ee = E.kind === "roundedRect" ? E.ry ?? E.rx ?? 0 : 0;
996
+ return /* @__PURE__ */ a(
995
997
  "foreignObject",
996
998
  {
997
- x: T.x,
998
- y: T.y,
999
- width: T.width,
1000
- height: T.height,
1001
- children: /* @__PURE__ */ o(
999
+ x: E.x,
1000
+ y: E.y,
1001
+ width: E.width,
1002
+ height: E.height,
1003
+ children: /* @__PURE__ */ a(
1002
1004
  "div",
1003
1005
  {
1004
1006
  xmlns: "http://www.w3.org/1999/xhtml",
@@ -1036,15 +1038,15 @@ function nt({
1036
1038
  strokeDasharray: l.safeAreaDashArray,
1037
1039
  vectorEffect: "non-scaling-stroke"
1038
1040
  }),
1039
- f.labels && S.map((E, R) => {
1040
- const T = Te[E.anchor ?? "c"];
1041
- return /* @__PURE__ */ o(
1041
+ f.labels && S.map((T, R) => {
1042
+ const E = Ee[T.anchor ?? "c"];
1043
+ return /* @__PURE__ */ a(
1042
1044
  "text",
1043
1045
  {
1044
- x: E.x,
1045
- y: E.y,
1046
- textAnchor: T.textAnchor,
1047
- dominantBaseline: T.dominantBaseline,
1046
+ x: T.x,
1047
+ y: T.y,
1048
+ textAnchor: E.textAnchor,
1049
+ dominantBaseline: E.dominantBaseline,
1048
1050
  fontSize: l.labelFontSize,
1049
1051
  fontFamily: l.labelFontFamily,
1050
1052
  fill: l.labelColor,
@@ -1052,7 +1054,7 @@ function nt({
1052
1054
  stroke: "#ffffff",
1053
1055
  strokeWidth: Math.max(2, l.labelFontSize * 0.25),
1054
1056
  strokeLinejoin: "round",
1055
- children: E.text
1057
+ children: T.text
1056
1058
  },
1057
1059
  `label-${R}`
1058
1060
  );
@@ -1062,134 +1064,134 @@ function nt({
1062
1064
  }
1063
1065
  );
1064
1066
  }
1065
- te();
1067
+ se();
1066
1068
  export {
1067
- wr as ArtboardElement,
1068
- ot as ArtboardPropertiesToolbar,
1069
- it as ArtboardTabs,
1070
- ct as AutoExportManager,
1071
- lt as BackgroundPickerDropdown,
1072
- Sr as BaseElement,
1073
- dt as BoldButton,
1069
+ Cr as ArtboardElement,
1070
+ Kt as ArtboardPropertiesToolbar,
1071
+ pt as ArtboardTabs,
1072
+ xt as AutoExportManager,
1073
+ Gt as BackgroundPickerDropdown,
1074
+ Tr as BaseElement,
1075
+ _t as BoldButton,
1074
1076
  Le as ButtonGroup,
1075
- ut as Canvas,
1077
+ gt as Canvas,
1076
1078
  Ce as CanvasEventBus,
1077
- mt as CanvasSkeleton,
1078
- ft as ColorPickerDropdown,
1079
- ht as ContextualToolbars,
1079
+ bt as CanvasSkeleton,
1080
+ Ut as ColorPickerDropdown,
1081
+ jt as ContextualToolbars,
1080
1082
  Oe as ControlGroup,
1081
- pt as CropPanel,
1082
- xt as DEFAULT_AUTO_EXPORT_CONFIG,
1083
- re as Dropdown,
1084
- gt as DropdownMenu,
1085
- ir as EditorProvider,
1086
- bt as EffectsPanel,
1087
- yt as ExportPanel,
1088
- vt as FontBrowserDrawer,
1089
- wt as FontColorButton,
1083
+ Jt as CropPanel,
1084
+ yt as DEFAULT_AUTO_EXPORT_CONFIG,
1085
+ te as Dropdown,
1086
+ at as DropdownMenu,
1087
+ lr as EditorProvider,
1088
+ vt as EffectsPanel,
1089
+ wt as ExportPanel,
1090
+ qt as FontBrowserDrawer,
1091
+ Zt as FontColorButton,
1090
1092
  Se as FontSizeDropdown,
1091
- Ze as FontSizeGroup,
1093
+ Ye as FontSizeGroup,
1092
1094
  St as GlyphPanel,
1093
1095
  ue as GroupElement,
1094
- Cr as ImageElement,
1096
+ Er as ImageElement,
1095
1097
  Ct as ImagePanel,
1096
- Et as ImageToolbar,
1097
- Tt as ItalicButton,
1098
- $t as KIT_PRESETS,
1099
- kt as KitProvider,
1100
- At as LayersPanel,
1101
- Ft as LayersPanelSkeleton,
1102
- Pt as MenuButton,
1103
- Nt as MenuItem,
1104
- Rt as MoreMenu,
1105
- tn as PIECE_GUIDES_API_BASE,
1106
- cr as PRESERVE_SELECTION_ATTR,
1098
+ Vt as ImageToolbar,
1099
+ Xt as ItalicButton,
1100
+ Tt as KIT_PRESETS,
1101
+ Et as KitProvider,
1102
+ it as LayersPanel,
1103
+ $t as LayersPanelSkeleton,
1104
+ ct as MenuButton,
1105
+ lt as MenuItem,
1106
+ Yt as MoreMenu,
1107
+ nn as PIECE_GUIDES_API_BASE,
1108
+ dr as PRESERVE_SELECTION_ATTR,
1107
1109
  ze as Panel,
1108
- Er as PathElement,
1109
- Bt as PathToolbar,
1110
- Tr as RichText,
1111
- _e as SecondaryToolbar,
1112
- $r as ShapeElement,
1113
- Dt as ShapeToolbar,
1114
- Mt as ShapeTypeDrawer,
1115
- It as Spinner,
1116
- zt as Surface,
1110
+ $r as PathElement,
1111
+ Ht as PathToolbar,
1112
+ kr as RichText,
1113
+ Ge as SecondaryToolbar,
1114
+ Ar as ShapeElement,
1115
+ Qt as ShapeToolbar,
1116
+ dt as ShapeTypeDrawer,
1117
+ kt as Spinner,
1118
+ ut as Surface,
1117
1119
  Ke as Switch,
1118
- Ot as TextAlignButton,
1119
- kr as TextElement,
1120
- Lt as TextMoreMenu,
1121
- Wt as TextToolbar,
1122
- br as ThemeProvider,
1120
+ er as TextAlignButton,
1121
+ Fr as TextElement,
1122
+ tr as TextMoreMenu,
1123
+ rr as TextToolbar,
1124
+ vr as ThemeProvider,
1123
1125
  We as Toggle,
1124
- Kt as ToolbarSkeleton,
1125
- _t as TransformControlPanel,
1126
- Gt as UnderlineButton,
1127
- Ut as UppercaseButton,
1126
+ At as ToolbarSkeleton,
1127
+ nr as TransformControlPanel,
1128
+ sr as UnderlineButton,
1129
+ or as UppercaseButton,
1128
1130
  nt as VisualGuideOverlay,
1129
- jt as ZoomControls,
1130
- Ee as canvasEventBus,
1131
- Jt as getAllSections,
1131
+ Ft as ZoomControls,
1132
+ Te as canvasEventBus,
1133
+ Pt as getAllSections,
1132
1134
  et as getCustomElementTypes,
1133
- qt as getSection,
1134
- Vt as getSectionIds,
1135
- Ar as hasDistressEffect,
1136
- Fr as hasMasks,
1137
- Pr as hasStroke,
1138
- Nr as isArchTransform,
1139
- Rr as isCircleElementConfig,
1140
- Br as isCircleTransform,
1141
- Dr as isCustomElementConfig,
1142
- Mr as isCustomTransform,
1143
- Ir as isFlagTransform,
1144
- Xr as isGroupElement,
1145
- zr as isGroupElementConfig,
1146
- Or as isGroupTransform,
1147
- Yr as isImageElement,
1148
- Lr as isImageElementConfig,
1149
- Wr as isImageTransform,
1150
- Kr as isKnockout,
1151
- Zr as isPathElement,
1152
- _r as isPathElementConfig,
1153
- Gr as isPathTransform,
1135
+ Nt as getSection,
1136
+ Rt as getSectionIds,
1137
+ Pr as hasDistressEffect,
1138
+ Nr as hasMasks,
1139
+ Rr as hasStroke,
1140
+ Br as isArchTransform,
1141
+ Mr as isCircleElementConfig,
1142
+ Dr as isCircleTransform,
1143
+ Ir as isCustomElementConfig,
1144
+ zr as isCustomTransform,
1145
+ Or as isFlagTransform,
1146
+ Yr as isGroupElement,
1147
+ Lr as isGroupElementConfig,
1148
+ Wr as isGroupTransform,
1149
+ Hr as isImageElement,
1150
+ Kr as isImageElementConfig,
1151
+ Gr as isImageTransform,
1152
+ _r as isKnockout,
1153
+ Qr as isPathElement,
1154
+ Ur as isPathElementConfig,
1155
+ jr as isPathTransform,
1154
1156
  tt as isRegisteredElementType,
1155
- Hr as isShapeElement,
1156
- Ur as isShapeElementConfig,
1157
- jr as isShapeTransform,
1158
- Qr as isTextElement,
1159
- Jr as isTextElementConfig,
1160
- qr as isWaveTransform,
1157
+ en as isShapeElement,
1158
+ Jr as isShapeElementConfig,
1159
+ qr as isShapeTransform,
1160
+ tn as isTextElement,
1161
+ Zr as isTextElementConfig,
1162
+ Vr as isWaveTransform,
1161
1163
  Ue as loadKitFromJSON,
1162
- rn as pieceGuidesForArtboard,
1163
- lr as preserveSelectionProps,
1164
- Xt as registerBuiltinSections,
1165
- Yt as registerBuiltinSectionsSync,
1164
+ sn as pieceGuidesForArtboard,
1165
+ ur as preserveSelectionProps,
1166
+ Bt as registerBuiltinSections,
1167
+ Mt as registerBuiltinSectionsSync,
1166
1168
  He as registerElementType,
1167
- Zt as registerSection,
1168
- Ht as renderPieceGuides,
1169
- Ge as serializeKit,
1170
- dr as shouldPreserveSelection,
1171
- Qt as surfaceVariants,
1169
+ Dt as registerSection,
1170
+ It as renderPieceGuides,
1171
+ _e as serializeKit,
1172
+ mr as shouldPreserveSelection,
1173
+ mt as surfaceVariants,
1172
1174
  Qe as unregisterElementType,
1173
- er as unregisterSection,
1175
+ zt as unregisterSection,
1174
1176
  Je as useBreakpoint,
1175
1177
  rt as useCanvasEvents,
1176
- tr as useCapabilities,
1177
- ur as useCommandContext,
1178
- Ve as useElementById,
1179
- mr as useElementsContext,
1180
- fr as useHistoryContext,
1181
- rr as useKit,
1182
- Xe as useLayerDragDrop,
1183
- nr as useLayerPreview,
1184
- Ye as useLayerSelection,
1178
+ Ot as useCapabilities,
1179
+ fr as useCommandContext,
1180
+ Ze as useElementById,
1181
+ hr as useElementsContext,
1182
+ pr as useHistoryContext,
1183
+ Lt as useKit,
1184
+ Ve as useLayerDragDrop,
1185
+ ar as useLayerPreview,
1186
+ Xe as useLayerSelection,
1185
1187
  qe as usePerformance,
1186
- nn as usePieceGuideBundle,
1188
+ on as usePieceGuideBundle,
1187
1189
  je as useProjectLoader,
1188
- hr as useSelectionContext,
1189
- sr as useSurface,
1190
- ar as useTextToolbar,
1191
- yr as useTheme,
1192
- pr as useToolStateContext,
1193
- xr as useViewportContext
1190
+ xr as useSelectionContext,
1191
+ ft as useSurface,
1192
+ ir as useTextToolbar,
1193
+ wr as useTheme,
1194
+ gr as useToolStateContext,
1195
+ br as useViewportContext
1194
1196
  };
1195
1197
  //# sourceMappingURL=advanced.mjs.map