@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
|
@@ -2,13 +2,13 @@ import { jsx as t, jsxs as f, Fragment as Ye } from "react/jsx-runtime";
|
|
|
2
2
|
import * as ce from "react";
|
|
3
3
|
import Fe, { useRef as V, useEffect as Z, useCallback as S, useState as T, useLayoutEffect as Eo, useMemo as He, memo as Io, useSyncExternalStore as fr } from "react";
|
|
4
4
|
import { createPortal as Ro } from "react-dom";
|
|
5
|
-
import { b as
|
|
6
|
-
import { u as Lo, I as J, c as Se, V as gr, i as ie, m as bt, B as P, W as br, T as fe, q as
|
|
7
|
-
import { R as gs, L as Me, a as wr, I as kr, T as st } from "./custom-icons-
|
|
8
|
-
import { i as Fo, aX as Oo, b0 as _o, aY as
|
|
5
|
+
import { b as ms, d as zo, c as hr, t as mr } from "./design-builder-BFM94eA9.js";
|
|
6
|
+
import { u as Lo, I as J, c as Se, V as gr, i as ie, m as bt, B as P, W as br, T as fe, q as he, r as me, X as U, w as Ht, a as Ao, U as Ze, D as yr, C as xr, j as vr, S as Cr } from "./useCommands-DSapP-w1.js";
|
|
7
|
+
import { R as gs, L as Me, a as wr, I as kr, T as st } from "./custom-icons-D_XezOul.js";
|
|
8
|
+
import { i as Fo, aX as Oo, b0 as _o, aY as mo, b1 as Tr, c as bs, Y as Nr, b2 as Sr, b3 as Dr, b4 as Mr, b5 as Er, b6 as go, X as bo, V as Ir, G as Dt, T as Ue, q as Rr, I as ot, S as Hs, P as Bo, t as zr, b7 as jo, b8 as Lr, a$ as Ar } from "./FontAnalyzer-Ch1jgTq7.js";
|
|
9
9
|
import * as Mt from "@radix-ui/react-popover";
|
|
10
10
|
import * as dt from "@radix-ui/react-slider";
|
|
11
|
-
import { T as yo, S as $o, U as Ws, V as Vs, X as Uo, Y as Ys, G as _s, H as Fr, J as Or, K as _r, Z as xo } from "./ExportManager-
|
|
11
|
+
import { T as yo, S as $o, U as Ws, V as Vs, X as Uo, Y as Ys, G as _s, H as Fr, J as Or, K as _r, Z as xo } from "./ExportManager-9_RjQEv0.js";
|
|
12
12
|
import * as en from "@radix-ui/react-collapsible";
|
|
13
13
|
import * as Xs from "@radix-ui/react-switch";
|
|
14
14
|
import * as qs from "@radix-ui/react-checkbox";
|
|
@@ -278,16 +278,16 @@ const oc = ce.forwardRef(
|
|
|
278
278
|
...g
|
|
279
279
|
}, b) => {
|
|
280
280
|
var q;
|
|
281
|
-
const C = s !== void 0 ? Array.isArray(s) ? s : [s] : void 0, [y, x] = ce.useState(C ?? [r]),
|
|
282
|
-
|
|
281
|
+
const C = s !== void 0 ? Array.isArray(s) ? s : [s] : void 0, [y, x] = ce.useState(C ?? [r]), m = ce.useRef(!1), N = ce.useRef(null), v = ce.useCallback((B) => {
|
|
282
|
+
m.current && B.preventDefault();
|
|
283
283
|
}, []), M = (B) => {
|
|
284
|
-
|
|
284
|
+
m.current = !0, x(B), n == null || n(B);
|
|
285
285
|
}, E = (B) => {
|
|
286
|
-
|
|
286
|
+
m.current = !1, o == null || o(B);
|
|
287
287
|
}, D = ce.useCallback(() => {
|
|
288
288
|
N.current || (N.current = v, document.addEventListener("touchmove", v, { passive: !1 }));
|
|
289
289
|
}, [v]), k = ce.useCallback(() => {
|
|
290
|
-
|
|
290
|
+
m.current = !1, N.current && (document.removeEventListener("touchmove", N.current), N.current = null);
|
|
291
291
|
}, []);
|
|
292
292
|
ce.useEffect(() => () => {
|
|
293
293
|
N.current && document.removeEventListener("touchmove", N.current);
|
|
@@ -456,7 +456,7 @@ const be = ({
|
|
|
456
456
|
{
|
|
457
457
|
type: "number",
|
|
458
458
|
value: x,
|
|
459
|
-
onChange: (
|
|
459
|
+
onChange: (m) => n(Math.max(r, Math.min(c, Number(m.target.value)))),
|
|
460
460
|
min: r,
|
|
461
461
|
max: c,
|
|
462
462
|
"aria-label": `${e} value`,
|
|
@@ -469,8 +469,8 @@ const be = ({
|
|
|
469
469
|
ge,
|
|
470
470
|
{
|
|
471
471
|
value: [s],
|
|
472
|
-
onValueChange: (
|
|
473
|
-
onChangeEnd: o ? (
|
|
472
|
+
onValueChange: (m) => n(m[0]),
|
|
473
|
+
onChangeEnd: o ? (m) => o(m[0]) : void 0,
|
|
474
474
|
min: r,
|
|
475
475
|
max: c,
|
|
476
476
|
step: i,
|
|
@@ -487,7 +487,7 @@ const be = ({
|
|
|
487
487
|
{
|
|
488
488
|
type: "number",
|
|
489
489
|
value: x,
|
|
490
|
-
onChange: (
|
|
490
|
+
onChange: (m) => n(Math.max(r, Math.min(c, Number(m.target.value)))),
|
|
491
491
|
min: r,
|
|
492
492
|
max: c,
|
|
493
493
|
"aria-label": `${e} value`,
|
|
@@ -499,8 +499,8 @@ const be = ({
|
|
|
499
499
|
ge,
|
|
500
500
|
{
|
|
501
501
|
value: [s],
|
|
502
|
-
onValueChange: (
|
|
503
|
-
onChangeEnd: o ? (
|
|
502
|
+
onValueChange: (m) => n(m[0]),
|
|
503
|
+
onChangeEnd: o ? (m) => o(m[0]) : void 0,
|
|
504
504
|
min: r,
|
|
505
505
|
max: c,
|
|
506
506
|
step: i,
|
|
@@ -531,12 +531,12 @@ const be = ({
|
|
|
531
531
|
y.preventDefault(), y.stopPropagation();
|
|
532
532
|
const x = i.current;
|
|
533
533
|
if (!x) return;
|
|
534
|
-
const
|
|
535
|
-
let v =
|
|
536
|
-
v === -1 && (v =
|
|
534
|
+
const m = Array.from(x.querySelectorAll("button[data-preset-id]")), N = document.activeElement;
|
|
535
|
+
let v = m.indexOf(N);
|
|
536
|
+
v === -1 && (v = m.findIndex((k) => k.getAttribute("aria-selected") === "true"), v === -1 && (v = 0));
|
|
537
537
|
let M;
|
|
538
|
-
y.key === "ArrowRight" ? M = v <
|
|
539
|
-
const E =
|
|
538
|
+
y.key === "ArrowRight" ? M = v < m.length - 1 ? v + 1 : 0 : M = v > 0 ? v - 1 : m.length - 1;
|
|
539
|
+
const E = m[M];
|
|
540
540
|
E.focus(), p(E);
|
|
541
541
|
const D = E.getAttribute("data-preset-id");
|
|
542
542
|
D !== null && n(D);
|
|
@@ -568,16 +568,16 @@ const be = ({
|
|
|
568
568
|
}
|
|
569
569
|
),
|
|
570
570
|
e.map((y, x) => {
|
|
571
|
-
const
|
|
571
|
+
const m = s === y.id, N = m || !o && !C && x === 0;
|
|
572
572
|
return /* @__PURE__ */ t(
|
|
573
573
|
"button",
|
|
574
574
|
{
|
|
575
575
|
"data-preset-id": y.id,
|
|
576
576
|
role: "option",
|
|
577
|
-
"aria-selected":
|
|
577
|
+
"aria-selected": m,
|
|
578
578
|
tabIndex: N ? 0 : -1,
|
|
579
579
|
onClick: () => n(y.id),
|
|
580
|
-
className: `sc:shrink-0 sc:rounded-md sc:transition-all ${
|
|
580
|
+
className: `sc:shrink-0 sc:rounded-md sc:transition-all ${m ? Co : wo}`,
|
|
581
581
|
style: { width: r, height: r },
|
|
582
582
|
title: y.name,
|
|
583
583
|
children: y.thumbnailUrl && /* @__PURE__ */ t(
|
|
@@ -662,10 +662,10 @@ var qt = function(e, s, n) {
|
|
|
662
662
|
var I = k.which || k.keyCode;
|
|
663
663
|
I >= 37 && I <= 40 && g();
|
|
664
664
|
}, D];
|
|
665
|
-
}, [p, i, g]), x = y[0],
|
|
665
|
+
}, [p, i, g]), x = y[0], m = y[1], N = y[2], v = y[3];
|
|
666
666
|
return Z(function() {
|
|
667
667
|
return v;
|
|
668
|
-
}, [v]), Fe.createElement("div", xs({}, r, { onTouchStart: x, onMouseDown: x, className: "react-colorful__interactive", ref: c, onKeyDown:
|
|
668
|
+
}, [v]), Fe.createElement("div", xs({}, r, { onTouchStart: x, onMouseDown: x, className: "react-colorful__interactive", ref: c, onKeyDown: m, onKeyUp: N, tabIndex: 0, role: "slider" }));
|
|
669
669
|
}), tn = function(e) {
|
|
670
670
|
return e.filter(Boolean).join(" ");
|
|
671
671
|
}, rc = function(e) {
|
|
@@ -726,16 +726,16 @@ function ti(e, s, n, o) {
|
|
|
726
726
|
}), p = i[0], g = i[1], b = V({ color: s, hsva: p }), C = V(!1);
|
|
727
727
|
Z(function() {
|
|
728
728
|
if (!e.equal(s, b.current.color)) {
|
|
729
|
-
var
|
|
730
|
-
b.current = { hsva:
|
|
729
|
+
var m = e.toHsva(s);
|
|
730
|
+
b.current = { hsva: m, color: s }, g(m), C.current = !1;
|
|
731
731
|
}
|
|
732
732
|
}, [s, e]), Z(function() {
|
|
733
|
-
var
|
|
734
|
-
ic(p, b.current.hsva) || e.equal(
|
|
733
|
+
var m;
|
|
734
|
+
ic(p, b.current.hsva) || e.equal(m = e.fromHsva(p), b.current.color) || (b.current = { hsva: p, color: m }, r(m), C.current = !0);
|
|
735
735
|
}, [p, e, r]);
|
|
736
|
-
var y = S(function(
|
|
736
|
+
var y = S(function(m) {
|
|
737
737
|
g(function(N) {
|
|
738
|
-
return Object.assign({}, N,
|
|
738
|
+
return Object.assign({}, N, m);
|
|
739
739
|
});
|
|
740
740
|
}, []), x = S(function() {
|
|
741
741
|
C.current && (C.current = !1, c(b.current.color));
|
|
@@ -757,8 +757,8 @@ var si = typeof window < "u" ? Eo : Z, ni = function() {
|
|
|
757
757
|
}, ci = function(e) {
|
|
758
758
|
var s = e.className, n = e.colorModel, o = e.color, r = o === void 0 ? n.defaultColor : o, c = e.onChange, i = e.onChangeEnd, p = cc(e, ["className", "colorModel", "color", "onChange", "onChangeEnd"]), g = V(null);
|
|
759
759
|
oi(g);
|
|
760
|
-
var b = ti(n, r, c, i), C = b[0], y = b[1], x = b[2],
|
|
761
|
-
return Fe.createElement("div", xs({}, p, { ref: g, className:
|
|
760
|
+
var b = ti(n, r, c, i), C = b[0], y = b[1], x = b[2], m = tn(["react-colorful", s]);
|
|
761
|
+
return Fe.createElement("div", xs({}, p, { ref: g, className: m }), Fe.createElement(Qr, { hsva: C, onChange: y, onChangeEnd: x }), Fe.createElement(Jr, { hue: C.h, onChange: y, onChangeEnd: x, className: "react-colorful__last-control" }));
|
|
762
762
|
}, ai = { defaultColor: "000", toHsva: Xr, fromHsva: function(e) {
|
|
763
763
|
return qr({ h: e.h, s: e.s, v: e.v, a: 1 });
|
|
764
764
|
}, equal: ei }, lc = function(e) {
|
|
@@ -776,14 +776,14 @@ const Et = Io(({
|
|
|
776
776
|
onOpenChange: g,
|
|
777
777
|
embedded: b = !1
|
|
778
778
|
}) => {
|
|
779
|
-
const [C, y] = T(!1), [x,
|
|
779
|
+
const [C, y] = T(!1), [x, m] = T(e), [N, v] = T(e), M = V(0), E = V(null), D = V(!1), k = V(s);
|
|
780
780
|
k.current = s;
|
|
781
781
|
const I = p !== void 0 ? p : C, L = g || y;
|
|
782
782
|
Z(() => {
|
|
783
|
-
!D.current && e !== "transparent" && (
|
|
783
|
+
!D.current && e !== "transparent" && (m(e), v(e));
|
|
784
784
|
}, [e]);
|
|
785
785
|
const z = (X) => {
|
|
786
|
-
D.current = !0, v(X),
|
|
786
|
+
D.current = !0, v(X), m(X);
|
|
787
787
|
const K = Date.now(), Y = K - M.current;
|
|
788
788
|
Y >= 16 ? (k.current({ target: { value: X } }), M.current = K, E.current && (clearTimeout(E.current), E.current = null)) : (E.current && clearTimeout(E.current), E.current = setTimeout(() => {
|
|
789
789
|
k.current({ target: { value: X } }), M.current = Date.now(), E.current = null, D.current = !1;
|
|
@@ -803,7 +803,7 @@ const Et = Io(({
|
|
|
803
803
|
}, []);
|
|
804
804
|
const B = (X) => {
|
|
805
805
|
const K = X.target.value;
|
|
806
|
-
|
|
806
|
+
m(K);
|
|
807
807
|
const Y = /^#?([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/, de = K.startsWith("#") ? K : `#${K}`;
|
|
808
808
|
Y.test(de) && k.current({ target: { value: de } });
|
|
809
809
|
}, j = (X) => {
|
|
@@ -909,7 +909,7 @@ const ri = () => /* @__PURE__ */ t(
|
|
|
909
909
|
);
|
|
910
910
|
function ii({ onClick: e }) {
|
|
911
911
|
return /* @__PURE__ */ t(br, { delayDuration: 300, children: /* @__PURE__ */ f(fe, { children: [
|
|
912
|
-
/* @__PURE__ */ t(
|
|
912
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
913
913
|
P,
|
|
914
914
|
{
|
|
915
915
|
variant: "outline",
|
|
@@ -919,7 +919,7 @@ function ii({ onClick: e }) {
|
|
|
919
919
|
children: /* @__PURE__ */ t(ri, {})
|
|
920
920
|
}
|
|
921
921
|
) }),
|
|
922
|
-
/* @__PURE__ */ t(
|
|
922
|
+
/* @__PURE__ */ t(me, { children: "Back" })
|
|
923
923
|
] }) });
|
|
924
924
|
}
|
|
925
925
|
const jt = 1e-3;
|
|
@@ -970,7 +970,7 @@ const li = ({
|
|
|
970
970
|
onDelete: C,
|
|
971
971
|
cornerRadiusExpanded: y = !1,
|
|
972
972
|
onCornerRadiusToggle: x,
|
|
973
|
-
cropExpanded:
|
|
973
|
+
cropExpanded: m = !1,
|
|
974
974
|
onCropToggle: N,
|
|
975
975
|
adjustExpanded: v = !1,
|
|
976
976
|
onAdjustToggle: M,
|
|
@@ -991,7 +991,7 @@ const li = ({
|
|
|
991
991
|
imageMaskExpanded: K = !1,
|
|
992
992
|
onImageMaskToggle: Y
|
|
993
993
|
}) => {
|
|
994
|
-
const [de, A] = T(!1), [te, De] = T(!1), [W, ve] = T(!1), [we, ke] = T(!1), [Re, Ee] = T(!1), [ye, Ie] = T(!1), [ze,
|
|
994
|
+
const [de, A] = T(!1), [te, De] = T(!1), [W, ve] = T(!1), [we, ke] = T(!1), [Re, Ee] = T(!1), [ye, Ie] = T(!1), [ze, h] = T(!1), [w, R] = T(!1), [$, G] = T(!1), [Te, H] = T(!1), [ae, Je] = T(!1), [Ce, We] = T(!1), [Qe, et] = T(!1), [tt, xt] = T(!1), ct = e.isCropping, $e = vs(e), l = () => {
|
|
995
995
|
if (Ee(!0), ct) {
|
|
996
996
|
const re = e.clone();
|
|
997
997
|
re.exitCropMode(), s(re);
|
|
@@ -1050,8 +1050,8 @@ const li = ({
|
|
|
1050
1050
|
onClick: l,
|
|
1051
1051
|
onMouseLeave: () => Ee(!1),
|
|
1052
1052
|
tooltip: ct ? "Exit Crop Mode" : "Crop",
|
|
1053
|
-
tooltipDisabled: Re ||
|
|
1054
|
-
active: ct ||
|
|
1053
|
+
tooltipDisabled: Re || m,
|
|
1054
|
+
active: ct || m
|
|
1055
1055
|
}
|
|
1056
1056
|
),
|
|
1057
1057
|
/* @__PURE__ */ t(U, { icon: "lucide:flip-horizontal-2", onClick: ne, tooltip: "Flip Horizontal" }),
|
|
@@ -1076,9 +1076,9 @@ const li = ({
|
|
|
1076
1076
|
{
|
|
1077
1077
|
icon: /* @__PURE__ */ t(gs, { size: 20, className: "sc:md:size-5" }),
|
|
1078
1078
|
onClick: () => {
|
|
1079
|
-
|
|
1079
|
+
h(!0), D == null || D();
|
|
1080
1080
|
},
|
|
1081
|
-
onMouseLeave: () =>
|
|
1081
|
+
onMouseLeave: () => h(!1),
|
|
1082
1082
|
tooltip: "Rotate",
|
|
1083
1083
|
tooltipDisabled: ze || E,
|
|
1084
1084
|
active: E || $e.rotation
|
|
@@ -1192,7 +1192,7 @@ const li = ({
|
|
|
1192
1192
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(J, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" }) }) }),
|
|
1193
1193
|
/* @__PURE__ */ t(Xe, { align: "end", className: "sc:w-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:gap-1", children: [
|
|
1194
1194
|
r && /* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
1195
|
-
/* @__PURE__ */ t(
|
|
1195
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1196
1196
|
P,
|
|
1197
1197
|
{
|
|
1198
1198
|
variant: "ghost",
|
|
@@ -1204,10 +1204,10 @@ const li = ({
|
|
|
1204
1204
|
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-5" })
|
|
1205
1205
|
}
|
|
1206
1206
|
) }),
|
|
1207
|
-
/* @__PURE__ */ t(
|
|
1207
|
+
/* @__PURE__ */ t(me, { children: "Move Forward" })
|
|
1208
1208
|
] }),
|
|
1209
1209
|
c && /* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
1210
|
-
/* @__PURE__ */ t(
|
|
1210
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1211
1211
|
P,
|
|
1212
1212
|
{
|
|
1213
1213
|
variant: "ghost",
|
|
@@ -1219,10 +1219,10 @@ const li = ({
|
|
|
1219
1219
|
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-5" })
|
|
1220
1220
|
}
|
|
1221
1221
|
) }),
|
|
1222
|
-
/* @__PURE__ */ t(
|
|
1222
|
+
/* @__PURE__ */ t(me, { children: "Move Backward" })
|
|
1223
1223
|
] }),
|
|
1224
1224
|
C && /* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
1225
|
-
/* @__PURE__ */ t(
|
|
1225
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1226
1226
|
P,
|
|
1227
1227
|
{
|
|
1228
1228
|
variant: "ghost",
|
|
@@ -1234,13 +1234,13 @@ const li = ({
|
|
|
1234
1234
|
children: /* @__PURE__ */ t(J, { icon: ie.trash, className: "sc:size-5" })
|
|
1235
1235
|
}
|
|
1236
1236
|
) }),
|
|
1237
|
-
/* @__PURE__ */ t(
|
|
1237
|
+
/* @__PURE__ */ t(me, { children: "Delete" })
|
|
1238
1238
|
] })
|
|
1239
1239
|
] }) })
|
|
1240
1240
|
] }),
|
|
1241
1241
|
n && o && /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1242
|
-
/* @__PURE__ */ t(
|
|
1243
|
-
/* @__PURE__ */ t(
|
|
1242
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", size: "sm", onClick: o, children: "Ungroup" }) }),
|
|
1243
|
+
/* @__PURE__ */ t(me, { children: "Ungroup this group" })
|
|
1244
1244
|
] })
|
|
1245
1245
|
] });
|
|
1246
1246
|
}, Js = [
|
|
@@ -1268,7 +1268,7 @@ const li = ({
|
|
|
1268
1268
|
rotationExpanded: C = !1,
|
|
1269
1269
|
onRotationToggle: y,
|
|
1270
1270
|
cornerRadiusExpanded: x = !1,
|
|
1271
|
-
onCornerRadiusToggle:
|
|
1271
|
+
onCornerRadiusToggle: m,
|
|
1272
1272
|
transparencyExpanded: N = !1,
|
|
1273
1273
|
onTransparencyToggle: v,
|
|
1274
1274
|
sidesExpanded: M = !1,
|
|
@@ -1292,7 +1292,7 @@ const li = ({
|
|
|
1292
1292
|
imageMaskExpanded: A = !1,
|
|
1293
1293
|
onImageMaskToggle: te
|
|
1294
1294
|
}) => {
|
|
1295
|
-
const [De, W] = T(!1), [ve, we] = T(!1), [ke, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1), [
|
|
1295
|
+
const [De, W] = T(!1), [ve, we] = T(!1), [ke, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1), [h, w] = T(!1), [R, $] = T(!1), [G, Te] = T(!1), [H, ae] = T(!1), [Je, Ce] = T(!1), [We, Qe] = T(!1), [et, tt] = T(!1), [xt, ct] = T(!1), [$e, l] = T(!1), [ne, at] = T(!1), re = He(() => Js.map((wt) => wt.color), []), rt = He(() => n && n.length > 0 ? n : re, [n, re]), Le = vs(e), Kt = (wt) => {
|
|
1296
1296
|
const kt = e.clone();
|
|
1297
1297
|
kt.transformData.fillColor = wt.target.value, delete kt.transformData.fill, s(kt);
|
|
1298
1298
|
}, vt = {
|
|
@@ -1318,7 +1318,7 @@ const li = ({
|
|
|
1318
1318
|
}
|
|
1319
1319
|
),
|
|
1320
1320
|
q ? /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1321
|
-
/* @__PURE__ */ t(
|
|
1321
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1322
1322
|
"button",
|
|
1323
1323
|
{
|
|
1324
1324
|
className: "sc-toolbar-btn",
|
|
@@ -1337,9 +1337,9 @@ const li = ({
|
|
|
1337
1337
|
)
|
|
1338
1338
|
}
|
|
1339
1339
|
) }),
|
|
1340
|
-
!H && !z && /* @__PURE__ */ t(
|
|
1340
|
+
!H && !z && /* @__PURE__ */ t(me, { children: "Fill Color" })
|
|
1341
1341
|
] }) : /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1342
|
-
/* @__PURE__ */ t(
|
|
1342
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
1343
1343
|
Et,
|
|
1344
1344
|
{
|
|
1345
1345
|
value: e.transformData.fillColor || "#3b82f6",
|
|
@@ -1349,14 +1349,14 @@ const li = ({
|
|
|
1349
1349
|
showSquare: !0
|
|
1350
1350
|
}
|
|
1351
1351
|
) }) }),
|
|
1352
|
-
/* @__PURE__ */ t(
|
|
1352
|
+
/* @__PURE__ */ t(me, { children: "Fill Color" })
|
|
1353
1353
|
] }),
|
|
1354
|
-
e.transformData.shapeType === "rectangle" &&
|
|
1354
|
+
e.transformData.shapeType === "rectangle" && m && /* @__PURE__ */ t(
|
|
1355
1355
|
U,
|
|
1356
1356
|
{
|
|
1357
1357
|
icon: "lucide:square-round-corner",
|
|
1358
1358
|
onClick: () => {
|
|
1359
|
-
ye(!0),
|
|
1359
|
+
ye(!0), m();
|
|
1360
1360
|
},
|
|
1361
1361
|
onMouseLeave: () => ye(!1),
|
|
1362
1362
|
tooltip: "Corner Radius",
|
|
@@ -1373,7 +1373,7 @@ const li = ({
|
|
|
1373
1373
|
},
|
|
1374
1374
|
onMouseLeave: () => w(!1),
|
|
1375
1375
|
tooltip: "Sides",
|
|
1376
|
-
tooltipDisabled:
|
|
1376
|
+
tooltipDisabled: h || M,
|
|
1377
1377
|
active: M
|
|
1378
1378
|
}
|
|
1379
1379
|
),
|
|
@@ -1511,7 +1511,7 @@ const li = ({
|
|
|
1511
1511
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(J, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" }) }) }),
|
|
1512
1512
|
/* @__PURE__ */ t(Xe, { align: "end", className: "sc:w-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:gap-1", children: [
|
|
1513
1513
|
i && /* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
1514
|
-
/* @__PURE__ */ t(
|
|
1514
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1515
1515
|
P,
|
|
1516
1516
|
{
|
|
1517
1517
|
variant: "ghost",
|
|
@@ -1523,10 +1523,10 @@ const li = ({
|
|
|
1523
1523
|
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-5" })
|
|
1524
1524
|
}
|
|
1525
1525
|
) }),
|
|
1526
|
-
/* @__PURE__ */ t(
|
|
1526
|
+
/* @__PURE__ */ t(me, { children: "Move Forward" })
|
|
1527
1527
|
] }),
|
|
1528
1528
|
p && /* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
1529
|
-
/* @__PURE__ */ t(
|
|
1529
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1530
1530
|
P,
|
|
1531
1531
|
{
|
|
1532
1532
|
variant: "ghost",
|
|
@@ -1538,10 +1538,10 @@ const li = ({
|
|
|
1538
1538
|
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-5" })
|
|
1539
1539
|
}
|
|
1540
1540
|
) }),
|
|
1541
|
-
/* @__PURE__ */ t(
|
|
1541
|
+
/* @__PURE__ */ t(me, { children: "Move Backward" })
|
|
1542
1542
|
] }),
|
|
1543
1543
|
b && /* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
1544
|
-
/* @__PURE__ */ t(
|
|
1544
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1545
1545
|
P,
|
|
1546
1546
|
{
|
|
1547
1547
|
variant: "ghost",
|
|
@@ -1553,13 +1553,13 @@ const li = ({
|
|
|
1553
1553
|
children: /* @__PURE__ */ t(J, { icon: ie.trash, className: "sc:size-5" })
|
|
1554
1554
|
}
|
|
1555
1555
|
) }),
|
|
1556
|
-
/* @__PURE__ */ t(
|
|
1556
|
+
/* @__PURE__ */ t(me, { children: "Delete" })
|
|
1557
1557
|
] })
|
|
1558
1558
|
] }) })
|
|
1559
1559
|
] }),
|
|
1560
1560
|
r && c && /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1561
|
-
/* @__PURE__ */ t(
|
|
1562
|
-
/* @__PURE__ */ t(
|
|
1561
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", size: "sm", onClick: c, children: "Ungroup" }) }),
|
|
1562
|
+
/* @__PURE__ */ t(me, { children: "Ungroup this group" })
|
|
1563
1563
|
] })
|
|
1564
1564
|
] });
|
|
1565
1565
|
}, ui = ({ element: e, onElementUpdate: s, onMoveForward: n, onMoveBackward: o }) => {
|
|
@@ -1572,7 +1572,7 @@ const li = ({
|
|
|
1572
1572
|
}, x = () => {
|
|
1573
1573
|
const z = e.clone();
|
|
1574
1574
|
z.transformData.strokeEnabled = !z.transformData.strokeEnabled, s(z);
|
|
1575
|
-
},
|
|
1575
|
+
}, m = () => {
|
|
1576
1576
|
const z = e.clone();
|
|
1577
1577
|
z.transformData.fillEnabled = !z.transformData.fillEnabled, s(z);
|
|
1578
1578
|
}, N = (z) => {
|
|
@@ -1590,7 +1590,7 @@ const li = ({
|
|
|
1590
1590
|
] })
|
|
1591
1591
|
] }),
|
|
1592
1592
|
/* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1593
|
-
/* @__PURE__ */ t(
|
|
1593
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1594
1594
|
P,
|
|
1595
1595
|
{
|
|
1596
1596
|
variant: E ? "default" : "ghost",
|
|
@@ -1599,7 +1599,7 @@ const li = ({
|
|
|
1599
1599
|
children: "Stroke"
|
|
1600
1600
|
}
|
|
1601
1601
|
) }),
|
|
1602
|
-
/* @__PURE__ */ t(
|
|
1602
|
+
/* @__PURE__ */ t(me, { children: E ? "Disable Stroke" : "Enable Stroke" })
|
|
1603
1603
|
] }),
|
|
1604
1604
|
E && /* @__PURE__ */ f(Pe, { open: r, onOpenChange: c, children: [
|
|
1605
1605
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
@@ -1657,16 +1657,16 @@ const li = ({
|
|
|
1657
1657
|
] }),
|
|
1658
1658
|
/* @__PURE__ */ t("div", { className: "sc:w-px sc:h-6 sc:bg-border-primary sc:mx-xs" }),
|
|
1659
1659
|
/* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1660
|
-
/* @__PURE__ */ t(
|
|
1660
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1661
1661
|
P,
|
|
1662
1662
|
{
|
|
1663
1663
|
variant: D ? "default" : "ghost",
|
|
1664
|
-
onClick:
|
|
1664
|
+
onClick: m,
|
|
1665
1665
|
className: "sc:px-xl sc:text-base",
|
|
1666
1666
|
children: "Fill"
|
|
1667
1667
|
}
|
|
1668
1668
|
) }),
|
|
1669
|
-
/* @__PURE__ */ t(
|
|
1669
|
+
/* @__PURE__ */ t(me, { children: D ? "Disable Fill" : "Enable Fill" })
|
|
1670
1670
|
] }),
|
|
1671
1671
|
D && /* @__PURE__ */ f(Pe, { open: i, onOpenChange: p, children: [
|
|
1672
1672
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
@@ -1701,12 +1701,12 @@ const li = ({
|
|
|
1701
1701
|
] }),
|
|
1702
1702
|
/* @__PURE__ */ t("div", { className: "sc:w-px sc:h-6 sc:bg-border-primary sc:mx-xs" }),
|
|
1703
1703
|
n && /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1704
|
-
/* @__PURE__ */ t(
|
|
1705
|
-
/* @__PURE__ */ t(
|
|
1704
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", onClick: n, children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-[18px]" }) }) }),
|
|
1705
|
+
/* @__PURE__ */ t(me, { children: "Move Forward" })
|
|
1706
1706
|
] }),
|
|
1707
1707
|
o && /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
1708
|
-
/* @__PURE__ */ t(
|
|
1709
|
-
/* @__PURE__ */ t(
|
|
1708
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", onClick: o, children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-[18px]" }) }) }),
|
|
1709
|
+
/* @__PURE__ */ t(me, { children: "Move Backward" })
|
|
1710
1710
|
] })
|
|
1711
1711
|
] });
|
|
1712
1712
|
}, dc = Io(({
|
|
@@ -1725,7 +1725,7 @@ const li = ({
|
|
|
1725
1725
|
}, [s]);
|
|
1726
1726
|
const x = (D) => {
|
|
1727
1727
|
y(D), r(D), o("color");
|
|
1728
|
-
},
|
|
1728
|
+
}, m = (D) => {
|
|
1729
1729
|
const k = D.target.value;
|
|
1730
1730
|
y(k);
|
|
1731
1731
|
const I = /^#?([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/, L = k.startsWith("#") ? k : `#${k}`;
|
|
@@ -1804,7 +1804,7 @@ const li = ({
|
|
|
1804
1804
|
type: "text",
|
|
1805
1805
|
className: "sc:flex-1 sc:rounded-lg sc:border sc:border-divider sc:bg-field sc:px-2 sc:py-1.5 sc:text-sm sc:text-foreground sc:focus:border-primary sc:focus:outline-none",
|
|
1806
1806
|
value: C,
|
|
1807
|
-
onChange:
|
|
1807
|
+
onChange: m,
|
|
1808
1808
|
placeholder: "#000000",
|
|
1809
1809
|
maxLength: 7
|
|
1810
1810
|
}
|
|
@@ -1898,8 +1898,8 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
1898
1898
|
] });
|
|
1899
1899
|
}, pc = ({ imageMask: e, onChange: s }) => {
|
|
1900
1900
|
Uo();
|
|
1901
|
-
const n = (e == null ? void 0 : e.enabled) || !1, o = (e == null ? void 0 : e.imageUrl) || "", r = (e == null ? void 0 : e.maskType) || "clip", c = (e == null ? void 0 : e.opacity) ?? 100, i = (e == null ? void 0 : e.inverted) ?? !1, p = Ys.map((
|
|
1902
|
-
if (
|
|
1901
|
+
const n = (e == null ? void 0 : e.enabled) || !1, o = (e == null ? void 0 : e.imageUrl) || "", r = (e == null ? void 0 : e.maskType) || "clip", c = (e == null ? void 0 : e.opacity) ?? 100, i = (e == null ? void 0 : e.inverted) ?? !1, p = Ys.map((m) => ({ id: m.imageUrl, name: m.name, thumbnailUrl: m.thumbnailUrl })), g = (m) => {
|
|
1902
|
+
if (m) {
|
|
1903
1903
|
const N = o || Ys[0].imageUrl;
|
|
1904
1904
|
s({
|
|
1905
1905
|
enabled: !0,
|
|
@@ -1911,22 +1911,22 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
1911
1911
|
} else
|
|
1912
1912
|
s(void 0);
|
|
1913
1913
|
}, b = S(
|
|
1914
|
-
(
|
|
1914
|
+
(m) => {
|
|
1915
1915
|
s({
|
|
1916
1916
|
enabled: !0,
|
|
1917
|
-
imageUrl:
|
|
1917
|
+
imageUrl: m,
|
|
1918
1918
|
maskType: r,
|
|
1919
1919
|
opacity: c,
|
|
1920
1920
|
inverted: i
|
|
1921
1921
|
});
|
|
1922
1922
|
},
|
|
1923
1923
|
[s, r, c, i]
|
|
1924
|
-
), C = (
|
|
1925
|
-
e && s({ ...e, maskType:
|
|
1926
|
-
}, y = (
|
|
1927
|
-
e && s({ ...e, opacity:
|
|
1928
|
-
}, x = (
|
|
1929
|
-
e && s({ ...e, inverted:
|
|
1924
|
+
), C = (m) => {
|
|
1925
|
+
e && s({ ...e, maskType: m });
|
|
1926
|
+
}, y = (m) => {
|
|
1927
|
+
e && s({ ...e, opacity: m[0] });
|
|
1928
|
+
}, x = (m) => {
|
|
1929
|
+
e && s({ ...e, inverted: m });
|
|
1930
1930
|
};
|
|
1931
1931
|
return /* @__PURE__ */ f(Yo, { open: n, onOpenChange: g, className: "sc:mb-xl", children: [
|
|
1932
1932
|
/* @__PURE__ */ t(Xo, { className: "sc:w-full", children: /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:justify-between sc:w-full", children: [
|
|
@@ -1936,7 +1936,7 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
1936
1936
|
{
|
|
1937
1937
|
checked: n,
|
|
1938
1938
|
onCheckedChange: g,
|
|
1939
|
-
onClick: (
|
|
1939
|
+
onClick: (m) => m.stopPropagation()
|
|
1940
1940
|
}
|
|
1941
1941
|
)
|
|
1942
1942
|
] }) }),
|
|
@@ -1953,14 +1953,14 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
1953
1953
|
),
|
|
1954
1954
|
/* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:gap-2", children: [
|
|
1955
1955
|
/* @__PURE__ */ t(Me, { className: "sc:text-sm", children: "Type" }),
|
|
1956
|
-
/* @__PURE__ */ t("div", { className: "sc:flex sc:rounded-md sc:border sc:border-divider sc:overflow-hidden", children: ["clip", "alpha", "luma"].map((
|
|
1956
|
+
/* @__PURE__ */ t("div", { className: "sc:flex sc:rounded-md sc:border sc:border-divider sc:overflow-hidden", children: ["clip", "alpha", "luma"].map((m) => /* @__PURE__ */ t(
|
|
1957
1957
|
"button",
|
|
1958
1958
|
{
|
|
1959
|
-
className: `sc:px-3 sc:py-1 sc:text-xs sc:capitalize sc:transition-colors ${r ===
|
|
1960
|
-
onClick: () => C(
|
|
1961
|
-
children:
|
|
1959
|
+
className: `sc:px-3 sc:py-1 sc:text-xs sc:capitalize sc:transition-colors ${r === m ? "sc:bg-primary sc:text-primary-foreground" : "sc:text-foreground sc:hover:bg-muted"}`,
|
|
1960
|
+
onClick: () => C(m),
|
|
1961
|
+
children: m
|
|
1962
1962
|
},
|
|
1963
|
-
|
|
1963
|
+
m
|
|
1964
1964
|
)) })
|
|
1965
1965
|
] }),
|
|
1966
1966
|
/* @__PURE__ */ t(
|
|
@@ -1968,7 +1968,7 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
1968
1968
|
{
|
|
1969
1969
|
label: "Opacity",
|
|
1970
1970
|
value: c,
|
|
1971
|
-
onChange: (
|
|
1971
|
+
onChange: (m) => y([m]),
|
|
1972
1972
|
min: 0,
|
|
1973
1973
|
max: 100,
|
|
1974
1974
|
step: 1,
|
|
@@ -1976,7 +1976,7 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
1976
1976
|
}
|
|
1977
1977
|
),
|
|
1978
1978
|
/* @__PURE__ */ f("label", { className: "sc:flex sc:items-center sc:gap-2 sc:text-sm sc:text-foreground", children: [
|
|
1979
|
-
/* @__PURE__ */ t(Xt, { checked: i, onCheckedChange: (
|
|
1979
|
+
/* @__PURE__ */ t(Xt, { checked: i, onCheckedChange: (m) => x(m === !0) }),
|
|
1980
1980
|
"Invert Mask"
|
|
1981
1981
|
] })
|
|
1982
1982
|
] })
|
|
@@ -1989,7 +1989,7 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
1989
1989
|
onDeleteArtboard: r,
|
|
1990
1990
|
artboardScreenBounds: c
|
|
1991
1991
|
}) => {
|
|
1992
|
-
const [i, p] = T(!1), [g, b] = T(""), [C, y] = T(!1), x = V(null),
|
|
1992
|
+
const [i, p] = T(!1), [g, b] = T(""), [C, y] = T(!1), x = V(null), m = (B) => {
|
|
1993
1993
|
const j = e.clone();
|
|
1994
1994
|
j.backgroundType = B, n(j);
|
|
1995
1995
|
}, N = (B) => {
|
|
@@ -2047,22 +2047,22 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
2047
2047
|
}
|
|
2048
2048
|
),
|
|
2049
2049
|
/* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
2050
|
-
/* @__PURE__ */ t(
|
|
2051
|
-
/* @__PURE__ */ t(
|
|
2050
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", onClick: I, "aria-label": "Save", children: /* @__PURE__ */ t(J, { icon: ie.check, className: "sc:size-4" }) }) }),
|
|
2051
|
+
/* @__PURE__ */ t(me, { children: "Save" })
|
|
2052
2052
|
] }),
|
|
2053
2053
|
/* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
2054
|
-
/* @__PURE__ */ t(
|
|
2055
|
-
/* @__PURE__ */ t(
|
|
2054
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", onClick: L, "aria-label": "Cancel", children: /* @__PURE__ */ t(J, { icon: ie.close, className: "sc:size-4" }) }) }),
|
|
2055
|
+
/* @__PURE__ */ t(me, { children: "Cancel" })
|
|
2056
2056
|
] })
|
|
2057
2057
|
] }) : /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:gap-2", children: [
|
|
2058
2058
|
/* @__PURE__ */ t("span", { className: "sc:text-xl sc:font-semibold sc:text-text-primary", children: e.name }),
|
|
2059
2059
|
/* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
2060
|
-
/* @__PURE__ */ t(
|
|
2061
|
-
/* @__PURE__ */ t(
|
|
2060
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", onClick: k, "aria-label": "Rename", children: /* @__PURE__ */ t(J, { icon: ie.pencil, className: "sc:size-4" }) }) }),
|
|
2061
|
+
/* @__PURE__ */ t(me, { children: "Rename" })
|
|
2062
2062
|
] }),
|
|
2063
2063
|
/* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
2064
|
-
/* @__PURE__ */ t(
|
|
2065
|
-
/* @__PURE__ */ t(
|
|
2064
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", onClick: q, disabled: s.length <= 1, "aria-label": "Delete", children: /* @__PURE__ */ t(J, { icon: ie.trash, className: "sc:size-4" }) }) }),
|
|
2065
|
+
/* @__PURE__ */ t(me, { children: "Delete" })
|
|
2066
2066
|
] })
|
|
2067
2067
|
] }),
|
|
2068
2068
|
/* @__PURE__ */ t(Wt, { orientation: "vertical", className: "sc:h-6" }),
|
|
@@ -2072,7 +2072,7 @@ const uc = ({ distressTexture: e, onChange: s }) => {
|
|
|
2072
2072
|
backgroundType: e.backgroundType,
|
|
2073
2073
|
backgroundColor: e.backgroundColor,
|
|
2074
2074
|
backgroundTexture: e.backgroundTexture,
|
|
2075
|
-
onBackgroundTypeChange:
|
|
2075
|
+
onBackgroundTypeChange: m,
|
|
2076
2076
|
onColorChange: N,
|
|
2077
2077
|
onTextureChange: v
|
|
2078
2078
|
}
|
|
@@ -2124,7 +2124,7 @@ function fi(e) {
|
|
|
2124
2124
|
return !n || n < 983040 || n > 1048573;
|
|
2125
2125
|
}).join("");
|
|
2126
2126
|
}
|
|
2127
|
-
const $t = bs("FontBrowserDrawer"),
|
|
2127
|
+
const $t = bs("FontBrowserDrawer"), hi = ({
|
|
2128
2128
|
value: e,
|
|
2129
2129
|
onChange: s,
|
|
2130
2130
|
fontFamilies: n,
|
|
@@ -2134,34 +2134,34 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2134
2134
|
previewText: i,
|
|
2135
2135
|
elements: p
|
|
2136
2136
|
}) => {
|
|
2137
|
-
const g = V(null), [b, C] = T(""), [y, x] = T("all"), [
|
|
2137
|
+
const g = V(null), [b, C] = T(""), [y, x] = T("all"), [m, N] = T(0), [v, M] = T("name"), [E, D] = T("medium"), [k, I] = T("masonry"), [L, z] = T(/* @__PURE__ */ new Set()), q = V([]), B = V(!1), { onFontUpload: j } = Ao(), se = fr(
|
|
2138
2138
|
_s.subscribe,
|
|
2139
2139
|
_s.list,
|
|
2140
2140
|
_s.list
|
|
2141
2141
|
), Q = V(null), [ee, le] = T(!1), [X, K] = T(
|
|
2142
2142
|
null
|
|
2143
2143
|
), Y = He(() => {
|
|
2144
|
-
const
|
|
2144
|
+
const h = /* @__PURE__ */ new Set(), w = [];
|
|
2145
2145
|
for (const R of se) {
|
|
2146
2146
|
const $ = R.family.trim().toLowerCase();
|
|
2147
|
-
|
|
2147
|
+
h.has($) || (h.add($), w.push(R.family));
|
|
2148
2148
|
}
|
|
2149
2149
|
return w;
|
|
2150
2150
|
}, [se]), de = He(
|
|
2151
|
-
() => new Set(Y.map((
|
|
2151
|
+
() => new Set(Y.map((h) => h.trim().toLowerCase())),
|
|
2152
2152
|
[Y]
|
|
2153
2153
|
);
|
|
2154
2154
|
Z(() => {
|
|
2155
2155
|
!o || se.length === 0 || Fr(se, {
|
|
2156
|
-
onLoadError: (
|
|
2157
|
-
$t.error("Custom font failed to load:",
|
|
2156
|
+
onLoadError: (h) => {
|
|
2157
|
+
$t.error("Custom font failed to load:", h), K({ code: h.code, message: h.message });
|
|
2158
2158
|
}
|
|
2159
2159
|
});
|
|
2160
2160
|
}, [o, se]);
|
|
2161
|
-
const A = async (
|
|
2161
|
+
const A = async (h) => {
|
|
2162
2162
|
var R;
|
|
2163
|
-
const w = (R =
|
|
2164
|
-
if (
|
|
2163
|
+
const w = (R = h.target.files) == null ? void 0 : R[0];
|
|
2164
|
+
if (h.target.value = "", !(!w || !j)) {
|
|
2165
2165
|
le(!0), K(null);
|
|
2166
2166
|
try {
|
|
2167
2167
|
const $ = await j(w), G = {
|
|
@@ -2180,10 +2180,10 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2180
2180
|
le(!1);
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
|
-
}, te = (
|
|
2184
|
-
s({ target: { value:
|
|
2185
|
-
}, W = ((
|
|
2186
|
-
switch (
|
|
2183
|
+
}, te = (h) => {
|
|
2184
|
+
s({ target: { value: h } }), setTimeout(() => r(!1), 0);
|
|
2185
|
+
}, W = ((h) => {
|
|
2186
|
+
switch (h) {
|
|
2187
2187
|
case "small":
|
|
2188
2188
|
return 1;
|
|
2189
2189
|
case "medium":
|
|
@@ -2193,30 +2193,30 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2193
2193
|
}
|
|
2194
2194
|
})(E);
|
|
2195
2195
|
Z(() => {
|
|
2196
|
-
const
|
|
2197
|
-
if (!document.getElementById(
|
|
2196
|
+
const h = "font-preview-style";
|
|
2197
|
+
if (!document.getElementById(h)) {
|
|
2198
2198
|
const w = document.createElement("style");
|
|
2199
|
-
w.id =
|
|
2199
|
+
w.id = h, w.textContent = ".font-preview { font-family: var(--font-preview) !important; }", document.head.appendChild(w);
|
|
2200
2200
|
}
|
|
2201
2201
|
}, []), Z(() => {
|
|
2202
2202
|
Ze.isFontsLoaded() || Ze.initialize().then(() => {
|
|
2203
|
-
N((
|
|
2204
|
-
}).catch((
|
|
2205
|
-
$t.error("Failed to load fonts:",
|
|
2203
|
+
N((h) => h + 1);
|
|
2204
|
+
}).catch((h) => {
|
|
2205
|
+
$t.error("Failed to load fonts:", h);
|
|
2206
2206
|
});
|
|
2207
2207
|
}, []);
|
|
2208
|
-
const ve = async (
|
|
2208
|
+
const ve = async (h, w = !1) => {
|
|
2209
2209
|
try {
|
|
2210
2210
|
if (w)
|
|
2211
|
-
await Ze.loadFont(
|
|
2212
|
-
else if (
|
|
2213
|
-
const R = i ? `${i}${
|
|
2214
|
-
Ze.loadGoogleFontForPreview(
|
|
2211
|
+
await Ze.loadFont(h);
|
|
2212
|
+
else if (h.googleFont) {
|
|
2213
|
+
const R = i ? `${i}${h.name}` : h.name;
|
|
2214
|
+
Ze.loadGoogleFontForPreview(h.name, R);
|
|
2215
2215
|
} else
|
|
2216
|
-
await Ze.loadFont(
|
|
2217
|
-
z((R) => new Set(R).add(
|
|
2216
|
+
await Ze.loadFont(h);
|
|
2217
|
+
z((R) => new Set(R).add(h.name));
|
|
2218
2218
|
} catch (R) {
|
|
2219
|
-
$t.error(`Failed to load font ${
|
|
2219
|
+
$t.error(`Failed to load font ${h.name}:`, R);
|
|
2220
2220
|
}
|
|
2221
2221
|
};
|
|
2222
2222
|
Z(() => {
|
|
@@ -2234,9 +2234,9 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2234
2234
|
), B.current = !1;
|
|
2235
2235
|
})();
|
|
2236
2236
|
}, [L]);
|
|
2237
|
-
const we = (
|
|
2238
|
-
const w = L.has(
|
|
2239
|
-
!w && !R && (q.current.push(
|
|
2237
|
+
const we = (h) => {
|
|
2238
|
+
const w = L.has(h), R = q.current.includes(h);
|
|
2239
|
+
!w && !R && (q.current.push(h), !B.current && q.current.length === 1 && z(($) => new Set($)));
|
|
2240
2240
|
};
|
|
2241
2241
|
Z(() => {
|
|
2242
2242
|
o && setTimeout(() => {
|
|
@@ -2247,36 +2247,36 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2247
2247
|
const w = Ze.getAllFonts().find((R) => R.name === e);
|
|
2248
2248
|
w && ve(w, !0);
|
|
2249
2249
|
}
|
|
2250
|
-
}, [e, L,
|
|
2250
|
+
}, [e, L, m]), Z(() => {
|
|
2251
2251
|
b.trim() && x("all");
|
|
2252
2252
|
}, [b]);
|
|
2253
|
-
const ke = async (
|
|
2254
|
-
const R = Ze.getAllFonts().find(($) => $.name ===
|
|
2253
|
+
const ke = async (h) => {
|
|
2254
|
+
const R = Ze.getAllFonts().find(($) => $.name === h);
|
|
2255
2255
|
if (R)
|
|
2256
2256
|
try {
|
|
2257
2257
|
await ve(R, !0);
|
|
2258
2258
|
} catch {
|
|
2259
|
-
$t.warn(`Failed to load font ${
|
|
2259
|
+
$t.warn(`Failed to load font ${h}, will use fallback`);
|
|
2260
2260
|
}
|
|
2261
|
-
s({ target: { value:
|
|
2261
|
+
s({ target: { value: h } }), setTimeout(() => r(!1), 0);
|
|
2262
2262
|
}, Re = Fe.memo(
|
|
2263
|
-
({ font:
|
|
2264
|
-
const R = V(null), $ = e ===
|
|
2263
|
+
({ font: h, isUsedInDocument: w = !1 }) => {
|
|
2264
|
+
const R = V(null), $ = e === h.name, G = L.has(h.name);
|
|
2265
2265
|
Z(() => {
|
|
2266
2266
|
if (!R.current) return;
|
|
2267
2267
|
const Ce = new IntersectionObserver(
|
|
2268
2268
|
(We) => {
|
|
2269
2269
|
We.forEach((Qe) => {
|
|
2270
|
-
Qe.isIntersecting && !G && we(
|
|
2270
|
+
Qe.isIntersecting && !G && we(h.name);
|
|
2271
2271
|
});
|
|
2272
2272
|
},
|
|
2273
2273
|
{ rootMargin: "600px" }
|
|
2274
2274
|
// Load fonts before they come into view for smoother scrolling
|
|
2275
2275
|
);
|
|
2276
2276
|
return Ce.observe(R.current), () => Ce.disconnect();
|
|
2277
|
-
}, [
|
|
2277
|
+
}, [h.name, G]);
|
|
2278
2278
|
let Te = "", H = !1;
|
|
2279
|
-
v === "name" ? (Te =
|
|
2279
|
+
v === "name" ? (Te = h.name, H = !1) : v === "preview" ? (Te = i || h.name, H = w) : (Te = i || h.name, H = !0);
|
|
2280
2280
|
const ae = v === "preview" && !H, Je = /* @__PURE__ */ f(
|
|
2281
2281
|
Ht,
|
|
2282
2282
|
{
|
|
@@ -2284,12 +2284,12 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2284
2284
|
$ && g && (g.current = Ce), R.current = Ce;
|
|
2285
2285
|
},
|
|
2286
2286
|
className: `sc:relative sc:flex sc:cursor-pointer sc:flex-col sc:justify-center sc:rounded-lg sc:border-2 sc:text-left ${k === "masonry" ? "sc:w-fit" : "sc:min-w-0"} ${$ ? "sc:border-accent" : "sc:hover:border-muted sc:border-transparent"}`,
|
|
2287
|
-
onClick: ae ? void 0 : () => ke(
|
|
2287
|
+
onClick: ae ? void 0 : () => ke(h.name),
|
|
2288
2288
|
role: ae ? void 0 : "button",
|
|
2289
|
-
"aria-label": ae ? void 0 : `Select ${
|
|
2289
|
+
"aria-label": ae ? void 0 : `Select ${h.name} font`,
|
|
2290
2290
|
tabIndex: ae ? void 0 : 0,
|
|
2291
2291
|
onKeyDown: ae ? void 0 : (Ce) => {
|
|
2292
|
-
(Ce.key === "Enter" || Ce.key === " ") && (Ce.preventDefault(), ke(
|
|
2292
|
+
(Ce.key === "Enter" || Ce.key === " ") && (Ce.preventDefault(), ke(h.name));
|
|
2293
2293
|
},
|
|
2294
2294
|
style: {
|
|
2295
2295
|
minHeight: `${H ? 48 * W : 36 * W}px`,
|
|
@@ -2311,7 +2311,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2311
2311
|
{
|
|
2312
2312
|
className: "sc-font-preview sc:text-foreground sc:overflow-hidden sc:leading-[1.1] sc:font-medium sc:text-ellipsis sc:whitespace-nowrap",
|
|
2313
2313
|
style: {
|
|
2314
|
-
"--font-preview": G ? `"${
|
|
2314
|
+
"--font-preview": G ? `"${h.name}", sans-serif` : "sans-serif",
|
|
2315
2315
|
fontSize: `${15 * W}px`,
|
|
2316
2316
|
opacity: G ? 1 : 0.4
|
|
2317
2317
|
},
|
|
@@ -2326,20 +2326,20 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2326
2326
|
fontSize: `${7 * W}px`,
|
|
2327
2327
|
opacity: G ? 1 : 0.4
|
|
2328
2328
|
},
|
|
2329
|
-
children:
|
|
2329
|
+
children: h.name
|
|
2330
2330
|
}
|
|
2331
2331
|
)
|
|
2332
2332
|
]
|
|
2333
2333
|
}
|
|
2334
2334
|
);
|
|
2335
2335
|
return ae ? /* @__PURE__ */ f(fe, { delayDuration: 200, children: [
|
|
2336
|
-
/* @__PURE__ */ t(
|
|
2336
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2337
2337
|
P,
|
|
2338
2338
|
{
|
|
2339
2339
|
className: "sc:m-0 sc:inline-block sc:h-auto sc:min-h-0 sc:border-0 sc:bg-transparent sc:p-0 sc:hover:bg-transparent",
|
|
2340
2340
|
style: { width: k === "masonry" ? "auto" : "100%" },
|
|
2341
|
-
onClick: () => ke(
|
|
2342
|
-
"aria-label": `Select ${
|
|
2341
|
+
onClick: () => ke(h.name),
|
|
2342
|
+
"aria-label": `Select ${h.name} font`,
|
|
2343
2343
|
children: /* @__PURE__ */ f(
|
|
2344
2344
|
Ht,
|
|
2345
2345
|
{
|
|
@@ -2367,7 +2367,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2367
2367
|
{
|
|
2368
2368
|
className: "sc-font-preview sc:text-foreground sc:overflow-hidden sc:leading-[1.1] sc:font-medium sc:text-ellipsis sc:whitespace-nowrap",
|
|
2369
2369
|
style: {
|
|
2370
|
-
"--font-preview": G ? `"${
|
|
2370
|
+
"--font-preview": G ? `"${h.name}", sans-serif` : "sans-serif",
|
|
2371
2371
|
fontSize: `${15 * W}px`,
|
|
2372
2372
|
opacity: G ? 1 : 0.4
|
|
2373
2373
|
},
|
|
@@ -2382,7 +2382,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2382
2382
|
fontSize: `${7 * W}px`,
|
|
2383
2383
|
opacity: G ? 1 : 0.4
|
|
2384
2384
|
},
|
|
2385
|
-
children:
|
|
2385
|
+
children: h.name
|
|
2386
2386
|
}
|
|
2387
2387
|
)
|
|
2388
2388
|
]
|
|
@@ -2390,24 +2390,24 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2390
2390
|
)
|
|
2391
2391
|
}
|
|
2392
2392
|
) }),
|
|
2393
|
-
/* @__PURE__ */ t(
|
|
2394
|
-
] },
|
|
2393
|
+
/* @__PURE__ */ t(me, { side: "top", children: /* @__PURE__ */ t("p", { children: h.name }) })
|
|
2394
|
+
] }, h.name) : /* @__PURE__ */ t(Fe.Fragment, { children: Je }, h.name);
|
|
2395
2395
|
},
|
|
2396
|
-
(
|
|
2396
|
+
(h, w) => h.font.name === w.font.name && h.isUsedInDocument === w.isUsedInDocument
|
|
2397
2397
|
), Ee = He(() => {
|
|
2398
2398
|
if (!p) return /* @__PURE__ */ new Set();
|
|
2399
|
-
const
|
|
2399
|
+
const h = /* @__PURE__ */ new Set(), w = (R) => {
|
|
2400
2400
|
const $ = R.fontFamily, G = R.text;
|
|
2401
|
-
$ && G && fi(G).trim().length > 0 &&
|
|
2401
|
+
$ && G && fi(G).trim().length > 0 && h.add($);
|
|
2402
2402
|
};
|
|
2403
2403
|
return p.forEach((R) => {
|
|
2404
2404
|
w(R), R.children && Array.isArray(R.children) && R.children.forEach(($) => {
|
|
2405
2405
|
w($);
|
|
2406
2406
|
});
|
|
2407
|
-
}),
|
|
2407
|
+
}), h;
|
|
2408
2408
|
}, [p]), ye = He(() => {
|
|
2409
|
-
const
|
|
2410
|
-
|
|
2409
|
+
const h = (Ze.isFontsLoaded() ? Ze.getAllFonts() : mo).filter((H) => !de.has(H.name.trim().toLowerCase())), w = new Set(mo.map((H) => H.name)), R = [];
|
|
2410
|
+
h.forEach((H) => {
|
|
2411
2411
|
if (Ee.has(H.name))
|
|
2412
2412
|
if (b) {
|
|
2413
2413
|
const ae = b.toLowerCase();
|
|
@@ -2415,7 +2415,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2415
2415
|
} else
|
|
2416
2416
|
R.push(H);
|
|
2417
2417
|
});
|
|
2418
|
-
let $ =
|
|
2418
|
+
let $ = h.filter((H) => !Ee.has(H.name));
|
|
2419
2419
|
if (y !== "all" && ($ = $.filter((H) => H.category === y)), b) {
|
|
2420
2420
|
const H = b.toLowerCase();
|
|
2421
2421
|
$ = $.filter((ae) => ae.name.toLowerCase().includes(H));
|
|
@@ -2424,7 +2424,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2424
2424
|
return $.forEach((H) => {
|
|
2425
2425
|
w.has(H.name) ? G.push(H) : Te.push(H);
|
|
2426
2426
|
}), R.sort((H, ae) => H.name.localeCompare(ae.name)), G.sort((H, ae) => H.name.localeCompare(ae.name)), Te.sort((H, ae) => H.name.localeCompare(ae.name)), { usedFonts: R, recommendedFonts: G, otherFonts: Te };
|
|
2427
|
-
}, [b, y,
|
|
2427
|
+
}, [b, y, m, Ee, de]), Ie = (h, w = !1) => k === "masonry" ? /* @__PURE__ */ t("div", { className: "sc:flex sc:flex-wrap sc:content-start sc:items-start sc:gap-2 sc:px-4 sc:pb-4", children: h.map((R) => /* @__PURE__ */ t(Re, { font: R, isUsedInDocument: w }, R.name)) }) : /* @__PURE__ */ t(
|
|
2428
2428
|
"div",
|
|
2429
2429
|
{
|
|
2430
2430
|
className: "sc:px-4 sc:pb-4",
|
|
@@ -2433,7 +2433,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2433
2433
|
gridTemplateColumns: `repeat(auto-fill, minmax(${140 * W}px, 1fr))`,
|
|
2434
2434
|
gap: "8px"
|
|
2435
2435
|
},
|
|
2436
|
-
children:
|
|
2436
|
+
children: h.map((R) => /* @__PURE__ */ t(Re, { font: R, isUsedInDocument: w }, R.name))
|
|
2437
2437
|
}
|
|
2438
2438
|
), ze = [
|
|
2439
2439
|
"all",
|
|
@@ -2487,7 +2487,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2487
2487
|
className: "sc:rounded-2xl sc:pt-[10px] sc:pb-[9px]",
|
|
2488
2488
|
placeholder: "Search fonts...",
|
|
2489
2489
|
value: b,
|
|
2490
|
-
onChange: (
|
|
2490
|
+
onChange: (h) => C(h.target.value),
|
|
2491
2491
|
autoFocus: !0,
|
|
2492
2492
|
"aria-label": "Search fonts"
|
|
2493
2493
|
}
|
|
@@ -2496,7 +2496,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2496
2496
|
st,
|
|
2497
2497
|
{
|
|
2498
2498
|
value: E,
|
|
2499
|
-
onValueChange: (
|
|
2499
|
+
onValueChange: (h) => D(h),
|
|
2500
2500
|
children: /* @__PURE__ */ t(st.ListContainer, { children: /* @__PURE__ */ f(st.List, { "aria-label": "Card size", children: [
|
|
2501
2501
|
/* @__PURE__ */ f(st.Tab, { id: "small", className: "sc:text-xs sc:font-semibold", "aria-label": "Small card size", children: [
|
|
2502
2502
|
"A",
|
|
@@ -2518,7 +2518,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2518
2518
|
{
|
|
2519
2519
|
variant: "secondary",
|
|
2520
2520
|
onClick: () => {
|
|
2521
|
-
M((
|
|
2521
|
+
M((h) => h === "both" ? "name" : h === "name" ? "preview" : "both");
|
|
2522
2522
|
},
|
|
2523
2523
|
"aria-label": v === "both" ? "Show font name only" : v === "name" ? "Show preview only" : "Show preview with font name",
|
|
2524
2524
|
className: "sc:h-10 sc:w-10 sc:p-0",
|
|
@@ -2548,18 +2548,18 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2548
2548
|
}
|
|
2549
2549
|
}
|
|
2550
2550
|
),
|
|
2551
|
-
/* @__PURE__ */ t("div", { className: "sc:relative sc:z-20 sc:px-4 sc:py-4 sc:pt-3", children: /* @__PURE__ */ t("div", { className: "sc:flex sc:gap-2 sc:overflow-x-auto", children: ze.map((
|
|
2552
|
-
const w =
|
|
2551
|
+
/* @__PURE__ */ t("div", { className: "sc:relative sc:z-20 sc:px-4 sc:py-4 sc:pt-3", children: /* @__PURE__ */ t("div", { className: "sc:flex sc:gap-2 sc:overflow-x-auto", children: ze.map((h) => {
|
|
2552
|
+
const w = h === "all" ? "All" : Tr[h];
|
|
2553
2553
|
return /* @__PURE__ */ t(
|
|
2554
2554
|
P,
|
|
2555
2555
|
{
|
|
2556
2556
|
size: "sm",
|
|
2557
|
-
variant: y ===
|
|
2558
|
-
onClick: () => x(
|
|
2559
|
-
className: `sc:shrink-0 ${y ===
|
|
2557
|
+
variant: y === h ? "default" : "secondary",
|
|
2558
|
+
onClick: () => x(h),
|
|
2559
|
+
className: `sc:shrink-0 ${y === h ? "" : "sc:hover:brightness-95"}`,
|
|
2560
2560
|
children: w
|
|
2561
2561
|
},
|
|
2562
|
-
|
|
2562
|
+
h
|
|
2563
2563
|
);
|
|
2564
2564
|
}) }) })
|
|
2565
2565
|
] }),
|
|
@@ -2567,18 +2567,18 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2567
2567
|
(Y.length > 0 || j) && !b && /* @__PURE__ */ f("div", { className: "sc:shrink-0 sc:p-0", "data-sc-part": "font-picker-your-fonts", children: [
|
|
2568
2568
|
/* @__PURE__ */ t("div", { className: "sc:text-muted sc:bg-white sc:px-4 sc:pt-2 sc:pb-2 sc:text-xs sc:font-bold sc:tracking-wider sc:uppercase", children: "Your Fonts" }),
|
|
2569
2569
|
/* @__PURE__ */ f("div", { className: "sc:flex sc:flex-wrap sc:content-start sc:items-center sc:gap-2 sc:px-4 sc:pb-4", children: [
|
|
2570
|
-
Y.map((
|
|
2570
|
+
Y.map((h) => /* @__PURE__ */ t(
|
|
2571
2571
|
Ht,
|
|
2572
2572
|
{
|
|
2573
2573
|
"data-sc-part": "font-picker-custom-font",
|
|
2574
|
-
"data-family":
|
|
2575
|
-
className: `sc:relative sc:flex sc:w-fit sc:cursor-pointer sc:flex-col sc:justify-center sc:rounded-lg sc:border-2 sc:text-left ${e ===
|
|
2576
|
-
onClick: () => te(
|
|
2574
|
+
"data-family": h,
|
|
2575
|
+
className: `sc:relative sc:flex sc:w-fit sc:cursor-pointer sc:flex-col sc:justify-center sc:rounded-lg sc:border-2 sc:text-left ${e === h ? "sc:border-accent" : "sc:hover:border-muted sc:border-transparent"}`,
|
|
2576
|
+
onClick: () => te(h),
|
|
2577
2577
|
role: "button",
|
|
2578
|
-
"aria-label": `Select ${
|
|
2578
|
+
"aria-label": `Select ${h} font`,
|
|
2579
2579
|
tabIndex: 0,
|
|
2580
2580
|
onKeyDown: (R) => {
|
|
2581
|
-
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), te(
|
|
2581
|
+
(R.key === "Enter" || R.key === " ") && (R.preventDefault(), te(h));
|
|
2582
2582
|
},
|
|
2583
2583
|
style: {
|
|
2584
2584
|
minHeight: `${36 * W}px`,
|
|
@@ -2589,14 +2589,14 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2589
2589
|
{
|
|
2590
2590
|
className: "sc-font-preview sc:text-foreground sc:overflow-hidden sc:leading-[1.1] sc:font-medium sc:text-ellipsis sc:whitespace-nowrap",
|
|
2591
2591
|
style: {
|
|
2592
|
-
"--font-preview": `"${
|
|
2592
|
+
"--font-preview": `"${h}", sans-serif`,
|
|
2593
2593
|
fontSize: `${15 * W}px`
|
|
2594
2594
|
},
|
|
2595
|
-
children: v === "name" ?
|
|
2595
|
+
children: v === "name" ? h : i || h
|
|
2596
2596
|
}
|
|
2597
2597
|
)
|
|
2598
2598
|
},
|
|
2599
|
-
|
|
2599
|
+
h
|
|
2600
2600
|
)),
|
|
2601
2601
|
j && /* @__PURE__ */ f(Ye, { children: [
|
|
2602
2602
|
/* @__PURE__ */ t(
|
|
@@ -2619,8 +2619,8 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2619
2619
|
"data-sc-part": "font-picker-upload",
|
|
2620
2620
|
"data-testid": "font-upload-button",
|
|
2621
2621
|
onClick: () => {
|
|
2622
|
-
var
|
|
2623
|
-
return (
|
|
2622
|
+
var h;
|
|
2623
|
+
return (h = Q.current) == null ? void 0 : h.click();
|
|
2624
2624
|
},
|
|
2625
2625
|
disabled: ee,
|
|
2626
2626
|
"aria-label": "Upload a font",
|
|
@@ -2662,7 +2662,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2662
2662
|
}
|
|
2663
2663
|
)
|
|
2664
2664
|
] });
|
|
2665
|
-
},
|
|
2665
|
+
}, mi = bs("TransformControlPanel"), gi = ({ element: e, controls: s, onUpdate: n }) => {
|
|
2666
2666
|
const [o, r] = T({});
|
|
2667
2667
|
return /* @__PURE__ */ t("div", { className: "sc:w-full sc:space-y-4", children: s.map((c) => {
|
|
2668
2668
|
const i = e.transformData[c.key] ?? c.defaultInternalValue ?? c.defaultValue;
|
|
@@ -2683,7 +2683,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2683
2683
|
] }, c.key);
|
|
2684
2684
|
const p = typeof i == "number" && !isNaN(i) ? i : c.defaultInternalValue ?? 0, g = o[c.key] !== void 0 ? o[c.key] : p, b = c.toSlider ? c.toSlider(g) : g, C = (y) => {
|
|
2685
2685
|
const x = c.fromSlider ? c.fromSlider(y) : y;
|
|
2686
|
-
return typeof x != "number" || isNaN(x) ? (
|
|
2686
|
+
return typeof x != "number" || isNaN(x) ? (mi.warn("Invalid internalValue:", x, "for control:", c.key), "0") : c.toDisplay ? c.toDisplay(x) : "isPercentage" in c && c.isPercentage ? `${(x * 100).toFixed(0)}%` : x.toFixed(1);
|
|
2687
2687
|
};
|
|
2688
2688
|
return /* @__PURE__ */ f("div", { className: "sc:flex sc:flex-col sc:gap-sm", children: [
|
|
2689
2689
|
/* @__PURE__ */ f("div", { className: "sc:flex sc:justify-between", children: [
|
|
@@ -2695,12 +2695,12 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2695
2695
|
{
|
|
2696
2696
|
value: [b],
|
|
2697
2697
|
onValueChange: (y) => {
|
|
2698
|
-
const x = y[0],
|
|
2699
|
-
r((N) => ({ ...N, [c.key]:
|
|
2698
|
+
const x = y[0], m = c.fromSlider ? c.fromSlider(x) : x;
|
|
2699
|
+
r((N) => ({ ...N, [c.key]: m }));
|
|
2700
2700
|
},
|
|
2701
2701
|
onChangeEnd: (y) => {
|
|
2702
|
-
const x = y[0],
|
|
2703
|
-
|
|
2702
|
+
const x = y[0], m = e.clone();
|
|
2703
|
+
m.transformData[c.key] = c.fromSlider ? c.fromSlider(x) : x, n(m), r((N) => {
|
|
2704
2704
|
const v = { ...N };
|
|
2705
2705
|
return delete v[c.key], v;
|
|
2706
2706
|
});
|
|
@@ -2721,9 +2721,9 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2721
2721
|
onOpenChange: r
|
|
2722
2722
|
}) => {
|
|
2723
2723
|
const [c, i] = T(!1), p = o !== void 0 ? o : c, g = r || i, b = e.transformType, C = Dr(b), y = Sr.filter(
|
|
2724
|
-
(
|
|
2725
|
-
), x = (
|
|
2726
|
-
|
|
2724
|
+
(m) => m.Component && m.id !== "image" && m.id !== "group" && m.id !== "shape" && m.id !== "path"
|
|
2725
|
+
), x = (m) => {
|
|
2726
|
+
m !== b && s(m);
|
|
2727
2727
|
};
|
|
2728
2728
|
return /* @__PURE__ */ f(Pe, { open: p, onOpenChange: g, children: [
|
|
2729
2729
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "Text Effects", children: /* @__PURE__ */ t(J, { icon: ie.wand, className: "sc:size-6" }) }) }),
|
|
@@ -2732,7 +2732,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2732
2732
|
/* @__PURE__ */ t(Me, { children: "Text Effect" }),
|
|
2733
2733
|
/* @__PURE__ */ f(Hr, { value: b, onValueChange: x, children: [
|
|
2734
2734
|
/* @__PURE__ */ t(Ko, { children: /* @__PURE__ */ t(Wr, { placeholder: "Select effect" }) }),
|
|
2735
|
-
/* @__PURE__ */ t(Po, { style: { zIndex: 2147483647 }, children: y.map((
|
|
2735
|
+
/* @__PURE__ */ t(Po, { style: { zIndex: 2147483647 }, children: y.map((m) => /* @__PURE__ */ t(Jo, { value: m.id, children: m.label }, m.id)) })
|
|
2736
2736
|
] })
|
|
2737
2737
|
] }),
|
|
2738
2738
|
C.length > 0 && /* @__PURE__ */ t(gi, { element: e, controls: C, onUpdate: n })
|
|
@@ -2743,7 +2743,7 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2743
2743
|
return /* @__PURE__ */ f(Pe, { open: s, onOpenChange: n, children: [
|
|
2744
2744
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(J, { icon: ie.moreHorizontal, className: "sc:size-6" }) }) }),
|
|
2745
2745
|
/* @__PURE__ */ t(Xe, { align: "start", className: "sc:w-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ t("div", { className: "sc:flex sc:items-center sc:gap-1", children: e.map((o, r) => /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
2746
|
-
/* @__PURE__ */ t(
|
|
2746
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2747
2747
|
P,
|
|
2748
2748
|
{
|
|
2749
2749
|
variant: o.active ? "default" : "ghost",
|
|
@@ -2755,13 +2755,13 @@ const $t = bs("FontBrowserDrawer"), mi = ({
|
|
|
2755
2755
|
children: o.icon
|
|
2756
2756
|
}
|
|
2757
2757
|
) }),
|
|
2758
|
-
/* @__PURE__ */ t(
|
|
2758
|
+
/* @__PURE__ */ t(me, { children: o.label })
|
|
2759
2759
|
] }, r)) }) })
|
|
2760
2760
|
] });
|
|
2761
2761
|
};
|
|
2762
2762
|
function xi({ colorPickerValue: e, isActive: s, onClick: n }) {
|
|
2763
2763
|
return /* @__PURE__ */ f(fe, { delay: 300, children: [
|
|
2764
|
-
/* @__PURE__ */ t(
|
|
2764
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2765
2765
|
"button",
|
|
2766
2766
|
{
|
|
2767
2767
|
className: "sc-toolbar-btn",
|
|
@@ -2780,7 +2780,7 @@ function xi({ colorPickerValue: e, isActive: s, onClick: n }) {
|
|
|
2780
2780
|
] })
|
|
2781
2781
|
}
|
|
2782
2782
|
) }),
|
|
2783
|
-
!s && /* @__PURE__ */ t(
|
|
2783
|
+
!s && /* @__PURE__ */ t(me, { children: "Font Color" })
|
|
2784
2784
|
] });
|
|
2785
2785
|
}
|
|
2786
2786
|
function vi({ toolbar: e }) {
|
|
@@ -2846,7 +2846,7 @@ function Ni({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2846
2846
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(J, { icon: "lucide:ellipsis-vertical", className: "sc:size-6" }) }) }),
|
|
2847
2847
|
/* @__PURE__ */ t(Xe, { align: "end", className: "sc:w-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ f("div", { className: "sc:flex sc:items-center sc:gap-1", children: [
|
|
2848
2848
|
/* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
2849
|
-
/* @__PURE__ */ t(
|
|
2849
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2850
2850
|
P,
|
|
2851
2851
|
{
|
|
2852
2852
|
variant: "ghost",
|
|
@@ -2858,10 +2858,10 @@ function Ni({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2858
2858
|
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-5" })
|
|
2859
2859
|
}
|
|
2860
2860
|
) }),
|
|
2861
|
-
/* @__PURE__ */ t(
|
|
2861
|
+
/* @__PURE__ */ t(me, { children: "Move Forward" })
|
|
2862
2862
|
] }),
|
|
2863
2863
|
/* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
2864
|
-
/* @__PURE__ */ t(
|
|
2864
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2865
2865
|
P,
|
|
2866
2866
|
{
|
|
2867
2867
|
variant: "ghost",
|
|
@@ -2873,10 +2873,10 @@ function Ni({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2873
2873
|
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-5" })
|
|
2874
2874
|
}
|
|
2875
2875
|
) }),
|
|
2876
|
-
/* @__PURE__ */ t(
|
|
2876
|
+
/* @__PURE__ */ t(me, { children: "Move Backward" })
|
|
2877
2877
|
] }),
|
|
2878
2878
|
/* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
2879
|
-
/* @__PURE__ */ t(
|
|
2879
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2880
2880
|
P,
|
|
2881
2881
|
{
|
|
2882
2882
|
variant: "ghost",
|
|
@@ -2888,7 +2888,7 @@ function Ni({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2888
2888
|
children: /* @__PURE__ */ t(J, { icon: ie.trash, className: "sc:size-5" })
|
|
2889
2889
|
}
|
|
2890
2890
|
) }),
|
|
2891
|
-
/* @__PURE__ */ t(
|
|
2891
|
+
/* @__PURE__ */ t(me, { children: "Delete" })
|
|
2892
2892
|
] })
|
|
2893
2893
|
] }) })
|
|
2894
2894
|
] });
|
|
@@ -2907,7 +2907,7 @@ function Si({
|
|
|
2907
2907
|
onOpacityToggle: C,
|
|
2908
2908
|
onFontSizeToggle: y,
|
|
2909
2909
|
strokeExpanded: x = !1,
|
|
2910
|
-
onStrokeToggle:
|
|
2910
|
+
onStrokeToggle: m,
|
|
2911
2911
|
shadowExpanded: N = !1,
|
|
2912
2912
|
onShadowToggle: v,
|
|
2913
2913
|
blendModeExpanded: M = !1,
|
|
@@ -2933,10 +2933,10 @@ function Si({
|
|
|
2933
2933
|
onFontBrowserToggle: De,
|
|
2934
2934
|
onTextMoreMenuOpenChange: W
|
|
2935
2935
|
}) {
|
|
2936
|
-
const [ve, we] = T(!1), [ke, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1),
|
|
2936
|
+
const [ve, we] = T(!1), [ke, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1), h = vs(ee), [w, R] = T(!1), [$, G] = T(!1), [Te, H] = T(!1), [ae, Je] = T(!1), [Ce, We] = T(!1), [Qe, et] = T(!1);
|
|
2937
2937
|
return /* @__PURE__ */ f("div", { className: "sc-toolbar-items", children: [
|
|
2938
2938
|
/* @__PURE__ */ t(
|
|
2939
|
-
|
|
2939
|
+
hi,
|
|
2940
2940
|
{
|
|
2941
2941
|
value: e.getEffectiveStyle().fontFamily || e.fontFamily,
|
|
2942
2942
|
onChange: (tt) => e.handleFontFamilyChange(tt.target.value),
|
|
@@ -2958,7 +2958,7 @@ function Si({
|
|
|
2958
2958
|
onMouseLeave: () => ze(!1),
|
|
2959
2959
|
tooltip: `Font Size · ${Math.round(e.fontSize)}`,
|
|
2960
2960
|
tooltipDisabled: Ie || (g == null ? void 0 : g.type) === "fontSize",
|
|
2961
|
-
active: (g == null ? void 0 : g.type) === "fontSize" ||
|
|
2961
|
+
active: (g == null ? void 0 : g.type) === "fontSize" || h.typography
|
|
2962
2962
|
}
|
|
2963
2963
|
),
|
|
2964
2964
|
/* @__PURE__ */ t(
|
|
@@ -2984,17 +2984,17 @@ function Si({
|
|
|
2984
2984
|
onOpenChange: K
|
|
2985
2985
|
}
|
|
2986
2986
|
),
|
|
2987
|
-
|
|
2987
|
+
m && /* @__PURE__ */ t(
|
|
2988
2988
|
U,
|
|
2989
2989
|
{
|
|
2990
2990
|
icon: "lucide:pen-line",
|
|
2991
2991
|
onClick: () => {
|
|
2992
|
-
we(!0),
|
|
2992
|
+
we(!0), m();
|
|
2993
2993
|
},
|
|
2994
2994
|
onMouseLeave: () => we(!1),
|
|
2995
2995
|
tooltip: "Stroke",
|
|
2996
2996
|
tooltipDisabled: ve || x,
|
|
2997
|
-
active: x ||
|
|
2997
|
+
active: x || h.stroke
|
|
2998
2998
|
}
|
|
2999
2999
|
),
|
|
3000
3000
|
/* @__PURE__ */ t(
|
|
@@ -3007,7 +3007,7 @@ function Si({
|
|
|
3007
3007
|
onMouseLeave: () => ye(!1),
|
|
3008
3008
|
tooltip: "Rotate",
|
|
3009
3009
|
tooltipDisabled: Ee || (g == null ? void 0 : g.type) === "rotation",
|
|
3010
|
-
active: (g == null ? void 0 : g.type) === "rotation" ||
|
|
3010
|
+
active: (g == null ? void 0 : g.type) === "rotation" || h.rotation
|
|
3011
3011
|
}
|
|
3012
3012
|
),
|
|
3013
3013
|
/* @__PURE__ */ t(
|
|
@@ -3020,7 +3020,7 @@ function Si({
|
|
|
3020
3020
|
onMouseLeave: () => R(!1),
|
|
3021
3021
|
tooltip: "Transparency",
|
|
3022
3022
|
tooltipDisabled: w || (g == null ? void 0 : g.type) === "opacity",
|
|
3023
|
-
active: (g == null ? void 0 : g.type) === "opacity" ||
|
|
3023
|
+
active: (g == null ? void 0 : g.type) === "opacity" || h.opacity
|
|
3024
3024
|
}
|
|
3025
3025
|
),
|
|
3026
3026
|
v && /* @__PURE__ */ t(
|
|
@@ -3033,7 +3033,7 @@ function Si({
|
|
|
3033
3033
|
onMouseLeave: () => G(!1),
|
|
3034
3034
|
tooltip: "Shadow",
|
|
3035
3035
|
tooltipDisabled: $ || N,
|
|
3036
|
-
active: N ||
|
|
3036
|
+
active: N || h.shadow
|
|
3037
3037
|
}
|
|
3038
3038
|
),
|
|
3039
3039
|
E && /* @__PURE__ */ t(
|
|
@@ -3046,7 +3046,7 @@ function Si({
|
|
|
3046
3046
|
onMouseLeave: () => H(!1),
|
|
3047
3047
|
tooltip: "Blend Mode",
|
|
3048
3048
|
tooltipDisabled: Te || M,
|
|
3049
|
-
active: M ||
|
|
3049
|
+
active: M || h.blendMode
|
|
3050
3050
|
}
|
|
3051
3051
|
),
|
|
3052
3052
|
k && /* @__PURE__ */ t(
|
|
@@ -3059,7 +3059,7 @@ function Si({
|
|
|
3059
3059
|
onMouseLeave: () => Je(!1),
|
|
3060
3060
|
tooltip: "Clip / Knockout",
|
|
3061
3061
|
tooltipDisabled: ae || D,
|
|
3062
|
-
active: D ||
|
|
3062
|
+
active: D || h.knockout
|
|
3063
3063
|
}
|
|
3064
3064
|
),
|
|
3065
3065
|
L && /* @__PURE__ */ t(
|
|
@@ -3072,7 +3072,7 @@ function Si({
|
|
|
3072
3072
|
onMouseLeave: () => We(!1),
|
|
3073
3073
|
tooltip: "Distress Texture",
|
|
3074
3074
|
tooltipDisabled: Ce || I,
|
|
3075
|
-
active: I ||
|
|
3075
|
+
active: I || h.distress
|
|
3076
3076
|
}
|
|
3077
3077
|
),
|
|
3078
3078
|
q && /* @__PURE__ */ t(
|
|
@@ -3085,7 +3085,7 @@ function Si({
|
|
|
3085
3085
|
onMouseLeave: () => et(!1),
|
|
3086
3086
|
tooltip: "Image Mask",
|
|
3087
3087
|
tooltipDisabled: Qe || z,
|
|
3088
|
-
active: z ||
|
|
3088
|
+
active: z || h.imageMask
|
|
3089
3089
|
}
|
|
3090
3090
|
),
|
|
3091
3091
|
/* @__PURE__ */ t(
|
|
@@ -3143,8 +3143,8 @@ function Mi(e, s, n, o) {
|
|
|
3143
3143
|
case "custom":
|
|
3144
3144
|
const C = 200, y = n * e.text.length * 0.6, x = Math.max(y, C);
|
|
3145
3145
|
r = { width: x };
|
|
3146
|
-
const
|
|
3147
|
-
c = o.x - x / 2, i = o.y -
|
|
3146
|
+
const m = n * 1.2;
|
|
3147
|
+
c = o.x - x / 2, i = o.y - m / 2;
|
|
3148
3148
|
break;
|
|
3149
3149
|
case "arch":
|
|
3150
3150
|
const N = 200, v = n * e.text.length * 0.6;
|
|
@@ -3186,96 +3186,96 @@ function Ei(e = {}) {
|
|
|
3186
3186
|
selectedElement: n,
|
|
3187
3187
|
activeChildElement: o,
|
|
3188
3188
|
handleElementUpdate: r
|
|
3189
|
-
} =
|
|
3190
|
-
(
|
|
3189
|
+
} = ms(), c = o || n, i = S(
|
|
3190
|
+
(h) => {
|
|
3191
3191
|
if (n)
|
|
3192
3192
|
if (o) {
|
|
3193
3193
|
if (!(n instanceof Dt)) return;
|
|
3194
3194
|
const w = n.clone(), R = w.children.findIndex(($) => $.id === o.id);
|
|
3195
|
-
R !== -1 && (w.children[R] =
|
|
3195
|
+
R !== -1 && (w.children[R] = h, r(w));
|
|
3196
3196
|
} else
|
|
3197
|
-
r(
|
|
3197
|
+
r(h);
|
|
3198
3198
|
},
|
|
3199
3199
|
[n, o, r]
|
|
3200
|
-
), p = c == null ? void 0 : c.id, g = V(void 0), [b, C] = T(32), [y, x] = T("#333333"), [
|
|
3200
|
+
), p = c == null ? void 0 : c.id, g = V(void 0), [b, C] = T(32), [y, x] = T("#333333"), [m, N] = T("Arial"), [v, M] = T("center");
|
|
3201
3201
|
Z(() => {
|
|
3202
3202
|
p !== g.current && (g.current = p, c && c instanceof Ue && (c.transformType === "circle" && "getEffectiveFontSize" in c ? C(Math.round(c.getEffectiveFontSize())) : c.fontSize !== void 0 && C(Math.round(c.fontSize)), c.color !== void 0 && x(c.color), c.fontFamily !== void 0 && N(c.fontFamily), M(c.textAlign || "center")));
|
|
3203
3203
|
}, [p, c]);
|
|
3204
|
-
const E = b, D = y, k =
|
|
3205
|
-
(
|
|
3206
|
-
if (C(
|
|
3204
|
+
const E = b, D = y, k = m, I = v, L = c instanceof Ue ? c : null, z = (L == null ? void 0 : L.letterSpacing) ?? 0, q = (L == null ? void 0 : L.lineHeight) ?? 1.2, B = (L == null ? void 0 : L.bold) ?? !1, j = (L == null ? void 0 : L.italic) ?? !1, se = (L == null ? void 0 : L.underline) ?? !1, Q = (L == null ? void 0 : L.letterCase) ?? "none", ee = S(
|
|
3205
|
+
(h) => {
|
|
3206
|
+
if (C(h), !c || !(c instanceof Ue)) return;
|
|
3207
3207
|
const w = c.clone();
|
|
3208
|
-
w.transformType === "circle" && "setEffectiveFontSize" in w ? w.setEffectiveFontSize(
|
|
3208
|
+
w.transformType === "circle" && "setEffectiveFontSize" in w ? w.setEffectiveFontSize(h) : w.setFontSize(h), w.richText && w.richText.clearStyleProperty("fontSize"), i(w);
|
|
3209
3209
|
},
|
|
3210
3210
|
[c, i]
|
|
3211
3211
|
), le = S(
|
|
3212
|
-
(
|
|
3213
|
-
if (N(
|
|
3212
|
+
(h) => {
|
|
3213
|
+
if (N(h), !c || !(c instanceof Ue)) return;
|
|
3214
3214
|
const w = c.clone();
|
|
3215
|
-
w.fontFamily =
|
|
3215
|
+
w.fontFamily = h, w.richText && w.richText.clearStyleProperty("fontFamily"), i(w);
|
|
3216
3216
|
},
|
|
3217
3217
|
[c, i]
|
|
3218
3218
|
), X = S(
|
|
3219
|
-
(
|
|
3220
|
-
if (x(
|
|
3219
|
+
(h) => {
|
|
3220
|
+
if (x(h), !c || !(c instanceof Ue)) return;
|
|
3221
3221
|
const w = c.clone();
|
|
3222
|
-
w.color =
|
|
3222
|
+
w.color = h, w.richText && w.richText.clearStyleProperty("color"), i(w);
|
|
3223
3223
|
},
|
|
3224
3224
|
[c, i]
|
|
3225
3225
|
), K = S(
|
|
3226
|
-
(
|
|
3227
|
-
if (M(
|
|
3226
|
+
(h) => {
|
|
3227
|
+
if (M(h), !c || !(c instanceof Ue)) return;
|
|
3228
3228
|
const w = c.clone();
|
|
3229
|
-
w.textAlign =
|
|
3229
|
+
w.textAlign = h, i(w);
|
|
3230
3230
|
},
|
|
3231
3231
|
[c, i]
|
|
3232
3232
|
), Y = S(
|
|
3233
|
-
(
|
|
3233
|
+
(h) => {
|
|
3234
3234
|
var w;
|
|
3235
|
-
(w = s == null ? void 0 : s.current) != null && w.isEditingText() ? s.current.applyTextFormatting({ fontSize:
|
|
3235
|
+
(w = s == null ? void 0 : s.current) != null && w.isEditingText() ? s.current.applyTextFormatting({ fontSize: h }) : ee(h);
|
|
3236
3236
|
},
|
|
3237
3237
|
[ee, s]
|
|
3238
3238
|
), de = S(
|
|
3239
|
-
(
|
|
3240
|
-
const w = E +
|
|
3239
|
+
(h) => {
|
|
3240
|
+
const w = E + h;
|
|
3241
3241
|
w >= 8 && w <= 500 && Y(w);
|
|
3242
3242
|
},
|
|
3243
3243
|
[E, Y]
|
|
3244
3244
|
), A = S(
|
|
3245
|
-
(
|
|
3245
|
+
(h) => {
|
|
3246
3246
|
var R;
|
|
3247
3247
|
if ((R = s == null ? void 0 : s.current) != null && R.isEditingText()) {
|
|
3248
|
-
s.current.applyTextFormatting({ letterSpacing:
|
|
3248
|
+
s.current.applyTextFormatting({ letterSpacing: h });
|
|
3249
3249
|
return;
|
|
3250
3250
|
}
|
|
3251
3251
|
if (!c || !(c instanceof Ue)) return;
|
|
3252
3252
|
const w = c.clone();
|
|
3253
|
-
w.letterSpacing =
|
|
3253
|
+
w.letterSpacing = h, w.richText && w.richText.clearStyleProperty("letterSpacing"), i(w);
|
|
3254
3254
|
},
|
|
3255
3255
|
[c, i, s]
|
|
3256
3256
|
), te = S(
|
|
3257
|
-
(
|
|
3257
|
+
(h) => {
|
|
3258
3258
|
if (!c || !(c instanceof Ue)) return;
|
|
3259
3259
|
const w = c.clone();
|
|
3260
|
-
w.lineHeight =
|
|
3260
|
+
w.lineHeight = h, i(w);
|
|
3261
3261
|
},
|
|
3262
3262
|
[c, i]
|
|
3263
3263
|
), De = S(
|
|
3264
|
-
(
|
|
3264
|
+
(h) => {
|
|
3265
3265
|
var w;
|
|
3266
|
-
(w = s == null ? void 0 : s.current) != null && w.isEditingText() ? s.current.applyTextFormatting({ fontFamily:
|
|
3266
|
+
(w = s == null ? void 0 : s.current) != null && w.isEditingText() ? s.current.applyTextFormatting({ fontFamily: h }) : le(h);
|
|
3267
3267
|
},
|
|
3268
3268
|
[le, s]
|
|
3269
3269
|
), W = S(
|
|
3270
|
-
(
|
|
3270
|
+
(h) => {
|
|
3271
3271
|
var $;
|
|
3272
|
-
const w =
|
|
3272
|
+
const w = h.target.value;
|
|
3273
3273
|
(($ = s == null ? void 0 : s.current) == null ? void 0 : $.isEditingText()) && (s != null && s.current) ? s.current.applyTextFormatting({ color: w }) : X(w);
|
|
3274
3274
|
},
|
|
3275
3275
|
[X, s]
|
|
3276
3276
|
), ve = S(() => {
|
|
3277
|
-
var
|
|
3278
|
-
if ((
|
|
3277
|
+
var h;
|
|
3278
|
+
if ((h = s == null ? void 0 : s.current) != null && h.isEditingText())
|
|
3279
3279
|
s.current.toggleFormattingProperty("bold");
|
|
3280
3280
|
else {
|
|
3281
3281
|
if (!c || !(c instanceof Ue)) return;
|
|
@@ -3283,8 +3283,8 @@ function Ei(e = {}) {
|
|
|
3283
3283
|
w.bold = !B, w.richText && w.richText.clearStyleProperty("bold"), i(w);
|
|
3284
3284
|
}
|
|
3285
3285
|
}, [B, c, i, s]), we = S(() => {
|
|
3286
|
-
var
|
|
3287
|
-
if ((
|
|
3286
|
+
var h;
|
|
3287
|
+
if ((h = s == null ? void 0 : s.current) != null && h.isEditingText())
|
|
3288
3288
|
s.current.toggleFormattingProperty("italic");
|
|
3289
3289
|
else {
|
|
3290
3290
|
if (!c || !(c instanceof Ue)) return;
|
|
@@ -3292,8 +3292,8 @@ function Ei(e = {}) {
|
|
|
3292
3292
|
w.italic = !j, w.richText && w.richText.clearStyleProperty("italic"), i(w);
|
|
3293
3293
|
}
|
|
3294
3294
|
}, [j, c, i, s]), ke = S(() => {
|
|
3295
|
-
var
|
|
3296
|
-
if ((
|
|
3295
|
+
var h;
|
|
3296
|
+
if ((h = s == null ? void 0 : s.current) != null && h.isEditingText())
|
|
3297
3297
|
s.current.toggleFormattingProperty("underline");
|
|
3298
3298
|
else {
|
|
3299
3299
|
if (!c || !(c instanceof Ue)) return;
|
|
@@ -3302,14 +3302,14 @@ function Ei(e = {}) {
|
|
|
3302
3302
|
}
|
|
3303
3303
|
}, [se, c, i, s]), Re = S(() => {
|
|
3304
3304
|
if (!c) return;
|
|
3305
|
-
const
|
|
3306
|
-
w.letterCase =
|
|
3305
|
+
const h = Q === "uppercase" ? "none" : "uppercase", w = c.clone();
|
|
3306
|
+
w.letterCase = h, i(w);
|
|
3307
3307
|
}, [Q, c, i]), Ee = S(() => Q === "uppercase", [Q]), ye = S(() => {
|
|
3308
|
-
const
|
|
3308
|
+
const h = ["left", "center", "right"], w = h.indexOf(I), R = h[(w + 1) % h.length];
|
|
3309
3309
|
K(R);
|
|
3310
3310
|
}, [I, K]), Ie = S(() => {
|
|
3311
|
-
var
|
|
3312
|
-
if ((w = (
|
|
3311
|
+
var h, w, R, $;
|
|
3312
|
+
if ((w = (h = s == null ? void 0 : s.current) == null ? void 0 : h.isEditingText) != null && w.call(h)) {
|
|
3313
3313
|
const G = ($ = (R = s.current).getSelectionStyle) == null ? void 0 : $.call(R);
|
|
3314
3314
|
if (G)
|
|
3315
3315
|
return {
|
|
@@ -3330,11 +3330,11 @@ function Ei(e = {}) {
|
|
|
3330
3330
|
underline: se
|
|
3331
3331
|
};
|
|
3332
3332
|
}, [s, k, E, D, B, j, se]), ze = S(
|
|
3333
|
-
(
|
|
3333
|
+
(h) => {
|
|
3334
3334
|
if (!c) return;
|
|
3335
|
-
const w = Rr(
|
|
3335
|
+
const w = Rr(h);
|
|
3336
3336
|
if (!(w != null && w.Component)) return;
|
|
3337
|
-
const R = Di(c,
|
|
3337
|
+
const R = Di(c, h, w.Component);
|
|
3338
3338
|
i(R);
|
|
3339
3339
|
},
|
|
3340
3340
|
[c, i]
|
|
@@ -3368,7 +3368,7 @@ function Ei(e = {}) {
|
|
|
3368
3368
|
}
|
|
3369
3369
|
const Ii = bs("useLayerPreview");
|
|
3370
3370
|
function Ri(e) {
|
|
3371
|
-
var C, y, x,
|
|
3371
|
+
var C, y, x, m, N;
|
|
3372
3372
|
const { element: s, size: n = 148, backgroundColor: o = "transparent", enabled: r = !0 } = e, [c, i] = T(null), [p, g] = T(!1), b = V(null);
|
|
3373
3373
|
return Z(() => {
|
|
3374
3374
|
if (!r) {
|
|
@@ -3427,7 +3427,7 @@ function Ri(e) {
|
|
|
3427
3427
|
s instanceof ot ? s.isCropping : null,
|
|
3428
3428
|
s instanceof Hs ? (C = s.transformData) == null ? void 0 : C.fillColor : null,
|
|
3429
3429
|
s instanceof Hs ? (y = s.transformData) == null ? void 0 : y.fill : null,
|
|
3430
|
-
s instanceof Bo ? (
|
|
3430
|
+
s instanceof Bo ? (m = (x = s.transformData) == null ? void 0 : x.points) == null ? void 0 : m.length : null,
|
|
3431
3431
|
s instanceof Dt ? (N = s.children) == null ? void 0 : N.length : null
|
|
3432
3432
|
]), { previewUrl: c, isLoading: p };
|
|
3433
3433
|
}
|
|
@@ -3588,24 +3588,24 @@ function _i(e, s) {
|
|
|
3588
3588
|
), g = (i - p) / (o.length - 1), b = [];
|
|
3589
3589
|
let C = n ? r.bbox.x : r.bbox.y;
|
|
3590
3590
|
for (const y of o) {
|
|
3591
|
-
const x = n ? y.bbox.x : y.bbox.y,
|
|
3592
|
-
|
|
3591
|
+
const x = n ? y.bbox.x : y.bbox.y, m = C - x;
|
|
3592
|
+
m !== 0 && b.push({
|
|
3593
3593
|
id: y.id,
|
|
3594
|
-
x: y.x + (n ?
|
|
3595
|
-
y: y.y + (n ? 0 :
|
|
3594
|
+
x: y.x + (n ? m : 0),
|
|
3595
|
+
y: y.y + (n ? 0 : m)
|
|
3596
3596
|
}), C += (n ? y.bbox.width : y.bbox.height) + g;
|
|
3597
3597
|
}
|
|
3598
3598
|
return b;
|
|
3599
3599
|
}
|
|
3600
|
-
function
|
|
3601
|
-
const { elements: e, multiSelection: s, selectedElement: n, artboardManager: o, executeCommandBatch: r, setElements: c } =
|
|
3600
|
+
function hc() {
|
|
3601
|
+
const { elements: e, multiSelection: s, selectedElement: n, artboardManager: o, executeCommandBatch: r, setElements: c } = ms(), i = He(() => (s.length > 0 ? e.filter((y) => s.includes(y.id)) : n ? [n] : []).filter((y) => !y.locked), [e, s, n]), p = S(
|
|
3602
3602
|
(C) => {
|
|
3603
3603
|
if (C.length === 0) return;
|
|
3604
|
-
const y = new Map(i.map((
|
|
3605
|
-
const N = y.get(
|
|
3604
|
+
const y = new Map(i.map((m) => [m.id, m])), x = C.flatMap((m) => {
|
|
3605
|
+
const N = y.get(m.id);
|
|
3606
3606
|
if (!N) return [];
|
|
3607
3607
|
const v = N.clone();
|
|
3608
|
-
v.x =
|
|
3608
|
+
v.x = m.x, v.y = m.y;
|
|
3609
3609
|
const M = (E) => {
|
|
3610
3610
|
c((D) => D.map((k) => k.id === E.id ? E : k));
|
|
3611
3611
|
};
|
|
@@ -3616,17 +3616,17 @@ function mc() {
|
|
|
3616
3616
|
[i, r, c]
|
|
3617
3617
|
), g = S(
|
|
3618
3618
|
(C) => {
|
|
3619
|
-
const y = i.map((
|
|
3620
|
-
id:
|
|
3621
|
-
x:
|
|
3622
|
-
y:
|
|
3623
|
-
bbox:
|
|
3619
|
+
const y = i.map((m) => ({
|
|
3620
|
+
id: m.id,
|
|
3621
|
+
x: m.x,
|
|
3622
|
+
y: m.y,
|
|
3623
|
+
bbox: m.getBoundingBox()
|
|
3624
3624
|
}));
|
|
3625
3625
|
let x = y.length >= Fi ? fc(y) : null;
|
|
3626
3626
|
if (!x) {
|
|
3627
|
-
const
|
|
3628
|
-
if (!
|
|
3629
|
-
x = { x:
|
|
3627
|
+
const m = o.getActiveArtboard();
|
|
3628
|
+
if (!m) return;
|
|
3629
|
+
x = { x: m.x, y: m.y, width: m.width, height: m.height };
|
|
3630
3630
|
}
|
|
3631
3631
|
p(Oi(y, C, x));
|
|
3632
3632
|
},
|
|
@@ -3651,7 +3651,7 @@ function mc() {
|
|
|
3651
3651
|
distribute: b
|
|
3652
3652
|
};
|
|
3653
3653
|
}
|
|
3654
|
-
const
|
|
3654
|
+
const mc = [
|
|
3655
3655
|
{ mode: "left", icon: "gravity-ui:objects-align-left", label: "Align left" },
|
|
3656
3656
|
{ mode: "center-h", icon: "gravity-ui:objects-align-center-horizontal", label: "Align horizontal centers" },
|
|
3657
3657
|
{ mode: "right", icon: "gravity-ui:objects-align-right", label: "Align right" },
|
|
@@ -3666,7 +3666,7 @@ const hc = [
|
|
|
3666
3666
|
artboardScreenBounds: s,
|
|
3667
3667
|
partAttr: n
|
|
3668
3668
|
}) => {
|
|
3669
|
-
const { elements: o, multiSelection: r, artboardManager: c, canvasRef: i, canvasEditorRef: p } =
|
|
3669
|
+
const { elements: o, multiSelection: r, artboardManager: c, canvasRef: i, canvasEditorRef: p } = ms(), { panOffset: g } = zo(), { canAlign: b, canDistribute: C, align: y, distribute: x } = hc(), m = V(null), [N, v] = T(null), M = He(() => {
|
|
3670
3670
|
const k = o.filter((I) => r.includes(I.id)).map((I) => ({ id: I.id, x: I.x, y: I.y, bbox: I.getBoundingBox() }));
|
|
3671
3671
|
return fc(k);
|
|
3672
3672
|
}, [o, r]);
|
|
@@ -3678,7 +3678,7 @@ const hc = [
|
|
|
3678
3678
|
}
|
|
3679
3679
|
const k = () => {
|
|
3680
3680
|
var A, te, De, W;
|
|
3681
|
-
const I = ((A =
|
|
3681
|
+
const I = ((A = m.current) == null ? void 0 : A.offsetWidth) || 0, L = ((te = m.current) == null ? void 0 : te.offsetHeight) || 48, z = c.getActiveArtboard(), q = (z == null ? void 0 : z.x) || 0, B = (z == null ? void 0 : z.y) || 0, j = ((W = (De = p == null ? void 0 : p.current) == null ? void 0 : De.getZoom) == null ? void 0 : W.call(De)) || 1, se = i == null ? void 0 : i.current;
|
|
3682
3682
|
let Q, ee;
|
|
3683
3683
|
if (se) {
|
|
3684
3684
|
const ve = se.getBoundingClientRect();
|
|
@@ -3713,7 +3713,7 @@ const hc = [
|
|
|
3713
3713
|
}, D = /* @__PURE__ */ t(
|
|
3714
3714
|
"div",
|
|
3715
3715
|
{
|
|
3716
|
-
ref:
|
|
3716
|
+
ref: m,
|
|
3717
3717
|
className: "sc-toolbar",
|
|
3718
3718
|
"data-sc-part": n ?? "multi-selection-toolbar",
|
|
3719
3719
|
"data-testid": "multi-selection-toolbar",
|
|
@@ -3721,7 +3721,7 @@ const hc = [
|
|
|
3721
3721
|
"data-preserve-selection": !0,
|
|
3722
3722
|
style: E,
|
|
3723
3723
|
children: /* @__PURE__ */ f("div", { className: "sc-toolbar-items", children: [
|
|
3724
|
-
|
|
3724
|
+
mc.map(({ mode: k, icon: I, label: L }) => /* @__PURE__ */ t(
|
|
3725
3725
|
U,
|
|
3726
3726
|
{
|
|
3727
3727
|
icon: I,
|
|
@@ -3759,7 +3759,7 @@ const hc = [
|
|
|
3759
3759
|
onBlendModeToggle: C,
|
|
3760
3760
|
knockoutExpanded: y = !1,
|
|
3761
3761
|
onKnockoutToggle: x,
|
|
3762
|
-
distressTextureExpanded:
|
|
3762
|
+
distressTextureExpanded: m = !1,
|
|
3763
3763
|
onDistressTextureToggle: N,
|
|
3764
3764
|
imageMaskExpanded: v = !1,
|
|
3765
3765
|
onImageMaskToggle: M,
|
|
@@ -3854,8 +3854,8 @@ const hc = [
|
|
|
3854
3854
|
},
|
|
3855
3855
|
onMouseLeave: () => K(!1),
|
|
3856
3856
|
tooltip: "Distress Texture",
|
|
3857
|
-
tooltipDisabled: X ||
|
|
3858
|
-
active:
|
|
3857
|
+
tooltipDisabled: X || m,
|
|
3858
|
+
active: m || A.distress
|
|
3859
3859
|
}
|
|
3860
3860
|
),
|
|
3861
3861
|
M && /* @__PURE__ */ t(
|
|
@@ -3872,8 +3872,8 @@ const hc = [
|
|
|
3872
3872
|
}
|
|
3873
3873
|
),
|
|
3874
3874
|
/* @__PURE__ */ f(fe, { delayDuration: 300, children: [
|
|
3875
|
-
/* @__PURE__ */ t(
|
|
3876
|
-
/* @__PURE__ */ t(
|
|
3875
|
+
/* @__PURE__ */ t(he, { asChild: !0, children: /* @__PURE__ */ t(P, { variant: "ghost", size: "sm", onClick: E, children: "Ungroup" }) }),
|
|
3876
|
+
/* @__PURE__ */ t(me, { children: "Ungroup this group" })
|
|
3877
3877
|
] })
|
|
3878
3878
|
] });
|
|
3879
3879
|
};
|
|
@@ -3892,8 +3892,8 @@ function Bs({ children: e, className: s }) {
|
|
|
3892
3892
|
};
|
|
3893
3893
|
}, []), /* @__PURE__ */ t("div", { ref: n, className: s, style: { touchAction: "none" }, children: e });
|
|
3894
3894
|
}
|
|
3895
|
-
const js = 1e3,
|
|
3896
|
-
var
|
|
3895
|
+
const js = 1e3, hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
3896
|
+
var m, N;
|
|
3897
3897
|
const [o, r] = T("center"), c = V(null), i = V({ x: 0, y: 0 });
|
|
3898
3898
|
Z(() => {
|
|
3899
3899
|
const v = c.current;
|
|
@@ -3911,7 +3911,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
3911
3911
|
v.removeEventListener("touchstart", M), v.removeEventListener("touchmove", E);
|
|
3912
3912
|
};
|
|
3913
3913
|
}, []);
|
|
3914
|
-
const p = ((
|
|
3914
|
+
const p = ((m = e.transformData) == null ? void 0 : m.cropWidth) || 1, g = ((N = e.transformData) == null ? void 0 : N.cropHeight) || 1, b = S(
|
|
3915
3915
|
(v, M, E, D) => {
|
|
3916
3916
|
const k = e.clone();
|
|
3917
3917
|
k.updateCrop(v, M, E, D, !0), s(k);
|
|
@@ -4093,8 +4093,8 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4093
4093
|
);
|
|
4094
4094
|
}, _l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4095
4095
|
__proto__: null,
|
|
4096
|
-
CropPanel:
|
|
4097
|
-
default:
|
|
4096
|
+
CropPanel: hs,
|
|
4097
|
+
default: hs
|
|
4098
4098
|
}, Symbol.toStringTag, { value: "Module" })), je = "sc:flex sc:flex-col sc:gap-5 sc:px-5 sc:pt-4 sc:pb-4 sc:md:gap-4 sc:md:px-4 sc:md:pt-3 sc:md:pb-3", gc = "sc:flex sc:flex-col sc:gap-5 sc:px-5 sc:pt-4 sc:pb-[calc(env(safe-area-inset-bottom,0px)+20px)] sc:md:gap-4 sc:md:px-4 sc:md:pt-2 sc:md:pb-[calc(env(safe-area-inset-bottom,0px)+16px)]", Ui = ({ value: e, onChange: s }) => /* @__PURE__ */ t(
|
|
4099
4099
|
"div",
|
|
4100
4100
|
{
|
|
@@ -4103,7 +4103,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4103
4103
|
style: { touchAction: "pan-y" },
|
|
4104
4104
|
children: /* @__PURE__ */ t("div", { className: je, children: /* @__PURE__ */ t(be, { label: "Radius", value: e, onChange: s, min: 0, max: 50, unit: "%" }) })
|
|
4105
4105
|
}
|
|
4106
|
-
), bc = ({ onAlign: e }) => /* @__PURE__ */ t("div", { className: "align-panel sc:flex sc:flex-col", "data-preserve-selection": !0, style: { touchAction: "pan-y" }, children: /* @__PURE__ */ t("div", { className: je, children: /* @__PURE__ */ t("div", { className: "sc:flex sc:items-center sc:justify-center sc:gap-1", children:
|
|
4106
|
+
), bc = ({ onAlign: e }) => /* @__PURE__ */ t("div", { className: "align-panel sc:flex sc:flex-col", "data-preserve-selection": !0, style: { touchAction: "pan-y" }, children: /* @__PURE__ */ t("div", { className: je, children: /* @__PURE__ */ t("div", { className: "sc:flex sc:items-center sc:justify-center sc:gap-1", children: mc.map(({ mode: s, icon: n, label: o }) => /* @__PURE__ */ t(
|
|
4107
4107
|
U,
|
|
4108
4108
|
{
|
|
4109
4109
|
icon: n,
|
|
@@ -4373,7 +4373,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4373
4373
|
(p == null ? void 0 : p.type) !== "linear" || !o || o({ type: "linear", angle: v, stops: p.stops.map((M) => ({ ...M })) });
|
|
4374
4374
|
},
|
|
4375
4375
|
[p, o]
|
|
4376
|
-
),
|
|
4376
|
+
), m = p ? ((N = p.stops[g]) == null ? void 0 : N.color) ?? e : e;
|
|
4377
4377
|
return /* @__PURE__ */ t(
|
|
4378
4378
|
"div",
|
|
4379
4379
|
{
|
|
@@ -4424,7 +4424,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4424
4424
|
/* @__PURE__ */ t(
|
|
4425
4425
|
Et,
|
|
4426
4426
|
{
|
|
4427
|
-
value:
|
|
4427
|
+
value: m,
|
|
4428
4428
|
onChange: (v) => p ? y(v.target.value) : s(v.target.value),
|
|
4429
4429
|
documentColors: r,
|
|
4430
4430
|
imageColors: c,
|
|
@@ -4631,7 +4631,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4631
4631
|
s(N ? { enabled: !0, color: p, width: g, lineCap: C, lineJoin: y, opacity: b } : void 0);
|
|
4632
4632
|
},
|
|
4633
4633
|
[s, p, g, C, y, b]
|
|
4634
|
-
),
|
|
4634
|
+
), m = S(
|
|
4635
4635
|
(N) => {
|
|
4636
4636
|
e && s({ ...e, ...N });
|
|
4637
4637
|
},
|
|
@@ -4655,7 +4655,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4655
4655
|
Et,
|
|
4656
4656
|
{
|
|
4657
4657
|
value: p,
|
|
4658
|
-
onChange: (N) =>
|
|
4658
|
+
onChange: (N) => m({ color: N.target.value }),
|
|
4659
4659
|
documentColors: n,
|
|
4660
4660
|
imageColors: o,
|
|
4661
4661
|
showSquare: !0
|
|
@@ -4667,7 +4667,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4667
4667
|
{
|
|
4668
4668
|
label: "Width",
|
|
4669
4669
|
value: g,
|
|
4670
|
-
onChange: (N) =>
|
|
4670
|
+
onChange: (N) => m({ width: N }),
|
|
4671
4671
|
min: 1,
|
|
4672
4672
|
max: 50,
|
|
4673
4673
|
unit: "px"
|
|
@@ -4678,7 +4678,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4678
4678
|
{
|
|
4679
4679
|
label: "Opacity",
|
|
4680
4680
|
value: Math.round(b * 100),
|
|
4681
|
-
onChange: (N) =>
|
|
4681
|
+
onChange: (N) => m({ opacity: N / 100 }),
|
|
4682
4682
|
min: 0,
|
|
4683
4683
|
max: 100,
|
|
4684
4684
|
unit: "%"
|
|
@@ -4702,7 +4702,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4702
4702
|
"button",
|
|
4703
4703
|
{
|
|
4704
4704
|
className: `sc:px-4 sc:py-2.5 sc:text-base sc:md:px-3 sc:md:py-1.5 sc:md:text-sm sc:capitalize sc:transition-colors ${C === N ? "sc:bg-primary sc:text-primary-foreground" : "sc:text-foreground sc:hover:bg-muted"}`,
|
|
4705
|
-
onClick: () =>
|
|
4705
|
+
onClick: () => m({ lineCap: N }),
|
|
4706
4706
|
children: N
|
|
4707
4707
|
},
|
|
4708
4708
|
N
|
|
@@ -4714,7 +4714,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4714
4714
|
"button",
|
|
4715
4715
|
{
|
|
4716
4716
|
className: `sc:px-4 sc:py-2.5 sc:text-base sc:md:px-3 sc:md:py-1.5 sc:md:text-sm sc:capitalize sc:transition-colors ${y === N ? "sc:bg-primary sc:text-primary-foreground" : "sc:text-foreground sc:hover:bg-muted"}`,
|
|
4717
|
-
onClick: () =>
|
|
4717
|
+
onClick: () => m({ lineJoin: N }),
|
|
4718
4718
|
children: N
|
|
4719
4719
|
},
|
|
4720
4720
|
N
|
|
@@ -4839,7 +4839,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4839
4839
|
)) })
|
|
4840
4840
|
] }) })
|
|
4841
4841
|
}
|
|
4842
|
-
), rl = ({ element: e, onElementUpdate: s }) => /* @__PURE__ */ t(
|
|
4842
|
+
), rl = ({ element: e, onElementUpdate: s }) => /* @__PURE__ */ t(hs, { element: e, onElementUpdate: s }), il = ({
|
|
4843
4843
|
panelType: e,
|
|
4844
4844
|
defaultIcon: s,
|
|
4845
4845
|
textColorValue: n,
|
|
@@ -4936,7 +4936,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4936
4936
|
isOpacityPanelOpen: C,
|
|
4937
4937
|
isAdjustPanelOpen: y,
|
|
4938
4938
|
isFontSizePanelOpen: x,
|
|
4939
|
-
isShapeCornerRadiusPanelOpen:
|
|
4939
|
+
isShapeCornerRadiusPanelOpen: m,
|
|
4940
4940
|
isShapeTransparencyPanelOpen: N,
|
|
4941
4941
|
isShapeSidesPanelOpen: v,
|
|
4942
4942
|
isShapePointsPanelOpen: M,
|
|
@@ -5009,7 +5009,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
5009
5009
|
/* @__PURE__ */ t(Ae, { isOpen: C, children: X }),
|
|
5010
5010
|
/* @__PURE__ */ t(Ae, { isOpen: y, children: K }),
|
|
5011
5011
|
/* @__PURE__ */ t(Ae, { isOpen: x, children: Y }),
|
|
5012
|
-
/* @__PURE__ */ t(Ae, { isOpen:
|
|
5012
|
+
/* @__PURE__ */ t(Ae, { isOpen: m, children: de }),
|
|
5013
5013
|
/* @__PURE__ */ t(Ae, { isOpen: N, children: A }),
|
|
5014
5014
|
/* @__PURE__ */ t(Ae, { isOpen: v, children: te }),
|
|
5015
5015
|
/* @__PURE__ */ t(Ae, { isOpen: M, children: De }),
|
|
@@ -5092,7 +5092,7 @@ const js = 1e3, ms = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
5092
5092
|
zIndex: "var(--sc-z-tooltip)",
|
|
5093
5093
|
minWidth: "300px"
|
|
5094
5094
|
},
|
|
5095
|
-
children: /* @__PURE__ */ t(
|
|
5095
|
+
children: /* @__PURE__ */ t(hs, { element: n, onElementUpdate: o })
|
|
5096
5096
|
}
|
|
5097
5097
|
), nt = (e) => typeof e == "string" && e.length > 0 && e !== "transparent";
|
|
5098
5098
|
function yc(e, s) {
|
|
@@ -5149,15 +5149,15 @@ function Qs(e) {
|
|
|
5149
5149
|
p.r < s && (s = p.r), p.r > n && (n = p.r), p.g < o && (o = p.g), p.g > r && (r = p.g), p.b < c && (c = p.b), p.b > i && (i = p.b);
|
|
5150
5150
|
return { rRange: n - s, gRange: r - o, bRange: i - c };
|
|
5151
5151
|
}
|
|
5152
|
-
function
|
|
5152
|
+
function hl(e) {
|
|
5153
5153
|
const s = Math.max(e.rRange, e.gRange, e.bRange);
|
|
5154
5154
|
return e.rRange === s ? "r" : e.gRange === s ? "g" : "b";
|
|
5155
5155
|
}
|
|
5156
|
-
function
|
|
5156
|
+
function ml(e) {
|
|
5157
5157
|
return Math.max(e.rRange, e.gRange, e.bRange);
|
|
5158
5158
|
}
|
|
5159
5159
|
function gl(e) {
|
|
5160
|
-
const s =
|
|
5160
|
+
const s = hl(e), n = e.pixels.slice().sort((i, p) => i[s] - p[s]), o = n.length >> 1, r = n.slice(0, o), c = n.slice(o);
|
|
5161
5161
|
return [
|
|
5162
5162
|
{ pixels: r, ...Qs(r) },
|
|
5163
5163
|
{ pixels: c, ...Qs(c) }
|
|
@@ -5180,7 +5180,7 @@ function yl(e, s) {
|
|
|
5180
5180
|
for (; n.length < s; ) {
|
|
5181
5181
|
let o = -1, r = 0;
|
|
5182
5182
|
for (let i = 0; i < n.length; i++) {
|
|
5183
|
-
const p =
|
|
5183
|
+
const p = ml(n[i]);
|
|
5184
5184
|
p > r && n[i].pixels.length >= 2 && (r = p, o = i);
|
|
5185
5185
|
}
|
|
5186
5186
|
if (o === -1) break;
|
|
@@ -5303,7 +5303,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5303
5303
|
artboardScreenBounds: C,
|
|
5304
5304
|
maxWidth: y,
|
|
5305
5305
|
transparent: x = !1,
|
|
5306
|
-
onPanelExpandChange:
|
|
5306
|
+
onPanelExpandChange: m,
|
|
5307
5307
|
defaultExpandedPanel: N,
|
|
5308
5308
|
onExpandedPanelTypeChange: v,
|
|
5309
5309
|
onOpenCropDrawer: M,
|
|
@@ -5317,12 +5317,12 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5317
5317
|
partAttr: B
|
|
5318
5318
|
}) => {
|
|
5319
5319
|
var Xn, qn, Kn, Gn, Zn, Pn, Jn, Qn, eo, to, so, no, oo, co, ao, ro, io, lo, uo;
|
|
5320
|
-
const { panOffset: j } = zo(), { multiSelection: se, setSelectedId: Q } =
|
|
5320
|
+
const { panOffset: j } = zo(), { multiSelection: se, setSelectedId: Q } = hr(), {
|
|
5321
5321
|
expandedPanelType: ee,
|
|
5322
5322
|
setExpandedPanelType: le,
|
|
5323
5323
|
setIsToolbarMenuOpen: X,
|
|
5324
5324
|
isRotating: K
|
|
5325
|
-
} =
|
|
5325
|
+
} = mr(), {
|
|
5326
5326
|
elements: Y,
|
|
5327
5327
|
setElements: de,
|
|
5328
5328
|
selectedElement: A,
|
|
@@ -5337,14 +5337,14 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5337
5337
|
executeAddElement: ye,
|
|
5338
5338
|
executeReorderElement: Ie,
|
|
5339
5339
|
refreshArtboards: ze
|
|
5340
|
-
} =
|
|
5340
|
+
} = ms(), { removeBackground: h } = Ao(), w = Ei({ canvasEditorRef: we }), [R, $] = T("root"), [G, Te] = T(null), [H, ae] = T(null), [Je, Ce] = T(!1), [We, Qe] = T(!1), [et] = T(!1), [tt, xt] = T(!1), [ct, $e] = T(!1), [l, ne] = T(() => N && {
|
|
5341
5341
|
cornerRadius: { type: "cornerRadius", icon: "lucide:square-round-corner", label: "Corner Radius" },
|
|
5342
5342
|
crop: { type: "crop", icon: "lucide:crop", label: "Crop" },
|
|
5343
5343
|
rotation: { type: "rotation", icon: ie.rotateLeft, label: "Rotate" },
|
|
5344
5344
|
opacity: { type: "opacity", icon: "lucide:blend", label: "Transparency" },
|
|
5345
5345
|
effects: { type: "effects", icon: "lucide:sparkles", label: "Effects" }
|
|
5346
|
-
}[N] || null), [at, re] = T(!1), [rt, Le] = T(!1), [Kt, vt] = T(!1), [Ct, it] = T(!1), [wt, kt] = T(null), [Gt, Tt] = T(null), [lt, sn] = T({ width: 0, height: 0 }), ut = V(null), pt = V(null), Cs = V(0), nn = V(!1), on = V(!1), ws = V(null), xc = V(void 0), Zt = V(null), cn = V(ee), an = V(void 0), rn = V(void 0), ln = V(!1), dn = V(!1), vc = V(!!N), un = V(!1), pn = V(l), fn = V(null),
|
|
5347
|
-
}), ks = V(void 0),
|
|
5346
|
+
}[N] || null), [at, re] = T(!1), [rt, Le] = T(!1), [Kt, vt] = T(!1), [Ct, it] = T(!1), [wt, kt] = T(null), [Gt, Tt] = T(null), [lt, sn] = T({ width: 0, height: 0 }), ut = V(null), pt = V(null), Cs = V(0), nn = V(!1), on = V(!1), ws = V(null), xc = V(void 0), Zt = V(null), cn = V(ee), an = V(void 0), rn = V(void 0), ln = V(!1), dn = V(!1), vc = V(!!N), un = V(!1), pn = V(l), fn = V(null), hn = V(() => {
|
|
5347
|
+
}), ks = V(void 0), mn = V(void 0);
|
|
5348
5348
|
dn.current = K;
|
|
5349
5349
|
const d = te || A, Pt = d == null ? void 0 : d.id, ft = A == null ? void 0 : A.id, It = d == null ? void 0 : d.transformType, { fontColor: Ts, getEffectiveStyle: Cc, handleFontColorChange: Ns } = w, Rt = !!(A && !K), F = S(
|
|
5350
5350
|
(a) => {
|
|
@@ -5375,7 +5375,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5375
5375
|
const pe = xe.clone();
|
|
5376
5376
|
return pe.imageUrl = u, pe.imageLoaded = !1, pe.imageElement = null, pe.onLoadCallback = (Oe) => {
|
|
5377
5377
|
const _e = Oe;
|
|
5378
|
-
de((
|
|
5378
|
+
de((ht) => ht.map((Ot) => Ot.id === _e.id ? _e : Ot));
|
|
5379
5379
|
}, pe.loadImage(u), pe;
|
|
5380
5380
|
}, _ = yn.current, ue = _.find((xe) => xe.id === a);
|
|
5381
5381
|
if (ue) {
|
|
@@ -5385,7 +5385,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5385
5385
|
}
|
|
5386
5386
|
for (const xe of _) {
|
|
5387
5387
|
if (!(xe instanceof Dt)) continue;
|
|
5388
|
-
const pe = xe.children.findIndex((
|
|
5388
|
+
const pe = xe.children.findIndex((ht) => ht.id === a);
|
|
5389
5389
|
if (pe === -1) continue;
|
|
5390
5390
|
const Oe = xe.children[pe];
|
|
5391
5391
|
if (!(Oe instanceof ot)) return;
|
|
@@ -5396,18 +5396,18 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5396
5396
|
},
|
|
5397
5397
|
[Re, de]
|
|
5398
5398
|
), kc = S(() => {
|
|
5399
|
-
if (!
|
|
5399
|
+
if (!h || Ss) return;
|
|
5400
5400
|
const a = d;
|
|
5401
5401
|
if (!a || !(a instanceof ot) || !a.imageUrl) return;
|
|
5402
5402
|
const u = a.id;
|
|
5403
|
-
bn(!0), Ds(null),
|
|
5403
|
+
bn(!0), Ds(null), h(a.imageUrl).then((O) => {
|
|
5404
5404
|
zt.current && xn(u, O);
|
|
5405
5405
|
}).catch((O) => {
|
|
5406
5406
|
Do.error("Error removing background:", O), zt.current && Ds(Dl(O, Sl));
|
|
5407
5407
|
}).finally(() => {
|
|
5408
5408
|
zt.current && bn(!1);
|
|
5409
5409
|
});
|
|
5410
|
-
}, [
|
|
5410
|
+
}, [h, Ss, d, xn]);
|
|
5411
5411
|
Z(() => {
|
|
5412
5412
|
Ds(null);
|
|
5413
5413
|
}, [Pt]);
|
|
@@ -5460,7 +5460,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5460
5460
|
a === null ? delete u.transformData.fill : u.transformData.fill = a, F(u);
|
|
5461
5461
|
},
|
|
5462
5462
|
[d, F]
|
|
5463
|
-
), { canAlign: Rc, align: vn } =
|
|
5463
|
+
), { canAlign: Rc, align: vn } = hc(), zc = S(() => {
|
|
5464
5464
|
ne(
|
|
5465
5465
|
(a) => (a == null ? void 0 : a.type) === "align" ? null : { type: "align", icon: "gravity-ui:objects-align-center-vertical", label: "Position" }
|
|
5466
5466
|
);
|
|
@@ -5753,14 +5753,14 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5753
5753
|
u.shadow = a, F(u);
|
|
5754
5754
|
},
|
|
5755
5755
|
[d, F]
|
|
5756
|
-
),
|
|
5756
|
+
), ha = S(
|
|
5757
5757
|
(a) => {
|
|
5758
5758
|
if (!d) return;
|
|
5759
5759
|
const u = d.clone();
|
|
5760
5760
|
u.blendMode = a === "normal" ? void 0 : a, F(u);
|
|
5761
5761
|
},
|
|
5762
5762
|
[d, F]
|
|
5763
|
-
),
|
|
5763
|
+
), ma = S(
|
|
5764
5764
|
(a) => {
|
|
5765
5765
|
if (!d || d.transformType !== "shape") return;
|
|
5766
5766
|
const O = d.clone();
|
|
@@ -5771,10 +5771,10 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5771
5771
|
o ? o() : $e(!0);
|
|
5772
5772
|
}, [o]);
|
|
5773
5773
|
Z(() => {
|
|
5774
|
-
|
|
5774
|
+
m == null || m(l !== null), v == null || v(
|
|
5775
5775
|
(l == null ? void 0 : l.type) ?? null
|
|
5776
5776
|
);
|
|
5777
|
-
}, [l,
|
|
5777
|
+
}, [l, m, v]), Z(() => {
|
|
5778
5778
|
const a = (l == null ? void 0 : l.type) ?? null;
|
|
5779
5779
|
a !== Zt.current && (Zt.current = a, le(a));
|
|
5780
5780
|
}, [l, le]), Z(() => {
|
|
@@ -5819,9 +5819,9 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5819
5819
|
L && A && (z == null || z(!1));
|
|
5820
5820
|
}, [L, A, z]), Z(() => {
|
|
5821
5821
|
const a = (d == null ? void 0 : d.transformType) === "image" ? d.isCropping : !1;
|
|
5822
|
-
(l == null ? void 0 : l.type) === "crop" &&
|
|
5822
|
+
(l == null ? void 0 : l.type) === "crop" && mn.current === !0 && a === !1 && ne(null), mn.current = a;
|
|
5823
5823
|
}, [d, l == null ? void 0 : l.type]), Z(() => {
|
|
5824
|
-
pn.current = l, fn.current = d ?? null,
|
|
5824
|
+
pn.current = l, fn.current = d ?? null, hn.current = F;
|
|
5825
5825
|
}), Z(() => {
|
|
5826
5826
|
const a = setTimeout(() => {
|
|
5827
5827
|
un.current = !0;
|
|
@@ -5837,7 +5837,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5837
5837
|
const O = u;
|
|
5838
5838
|
if (O.isCropping) {
|
|
5839
5839
|
const _ = O.clone();
|
|
5840
|
-
_.exitCropMode(),
|
|
5840
|
+
_.exitCropMode(), hn.current(_);
|
|
5841
5841
|
}
|
|
5842
5842
|
}
|
|
5843
5843
|
}
|
|
@@ -5883,9 +5883,9 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5883
5883
|
const u = () => {
|
|
5884
5884
|
var _, ue, xe, pe, Oe;
|
|
5885
5885
|
try {
|
|
5886
|
-
const _e = ((_ = ut.current) == null ? void 0 : _.offsetWidth) || lt.width || 0,
|
|
5887
|
-
x:
|
|
5888
|
-
y:
|
|
5886
|
+
const _e = ((_ = ut.current) == null ? void 0 : _.offsetWidth) || lt.width || 0, ht = ((ue = ut.current) == null ? void 0 : ue.offsetHeight) || lt.height || 48, Ot = ke == null ? void 0 : ke.current, mt = te || A, Nt = mt.transformData, qe = ((xe = mt.getBoundingBox) == null ? void 0 : xe.call(mt)) || {
|
|
5887
|
+
x: mt.x,
|
|
5888
|
+
y: mt.y,
|
|
5889
5889
|
width: (Nt == null ? void 0 : Nt.width) || 100,
|
|
5890
5890
|
height: (Nt == null ? void 0 : Nt.height) || 50
|
|
5891
5891
|
}, St = W.getActiveArtboard(), po = (St == null ? void 0 : St.x) || 0, fo = (St == null ? void 0 : St.y) || 0, Ke = ((Oe = (pe = we == null ? void 0 : we.current) == null ? void 0 : pe.getZoom) == null ? void 0 : Oe.call(pe)) || 1;
|
|
@@ -5899,15 +5899,15 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
5899
5899
|
const Bt = window.innerWidth / 2, Os = window.innerHeight / 2;
|
|
5900
5900
|
is = Bt - qe.width * Ke / 2, _t = Os - qe.height * Ke / 2, ls = qe.width * Ke, ds = qe.height * Ke;
|
|
5901
5901
|
}
|
|
5902
|
-
const
|
|
5903
|
-
let gt = lr -
|
|
5902
|
+
const ho = 12, lr = _t, dr = is + ls / 2;
|
|
5903
|
+
let gt = lr - ht - ho, Fs = dr;
|
|
5904
5904
|
if (_e > 0) {
|
|
5905
5905
|
const Os = _e / 2 + 20, pr = window.innerWidth - _e / 2 - 20;
|
|
5906
5906
|
Fs = Math.max(Os, Math.min(pr, Fs));
|
|
5907
5907
|
}
|
|
5908
|
-
gt < 10 && (gt = _t + ds +
|
|
5909
|
-
const ur = window.innerHeight -
|
|
5910
|
-
gt = Math.min(gt, ur), gt = Math.max(10, gt), ae({ top: gt, left: Fs }), kt(
|
|
5908
|
+
gt < 10 && (gt = _t + ds + ho);
|
|
5909
|
+
const ur = window.innerHeight - ht - 10;
|
|
5910
|
+
gt = Math.min(gt, ur), gt = Math.max(10, gt), ae({ top: gt, left: Fs }), kt(mt.id);
|
|
5911
5911
|
} catch (_e) {
|
|
5912
5912
|
Do.error("Error calculating toolbar position:", _e), ae(null);
|
|
5913
5913
|
}
|
|
@@ -6100,7 +6100,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
6100
6100
|
onMoveForward: cs,
|
|
6101
6101
|
onMoveBackward: as,
|
|
6102
6102
|
onChangeImage: n,
|
|
6103
|
-
onRemoveBackground:
|
|
6103
|
+
onRemoveBackground: h ? kc : void 0,
|
|
6104
6104
|
removingBackground: Ss,
|
|
6105
6105
|
removeBackgroundError: wc,
|
|
6106
6106
|
onDelete: Es,
|
|
@@ -6359,7 +6359,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
6359
6359
|
al,
|
|
6360
6360
|
{
|
|
6361
6361
|
blendMode: Oo(d.blendMode) ? d.blendMode : "normal",
|
|
6362
|
-
onChange:
|
|
6362
|
+
onChange: ha
|
|
6363
6363
|
}
|
|
6364
6364
|
) : null, er = $n && d ? /* @__PURE__ */ t(
|
|
6365
6365
|
tl,
|
|
@@ -6558,7 +6558,7 @@ const Mo = ({ services: e, ...s }) => {
|
|
|
6558
6558
|
{
|
|
6559
6559
|
isOpen: ct,
|
|
6560
6560
|
onClose: () => $e(!1),
|
|
6561
|
-
onSelectType:
|
|
6561
|
+
onSelectType: ma,
|
|
6562
6562
|
currentType: d.transformData.shapeType
|
|
6563
6563
|
}
|
|
6564
6564
|
)
|
|
@@ -6573,14 +6573,14 @@ export {
|
|
|
6573
6573
|
dc as B,
|
|
6574
6574
|
Mo as C,
|
|
6575
6575
|
Yo as D,
|
|
6576
|
-
|
|
6576
|
+
hi as F,
|
|
6577
6577
|
li as I,
|
|
6578
6578
|
yi as M,
|
|
6579
6579
|
Pe as P,
|
|
6580
6580
|
di as S,
|
|
6581
6581
|
Ti as T,
|
|
6582
6582
|
wi as U,
|
|
6583
|
-
|
|
6583
|
+
hs as a,
|
|
6584
6584
|
Ge as b,
|
|
6585
6585
|
Xe as c,
|
|
6586
6586
|
vi as d,
|
|
@@ -6601,4 +6601,4 @@ export {
|
|
|
6601
6601
|
Bl as s,
|
|
6602
6602
|
Ri as u
|
|
6603
6603
|
};
|
|
6604
|
-
//# sourceMappingURL=ContextualToolbars-
|
|
6604
|
+
//# sourceMappingURL=ContextualToolbars-B2LTNu7r.js.map
|