@snowcone-app/canvas 0.41.3 → 0.41.5
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-JcBrIZ6I.js → CanvasRenderer-3M-52sAd.js} +4 -4
- package/dist/{CanvasRenderer-JcBrIZ6I.js.map → CanvasRenderer-3M-52sAd.js.map} +1 -1
- package/dist/{CanvasStateV1-BJ5-75NN.js → CanvasStateV1-C9tFMK5q.js} +3 -3
- package/dist/{CanvasStateV1-BJ5-75NN.js.map → CanvasStateV1-C9tFMK5q.js.map} +1 -1
- package/dist/{ContextualToolbars-wmbHxn5a.js → ContextualToolbars-B2LTNu7r.js} +358 -358
- package/dist/{ContextualToolbars-wmbHxn5a.js.map → ContextualToolbars-B2LTNu7r.js.map} +1 -1
- package/dist/{EditorCanvasImpl-CSDnCIpN.js → EditorCanvasImpl-CKqnla_y.js} +26 -26
- package/dist/EditorCanvasImpl-CKqnla_y.js.map +1 -0
- package/dist/{ExportManager-CHlByUYV.js → ExportManager-9_RjQEv0.js} +2 -2
- package/dist/{ExportManager-CHlByUYV.js.map → ExportManager-9_RjQEv0.js.map} +1 -1
- package/dist/{FontAnalyzer-Bj2KrX80.js → FontAnalyzer-Ch1jgTq7.js} +88 -68
- package/dist/FontAnalyzer-Ch1jgTq7.js.map +1 -0
- package/dist/ImagePanel-DY9Ve3X7.js +1016 -0
- package/dist/{ImagePanel-0ZwDDaCy.js.map → ImagePanel-DY9Ve3X7.js.map} +1 -1
- package/dist/SnowconeCanvas-BSFMazgl.js +1098 -0
- package/dist/SnowconeCanvas-BSFMazgl.js.map +1 -0
- package/dist/advanced.mjs +44 -44
- package/dist/api/stable.d.ts +1 -1
- package/dist/components/embed/SnowconeCanvas.d.ts +15 -0
- package/dist/components/embed/kernel.d.ts +3 -1
- package/dist/core/ArtboardElement.d.ts +2 -0
- package/dist/core/ArtboardManager.d.ts +11 -0
- package/dist/{custom-icons-up58ZbC9.js → custom-icons-D_XezOul.js} +2 -2
- package/dist/{custom-icons-up58ZbC9.js.map → custom-icons-D_XezOul.js.map} +1 -1
- package/dist/design-builder-BFM94eA9.js +1859 -0
- package/dist/design-builder-BFM94eA9.js.map +1 -0
- package/dist/{embed-GXevsHX5.js → embed-KG_YnRHA.js} +10 -10
- package/dist/{embed-GXevsHX5.js.map → embed-KG_YnRHA.js.map} +1 -1
- package/dist/embed.mjs +12 -12
- package/dist/{guards-CQeF53PN.js → guards-D_mw4DgS.js} +2 -2
- package/dist/{guards-CQeF53PN.js.map → guards-D_mw4DgS.js.map} +1 -1
- package/dist/index.mjs +9 -9
- package/dist/internals.mjs +6 -6
- package/dist/{placement-D31o3YYC.js → placement-tSiIVhrL.js} +3 -3
- package/dist/{placement-D31o3YYC.js.map → placement-tSiIVhrL.js.map} +1 -1
- package/dist/placement.mjs +2 -2
- package/dist/{template-fields-tobyHoMe.js → template-fields-C0qoE_ZH.js} +32 -32
- package/dist/{template-fields-tobyHoMe.js.map → template-fields-C0qoE_ZH.js.map} +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{useCommands-Cm3mDB-l.js → useCommands-DSapP-w1.js} +7 -7
- package/dist/{useCommands-Cm3mDB-l.js.map → useCommands-DSapP-w1.js.map} +1 -1
- package/dist/{usePieceGuideBundle-BTnUn33k.js → usePieceGuideBundle-oBykb3X8.js} +2 -2
- package/dist/{usePieceGuideBundle-BTnUn33k.js.map → usePieceGuideBundle-oBykb3X8.js.map} +1 -1
- package/dist/utils/newImagePlacement.d.ts +56 -0
- package/dist/{validation-D4zxugNJ.js → validation-D6zVSeTh.js} +307 -307
- package/dist/{validation-D4zxugNJ.js.map → validation-D6zVSeTh.js.map} +1 -1
- package/dist/vendor/ui/primitives/badge.d.ts +1 -1
- package/dist/vendor/ui/primitives/link.d.ts +1 -1
- package/dist/vendor/ui/primitives/spinner.d.ts +1 -1
- package/example/package.json +1 -1
- package/package.json +4 -4
- package/dist/EditorCanvasImpl-CSDnCIpN.js.map +0 -1
- package/dist/FontAnalyzer-Bj2KrX80.js.map +0 -1
- package/dist/ImagePanel-0ZwDDaCy.js +0 -984
- package/dist/SnowconeCanvas-BZk7PRpk.js +0 -1215
- package/dist/SnowconeCanvas-BZk7PRpk.js.map +0 -1
- package/dist/design-builder-DUEwCUmA.js +0 -1676
- package/dist/design-builder-DUEwCUmA.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as r, jsxs as y, Fragment as Pn } from "react/jsx-runtime";
|
|
2
2
|
import * as $n from "react";
|
|
3
3
|
import je, { useState as le, useEffect as Ie, useCallback as ft, useMemo as xs, useContext as Ar, createContext as Dr, useRef as we, useImperativeHandle as nr, forwardRef as Nr } from "react";
|
|
4
|
-
import { b as rs,
|
|
5
|
-
import { l as rr, I as
|
|
6
|
-
import { I as Lt, G as Re, b9 as Is, x as ys, af as cr, ba as Fs, bb as Ur, a1 as Cn, bc as Gr, bd as us, P as wn, c as
|
|
4
|
+
import { b as rs, w as sr, y as _s, z as $s, d as Ts, o as Br, c as zr, t as Or } from "./design-builder-BFM94eA9.js";
|
|
5
|
+
import { l as rr, I as Oe, s as Xr, u as or, c as Fn, v as Qt, i as _e, J as Lr, G as Yr, H as Hr, F as _r, W as $r, T as dn, q as un, r as hn, B as Ct, Y as Fr, Z as Wr, _ as Vr, D as ir, k as Kr, b as ar } from "./useCommands-DSapP-w1.js";
|
|
6
|
+
import { I as Lt, G as Re, b9 as Is, x as ys, af as cr, ba as Fs, bb as Ur, a1 as Cn, bc as Gr, bd as us, P as wn, c as On, a6 as en, a4 as ms, be as qr, T as Qe, u as jr, bf as Jn, bg as Zr, bh as Jr, bi as Qr, a5 as lr, a3 as eo, bj as Es, a2 as to, g as no, S as Qn, ax as so, z as Bn } from "./FontAnalyzer-Ch1jgTq7.js";
|
|
7
7
|
import { createPortal as dr } from "react-dom";
|
|
8
|
-
import { b as ro, n as ur, g as _n, c as oo, r as io, d as ao, C as Ws, e as Vs, f as gs, T as co, a as lo, A as uo, S as ho, I as fo } from "./CanvasRenderer-
|
|
8
|
+
import { b as ro, n as ur, g as _n, c as oo, r as io, d as ao, C as Ws, e as Vs, f as gs, T as co, a as lo, A as uo, S as ho, I as fo } from "./CanvasRenderer-3M-52sAd.js";
|
|
9
9
|
import { u as po } from "./ThemeContext-Rjz25x9X.js";
|
|
10
10
|
import { renderToStaticMarkup as mo } from "react-dom/server";
|
|
11
|
-
import { D as Ps, n as As, o as hr, p as Ds, e as go, q as Mt } from "./ContextualToolbars-
|
|
12
|
-
import { L as Tt, S as fr, T as
|
|
11
|
+
import { D as Ps, n as As, o as hr, p as Ds, e as go, q as Mt } from "./ContextualToolbars-B2LTNu7r.js";
|
|
12
|
+
import { L as Tt, S as fr, T as zt, I as xo } from "./custom-icons-D_XezOul.js";
|
|
13
13
|
import * as ts from "@radix-ui/react-radio-group";
|
|
14
|
-
import { S as yo, U as Ks, V as Us } from "./ExportManager-
|
|
14
|
+
import { S as yo, U as Ks, V as Us } from "./ExportManager-9_RjQEv0.js";
|
|
15
15
|
import { cva as pr } from "class-variance-authority";
|
|
16
16
|
import { debounce as Gs } from "lodash-es";
|
|
17
17
|
const bo = {
|
|
@@ -214,9 +214,9 @@ function Ro(e) {
|
|
|
214
214
|
Ie(() => {
|
|
215
215
|
if (!t) return;
|
|
216
216
|
const T = (g) => {
|
|
217
|
-
var
|
|
217
|
+
var z;
|
|
218
218
|
const P = g.target;
|
|
219
|
-
if (!(P.tagName === "INPUT" || P.tagName === "TEXTAREA") && !P.isContentEditable && !((
|
|
219
|
+
if (!(P.tagName === "INPUT" || P.tagName === "TEXTAREA") && !P.isContentEditable && !((z = P.closest) != null && z.call(P, '[role="listbox"], [role="menu"], [role="tablist"]'))) {
|
|
220
220
|
if ((g.metaKey || g.ctrlKey) && g.key === "z" && !g.shiftKey) {
|
|
221
221
|
g.preventDefault(), p();
|
|
222
222
|
return;
|
|
@@ -430,17 +430,17 @@ function Ao(e, t) {
|
|
|
430
430
|
const g = ys(E, n, s, o, i, l);
|
|
431
431
|
let P = p;
|
|
432
432
|
a === "center" ? P = (d - g) / 2 : a === "right" && (P = d - p - g);
|
|
433
|
-
let
|
|
433
|
+
let z = P;
|
|
434
434
|
const D = Math.min(R, C.length);
|
|
435
435
|
for (let w = 0; w < D; w++) {
|
|
436
436
|
if (!T && w < A) continue;
|
|
437
437
|
const ne = C[w], V = x + w, N = c.getStyleAt(V), u = N.fontSize || n, j = N.fontFamily || s, G = N.bold !== void 0 ? N.bold : o, te = N.italic !== void 0 ? N.italic : i, ae = N.letterSpacing !== void 0 ? N.letterSpacing : l;
|
|
438
|
-
|
|
438
|
+
z += ys(ne, u, j, G, te, ae);
|
|
439
439
|
}
|
|
440
440
|
return {
|
|
441
441
|
lineIndex: v,
|
|
442
442
|
lineCount: b.length,
|
|
443
|
-
xPositionInLine:
|
|
443
|
+
xPositionInLine: z,
|
|
444
444
|
lineStartIndex: x
|
|
445
445
|
};
|
|
446
446
|
}
|
|
@@ -486,12 +486,12 @@ function Sn(e, t) {
|
|
|
486
486
|
E += b[N].length + 1;
|
|
487
487
|
const A = b[C];
|
|
488
488
|
let T = A, I = 0, g = 0;
|
|
489
|
-
const P = C === 0,
|
|
489
|
+
const P = C === 0, z = C === b.length - 1;
|
|
490
490
|
if (!P) {
|
|
491
491
|
const N = A.match(/^ +/);
|
|
492
492
|
I = N ? N[0].length : 0, I > 0 && (T = T.substring(I));
|
|
493
493
|
}
|
|
494
|
-
if (!
|
|
494
|
+
if (!z) {
|
|
495
495
|
const N = T.match(/ +$/);
|
|
496
496
|
g = N ? N[0].length : 0, g > 0 && (T = T.substring(0, T.length - g));
|
|
497
497
|
}
|
|
@@ -505,7 +505,7 @@ function Sn(e, t) {
|
|
|
505
505
|
return E + A.length - g;
|
|
506
506
|
let V = 0;
|
|
507
507
|
for (let N = 0; N < A.length; N++) {
|
|
508
|
-
if (!P && N < I || !
|
|
508
|
+
if (!P && N < I || !z && N >= A.length - g) continue;
|
|
509
509
|
const u = A[N], j = E + N, G = c.getStyleAt(j), te = G.fontSize || n, ae = G.fontFamily || s, $ = G.bold !== void 0 ? G.bold : o, me = G.italic !== void 0 ? G.italic : i, ie = G.letterSpacing !== void 0 ? G.letterSpacing : l, be = ys(u, te, ae, $, me, ie);
|
|
510
510
|
if (ne < V + be / 2)
|
|
511
511
|
return j;
|
|
@@ -535,10 +535,10 @@ function No() {
|
|
|
535
535
|
const x = Math.min(n.x, m), v = Math.max(n.x, m), C = Math.min(n.y, p), R = Math.max(n.y, p), E = [];
|
|
536
536
|
b.forEach((A) => {
|
|
537
537
|
if (A.visible === !1) return;
|
|
538
|
-
const T = A.getVisualBoundingBox(), I = T.x, g = T.x + T.width, P = T.y,
|
|
538
|
+
const T = A.getVisualBoundingBox(), I = T.x, g = T.x + T.width, P = T.y, z = T.y + T.height;
|
|
539
539
|
!(g < x || // element is left of marquee
|
|
540
540
|
I > v || // element is right of marquee
|
|
541
|
-
|
|
541
|
+
z < C || // element is above marquee
|
|
542
542
|
P > R) && E.push(A.id);
|
|
543
543
|
}), l(E);
|
|
544
544
|
},
|
|
@@ -774,12 +774,12 @@ class Bo {
|
|
|
774
774
|
t.restore();
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
|
-
const
|
|
778
|
-
function
|
|
777
|
+
const zo = On("usePenTool");
|
|
778
|
+
function Oo({ selectedElement: e }) {
|
|
779
779
|
const [t] = le(() => new Bo()), [n, s] = le("crosshair");
|
|
780
780
|
return Ie(() => {
|
|
781
781
|
try {
|
|
782
|
-
const o = mo(/* @__PURE__ */ r(
|
|
782
|
+
const o = mo(/* @__PURE__ */ r(Oe, { icon: "lucide:pen-tool", width: 24, height: 24 })).replace(
|
|
783
783
|
/<svg[^>]*>|<\/svg>/g,
|
|
784
784
|
""
|
|
785
785
|
), i = `
|
|
@@ -796,7 +796,7 @@ function zo({ selectedElement: e }) {
|
|
|
796
796
|
`.trim(), l = `data:image/svg+xml,${encodeURIComponent(i)}`;
|
|
797
797
|
s(`url('${l}') 0 0, crosshair`);
|
|
798
798
|
} catch (o) {
|
|
799
|
-
|
|
799
|
+
zo.error("Failed to create pen cursor:", o), s("crosshair");
|
|
800
800
|
}
|
|
801
801
|
}, []), Ie(() => {
|
|
802
802
|
e instanceof wn && e.transformData.points.length === 0 && !t.isActive() && t.startPath(e);
|
|
@@ -936,10 +936,10 @@ class Yo {
|
|
|
936
936
|
const T = f.flipHorizontal ? -1 : 1, I = f.flipVertical ? -1 : 1;
|
|
937
937
|
E *= T, A *= I;
|
|
938
938
|
const g = -E / d, P = -A / m;
|
|
939
|
-
let
|
|
939
|
+
let z = p + g, D = b + P;
|
|
940
940
|
const w = 1 - x, ne = 1 - v;
|
|
941
|
-
return
|
|
942
|
-
cropX:
|
|
941
|
+
return z = Math.max(0, Math.min(w, z)), D = Math.max(0, Math.min(ne, D)), {
|
|
942
|
+
cropX: z,
|
|
943
943
|
cropY: D,
|
|
944
944
|
cropWidth: x,
|
|
945
945
|
cropHeight: v,
|
|
@@ -955,8 +955,8 @@ class Yo {
|
|
|
955
955
|
const l = s.startData.transformData, c = l.flipHorizontal, f = l.flipVertical, d = this._getCropResizeCursor(n, !!c, !!f), m = s.startData.rotation, p = s.startData.x, b = s.startData.y, x = ms.fromSnapshot(s.startData), { cos: v, sin: C } = x.getInverseCosSin(), R = c ? -1 : 1, E = f ? -1 : 1, A = i - p, T = a - b;
|
|
956
956
|
let I = A * v - T * C, g = A * C + T * v;
|
|
957
957
|
I *= R, g *= E;
|
|
958
|
-
const P = o.startX - p,
|
|
959
|
-
let D = P * v -
|
|
958
|
+
const P = o.startX - p, z = o.startY - b;
|
|
959
|
+
let D = P * v - z * C, w = P * C + z * v;
|
|
960
960
|
D *= R, w *= E;
|
|
961
961
|
const ne = I - D, V = g - w, N = l.cropX, u = l.cropY, j = l.cropWidth, G = l.cropHeight, te = l.width, ae = l.height, $ = ne / te, me = V / ae, ie = this._calculateNewCropValues(
|
|
962
962
|
n,
|
|
@@ -1080,17 +1080,17 @@ function $o({ selectedElement: e, ref: t }) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
},
|
|
1082
1082
|
[n, E, d, p]
|
|
1083
|
-
),
|
|
1083
|
+
), z = ft(() => {
|
|
1084
1084
|
if (!n || !E || !e) return null;
|
|
1085
1085
|
const w = Math.min(d, p), ne = Math.max(d, p);
|
|
1086
1086
|
return w === ne ? w === 0 ? js(e) ? e.getDefaultStyle() : {} : E.getStyleAt(Math.max(0, w - 1)) : E.getStyleAt(w);
|
|
1087
1087
|
}, [n, E, d, p, e]), D = ft(
|
|
1088
1088
|
(w) => {
|
|
1089
1089
|
if (!n || !E || !e) return;
|
|
1090
|
-
const ne =
|
|
1090
|
+
const ne = z(), u = !{ ...js(e) ? e.getDefaultStyle() : {}, ...ne }[w];
|
|
1091
1091
|
P({ [w]: u });
|
|
1092
1092
|
},
|
|
1093
|
-
[n, E, e,
|
|
1093
|
+
[n, E, e, z, P]
|
|
1094
1094
|
);
|
|
1095
1095
|
return nr(
|
|
1096
1096
|
t,
|
|
@@ -1102,9 +1102,9 @@ function $o({ selectedElement: e, ref: t }) {
|
|
|
1102
1102
|
D(w);
|
|
1103
1103
|
},
|
|
1104
1104
|
isEditingText: () => n,
|
|
1105
|
-
getSelectionStyle: () =>
|
|
1105
|
+
getSelectionStyle: () => z()
|
|
1106
1106
|
}),
|
|
1107
|
-
[P, D, n,
|
|
1107
|
+
[P, D, n, z]
|
|
1108
1108
|
), {
|
|
1109
1109
|
isEditing: n,
|
|
1110
1110
|
setIsEditing: s,
|
|
@@ -1133,7 +1133,7 @@ function $o({ selectedElement: e, ref: t }) {
|
|
|
1133
1133
|
currentFormattingStyle: T,
|
|
1134
1134
|
setCurrentFormattingStyle: I,
|
|
1135
1135
|
applyFormattingToSelection: P,
|
|
1136
|
-
getSelectionStyle:
|
|
1136
|
+
getSelectionStyle: z,
|
|
1137
1137
|
toggleFormattingProperty: D
|
|
1138
1138
|
};
|
|
1139
1139
|
}
|
|
@@ -1194,7 +1194,7 @@ function Fo({
|
|
|
1194
1194
|
};
|
|
1195
1195
|
return window.addEventListener("resize", V), () => window.removeEventListener("resize", V);
|
|
1196
1196
|
}, [e, t, f, d]);
|
|
1197
|
-
const C = Math.max(0.1, Math.min(1, s)), R = a ?? i, E = l ?? i, A = R !== void 0 && n > 0 ? R / n : 0, T = E !== void 0 && n > 0 ? E / n : 0, I = R !== void 0 ? x.width + A * 2 : x.width / C, g = E !== void 0 ? x.height + T * 2 : x.height / C, P = R !== void 0 ? A : (I - x.width) / 2,
|
|
1197
|
+
const C = Math.max(0.1, Math.min(1, s)), R = a ?? i, E = l ?? i, A = R !== void 0 && n > 0 ? R / n : 0, T = E !== void 0 && n > 0 ? E / n : 0, I = R !== void 0 ? x.width + A * 2 : x.width / C, g = E !== void 0 ? x.height + T * 2 : x.height / C, P = R !== void 0 ? A : (I - x.width) / 2, z = E !== void 0 ? T : (g - x.height) / 2, D = d ? P - d.x : P, w = d ? z - d.y : z, ne = n > 0 ? o / n : o;
|
|
1198
1198
|
return {
|
|
1199
1199
|
isTouchDevice: m,
|
|
1200
1200
|
canvasSize: x,
|
|
@@ -1407,18 +1407,18 @@ function Zo(e) {
|
|
|
1407
1407
|
let x = ks(m.boundaryStroke, c);
|
|
1408
1408
|
f && _s(p) ? p = "#ffffff" : !f && $s(p) && (p = "#000000"), f && _s(x) ? x = "#ffffff" : !f && $s(x) && (x = "#000000");
|
|
1409
1409
|
const C = n.some(
|
|
1410
|
-
(
|
|
1410
|
+
(z) => {
|
|
1411
1411
|
var D;
|
|
1412
|
-
return (((D = s == null ? void 0 : s[
|
|
1412
|
+
return (((D = s == null ? void 0 : s[z.id]) == null ? void 0 : D.zones) ?? []).some((w) => w.kind === "dieCut");
|
|
1413
1413
|
}
|
|
1414
1414
|
) && c ? Ko(c) : null;
|
|
1415
1415
|
t.save(), t.translate(o.x, o.y);
|
|
1416
|
-
for (const
|
|
1417
|
-
if (e.focusedPieceId != null &&
|
|
1416
|
+
for (const z of n) {
|
|
1417
|
+
if (e.focusedPieceId != null && z.id !== e.focusedPieceId)
|
|
1418
1418
|
continue;
|
|
1419
|
-
const D = s == null ? void 0 : s[
|
|
1420
|
-
t.save(), t.translate(
|
|
1421
|
-
const { width: V, height: N } = ur(
|
|
1419
|
+
const D = s == null ? void 0 : s[z.id], w = (D == null ? void 0 : D.zones) ?? [], ne = (D == null ? void 0 : D.labels) ?? [];
|
|
1420
|
+
t.save(), t.translate(z.x, z.y), ro(t, z);
|
|
1421
|
+
const { width: V, height: N } = ur(z), u = qo(D, V, N), j = jo(D, z, V, N), G = !0, te = Math.max(0, (D == null ? void 0 : D.outerRadius) ?? 0), ae = D != null && D.boundary && D.boundary.kind === "path" ? D.boundary : null, $ = ae ?? (te > 0 ? {
|
|
1422
1422
|
kind: "roundedRect",
|
|
1423
1423
|
x: 0,
|
|
1424
1424
|
y: 0,
|
|
@@ -1577,8 +1577,8 @@ function ai(e) {
|
|
|
1577
1577
|
Te && (Se = Te);
|
|
1578
1578
|
}
|
|
1579
1579
|
if (Se) {
|
|
1580
|
-
const Te = Se.getVisualBoundingBox(),
|
|
1581
|
-
t.save(), Se.rotation !== 0 && (t.translate(
|
|
1580
|
+
const Te = Se.getVisualBoundingBox(), ze = Se.getRotationAnchor();
|
|
1581
|
+
t.save(), Se.rotation !== 0 && (t.translate(ze.x, ze.y), t.rotate(-Se.rotation * Math.PI / 180), t.translate(-ze.x, -ze.y)), t.strokeStyle = Cn(), t.lineWidth = _n(d), t.strokeRect(Te.x, Te.y, Te.width, Te.height), t.restore();
|
|
1582
1582
|
}
|
|
1583
1583
|
});
|
|
1584
1584
|
let x = m.map((be) => s.find((Se) => Se.id === be)).filter((be) => be !== void 0);
|
|
@@ -1593,14 +1593,14 @@ function ai(e) {
|
|
|
1593
1593
|
{ x: Se.x + Se.width, y: Se.y + Se.height }
|
|
1594
1594
|
];
|
|
1595
1595
|
if (be.rotation !== 0) {
|
|
1596
|
-
const
|
|
1596
|
+
const ze = be.getRotationAnchor(), Ne = -be.rotation * Math.PI / 180, $e = Math.cos(Ne), at = Math.sin(Ne);
|
|
1597
1597
|
Te.forEach((pt) => {
|
|
1598
|
-
const ct = pt.x -
|
|
1599
|
-
pt.x =
|
|
1598
|
+
const ct = pt.x - ze.x, Pt = pt.y - ze.y;
|
|
1599
|
+
pt.x = ze.x + (ct * $e - Pt * at), pt.y = ze.y + (ct * at + Pt * $e);
|
|
1600
1600
|
});
|
|
1601
1601
|
}
|
|
1602
|
-
Te.forEach((
|
|
1603
|
-
v = Math.min(v,
|
|
1602
|
+
Te.forEach((ze) => {
|
|
1603
|
+
v = Math.min(v, ze.x), C = Math.min(C, ze.y), R = Math.max(R, ze.x), E = Math.max(E, ze.y);
|
|
1604
1604
|
});
|
|
1605
1605
|
});
|
|
1606
1606
|
const A = R - v, T = E - C, I = (v + R) / 2, g = (C + E) / 2;
|
|
@@ -1626,8 +1626,8 @@ function ai(e) {
|
|
|
1626
1626
|
const w = l && i.getMode() === "rotate" ? P.rotation + c : P.rotation, ne = P.width, V = P.height, N = P.centerX, u = P.centerY, j = N - ne / 2, G = u - V / 2, te = N + ne / 2, ae = u + V / 2;
|
|
1627
1627
|
let $ = N, me = ae + Zr;
|
|
1628
1628
|
if (w !== 0) {
|
|
1629
|
-
const be = -w * Math.PI / 180, Se = Math.cos(be), Te = Math.sin(be),
|
|
1630
|
-
$ = N + (
|
|
1629
|
+
const be = -w * Math.PI / 180, Se = Math.cos(be), Te = Math.sin(be), ze = $ - N, Ne = me - u;
|
|
1630
|
+
$ = N + (ze * Se - Ne * Te), me = u + (ze * Te + Ne * Se);
|
|
1631
1631
|
}
|
|
1632
1632
|
const ie = {
|
|
1633
1633
|
minX: j,
|
|
@@ -1683,8 +1683,8 @@ function ci(e, t) {
|
|
|
1683
1683
|
return;
|
|
1684
1684
|
let I = T.x, g = T.y;
|
|
1685
1685
|
if (d !== 0) {
|
|
1686
|
-
const P = -d * Math.PI / 180,
|
|
1687
|
-
I = a + (w *
|
|
1686
|
+
const P = -d * Math.PI / 180, z = Math.cos(P), D = Math.sin(P), w = T.x - a, ne = T.y - l;
|
|
1687
|
+
I = a + (w * z - ne * D), g = l + (w * D + ne * z);
|
|
1688
1688
|
}
|
|
1689
1689
|
e.save(), e.beginPath(), e.arc(I, g, v, 0, Math.PI * 2), e.fillStyle = "#fff", e.fill(), e.strokeStyle = Cn(), e.lineWidth = R && E && T.anchor === E ? _n(x) * 1.25 : _n(x), e.stroke(), e.restore();
|
|
1690
1690
|
}), R || io(e, m, p, x, Cn()), b.getMode() === "resize" && li(e, a, i, c, f);
|
|
@@ -1865,7 +1865,7 @@ function mi(e, t, n) {
|
|
|
1865
1865
|
effectiveViewPadding: I,
|
|
1866
1866
|
showRotationHandle: g,
|
|
1867
1867
|
isRotating: P,
|
|
1868
|
-
currentRotation:
|
|
1868
|
+
currentRotation: z,
|
|
1869
1869
|
hoverState: D,
|
|
1870
1870
|
isEditing: w,
|
|
1871
1871
|
editText: ne,
|
|
@@ -1882,14 +1882,14 @@ function mi(e, t, n) {
|
|
|
1882
1882
|
MULTI_CLICK_DEBOUNCE: be,
|
|
1883
1883
|
snapGuides: Se,
|
|
1884
1884
|
spacingIndicators: Te,
|
|
1885
|
-
isAltKeyPressed:
|
|
1885
|
+
isAltKeyPressed: ze,
|
|
1886
1886
|
multiSelection: Ne,
|
|
1887
1887
|
multiSelectionOBBRef: $e,
|
|
1888
1888
|
multiSelectionGroupBoundsRef: at,
|
|
1889
1889
|
isMarqueeSelecting: pt,
|
|
1890
1890
|
marqueeStart: ct,
|
|
1891
1891
|
marqueeEnd: Pt,
|
|
1892
|
-
marqueePreviewSelection:
|
|
1892
|
+
marqueePreviewSelection: Ot,
|
|
1893
1893
|
penTool: At,
|
|
1894
1894
|
hideHandles: We,
|
|
1895
1895
|
pieceGuides: Ee
|
|
@@ -1990,7 +1990,7 @@ function mi(e, t, n) {
|
|
|
1990
1990
|
selectedId: f,
|
|
1991
1991
|
selectedElement: gt || null,
|
|
1992
1992
|
transformHandles: b,
|
|
1993
|
-
currentRotation:
|
|
1993
|
+
currentRotation: z,
|
|
1994
1994
|
isRotating: P,
|
|
1995
1995
|
hoverState: D,
|
|
1996
1996
|
isEditing: w,
|
|
@@ -1998,7 +1998,7 @@ function mi(e, t, n) {
|
|
|
1998
1998
|
snapGuides: Se,
|
|
1999
1999
|
spacingIndicators: Te,
|
|
2000
2000
|
hideHandles: Nt,
|
|
2001
|
-
isAltKeyPressed:
|
|
2001
|
+
isAltKeyPressed: ze,
|
|
2002
2002
|
artboardBackgroundColor: _ == null ? void 0 : _.backgroundColor,
|
|
2003
2003
|
distressTexture: _ == null ? void 0 : _.distressTexture,
|
|
2004
2004
|
imageMask: _ == null ? void 0 : _.imageMask,
|
|
@@ -2097,13 +2097,13 @@ function mi(e, t, n) {
|
|
|
2097
2097
|
selectedElement: gt || null,
|
|
2098
2098
|
transformHandles: b,
|
|
2099
2099
|
stateMachine: x,
|
|
2100
|
-
currentRotation:
|
|
2100
|
+
currentRotation: z,
|
|
2101
2101
|
isRotating: P,
|
|
2102
2102
|
hoverState: D,
|
|
2103
2103
|
selectedId: f,
|
|
2104
2104
|
hideHandles: Nt,
|
|
2105
2105
|
isEditing: w,
|
|
2106
|
-
isAltKeyPressed:
|
|
2106
|
+
isAltKeyPressed: ze,
|
|
2107
2107
|
artboardBackgroundColor: _.backgroundColor,
|
|
2108
2108
|
// Hover ring is clipped to the visible artboard / piece bounds
|
|
2109
2109
|
// so it doesn't paint into the overflow region. Uses the piece-
|
|
@@ -2122,7 +2122,7 @@ function mi(e, t, n) {
|
|
|
2122
2122
|
zoom: A,
|
|
2123
2123
|
paddingOffset: { x: R, y: E }
|
|
2124
2124
|
});
|
|
2125
|
-
const tn = pt ?
|
|
2125
|
+
const tn = pt ? Ot : Ne, Yt = new Set(Dt.map((Ke) => Ke.id)), { updatedOBB: wt, groupBounds: Xt } = ai({
|
|
2126
2126
|
ctx: se,
|
|
2127
2127
|
displaySelection: tn,
|
|
2128
2128
|
elements: o,
|
|
@@ -2130,7 +2130,7 @@ function mi(e, t, n) {
|
|
|
2130
2130
|
stateMachine: x,
|
|
2131
2131
|
multiSelectionOBB: $e.current,
|
|
2132
2132
|
isRotating: P,
|
|
2133
|
-
currentRotation:
|
|
2133
|
+
currentRotation: z,
|
|
2134
2134
|
isMarqueeSelecting: pt,
|
|
2135
2135
|
zoom: A
|
|
2136
2136
|
});
|
|
@@ -2474,7 +2474,7 @@ function Pi(e) {
|
|
|
2474
2474
|
CLICK_DEDUP_THRESHOLD: I,
|
|
2475
2475
|
isEditing: g,
|
|
2476
2476
|
editText: P,
|
|
2477
|
-
isTouchDevice:
|
|
2477
|
+
isTouchDevice: z,
|
|
2478
2478
|
selectionStart: D,
|
|
2479
2479
|
selectionEnd: w,
|
|
2480
2480
|
isRotating: ne,
|
|
@@ -2491,14 +2491,14 @@ function Pi(e) {
|
|
|
2491
2491
|
spacingIndicators: be,
|
|
2492
2492
|
focusedPieceRect: Se,
|
|
2493
2493
|
setCursorPosition: Te,
|
|
2494
|
-
setSelectionStart:
|
|
2494
|
+
setSelectionStart: ze,
|
|
2495
2495
|
setSelectionEnd: Ne,
|
|
2496
2496
|
setIsRotating: $e,
|
|
2497
2497
|
setRotationStartAngle: at,
|
|
2498
2498
|
setCurrentRotation: pt,
|
|
2499
2499
|
setRotatingElementVersion: ct,
|
|
2500
2500
|
setIsAltKeyPressed: Pt,
|
|
2501
|
-
setSnapGuides:
|
|
2501
|
+
setSnapGuides: Ot,
|
|
2502
2502
|
setSpacingIndicators: At,
|
|
2503
2503
|
setHandlesVersion: We,
|
|
2504
2504
|
setHoverState: Ee,
|
|
@@ -2533,32 +2533,32 @@ function Pi(e) {
|
|
|
2533
2533
|
Ht.current = nt;
|
|
2534
2534
|
const ve = we(xt);
|
|
2535
2535
|
ve.current = xt, Ie(() => {
|
|
2536
|
-
const
|
|
2537
|
-
if (!
|
|
2536
|
+
const O = t.current;
|
|
2537
|
+
if (!O) return;
|
|
2538
2538
|
const fe = () => {
|
|
2539
|
-
Ue.current =
|
|
2539
|
+
Ue.current = O.getBoundingClientRect();
|
|
2540
2540
|
};
|
|
2541
2541
|
return fe(), window.addEventListener("scroll", fe, { passive: !0, capture: !0 }), window.addEventListener("resize", fe, { passive: !0 }), () => {
|
|
2542
2542
|
window.removeEventListener("scroll", fe, { capture: !0 }), window.removeEventListener("resize", fe);
|
|
2543
2543
|
};
|
|
2544
2544
|
}, [t]), Ie(() => {
|
|
2545
|
-
const
|
|
2546
|
-
|
|
2545
|
+
const O = t.current;
|
|
2546
|
+
O && (Ue.current = O.getBoundingClientRect());
|
|
2547
2547
|
}, [$, t]);
|
|
2548
2548
|
const as = ft(
|
|
2549
|
-
(
|
|
2549
|
+
(O) => {
|
|
2550
2550
|
var q, pe, ke, ee, J;
|
|
2551
|
-
if (
|
|
2551
|
+
if (O.button === 2) return;
|
|
2552
2552
|
const fe = t.current;
|
|
2553
2553
|
if (!fe) return;
|
|
2554
2554
|
const dt = fe.getBoundingClientRect();
|
|
2555
2555
|
Ue.current = dt;
|
|
2556
|
-
const W = (
|
|
2557
|
-
Ae.current.size === 0 && (ge.current = (u == null ? void 0 : u.id) ?? null), Ae.current.set(
|
|
2556
|
+
const W = (O.clientX - dt.left) / $ - me, Z = (O.clientY - dt.top) / $ - ie;
|
|
2557
|
+
Ae.current.size === 0 && (ge.current = (u == null ? void 0 : u.id) ?? null), Ae.current.set(O.pointerId, {
|
|
2558
2558
|
x: W,
|
|
2559
2559
|
y: Z,
|
|
2560
|
-
clientX:
|
|
2561
|
-
clientY:
|
|
2560
|
+
clientX: O.clientX,
|
|
2561
|
+
clientY: O.clientY
|
|
2562
2562
|
});
|
|
2563
2563
|
const et = g || u instanceof Lt && u.isCropping || H.isActive();
|
|
2564
2564
|
if (Ae.current.size === 2 && !et) {
|
|
@@ -2588,10 +2588,10 @@ function Pi(e) {
|
|
|
2588
2588
|
containerRect: { left: bt.left, top: bt.top }
|
|
2589
2589
|
};
|
|
2590
2590
|
try {
|
|
2591
|
-
fe.setPointerCapture(
|
|
2591
|
+
fe.setPointerCapture(O.pointerId);
|
|
2592
2592
|
} catch {
|
|
2593
2593
|
}
|
|
2594
|
-
|
|
2594
|
+
O.preventDefault();
|
|
2595
2595
|
return;
|
|
2596
2596
|
}
|
|
2597
2597
|
}
|
|
@@ -2611,33 +2611,33 @@ function Pi(e) {
|
|
|
2611
2611
|
const X = Ae.current.get(k[0]), M = Ae.current.get(k[1]);
|
|
2612
2612
|
Be.current = null, Je.current = null, Fe.current = null, ue.current = u.clone(), h.startPinch(u, X, M);
|
|
2613
2613
|
try {
|
|
2614
|
-
fe.setPointerCapture(
|
|
2614
|
+
fe.setPointerCapture(O.pointerId);
|
|
2615
2615
|
} catch {
|
|
2616
2616
|
}
|
|
2617
|
-
|
|
2617
|
+
O.preventDefault();
|
|
2618
2618
|
return;
|
|
2619
2619
|
}
|
|
2620
2620
|
if (g && u instanceof Qe) {
|
|
2621
|
-
if (
|
|
2621
|
+
if (z && D !== w) {
|
|
2622
2622
|
const k = m.current;
|
|
2623
2623
|
if (k.start || k.end) {
|
|
2624
2624
|
const X = en.toRadiansInverse(u.rotation), M = u.getRotationAnchor(), F = W - M.x, ce = Z - M.y, oe = Math.cos(X), Me = Math.sin(X), Le = F * oe - ce * Me, it = F * Me + ce * oe, bt = Le, Bt = it, St = 44 / $;
|
|
2625
2625
|
if (k.start && Math.sqrt(
|
|
2626
2626
|
Math.pow(bt - k.start.center.x, 2) + Math.pow(Bt - k.start.center.y, 2)
|
|
2627
2627
|
) <= St) {
|
|
2628
|
-
|
|
2628
|
+
O.preventDefault(), d.current = "start", (pe = n.current) == null || pe.focus();
|
|
2629
2629
|
return;
|
|
2630
2630
|
}
|
|
2631
2631
|
if (k.end && Math.sqrt(
|
|
2632
2632
|
Math.pow(bt - k.end.center.x, 2) + Math.pow(Bt - k.end.center.y, 2)
|
|
2633
2633
|
) <= St) {
|
|
2634
|
-
|
|
2634
|
+
O.preventDefault(), d.current = "end", (ke = n.current) == null || ke.focus();
|
|
2635
2635
|
return;
|
|
2636
2636
|
}
|
|
2637
2637
|
}
|
|
2638
2638
|
}
|
|
2639
2639
|
if (u.hitTest(W, Z)) {
|
|
2640
|
-
|
|
2640
|
+
O.preventDefault(), s.current = !0;
|
|
2641
2641
|
const k = u.getVisualBoundingBox(), X = en.toRadiansInverse(u.rotation), M = u.getRotationAnchor(), F = W - M.x, ce = Z - M.y, oe = Math.cos(X), Me = Math.sin(X), Le = F * oe - ce * Me, it = F * Me + ce * oe, bt = Le + k.width / 2, Bt = it + k.height / 2, St = Sn(u, { x: bt, y: Bt }), Et = Date.now();
|
|
2642
2642
|
if (Et - a.current < I) {
|
|
2643
2643
|
(ee = n.current) == null || ee.focus();
|
|
@@ -2646,20 +2646,20 @@ function Pi(e) {
|
|
|
2646
2646
|
a.current = Et, Et - l.current >= T && (c.current = null), Et - o.current < A ? i.current += 1 : i.current = 1, o.current = Et;
|
|
2647
2647
|
const ut = P;
|
|
2648
2648
|
if (i.current >= 3)
|
|
2649
|
-
|
|
2649
|
+
O.preventDefault(), l.current = Et, c.current = { start: 0, end: ut.length, cursor: ut.length }, f.current = !0, i.current = 0, Te(ut.length), ze(0), Ne(ut.length), n.current && (n.current.focus(), n.current.setSelectionRange(0, ut.length));
|
|
2650
2650
|
else if (i.current === 2) {
|
|
2651
|
-
|
|
2651
|
+
O.preventDefault(), l.current = Et, f.current = !0;
|
|
2652
2652
|
const kt = yr(ut, St);
|
|
2653
|
-
c.current = { start: kt.start, end: kt.end, cursor: kt.end }, Te(kt.end),
|
|
2653
|
+
c.current = { start: kt.start, end: kt.end, cursor: kt.end }, Te(kt.end), ze(kt.start), Ne(kt.end), n.current && (n.current.focus(), n.current.setSelectionRange(kt.start, kt.end));
|
|
2654
2654
|
} else
|
|
2655
|
-
c.current = null, Te(St),
|
|
2655
|
+
c.current = null, Te(St), ze(St), Ne(St), n.current && (n.current.focus(), n.current.setSelectionRange(St, St)), f.current = !1;
|
|
2656
2656
|
return;
|
|
2657
2657
|
}
|
|
2658
2658
|
c.current = null, (J = n.current) == null || J.blur();
|
|
2659
2659
|
return;
|
|
2660
2660
|
}
|
|
2661
2661
|
if (g) return;
|
|
2662
|
-
if (
|
|
2662
|
+
if (O.target.setPointerCapture(O.pointerId), H.isActive() && u instanceof wn) {
|
|
2663
2663
|
const k = W - u.x, X = Z - u.y;
|
|
2664
2664
|
if (H.canClosePath(k, X, 15)) {
|
|
2665
2665
|
H.startClosing(k, X), H.startDraggingHandle(), We((M) => M + 1);
|
|
@@ -2823,7 +2823,7 @@ function Pi(e) {
|
|
|
2823
2823
|
Zs({ updateActiveChild: Ze, selectedElement: u || null, transformHandles: U, setHandlesVersion: We, zoom: $ });
|
|
2824
2824
|
return;
|
|
2825
2825
|
}
|
|
2826
|
-
if (!
|
|
2826
|
+
if (!O.shiftKey) {
|
|
2827
2827
|
const k = gt(), X = [];
|
|
2828
2828
|
for (let F = k.length - 1; F >= 0; F--) {
|
|
2829
2829
|
const ce = k[F];
|
|
@@ -2839,35 +2839,35 @@ function Pi(e) {
|
|
|
2839
2839
|
elementId: X[0].id,
|
|
2840
2840
|
x: W,
|
|
2841
2841
|
y: Z,
|
|
2842
|
-
shiftKey:
|
|
2842
|
+
shiftKey: O.shiftKey
|
|
2843
2843
|
} : F + 1 < X.length ? M = {
|
|
2844
2844
|
kind: "select-element",
|
|
2845
2845
|
elementId: X[F + 1].id,
|
|
2846
2846
|
x: W,
|
|
2847
2847
|
y: Z,
|
|
2848
|
-
shiftKey:
|
|
2848
|
+
shiftKey: O.shiftKey
|
|
2849
2849
|
} : M = { kind: "deselect" };
|
|
2850
2850
|
}
|
|
2851
2851
|
Fe.current = {
|
|
2852
|
-
pointerId:
|
|
2853
|
-
startClientX:
|
|
2854
|
-
startClientY:
|
|
2852
|
+
pointerId: O.pointerId,
|
|
2853
|
+
startClientX: O.clientX,
|
|
2854
|
+
startClientY: O.clientY,
|
|
2855
2855
|
startPanOffset: { ...ve.current },
|
|
2856
2856
|
movedPastThreshold: !1,
|
|
2857
2857
|
pendingTap: M
|
|
2858
2858
|
};
|
|
2859
2859
|
try {
|
|
2860
|
-
fe.setPointerCapture(
|
|
2860
|
+
fe.setPointerCapture(O.pointerId);
|
|
2861
2861
|
} catch {
|
|
2862
2862
|
}
|
|
2863
|
-
|
|
2863
|
+
O.preventDefault();
|
|
2864
2864
|
return;
|
|
2865
2865
|
}
|
|
2866
2866
|
const xe = gt();
|
|
2867
2867
|
if (Ti({
|
|
2868
2868
|
x: W,
|
|
2869
2869
|
y: Z,
|
|
2870
|
-
shiftKey:
|
|
2870
|
+
shiftKey: O.shiftKey,
|
|
2871
2871
|
activeArtboardElements: xe,
|
|
2872
2872
|
selectedElement: u || null,
|
|
2873
2873
|
multiSelection: te,
|
|
@@ -2878,22 +2878,22 @@ function Pi(e) {
|
|
|
2878
2878
|
setHoverState: Ee,
|
|
2879
2879
|
forceUpdate: se
|
|
2880
2880
|
})) return;
|
|
2881
|
-
const L = Xr.shouldProtectClick(), Q = Br(
|
|
2881
|
+
const L = Xr.shouldProtectClick(), Q = Br(O.target);
|
|
2882
2882
|
if (!L && !Q)
|
|
2883
2883
|
if (Ht.current > 1.001) {
|
|
2884
2884
|
Fe.current = {
|
|
2885
|
-
pointerId:
|
|
2886
|
-
startClientX:
|
|
2887
|
-
startClientY:
|
|
2885
|
+
pointerId: O.pointerId,
|
|
2886
|
+
startClientX: O.clientX,
|
|
2887
|
+
startClientY: O.clientY,
|
|
2888
2888
|
startPanOffset: { ...ve.current },
|
|
2889
2889
|
movedPastThreshold: !1,
|
|
2890
2890
|
pendingTap: null
|
|
2891
2891
|
};
|
|
2892
2892
|
try {
|
|
2893
|
-
fe.setPointerCapture(
|
|
2893
|
+
fe.setPointerCapture(O.pointerId);
|
|
2894
2894
|
} catch {
|
|
2895
2895
|
}
|
|
2896
|
-
|
|
2896
|
+
O.preventDefault();
|
|
2897
2897
|
} else
|
|
2898
2898
|
Xe(null), Y([]), Dt(W, Z);
|
|
2899
2899
|
},
|
|
@@ -2912,7 +2912,7 @@ function Pi(e) {
|
|
|
2912
2912
|
We,
|
|
2913
2913
|
$,
|
|
2914
2914
|
Te,
|
|
2915
|
-
|
|
2915
|
+
ze,
|
|
2916
2916
|
Ne,
|
|
2917
2917
|
// Canvas-zoom pinch entry uses these setters / refs.
|
|
2918
2918
|
t,
|
|
@@ -2920,17 +2920,17 @@ function Pi(e) {
|
|
|
2920
2920
|
Se
|
|
2921
2921
|
]
|
|
2922
2922
|
), An = ft(
|
|
2923
|
-
(
|
|
2923
|
+
(O) => {
|
|
2924
2924
|
var et;
|
|
2925
|
-
if (
|
|
2925
|
+
if (O.buttons === 2) return;
|
|
2926
2926
|
const fe = t.current;
|
|
2927
2927
|
if (!fe) return;
|
|
2928
|
-
const dt = Ue.current ?? fe.getBoundingClientRect(), W = (
|
|
2929
|
-
if (p.current = { x: W, y: Z }, Ae.current.has(
|
|
2928
|
+
const dt = Ue.current ?? fe.getBoundingClientRect(), W = (O.clientX - dt.left) / $ - me, Z = (O.clientY - dt.top) / $ - ie;
|
|
2929
|
+
if (p.current = { x: W, y: Z }, Ae.current.has(O.pointerId) && Ae.current.set(O.pointerId, {
|
|
2930
2930
|
x: W,
|
|
2931
2931
|
y: Z,
|
|
2932
|
-
clientX:
|
|
2933
|
-
clientY:
|
|
2932
|
+
clientX: O.clientX,
|
|
2933
|
+
clientY: O.clientY
|
|
2934
2934
|
}), Ge.current) {
|
|
2935
2935
|
const B = Ge.current, xe = Ae.current.get(B.pointerA), S = Ae.current.get(B.pointerB);
|
|
2936
2936
|
if (xe && S) {
|
|
@@ -2955,8 +2955,8 @@ function Pi(e) {
|
|
|
2955
2955
|
}
|
|
2956
2956
|
return;
|
|
2957
2957
|
}
|
|
2958
|
-
if (Fe.current && Fe.current.pointerId ===
|
|
2959
|
-
const B = Fe.current, xe =
|
|
2958
|
+
if (Fe.current && Fe.current.pointerId === O.pointerId) {
|
|
2959
|
+
const B = Fe.current, xe = O.clientX - B.startClientX, S = O.clientY - B.startClientY;
|
|
2960
2960
|
if (!B.movedPastThreshold)
|
|
2961
2961
|
if (Math.hypot(xe, S) > 5)
|
|
2962
2962
|
B.movedPastThreshold = !0, B.pendingTap = null;
|
|
@@ -2987,7 +2987,7 @@ function Pi(e) {
|
|
|
2987
2987
|
)
|
|
2988
2988
|
);
|
|
2989
2989
|
}
|
|
2990
|
-
|
|
2990
|
+
O.preventDefault();
|
|
2991
2991
|
return;
|
|
2992
2992
|
}
|
|
2993
2993
|
if (d.current && u instanceof Qe) {
|
|
@@ -2995,7 +2995,7 @@ function Pi(e) {
|
|
|
2995
2995
|
let k = 0;
|
|
2996
2996
|
d.current === "start" && (J != null && J.start) ? k = J.start.textEdge.y - J.start.center.y : d.current === "end" && (J != null && J.end) && (k = J.end.textEdge.y - J.end.center.y);
|
|
2997
2997
|
const X = ke + B.width / 2, M = ee + k + B.height / 2, F = Sn(u, { x: X, y: M });
|
|
2998
|
-
if (d.current === "start" ? F <= w ? (
|
|
2998
|
+
if (d.current === "start" ? F <= w ? (ze(F), Te(F)) : (ze(w), Ne(F), Te(F), d.current = "end") : F >= D ? (Ne(F), Te(F)) : (Ne(D), ze(F), Te(F), d.current = "start"), n.current) {
|
|
2999
2999
|
const ce = Math.min(D, w), oe = Math.max(D, w);
|
|
3000
3000
|
n.current.setSelectionRange(ce, oe);
|
|
3001
3001
|
}
|
|
@@ -3005,7 +3005,7 @@ function Pi(e) {
|
|
|
3005
3005
|
H.isDraggingHandle() ? (H.updateHandle(W - u.x, Z - u.y), We((B) => B + 1)) : (H.setPreviewPoint(W - u.x, Z - u.y), We((B) => B + 1));
|
|
3006
3006
|
return;
|
|
3007
3007
|
}
|
|
3008
|
-
if (
|
|
3008
|
+
if (O.altKey !== N && Pt(O.altKey), V) {
|
|
3009
3009
|
Nt(W, Z, G);
|
|
3010
3010
|
return;
|
|
3011
3011
|
}
|
|
@@ -3015,7 +3015,7 @@ function Pi(e) {
|
|
|
3015
3015
|
const { dx: xe, dy: S } = Vs(
|
|
3016
3016
|
W - B.startX,
|
|
3017
3017
|
Z - B.startY,
|
|
3018
|
-
{ shift:
|
|
3018
|
+
{ shift: O.shiftKey }
|
|
3019
3019
|
);
|
|
3020
3020
|
B.currentElements || (B.currentElements = /* @__PURE__ */ new Map());
|
|
3021
3021
|
const L = [];
|
|
@@ -3053,7 +3053,7 @@ function Pi(e) {
|
|
|
3053
3053
|
S.forEach((ee) => {
|
|
3054
3054
|
ee instanceof Re ? L.push(...ee.children) : L.push(ee);
|
|
3055
3055
|
});
|
|
3056
|
-
const Q = { shift:
|
|
3056
|
+
const Q = { shift: O.shiftKey };
|
|
3057
3057
|
let q = h.updateDrag(W, Z, L, Q);
|
|
3058
3058
|
const pe = xe && u instanceof Re ? u.children.find((ee) => ee.id === xe.childId) : u;
|
|
3059
3059
|
if (pe && (q = he.snapToSpacing(q, pe, L), Q.shift)) {
|
|
@@ -3084,7 +3084,7 @@ function Pi(e) {
|
|
|
3084
3084
|
const k = h.getContext();
|
|
3085
3085
|
k._cachedElement || (k._cachedElement = {}), k._cachedElement[J.id] = J;
|
|
3086
3086
|
}
|
|
3087
|
-
We((ee) => ee + 1),
|
|
3087
|
+
We((ee) => ee + 1), Ot(re.getGuides());
|
|
3088
3088
|
let ke;
|
|
3089
3089
|
if (xe && u instanceof Re)
|
|
3090
3090
|
ke = u.children.find((ee) => ee.id === xe.childId);
|
|
@@ -3190,19 +3190,19 @@ function Pi(e) {
|
|
|
3190
3190
|
allElements: ke,
|
|
3191
3191
|
snapSystem: re,
|
|
3192
3192
|
// Read per move event: Shift = aspect-lock to gesture-start ratio
|
|
3193
|
-
modifiers: { shift:
|
|
3193
|
+
modifiers: { shift: O.shiftKey }
|
|
3194
3194
|
}).element;
|
|
3195
3195
|
if (h.updateResizeElement(J), pe) {
|
|
3196
3196
|
const k = u.clone(), X = k.children.findIndex((M) => M.id === q.childId);
|
|
3197
3197
|
X >= 0 && (k.children[X] = J, k.updateBoundsFromChildren(!0)), Pe(k), X >= 0 && (Ze(k.children[X]), U.update(k.children[X], $));
|
|
3198
3198
|
} else
|
|
3199
3199
|
Pe(J), U.update(J, $);
|
|
3200
|
-
We((k) => k + 1),
|
|
3200
|
+
We((k) => k + 1), Ot(re.getGuides());
|
|
3201
3201
|
} else if (h.getMode() === "rotate") {
|
|
3202
3202
|
fe.style.cursor = "grabbing", ne || ($e(!0), _ == null || _(!0));
|
|
3203
3203
|
const B = h._multiSelectionRotationContext;
|
|
3204
3204
|
if (B && te.length > 0) {
|
|
3205
|
-
const J = B.startBounds, k = h.updateRotate(W, Z, J.centerX, J.centerY, { shift:
|
|
3205
|
+
const J = B.startBounds, k = h.updateRotate(W, Z, J.centerX, J.centerY, { shift: O.shiftKey });
|
|
3206
3206
|
pt(k), B.elementsStartData.forEach((X) => {
|
|
3207
3207
|
const M = X.element, F = X.startData, ce = ms.rotatePointAroundAnchor(
|
|
3208
3208
|
F.x,
|
|
@@ -3217,7 +3217,7 @@ function Pi(e) {
|
|
|
3217
3217
|
}
|
|
3218
3218
|
const xe = h._activeChildContext, S = xe ? j : u;
|
|
3219
3219
|
if (!S) return;
|
|
3220
|
-
const L = S.getBoundingBox(), Q = Es(L), q = Q.x, pe = Q.y, ke = h.updateRotate(W, Z, Q.x, Q.y, { shift:
|
|
3220
|
+
const L = S.getBoundingBox(), Q = Es(L), q = Q.x, pe = Q.y, ke = h.updateRotate(W, Z, Q.x, Q.y, { shift: O.shiftKey }), ee = S.clone();
|
|
3221
3221
|
if (ee.setRotation(ke), !(ee instanceof Re)) {
|
|
3222
3222
|
const J = ee.getBoundingBox(), k = Es(J), X = q - k.x, M = pe - k.y;
|
|
3223
3223
|
ee.x += X, ee.y += M;
|
|
@@ -3271,7 +3271,7 @@ function Pi(e) {
|
|
|
3271
3271
|
return;
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
if (
|
|
3274
|
+
if (O.altKey) {
|
|
3275
3275
|
let S = null;
|
|
3276
3276
|
const L = gt();
|
|
3277
3277
|
for (let Q = L.length - 1; Q >= 0; Q--) {
|
|
@@ -3393,21 +3393,21 @@ function Pi(e) {
|
|
|
3393
3393
|
st,
|
|
3394
3394
|
yt
|
|
3395
3395
|
]
|
|
3396
|
-
), En = ft((
|
|
3396
|
+
), En = ft((O) => {
|
|
3397
3397
|
var W, Z, et, B, xe;
|
|
3398
|
-
if (
|
|
3399
|
-
if (
|
|
3398
|
+
if (O.button === 2) return;
|
|
3399
|
+
if (O.target.releasePointerCapture(O.pointerId), Ae.current.delete(O.pointerId), Ge.current && (O.pointerId === Ge.current.pointerA || O.pointerId === Ge.current.pointerB)) {
|
|
3400
3400
|
Ge.current = null, Ae.current.clear();
|
|
3401
3401
|
return;
|
|
3402
3402
|
}
|
|
3403
|
-
if (Fe.current && Fe.current.pointerId ===
|
|
3403
|
+
if (Fe.current && Fe.current.pointerId === O.pointerId) {
|
|
3404
3404
|
const S = Fe.current;
|
|
3405
3405
|
Fe.current = null, S.movedPastThreshold || (((W = S.pendingTap) == null ? void 0 : W.kind) === "select-element" ? (Xe(S.pendingTap.elementId), Y([])) : ((Z = S.pendingTap) == null ? void 0 : Z.kind) === "deselect" && (Xe(null), Y([])));
|
|
3406
3406
|
return;
|
|
3407
3407
|
}
|
|
3408
3408
|
if (h.getMode() === "pinch" && K.current) {
|
|
3409
3409
|
const { a: S, b: L } = K.current;
|
|
3410
|
-
if (
|
|
3410
|
+
if (O.pointerId === S || O.pointerId === L) {
|
|
3411
3411
|
const q = h.getContext().element, pe = ue.current ?? void 0;
|
|
3412
3412
|
q && Ve(
|
|
3413
3413
|
pe,
|
|
@@ -3434,7 +3434,7 @@ function Pi(e) {
|
|
|
3434
3434
|
q && (L.x !== q.x || L.y !== q.y || L instanceof Re && q instanceof Re && JSON.stringify(L.children.map((ke) => ({ x: ke.x, y: ke.y }))) !== JSON.stringify(q.children.map((ke) => ({ x: ke.x, y: ke.y })))) && Ve(L, q);
|
|
3435
3435
|
}), b.current = null);
|
|
3436
3436
|
const fe = t.current;
|
|
3437
|
-
if (fe && (fe.style.cursor = "default"), re.clearGuides(), re.clearSnapState(),
|
|
3437
|
+
if (fe && (fe.style.cursor = "default"), re.clearGuides(), re.clearSnapState(), Ot([]), he.clearIndicators(), At([]), h._cropGroupContext && delete h._cropGroupContext, h._activeChildContext) {
|
|
3438
3438
|
if (j && u instanceof Re) {
|
|
3439
3439
|
const S = h.getContext(), q = (S._cachedElement && S._cachedElement[u.id] || u).children.find((pe) => pe.id === j.id);
|
|
3440
3440
|
q && (Ze(q), U.update(q, $));
|
|
@@ -3484,8 +3484,8 @@ function Pi(e) {
|
|
|
3484
3484
|
}
|
|
3485
3485
|
if (Be.current) {
|
|
3486
3486
|
const S = Be.current, L = Je.current, Q = G.find((ee) => ee.id === S), q = (et = b.current) == null ? void 0 : et.get(S), pe = !!(Q && q && (Math.abs(Q.x - q.x) > 0.1 || Math.abs(Q.y - q.y) > 0.1)), ke = L ? Math.hypot(
|
|
3487
|
-
(
|
|
3488
|
-
(
|
|
3487
|
+
(O.clientX - (((B = Ue.current) == null ? void 0 : B.left) ?? 0)) / $ - me - L.x,
|
|
3488
|
+
(O.clientY - (((xe = Ue.current) == null ? void 0 : xe.top) ?? 0)) / $ - ie - L.y
|
|
3489
3489
|
) > 4 / Math.max($, 1e-4) : !1;
|
|
3490
3490
|
if (!pe && !ke && S === (u == null ? void 0 : u.id) && L) {
|
|
3491
3491
|
const ee = gt(), J = [];
|
|
@@ -3523,11 +3523,11 @@ function Pi(e) {
|
|
|
3523
3523
|
Ve,
|
|
3524
3524
|
Se
|
|
3525
3525
|
]), cs = ft(
|
|
3526
|
-
(
|
|
3526
|
+
(O) => {
|
|
3527
3527
|
if (!u) return;
|
|
3528
3528
|
const fe = t.current;
|
|
3529
3529
|
if (!fe) return;
|
|
3530
|
-
const dt = Ue.current ?? fe.getBoundingClientRect(), W = (
|
|
3530
|
+
const dt = Ue.current ?? fe.getBoundingClientRect(), W = (O.clientX - dt.left) / $ - me, Z = (O.clientY - dt.top) / $ - ie;
|
|
3531
3531
|
if (u.hitTest(W, Z)) {
|
|
3532
3532
|
if (u instanceof Re) {
|
|
3533
3533
|
const oe = u.hitTestChild(W, Z);
|
|
@@ -3544,7 +3544,7 @@ function Pi(e) {
|
|
|
3544
3544
|
const $t = oe.getRichText().clone();
|
|
3545
3545
|
C.current = $t, rn($t);
|
|
3546
3546
|
const an = oe.getRichText().getStyleAt(Math.max(0, oe.text.length - 1));
|
|
3547
|
-
Ut({ ...oe.getDefaultStyle(), ...an }), Te(qt),
|
|
3547
|
+
Ut({ ...oe.getDefaultStyle(), ...an }), Te(qt), ze(qt), Ne(qt), on(!0), R.current = Date.now(), v.current = oe.id;
|
|
3548
3548
|
return;
|
|
3549
3549
|
}
|
|
3550
3550
|
}
|
|
@@ -3566,7 +3566,7 @@ function Pi(e) {
|
|
|
3566
3566
|
const F = u.getRichText().clone();
|
|
3567
3567
|
C.current = F, rn(F);
|
|
3568
3568
|
const ce = u.getRichText().getStyleAt(Math.max(0, u.text.length - 1));
|
|
3569
|
-
Ut({ ...u.getDefaultStyle(), ...ce }), Te(k),
|
|
3569
|
+
Ut({ ...u.getDefaultStyle(), ...ce }), Te(k), ze(k), Ne(k), on(!0), R.current = Date.now();
|
|
3570
3570
|
}
|
|
3571
3571
|
},
|
|
3572
3572
|
[
|
|
@@ -3584,7 +3584,7 @@ function Pi(e) {
|
|
|
3584
3584
|
rn,
|
|
3585
3585
|
Ut,
|
|
3586
3586
|
Te,
|
|
3587
|
-
|
|
3587
|
+
ze,
|
|
3588
3588
|
Ne,
|
|
3589
3589
|
on,
|
|
3590
3590
|
Ze,
|
|
@@ -3592,50 +3592,50 @@ function Pi(e) {
|
|
|
3592
3592
|
Ke
|
|
3593
3593
|
]
|
|
3594
3594
|
), Xn = ft(
|
|
3595
|
-
(
|
|
3595
|
+
(O) => {
|
|
3596
3596
|
const fe = t.current;
|
|
3597
3597
|
if (!fe || h.getMode() === "idle") return;
|
|
3598
3598
|
const W = Ue.current ?? fe.getBoundingClientRect();
|
|
3599
|
-
if (
|
|
3599
|
+
if (O.clientX >= W.left && O.clientX <= W.right && O.clientY >= W.top && O.clientY <= W.bottom) return;
|
|
3600
3600
|
const et = {
|
|
3601
|
-
clientX:
|
|
3602
|
-
clientY:
|
|
3603
|
-
altKey:
|
|
3604
|
-
shiftKey:
|
|
3605
|
-
ctrlKey:
|
|
3606
|
-
metaKey:
|
|
3601
|
+
clientX: O.clientX,
|
|
3602
|
+
clientY: O.clientY,
|
|
3603
|
+
altKey: O.altKey,
|
|
3604
|
+
shiftKey: O.shiftKey,
|
|
3605
|
+
ctrlKey: O.ctrlKey,
|
|
3606
|
+
metaKey: O.metaKey,
|
|
3607
3607
|
bubbles: !0,
|
|
3608
3608
|
cancelable: !0,
|
|
3609
3609
|
currentTarget: fe,
|
|
3610
3610
|
target: fe,
|
|
3611
|
-
nativeEvent:
|
|
3611
|
+
nativeEvent: O,
|
|
3612
3612
|
type: "pointermove",
|
|
3613
|
-
pointerId:
|
|
3614
|
-
pointerType:
|
|
3615
|
-
preventDefault: () =>
|
|
3616
|
-
stopPropagation: () =>
|
|
3613
|
+
pointerId: O.pointerId || 0,
|
|
3614
|
+
pointerType: O.pointerType || "mouse",
|
|
3615
|
+
preventDefault: () => O.preventDefault(),
|
|
3616
|
+
stopPropagation: () => O.stopPropagation(),
|
|
3617
3617
|
isPropagationStopped: () => !1,
|
|
3618
|
-
isDefaultPrevented: () =>
|
|
3618
|
+
isDefaultPrevented: () => O.defaultPrevented
|
|
3619
3619
|
};
|
|
3620
3620
|
An(et);
|
|
3621
3621
|
},
|
|
3622
3622
|
[An, t, h]
|
|
3623
3623
|
), Wn = ft(
|
|
3624
|
-
(
|
|
3624
|
+
(O) => {
|
|
3625
3625
|
const fe = t.current;
|
|
3626
3626
|
if (!fe) return;
|
|
3627
|
-
const dt =
|
|
3627
|
+
const dt = O.target, W = dt ? fe.contains(dt) : !1, Z = Ae.current.has(O.pointerId) || Ge.current !== null || Fe.current !== null || K.current !== null || h.isInteracting();
|
|
3628
3628
|
if (!W && !Z) return;
|
|
3629
3629
|
const et = {
|
|
3630
|
-
clientX:
|
|
3631
|
-
clientY:
|
|
3630
|
+
clientX: O.clientX,
|
|
3631
|
+
clientY: O.clientY,
|
|
3632
3632
|
// Forward the button so handlePointerUp's right-button guard
|
|
3633
3633
|
// applies to document-forwarded releases too.
|
|
3634
|
-
button:
|
|
3634
|
+
button: O.button,
|
|
3635
3635
|
currentTarget: fe,
|
|
3636
3636
|
target: fe,
|
|
3637
|
-
pointerId:
|
|
3638
|
-
pointerType:
|
|
3637
|
+
pointerId: O.pointerId || 0,
|
|
3638
|
+
pointerType: O.pointerType || "mouse"
|
|
3639
3639
|
};
|
|
3640
3640
|
En(et);
|
|
3641
3641
|
},
|
|
@@ -3645,12 +3645,12 @@ function Pi(e) {
|
|
|
3645
3645
|
document.removeEventListener("pointermove", Xn), document.removeEventListener("pointerup", Wn);
|
|
3646
3646
|
}), [Xn, Wn]);
|
|
3647
3647
|
const xn = ft(
|
|
3648
|
-
(
|
|
3648
|
+
(O) => {
|
|
3649
3649
|
if (!rt) return;
|
|
3650
|
-
|
|
3650
|
+
O.preventDefault();
|
|
3651
3651
|
const fe = t.current;
|
|
3652
3652
|
if (!fe || g || u instanceof Lt && u.isCropping || H.isActive()) return;
|
|
3653
|
-
const W = fe.getBoundingClientRect(), Z = (
|
|
3653
|
+
const W = fe.getBoundingClientRect(), Z = (O.clientX - W.left) / $ - me, et = (O.clientY - W.top) / $ - ie, B = gt();
|
|
3654
3654
|
let xe = null;
|
|
3655
3655
|
for (let S = B.length - 1; S >= 0; S--) {
|
|
3656
3656
|
const L = B[S];
|
|
@@ -3664,8 +3664,8 @@ function Pi(e) {
|
|
|
3664
3664
|
!S && !L && (Xe(xe.id), Y([]));
|
|
3665
3665
|
}
|
|
3666
3666
|
rt({
|
|
3667
|
-
clientX:
|
|
3668
|
-
clientY:
|
|
3667
|
+
clientX: O.clientX,
|
|
3668
|
+
clientY: O.clientY,
|
|
3669
3669
|
worldX: Z,
|
|
3670
3670
|
worldY: et,
|
|
3671
3671
|
elementId: xe ? xe.id : null
|
|
@@ -3737,7 +3737,7 @@ function Ai(e) {
|
|
|
3737
3737
|
selectionEnd: I,
|
|
3738
3738
|
selectedId: g,
|
|
3739
3739
|
selectedElement: P,
|
|
3740
|
-
activeChildElement:
|
|
3740
|
+
activeChildElement: z,
|
|
3741
3741
|
elements: D,
|
|
3742
3742
|
zoom: w,
|
|
3743
3743
|
paddingOffsetX: ne,
|
|
@@ -3754,7 +3754,7 @@ function Ai(e) {
|
|
|
3754
3754
|
setHandlesVersion: be,
|
|
3755
3755
|
setElements: Se,
|
|
3756
3756
|
onElementUpdate: Te,
|
|
3757
|
-
onTextSelectionChange:
|
|
3757
|
+
onTextSelectionChange: ze,
|
|
3758
3758
|
transformHandles: Ne,
|
|
3759
3759
|
updateActiveChild: $e
|
|
3760
3760
|
} = e, at = ft(
|
|
@@ -3799,7 +3799,7 @@ function Ai(e) {
|
|
|
3799
3799
|
pt({ [h]: H });
|
|
3800
3800
|
},
|
|
3801
3801
|
[C, E, P, ct, pt]
|
|
3802
|
-
),
|
|
3802
|
+
), Ot = ft(() => {
|
|
3803
3803
|
if (!C) return;
|
|
3804
3804
|
const h = o.current || E;
|
|
3805
3805
|
if (P && h) {
|
|
@@ -3873,17 +3873,17 @@ function Ai(e) {
|
|
|
3873
3873
|
H = H.parentElement;
|
|
3874
3874
|
}
|
|
3875
3875
|
if (!Ce)
|
|
3876
|
-
|
|
3876
|
+
Ot();
|
|
3877
3877
|
else {
|
|
3878
3878
|
const Y = T, _ = I;
|
|
3879
3879
|
(Xe = n.current) == null || Xe.focus(), n.current && n.current.setSelectionRange(Y, _);
|
|
3880
3880
|
}
|
|
3881
3881
|
}, 0);
|
|
3882
|
-
}, [
|
|
3882
|
+
}, [Ot, T, I]), We = ft(
|
|
3883
3883
|
(h) => {
|
|
3884
3884
|
const U = h.currentTarget;
|
|
3885
3885
|
if (h.key === "Enter" && (h.metaKey || h.ctrlKey))
|
|
3886
|
-
h.preventDefault(),
|
|
3886
|
+
h.preventDefault(), Ot();
|
|
3887
3887
|
else if (h.key === "Escape")
|
|
3888
3888
|
h.preventDefault(), h.stopPropagation(), N(!1), u(""), j(null), o.current = null, me(null), s.current = null;
|
|
3889
3889
|
else if ((h.metaKey || h.ctrlKey) && h.key.toLowerCase() === "b")
|
|
@@ -3908,7 +3908,7 @@ function Ai(e) {
|
|
|
3908
3908
|
G(re), te(re), ae(U.selectionEnd), i.current = re;
|
|
3909
3909
|
}, 0);
|
|
3910
3910
|
},
|
|
3911
|
-
[
|
|
3911
|
+
[Ot, Pt, G, te, ae, i, A, P]
|
|
3912
3912
|
);
|
|
3913
3913
|
Ie(() => {
|
|
3914
3914
|
C && (a.current = performance.now());
|
|
@@ -3980,7 +3980,7 @@ function Ai(e) {
|
|
|
3980
3980
|
if (d.current || Date.now() - l.current < x)
|
|
3981
3981
|
return;
|
|
3982
3982
|
const H = h.selectionStart || 0, Ce = h.selectionEnd || 0;
|
|
3983
|
-
G((Pe) => Pe === Ce ? Pe : Ce), te((Pe) => Pe === H ? Pe : H), ae((Pe) => Pe === Ce ? Pe : Ce),
|
|
3983
|
+
G((Pe) => Pe === Ce ? Pe : Ce), te((Pe) => Pe === H ? Pe : H), ae((Pe) => Pe === Ce ? Pe : Ce), ze == null || ze();
|
|
3984
3984
|
};
|
|
3985
3985
|
h.addEventListener("click", U), h.addEventListener("keyup", U), h.addEventListener("select", U), h.addEventListener("mouseup", U);
|
|
3986
3986
|
const re = () => {
|
|
@@ -3994,15 +3994,15 @@ function Ai(e) {
|
|
|
3994
3994
|
const re = U.target;
|
|
3995
3995
|
if (re.tagName === "INPUT" || re.tagName === "TEXTAREA" || U.key !== "Enter" || C || !t.current) return;
|
|
3996
3996
|
const he = t.current.getBoundingClientRect();
|
|
3997
|
-
if (
|
|
3997
|
+
if (z && z instanceof Qe && !(z instanceof Re) && !(z instanceof Lt) && !(z instanceof Qn)) {
|
|
3998
3998
|
U.preventDefault();
|
|
3999
|
-
const H =
|
|
3999
|
+
const H = z.getVisualBoundingBox(), Ce = H.height + 16, Pe = 6;
|
|
4000
4000
|
$({
|
|
4001
4001
|
x: he.left + (H.x + ne) * w - Pe,
|
|
4002
4002
|
y: he.top + (H.y + V) * w - Pe,
|
|
4003
4003
|
width: Math.max(200, H.width * w),
|
|
4004
4004
|
height: Math.max(Ce * w, 50)
|
|
4005
|
-
}), u(fs(
|
|
4005
|
+
}), u(fs(z)), N(!0), p.current = Date.now(), s.current = z.id;
|
|
4006
4006
|
return;
|
|
4007
4007
|
}
|
|
4008
4008
|
if (P && P instanceof Qe && !(P instanceof Re) && !(P instanceof Lt) && !(P instanceof Qn)) {
|
|
@@ -4017,8 +4017,8 @@ function Ai(e) {
|
|
|
4017
4017
|
}
|
|
4018
4018
|
};
|
|
4019
4019
|
return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
|
|
4020
|
-
}, [P,
|
|
4021
|
-
handleTextEditComplete:
|
|
4020
|
+
}, [P, z, C]), {
|
|
4021
|
+
handleTextEditComplete: Ot,
|
|
4022
4022
|
handleTextEditBlur: At,
|
|
4023
4023
|
handleTextKeyDown: We,
|
|
4024
4024
|
applyFormattingToSelection: pt,
|
|
@@ -4054,7 +4054,7 @@ const br = Nr(
|
|
|
4054
4054
|
offsetX: I = 0,
|
|
4055
4055
|
offsetY: g = 0,
|
|
4056
4056
|
viewPadding: P = 1,
|
|
4057
|
-
artboardBorderRadius:
|
|
4057
|
+
artboardBorderRadius: z = 0,
|
|
4058
4058
|
fixedMargin: D,
|
|
4059
4059
|
fixedMarginX: w,
|
|
4060
4060
|
fixedMarginY: ne,
|
|
@@ -4064,7 +4064,7 @@ const br = Nr(
|
|
|
4064
4064
|
pieceFocus: j,
|
|
4065
4065
|
focusedPieceRect: G
|
|
4066
4066
|
}, te) => {
|
|
4067
|
-
const { resolvedTheme: ae } = po(), $ = we(null), me = R || $, ie = we(null), be = we(!1), Se = we(0), Te = we(0),
|
|
4067
|
+
const { resolvedTheme: ae } = po(), $ = we(null), me = R || $, ie = we(null), be = we(!1), Se = we(0), Te = we(0), ze = we(0), Ne = we(!1), $e = we(0), at = we(null), pt = we(0), ct = we(null), Pt = we({ start: null, end: null }), Ot = we(null), At = we(null), We = we(null), Ee = we(null), lt = 400, se = 300, h = 50, U = 200, re = je.useMemo(() => {
|
|
4068
4068
|
if (!j || j === "spread") return null;
|
|
4069
4069
|
const ye = (u == null ? void 0 : u.pieces) ?? [];
|
|
4070
4070
|
if (ye.length <= 1) return null;
|
|
@@ -4093,7 +4093,7 @@ const br = Nr(
|
|
|
4093
4093
|
height: A,
|
|
4094
4094
|
zoom: T,
|
|
4095
4095
|
viewPadding: P,
|
|
4096
|
-
artboardBorderRadius:
|
|
4096
|
+
artboardBorderRadius: z,
|
|
4097
4097
|
fixedMargin: D,
|
|
4098
4098
|
fixedMarginX: w,
|
|
4099
4099
|
fixedMarginY: ne,
|
|
@@ -4162,7 +4162,7 @@ const br = Nr(
|
|
|
4162
4162
|
gs.removeHook("afterResize", ye);
|
|
4163
4163
|
};
|
|
4164
4164
|
}, [st]);
|
|
4165
|
-
const { cropController: Wn } = Ho(), { penTool: xn, penCursor:
|
|
4165
|
+
const { cropController: Wn } = Ho(), { penTool: xn, penCursor: O } = Oo({ selectedElement: ve }), {
|
|
4166
4166
|
isEditing: fe,
|
|
4167
4167
|
setIsEditing: dt,
|
|
4168
4168
|
editText: W,
|
|
@@ -4255,9 +4255,9 @@ const br = Nr(
|
|
|
4255
4255
|
window.removeEventListener("keydown", ye), window.removeEventListener("keyup", de), window.removeEventListener("blur", Ye);
|
|
4256
4256
|
};
|
|
4257
4257
|
}, [xn, ve, l, ge, fe]), Ie(() => {
|
|
4258
|
-
if (!me.current || !
|
|
4258
|
+
if (!me.current || !Ot.current || yt.getMode() === "drag" || yt.getMode() === "resize")
|
|
4259
4259
|
return;
|
|
4260
|
-
const { x: de, y: Ye } =
|
|
4260
|
+
const { x: de, y: Ye } = Ot.current;
|
|
4261
4261
|
if (Yt) {
|
|
4262
4262
|
let He = null;
|
|
4263
4263
|
const tt = $t();
|
|
@@ -4323,7 +4323,7 @@ const br = Nr(
|
|
|
4323
4323
|
editPositionUpdateTimerRef: Ee,
|
|
4324
4324
|
draggingSelectionHandleRef: ct,
|
|
4325
4325
|
repositioningCursorRef: be,
|
|
4326
|
-
editModeEnteredAtRef:
|
|
4326
|
+
editModeEnteredAtRef: ze,
|
|
4327
4327
|
lastTouchTargetRef: Ve,
|
|
4328
4328
|
MULTI_CLICK_DEBOUNCE: se,
|
|
4329
4329
|
EDIT_MODE_BLUR_DEBOUNCE: U,
|
|
@@ -4373,12 +4373,12 @@ const br = Nr(
|
|
|
4373
4373
|
skipDragSelectionRef: Ne,
|
|
4374
4374
|
draggingSelectionHandleRef: ct,
|
|
4375
4375
|
selectionHandlePositionsRef: Pt,
|
|
4376
|
-
lastMousePosRef:
|
|
4376
|
+
lastMousePosRef: Ot,
|
|
4377
4377
|
dragOriginalElementsRef: At,
|
|
4378
4378
|
rotatingElementRef: We,
|
|
4379
4379
|
editingChildIdRef: Ft,
|
|
4380
4380
|
editRichTextRef: F,
|
|
4381
|
-
editModeEnteredAtRef:
|
|
4381
|
+
editModeEnteredAtRef: ze,
|
|
4382
4382
|
multiSelectionGroupBoundsRef: Gt,
|
|
4383
4383
|
MULTI_CLICK_THRESHOLD: lt,
|
|
4384
4384
|
MULTI_CLICK_DEBOUNCE: se,
|
|
@@ -4598,7 +4598,7 @@ const br = Nr(
|
|
|
4598
4598
|
background: u ? "transparent" : "var(--color-canvas-bg)",
|
|
4599
4599
|
width: `${Y * T}px`,
|
|
4600
4600
|
height: `${_ * T}px`,
|
|
4601
|
-
cursor: xn.isActive() && ve instanceof wn ?
|
|
4601
|
+
cursor: xn.isActive() && ve instanceof wn ? O : void 0,
|
|
4602
4602
|
position: "absolute",
|
|
4603
4603
|
left: `${I}px`,
|
|
4604
4604
|
top: `${g}px`,
|
|
@@ -4670,7 +4670,7 @@ const br = Nr(
|
|
|
4670
4670
|
onPointerMove: (qe) => {
|
|
4671
4671
|
if (qe.buttons !== 1) return;
|
|
4672
4672
|
if (ct.current && ve instanceof Qe && me.current) {
|
|
4673
|
-
const qn = me.current.getBoundingClientRect(), pn = (qe.clientX - qn.left) / T - ot, ln = (qe.clientY - qn.top) / T - rt, Bs = ve.getVisualBoundingBox(),
|
|
4673
|
+
const qn = me.current.getBoundingClientRect(), pn = (qe.clientX - qn.left) / T - ot, ln = (qe.clientY - qn.top) / T - rt, Bs = ve.getVisualBoundingBox(), zs = ve.getRotationAnchor(), Os = en.toRadiansInverse(ve.rotation), Xs = pn - zs.x, Ls = ln - zs.y, Ys = Math.cos(Os), Hs = Math.sin(Os), kr = Xs * Ys - Ls * Hs, Rr = Xs * Hs + Ls * Ys, mn = Pt.current;
|
|
4674
4674
|
let Ss = 0;
|
|
4675
4675
|
ct.current === "start" && (mn != null && mn.start) ? Ss = mn.start.textEdge.y - mn.start.center.y : ct.current === "end" && (mn != null && mn.end) && (Ss = mn.end.textEdge.y - mn.end.center.y);
|
|
4676
4676
|
const Mr = kr + Bs.width / 2, Tr = Rr + Ss + Bs.height / 2, gn = Sn(ve, { x: Mr, y: Tr });
|
|
@@ -4825,7 +4825,7 @@ function Yn({
|
|
|
4825
4825
|
}
|
|
4826
4826
|
);
|
|
4827
4827
|
}
|
|
4828
|
-
const
|
|
4828
|
+
const zn = $n.forwardRef(
|
|
4829
4829
|
({ className: e, disabled: t, children: n, ...s }, o) => /* @__PURE__ */ r(
|
|
4830
4830
|
"fieldset",
|
|
4831
4831
|
{
|
|
@@ -4842,7 +4842,7 @@ const On = $n.forwardRef(
|
|
|
4842
4842
|
}
|
|
4843
4843
|
)
|
|
4844
4844
|
);
|
|
4845
|
-
|
|
4845
|
+
zn.displayName = "Fieldset";
|
|
4846
4846
|
const Ni = $n.forwardRef(
|
|
4847
4847
|
({ className: e, children: t, ...n }, s) => /* @__PURE__ */ r(
|
|
4848
4848
|
"legend",
|
|
@@ -4911,7 +4911,7 @@ const Bi = pr("sc:pointer-events-none sc:relative sc:origin-center sc:animate-sp
|
|
|
4911
4911
|
}
|
|
4912
4912
|
}
|
|
4913
4913
|
});
|
|
4914
|
-
function
|
|
4914
|
+
function zi({ className: e, size: t, color: n, label: s = "Loading", ...o }) {
|
|
4915
4915
|
const i = $n.useId();
|
|
4916
4916
|
return /* @__PURE__ */ r(
|
|
4917
4917
|
"span",
|
|
@@ -4954,7 +4954,7 @@ function Oi({ className: e, size: t, color: n, label: s = "Loading", ...o }) {
|
|
|
4954
4954
|
}
|
|
4955
4955
|
);
|
|
4956
4956
|
}
|
|
4957
|
-
const
|
|
4957
|
+
const Oi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platform ?? ""), Zn = Oi ? "⌘" : "Ctrl+", ps = () => /* @__PURE__ */ r("div", { className: "sc:h-[1px] sc:bg-border-primary sc:my-xs" }), Xi = ({ menu: e, onClose: t }) => {
|
|
4958
4958
|
const {
|
|
4959
4959
|
multiSelection: n,
|
|
4960
4960
|
handleCopyElements: s,
|
|
@@ -4985,7 +4985,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
4985
4985
|
};
|
|
4986
4986
|
return document.addEventListener("pointerdown", u), () => document.removeEventListener("pointerdown", u);
|
|
4987
4987
|
}, [t]);
|
|
4988
|
-
const g = e.targetId ? A(e.targetId) : null, P = xs(() => e.targetId ? n.length > 1 && n.includes(e.targetId) ? n : [e.targetId] : [], [e.targetId, n]),
|
|
4988
|
+
const g = e.targetId ? A(e.targetId) : null, P = xs(() => e.targetId ? n.length > 1 && n.includes(e.targetId) ? n : [e.targetId] : [], [e.targetId, n]), z = !!(g != null && g.locked), D = P.some((u) => {
|
|
4989
4989
|
var j;
|
|
4990
4990
|
return !!((j = A(u)) != null && j.locked);
|
|
4991
4991
|
}), w = g instanceof Re, ne = P.length > 1, V = (u) => () => {
|
|
@@ -5013,7 +5013,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5013
5013
|
Qt,
|
|
5014
5014
|
{
|
|
5015
5015
|
"data-testid": "context-menu-copy",
|
|
5016
|
-
icon: /* @__PURE__ */ r(
|
|
5016
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.copy, className: "sc:size-3.5" }),
|
|
5017
5017
|
label: "Copy",
|
|
5018
5018
|
shortcut: `${Zn}C`,
|
|
5019
5019
|
onClick: V(() => s())
|
|
@@ -5023,7 +5023,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5023
5023
|
Qt,
|
|
5024
5024
|
{
|
|
5025
5025
|
"data-testid": "context-menu-paste",
|
|
5026
|
-
icon: /* @__PURE__ */ r(
|
|
5026
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.paste, className: "sc:size-3.5" }),
|
|
5027
5027
|
label: "Paste",
|
|
5028
5028
|
shortcut: `${Zn}V`,
|
|
5029
5029
|
disabled: !i,
|
|
@@ -5034,7 +5034,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5034
5034
|
Qt,
|
|
5035
5035
|
{
|
|
5036
5036
|
"data-testid": "context-menu-duplicate",
|
|
5037
|
-
icon: /* @__PURE__ */ r(
|
|
5037
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.copy, className: "sc:size-3.5" }),
|
|
5038
5038
|
label: "Duplicate",
|
|
5039
5039
|
shortcut: `${Zn}D`,
|
|
5040
5040
|
onClick: V(() => P.forEach((u) => d(u)))
|
|
@@ -5045,8 +5045,8 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5045
5045
|
Qt,
|
|
5046
5046
|
{
|
|
5047
5047
|
"data-testid": "context-menu-lock",
|
|
5048
|
-
icon: /* @__PURE__ */ r(
|
|
5049
|
-
label:
|
|
5048
|
+
icon: /* @__PURE__ */ r(Oe, { icon: z ? _e.lockOpen : _e.lock, className: "sc:size-3.5" }),
|
|
5049
|
+
label: z ? "Unlock" : "Lock",
|
|
5050
5050
|
onClick: V(() => P.forEach((u) => p(u)))
|
|
5051
5051
|
}
|
|
5052
5052
|
),
|
|
@@ -5055,9 +5055,9 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5055
5055
|
Qt,
|
|
5056
5056
|
{
|
|
5057
5057
|
"data-testid": "context-menu-bring-to-front",
|
|
5058
|
-
icon: /* @__PURE__ */ r(
|
|
5058
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.layerForward, className: "sc:size-3.5" }),
|
|
5059
5059
|
label: "Bring to Front",
|
|
5060
|
-
disabled:
|
|
5060
|
+
disabled: z,
|
|
5061
5061
|
onClick: V(() => v(e.targetId))
|
|
5062
5062
|
}
|
|
5063
5063
|
),
|
|
@@ -5065,9 +5065,9 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5065
5065
|
Qt,
|
|
5066
5066
|
{
|
|
5067
5067
|
"data-testid": "context-menu-bring-forward",
|
|
5068
|
-
icon: /* @__PURE__ */ r(
|
|
5068
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.arrowUp, className: "sc:size-3.5" }),
|
|
5069
5069
|
label: "Bring Forward",
|
|
5070
|
-
disabled:
|
|
5070
|
+
disabled: z,
|
|
5071
5071
|
onClick: V(() => b(e.targetId))
|
|
5072
5072
|
}
|
|
5073
5073
|
),
|
|
@@ -5075,9 +5075,9 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5075
5075
|
Qt,
|
|
5076
5076
|
{
|
|
5077
5077
|
"data-testid": "context-menu-send-backward",
|
|
5078
|
-
icon: /* @__PURE__ */ r(
|
|
5078
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.arrowDown, className: "sc:size-3.5" }),
|
|
5079
5079
|
label: "Send Backward",
|
|
5080
|
-
disabled:
|
|
5080
|
+
disabled: z,
|
|
5081
5081
|
onClick: V(() => x(e.targetId))
|
|
5082
5082
|
}
|
|
5083
5083
|
),
|
|
@@ -5085,9 +5085,9 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5085
5085
|
Qt,
|
|
5086
5086
|
{
|
|
5087
5087
|
"data-testid": "context-menu-send-to-back",
|
|
5088
|
-
icon: /* @__PURE__ */ r(
|
|
5088
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.layerBackward, className: "sc:size-3.5" }),
|
|
5089
5089
|
label: "Send to Back",
|
|
5090
|
-
disabled:
|
|
5090
|
+
disabled: z,
|
|
5091
5091
|
onClick: V(() => C(e.targetId))
|
|
5092
5092
|
}
|
|
5093
5093
|
),
|
|
@@ -5096,7 +5096,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5096
5096
|
Qt,
|
|
5097
5097
|
{
|
|
5098
5098
|
"data-testid": "context-menu-group",
|
|
5099
|
-
icon: /* @__PURE__ */ r(
|
|
5099
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.group, className: "sc:size-3.5" }),
|
|
5100
5100
|
label: "Group",
|
|
5101
5101
|
disabled: D,
|
|
5102
5102
|
onClick: V(() => R(P))
|
|
@@ -5106,9 +5106,9 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5106
5106
|
Qt,
|
|
5107
5107
|
{
|
|
5108
5108
|
"data-testid": "context-menu-ungroup",
|
|
5109
|
-
icon: /* @__PURE__ */ r(
|
|
5109
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.ungroup, className: "sc:size-3.5" }),
|
|
5110
5110
|
label: "Ungroup",
|
|
5111
|
-
disabled:
|
|
5111
|
+
disabled: z,
|
|
5112
5112
|
onClick: V(() => E(e.targetId))
|
|
5113
5113
|
}
|
|
5114
5114
|
),
|
|
@@ -5117,7 +5117,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5117
5117
|
Qt,
|
|
5118
5118
|
{
|
|
5119
5119
|
"data-testid": "context-menu-delete",
|
|
5120
|
-
icon: /* @__PURE__ */ r(
|
|
5120
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.trash, className: "sc:size-3.5" }),
|
|
5121
5121
|
label: "Delete",
|
|
5122
5122
|
shortcut: "Del",
|
|
5123
5123
|
className: "sc:text-[#d32f2f] sc:hover:bg-[rgba(211,47,47,0.1)] sc:hover:text-[#c62828]",
|
|
@@ -5134,7 +5134,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5134
5134
|
Qt,
|
|
5135
5135
|
{
|
|
5136
5136
|
"data-testid": "context-menu-paste",
|
|
5137
|
-
icon: /* @__PURE__ */ r(
|
|
5137
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.paste, className: "sc:size-3.5" }),
|
|
5138
5138
|
label: "Paste",
|
|
5139
5139
|
shortcut: `${Zn}V`,
|
|
5140
5140
|
disabled: !i,
|
|
@@ -5145,7 +5145,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5145
5145
|
Qt,
|
|
5146
5146
|
{
|
|
5147
5147
|
"data-testid": "context-menu-select-all",
|
|
5148
|
-
icon: /* @__PURE__ */ r(
|
|
5148
|
+
icon: /* @__PURE__ */ r(Oe, { icon: _e.selectAll, className: "sc:size-3.5" }),
|
|
5149
5149
|
label: "Select All",
|
|
5150
5150
|
shortcut: `${Zn}A`,
|
|
5151
5151
|
onClick: V(
|
|
@@ -5194,7 +5194,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5194
5194
|
executeElementUpdate: g
|
|
5195
5195
|
} = rs(), {
|
|
5196
5196
|
zoom: P,
|
|
5197
|
-
setZoom:
|
|
5197
|
+
setZoom: z,
|
|
5198
5198
|
panOffset: D,
|
|
5199
5199
|
setPanOffset: w,
|
|
5200
5200
|
isPanning: ne,
|
|
@@ -5210,12 +5210,12 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5210
5210
|
handleActiveChildChange: me,
|
|
5211
5211
|
setHoveredElementId: ie,
|
|
5212
5212
|
hideHandles: be
|
|
5213
|
-
} =
|
|
5213
|
+
} = zr(), {
|
|
5214
5214
|
setTextSelectionVersion: Se,
|
|
5215
5215
|
setExpandedPanelType: Te
|
|
5216
|
-
} =
|
|
5216
|
+
} = Or(), ze = je.useCallback(() => {
|
|
5217
5217
|
Te("crop");
|
|
5218
|
-
}, [Te]), Ne = je.useRef(null), [$e, at] = je.useState(0), [pt, ct] = je.useState(0), [Pt,
|
|
5218
|
+
}, [Te]), Ne = je.useRef(null), [$e, at] = je.useState(0), [pt, ct] = je.useState(0), [Pt, Ot] = je.useState(!1), At = je.useRef(P), We = je.useRef(!1), [Ee, lt] = je.useState(!1), se = je.useRef(null);
|
|
5219
5219
|
Ro({ enabled: m });
|
|
5220
5220
|
const [h, U] = je.useState(null), re = je.useCallback(
|
|
5221
5221
|
(K) => {
|
|
@@ -5344,7 +5344,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5344
5344
|
}
|
|
5345
5345
|
} else
|
|
5346
5346
|
nt = Math.min(Je * i / Ge, 1);
|
|
5347
|
-
at(nt), ct(Je),
|
|
5347
|
+
at(nt), ct(Je), Ot(st);
|
|
5348
5348
|
};
|
|
5349
5349
|
let ge = !1;
|
|
5350
5350
|
We.current ? ue() : K = requestAnimationFrame(() => {
|
|
@@ -5371,8 +5371,8 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5371
5371
|
At.current = P;
|
|
5372
5372
|
}
|
|
5373
5373
|
}, [a, P, $e, u]), je.useEffect(() => {
|
|
5374
|
-
ot <= 0 || (At.current = ot,
|
|
5375
|
-
}, [ot,
|
|
5374
|
+
ot <= 0 || (At.current = ot, z(ot));
|
|
5375
|
+
}, [ot, z]);
|
|
5376
5376
|
const rt = je.useRef(null);
|
|
5377
5377
|
je.useEffect(() => {
|
|
5378
5378
|
const K = _ && "id" in _ ? _.id ?? null : null;
|
|
@@ -5490,7 +5490,7 @@ const zi = typeof navigator < "u" && /Mac|iP(hone|ad|od)/.test(navigator.platfor
|
|
|
5490
5490
|
onActiveChildChange: me,
|
|
5491
5491
|
onTextSelectionChange: () => Se((K) => K + 1),
|
|
5492
5492
|
onHoverChange: ie,
|
|
5493
|
-
onCropModeEnter:
|
|
5493
|
+
onCropModeEnter: ze,
|
|
5494
5494
|
onContextMenuRequest: re,
|
|
5495
5495
|
hideHandles: be,
|
|
5496
5496
|
canvasRef: C,
|
|
@@ -5659,12 +5659,12 @@ async function Ja() {
|
|
|
5659
5659
|
] = await Promise.all([
|
|
5660
5660
|
Promise.resolve().then(() => va),
|
|
5661
5661
|
Promise.resolve().then(() => wa),
|
|
5662
|
-
import("./ImagePanel-
|
|
5662
|
+
import("./ImagePanel-DY9Ve3X7.js"),
|
|
5663
5663
|
Promise.resolve().then(() => Ra),
|
|
5664
5664
|
Promise.resolve().then(() => Ta),
|
|
5665
|
-
import("./ContextualToolbars-
|
|
5665
|
+
import("./ContextualToolbars-B2LTNu7r.js").then((c) => c.s),
|
|
5666
5666
|
Promise.resolve().then(() => Ia),
|
|
5667
|
-
import("./ContextualToolbars-
|
|
5667
|
+
import("./ContextualToolbars-B2LTNu7r.js").then((c) => c.r)
|
|
5668
5668
|
]);
|
|
5669
5669
|
It("effects-panel", {
|
|
5670
5670
|
component: e,
|
|
@@ -5814,7 +5814,7 @@ const Vi = ({ stroke: e, onChange: t }) => {
|
|
|
5814
5814
|
/* @__PURE__ */ r(hr, { checked: o, onCheckedChange: d })
|
|
5815
5815
|
] }) }),
|
|
5816
5816
|
/* @__PURE__ */ y(Ds, { className: "sc:flex sc:flex-col sc:gap-lg sc:pt-lg", children: [
|
|
5817
|
-
/* @__PURE__ */ r(
|
|
5817
|
+
/* @__PURE__ */ r(zn, { className: "sc:flex sc:flex-col sc:gap-sm", children: /* @__PURE__ */ y("div", { className: "sc:flex sc:items-center sc:justify-between", children: [
|
|
5818
5818
|
/* @__PURE__ */ r(Tt, { children: "Color" }),
|
|
5819
5819
|
/* @__PURE__ */ r(go, { value: i, onChange: m })
|
|
5820
5820
|
] }) }),
|
|
@@ -5853,7 +5853,7 @@ const Vi = ({ stroke: e, onChange: t }) => {
|
|
|
5853
5853
|
] })
|
|
5854
5854
|
] }),
|
|
5855
5855
|
/* @__PURE__ */ y($r, { delayDuration: 300, children: [
|
|
5856
|
-
/* @__PURE__ */ y(
|
|
5856
|
+
/* @__PURE__ */ y(zn, { className: "sc:flex sc:flex-col sc:gap-sm", children: [
|
|
5857
5857
|
/* @__PURE__ */ r(Tt, { children: "Line Cap" }),
|
|
5858
5858
|
/* @__PURE__ */ y(ss, { value: l, onValueChange: x, orientation: "horizontal", children: [
|
|
5859
5859
|
/* @__PURE__ */ y(dn, { children: [
|
|
@@ -5870,7 +5870,7 @@ const Vi = ({ stroke: e, onChange: t }) => {
|
|
|
5870
5870
|
] })
|
|
5871
5871
|
] })
|
|
5872
5872
|
] }),
|
|
5873
|
-
/* @__PURE__ */ y(
|
|
5873
|
+
/* @__PURE__ */ y(zn, { className: "sc:flex sc:flex-col sc:gap-sm", children: [
|
|
5874
5874
|
/* @__PURE__ */ r(Tt, { children: "Line Join" }),
|
|
5875
5875
|
/* @__PURE__ */ y(ss, { value: c, onValueChange: v, orientation: "horizontal", children: [
|
|
5876
5876
|
/* @__PURE__ */ y(dn, { children: [
|
|
@@ -6588,8 +6588,8 @@ const la = ({ distressEffect: e, onChange: t }) => {
|
|
|
6588
6588
|
seed: Date.now()
|
|
6589
6589
|
} : void 0);
|
|
6590
6590
|
}, p = (g, P) => {
|
|
6591
|
-
const
|
|
6592
|
-
t(
|
|
6591
|
+
const z = ca(g, P);
|
|
6592
|
+
t(z), s(!1);
|
|
6593
6593
|
}, b = (g) => {
|
|
6594
6594
|
if (e)
|
|
6595
6595
|
if (g === "custom") {
|
|
@@ -6802,7 +6802,7 @@ const la = ({ distressEffect: e, onChange: t }) => {
|
|
|
6802
6802
|
] })
|
|
6803
6803
|
] })
|
|
6804
6804
|
] }),
|
|
6805
|
-
/* @__PURE__ */ y(
|
|
6805
|
+
/* @__PURE__ */ y(zn, { className: "sc:flex sc:flex-col sc:gap-sm", children: [
|
|
6806
6806
|
/* @__PURE__ */ r(Tt, { children: "Style" }),
|
|
6807
6807
|
/* @__PURE__ */ y(ss, { value: i, onValueChange: b, orientation: "horizontal", children: [
|
|
6808
6808
|
/* @__PURE__ */ r(Kt, { value: "worn", id: "style-worn", children: "Worn" }),
|
|
@@ -6987,7 +6987,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
6987
6987
|
children: [
|
|
6988
6988
|
/* @__PURE__ */ r(As, { className: "sc:w-full", children: /* @__PURE__ */ r("div", { className: "sc:flex sc:items-center sc:justify-between sc:w-full", children: /* @__PURE__ */ r(Tt, { children: "Compositing" }) }) }),
|
|
6989
6989
|
/* @__PURE__ */ y(Ds, { className: "sc:flex sc:flex-col sc:gap-lg sc:pt-lg", children: [
|
|
6990
|
-
/* @__PURE__ */ y(
|
|
6990
|
+
/* @__PURE__ */ y(zn, { className: "sc:flex sc:flex-col sc:gap-sm", children: [
|
|
6991
6991
|
/* @__PURE__ */ r(Tt, { children: "Blend Mode" }),
|
|
6992
6992
|
/* @__PURE__ */ y(ss, { value: e, onValueChange: d, orientation: "horizontal", children: [
|
|
6993
6993
|
/* @__PURE__ */ r(Kt, { value: "normal", id: "blend-normal", children: "Normal" }),
|
|
@@ -7028,7 +7028,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7028
7028
|
)
|
|
7029
7029
|
] })
|
|
7030
7030
|
] }),
|
|
7031
|
-
/* @__PURE__ */ y(
|
|
7031
|
+
/* @__PURE__ */ y(zn, { className: "sc:flex sc:flex-col sc:gap-sm", children: [
|
|
7032
7032
|
/* @__PURE__ */ r(Tt, { children: "Knockout Scope" }),
|
|
7033
7033
|
/* @__PURE__ */ y("div", { className: "sc:flex sc:gap-sm", children: [
|
|
7034
7034
|
/* @__PURE__ */ y(
|
|
@@ -7077,7 +7077,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7077
7077
|
]
|
|
7078
7078
|
}
|
|
7079
7079
|
);
|
|
7080
|
-
}, pa =
|
|
7080
|
+
}, pa = On("GlyphPicker"), ma = ({
|
|
7081
7081
|
isOpen: e,
|
|
7082
7082
|
onClose: t,
|
|
7083
7083
|
character: n,
|
|
@@ -7121,7 +7121,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7121
7121
|
/* @__PURE__ */ r(fr, { size: 24, className: "sc:text-text-muted" }),
|
|
7122
7122
|
/* @__PURE__ */ r("h3", { className: "sc:m-0 sc:text-3xl sc:font-semibold sc:text-text-primary", children: C })
|
|
7123
7123
|
] }),
|
|
7124
|
-
/* @__PURE__ */ r(Ct, { size: "icon", variant: "ghost", onClick: t, children: /* @__PURE__ */ r(
|
|
7124
|
+
/* @__PURE__ */ r(Ct, { size: "icon", variant: "ghost", onClick: t, children: /* @__PURE__ */ r(Oe, { icon: _e.close, className: "sc:size-6" }) })
|
|
7125
7125
|
] }),
|
|
7126
7126
|
/* @__PURE__ */ y("div", { className: "sc:flex-1 sc:overflow-y-auto sc:p-3xl", children: [
|
|
7127
7127
|
m && /* @__PURE__ */ r("div", { className: "sc:text-center sc:py-6xl sc:text-text-muted", children: "Loading alternates..." }),
|
|
@@ -7184,7 +7184,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7184
7184
|
]
|
|
7185
7185
|
}
|
|
7186
7186
|
) });
|
|
7187
|
-
}, Rs =
|
|
7187
|
+
}, Rs = On("OpenTypeFeaturesPanel"), ga = [
|
|
7188
7188
|
// Ligatures
|
|
7189
7189
|
{ tag: "liga", label: "Standard Ligatures", description: "Common ligatures like fi, fl", category: "ligatures" },
|
|
7190
7190
|
{
|
|
@@ -7234,7 +7234,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7234
7234
|
onChange: i,
|
|
7235
7235
|
onGlyphOverridesChange: a
|
|
7236
7236
|
}) => {
|
|
7237
|
-
const [l, c] = le(!1), [f, d] = le([]), [m, p] = le(!1), [b, x] = le(!1), [v, C] = le(0), [R, E] = le(""), [A, T] = le(!1), [I, g] = le(/* @__PURE__ */ new Map()), [P,
|
|
7237
|
+
const [l, c] = le(!1), [f, d] = le([]), [m, p] = le(!1), [b, x] = le(!1), [v, C] = le(0), [R, E] = le(""), [A, T] = le(!1), [I, g] = le(/* @__PURE__ */ new Map()), [P, z] = le(!1);
|
|
7238
7238
|
Ie(() => {
|
|
7239
7239
|
if (!e) {
|
|
7240
7240
|
d([]);
|
|
@@ -7255,7 +7255,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7255
7255
|
g(/* @__PURE__ */ new Map());
|
|
7256
7256
|
return;
|
|
7257
7257
|
}
|
|
7258
|
-
|
|
7258
|
+
z(!0), (async () => {
|
|
7259
7259
|
const ae = /* @__PURE__ */ new Map();
|
|
7260
7260
|
for (const $ of G)
|
|
7261
7261
|
try {
|
|
@@ -7264,7 +7264,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7264
7264
|
} catch (me) {
|
|
7265
7265
|
Rs.error(`Error loading alternates for '${$}':`, me), ae.set($, 0);
|
|
7266
7266
|
}
|
|
7267
|
-
g(ae),
|
|
7267
|
+
g(ae), z(!1);
|
|
7268
7268
|
})();
|
|
7269
7269
|
}, [n, e, t]);
|
|
7270
7270
|
const D = (G) => {
|
|
@@ -7302,7 +7302,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7302
7302
|
onClick: () => c(!l),
|
|
7303
7303
|
children: [
|
|
7304
7304
|
/* @__PURE__ */ y("div", { className: "sc:flex sc:items-center sc:gap-sm", children: [
|
|
7305
|
-
/* @__PURE__ */ r(
|
|
7305
|
+
/* @__PURE__ */ r(Oe, { icon: _e.text, className: "sc:size-4" }),
|
|
7306
7306
|
/* @__PURE__ */ r("span", { className: "sc:text-xl sc:font-medium", children: "OpenType Features" }),
|
|
7307
7307
|
N > 0 && /* @__PURE__ */ r("span", { className: "sc:rounded-full sc:bg-info sc:px-xs sc:py-[2px] sc:text-2xs sc:font-semibold sc:text-info-foreground", children: N })
|
|
7308
7308
|
] }),
|
|
@@ -7421,45 +7421,45 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7421
7421
|
placement: "right",
|
|
7422
7422
|
maxWidth: "600px",
|
|
7423
7423
|
children: /* @__PURE__ */ y(
|
|
7424
|
-
|
|
7424
|
+
zt,
|
|
7425
7425
|
{
|
|
7426
7426
|
value: o,
|
|
7427
7427
|
onValueChange: (x) => i(x),
|
|
7428
7428
|
className: "sc:flex sc:flex-col sc:h-full",
|
|
7429
7429
|
children: [
|
|
7430
|
-
/* @__PURE__ */ r(
|
|
7431
|
-
/* @__PURE__ */ y(
|
|
7432
|
-
/* @__PURE__ */ r(
|
|
7430
|
+
/* @__PURE__ */ r(zt.ListContainer, { className: "sc:px-6", children: /* @__PURE__ */ y(zt.List, { "aria-label": "Effect types", children: [
|
|
7431
|
+
/* @__PURE__ */ y(zt.Tab, { id: "stroke", children: [
|
|
7432
|
+
/* @__PURE__ */ r(Oe, { icon: _e.minus, className: "sc:size-4" }),
|
|
7433
7433
|
"Stroke",
|
|
7434
7434
|
a && /* @__PURE__ */ r(Yn, { variant: "default", className: "sc:ml-2 sc:size-2 sc:rounded-full sc:p-0" }),
|
|
7435
|
-
/* @__PURE__ */ r(
|
|
7435
|
+
/* @__PURE__ */ r(zt.Indicator, {})
|
|
7436
7436
|
] }),
|
|
7437
|
-
/* @__PURE__ */ y(
|
|
7438
|
-
/* @__PURE__ */ r(
|
|
7437
|
+
/* @__PURE__ */ y(zt.Tab, { id: "masks", children: [
|
|
7438
|
+
/* @__PURE__ */ r(Oe, { icon: _e.group, className: "sc:size-4" }),
|
|
7439
7439
|
"Masks",
|
|
7440
7440
|
l && /* @__PURE__ */ r(Yn, { variant: "default", className: "sc:ml-2 sc:size-2 sc:rounded-full sc:p-0" }),
|
|
7441
|
-
/* @__PURE__ */ r(
|
|
7441
|
+
/* @__PURE__ */ r(zt.Indicator, {})
|
|
7442
7442
|
] }),
|
|
7443
|
-
/* @__PURE__ */ y(
|
|
7444
|
-
/* @__PURE__ */ r(
|
|
7443
|
+
/* @__PURE__ */ y(zt.Tab, { id: "distress", children: [
|
|
7444
|
+
/* @__PURE__ */ r(Oe, { icon: "lucide:cloud", className: "sc:size-4" }),
|
|
7445
7445
|
"Distress",
|
|
7446
7446
|
c && /* @__PURE__ */ r(Yn, { variant: "default", className: "sc:ml-2 sc:size-2 sc:rounded-full sc:p-0" }),
|
|
7447
|
-
/* @__PURE__ */ r(
|
|
7447
|
+
/* @__PURE__ */ r(zt.Indicator, {})
|
|
7448
7448
|
] }),
|
|
7449
|
-
/* @__PURE__ */ y(
|
|
7450
|
-
/* @__PURE__ */ r(
|
|
7449
|
+
/* @__PURE__ */ y(zt.Tab, { id: "compositing", children: [
|
|
7450
|
+
/* @__PURE__ */ r(Oe, { icon: _e.scissors, className: "sc:size-4" }),
|
|
7451
7451
|
"Knockout",
|
|
7452
7452
|
f && /* @__PURE__ */ r(Yn, { variant: "default", className: "sc:ml-2 sc:size-2 sc:rounded-full sc:p-0" }),
|
|
7453
|
-
/* @__PURE__ */ r(
|
|
7453
|
+
/* @__PURE__ */ r(zt.Indicator, {})
|
|
7454
7454
|
] }),
|
|
7455
|
-
d && /* @__PURE__ */ y(
|
|
7456
|
-
/* @__PURE__ */ r(
|
|
7455
|
+
d && /* @__PURE__ */ y(zt.Tab, { id: "typography", children: [
|
|
7456
|
+
/* @__PURE__ */ r(Oe, { icon: _e.text, className: "sc:size-4" }),
|
|
7457
7457
|
"Typography",
|
|
7458
7458
|
m && /* @__PURE__ */ r(Yn, { variant: "default", className: "sc:ml-2 sc:size-2 sc:rounded-full sc:p-0" }),
|
|
7459
|
-
/* @__PURE__ */ r(
|
|
7459
|
+
/* @__PURE__ */ r(zt.Indicator, {})
|
|
7460
7460
|
] })
|
|
7461
7461
|
] }) }),
|
|
7462
|
-
/* @__PURE__ */ y(
|
|
7462
|
+
/* @__PURE__ */ y(zt.Panel, { id: "stroke", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
|
|
7463
7463
|
/* @__PURE__ */ r(
|
|
7464
7464
|
Vi,
|
|
7465
7465
|
{
|
|
@@ -7471,11 +7471,11 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7471
7471
|
}
|
|
7472
7472
|
),
|
|
7473
7473
|
/* @__PURE__ */ r("div", { className: "sc:mt-6 sc:pt-4 sc:border-t sc:border-black/10 sc:dark:border-white/10", children: /* @__PURE__ */ y("div", { className: "sc:flex sc:items-start sc:gap-2 sc:text-xs sc:text-muted", children: [
|
|
7474
|
-
/* @__PURE__ */ r(
|
|
7474
|
+
/* @__PURE__ */ r(Oe, { icon: "lucide:lightbulb", className: "sc:size-4 sc:shrink-0 sc:mt-0.5" }),
|
|
7475
7475
|
/* @__PURE__ */ r("span", { children: "Add outlines to text and shapes" })
|
|
7476
7476
|
] }) })
|
|
7477
7477
|
] }),
|
|
7478
|
-
/* @__PURE__ */ y(
|
|
7478
|
+
/* @__PURE__ */ y(zt.Panel, { id: "masks", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
|
|
7479
7479
|
/* @__PURE__ */ r(
|
|
7480
7480
|
Ui,
|
|
7481
7481
|
{
|
|
@@ -7487,11 +7487,11 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7487
7487
|
}
|
|
7488
7488
|
),
|
|
7489
7489
|
/* @__PURE__ */ r("div", { className: "sc:mt-6 sc:pt-4 sc:border-t sc:border-black/10 sc:dark:border-white/10", children: /* @__PURE__ */ y("div", { className: "sc:flex sc:items-start sc:gap-2 sc:text-xs sc:text-muted", children: [
|
|
7490
|
-
/* @__PURE__ */ r(
|
|
7490
|
+
/* @__PURE__ */ r(Oe, { icon: "lucide:lightbulb", className: "sc:size-4 sc:shrink-0 sc:mt-0.5" }),
|
|
7491
7491
|
/* @__PURE__ */ r("span", { children: "Use masks to control visibility" })
|
|
7492
7492
|
] }) })
|
|
7493
7493
|
] }),
|
|
7494
|
-
/* @__PURE__ */ y(
|
|
7494
|
+
/* @__PURE__ */ y(zt.Panel, { id: "distress", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
|
|
7495
7495
|
/* @__PURE__ */ r(
|
|
7496
7496
|
la,
|
|
7497
7497
|
{
|
|
@@ -7503,11 +7503,11 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7503
7503
|
}
|
|
7504
7504
|
),
|
|
7505
7505
|
/* @__PURE__ */ r("div", { className: "sc:mt-6 sc:pt-4 sc:border-t sc:border-black/10 sc:dark:border-white/10", children: /* @__PURE__ */ y("div", { className: "sc:flex sc:items-start sc:gap-2 sc:text-xs sc:text-muted", children: [
|
|
7506
|
-
/* @__PURE__ */ r(
|
|
7506
|
+
/* @__PURE__ */ r(Oe, { icon: "lucide:lightbulb", className: "sc:size-4 sc:shrink-0 sc:mt-0.5" }),
|
|
7507
7507
|
/* @__PURE__ */ r("span", { children: "Add vintage/grunge effects for t-shirt designs" })
|
|
7508
7508
|
] }) })
|
|
7509
7509
|
] }),
|
|
7510
|
-
/* @__PURE__ */ y(
|
|
7510
|
+
/* @__PURE__ */ y(zt.Panel, { id: "compositing", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
|
|
7511
7511
|
/* @__PURE__ */ r(
|
|
7512
7512
|
fa,
|
|
7513
7513
|
{
|
|
@@ -7520,11 +7520,11 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7520
7520
|
}
|
|
7521
7521
|
),
|
|
7522
7522
|
/* @__PURE__ */ r("div", { className: "sc:mt-6 sc:pt-4 sc:border-t sc:border-black/10 sc:dark:border-white/10", children: /* @__PURE__ */ y("div", { className: "sc:flex sc:items-start sc:gap-2 sc:text-xs sc:text-muted", children: [
|
|
7523
|
-
/* @__PURE__ */ r(
|
|
7523
|
+
/* @__PURE__ */ r(Oe, { icon: "lucide:lightbulb", className: "sc:size-4 sc:shrink-0 sc:mt-0.5" }),
|
|
7524
7524
|
/* @__PURE__ */ r("span", { children: "Use Artboard scope for t-shirts, Group scope for patterns" })
|
|
7525
7525
|
] }) })
|
|
7526
7526
|
] }),
|
|
7527
|
-
d && /* @__PURE__ */ y(
|
|
7527
|
+
d && /* @__PURE__ */ y(zt.Panel, { id: "typography", className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
|
|
7528
7528
|
/* @__PURE__ */ r(
|
|
7529
7529
|
xa,
|
|
7530
7530
|
{
|
|
@@ -7544,7 +7544,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7544
7544
|
}
|
|
7545
7545
|
),
|
|
7546
7546
|
/* @__PURE__ */ r("div", { className: "sc:mt-6 sc:pt-4 sc:border-t sc:border-black/10 sc:dark:border-white/10", children: /* @__PURE__ */ y("div", { className: "sc:flex sc:items-start sc:gap-2 sc:text-xs sc:text-muted", children: [
|
|
7547
|
-
/* @__PURE__ */ r(
|
|
7547
|
+
/* @__PURE__ */ r(Oe, { icon: "lucide:lightbulb", className: "sc:size-4 sc:shrink-0 sc:mt-0.5" }),
|
|
7548
7548
|
/* @__PURE__ */ r("span", { children: "Enable advanced OpenType features like ligatures and stylistic sets" })
|
|
7549
7549
|
] }) })
|
|
7550
7550
|
] })
|
|
@@ -7579,7 +7579,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7579
7579
|
}, va = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7580
7580
|
__proto__: null,
|
|
7581
7581
|
EffectsPanel: ba
|
|
7582
|
-
}, Symbol.toStringTag, { value: "Module" })), Js =
|
|
7582
|
+
}, Symbol.toStringTag, { value: "Module" })), Js = On("ExportPanel"), Ca = ({
|
|
7583
7583
|
showContinuousExport: e = !0,
|
|
7584
7584
|
defaultScale: t = 3,
|
|
7585
7585
|
defaultFormat: n = "png",
|
|
@@ -7605,7 +7605,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7605
7605
|
} catch (w) {
|
|
7606
7606
|
Js.error("Export failed:", w), alert("Export failed. Please try again.");
|
|
7607
7607
|
}
|
|
7608
|
-
},
|
|
7608
|
+
}, z = async () => {
|
|
7609
7609
|
try {
|
|
7610
7610
|
const w = await l({ scale: R, format: A }), ne = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
7611
7611
|
Object.entries(w).forEach(([V, N]) => {
|
|
@@ -7778,7 +7778,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7778
7778
|
opacity: d || !C ? 0.5 : 1
|
|
7779
7779
|
},
|
|
7780
7780
|
children: [
|
|
7781
|
-
/* @__PURE__ */ r(
|
|
7781
|
+
/* @__PURE__ */ r(Oe, { icon: _e.download, className: "sc:size-4" }),
|
|
7782
7782
|
d ? "Exporting..." : "Export Active Artboard"
|
|
7783
7783
|
]
|
|
7784
7784
|
}
|
|
@@ -7786,7 +7786,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7786
7786
|
/* @__PURE__ */ y(
|
|
7787
7787
|
"button",
|
|
7788
7788
|
{
|
|
7789
|
-
onClick:
|
|
7789
|
+
onClick: z,
|
|
7790
7790
|
disabled: d || v.length === 0,
|
|
7791
7791
|
style: {
|
|
7792
7792
|
display: "flex",
|
|
@@ -7804,7 +7804,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7804
7804
|
opacity: d || v.length === 0 ? 0.5 : 1
|
|
7805
7805
|
},
|
|
7806
7806
|
children: [
|
|
7807
|
-
/* @__PURE__ */ r(
|
|
7807
|
+
/* @__PURE__ */ r(Oe, { icon: _e.image, className: "sc:size-4" }),
|
|
7808
7808
|
d ? "Exporting..." : "Export All Artboards"
|
|
7809
7809
|
]
|
|
7810
7810
|
}
|
|
@@ -7828,7 +7828,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7828
7828
|
fontWeight: 500
|
|
7829
7829
|
},
|
|
7830
7830
|
children: [
|
|
7831
|
-
m ? /* @__PURE__ */ r(
|
|
7831
|
+
m ? /* @__PURE__ */ r(Oe, { icon: _e.pause, className: "sc:size-4" }) : /* @__PURE__ */ r(Oe, { icon: _e.play, className: "sc:size-4" }),
|
|
7832
7832
|
m ? "Stop Continuous Export" : "Start Continuous Export"
|
|
7833
7833
|
]
|
|
7834
7834
|
}
|
|
@@ -7892,7 +7892,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7892
7892
|
}, wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7893
7893
|
__proto__: null,
|
|
7894
7894
|
ExportPanel: Ca
|
|
7895
|
-
}, Symbol.toStringTag, { value: "Module" })), Sa =
|
|
7895
|
+
}, Symbol.toStringTag, { value: "Module" })), Sa = On("GlyphBrowserDrawer"), Ea = ({
|
|
7896
7896
|
isOpen: e,
|
|
7897
7897
|
onClose: t,
|
|
7898
7898
|
fontFamily: n,
|
|
@@ -7931,7 +7931,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7931
7931
|
children: [
|
|
7932
7932
|
/* @__PURE__ */ r("div", { className: "sc:px-6 sc:py-4 sc:border-b sc:border-black/10 sc:dark:border-white/10", children: /* @__PURE__ */ y("div", { className: "sc:relative", children: [
|
|
7933
7933
|
/* @__PURE__ */ r(
|
|
7934
|
-
|
|
7934
|
+
Oe,
|
|
7935
7935
|
{
|
|
7936
7936
|
icon: _e.search,
|
|
7937
7937
|
className: "sc:absolute sc:left-3 sc:top-1/2 sc:-translate-y-1/2 sc:text-muted sc:pointer-events-none sc:size-4 sc:z-10"
|
|
@@ -7950,16 +7950,16 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7950
7950
|
] }) }),
|
|
7951
7951
|
/* @__PURE__ */ y("div", { className: "sc:flex-1 sc:overflow-y-auto sc:p-6", children: [
|
|
7952
7952
|
l && /* @__PURE__ */ y("div", { className: "sc:py-12 sc:text-center sc:text-muted", children: [
|
|
7953
|
-
/* @__PURE__ */ r(
|
|
7953
|
+
/* @__PURE__ */ r(zi, { size: "lg", className: "sc:mx-auto sc:mb-4" }),
|
|
7954
7954
|
/* @__PURE__ */ r("div", { className: "sc:text-sm", children: "Loading glyphs..." })
|
|
7955
7955
|
] }),
|
|
7956
7956
|
f && /* @__PURE__ */ y("div", { className: "sc:py-12 sc:text-center", children: [
|
|
7957
|
-
/* @__PURE__ */ r(
|
|
7957
|
+
/* @__PURE__ */ r(Oe, { icon: _e.alertCircle, className: "sc:size-12 sc:mx-auto sc:mb-4 sc:text-danger" }),
|
|
7958
7958
|
/* @__PURE__ */ r("div", { className: "sc:text-base sc:font-medium sc:mb-2", children: f }),
|
|
7959
7959
|
/* @__PURE__ */ r("div", { className: "sc:text-sm sc:text-muted", children: "This font may not have alternate glyphs." })
|
|
7960
7960
|
] }),
|
|
7961
7961
|
!l && !f && x.length === 0 && m && /* @__PURE__ */ y("div", { className: "sc:py-12 sc:text-center", children: [
|
|
7962
|
-
/* @__PURE__ */ r(
|
|
7962
|
+
/* @__PURE__ */ r(Oe, { icon: _e.search, className: "sc:size-12 sc:mx-auto sc:mb-4 sc:text-muted" }),
|
|
7963
7963
|
/* @__PURE__ */ y("div", { className: "sc:text-base sc:font-medium", children: [
|
|
7964
7964
|
'No glyphs found matching "',
|
|
7965
7965
|
m,
|
|
@@ -7998,7 +7998,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
7998
7998
|
]
|
|
7999
7999
|
}
|
|
8000
8000
|
);
|
|
8001
|
-
}, Qs =
|
|
8001
|
+
}, Qs = On("GlyphPanel"), ka = ({
|
|
8002
8002
|
isOpen: e,
|
|
8003
8003
|
onClose: t,
|
|
8004
8004
|
fontFamily: n,
|
|
@@ -8055,8 +8055,8 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8055
8055
|
createArtboard: d,
|
|
8056
8056
|
deleteArtboard: m,
|
|
8057
8057
|
renameArtboard: p
|
|
8058
|
-
} = ar(), [b, x] = le(null), [v, C] = le(""), R = (
|
|
8059
|
-
x(
|
|
8058
|
+
} = ar(), [b, x] = le(null), [v, C] = le(""), R = (z, D) => {
|
|
8059
|
+
x(z), C(D);
|
|
8060
8060
|
}, E = () => {
|
|
8061
8061
|
b && v.trim() && p(b, v.trim()), x(null), C("");
|
|
8062
8062
|
}, A = () => {
|
|
@@ -8065,15 +8065,15 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8065
8065
|
d(1200, 1200, {
|
|
8066
8066
|
name: `Artboard ${c.length + 1}`
|
|
8067
8067
|
}), a && setTimeout(() => {
|
|
8068
|
-
const
|
|
8069
|
-
|
|
8068
|
+
const z = c[c.length];
|
|
8069
|
+
z && a(z.id);
|
|
8070
8070
|
}, 10);
|
|
8071
|
-
}, I = (
|
|
8071
|
+
}, I = (z, D) => {
|
|
8072
8072
|
if (D.stopPropagation(), c.length <= 1) {
|
|
8073
8073
|
alert("Cannot delete the last artboard");
|
|
8074
8074
|
return;
|
|
8075
8075
|
}
|
|
8076
|
-
confirm("Delete this artboard?") && (m(
|
|
8076
|
+
confirm("Delete this artboard?") && (m(z), l && l(z));
|
|
8077
8077
|
}, g = e === "horizontal" ? {
|
|
8078
8078
|
display: "flex",
|
|
8079
8079
|
flexDirection: "row",
|
|
@@ -8095,32 +8095,32 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8095
8095
|
overflowX: "hidden",
|
|
8096
8096
|
minWidth: 200,
|
|
8097
8097
|
...o
|
|
8098
|
-
}, P = (
|
|
8098
|
+
}, P = (z) => ({
|
|
8099
8099
|
display: "flex",
|
|
8100
8100
|
alignItems: "center",
|
|
8101
8101
|
gap: 8,
|
|
8102
8102
|
padding: "8px 12px",
|
|
8103
|
-
backgroundColor:
|
|
8104
|
-
color:
|
|
8105
|
-
border:
|
|
8103
|
+
backgroundColor: z ? "var(--accent-primary)" : "var(--bg-primary)",
|
|
8104
|
+
color: z ? "var(--primary-foreground)" : "var(--text-primary)",
|
|
8105
|
+
border: z ? "none" : "1px solid var(--border-primary)",
|
|
8106
8106
|
borderRadius: 6,
|
|
8107
8107
|
cursor: "pointer",
|
|
8108
8108
|
fontSize: 13,
|
|
8109
|
-
fontWeight:
|
|
8109
|
+
fontWeight: z ? 600 : 400,
|
|
8110
8110
|
whiteSpace: "nowrap",
|
|
8111
8111
|
maxWidth: e === "horizontal" ? s : void 0,
|
|
8112
8112
|
minWidth: e === "horizontal" ? 120 : void 0,
|
|
8113
8113
|
transition: "all 0.2s"
|
|
8114
8114
|
});
|
|
8115
8115
|
return /* @__PURE__ */ y("div", { className: `artboard-tabs ${i}`, style: g, children: [
|
|
8116
|
-
c.map((
|
|
8117
|
-
const D = b ===
|
|
8116
|
+
c.map((z) => {
|
|
8117
|
+
const D = b === z.id;
|
|
8118
8118
|
return /* @__PURE__ */ y(
|
|
8119
8119
|
"div",
|
|
8120
8120
|
{
|
|
8121
|
-
style: P(
|
|
8122
|
-
onClick: () => !D && f(
|
|
8123
|
-
onDoubleClick: () => R(
|
|
8121
|
+
style: P(z.isActive),
|
|
8122
|
+
onClick: () => !D && f(z.id),
|
|
8123
|
+
onDoubleClick: () => R(z.id, z.name),
|
|
8124
8124
|
children: [
|
|
8125
8125
|
D ? /* @__PURE__ */ r(
|
|
8126
8126
|
"input",
|
|
@@ -8143,7 +8143,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8143
8143
|
minWidth: 80
|
|
8144
8144
|
}
|
|
8145
8145
|
}
|
|
8146
|
-
) : /* @__PURE__ */ r("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children:
|
|
8146
|
+
) : /* @__PURE__ */ r("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: z.name }),
|
|
8147
8147
|
/* @__PURE__ */ r(
|
|
8148
8148
|
"span",
|
|
8149
8149
|
{
|
|
@@ -8152,15 +8152,15 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8152
8152
|
opacity: 0.7,
|
|
8153
8153
|
padding: "2px 6px",
|
|
8154
8154
|
borderRadius: 10,
|
|
8155
|
-
backgroundColor:
|
|
8155
|
+
backgroundColor: z.isActive ? "color-mix(in srgb, var(--primary-foreground) 20%, transparent)" : "var(--bg-secondary)"
|
|
8156
8156
|
},
|
|
8157
|
-
children:
|
|
8157
|
+
children: z.elementCount
|
|
8158
8158
|
}
|
|
8159
8159
|
),
|
|
8160
8160
|
n && /* @__PURE__ */ r(
|
|
8161
8161
|
"button",
|
|
8162
8162
|
{
|
|
8163
|
-
onClick: (w) => I(
|
|
8163
|
+
onClick: (w) => I(z.id, w),
|
|
8164
8164
|
style: {
|
|
8165
8165
|
background: "none",
|
|
8166
8166
|
border: "none",
|
|
@@ -8174,12 +8174,12 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8174
8174
|
onMouseEnter: (w) => w.currentTarget.style.opacity = "1",
|
|
8175
8175
|
onMouseLeave: (w) => w.currentTarget.style.opacity = "0.7",
|
|
8176
8176
|
title: "Delete artboard",
|
|
8177
|
-
children: /* @__PURE__ */ r(
|
|
8177
|
+
children: /* @__PURE__ */ r(Oe, { icon: _e.close, className: "sc:size-3.5" })
|
|
8178
8178
|
}
|
|
8179
8179
|
)
|
|
8180
8180
|
]
|
|
8181
8181
|
},
|
|
8182
|
-
|
|
8182
|
+
z.id
|
|
8183
8183
|
);
|
|
8184
8184
|
}),
|
|
8185
8185
|
t && /* @__PURE__ */ y(
|
|
@@ -8201,15 +8201,15 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8201
8201
|
minWidth: e === "horizontal" ? 120 : void 0,
|
|
8202
8202
|
transition: "all 0.2s"
|
|
8203
8203
|
},
|
|
8204
|
-
onMouseEnter: (
|
|
8205
|
-
|
|
8204
|
+
onMouseEnter: (z) => {
|
|
8205
|
+
z.currentTarget.style.backgroundColor = "var(--bg-tertiary)", z.currentTarget.style.borderColor = "var(--accent-primary)";
|
|
8206
8206
|
},
|
|
8207
|
-
onMouseLeave: (
|
|
8208
|
-
|
|
8207
|
+
onMouseLeave: (z) => {
|
|
8208
|
+
z.currentTarget.style.backgroundColor = "var(--bg-primary)", z.currentTarget.style.borderColor = "var(--border-primary)";
|
|
8209
8209
|
},
|
|
8210
8210
|
title: "Add new artboard",
|
|
8211
8211
|
children: [
|
|
8212
|
-
/* @__PURE__ */ r(
|
|
8212
|
+
/* @__PURE__ */ r(Oe, { icon: _e.plus, className: "sc:size-3.5" }),
|
|
8213
8213
|
/* @__PURE__ */ r("span", { children: "New Artboard" })
|
|
8214
8214
|
]
|
|
8215
8215
|
}
|
|
@@ -8256,7 +8256,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8256
8256
|
onClick: a,
|
|
8257
8257
|
disabled: o <= 0.1,
|
|
8258
8258
|
"aria-label": "Zoom out",
|
|
8259
|
-
children: /* @__PURE__ */ r(
|
|
8259
|
+
children: /* @__PURE__ */ r(Oe, { icon: _e.minus, className: "sc:size-4" })
|
|
8260
8260
|
}
|
|
8261
8261
|
) }),
|
|
8262
8262
|
/* @__PURE__ */ r(hn, { children: "Zoom out" })
|
|
@@ -8287,7 +8287,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8287
8287
|
onClick: i,
|
|
8288
8288
|
disabled: o >= 4,
|
|
8289
8289
|
"aria-label": "Zoom in",
|
|
8290
|
-
children: /* @__PURE__ */ r(
|
|
8290
|
+
children: /* @__PURE__ */ r(Oe, { icon: _e.plus, className: "sc:size-4" })
|
|
8291
8291
|
}
|
|
8292
8292
|
) }),
|
|
8293
8293
|
/* @__PURE__ */ r(hn, { children: "Zoom in" })
|
|
@@ -8311,7 +8311,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8311
8311
|
size: "icon",
|
|
8312
8312
|
onClick: l,
|
|
8313
8313
|
"aria-label": "Fit to screen",
|
|
8314
|
-
children: /* @__PURE__ */ r(
|
|
8314
|
+
children: /* @__PURE__ */ r(Oe, { icon: _e.fitScreen, className: "sc:size-4" })
|
|
8315
8315
|
}
|
|
8316
8316
|
) }),
|
|
8317
8317
|
/* @__PURE__ */ r(hn, { children: "Fit to screen" })
|
|
@@ -8324,7 +8324,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8324
8324
|
size: "icon",
|
|
8325
8325
|
onClick: c,
|
|
8326
8326
|
"aria-label": "Reset to 100%",
|
|
8327
|
-
children: /* @__PURE__ */ r(
|
|
8327
|
+
children: /* @__PURE__ */ r(Oe, { icon: _e.maximize, className: "sc:size-4" })
|
|
8328
8328
|
}
|
|
8329
8329
|
) }),
|
|
8330
8330
|
/* @__PURE__ */ r(hn, { children: "Reset to 100%" })
|
|
@@ -8336,7 +8336,7 @@ const fa = ({ blendMode: e = "normal", knockoutParts: t, onChange: n }) => {
|
|
|
8336
8336
|
__proto__: null,
|
|
8337
8337
|
ZoomControls: er,
|
|
8338
8338
|
default: er
|
|
8339
|
-
}, Symbol.toStringTag, { value: "Module" })), tr =
|
|
8339
|
+
}, Symbol.toStringTag, { value: "Module" })), tr = On("AutoExportManager"), Pa = {
|
|
8340
8340
|
enabled: !0,
|
|
8341
8341
|
debounceMs: 100,
|
|
8342
8342
|
maxWaitMs: 1e3
|
|
@@ -8694,4 +8694,4 @@ export {
|
|
|
8694
8694
|
Za as u,
|
|
8695
8695
|
oc as v
|
|
8696
8696
|
};
|
|
8697
|
-
//# sourceMappingURL=validation-
|
|
8697
|
+
//# sourceMappingURL=validation-D6zVSeTh.js.map
|