@snowcone-app/canvas 0.38.0 → 0.39.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/{CanvasRenderer-D-E5WWLm.js → CanvasRenderer-COO5UXtZ.js} +704 -669
- package/dist/CanvasRenderer-COO5UXtZ.js.map +1 -0
- package/dist/{CanvasStateV1-C9LQt2J0.js → CanvasStateV1-CJJff7Ci.js} +315 -314
- package/dist/{CanvasStateV1-C9LQt2J0.js.map → CanvasStateV1-CJJff7Ci.js.map} +1 -1
- package/dist/{EditorCanvasImpl-BnxEbr2p.js → EditorCanvasImpl-C_72UKu3.js} +3 -3
- package/dist/{EditorCanvasImpl-BnxEbr2p.js.map → EditorCanvasImpl-C_72UKu3.js.map} +1 -1
- package/dist/FontAnalyzer-DWHS41ba.js.map +1 -1
- package/dist/{SnowconeCanvas-CWSPyqqj.js → SnowconeCanvas-C-YbGCcQ.js} +4 -4
- package/dist/{SnowconeCanvas-CWSPyqqj.js.map → SnowconeCanvas-C-YbGCcQ.js.map} +1 -1
- package/dist/advanced.mjs +358 -360
- package/dist/advanced.mjs.map +1 -1
- package/dist/components/VisualGuideOverlay.d.ts +4 -1
- package/dist/components/embed-realtime/usePieceGuideBundle.d.ts +2 -0
- package/dist/{embed-SOFUZlGB.js → embed-DtlgX9iG.js} +5 -5
- package/dist/{embed-SOFUZlGB.js.map → embed-DtlgX9iG.js.map} +1 -1
- package/dist/embed.mjs +3 -3
- package/dist/index.mjs +4 -4
- package/dist/internals.mjs +2 -2
- package/dist/rendering/PieceGuideRenderer.d.ts +4 -1
- package/dist/state/CanvasStateV1.d.ts +3 -3
- package/dist/{template-fields-CBLHgW7G.js → template-fields-Dltc4Ztb.js} +2 -2
- package/dist/{template-fields-CBLHgW7G.js.map → template-fields-Dltc4Ztb.js.map} +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/{usePieceGuideBundle-C7r06a_x.js → usePieceGuideBundle-Cab2gRnn.js} +19 -16
- package/dist/usePieceGuideBundle-Cab2gRnn.js.map +1 -0
- package/dist/utils/pieceRotation.d.ts +35 -0
- package/dist/{validation-BG-V98h0.js → validation-Dh9sVEb9.js} +1428 -1430
- package/dist/validation-Dh9sVEb9.js.map +1 -0
- package/example/package.json +1 -1
- package/package.json +1 -1
- package/dist/CanvasRenderer-D-E5WWLm.js.map +0 -1
- package/dist/usePieceGuideBundle-C7r06a_x.js.map +0 -1
- package/dist/validation-BG-V98h0.js.map +0 -1
package/dist/advanced.mjs
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { p as
|
|
2
|
-
import { t as
|
|
3
|
-
import { r as
|
|
4
|
-
import { d as
|
|
5
|
-
import { ImagePanel as
|
|
6
|
-
import { P as
|
|
7
|
-
import { A as
|
|
8
|
-
import { b as
|
|
9
|
-
import { E as
|
|
10
|
-
import { T as wr, u as
|
|
11
|
-
import { c as
|
|
12
|
-
import { A as
|
|
13
|
-
import { a as
|
|
14
|
-
import { useState as A, useCallback as y, useEffect as
|
|
15
|
-
import { I as
|
|
16
|
-
import { e as
|
|
17
|
-
import { jsxs as
|
|
18
|
-
import {
|
|
19
|
-
|
|
1
|
+
import { p as Q, T as M, q as D, B as ee, I as j, r as I, s as te, e as re } from "./useCommands-x8J7_Mzy.js";
|
|
2
|
+
import { t as it, L as ct, M as lt, v as dt, S as ut, w as mt, x as ft, u as ht } from "./useCommands-x8J7_Mzy.js";
|
|
3
|
+
import { r as ne, v as se } from "./validation-Dh9sVEb9.js";
|
|
4
|
+
import { d as xt, e as gt, f as bt, h as yt, D as vt, b as St, c as wt, G as Ct, i as Tt, K as Et, L as kt, S as $t, T as At, Z as Ft, j as Pt, g as Nt, k as Bt, l as Rt, a as Mt, m as Dt, n as It, u as zt, o as Ot, p as Lt } from "./validation-Dh9sVEb9.js";
|
|
5
|
+
import { ImagePanel as Kt } from "./ImagePanel-BaX0UE-L.js";
|
|
6
|
+
import { P as ae, b as oe, c as ie } from "./ContextualToolbars-C62As-xY.js";
|
|
7
|
+
import { A as _t, B as Ut, d as jt, e as qt, C as Jt, a as Zt, F as Vt, f as Xt, I as Yt, g as Ht, M as Qt, h as er, S as tr, T as rr, i as nr, j as sr, k as ar, U as or, l as ir, u as cr, m as lr } from "./ContextualToolbars-C62As-xY.js";
|
|
8
|
+
import { b as q } from "./design-builder-CoCtjIwj.js";
|
|
9
|
+
import { E as ur, P as mr, p as fr, j as hr, a as pr, u as xr, k as gr, c as br, m as yr, d as vr } from "./design-builder-CoCtjIwj.js";
|
|
10
|
+
import { T as wr, u as Cr } from "./ThemeContext-Rjz25x9X.js";
|
|
11
|
+
import { c as ce, G as le, ap as de, q as ue, aq as me, ar as fe } from "./FontAnalyzer-DWHS41ba.js";
|
|
12
|
+
import { A as Er, as as kr, I as $r, P as Ar, at as Fr, S as Pr, T as Nr, au as Br, av as Rr, aw as Mr, ax as Dr, ay as Ir, az as zr, aA as Or, aB as Lr, aC as Wr, aD as Kr, aE as Gr, aF as _r, aG as Ur, aH as jr, aI as qr, aJ as Jr, aK as Zr, aL as Vr, aM as Xr, aN as Yr } from "./FontAnalyzer-DWHS41ba.js";
|
|
13
|
+
import { a as Qr, i as en, b as tn, c as rn, d as nn } from "./guards-DMmhw_Ow.js";
|
|
14
|
+
import { useState as A, useCallback as y, useEffect as J, useMemo as Z, useRef as R, memo as he } from "react";
|
|
15
|
+
import { I as pe } from "./ExportManager-BbBfO22S.js";
|
|
16
|
+
import { e as xe, c as ge } from "./compose-DtQL_oit.js";
|
|
17
|
+
import { jsxs as g, jsx as o, Fragment as be } from "react/jsx-runtime";
|
|
18
|
+
import { n as ye, p as ve } from "./CanvasRenderer-COO5UXtZ.js";
|
|
19
|
+
import { P as an, p as on, u as cn } from "./usePieceGuideBundle-Cab2gRnn.js";
|
|
20
|
+
const Oe = ({
|
|
20
21
|
title: e,
|
|
21
22
|
icon: t,
|
|
22
23
|
children: r,
|
|
@@ -24,58 +25,58 @@ const ze = ({
|
|
|
24
25
|
enabled: n = !1,
|
|
25
26
|
onEnabledChange: s,
|
|
26
27
|
collapsible: i = !1,
|
|
27
|
-
expanded:
|
|
28
|
+
expanded: d = !0,
|
|
28
29
|
onExpandChange: l,
|
|
29
|
-
className:
|
|
30
|
+
className: h = ""
|
|
30
31
|
}) => {
|
|
31
|
-
const w = a ? n &&
|
|
32
|
+
const w = a ? n && d : i ? d : !0, p = a && n || i, u = () => {
|
|
32
33
|
s && s(!n);
|
|
33
34
|
}, c = () => {
|
|
34
|
-
l && l(!
|
|
35
|
+
l && l(!d);
|
|
35
36
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ g("div", { className: `sc:rounded-xl sc:border sc:border-border-primary sc:bg-bg-secondary sc:p-xl ${h}`, children: [
|
|
38
|
+
/* @__PURE__ */ g("div", { className: "sc:flex sc:items-center sc:justify-between", children: [
|
|
39
|
+
/* @__PURE__ */ g("div", { className: "sc:flex sc:items-center sc:gap-md", children: [
|
|
39
40
|
a && /* @__PURE__ */ o("label", { className: "sc:flex sc:cursor-pointer sc:items-center", children: /* @__PURE__ */ o(
|
|
40
41
|
"input",
|
|
41
42
|
{
|
|
42
43
|
type: "checkbox",
|
|
43
44
|
checked: n,
|
|
44
|
-
onChange:
|
|
45
|
+
onChange: u,
|
|
45
46
|
className: "sc:h-4 sc:w-4 sc:cursor-pointer sc:rounded sc:border-border-primary sc:bg-bg-input sc:accent-accent-primary"
|
|
46
47
|
}
|
|
47
48
|
) }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ g("div", { className: "sc:flex sc:items-center sc:gap-md", children: [
|
|
49
50
|
t && /* @__PURE__ */ o("span", { className: "sc:flex sc:items-center sc:text-text-secondary", children: t }),
|
|
50
51
|
/* @__PURE__ */ o("h3", { className: "sc:text-xl sc:font-semibold sc:text-text-primary", children: e })
|
|
51
52
|
] })
|
|
52
53
|
] }),
|
|
53
|
-
|
|
54
|
+
p && /* @__PURE__ */ o(
|
|
54
55
|
"button",
|
|
55
56
|
{
|
|
56
57
|
onClick: c,
|
|
57
58
|
className: "sc:rounded-lg sc:border-none sc:bg-transparent sc:px-md sc:py-xs sc:text-base sc:text-text-muted sc:transition-colors sc:duration-fast sc:hover:text-text-primary",
|
|
58
|
-
title:
|
|
59
|
-
children:
|
|
59
|
+
title: d ? "Collapse" : "Expand",
|
|
60
|
+
children: d ? "▼" : "▶"
|
|
60
61
|
}
|
|
61
62
|
)
|
|
62
63
|
] }),
|
|
63
64
|
w && /* @__PURE__ */ o("div", { className: "sc:mt-xl sc:flex sc:flex-col sc:gap-xl", children: r })
|
|
64
65
|
] });
|
|
65
|
-
},
|
|
66
|
+
}, Le = ({
|
|
66
67
|
label: e,
|
|
67
68
|
labelSuffix: t,
|
|
68
69
|
children: r,
|
|
69
70
|
inline: a = !1,
|
|
70
71
|
className: n = ""
|
|
71
|
-
}) => /* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
}) => /* @__PURE__ */ g("div", { className: `sc:flex ${a ? "sc:items-center sc:justify-between" : "sc:flex-col"} sc:gap-sm ${n}`, children: [
|
|
73
|
+
/* @__PURE__ */ g("label", { className: "sc:flex sc:items-center sc:justify-between sc:text-base sc:font-medium sc:text-text-secondary", children: [
|
|
73
74
|
/* @__PURE__ */ o("span", { children: e }),
|
|
74
75
|
t && /* @__PURE__ */ o("span", { className: "sc:font-semibold sc:text-accent-primary", children: t })
|
|
75
76
|
] }),
|
|
76
77
|
/* @__PURE__ */ o("div", { className: a ? "sc:flex-shrink-0" : "", children: r })
|
|
77
78
|
] });
|
|
78
|
-
function
|
|
79
|
+
function We({
|
|
79
80
|
options: e,
|
|
80
81
|
value: t,
|
|
81
82
|
onChange: r,
|
|
@@ -84,7 +85,7 @@ function Le({
|
|
|
84
85
|
}) {
|
|
85
86
|
return /* @__PURE__ */ o("div", { className: `sc:flex sc:gap-sm ${n}`, children: e.map((s) => {
|
|
86
87
|
const i = s.value === t;
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ g(
|
|
88
89
|
"button",
|
|
89
90
|
{
|
|
90
91
|
onClick: () => !s.disabled && r(s.value),
|
|
@@ -100,11 +101,11 @@ function Le({
|
|
|
100
101
|
);
|
|
101
102
|
}) });
|
|
102
103
|
}
|
|
103
|
-
const
|
|
104
|
-
const i = (
|
|
105
|
-
a(
|
|
104
|
+
const Ke = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, className: s = "" }) => {
|
|
105
|
+
const i = (d) => {
|
|
106
|
+
a(d.target.checked);
|
|
106
107
|
};
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ g(
|
|
108
109
|
"label",
|
|
109
110
|
{
|
|
110
111
|
className: `sc:flex sc:cursor-pointer sc:items-center sc:gap-md ${n ? "sc:cursor-not-allowed sc:opacity-disabled" : ""} ${s}`,
|
|
@@ -119,14 +120,14 @@ const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
|
|
|
119
120
|
className: "sc:h-4 sc:w-4 sc:cursor-pointer sc:rounded sc:border-border-primary sc:bg-bg-input sc:accent-accent-primary sc:disabled:cursor-not-allowed"
|
|
120
121
|
}
|
|
121
122
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ g("span", { className: "sc:flex sc:items-center sc:gap-sm sc:text-base sc:font-medium sc:text-text-primary", children: [
|
|
123
124
|
t && /* @__PURE__ */ o("span", { className: "sc:flex sc:items-center sc:text-text-secondary", children: t }),
|
|
124
125
|
/* @__PURE__ */ o("span", { children: e })
|
|
125
126
|
] })
|
|
126
127
|
]
|
|
127
128
|
}
|
|
128
129
|
);
|
|
129
|
-
},
|
|
130
|
+
}, Ge = ({
|
|
130
131
|
checked: e,
|
|
131
132
|
onChange: t,
|
|
132
133
|
label: r,
|
|
@@ -136,7 +137,7 @@ const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
|
|
|
136
137
|
const s = () => {
|
|
137
138
|
a || t(!e);
|
|
138
139
|
};
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ g(
|
|
140
141
|
"label",
|
|
141
142
|
{
|
|
142
143
|
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(),
|
|
@@ -168,26 +169,26 @@ const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
|
|
|
168
169
|
]
|
|
169
170
|
}
|
|
170
171
|
);
|
|
171
|
-
},
|
|
172
|
+
}, _e = ({
|
|
172
173
|
isOpen: e,
|
|
173
174
|
onToggle: t,
|
|
174
175
|
trigger: r,
|
|
175
176
|
children: a
|
|
176
177
|
}) => /* @__PURE__ */ o(
|
|
177
|
-
|
|
178
|
+
Q,
|
|
178
179
|
{
|
|
179
180
|
isOpen: e,
|
|
180
181
|
onToggle: t,
|
|
181
|
-
trigger: r || /* @__PURE__ */
|
|
182
|
+
trigger: r || /* @__PURE__ */ g(M, { delayDuration: 0, children: [
|
|
182
183
|
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */ o(
|
|
183
|
-
|
|
184
|
+
ee,
|
|
184
185
|
{
|
|
185
186
|
variant: "ghost",
|
|
186
187
|
size: "toolbar",
|
|
187
188
|
onClick: (s) => {
|
|
188
189
|
s.stopPropagation(), t(!e);
|
|
189
190
|
},
|
|
190
|
-
children: /* @__PURE__ */ o(
|
|
191
|
+
children: /* @__PURE__ */ o(j, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" })
|
|
191
192
|
}
|
|
192
193
|
) }),
|
|
193
194
|
/* @__PURE__ */ o(I, { children: /* @__PURE__ */ o("p", { children: "More" }) })
|
|
@@ -198,7 +199,7 @@ const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
|
|
|
198
199
|
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 })
|
|
199
200
|
}
|
|
200
201
|
);
|
|
201
|
-
function
|
|
202
|
+
function Ue(e) {
|
|
202
203
|
const t = {
|
|
203
204
|
name: e.name,
|
|
204
205
|
capabilities: {
|
|
@@ -223,18 +224,18 @@ function _e(e) {
|
|
|
223
224
|
};
|
|
224
225
|
return e.content && (t.content = { ...e.content }), t;
|
|
225
226
|
}
|
|
226
|
-
function
|
|
227
|
+
function je(e) {
|
|
227
228
|
if (!e.name || e.name.trim() === "")
|
|
228
229
|
throw new Error("[loadKitFromJSON] Kit name is required");
|
|
229
230
|
const t = {};
|
|
230
231
|
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);
|
|
231
232
|
let r;
|
|
232
233
|
if (e.extends) {
|
|
233
|
-
const n =
|
|
234
|
-
r =
|
|
234
|
+
const n = ne(e.extends);
|
|
235
|
+
r = xe(n, { name: e.name, ...t });
|
|
235
236
|
} else
|
|
236
|
-
r =
|
|
237
|
-
const a =
|
|
237
|
+
r = ge({ name: e.name, ...t });
|
|
238
|
+
const a = se(r);
|
|
238
239
|
if (a.warnings.length > 0)
|
|
239
240
|
for (const n of a.warnings)
|
|
240
241
|
console.warn(`[loadKitFromJSON] Warning: ${n}`);
|
|
@@ -246,46 +247,46 @@ ${a.errors.join(`
|
|
|
246
247
|
);
|
|
247
248
|
return r;
|
|
248
249
|
}
|
|
249
|
-
const
|
|
250
|
-
function
|
|
250
|
+
const z = ce("useProjectLoader");
|
|
251
|
+
function qe() {
|
|
251
252
|
const {
|
|
252
253
|
handleLoadWorkspace: e
|
|
253
|
-
} =
|
|
254
|
+
} = q(), [t, r] = A(!1), [a, n] = A(null), [s, i] = A(null), [d, l] = A(null), h = y(async (u) => {
|
|
254
255
|
r(!0), n(null);
|
|
255
256
|
try {
|
|
256
|
-
const c = typeof
|
|
257
|
+
const c = typeof u == "string" ? JSON.parse(u) : u;
|
|
257
258
|
if (!c.artboards || !Array.isArray(c.artboards))
|
|
258
259
|
throw new Error("Invalid document format: missing artboards array");
|
|
259
|
-
const x = JSON.stringify(c),
|
|
260
|
-
if (!
|
|
261
|
-
throw new Error(
|
|
262
|
-
e(
|
|
263
|
-
const
|
|
264
|
-
var
|
|
265
|
-
return
|
|
260
|
+
const x = JSON.stringify(c), C = new Blob([x], { type: "application/json" }), b = new File([C], "project.json", { type: "application/json" }), f = await pe.importFromJSON(b);
|
|
261
|
+
if (!f.success || !f.artboards || !f.elements)
|
|
262
|
+
throw new Error(f.error || "Failed to import project");
|
|
263
|
+
e(f.artboards, f.elements, f.activeArtboardId || null), i(c);
|
|
264
|
+
const m = c.artboards.reduce((v, k) => {
|
|
265
|
+
var S;
|
|
266
|
+
return v + (((S = k.elements) == null ? void 0 : S.length) || 0);
|
|
266
267
|
}, 0);
|
|
267
268
|
l({
|
|
268
269
|
version: c.metadata.version,
|
|
269
270
|
timestamp: c.metadata.timestamp,
|
|
270
271
|
artboardCount: c.artboards.length,
|
|
271
|
-
elementCount:
|
|
272
|
+
elementCount: m
|
|
272
273
|
});
|
|
273
274
|
} catch (c) {
|
|
274
|
-
throw
|
|
275
|
+
throw z.error("[useProjectLoader] Failed to load project:", c), n(c), c;
|
|
275
276
|
} finally {
|
|
276
277
|
r(!1);
|
|
277
278
|
}
|
|
278
|
-
}, [e]), w = y(async (
|
|
279
|
+
}, [e]), w = y(async (u) => {
|
|
279
280
|
r(!0), n(null);
|
|
280
281
|
try {
|
|
281
|
-
const c = await
|
|
282
|
-
await
|
|
282
|
+
const c = await u.text();
|
|
283
|
+
await h(c);
|
|
283
284
|
} catch (c) {
|
|
284
|
-
throw
|
|
285
|
+
throw z.error("[useProjectLoader] Failed to load file:", c), n(c), c;
|
|
285
286
|
} finally {
|
|
286
287
|
r(!1);
|
|
287
288
|
}
|
|
288
|
-
}, [
|
|
289
|
+
}, [h]), p = y(async (u) => {
|
|
289
290
|
r(!0), n(null);
|
|
290
291
|
try {
|
|
291
292
|
const c = {
|
|
@@ -294,8 +295,8 @@ function je() {
|
|
|
294
295
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
295
296
|
appVersion: "1.0.0"
|
|
296
297
|
},
|
|
297
|
-
artboards:
|
|
298
|
-
id: `artboard-${Date.now()}-${
|
|
298
|
+
artboards: u.artboards.map((x, C) => ({
|
|
299
|
+
id: `artboard-${Date.now()}-${C}`,
|
|
299
300
|
name: x.name,
|
|
300
301
|
x: 0,
|
|
301
302
|
y: 0,
|
|
@@ -307,24 +308,24 @@ function je() {
|
|
|
307
308
|
activeArtboardId: null
|
|
308
309
|
// First artboard will be active by default
|
|
309
310
|
};
|
|
310
|
-
await
|
|
311
|
+
await h(c);
|
|
311
312
|
} catch (c) {
|
|
312
|
-
throw
|
|
313
|
+
throw z.error("[useProjectLoader] Failed to load template:", c), n(c), c;
|
|
313
314
|
} finally {
|
|
314
315
|
r(!1);
|
|
315
316
|
}
|
|
316
|
-
}, [
|
|
317
|
+
}, [h]);
|
|
317
318
|
return {
|
|
318
|
-
loadFromJSON:
|
|
319
|
+
loadFromJSON: h,
|
|
319
320
|
loadFromFile: w,
|
|
320
|
-
loadTemplate:
|
|
321
|
+
loadTemplate: p,
|
|
321
322
|
isLoading: t,
|
|
322
323
|
loadError: a,
|
|
323
324
|
currentProject: s,
|
|
324
|
-
projectMetadata:
|
|
325
|
+
projectMetadata: d
|
|
325
326
|
};
|
|
326
327
|
}
|
|
327
|
-
const
|
|
328
|
+
const G = {
|
|
328
329
|
xs: 320,
|
|
329
330
|
sm: 480,
|
|
330
331
|
md: 768,
|
|
@@ -332,45 +333,45 @@ const U = {
|
|
|
332
333
|
xl: 1280,
|
|
333
334
|
xxl: 1536
|
|
334
335
|
};
|
|
335
|
-
function
|
|
336
|
+
function Se(e, t) {
|
|
336
337
|
return e >= t.xxl ? "xxl" : e >= t.xl ? "xl" : e >= t.lg ? "lg" : e >= t.md ? "md" : e >= t.sm ? "sm" : "xs";
|
|
337
338
|
}
|
|
338
|
-
function
|
|
339
|
+
function Je(e) {
|
|
339
340
|
const t = {
|
|
340
|
-
...
|
|
341
|
+
...G,
|
|
341
342
|
...e
|
|
342
|
-
}, [r, a] = A(() => typeof window < "u" ? window.innerWidth :
|
|
343
|
-
|
|
343
|
+
}, [r, a] = A(() => typeof window < "u" ? window.innerWidth : G.lg);
|
|
344
|
+
J(() => {
|
|
344
345
|
if (typeof window > "u") return;
|
|
345
346
|
const x = () => {
|
|
346
347
|
a(window.innerWidth);
|
|
347
348
|
};
|
|
348
349
|
return window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
|
|
349
350
|
}, []);
|
|
350
|
-
const n =
|
|
351
|
-
() =>
|
|
351
|
+
const n = Z(
|
|
352
|
+
() => Se(r, t),
|
|
352
353
|
[r, t]
|
|
353
|
-
), s = n === "xs", i = n === "sm",
|
|
354
|
+
), s = n === "xs", i = n === "sm", d = n === "md", l = n === "lg", h = n === "xl", w = n === "xxl", p = ["xs", "sm", "md", "lg", "xl", "xxl"];
|
|
354
355
|
return {
|
|
355
356
|
breakpoint: n,
|
|
356
357
|
width: r,
|
|
357
358
|
isXs: s,
|
|
358
359
|
isSm: i,
|
|
359
|
-
isMd:
|
|
360
|
+
isMd: d,
|
|
360
361
|
isLg: l,
|
|
361
|
-
isXl:
|
|
362
|
+
isXl: h,
|
|
362
363
|
isXxl: w,
|
|
363
364
|
isAtLeast: (x) => {
|
|
364
|
-
const
|
|
365
|
-
return
|
|
365
|
+
const C = p.indexOf(n), b = p.indexOf(x);
|
|
366
|
+
return C >= b;
|
|
366
367
|
},
|
|
367
368
|
isAtMost: (x) => {
|
|
368
|
-
const
|
|
369
|
-
return
|
|
369
|
+
const C = p.indexOf(n), b = p.indexOf(x);
|
|
370
|
+
return C <= b;
|
|
370
371
|
}
|
|
371
372
|
};
|
|
372
373
|
}
|
|
373
|
-
const
|
|
374
|
+
const _ = {
|
|
374
375
|
fps: 0,
|
|
375
376
|
avgRenderTime: 0,
|
|
376
377
|
peakRenderTime: 0,
|
|
@@ -379,29 +380,29 @@ const j = {
|
|
|
379
380
|
exportCount: 0,
|
|
380
381
|
avgExportTime: 0
|
|
381
382
|
};
|
|
382
|
-
function
|
|
383
|
-
const [e, t] = A(
|
|
384
|
-
const
|
|
385
|
-
fps:
|
|
383
|
+
function Ze() {
|
|
384
|
+
const [e, t] = A(_), [r, a] = A(!1), n = R([]), s = R([]), i = R([]), d = R(performance.now()), l = R(null), h = y((m) => m.length === 0 ? 0 : 1e3 / (m.reduce((k, S) => k + S, 0) / m.length), []), w = y((m) => m.length === 0 ? 0 : m.reduce((v, k) => v + k, 0) / m.length, []), p = y(() => "memory" in performance && performance.memory ? performance.memory.usedJSHeapSize / (1024 * 1024) : 0, []), u = y(() => {
|
|
385
|
+
const m = {
|
|
386
|
+
fps: h(n.current),
|
|
386
387
|
avgRenderTime: w(s.current),
|
|
387
388
|
peakRenderTime: Math.max(...s.current, 0),
|
|
388
|
-
memoryUsage:
|
|
389
|
+
memoryUsage: p(),
|
|
389
390
|
elementCount: 0,
|
|
390
391
|
// Would need to be updated by editor context
|
|
391
392
|
exportCount: i.current.length,
|
|
392
393
|
avgExportTime: w(i.current)
|
|
393
394
|
};
|
|
394
|
-
t(
|
|
395
|
-
}, [
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
}, [r,
|
|
399
|
-
a(!0),
|
|
400
|
-
}, [c]),
|
|
395
|
+
t(m);
|
|
396
|
+
}, [h, w, p]), c = y(() => {
|
|
397
|
+
const m = performance.now(), v = m - d.current;
|
|
398
|
+
d.current = m, n.current.push(v), n.current.length > 60 && n.current.shift(), n.current.length % 30 === 0 && u(), r && (l.current = requestAnimationFrame(c));
|
|
399
|
+
}, [r, u]), x = y(() => {
|
|
400
|
+
a(!0), d.current = performance.now(), l.current = requestAnimationFrame(c);
|
|
401
|
+
}, [c]), C = y(() => {
|
|
401
402
|
a(!1), l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
402
|
-
}, []),
|
|
403
|
-
n.current = [], s.current = [], i.current = [], t(
|
|
404
|
-
}, []),
|
|
403
|
+
}, []), b = y(() => {
|
|
404
|
+
n.current = [], s.current = [], i.current = [], t(_);
|
|
405
|
+
}, []), f = y(() => `
|
|
405
406
|
Performance Report
|
|
406
407
|
==================
|
|
407
408
|
FPS: ${e.fps.toFixed(1)}
|
|
@@ -412,22 +413,22 @@ Element Count: ${e.elementCount}
|
|
|
412
413
|
Export Count: ${e.exportCount}
|
|
413
414
|
Avg Export Time: ${e.avgExportTime.toFixed(2)}ms
|
|
414
415
|
`.trim(), [e]);
|
|
415
|
-
return
|
|
416
|
+
return J(() => () => {
|
|
416
417
|
l.current !== null && cancelAnimationFrame(l.current);
|
|
417
418
|
}, []), {
|
|
418
419
|
metrics: e,
|
|
419
420
|
startProfiling: x,
|
|
420
|
-
stopProfiling:
|
|
421
|
-
clearMetrics:
|
|
422
|
-
getReport:
|
|
421
|
+
stopProfiling: C,
|
|
422
|
+
clearMetrics: b,
|
|
423
|
+
getReport: f,
|
|
423
424
|
isProfiling: r
|
|
424
425
|
};
|
|
425
426
|
}
|
|
426
|
-
function
|
|
427
|
-
const { getElementById: t } =
|
|
427
|
+
function Ve(e) {
|
|
428
|
+
const { getElementById: t } = q();
|
|
428
429
|
return e ? t(e) ?? null : null;
|
|
429
430
|
}
|
|
430
|
-
function
|
|
431
|
+
function Xe(e) {
|
|
431
432
|
const {
|
|
432
433
|
onReorder: t,
|
|
433
434
|
onGroupReorder: r,
|
|
@@ -435,69 +436,69 @@ function Ve(e) {
|
|
|
435
436
|
onDropIntoGroupAtPosition: n,
|
|
436
437
|
findElement: s,
|
|
437
438
|
findParentGroup: i
|
|
438
|
-
} = e, [
|
|
439
|
-
|
|
440
|
-
l(
|
|
439
|
+
} = e, [d, l] = A(null), [h, w] = A(null), [p, u] = A(null), c = y((f, m) => {
|
|
440
|
+
f.dataTransfer.effectAllowed = "move", requestAnimationFrame(() => {
|
|
441
|
+
l(m);
|
|
441
442
|
});
|
|
442
443
|
}, []), x = y(
|
|
443
|
-
(
|
|
444
|
-
|
|
445
|
-
const
|
|
444
|
+
(f, m) => {
|
|
445
|
+
f.preventDefault(), f.dataTransfer.dropEffect = "move";
|
|
446
|
+
const v = f.currentTarget.getBoundingClientRect(), S = f.clientY - v.top, P = v.height, F = (s == null ? void 0 : s(m)) instanceof le;
|
|
446
447
|
let $;
|
|
447
|
-
|
|
448
|
+
F ? S < P * 0.25 ? $ = "before" : S > P * 0.75 ? $ = "after" : $ = "into" : S < P * 0.4 ? $ = "before" : S > P * 0.6 ? $ = "after" : $ = S < P / 2 ? "before" : "after", w(m), u($);
|
|
448
449
|
},
|
|
449
450
|
[s]
|
|
450
|
-
),
|
|
451
|
-
l(null), w(null),
|
|
452
|
-
}, []),
|
|
453
|
-
(
|
|
454
|
-
if (
|
|
455
|
-
|
|
451
|
+
), C = y(() => {
|
|
452
|
+
l(null), w(null), u(null);
|
|
453
|
+
}, []), b = y(
|
|
454
|
+
(f, m) => {
|
|
455
|
+
if (f.preventDefault(), !d || d === m || !p) {
|
|
456
|
+
C();
|
|
456
457
|
return;
|
|
457
458
|
}
|
|
458
|
-
if (
|
|
459
|
-
a && a(
|
|
459
|
+
if (p === "into")
|
|
460
|
+
a && a(d, m);
|
|
460
461
|
else {
|
|
461
|
-
const
|
|
462
|
-
|
|
462
|
+
const v = i == null ? void 0 : i(d), k = i == null ? void 0 : i(m), S = p === "before" ? "after" : "before";
|
|
463
|
+
v && k && v.id === k.id ? r && r(d, m, S, v.id) : !v && k && n ? n(d, k.id, m, S) : t(d, m, S);
|
|
463
464
|
}
|
|
464
|
-
|
|
465
|
+
C();
|
|
465
466
|
},
|
|
466
467
|
[
|
|
467
|
-
|
|
468
|
-
|
|
468
|
+
d,
|
|
469
|
+
p,
|
|
469
470
|
t,
|
|
470
471
|
r,
|
|
471
472
|
a,
|
|
472
473
|
n,
|
|
473
474
|
i,
|
|
474
|
-
|
|
475
|
+
C
|
|
475
476
|
]
|
|
476
477
|
);
|
|
477
478
|
return {
|
|
478
|
-
draggedId:
|
|
479
|
-
dragOverId:
|
|
480
|
-
dropPosition:
|
|
479
|
+
draggedId: d,
|
|
480
|
+
dragOverId: h,
|
|
481
|
+
dropPosition: p,
|
|
481
482
|
handlers: {
|
|
482
483
|
onDragStart: c,
|
|
483
484
|
onDragOver: x,
|
|
484
|
-
onDrop:
|
|
485
|
-
onDragEnd:
|
|
485
|
+
onDrop: b,
|
|
486
|
+
onDragEnd: C
|
|
486
487
|
}
|
|
487
488
|
};
|
|
488
489
|
}
|
|
489
|
-
function
|
|
490
|
+
function Ye(e) {
|
|
490
491
|
const { selectedId: t, multiSelection: r, onSelectionChange: a, onMultiSelectionChange: n } = e, s = y(
|
|
491
|
-
(
|
|
492
|
+
(d) => d === t || r.includes(d),
|
|
492
493
|
[t, r]
|
|
493
494
|
), i = y(
|
|
494
|
-
(
|
|
495
|
-
if (
|
|
496
|
-
const
|
|
495
|
+
(d, l) => {
|
|
496
|
+
if (d.shiftKey) {
|
|
497
|
+
const h = r.includes(l), w = t === l;
|
|
497
498
|
if (r.length > 0)
|
|
498
|
-
if (
|
|
499
|
-
const
|
|
500
|
-
|
|
499
|
+
if (h) {
|
|
500
|
+
const p = r.filter((u) => u !== l);
|
|
501
|
+
p.length === 1 ? (n([]), a(p[0])) : p.length === 0 ? (n([]), a(null)) : n(p);
|
|
501
502
|
} else
|
|
502
503
|
n([...r, l]);
|
|
503
504
|
else {
|
|
@@ -512,13 +513,13 @@ function Xe(e) {
|
|
|
512
513
|
);
|
|
513
514
|
return { isSelected: s, handleClick: i };
|
|
514
515
|
}
|
|
515
|
-
const
|
|
516
|
+
const we = he(({ value: e, onChange: t, fontSizes: r, isOpen: a, onToggle: n }) => {
|
|
516
517
|
const s = (i) => {
|
|
517
518
|
t(i), n(!1);
|
|
518
519
|
};
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */ o(
|
|
521
|
-
/* @__PURE__ */ o(
|
|
520
|
+
return /* @__PURE__ */ g(ae, { open: a, onOpenChange: n, children: [
|
|
521
|
+
/* @__PURE__ */ o(oe, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "sc-toolbar-btn", "aria-label": "Font size", children: /* @__PURE__ */ o(j, { icon: "radix-icons:font-size", className: "sc:size-5" }) }) }),
|
|
522
|
+
/* @__PURE__ */ o(ie, { 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(
|
|
522
523
|
"button",
|
|
523
524
|
{
|
|
524
525
|
onClick: () => s(i),
|
|
@@ -529,22 +530,22 @@ const Se = xe(({ value: e, onChange: t, fontSizes: r, isOpen: a, onToggle: n })
|
|
|
529
530
|
)) }) })
|
|
530
531
|
] });
|
|
531
532
|
});
|
|
532
|
-
|
|
533
|
-
function
|
|
533
|
+
we.displayName = "FontSizeDropdown";
|
|
534
|
+
function He({ toolbar: e }) {
|
|
534
535
|
const { fontSize: t, handleFontSizeIncrement: r, handleFontSizeChange: a } = e, [n, s] = A(!1);
|
|
535
|
-
return /* @__PURE__ */
|
|
536
|
-
/* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ g("div", { className: "sc-toolbar-group", children: [
|
|
537
|
+
/* @__PURE__ */ g(M, { delayDuration: 300, children: [
|
|
537
538
|
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "sc-toolbar-btn-sm", onClick: () => r(-1), children: "-" }) }),
|
|
538
539
|
/* @__PURE__ */ o(I, { children: "Decrease Font Size" })
|
|
539
540
|
] }),
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ g(M, { delayDuration: 300, children: [
|
|
542
|
+
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
|
|
542
543
|
/* @__PURE__ */ o(
|
|
543
544
|
"button",
|
|
544
545
|
{
|
|
545
546
|
className: "sc-toolbar-font-size-display",
|
|
546
547
|
onClick: () => {
|
|
547
|
-
|
|
548
|
+
te.protectNextClick(), s(!n);
|
|
548
549
|
},
|
|
549
550
|
children: t
|
|
550
551
|
}
|
|
@@ -555,16 +556,16 @@ function Ye({ toolbar: e }) {
|
|
|
555
556
|
className: "font-dropdown",
|
|
556
557
|
ref: (i) => {
|
|
557
558
|
if (i) {
|
|
558
|
-
const
|
|
559
|
-
const
|
|
560
|
-
!i.contains(
|
|
559
|
+
const d = (l) => {
|
|
560
|
+
const h = l.target;
|
|
561
|
+
!i.contains(h) && !h.closest(".sc-toolbar-font-size-display") && s(!1);
|
|
561
562
|
};
|
|
562
563
|
setTimeout(() => {
|
|
563
|
-
document.addEventListener("mousedown",
|
|
564
|
+
document.addEventListener("mousedown", d);
|
|
564
565
|
}, 0);
|
|
565
566
|
}
|
|
566
567
|
},
|
|
567
|
-
children:
|
|
568
|
+
children: de.map((i) => /* @__PURE__ */ o(
|
|
568
569
|
"button",
|
|
569
570
|
{
|
|
570
571
|
className: `font-dropdown-option ${t === i ? "selected" : ""}`,
|
|
@@ -580,14 +581,14 @@ function Ye({ toolbar: e }) {
|
|
|
580
581
|
] }) }),
|
|
581
582
|
/* @__PURE__ */ o(I, { children: "Font Size" })
|
|
582
583
|
] }),
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ g(M, { delayDuration: 300, children: [
|
|
584
585
|
/* @__PURE__ */ o(D, { asChild: !0, children: /* @__PURE__ */ o("button", { className: "sc-toolbar-btn-sm", onClick: () => r(1), children: "+" }) }),
|
|
585
586
|
/* @__PURE__ */ o(I, { children: "Increase Font Size" })
|
|
586
587
|
] })
|
|
587
588
|
] });
|
|
588
589
|
}
|
|
589
|
-
const
|
|
590
|
-
function
|
|
590
|
+
const W = /* @__PURE__ */ new Map();
|
|
591
|
+
function Qe(e) {
|
|
591
592
|
if (!e.type || typeof e.type != "string")
|
|
592
593
|
throw new Error('ElementTypeRegistration requires a non-empty "type" string');
|
|
593
594
|
if (typeof e.Component != "function")
|
|
@@ -598,20 +599,20 @@ function He(e) {
|
|
|
598
599
|
throw new Error(
|
|
599
600
|
`ElementTypeRegistration for "${e.type}" requires a non-empty "label" string`
|
|
600
601
|
);
|
|
601
|
-
|
|
602
|
+
me(e.type, {
|
|
602
603
|
id: e.type,
|
|
603
604
|
label: e.label,
|
|
604
605
|
Component: e.Component
|
|
605
|
-
}),
|
|
606
|
+
}), W.set(e.type, { ...e });
|
|
606
607
|
}
|
|
607
|
-
function
|
|
608
|
-
|
|
608
|
+
function et(e) {
|
|
609
|
+
fe(e), W.delete(e);
|
|
609
610
|
}
|
|
610
|
-
function
|
|
611
|
-
return Array.from(
|
|
611
|
+
function tt() {
|
|
612
|
+
return Array.from(W.values());
|
|
612
613
|
}
|
|
613
|
-
function
|
|
614
|
-
return
|
|
614
|
+
function rt(e) {
|
|
615
|
+
return ue(e) !== void 0;
|
|
615
616
|
}
|
|
616
617
|
class Ce {
|
|
617
618
|
constructor() {
|
|
@@ -704,10 +705,10 @@ class Ce {
|
|
|
704
705
|
}
|
|
705
706
|
}
|
|
706
707
|
const Te = new Ce();
|
|
707
|
-
function
|
|
708
|
+
function nt() {
|
|
708
709
|
return Te;
|
|
709
710
|
}
|
|
710
|
-
const
|
|
711
|
+
const O = {
|
|
711
712
|
bleedFill: "#ffffff",
|
|
712
713
|
bleedOpacity: 0.5,
|
|
713
714
|
// Subtle boundary — the wash already draws the eye to the safe area,
|
|
@@ -773,7 +774,7 @@ const W = {
|
|
|
773
774
|
bc: { textAnchor: "middle", dominantBaseline: "alphabetic" },
|
|
774
775
|
br: { textAnchor: "end", dominantBaseline: "alphabetic" }
|
|
775
776
|
};
|
|
776
|
-
function
|
|
777
|
+
function L(e, t) {
|
|
777
778
|
return e.kind === "rect" ? /* @__PURE__ */ o(
|
|
778
779
|
"rect",
|
|
779
780
|
{
|
|
@@ -802,7 +803,7 @@ function K(e, t) {
|
|
|
802
803
|
}
|
|
803
804
|
);
|
|
804
805
|
}
|
|
805
|
-
function
|
|
806
|
+
function ke(e, t, r) {
|
|
806
807
|
return (e == null ? void 0 : e.boundary) ?? {
|
|
807
808
|
kind: "rect",
|
|
808
809
|
x: 0,
|
|
@@ -811,7 +812,7 @@ function $e(e, t, r) {
|
|
|
811
812
|
height: r
|
|
812
813
|
};
|
|
813
814
|
}
|
|
814
|
-
function
|
|
815
|
+
function U(e) {
|
|
815
816
|
if (e.kind === "rect")
|
|
816
817
|
return `M ${e.x} ${e.y} h ${e.width} v ${e.height} h ${-e.width} Z`;
|
|
817
818
|
if (e.kind === "roundedRect") {
|
|
@@ -834,7 +835,7 @@ function q(e) {
|
|
|
834
835
|
}
|
|
835
836
|
return e.d;
|
|
836
837
|
}
|
|
837
|
-
function
|
|
838
|
+
function $e(e, t, r, a) {
|
|
838
839
|
if (e != null && e.safeArea) return e.safeArea;
|
|
839
840
|
if (t.safeAreaInsetPx && t.safeAreaInsetPx > 0) {
|
|
840
841
|
const n = t.safeAreaInsetPx;
|
|
@@ -848,7 +849,7 @@ function ke(e, t, r, a) {
|
|
|
848
849
|
}
|
|
849
850
|
return null;
|
|
850
851
|
}
|
|
851
|
-
function
|
|
852
|
+
function st({
|
|
852
853
|
artboardWidth: e,
|
|
853
854
|
artboardHeight: t,
|
|
854
855
|
canvasPadding: r = 0,
|
|
@@ -856,74 +857,71 @@ function nt({
|
|
|
856
857
|
pieceGuides: n,
|
|
857
858
|
show: s,
|
|
858
859
|
style: i,
|
|
859
|
-
className:
|
|
860
|
+
className: d
|
|
860
861
|
}) {
|
|
861
|
-
const l =
|
|
862
|
-
const
|
|
862
|
+
const l = Z(() => {
|
|
863
|
+
const u = Math.max(
|
|
863
864
|
16,
|
|
864
865
|
Math.round(Math.min(e, t) * 0.03)
|
|
865
866
|
), c = {
|
|
866
|
-
...
|
|
867
|
+
...O,
|
|
867
868
|
...i ?? {},
|
|
868
|
-
zoneFill: { ...
|
|
869
|
-
zoneStroke: { ...
|
|
869
|
+
zoneFill: { ...O.zoneFill, ...(i == null ? void 0 : i.zoneFill) ?? {} },
|
|
870
|
+
zoneStroke: { ...O.zoneStroke, ...(i == null ? void 0 : i.zoneStroke) ?? {} }
|
|
870
871
|
};
|
|
871
|
-
return (i == null ? void 0 : i.labelFontSize) === void 0 && (c.labelFontSize =
|
|
872
|
-
}, [i, e, t]),
|
|
872
|
+
return (i == null ? void 0 : i.labelFontSize) === void 0 && (c.labelFontSize = u), c;
|
|
873
|
+
}, [i, e, t]), h = {
|
|
873
874
|
bleed: (s == null ? void 0 : s.bleed) ?? !0,
|
|
874
875
|
zones: (s == null ? void 0 : s.zones) ?? !0,
|
|
875
876
|
boundary: (s == null ? void 0 : s.boundary) ?? !0,
|
|
876
877
|
safeArea: (s == null ? void 0 : s.safeArea) ?? !0,
|
|
877
878
|
labels: (s == null ? void 0 : s.labels) ?? !0
|
|
878
|
-
}, w = e + r * 2,
|
|
879
|
+
}, w = e + r * 2, p = t + r * 2;
|
|
879
880
|
return /* @__PURE__ */ o(
|
|
880
881
|
"svg",
|
|
881
882
|
{
|
|
882
883
|
xmlns: "http://www.w3.org/2000/svg",
|
|
883
|
-
viewBox: `0 0 ${w} ${
|
|
884
|
+
viewBox: `0 0 ${w} ${p}`,
|
|
884
885
|
preserveAspectRatio: "xMidYMid meet",
|
|
885
|
-
className:
|
|
886
|
+
className: d,
|
|
886
887
|
style: { pointerEvents: "none", width: "100%", height: "100%" },
|
|
887
|
-
children: /* @__PURE__ */ o("g", { transform: `translate(${r} ${r})`, children: a.map((
|
|
888
|
-
const c = n == null ? void 0 : n[
|
|
889
|
-
let N = "";
|
|
890
|
-
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)`);
|
|
891
|
-
const z = N ? `${F} ${N}` : F, $ = l.safeAreaWashCornerRadius < 0 ? Math.round(Math.min(u, p) * 0.02) : l.safeAreaWashCornerRadius, P = c != null && c.boundary && (c.boundary.kind === "rect" || c.boundary.kind === "roundedRect") ? c.boundary : null, O = P ? P.kind === "rect" && $ > 0 ? {
|
|
888
|
+
children: /* @__PURE__ */ o("g", { transform: `translate(${r} ${r})`, children: a.map((u) => {
|
|
889
|
+
const c = n == null ? void 0 : n[u.id], x = (c == null ? void 0 : c.zones) ?? [], C = (c == null ? void 0 : c.labels) ?? [], { width: b, height: f } = ye(u), m = ke(c, b, f), v = $e(c, u, b, f), k = `translate(${u.x} ${u.y})`, S = ve(u), P = S ? `${k} ${S}` : k, N = l.safeAreaWashCornerRadius < 0 ? Math.round(Math.min(b, f) * 0.02) : l.safeAreaWashCornerRadius, F = c != null && c.boundary && (c.boundary.kind === "rect" || c.boundary.kind === "roundedRect") ? c.boundary : null, $ = F ? F.kind === "rect" && N > 0 ? {
|
|
892
890
|
kind: "roundedRect",
|
|
893
|
-
x:
|
|
894
|
-
y:
|
|
895
|
-
width:
|
|
896
|
-
height:
|
|
897
|
-
rx:
|
|
898
|
-
ry:
|
|
899
|
-
} :
|
|
891
|
+
x: F.x,
|
|
892
|
+
y: F.y,
|
|
893
|
+
width: F.width,
|
|
894
|
+
height: F.height,
|
|
895
|
+
rx: N,
|
|
896
|
+
ry: N
|
|
897
|
+
} : F : N > 0 ? {
|
|
900
898
|
kind: "roundedRect",
|
|
901
899
|
x: 0,
|
|
902
900
|
y: 0,
|
|
903
|
-
width:
|
|
904
|
-
height:
|
|
905
|
-
rx:
|
|
906
|
-
ry:
|
|
901
|
+
width: b,
|
|
902
|
+
height: f,
|
|
903
|
+
rx: N,
|
|
904
|
+
ry: N
|
|
907
905
|
} : {
|
|
908
906
|
kind: "rect",
|
|
909
907
|
x: 0,
|
|
910
908
|
y: 0,
|
|
911
|
-
width:
|
|
912
|
-
height:
|
|
913
|
-
},
|
|
909
|
+
width: b,
|
|
910
|
+
height: f
|
|
911
|
+
}, K = `bleed-blur-${u.id}`, V = {
|
|
914
912
|
kind: "rect",
|
|
915
913
|
x: 0,
|
|
916
914
|
y: 0,
|
|
917
|
-
width:
|
|
918
|
-
height:
|
|
919
|
-
},
|
|
920
|
-
return /* @__PURE__ */
|
|
921
|
-
|
|
922
|
-
/* @__PURE__ */
|
|
915
|
+
width: b,
|
|
916
|
+
height: f
|
|
917
|
+
}, X = $.kind === "rect" || $.kind === "roundedRect";
|
|
918
|
+
return /* @__PURE__ */ g("g", { transform: P, children: [
|
|
919
|
+
h.safeArea && X && /* @__PURE__ */ g(be, { children: [
|
|
920
|
+
/* @__PURE__ */ g("defs", { children: [
|
|
923
921
|
/* @__PURE__ */ o(
|
|
924
922
|
"filter",
|
|
925
923
|
{
|
|
926
|
-
id:
|
|
924
|
+
id: K,
|
|
927
925
|
x: "-20%",
|
|
928
926
|
y: "-20%",
|
|
929
927
|
width: "140%",
|
|
@@ -942,32 +940,32 @@ function nt({
|
|
|
942
940
|
// other piece-local geometry.
|
|
943
941
|
Math.max(
|
|
944
942
|
12,
|
|
945
|
-
Math.round(Math.min(
|
|
943
|
+
Math.round(Math.min(b, f) * 0.025)
|
|
946
944
|
)
|
|
947
945
|
)
|
|
948
946
|
}
|
|
949
947
|
)
|
|
950
948
|
}
|
|
951
949
|
),
|
|
952
|
-
/* @__PURE__ */ o("clipPath", { id: `piece-clip-${
|
|
950
|
+
/* @__PURE__ */ o("clipPath", { id: `piece-clip-${u.id}`, children: /* @__PURE__ */ o(
|
|
953
951
|
"rect",
|
|
954
952
|
{
|
|
955
953
|
x: 0,
|
|
956
954
|
y: 0,
|
|
957
|
-
width:
|
|
958
|
-
height:
|
|
955
|
+
width: b,
|
|
956
|
+
height: f
|
|
959
957
|
}
|
|
960
958
|
) })
|
|
961
959
|
] }),
|
|
962
960
|
/* @__PURE__ */ o(
|
|
963
961
|
"g",
|
|
964
962
|
{
|
|
965
|
-
clipPath: `url(#piece-clip-${
|
|
966
|
-
filter: `url(#${
|
|
963
|
+
clipPath: `url(#piece-clip-${u.id})`,
|
|
964
|
+
filter: `url(#${K})`,
|
|
967
965
|
children: /* @__PURE__ */ o(
|
|
968
966
|
"path",
|
|
969
967
|
{
|
|
970
|
-
d: `${
|
|
968
|
+
d: `${U(V)} ${U($)}`,
|
|
971
969
|
style: {
|
|
972
970
|
// Honor `style.bleedFill` / `style.bleedOpacity`
|
|
973
971
|
// overrides — previously hardcoded, which silently
|
|
@@ -982,18 +980,18 @@ function nt({
|
|
|
982
980
|
}
|
|
983
981
|
)
|
|
984
982
|
] }),
|
|
985
|
-
|
|
983
|
+
h.zones && x.filter((T) => T.kind !== "dieCut").map((T, B) => /* @__PURE__ */ o("g", { children: L(T.path, {
|
|
986
984
|
fill: l.zoneFill[T.kind],
|
|
987
985
|
stroke: l.zoneStroke[T.kind],
|
|
988
986
|
strokeWidth: 1.5,
|
|
989
987
|
strokeDasharray: T.kind === "wrap" ? "4 3" : void 0,
|
|
990
988
|
vectorEffect: "non-scaling-stroke"
|
|
991
989
|
}) }, `zone-${B}`)),
|
|
992
|
-
|
|
990
|
+
h.zones && x.filter((T) => T.kind === "dieCut").map((T, B) => {
|
|
993
991
|
const E = T.path;
|
|
994
992
|
if (E.kind !== "rect" && E.kind !== "roundedRect")
|
|
995
993
|
return null;
|
|
996
|
-
const
|
|
994
|
+
const Y = E.kind === "roundedRect" ? E.rx ?? E.ry ?? 0 : 0, H = E.kind === "roundedRect" ? E.ry ?? E.rx ?? 0 : 0;
|
|
997
995
|
return /* @__PURE__ */ o(
|
|
998
996
|
"foreignObject",
|
|
999
997
|
{
|
|
@@ -1008,7 +1006,7 @@ function nt({
|
|
|
1008
1006
|
style: {
|
|
1009
1007
|
width: "100%",
|
|
1010
1008
|
height: "100%",
|
|
1011
|
-
borderRadius: `${
|
|
1009
|
+
borderRadius: `${Y}px / ${H}px`,
|
|
1012
1010
|
backdropFilter: "blur(4px)",
|
|
1013
1011
|
WebkitBackdropFilter: "blur(4px)",
|
|
1014
1012
|
// Match the canvas's own "outside-artboard"
|
|
@@ -1026,20 +1024,20 @@ function nt({
|
|
|
1026
1024
|
`diecut-${B}`
|
|
1027
1025
|
);
|
|
1028
1026
|
}),
|
|
1029
|
-
|
|
1027
|
+
h.boundary && l.boundaryStroke && L(m, {
|
|
1030
1028
|
fill: "none",
|
|
1031
1029
|
stroke: l.boundaryStroke,
|
|
1032
1030
|
strokeWidth: l.boundaryStrokeWidth,
|
|
1033
1031
|
vectorEffect: "non-scaling-stroke"
|
|
1034
1032
|
}),
|
|
1035
|
-
|
|
1033
|
+
h.safeArea && v && l.safeAreaStroke && L(v, {
|
|
1036
1034
|
fill: "none",
|
|
1037
1035
|
stroke: l.safeAreaStroke,
|
|
1038
1036
|
strokeWidth: l.safeAreaStrokeWidth,
|
|
1039
1037
|
strokeDasharray: l.safeAreaDashArray,
|
|
1040
1038
|
vectorEffect: "non-scaling-stroke"
|
|
1041
1039
|
}),
|
|
1042
|
-
|
|
1040
|
+
h.labels && C.map((T, B) => {
|
|
1043
1041
|
const E = Ee[T.anchor ?? "c"];
|
|
1044
1042
|
return /* @__PURE__ */ o(
|
|
1045
1043
|
"text",
|
|
@@ -1060,139 +1058,139 @@ function nt({
|
|
|
1060
1058
|
`label-${B}`
|
|
1061
1059
|
);
|
|
1062
1060
|
})
|
|
1063
|
-
] },
|
|
1061
|
+
] }, u.id);
|
|
1064
1062
|
}) })
|
|
1065
1063
|
}
|
|
1066
1064
|
);
|
|
1067
1065
|
}
|
|
1068
|
-
|
|
1066
|
+
re();
|
|
1069
1067
|
export {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1068
|
+
Er as ArtboardElement,
|
|
1069
|
+
_t as ArtboardPropertiesToolbar,
|
|
1070
|
+
xt as ArtboardTabs,
|
|
1071
|
+
gt as AutoExportManager,
|
|
1072
|
+
Ut as BackgroundPickerDropdown,
|
|
1073
|
+
kr as BaseElement,
|
|
1074
|
+
jt as BoldButton,
|
|
1075
|
+
We as ButtonGroup,
|
|
1076
|
+
bt as Canvas,
|
|
1079
1077
|
Ce as CanvasEventBus,
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1078
|
+
yt as CanvasSkeleton,
|
|
1079
|
+
qt as ColorPickerDropdown,
|
|
1080
|
+
Jt as ContextualToolbars,
|
|
1081
|
+
Le as ControlGroup,
|
|
1082
|
+
Zt as CropPanel,
|
|
1083
|
+
vt as DEFAULT_AUTO_EXPORT_CONFIG,
|
|
1084
|
+
Q as Dropdown,
|
|
1085
|
+
it as DropdownMenu,
|
|
1086
|
+
ur as EditorProvider,
|
|
1087
|
+
St as EffectsPanel,
|
|
1090
1088
|
wt as ExportPanel,
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1089
|
+
Vt as FontBrowserDrawer,
|
|
1090
|
+
Xt as FontColorButton,
|
|
1091
|
+
we as FontSizeDropdown,
|
|
1092
|
+
He as FontSizeGroup,
|
|
1093
|
+
Ct as GlyphPanel,
|
|
1094
|
+
le as GroupElement,
|
|
1097
1095
|
$r as ImageElement,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1096
|
+
Kt as ImagePanel,
|
|
1097
|
+
Yt as ImageToolbar,
|
|
1098
|
+
Ht as ItalicButton,
|
|
1099
|
+
Tt as KIT_PRESETS,
|
|
1100
|
+
Et as KitProvider,
|
|
1101
|
+
ct as LayersPanel,
|
|
1102
|
+
kt as LayersPanelSkeleton,
|
|
1103
|
+
lt as MenuButton,
|
|
1104
|
+
dt as MenuItem,
|
|
1105
|
+
Qt as MoreMenu,
|
|
1106
|
+
an as PIECE_GUIDES_API_BASE,
|
|
1107
|
+
mr as PRESERVE_SELECTION_ATTR,
|
|
1108
|
+
Oe as Panel,
|
|
1109
|
+
Ar as PathElement,
|
|
1110
|
+
er as PathToolbar,
|
|
1111
|
+
Fr as RichText,
|
|
1112
|
+
_e as SecondaryToolbar,
|
|
1113
|
+
Pr as ShapeElement,
|
|
1114
|
+
tr as ShapeToolbar,
|
|
1115
|
+
ut as ShapeTypeDrawer,
|
|
1118
1116
|
$t as Spinner,
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1117
|
+
mt as Surface,
|
|
1118
|
+
Ge as Switch,
|
|
1119
|
+
rr as TextAlignButton,
|
|
1120
|
+
Nr as TextElement,
|
|
1121
|
+
nr as TextMoreMenu,
|
|
1122
|
+
sr as TextToolbar,
|
|
1125
1123
|
wr as ThemeProvider,
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1124
|
+
Ke as Toggle,
|
|
1125
|
+
At as ToolbarSkeleton,
|
|
1126
|
+
ar as TransformControlPanel,
|
|
1127
|
+
or as UnderlineButton,
|
|
1128
|
+
ir as UppercaseButton,
|
|
1129
|
+
st as VisualGuideOverlay,
|
|
1130
|
+
Ft as ZoomControls,
|
|
1133
1131
|
Te as canvasEventBus,
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1132
|
+
Pt as getAllSections,
|
|
1133
|
+
tt as getCustomElementTypes,
|
|
1134
|
+
Nt as getSection,
|
|
1135
|
+
Bt as getSectionIds,
|
|
1136
|
+
Br as hasDistressEffect,
|
|
1137
|
+
Rr as hasMasks,
|
|
1138
|
+
Mr as hasStroke,
|
|
1139
|
+
Dr as isArchTransform,
|
|
1140
|
+
Ir as isCircleElementConfig,
|
|
1141
|
+
zr as isCircleTransform,
|
|
1142
|
+
Or as isCustomElementConfig,
|
|
1143
|
+
Lr as isCustomTransform,
|
|
1144
|
+
Wr as isFlagTransform,
|
|
1145
|
+
Qr as isGroupElement,
|
|
1146
|
+
Kr as isGroupElementConfig,
|
|
1147
|
+
Gr as isGroupTransform,
|
|
1148
|
+
en as isImageElement,
|
|
1149
|
+
_r as isImageElementConfig,
|
|
1150
|
+
Ur as isImageTransform,
|
|
1151
|
+
jr as isKnockout,
|
|
1152
|
+
tn as isPathElement,
|
|
1153
|
+
qr as isPathElementConfig,
|
|
1154
|
+
Jr as isPathTransform,
|
|
1155
|
+
rt as isRegisteredElementType,
|
|
1156
|
+
rn as isShapeElement,
|
|
1157
|
+
Zr as isShapeElementConfig,
|
|
1158
|
+
Vr as isShapeTransform,
|
|
1159
|
+
nn as isTextElement,
|
|
1160
|
+
Xr as isTextElementConfig,
|
|
1161
|
+
Yr as isWaveTransform,
|
|
1162
|
+
je as loadKitFromJSON,
|
|
1163
|
+
on as pieceGuidesForArtboard,
|
|
1164
|
+
fr as preserveSelectionProps,
|
|
1165
|
+
Rt as registerBuiltinSections,
|
|
1166
|
+
Mt as registerBuiltinSectionsSync,
|
|
1167
|
+
Qe as registerElementType,
|
|
1168
|
+
Dt as registerSection,
|
|
1169
|
+
It as renderPieceGuides,
|
|
1170
|
+
Ue as serializeKit,
|
|
1171
|
+
hr as shouldPreserveSelection,
|
|
1172
|
+
ft as surfaceVariants,
|
|
1173
|
+
et as unregisterElementType,
|
|
1174
|
+
zt as unregisterSection,
|
|
1175
|
+
Je as useBreakpoint,
|
|
1176
|
+
nt as useCanvasEvents,
|
|
1177
|
+
Ot as useCapabilities,
|
|
1178
|
+
pr as useCommandContext,
|
|
1179
|
+
Ve as useElementById,
|
|
1180
|
+
xr as useElementsContext,
|
|
1181
|
+
gr as useHistoryContext,
|
|
1182
|
+
Lt as useKit,
|
|
1183
|
+
Xe as useLayerDragDrop,
|
|
1184
|
+
cr as useLayerPreview,
|
|
1185
|
+
Ye as useLayerSelection,
|
|
1186
|
+
Ze as usePerformance,
|
|
1187
|
+
cn as usePieceGuideBundle,
|
|
1188
|
+
qe as useProjectLoader,
|
|
1189
|
+
br as useSelectionContext,
|
|
1190
|
+
ht as useSurface,
|
|
1191
|
+
lr as useTextToolbar,
|
|
1192
|
+
Cr as useTheme,
|
|
1193
|
+
yr as useToolStateContext,
|
|
1194
|
+
vr as useViewportContext
|
|
1197
1195
|
};
|
|
1198
1196
|
//# sourceMappingURL=advanced.mjs.map
|