@snowcone-app/canvas 0.17.2 → 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.
- package/dist/{ImportManager-C_wBjWaV.js → CanvasRenderer-DUc-MOeR.js} +586 -806
- package/dist/CanvasRenderer-DUc-MOeR.js.map +1 -0
- package/dist/{CanvasStateV1-BG2hEc3-.js → CanvasStateV1-Bq48qhv5.js} +3 -3
- package/dist/{CanvasStateV1-BG2hEc3-.js.map → CanvasStateV1-Bq48qhv5.js.map} +1 -1
- package/dist/ContextualToolbars-CkLjHNPn.js +5833 -0
- package/dist/ContextualToolbars-CkLjHNPn.js.map +1 -0
- package/dist/EditorCanvasImpl-Bv4yagew.js +81 -0
- package/dist/EditorCanvasImpl-Bv4yagew.js.map +1 -0
- package/dist/EditorContext-5QpqAhjh.js +1184 -0
- package/dist/{EditorContext-CGkfmbgo.js.map → EditorContext-5QpqAhjh.js.map} +1 -1
- package/dist/{FontAnalyzer-CLv7_msL.js → FontAnalyzer-DIlqmyuf.js} +35 -35
- package/dist/FontAnalyzer-DIlqmyuf.js.map +1 -0
- package/dist/{ElementFactory-CuHSAPfg.js → ImportManager-D--7JnvW.js} +699 -476
- package/dist/ImportManager-D--7JnvW.js.map +1 -0
- package/dist/MenuButton-CeoEAtzP.js +7444 -0
- package/dist/MenuButton-CeoEAtzP.js.map +1 -0
- package/dist/SnowconeCanvas-C_O-aeaQ.js +1166 -0
- package/dist/SnowconeCanvas-C_O-aeaQ.js.map +1 -0
- package/dist/advanced.mjs +266 -264
- package/dist/advanced.mjs.map +1 -1
- package/dist/api/embed.d.ts +1 -1
- package/dist/components/ContextualToolbars.d.ts +8 -0
- package/dist/components/editor/EditorAdd.d.ts +11 -0
- package/dist/components/editor/EditorCanvasImpl.d.ts +6 -0
- package/dist/components/editor/EditorControls.d.ts +14 -0
- package/dist/components/editor/EditorHistory.d.ts +11 -0
- package/dist/components/editor/EditorLayers.d.ts +16 -0
- package/dist/components/editor/EditorMenu.d.ts +11 -0
- package/dist/components/editor/RootInternals.d.ts +7 -0
- package/dist/components/editor/index.d.ts +20 -0
- package/dist/components/embed/addElementTypes.d.ts +9 -0
- package/dist/contexts/EditorContext.d.ts +38 -0
- package/dist/core/preview-registry.d.ts +34 -0
- package/dist/{editorErrors-BY4Pdg7a.js → editorErrors-DXNfVXtD.js} +2 -2
- package/dist/{editorErrors-BY4Pdg7a.js.map → editorErrors-DXNfVXtD.js.map} +1 -1
- package/dist/embed-Cdbjay9i.js +961 -0
- package/dist/embed-Cdbjay9i.js.map +1 -0
- package/dist/embed.mjs +5 -5
- package/dist/index.mjs +7 -7
- package/dist/internals.mjs +12 -12
- package/dist/{template-fields-Z9x13sjM.js → template-fields-DgoBtajp.js} +266 -240
- package/dist/template-fields-DgoBtajp.js.map +1 -0
- package/dist/testing.mjs +3 -3
- package/dist/{usePieceGuideBundle-C1ipFnZd.js → usePieceGuideBundle-DVOISsB1.js} +2 -2
- package/dist/{usePieceGuideBundle-C1ipFnZd.js.map → usePieceGuideBundle-DVOISsB1.js.map} +1 -1
- package/dist/validation-0IscSfRb.js +9304 -0
- package/dist/validation-0IscSfRb.js.map +1 -0
- package/package.json +1 -1
- package/dist/EditorCanvasImpl-DgXvuWXX.js +0 -70
- package/dist/EditorCanvasImpl-DgXvuWXX.js.map +0 -1
- package/dist/EditorContext-CGkfmbgo.js +0 -1178
- package/dist/ElementFactory-CuHSAPfg.js.map +0 -1
- package/dist/FontAnalyzer-CLv7_msL.js.map +0 -1
- package/dist/ImportManager-C_wBjWaV.js.map +0 -1
- package/dist/SnowconeCanvas-wdckG-6O.js +0 -1179
- package/dist/SnowconeCanvas-wdckG-6O.js.map +0 -1
- package/dist/UnifiedFontService-Dsu5cwfT.js +0 -1478
- package/dist/UnifiedFontService-Dsu5cwfT.js.map +0 -1
- package/dist/embed-32ZVWfmj.js +0 -746
- package/dist/embed-32ZVWfmj.js.map +0 -1
- package/dist/iconify-D6eVIEy4.js +0 -1089
- package/dist/iconify-D6eVIEy4.js.map +0 -1
- package/dist/template-fields-Z9x13sjM.js.map +0 -1
- package/dist/validation-C795COGQ.js +0 -19959
- package/dist/validation-C795COGQ.js.map +0 -1
package/dist/advanced.mjs
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { u as
|
|
5
|
-
import {
|
|
6
|
-
import { T as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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
|
|
14
|
-
import { P as
|
|
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:
|
|
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 =
|
|
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
|
-
|
|
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__ */
|
|
47
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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:
|
|
68
|
+
inline: o = !1,
|
|
67
69
|
className: n = ""
|
|
68
|
-
}) => /* @__PURE__ */ b("div", { className: `sc:flex ${
|
|
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__ */
|
|
71
|
-
t && /* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
81
|
+
fullWidth: o = !0,
|
|
80
82
|
className: n = ""
|
|
81
83
|
}) {
|
|
82
|
-
return /* @__PURE__ */
|
|
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: ` ${
|
|
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__ */
|
|
93
|
-
/* @__PURE__ */
|
|
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:
|
|
102
|
+
const We = ({ label: e, icon: t, checked: r, onChange: o, disabled: n = !1, className: s = "" }) => {
|
|
101
103
|
const i = (m) => {
|
|
102
|
-
|
|
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__ */
|
|
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__ */
|
|
121
|
-
/* @__PURE__ */
|
|
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:
|
|
132
|
+
disabled: o = !1,
|
|
131
133
|
className: n = ""
|
|
132
134
|
}) => {
|
|
133
135
|
const s = () => {
|
|
134
|
-
|
|
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 ${
|
|
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__ */
|
|
143
|
+
/* @__PURE__ */ a(
|
|
142
144
|
"input",
|
|
143
145
|
{
|
|
144
146
|
type: "checkbox",
|
|
145
147
|
checked: e,
|
|
146
148
|
onChange: s,
|
|
147
|
-
disabled:
|
|
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__ */
|
|
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__ */
|
|
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
|
-
},
|
|
170
|
+
}, Ge = ({
|
|
169
171
|
isOpen: e,
|
|
170
172
|
onToggle: t,
|
|
171
173
|
trigger: r,
|
|
172
|
-
children:
|
|
173
|
-
}) => /* @__PURE__ */
|
|
174
|
-
|
|
174
|
+
children: o
|
|
175
|
+
}) => /* @__PURE__ */ a(
|
|
176
|
+
te,
|
|
175
177
|
{
|
|
176
178
|
isOpen: e,
|
|
177
179
|
onToggle: t,
|
|
178
|
-
trigger: r || /* @__PURE__ */ b(
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
|
|
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__ */
|
|
189
|
+
children: /* @__PURE__ */ a(q, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" })
|
|
188
190
|
}
|
|
189
191
|
) }),
|
|
190
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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
|
|
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 =
|
|
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
|
|
235
|
-
if (
|
|
236
|
-
for (const n of
|
|
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 (!
|
|
240
|
+
if (!o.valid)
|
|
239
241
|
throw new Error(
|
|
240
242
|
`[loadKitFromJSON] Kit "${e.name}" failed validation:
|
|
241
|
-
${
|
|
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
|
-
} =
|
|
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
|
|
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:
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
398
|
+
o(!0), m.current = performance.now(), l.current = requestAnimationFrame(c);
|
|
397
399
|
}, [c]), S = y(() => {
|
|
398
|
-
|
|
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
|
|
424
|
-
const { getElementById: t } =
|
|
425
|
+
function Ze(e) {
|
|
426
|
+
const { getElementById: t } = Z();
|
|
425
427
|
return e ? t(e) ?? null : null;
|
|
426
428
|
}
|
|
427
|
-
function
|
|
429
|
+
function Ve(e) {
|
|
428
430
|
const {
|
|
429
431
|
onReorder: t,
|
|
430
432
|
onGroupReorder: r,
|
|
431
|
-
onDropIntoGroup:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
487
|
-
const { selectedId: t, multiSelection: r, onSelectionChange:
|
|
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([]),
|
|
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]),
|
|
505
|
+
t !== null ? (n([t, l]), o(null)) : o(l);
|
|
504
506
|
}
|
|
505
507
|
} else
|
|
506
|
-
|
|
508
|
+
o(l), n([]);
|
|
507
509
|
},
|
|
508
|
-
[t, r,
|
|
510
|
+
[t, r, o, n]
|
|
509
511
|
);
|
|
510
512
|
return { isSelected: s, handleClick: i };
|
|
511
513
|
}
|
|
512
|
-
const Se =
|
|
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(
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
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
|
|
531
|
-
const { fontSize: t, handleFontSizeIncrement: r, handleFontSizeChange:
|
|
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(
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
/* @__PURE__ */
|
|
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(
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
546
|
+
ne.protectNextClick(), s(!n);
|
|
545
547
|
},
|
|
546
548
|
children: t
|
|
547
549
|
}
|
|
548
550
|
),
|
|
549
|
-
n && /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
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__ */
|
|
580
|
+
/* @__PURE__ */ a(I, { children: "Font Size" })
|
|
579
581
|
] }),
|
|
580
|
-
/* @__PURE__ */ b(
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
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
|
|
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
|
-
}),
|
|
604
|
+
}), G.set(e.type, { ...e });
|
|
603
605
|
}
|
|
604
606
|
function Qe(e) {
|
|
605
|
-
pe(e),
|
|
607
|
+
pe(e), G.delete(e);
|
|
606
608
|
}
|
|
607
609
|
function et() {
|
|
608
|
-
return Array.from(
|
|
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
|
|
629
|
-
return
|
|
630
|
-
|
|
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
|
|
647
|
+
const o = (s) => {
|
|
646
648
|
n(), r(s);
|
|
647
|
-
}, n = this.on(t,
|
|
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
|
|
664
|
-
if (
|
|
665
|
-
for (const n of [...
|
|
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
|
|
705
|
+
const Te = new Ce();
|
|
704
706
|
function rt() {
|
|
705
|
-
return
|
|
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
|
-
},
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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:
|
|
820
|
+
const { x: o, y: n, width: s, height: i } = e;
|
|
819
821
|
return [
|
|
820
|
-
`M ${
|
|
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,
|
|
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,
|
|
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:
|
|
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__ */
|
|
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__ */
|
|
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
|
-
},
|
|
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__ */
|
|
922
|
+
/* @__PURE__ */ a(
|
|
921
923
|
"filter",
|
|
922
924
|
{
|
|
923
|
-
id:
|
|
925
|
+
id: _,
|
|
924
926
|
x: "-20%",
|
|
925
927
|
y: "-20%",
|
|
926
928
|
width: "140%",
|
|
927
929
|
height: "140%",
|
|
928
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
961
|
+
/* @__PURE__ */ a(
|
|
960
962
|
"g",
|
|
961
963
|
{
|
|
962
964
|
clipPath: `url(#piece-clip-${d.id})`,
|
|
963
|
-
filter: `url(#${
|
|
964
|
-
children: /* @__PURE__ */
|
|
965
|
+
filter: `url(#${_})`,
|
|
966
|
+
children: /* @__PURE__ */ a(
|
|
965
967
|
"path",
|
|
966
968
|
{
|
|
967
|
-
d: `${J(
|
|
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((
|
|
983
|
-
fill: l.zoneFill[
|
|
984
|
-
stroke: l.zoneStroke[
|
|
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:
|
|
988
|
+
strokeDasharray: T.kind === "wrap" ? "4 3" : void 0,
|
|
987
989
|
vectorEffect: "non-scaling-stroke"
|
|
988
990
|
}) }, `zone-${R}`)),
|
|
989
|
-
f.zones && x.filter((
|
|
990
|
-
const
|
|
991
|
-
if (
|
|
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 =
|
|
994
|
-
return /* @__PURE__ */
|
|
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:
|
|
998
|
-
y:
|
|
999
|
-
width:
|
|
1000
|
-
height:
|
|
1001
|
-
children: /* @__PURE__ */
|
|
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((
|
|
1040
|
-
const
|
|
1041
|
-
return /* @__PURE__ */
|
|
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:
|
|
1045
|
-
y:
|
|
1046
|
-
textAnchor:
|
|
1047
|
-
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:
|
|
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
|
-
|
|
1067
|
+
se();
|
|
1066
1068
|
export {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
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
|
-
|
|
1077
|
+
gt as Canvas,
|
|
1076
1078
|
Ce as CanvasEventBus,
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1079
|
+
bt as CanvasSkeleton,
|
|
1080
|
+
Ut as ColorPickerDropdown,
|
|
1081
|
+
jt as ContextualToolbars,
|
|
1080
1082
|
Oe as ControlGroup,
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
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
|
-
|
|
1093
|
+
Ye as FontSizeGroup,
|
|
1092
1094
|
St as GlyphPanel,
|
|
1093
1095
|
ue as GroupElement,
|
|
1094
|
-
|
|
1096
|
+
Er as ImageElement,
|
|
1095
1097
|
Ct as ImagePanel,
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
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
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
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
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
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
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1126
|
+
At as ToolbarSkeleton,
|
|
1127
|
+
nr as TransformControlPanel,
|
|
1128
|
+
sr as UnderlineButton,
|
|
1129
|
+
or as UppercaseButton,
|
|
1128
1130
|
nt as VisualGuideOverlay,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1131
|
+
Ft as ZoomControls,
|
|
1132
|
+
Te as canvasEventBus,
|
|
1133
|
+
Pt as getAllSections,
|
|
1132
1134
|
et as getCustomElementTypes,
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
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
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
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
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1164
|
+
sn as pieceGuidesForArtboard,
|
|
1165
|
+
ur as preserveSelectionProps,
|
|
1166
|
+
Bt as registerBuiltinSections,
|
|
1167
|
+
Mt as registerBuiltinSectionsSync,
|
|
1166
1168
|
He as registerElementType,
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
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
|
-
|
|
1175
|
+
zt as unregisterSection,
|
|
1174
1176
|
Je as useBreakpoint,
|
|
1175
1177
|
rt as useCanvasEvents,
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
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
|
-
|
|
1188
|
+
on as usePieceGuideBundle,
|
|
1187
1189
|
je as useProjectLoader,
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
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
|