@snowcone-app/canvas 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CanvasStateV1-BQD8fCBU.js → CanvasStateV1-C6i6vU6p.js} +63 -63
- package/dist/{CanvasStateV1-BQD8fCBU.js.map → CanvasStateV1-C6i6vU6p.js.map} +1 -1
- package/dist/EditorCanvasImpl-C8SsT3C2.js +68 -0
- package/dist/EditorCanvasImpl-C8SsT3C2.js.map +1 -0
- package/dist/EditorContext-CyanYzo2.js +1131 -0
- package/dist/EditorContext-CyanYzo2.js.map +1 -0
- package/dist/{ImportManager-eotl7r5d.js → ElementFactory-C05JJkRp.js} +1510 -5121
- package/dist/ElementFactory-C05JJkRp.js.map +1 -0
- package/dist/{HybridHistoryManager-NL3zyEl4.js → HybridHistoryManager-Bht98XRv.js} +98 -98
- package/dist/{HybridHistoryManager-NL3zyEl4.js.map → HybridHistoryManager-Bht98XRv.js.map} +1 -1
- package/dist/ImportManager-kRYfIX-D.js +3617 -0
- package/dist/ImportManager-kRYfIX-D.js.map +1 -0
- package/dist/SnowconeCanvas-C3eZ9PP8.js +1047 -0
- package/dist/SnowconeCanvas-C3eZ9PP8.js.map +1 -0
- package/dist/ThemeContext-Rjz25x9X.js +75 -0
- package/dist/ThemeContext-Rjz25x9X.js.map +1 -0
- package/dist/UnifiedFontService-BAtqqkU4.js +1478 -0
- package/dist/UnifiedFontService-BAtqqkU4.js.map +1 -0
- package/dist/advanced.mjs +210 -207
- package/dist/advanced.mjs.map +1 -1
- package/dist/api/embed.d.ts +8 -4
- package/dist/api/testing.d.ts +1 -0
- package/dist/components/editor/EditorBuy.d.ts +49 -0
- package/dist/components/editor/EditorCanvas.d.ts +30 -0
- package/dist/components/editor/EditorCanvasImpl.d.ts +33 -0
- package/dist/components/editor/EditorPreview.d.ts +39 -0
- package/dist/components/editor/EditorRoot.d.ts +86 -0
- package/dist/components/editor/EditorTextField.d.ts +22 -0
- package/dist/components/editor/RootInternals.d.ts +77 -0
- package/dist/components/editor/designStateStore.d.ts +45 -0
- package/dist/components/editor/index.d.ts +23 -0
- package/dist/components/embed-realtime/RealtimeCanvas.d.ts +1 -1
- package/dist/components/embed-realtime/RealtimeEmbed.d.ts +5 -78
- package/dist/components/embed-realtime/RealtimeMockup.d.ts +5 -34
- package/dist/components/embed-realtime/context.d.ts +12 -2
- package/dist/components/embed-realtime/validateEmbed.d.ts +17 -3
- package/dist/design/design-builder.d.ts +81 -6
- package/dist/editorError-DMENTZ-3.js +19 -0
- package/dist/editorError-DMENTZ-3.js.map +1 -0
- package/dist/editorErrors-DbIEtCTt.js +29 -0
- package/dist/editorErrors-DbIEtCTt.js.map +1 -0
- package/dist/embed-B5kewSQY.js +738 -0
- package/dist/embed-B5kewSQY.js.map +1 -0
- package/dist/embed.mjs +38 -230
- package/dist/embed.mjs.map +1 -1
- package/dist/errors/editorError.d.ts +57 -0
- package/dist/iconify-D6eVIEy4.js +1089 -0
- package/dist/iconify-D6eVIEy4.js.map +1 -0
- package/dist/index.mjs +48 -46
- package/dist/index.mjs.map +1 -1
- package/dist/internals.mjs +105 -104
- package/dist/internals.mjs.map +1 -1
- package/dist/template-fields-GOM4MNfq.js +643 -0
- package/dist/template-fields-GOM4MNfq.js.map +1 -0
- package/dist/testing/editorErrors.d.ts +30 -0
- package/dist/testing.mjs +28 -23
- package/dist/testing.mjs.map +1 -1
- package/dist/{usePieceGuideBundle-Cyl695jv.js → usePieceGuideBundle-CGERAQJl.js} +2 -2
- package/dist/{usePieceGuideBundle-Cyl695jv.js.map → usePieceGuideBundle-CGERAQJl.js.map} +1 -1
- package/dist/validation-DEd6EOCP.js +19947 -0
- package/dist/validation-DEd6EOCP.js.map +1 -0
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/package.json +12 -4
- package/dist/ImportManager-eotl7r5d.js.map +0 -1
- package/dist/ThemeContext-D9AaUw9v.js +0 -1200
- package/dist/ThemeContext-D9AaUw9v.js.map +0 -1
- package/dist/template-fields-PcSPApl5.js +0 -1632
- package/dist/template-fields-PcSPApl5.js.map +0 -1
- package/dist/validation-BpEod0Rn.js +0 -22953
- package/dist/validation-BpEod0Rn.js.map +0 -1
package/dist/advanced.mjs
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { u as V } from "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { e as te } from "./UnifiedFontService-BAtqqkU4.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-DEd6EOCP.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-DEd6EOCP.js";
|
|
4
|
+
import { u as q } from "./EditorContext-CyanYzo2.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-CyanYzo2.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 "./HybridHistoryManager-Bht98XRv.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 "./HybridHistoryManager-Bht98XRv.js";
|
|
9
|
+
import { I as xe } from "./ImportManager-kRYfIX-D.js";
|
|
10
|
+
import { i as Xr, a as Yr, b as Zr, c as Hr, d as Qr } from "./ImportManager-kRYfIX-D.js";
|
|
11
|
+
import { useState as A, useCallback as y, useEffect as V, useMemo as X, useRef as B, memo as ge } from "react";
|
|
12
|
+
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-CGERAQJl.js";
|
|
15
|
+
import { Icon as Y } from "./iconify-D6eVIEy4.js";
|
|
16
|
+
const ze = ({
|
|
14
17
|
title: e,
|
|
15
18
|
icon: t,
|
|
16
19
|
children: r,
|
|
@@ -56,7 +59,7 @@ const Me = ({
|
|
|
56
59
|
] }),
|
|
57
60
|
w && /* @__PURE__ */ o("div", { className: "sc:mt-xl sc:flex sc:flex-col sc:gap-xl", children: r })
|
|
58
61
|
] });
|
|
59
|
-
},
|
|
62
|
+
}, Oe = ({
|
|
60
63
|
label: e,
|
|
61
64
|
labelSuffix: t,
|
|
62
65
|
children: r,
|
|
@@ -69,7 +72,7 @@ const Me = ({
|
|
|
69
72
|
] }),
|
|
70
73
|
/* @__PURE__ */ o("div", { className: a ? "sc:flex-shrink-0" : "", children: r })
|
|
71
74
|
] });
|
|
72
|
-
function
|
|
75
|
+
function Le({
|
|
73
76
|
options: e,
|
|
74
77
|
value: t,
|
|
75
78
|
onChange: r,
|
|
@@ -94,7 +97,7 @@ function ze({
|
|
|
94
97
|
);
|
|
95
98
|
}) });
|
|
96
99
|
}
|
|
97
|
-
const
|
|
100
|
+
const We = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, className: s = "" }) => {
|
|
98
101
|
const i = (m) => {
|
|
99
102
|
a(m.target.checked);
|
|
100
103
|
};
|
|
@@ -120,7 +123,7 @@ const Oe = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
|
|
|
120
123
|
]
|
|
121
124
|
}
|
|
122
125
|
);
|
|
123
|
-
},
|
|
126
|
+
}, Ke = ({
|
|
124
127
|
checked: e,
|
|
125
128
|
onChange: t,
|
|
126
129
|
label: r,
|
|
@@ -162,26 +165,26 @@ const Oe = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
|
|
|
162
165
|
]
|
|
163
166
|
}
|
|
164
167
|
);
|
|
165
|
-
},
|
|
168
|
+
}, _e = ({
|
|
166
169
|
isOpen: e,
|
|
167
170
|
onToggle: t,
|
|
168
171
|
trigger: r,
|
|
169
172
|
children: a
|
|
170
173
|
}) => /* @__PURE__ */ o(
|
|
171
|
-
|
|
174
|
+
re,
|
|
172
175
|
{
|
|
173
176
|
isOpen: e,
|
|
174
177
|
onToggle: t,
|
|
175
178
|
trigger: r || /* @__PURE__ */ b(D, { delayDuration: 0, children: [
|
|
176
179
|
/* @__PURE__ */ o(M, { asChild: !0, children: /* @__PURE__ */ o(
|
|
177
|
-
|
|
180
|
+
ne,
|
|
178
181
|
{
|
|
179
182
|
variant: "ghost",
|
|
180
183
|
size: "toolbar",
|
|
181
184
|
onClick: (s) => {
|
|
182
185
|
s.stopPropagation(), t(!e);
|
|
183
186
|
},
|
|
184
|
-
children: /* @__PURE__ */ o(
|
|
187
|
+
children: /* @__PURE__ */ o(Y, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" })
|
|
185
188
|
}
|
|
186
189
|
) }),
|
|
187
190
|
/* @__PURE__ */ o(I, { children: /* @__PURE__ */ o("p", { children: "More" }) })
|
|
@@ -192,7 +195,7 @@ const Oe = ({ label: e, icon: t, checked: r, onChange: a, disabled: n = !1, clas
|
|
|
192
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 })
|
|
193
196
|
}
|
|
194
197
|
);
|
|
195
|
-
function
|
|
198
|
+
function Ge(e) {
|
|
196
199
|
const t = {
|
|
197
200
|
name: e.name,
|
|
198
201
|
capabilities: {
|
|
@@ -217,18 +220,18 @@ function Ke(e) {
|
|
|
217
220
|
};
|
|
218
221
|
return e.content && (t.content = { ...e.content }), t;
|
|
219
222
|
}
|
|
220
|
-
function
|
|
223
|
+
function Ue(e) {
|
|
221
224
|
if (!e.name || e.name.trim() === "")
|
|
222
225
|
throw new Error("[loadKitFromJSON] Kit name is required");
|
|
223
226
|
const t = {};
|
|
224
227
|
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);
|
|
225
228
|
let r;
|
|
226
229
|
if (e.extends) {
|
|
227
|
-
const n =
|
|
228
|
-
r =
|
|
230
|
+
const n = se(e.extends);
|
|
231
|
+
r = be(n, { name: e.name, ...t });
|
|
229
232
|
} else
|
|
230
|
-
r =
|
|
231
|
-
const a =
|
|
233
|
+
r = ye({ name: e.name, ...t });
|
|
234
|
+
const a = ae(r);
|
|
232
235
|
if (a.warnings.length > 0)
|
|
233
236
|
for (const n of a.warnings)
|
|
234
237
|
console.warn(`[loadKitFromJSON] Warning: ${n}`);
|
|
@@ -241,19 +244,19 @@ ${a.errors.join(`
|
|
|
241
244
|
return r;
|
|
242
245
|
}
|
|
243
246
|
const L = de("useProjectLoader");
|
|
244
|
-
function
|
|
247
|
+
function je() {
|
|
245
248
|
const {
|
|
246
249
|
handleLoadWorkspace: e
|
|
247
|
-
} =
|
|
250
|
+
} = q(), [t, r] = A(!1), [a, n] = A(null), [s, i] = A(null), [m, l] = A(null), f = y(async (d) => {
|
|
248
251
|
r(!0), n(null);
|
|
249
252
|
try {
|
|
250
253
|
const c = typeof d == "string" ? JSON.parse(d) : d;
|
|
251
254
|
if (!c.artboards || !Array.isArray(c.artboards))
|
|
252
255
|
throw new Error("Invalid document format: missing artboards array");
|
|
253
|
-
const
|
|
254
|
-
if (!
|
|
255
|
-
throw new Error(
|
|
256
|
-
e(
|
|
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);
|
|
257
|
+
if (!g.success || !g.artboards || !g.elements)
|
|
258
|
+
throw new Error(g.error || "Failed to import project");
|
|
259
|
+
e(g.artboards, g.elements, g.activeArtboardId || null), i(c);
|
|
257
260
|
const u = c.artboards.reduce((p, k) => {
|
|
258
261
|
var v;
|
|
259
262
|
return p + (((v = k.elements) == null ? void 0 : v.length) || 0);
|
|
@@ -288,15 +291,15 @@ function Ge() {
|
|
|
288
291
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
289
292
|
appVersion: "1.0.0"
|
|
290
293
|
},
|
|
291
|
-
artboards: d.artboards.map((
|
|
294
|
+
artboards: d.artboards.map((x, S) => ({
|
|
292
295
|
id: `artboard-${Date.now()}-${S}`,
|
|
293
|
-
name:
|
|
296
|
+
name: x.name,
|
|
294
297
|
x: 0,
|
|
295
298
|
y: 0,
|
|
296
|
-
width:
|
|
297
|
-
height:
|
|
298
|
-
backgroundColor:
|
|
299
|
-
elements:
|
|
299
|
+
width: x.width,
|
|
300
|
+
height: x.height,
|
|
301
|
+
backgroundColor: x.backgroundColor,
|
|
302
|
+
elements: x.elements || []
|
|
300
303
|
})),
|
|
301
304
|
activeArtboardId: null
|
|
302
305
|
// First artboard will be active by default
|
|
@@ -329,19 +332,19 @@ const U = {
|
|
|
329
332
|
function we(e, t) {
|
|
330
333
|
return e >= t.xxl ? "xxl" : e >= t.xl ? "xl" : e >= t.lg ? "lg" : e >= t.md ? "md" : e >= t.sm ? "sm" : "xs";
|
|
331
334
|
}
|
|
332
|
-
function
|
|
335
|
+
function Je(e) {
|
|
333
336
|
const t = {
|
|
334
337
|
...U,
|
|
335
338
|
...e
|
|
336
339
|
}, [r, a] = A(() => typeof window < "u" ? window.innerWidth : U.lg);
|
|
337
|
-
|
|
340
|
+
V(() => {
|
|
338
341
|
if (typeof window > "u") return;
|
|
339
|
-
const
|
|
342
|
+
const x = () => {
|
|
340
343
|
a(window.innerWidth);
|
|
341
344
|
};
|
|
342
|
-
return window.addEventListener("resize",
|
|
345
|
+
return window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
|
|
343
346
|
}, []);
|
|
344
|
-
const n =
|
|
347
|
+
const n = X(
|
|
345
348
|
() => we(r, t),
|
|
346
349
|
[r, t]
|
|
347
350
|
), s = n === "xs", i = n === "sm", m = n === "md", l = n === "lg", f = n === "xl", w = n === "xxl", h = ["xs", "sm", "md", "lg", "xl", "xxl"];
|
|
@@ -354,12 +357,12 @@ function Ue(e) {
|
|
|
354
357
|
isLg: l,
|
|
355
358
|
isXl: f,
|
|
356
359
|
isXxl: w,
|
|
357
|
-
isAtLeast: (
|
|
358
|
-
const S = h.indexOf(n), C = h.indexOf(
|
|
360
|
+
isAtLeast: (x) => {
|
|
361
|
+
const S = h.indexOf(n), C = h.indexOf(x);
|
|
359
362
|
return S >= C;
|
|
360
363
|
},
|
|
361
|
-
isAtMost: (
|
|
362
|
-
const S = h.indexOf(n), C = h.indexOf(
|
|
364
|
+
isAtMost: (x) => {
|
|
365
|
+
const S = h.indexOf(n), C = h.indexOf(x);
|
|
363
366
|
return S <= C;
|
|
364
367
|
}
|
|
365
368
|
};
|
|
@@ -373,7 +376,7 @@ const j = {
|
|
|
373
376
|
exportCount: 0,
|
|
374
377
|
avgExportTime: 0
|
|
375
378
|
};
|
|
376
|
-
function
|
|
379
|
+
function qe() {
|
|
377
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(() => {
|
|
378
381
|
const u = {
|
|
379
382
|
fps: f(n.current),
|
|
@@ -389,13 +392,13 @@ function je() {
|
|
|
389
392
|
}, [f, w, h]), c = y(() => {
|
|
390
393
|
const u = performance.now(), p = u - m.current;
|
|
391
394
|
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));
|
|
392
|
-
}, [r, d]),
|
|
395
|
+
}, [r, d]), x = y(() => {
|
|
393
396
|
a(!0), m.current = performance.now(), l.current = requestAnimationFrame(c);
|
|
394
397
|
}, [c]), S = y(() => {
|
|
395
398
|
a(!1), l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
396
399
|
}, []), C = y(() => {
|
|
397
400
|
n.current = [], s.current = [], i.current = [], t(j);
|
|
398
|
-
}, []),
|
|
401
|
+
}, []), g = y(() => `
|
|
399
402
|
Performance Report
|
|
400
403
|
==================
|
|
401
404
|
FPS: ${e.fps.toFixed(1)}
|
|
@@ -406,22 +409,22 @@ Element Count: ${e.elementCount}
|
|
|
406
409
|
Export Count: ${e.exportCount}
|
|
407
410
|
Avg Export Time: ${e.avgExportTime.toFixed(2)}ms
|
|
408
411
|
`.trim(), [e]);
|
|
409
|
-
return
|
|
412
|
+
return V(() => () => {
|
|
410
413
|
l.current !== null && cancelAnimationFrame(l.current);
|
|
411
414
|
}, []), {
|
|
412
415
|
metrics: e,
|
|
413
|
-
startProfiling:
|
|
416
|
+
startProfiling: x,
|
|
414
417
|
stopProfiling: S,
|
|
415
418
|
clearMetrics: C,
|
|
416
|
-
getReport:
|
|
419
|
+
getReport: g,
|
|
417
420
|
isProfiling: r
|
|
418
421
|
};
|
|
419
422
|
}
|
|
420
|
-
function
|
|
421
|
-
const { getElementById: t } =
|
|
423
|
+
function Ve(e) {
|
|
424
|
+
const { getElementById: t } = q();
|
|
422
425
|
return e ? t(e) ?? null : null;
|
|
423
426
|
}
|
|
424
|
-
function
|
|
427
|
+
function Xe(e) {
|
|
425
428
|
const {
|
|
426
429
|
onReorder: t,
|
|
427
430
|
onGroupReorder: r,
|
|
@@ -429,14 +432,14 @@ function qe(e) {
|
|
|
429
432
|
onDropIntoGroupAtPosition: n,
|
|
430
433
|
findElement: s,
|
|
431
434
|
findParentGroup: i
|
|
432
|
-
} = e, [m, l] = A(null), [f, w] = A(null), [h, d] = A(null), c = y((
|
|
433
|
-
|
|
435
|
+
} = e, [m, l] = A(null), [f, w] = A(null), [h, d] = A(null), c = y((g, u) => {
|
|
436
|
+
g.dataTransfer.effectAllowed = "move", requestAnimationFrame(() => {
|
|
434
437
|
l(u);
|
|
435
438
|
});
|
|
436
|
-
}, []),
|
|
437
|
-
(
|
|
438
|
-
|
|
439
|
-
const p =
|
|
439
|
+
}, []), x = y(
|
|
440
|
+
(g, u) => {
|
|
441
|
+
g.preventDefault(), g.dataTransfer.dropEffect = "move";
|
|
442
|
+
const p = g.currentTarget.getBoundingClientRect(), v = g.clientY - p.top, F = p.height, z = (s == null ? void 0 : s(u)) instanceof ue;
|
|
440
443
|
let $;
|
|
441
444
|
z ? v < F * 0.25 ? $ = "before" : v > F * 0.75 ? $ = "after" : $ = "into" : v < F * 0.4 ? $ = "before" : v > F * 0.6 ? $ = "after" : $ = v < F / 2 ? "before" : "after", w(u), d($);
|
|
442
445
|
},
|
|
@@ -444,8 +447,8 @@ function qe(e) {
|
|
|
444
447
|
), S = y(() => {
|
|
445
448
|
l(null), w(null), d(null);
|
|
446
449
|
}, []), C = y(
|
|
447
|
-
(
|
|
448
|
-
if (
|
|
450
|
+
(g, u) => {
|
|
451
|
+
if (g.preventDefault(), !m || m === u || !h) {
|
|
449
452
|
S();
|
|
450
453
|
return;
|
|
451
454
|
}
|
|
@@ -474,13 +477,13 @@ function qe(e) {
|
|
|
474
477
|
dropPosition: h,
|
|
475
478
|
handlers: {
|
|
476
479
|
onDragStart: c,
|
|
477
|
-
onDragOver:
|
|
480
|
+
onDragOver: x,
|
|
478
481
|
onDrop: C,
|
|
479
482
|
onDragEnd: S
|
|
480
483
|
}
|
|
481
484
|
};
|
|
482
485
|
}
|
|
483
|
-
function
|
|
486
|
+
function Ye(e) {
|
|
484
487
|
const { selectedId: t, multiSelection: r, onSelectionChange: a, onMultiSelectionChange: n } = e, s = y(
|
|
485
488
|
(m) => m === t || r.includes(m),
|
|
486
489
|
[t, r]
|
|
@@ -506,13 +509,13 @@ function Ve(e) {
|
|
|
506
509
|
);
|
|
507
510
|
return { isSelected: s, handleClick: i };
|
|
508
511
|
}
|
|
509
|
-
const Se =
|
|
512
|
+
const Se = ge(({ value: e, onChange: t, fontSizes: r, isOpen: a, onToggle: n }) => {
|
|
510
513
|
const s = (i) => {
|
|
511
514
|
t(i), n(!1);
|
|
512
515
|
};
|
|
513
|
-
return /* @__PURE__ */ b(
|
|
514
|
-
/* @__PURE__ */ o(
|
|
515
|
-
/* @__PURE__ */ o(
|
|
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(
|
|
516
519
|
"button",
|
|
517
520
|
{
|
|
518
521
|
onClick: () => s(i),
|
|
@@ -524,7 +527,7 @@ const Se = xe(({ value: e, onChange: t, fontSizes: r, isOpen: a, onToggle: n })
|
|
|
524
527
|
] });
|
|
525
528
|
});
|
|
526
529
|
Se.displayName = "FontSizeDropdown";
|
|
527
|
-
function
|
|
530
|
+
function Ze({ toolbar: e }) {
|
|
528
531
|
const { fontSize: t, handleFontSizeIncrement: r, handleFontSizeChange: a } = e, [n, s] = A(!1);
|
|
529
532
|
return /* @__PURE__ */ b("div", { className: "sc-toolbar-group", children: [
|
|
530
533
|
/* @__PURE__ */ b(D, { delayDuration: 300, children: [
|
|
@@ -538,7 +541,7 @@ function Xe({ toolbar: e }) {
|
|
|
538
541
|
{
|
|
539
542
|
className: "sc-toolbar-font-size-display",
|
|
540
543
|
onClick: () => {
|
|
541
|
-
|
|
544
|
+
le.protectNextClick(), s(!n);
|
|
542
545
|
},
|
|
543
546
|
children: t
|
|
544
547
|
}
|
|
@@ -581,7 +584,7 @@ function Xe({ toolbar: e }) {
|
|
|
581
584
|
] });
|
|
582
585
|
}
|
|
583
586
|
const _ = /* @__PURE__ */ new Map();
|
|
584
|
-
function
|
|
587
|
+
function He(e) {
|
|
585
588
|
if (!e.type || typeof e.type != "string")
|
|
586
589
|
throw new Error('ElementTypeRegistration requires a non-empty "type" string');
|
|
587
590
|
if (typeof e.Component != "function")
|
|
@@ -598,13 +601,13 @@ function Ye(e) {
|
|
|
598
601
|
Component: e.Component
|
|
599
602
|
}), _.set(e.type, { ...e });
|
|
600
603
|
}
|
|
601
|
-
function
|
|
604
|
+
function Qe(e) {
|
|
602
605
|
pe(e), _.delete(e);
|
|
603
606
|
}
|
|
604
|
-
function
|
|
607
|
+
function et() {
|
|
605
608
|
return Array.from(_.values());
|
|
606
609
|
}
|
|
607
|
-
function
|
|
610
|
+
function tt(e) {
|
|
608
611
|
return fe(e) !== void 0;
|
|
609
612
|
}
|
|
610
613
|
class Ce {
|
|
@@ -698,7 +701,7 @@ class Ce {
|
|
|
698
701
|
}
|
|
699
702
|
}
|
|
700
703
|
const Ee = new Ce();
|
|
701
|
-
function
|
|
704
|
+
function rt() {
|
|
702
705
|
return Ee;
|
|
703
706
|
}
|
|
704
707
|
const W = {
|
|
@@ -842,7 +845,7 @@ function ke(e, t, r, a) {
|
|
|
842
845
|
}
|
|
843
846
|
return null;
|
|
844
847
|
}
|
|
845
|
-
function
|
|
848
|
+
function nt({
|
|
846
849
|
artboardWidth: e,
|
|
847
850
|
artboardHeight: t,
|
|
848
851
|
canvasPadding: r = 0,
|
|
@@ -852,7 +855,7 @@ function tt({
|
|
|
852
855
|
style: i,
|
|
853
856
|
className: m
|
|
854
857
|
}) {
|
|
855
|
-
const l =
|
|
858
|
+
const l = X(() => {
|
|
856
859
|
const d = Math.max(
|
|
857
860
|
16,
|
|
858
861
|
Math.round(Math.min(e, t) * 0.03)
|
|
@@ -879,7 +882,7 @@ function tt({
|
|
|
879
882
|
className: m,
|
|
880
883
|
style: { pointerEvents: "none", width: "100%", height: "100%" },
|
|
881
884
|
children: /* @__PURE__ */ o("g", { transform: `translate(${r} ${r})`, children: a.map((d) => {
|
|
882
|
-
const c = n == null ? void 0 : n[d.id],
|
|
885
|
+
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})`;
|
|
883
886
|
let N = "";
|
|
884
887
|
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)`);
|
|
885
888
|
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 ? {
|
|
@@ -912,7 +915,7 @@ function tt({
|
|
|
912
915
|
height: p
|
|
913
916
|
}, H = O.kind === "rect" || O.kind === "roundedRect";
|
|
914
917
|
return /* @__PURE__ */ b("g", { transform: z, children: [
|
|
915
|
-
f.safeArea && H && /* @__PURE__ */ b(
|
|
918
|
+
f.safeArea && H && /* @__PURE__ */ b(ve, { children: [
|
|
916
919
|
/* @__PURE__ */ b("defs", { children: [
|
|
917
920
|
/* @__PURE__ */ o(
|
|
918
921
|
"filter",
|
|
@@ -976,14 +979,14 @@ function tt({
|
|
|
976
979
|
}
|
|
977
980
|
)
|
|
978
981
|
] }),
|
|
979
|
-
f.zones &&
|
|
982
|
+
f.zones && x.filter((E) => E.kind !== "dieCut").map((E, R) => /* @__PURE__ */ o("g", { children: K(E.path, {
|
|
980
983
|
fill: l.zoneFill[E.kind],
|
|
981
984
|
stroke: l.zoneStroke[E.kind],
|
|
982
985
|
strokeWidth: 1.5,
|
|
983
986
|
strokeDasharray: E.kind === "wrap" ? "4 3" : void 0,
|
|
984
987
|
vectorEffect: "non-scaling-stroke"
|
|
985
988
|
}) }, `zone-${R}`)),
|
|
986
|
-
f.zones &&
|
|
989
|
+
f.zones && x.filter((E) => E.kind === "dieCut").map((E, R) => {
|
|
987
990
|
const T = E.path;
|
|
988
991
|
if (T.kind !== "rect" && T.kind !== "roundedRect")
|
|
989
992
|
return null;
|
|
@@ -1059,134 +1062,134 @@ function tt({
|
|
|
1059
1062
|
}
|
|
1060
1063
|
);
|
|
1061
1064
|
}
|
|
1062
|
-
|
|
1065
|
+
te();
|
|
1063
1066
|
export {
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
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,
|
|
1074
|
+
Le as ButtonGroup,
|
|
1075
|
+
ut as Canvas,
|
|
1073
1076
|
Ce as CanvasEventBus,
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1077
|
+
mt as CanvasSkeleton,
|
|
1078
|
+
ft as ColorPickerDropdown,
|
|
1079
|
+
ht as ContextualToolbars,
|
|
1080
|
+
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,
|
|
1087
1090
|
Se as FontSizeDropdown,
|
|
1088
|
-
|
|
1089
|
-
|
|
1091
|
+
Ze as FontSizeGroup,
|
|
1092
|
+
St as GlyphPanel,
|
|
1090
1093
|
ue as GroupElement,
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1094
|
+
Cr as ImageElement,
|
|
1095
|
+
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,
|
|
1107
|
+
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,
|
|
1117
|
+
Ke as Switch,
|
|
1118
|
+
Ot as TextAlignButton,
|
|
1119
|
+
kr as TextElement,
|
|
1120
|
+
Lt as TextMoreMenu,
|
|
1121
|
+
Wt as TextToolbar,
|
|
1122
|
+
br as ThemeProvider,
|
|
1123
|
+
We as Toggle,
|
|
1124
|
+
Kt as ToolbarSkeleton,
|
|
1125
|
+
_t as TransformControlPanel,
|
|
1126
|
+
Gt as UnderlineButton,
|
|
1127
|
+
Ut as UppercaseButton,
|
|
1128
|
+
nt as VisualGuideOverlay,
|
|
1129
|
+
jt as ZoomControls,
|
|
1127
1130
|
Ee as canvasEventBus,
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
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
|
-
|
|
1131
|
+
Jt as getAllSections,
|
|
1132
|
+
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,
|
|
1154
|
+
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,
|
|
1161
|
+
Ue as loadKitFromJSON,
|
|
1162
|
+
rn as pieceGuidesForArtboard,
|
|
1163
|
+
lr as preserveSelectionProps,
|
|
1164
|
+
Xt as registerBuiltinSections,
|
|
1165
|
+
Yt as registerBuiltinSectionsSync,
|
|
1166
|
+
He as registerElementType,
|
|
1167
|
+
Zt as registerSection,
|
|
1168
|
+
Ht as renderPieceGuides,
|
|
1169
|
+
Ge as serializeKit,
|
|
1170
|
+
dr as shouldPreserveSelection,
|
|
1171
|
+
Qt as surfaceVariants,
|
|
1172
|
+
Qe as unregisterElementType,
|
|
1173
|
+
er as unregisterSection,
|
|
1174
|
+
Je as useBreakpoint,
|
|
1175
|
+
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,
|
|
1185
|
+
qe as usePerformance,
|
|
1186
|
+
nn as usePieceGuideBundle,
|
|
1187
|
+
je as useProjectLoader,
|
|
1188
|
+
hr as useSelectionContext,
|
|
1189
|
+
sr as useSurface,
|
|
1190
|
+
ar as useTextToolbar,
|
|
1191
|
+
yr as useTheme,
|
|
1189
1192
|
pr as useToolStateContext,
|
|
1190
|
-
|
|
1193
|
+
xr as useViewportContext
|
|
1191
1194
|
};
|
|
1192
1195
|
//# sourceMappingURL=advanced.mjs.map
|