@snowcone-app/canvas 0.40.20 → 0.40.22
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/ERROR_CONTRACT.md +30 -0
- package/dist/{CanvasRenderer-COHWEK1r.js → CanvasRenderer-BmLEU_Zb.js} +4 -4
- package/dist/{CanvasRenderer-COHWEK1r.js.map → CanvasRenderer-BmLEU_Zb.js.map} +1 -1
- package/dist/{CanvasStateV1-DwziqxMO.js → CanvasStateV1-DnpfA376.js} +3 -3
- package/dist/{CanvasStateV1-DwziqxMO.js.map → CanvasStateV1-DnpfA376.js.map} +1 -1
- package/dist/{ContextualToolbars-D-EX9Q9L.js → ContextualToolbars-DSJykxdc.js} +196 -196
- package/dist/{ContextualToolbars-D-EX9Q9L.js.map → ContextualToolbars-DSJykxdc.js.map} +1 -1
- package/dist/{EditorCanvasImpl-Bt-dfd8v.js → EditorCanvasImpl-t5MD0lMB.js} +8 -8
- package/dist/{EditorCanvasImpl-Bt-dfd8v.js.map → EditorCanvasImpl-t5MD0lMB.js.map} +1 -1
- package/dist/{ExportManager-DLOH2Kzk.js → ExportManager-CnUTZrbv.js} +2 -2
- package/dist/{ExportManager-DLOH2Kzk.js.map → ExportManager-CnUTZrbv.js.map} +1 -1
- package/dist/{FontAnalyzer-DWHS41ba.js → FontAnalyzer-Bjtl4XTH.js} +70 -70
- package/dist/{FontAnalyzer-DWHS41ba.js.map → FontAnalyzer-Bjtl4XTH.js.map} +1 -1
- package/dist/{ImagePanel-BIzwlaf5.js → ImagePanel-AWQgzuXz.js} +6 -6
- package/dist/{ImagePanel-BIzwlaf5.js.map → ImagePanel-AWQgzuXz.js.map} +1 -1
- package/dist/SnowconeCanvas-BWv3Sd5P.js +1213 -0
- package/dist/SnowconeCanvas-BWv3Sd5P.js.map +1 -0
- package/dist/advanced.mjs +15 -15
- package/dist/api/stable.d.ts +1 -0
- package/dist/components/embed/SnowconeCanvas.d.ts +13 -0
- package/dist/components/embed/kernel.d.ts +8 -0
- package/dist/{custom-icons-DHew1GPV.js → custom-icons-Bn8_I4kt.js} +2 -2
- package/dist/{custom-icons-DHew1GPV.js.map → custom-icons-Bn8_I4kt.js.map} +1 -1
- package/dist/{design-builder-CoCtjIwj.js → design-builder-B3v5OAQo.js} +48 -48
- package/dist/{design-builder-CoCtjIwj.js.map → design-builder-B3v5OAQo.js.map} +1 -1
- package/dist/{embed-Dzblbo8q.js → embed-D6-jVZMw.js} +10 -10
- package/dist/{embed-Dzblbo8q.js.map → embed-D6-jVZMw.js.map} +1 -1
- package/dist/embed.mjs +9 -9
- package/dist/errors/editorError.d.ts +6 -0
- package/dist/{guards-DMmhw_Ow.js → guards-B_Q3pewr.js} +2 -2
- package/dist/{guards-DMmhw_Ow.js.map → guards-B_Q3pewr.js.map} +1 -1
- package/dist/index.mjs +9 -9
- package/dist/internals.mjs +6 -6
- package/dist/{template-fields-BzAlpOEB.js → template-fields-B4sJfQjP.js} +18 -18
- package/dist/{template-fields-BzAlpOEB.js.map → template-fields-B4sJfQjP.js.map} +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{useCommands-CLnk8kvW.js → useCommands-CZHeVauL.js} +7 -7
- package/dist/{useCommands-CLnk8kvW.js.map → useCommands-CZHeVauL.js.map} +1 -1
- package/dist/{usePieceGuideBundle-BpIz4qow.js → usePieceGuideBundle-DsCv7HKy.js} +2 -2
- package/dist/{usePieceGuideBundle-BpIz4qow.js.map → usePieceGuideBundle-DsCv7HKy.js.map} +1 -1
- package/dist/utils/initialImageText.d.ts +51 -0
- package/dist/{validation-Ds2Df_gS.js → validation-D9catdeB.js} +11 -11
- package/dist/{validation-Ds2Df_gS.js.map → validation-D9catdeB.js.map} +1 -1
- package/example/package.json +1 -1
- package/package.json +3 -3
- package/dist/SnowconeCanvas-BZVuH85I.js +0 -1134
- package/dist/SnowconeCanvas-BZVuH85I.js.map +0 -1
|
@@ -2,14 +2,14 @@ import { jsx as t, jsxs as h, Fragment as Ve } from "react/jsx-runtime";
|
|
|
2
2
|
import * as oe from "react";
|
|
3
3
|
import Fe, { useRef as V, useEffect as Z, useCallback as S, useState as T, useLayoutEffect as Mo, useMemo as He, memo as Eo, useSyncExternalStore as ur } from "react";
|
|
4
4
|
import { createPortal as Io } from "react-dom";
|
|
5
|
-
import { b as ms, d as Ro, c as fr, m as pr } from "./design-builder-
|
|
6
|
-
import { u as zo, I as
|
|
7
|
-
import { R as gs, L as Me, a as vr, I as Cr, T as st } from "./custom-icons-
|
|
8
|
-
import { i as Ao, aT as Fo, aY as Oo, aU as po, aZ as wr, c as bs,
|
|
5
|
+
import { b as ms, d as Ro, c as fr, m as pr } from "./design-builder-B3v5OAQo.js";
|
|
6
|
+
import { u as zo, I as J, c as Se, V as hr, i as le, m as St, B as Q, W as mr, T as he, q as me, r as ge, X as j, w as Ht, a as Lo, U as Ze, D as gr, C as br, j as yr, S as xr } from "./useCommands-CZHeVauL.js";
|
|
7
|
+
import { R as gs, L as Me, a as vr, I as Cr, T as st } from "./custom-icons-Bn8_I4kt.js";
|
|
8
|
+
import { i as Ao, aT as Fo, aY as Oo, aU as po, aZ as wr, c as bs, Y as kr, a_ as Tr, a$ as Nr, b0 as Sr, b1 as Dr, b2 as ho, X as mo, V as Mr, G as Dt, T as je, q as Er, I as ot, S as $s, P as _o, t as Ir, b3 as Bo, b4 as Rr, aX as zr } from "./FontAnalyzer-Bjtl4XTH.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 go, S as Uo, U as js, V as Hs, X as $o, Y as Ws, G as _s, H as Lr, J as Ar, K as Fr, Z as bo } from "./ExportManager-
|
|
12
|
-
import * as
|
|
11
|
+
import { T as go, S as Uo, U as js, V as Hs, X as $o, Y as Ws, G as _s, H as Lr, J as Ar, K as Fr, Z as bo } from "./ExportManager-CnUTZrbv.js";
|
|
12
|
+
import * as Ps from "@radix-ui/react-collapsible";
|
|
13
13
|
import * as Vs from "@radix-ui/react-switch";
|
|
14
14
|
import * as Ys from "@radix-ui/react-checkbox";
|
|
15
15
|
import * as jo from "@radix-ui/react-separator";
|
|
@@ -42,7 +42,7 @@ const Xt = oe.forwardRef(
|
|
|
42
42
|
"sc:data-[state=checked]:animate-in sc:data-[state=checked]:zoom-in-0 sc:data-[state=checked]:duration-300",
|
|
43
43
|
"sc:data-[state=indeterminate]:animate-in sc:data-[state=indeterminate]:zoom-in-0 sc:data-[state=indeterminate]:duration-150"
|
|
44
44
|
),
|
|
45
|
-
children: s === "indeterminate" ? /* @__PURE__ */ t(
|
|
45
|
+
children: s === "indeterminate" ? /* @__PURE__ */ t(J, { icon: "gravity-ui:minus", className: "sc:size-3" }) : /* @__PURE__ */ t(J, { icon: "gravity-ui:check", className: "sc:size-3" })
|
|
46
46
|
}
|
|
47
47
|
)
|
|
48
48
|
}
|
|
@@ -51,7 +51,7 @@ const Xt = oe.forwardRef(
|
|
|
51
51
|
);
|
|
52
52
|
Xt.displayName = Ys.Root.displayName;
|
|
53
53
|
const Ho = oe.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ t(
|
|
54
|
-
|
|
54
|
+
Ps.Root,
|
|
55
55
|
{
|
|
56
56
|
ref: n,
|
|
57
57
|
className: Se(e),
|
|
@@ -59,8 +59,8 @@ const Ho = oe.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ t(
|
|
|
59
59
|
}
|
|
60
60
|
));
|
|
61
61
|
Ho.displayName = "Collapsible";
|
|
62
|
-
const Or =
|
|
63
|
-
|
|
62
|
+
const Or = Ps.Trigger, Wo = oe.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ t(
|
|
63
|
+
Ps.Content,
|
|
64
64
|
{
|
|
65
65
|
ref: n,
|
|
66
66
|
className: Se(
|
|
@@ -93,7 +93,7 @@ const Vo = Ho, Yo = Or, Xo = Wo, _r = Mt.Root, Ge = Mt.Trigger, Br = Mt.Anchor,
|
|
|
93
93
|
}
|
|
94
94
|
) }) }));
|
|
95
95
|
Ye.displayName = Mt.Content.displayName;
|
|
96
|
-
const Ur = ({ children: e, open: s, onOpenChange: n, ...o }) => /* @__PURE__ */ t(_r, { open: s, onOpenChange: n, ...o, children: e }),
|
|
96
|
+
const Ur = ({ children: e, open: s, onOpenChange: n, ...o }) => /* @__PURE__ */ t(_r, { open: s, onOpenChange: n, ...o, children: e }), Je = Object.assign(Ur, {
|
|
97
97
|
Trigger: Ge,
|
|
98
98
|
Content: Ye,
|
|
99
99
|
Anchor: Br,
|
|
@@ -124,7 +124,7 @@ const Ur = ({ children: e, open: s, onOpenChange: n, ...o }) => /* @__PURE__ */
|
|
|
124
124
|
children: [
|
|
125
125
|
s,
|
|
126
126
|
/* @__PURE__ */ t(Ne.Icon, { asChild: !0, children: /* @__PURE__ */ t(
|
|
127
|
-
|
|
127
|
+
J,
|
|
128
128
|
{
|
|
129
129
|
icon: "gravity-ui:chevron-down",
|
|
130
130
|
className: "sc:text-foreground/40 sc:size-4 sc:transition-transform sc:duration-200 sc:ease-out sc:[[data-state=open]>&]:rotate-180"
|
|
@@ -142,7 +142,7 @@ const Ko = oe.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ t(
|
|
|
142
142
|
ref: n,
|
|
143
143
|
className: Se("sc:flex sc:cursor-default sc:items-center sc:justify-center sc:py-1", e),
|
|
144
144
|
...s,
|
|
145
|
-
children: /* @__PURE__ */ t(
|
|
145
|
+
children: /* @__PURE__ */ t(J, { icon: "gravity-ui:chevron-up", className: "sc:size-4" })
|
|
146
146
|
}
|
|
147
147
|
));
|
|
148
148
|
Ko.displayName = Ne.ScrollUpButton.displayName;
|
|
@@ -152,7 +152,7 @@ const Go = oe.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ t(
|
|
|
152
152
|
ref: n,
|
|
153
153
|
className: Se("sc:flex sc:cursor-default sc:items-center sc:justify-center sc:py-1", e),
|
|
154
154
|
...s,
|
|
155
|
-
children: /* @__PURE__ */ t(
|
|
155
|
+
children: /* @__PURE__ */ t(J, { icon: "gravity-ui:chevron-down", className: "sc:size-4" })
|
|
156
156
|
}
|
|
157
157
|
));
|
|
158
158
|
Go.displayName = Ne.ScrollDownButton.displayName;
|
|
@@ -194,7 +194,7 @@ const Hr = oe.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ t(
|
|
|
194
194
|
}
|
|
195
195
|
));
|
|
196
196
|
Hr.displayName = Ne.Label.displayName;
|
|
197
|
-
const
|
|
197
|
+
const Jo = oe.forwardRef(({ className: e, children: s, ...n }, o) => /* @__PURE__ */ h(
|
|
198
198
|
Ne.Item,
|
|
199
199
|
{
|
|
200
200
|
ref: o,
|
|
@@ -205,12 +205,12 @@ const Qo = oe.forwardRef(({ className: e, children: s, ...n }, o) => /* @__PURE_
|
|
|
205
205
|
),
|
|
206
206
|
...n,
|
|
207
207
|
children: [
|
|
208
|
-
/* @__PURE__ */ t("span", { className: "sc:absolute sc:right-2 sc:flex sc:h-3.5 sc:w-3.5 sc:items-center sc:justify-center", children: /* @__PURE__ */ t(Ne.ItemIndicator, { children: /* @__PURE__ */ t(
|
|
208
|
+
/* @__PURE__ */ t("span", { className: "sc:absolute sc:right-2 sc:flex sc:h-3.5 sc:w-3.5 sc:items-center sc:justify-center", children: /* @__PURE__ */ t(Ne.ItemIndicator, { children: /* @__PURE__ */ t(J, { icon: "gravity-ui:check", className: "sc:size-4" }) }) }),
|
|
209
209
|
/* @__PURE__ */ t(Ne.ItemText, { children: s })
|
|
210
210
|
]
|
|
211
211
|
}
|
|
212
212
|
));
|
|
213
|
-
|
|
213
|
+
Jo.displayName = Ne.Item.displayName;
|
|
214
214
|
const Wr = oe.forwardRef(({ className: e, ...s }, n) => /* @__PURE__ */ t(Ne.Separator, { ref: n, className: Se("sc:bg-divider sc:mx-2 sc:my-1 sc:h-px", e), ...s }));
|
|
215
215
|
Wr.displayName = Ne.Separator.displayName;
|
|
216
216
|
const Wt = oe.forwardRef(({ className: e, orientation: s = "horizontal", decorative: n = !0, ...o }, r) => /* @__PURE__ */ t(
|
|
@@ -228,7 +228,7 @@ const Wt = oe.forwardRef(({ className: e, orientation: s = "horizontal", decorat
|
|
|
228
228
|
}
|
|
229
229
|
));
|
|
230
230
|
Wt.displayName = jo.Root.displayName;
|
|
231
|
-
const
|
|
231
|
+
const Po = oe.createContext(null), Qo = oe.forwardRef(
|
|
232
232
|
({ className: e, children: s, ...n }, o) => /* @__PURE__ */ t(
|
|
233
233
|
dt.Track,
|
|
234
234
|
{
|
|
@@ -239,7 +239,7 @@ const Jo = oe.createContext(null), Po = oe.forwardRef(
|
|
|
239
239
|
}
|
|
240
240
|
)
|
|
241
241
|
);
|
|
242
|
-
|
|
242
|
+
Qo.displayName = "SliderTrack";
|
|
243
243
|
const ec = oe.forwardRef(
|
|
244
244
|
({ className: e, ...s }, n) => /* @__PURE__ */ t(
|
|
245
245
|
dt.Thumb,
|
|
@@ -260,7 +260,7 @@ const tc = oe.forwardRef(
|
|
|
260
260
|
tc.displayName = "SliderFill";
|
|
261
261
|
const sc = oe.forwardRef(
|
|
262
262
|
({ className: e, children: s, ...n }, o) => {
|
|
263
|
-
const r = oe.useContext(
|
|
263
|
+
const r = oe.useContext(Po), c = (r == null ? void 0 : r.values) ?? [0];
|
|
264
264
|
return /* @__PURE__ */ t("span", { ref: o, className: Se("sc:text-sm sc:text-foreground/60", e), ...n, children: typeof s == "function" ? s({ state: { values: c } }) : s ?? c.join(" - ") });
|
|
265
265
|
}
|
|
266
266
|
);
|
|
@@ -300,7 +300,7 @@ const nc = oe.forwardRef(
|
|
|
300
300
|
}),
|
|
301
301
|
[w, y, r, c]
|
|
302
302
|
);
|
|
303
|
-
return /* @__PURE__ */ t(
|
|
303
|
+
return /* @__PURE__ */ t(Po.Provider, { value: z, children: /* @__PURE__ */ t(
|
|
304
304
|
dt.Root,
|
|
305
305
|
{
|
|
306
306
|
ref: m,
|
|
@@ -332,7 +332,7 @@ const nc = oe.forwardRef(
|
|
|
332
332
|
);
|
|
333
333
|
nc.displayName = dt.Root.displayName;
|
|
334
334
|
const Te = Object.assign(nc, {
|
|
335
|
-
Track:
|
|
335
|
+
Track: Qo,
|
|
336
336
|
Thumb: ec,
|
|
337
337
|
Fill: tc,
|
|
338
338
|
Output: sc
|
|
@@ -393,7 +393,7 @@ const Xs = ({
|
|
|
393
393
|
style: { touchAction: "pan-y" },
|
|
394
394
|
children: [
|
|
395
395
|
/* @__PURE__ */ h("div", { className: "sc:flex sc:items-center sc:gap-3 sc:md:gap-2", children: [
|
|
396
|
-
typeof e == "string" ? /* @__PURE__ */ t(
|
|
396
|
+
typeof e == "string" ? /* @__PURE__ */ t(J, { icon: e, className: "sc:text-primary sc:size-7 sc:md:size-5" }) : e,
|
|
397
397
|
/* @__PURE__ */ t("span", { className: "sc:text-foreground sc:text-lg sc:font-semibold sc:md:text-sm sc:md:font-medium", children: s })
|
|
398
398
|
] }),
|
|
399
399
|
r === "done" ? /* @__PURE__ */ t(
|
|
@@ -410,7 +410,7 @@ const Xs = ({
|
|
|
410
410
|
onClick: n,
|
|
411
411
|
className: "sc:hover:bg-muted sc:text-foreground/70 sc:hover:text-foreground sc:flex sc:size-11 sc:items-center sc:justify-center sc:rounded-md sc:transition-colors sc:md:size-7",
|
|
412
412
|
"aria-label": "Close panel",
|
|
413
|
-
children: /* @__PURE__ */ t(
|
|
413
|
+
children: /* @__PURE__ */ t(J, { icon: le.close, className: "sc:size-7 sc:md:size-4" })
|
|
414
414
|
}
|
|
415
415
|
)
|
|
416
416
|
]
|
|
@@ -666,10 +666,10 @@ var qt = function(e, s, n) {
|
|
|
666
666
|
return Z(function() {
|
|
667
667
|
return v;
|
|
668
668
|
}, [v]), Fe.createElement("div", xs({}, r, { onTouchStart: x, onMouseDown: x, className: "react-colorful__interactive", ref: c, onKeyDown: g, onKeyUp: N, tabIndex: 0, role: "slider" }));
|
|
669
|
-
}),
|
|
669
|
+
}), Qs = function(e) {
|
|
670
670
|
return e.filter(Boolean).join(" ");
|
|
671
671
|
}, ac = function(e) {
|
|
672
|
-
var s = e.color, n = e.left, o = e.top, r = o === void 0 ? 0.5 : o, c =
|
|
672
|
+
var s = e.color, n = e.left, o = e.top, r = o === void 0 ? 0.5 : o, c = Qs(["react-colorful__pointer", e.className]);
|
|
673
673
|
return Fe.createElement("div", { className: c, style: { top: 100 * r + "%", left: 100 * n + "%" } }, Fe.createElement("div", { className: "react-colorful__pointer-fill", style: { backgroundColor: s } }));
|
|
674
674
|
}, Be = function(e, s, n) {
|
|
675
675
|
return s === void 0 && (s = 0), n === void 0 && (n = Math.pow(10, s)), Math.round(n * e) / n;
|
|
@@ -700,13 +700,13 @@ var qt = function(e, s, n) {
|
|
|
700
700
|
var s = e.r, n = e.g, o = e.b, r = e.a, c = Math.max(s, n, o), i = c - Math.min(s, n, o), f = i ? c === s ? (n - o) / i : c === n ? 2 + (o - s) / i : 4 + (s - n) / i : 0;
|
|
701
701
|
return { h: Be(60 * (f < 0 ? f + 6 : f)), s: Be(c ? i / c * 100 : 0), v: Be(c / 255 * 100), a: r };
|
|
702
702
|
}, Zr = Fe.memo(function(e) {
|
|
703
|
-
var s = e.hue, n = e.onChange, o = e.onChangeEnd, r =
|
|
703
|
+
var s = e.hue, n = e.onChange, o = e.onChangeEnd, r = Qs(["react-colorful__hue", e.className]);
|
|
704
704
|
return Fe.createElement("div", { className: r }, Fe.createElement(cc, { onMove: function(c) {
|
|
705
705
|
n({ h: 360 * c.left });
|
|
706
706
|
}, onKey: function(c) {
|
|
707
707
|
n({ h: qt(s + 360 * c.left, 0, 360) });
|
|
708
708
|
}, onEnd: o, "aria-label": "Hue", "aria-valuenow": Be(s), "aria-valuemax": "360", "aria-valuemin": "0" }, Fe.createElement(ac, { className: "react-colorful__hue-pointer", left: s / 360, color: Gs({ h: s, s: 100, v: 100, a: 1 }) })));
|
|
709
|
-
}),
|
|
709
|
+
}), Jr = Fe.memo(function(e) {
|
|
710
710
|
var s = e.hsva, n = e.onChange, o = e.onChangeEnd, r = { backgroundColor: Gs({ h: s.h, s: 100, v: 100, a: 1 }) };
|
|
711
711
|
return Fe.createElement("div", { className: "react-colorful__saturation", style: r }, Fe.createElement(cc, { onMove: function(c) {
|
|
712
712
|
n({ s: 100 * c.left, v: 100 - 100 * c.top });
|
|
@@ -717,10 +717,10 @@ var qt = function(e, s, n) {
|
|
|
717
717
|
if (e === s) return !0;
|
|
718
718
|
for (var n in e) if (e[n] !== s[n]) return !1;
|
|
719
719
|
return !0;
|
|
720
|
-
},
|
|
720
|
+
}, Pr = function(e, s) {
|
|
721
721
|
return e.toLowerCase() === s.toLowerCase() || rc(Ks(e), Ks(s));
|
|
722
722
|
};
|
|
723
|
-
function
|
|
723
|
+
function Qr(e, s, n, o) {
|
|
724
724
|
var r = Vt(n), c = Vt(o), i = T(function() {
|
|
725
725
|
return e.toHsva(s);
|
|
726
726
|
}), f = i[0], b = i[1], m = V({ color: s, hsva: f }), w = V(!1);
|
|
@@ -757,11 +757,11 @@ var ei = typeof window < "u" ? Mo : Z, ti = function() {
|
|
|
757
757
|
}, ni = 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, f = oc(e, ["className", "colorModel", "color", "onChange", "onChangeEnd"]), b = V(null);
|
|
759
759
|
si(b);
|
|
760
|
-
var m =
|
|
761
|
-
return Fe.createElement("div", xs({}, f, { ref: b, className: g }), Fe.createElement(
|
|
760
|
+
var m = Qr(n, r, c, i), w = m[0], y = m[1], x = m[2], g = Qs(["react-colorful", s]);
|
|
761
|
+
return Fe.createElement("div", xs({}, f, { ref: b, className: g }), Fe.createElement(Jr, { hsva: w, onChange: y, onChangeEnd: x }), Fe.createElement(Zr, { hue: w.h, onChange: y, onChangeEnd: x, className: "react-colorful__last-control" }));
|
|
762
762
|
}, oi = { defaultColor: "000", toHsva: Vr, fromHsva: function(e) {
|
|
763
763
|
return Yr({ h: e.h, s: e.s, v: e.v, a: 1 });
|
|
764
|
-
}, equal:
|
|
764
|
+
}, equal: Pr }, ic = function(e) {
|
|
765
765
|
return Fe.createElement(ni, xs({}, e, { colorModel: oi }));
|
|
766
766
|
};
|
|
767
767
|
const Et = Eo(({
|
|
@@ -810,27 +810,27 @@ const Et = Eo(({
|
|
|
810
810
|
z(X);
|
|
811
811
|
}, se = () => {
|
|
812
812
|
k.current({ target: { value: "transparent" } });
|
|
813
|
-
},
|
|
813
|
+
}, P = e === "transparent", ee = c ? /* @__PURE__ */ t(
|
|
814
814
|
"div",
|
|
815
815
|
{
|
|
816
|
-
className: `sc:size-8 sc:md:size-6 sc:rounded-md sc:border sc:border-border-primary ${
|
|
817
|
-
style:
|
|
816
|
+
className: `sc:size-8 sc:md:size-6 sc:rounded-md sc:border sc:border-border-primary ${P ? "transparent-pattern-small" : ""}`,
|
|
817
|
+
style: P ? {} : { backgroundColor: e }
|
|
818
818
|
}
|
|
819
819
|
) : /* @__PURE__ */ h("div", { className: "sc:relative sc:flex sc:items-center sc:justify-center sc:h-5 sc:w-5", children: [
|
|
820
820
|
r ? /* @__PURE__ */ t("span", { className: "sc:flex sc:items-center sc:-translate-y-0.5", children: r }) : /* @__PURE__ */ t("span", { className: "sc:font-bold sc:text-lg sc:leading-none sc:-translate-y-0.5", children: "A" }),
|
|
821
821
|
/* @__PURE__ */ t(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
|
-
className: `sc:absolute sc:bottom-0 sc:left-1/2 sc:-translate-x-1/2 sc:h-[3px] sc:w-4 sc:rounded-sm ${
|
|
825
|
-
style:
|
|
824
|
+
className: `sc:absolute sc:bottom-0 sc:left-1/2 sc:-translate-x-1/2 sc:h-[3px] sc:w-4 sc:rounded-sm ${P ? "transparent-pattern-small" : ""}`,
|
|
825
|
+
style: P ? {} : { backgroundColor: e }
|
|
826
826
|
}
|
|
827
827
|
)
|
|
828
828
|
] }), de = /* @__PURE__ */ h("div", { className: "sc:space-y-4 sc:min-w-[232px]", children: [
|
|
829
829
|
i && /* @__PURE__ */ h(
|
|
830
|
-
|
|
830
|
+
Q,
|
|
831
831
|
{
|
|
832
832
|
variant: "ghost",
|
|
833
|
-
className: `sc:flex sc:w-full sc:cursor-pointer sc:items-center sc:justify-start sc:gap-2 sc:rounded-lg ${
|
|
833
|
+
className: `sc:flex sc:w-full sc:cursor-pointer sc:items-center sc:justify-start sc:gap-2 sc:rounded-lg ${P ? "sc:bg-primary/10" : ""}`,
|
|
834
834
|
onClick: se,
|
|
835
835
|
children: [
|
|
836
836
|
/* @__PURE__ */ t("div", { className: "transparent-pattern-small sc:h-6 sc:w-6 sc:rounded" }),
|
|
@@ -838,7 +838,7 @@ const Et = Eo(({
|
|
|
838
838
|
]
|
|
839
839
|
}
|
|
840
840
|
),
|
|
841
|
-
/* @__PURE__ */ t("div", { className: "sc:w-[200px]", children: /* @__PURE__ */ t(ic, { color:
|
|
841
|
+
/* @__PURE__ */ t("div", { className: "sc:w-[200px]", children: /* @__PURE__ */ t(ic, { color: P ? "#ffffff" : N, onChange: z }) }),
|
|
842
842
|
/* @__PURE__ */ h("div", { className: "sc:flex sc:items-center sc:gap-2", children: [
|
|
843
843
|
/* @__PURE__ */ t("label", { htmlFor: "hex-input", className: "sc:text-sm sc:font-medium sc:uppercase sc:text-foreground/60", children: "HEX" }),
|
|
844
844
|
/* @__PURE__ */ t(
|
|
@@ -881,7 +881,7 @@ const Et = Eo(({
|
|
|
881
881
|
)) })
|
|
882
882
|
] })
|
|
883
883
|
] });
|
|
884
|
-
return m ? de : /* @__PURE__ */ h(
|
|
884
|
+
return m ? de : /* @__PURE__ */ h(Je, { open: E, onOpenChange: L, children: [
|
|
885
885
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
886
886
|
"button",
|
|
887
887
|
{
|
|
@@ -910,7 +910,7 @@ const ci = () => /* @__PURE__ */ t(
|
|
|
910
910
|
function ai({ onClick: e }) {
|
|
911
911
|
return /* @__PURE__ */ t(mr, { delayDuration: 300, children: /* @__PURE__ */ h(he, { children: [
|
|
912
912
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
913
|
-
|
|
913
|
+
Q,
|
|
914
914
|
{
|
|
915
915
|
variant: "outline",
|
|
916
916
|
onClick: e,
|
|
@@ -984,14 +984,14 @@ const ri = ({
|
|
|
984
984
|
onShadowToggle: B,
|
|
985
985
|
blendModeExpanded: U = !1,
|
|
986
986
|
onBlendModeToggle: se,
|
|
987
|
-
knockoutExpanded:
|
|
987
|
+
knockoutExpanded: P = !1,
|
|
988
988
|
onKnockoutToggle: ee,
|
|
989
989
|
distressTextureExpanded: de = !1,
|
|
990
990
|
onDistressTextureToggle: X,
|
|
991
991
|
imageMaskExpanded: K = !1,
|
|
992
992
|
onImageMaskToggle: Y
|
|
993
993
|
}) => {
|
|
994
|
-
const [ue, A] = T(!1), [te, De] = T(!1), [W, xe] = T(!1), [Ce, we] = T(!1), [Re, Ee] = T(!1), [ye, Ie] = T(!1), [ze, p] = T(!1), [C, R] = T(!1), [$, G] = T(!1), [ke, H] = T(!1), [ae,
|
|
994
|
+
const [ue, A] = T(!1), [te, De] = T(!1), [W, xe] = T(!1), [Ce, we] = T(!1), [Re, Ee] = T(!1), [ye, Ie] = T(!1), [ze, p] = T(!1), [C, R] = T(!1), [$, G] = T(!1), [ke, H] = T(!1), [ae, Pe] = T(!1), [ve, We] = T(!1), [Qe, et] = T(!1), [tt, yt] = T(!1), ct = e.isCropping, $e = vs(e), l = () => {
|
|
995
995
|
if (Ee(!0), ct) {
|
|
996
996
|
const ie = e.clone();
|
|
997
997
|
ie.exitCropMode(), s(ie);
|
|
@@ -1023,7 +1023,7 @@ const ri = ({
|
|
|
1023
1023
|
f && /* @__PURE__ */ t(
|
|
1024
1024
|
j,
|
|
1025
1025
|
{
|
|
1026
|
-
icon: b ? /* @__PURE__ */ t(
|
|
1026
|
+
icon: b ? /* @__PURE__ */ t(J, { icon: "eos-icons:loading", className: "sc:size-6 sc:md:size-5 sc:animate-spin" }) : "gravity-ui:magic-wand",
|
|
1027
1027
|
onClick: () => {
|
|
1028
1028
|
xe(!0), f();
|
|
1029
1029
|
},
|
|
@@ -1119,8 +1119,8 @@ const ri = ({
|
|
|
1119
1119
|
},
|
|
1120
1120
|
onMouseLeave: () => We(!1),
|
|
1121
1121
|
tooltip: "Clip / Knockout",
|
|
1122
|
-
tooltipDisabled: ve ||
|
|
1123
|
-
active:
|
|
1122
|
+
tooltipDisabled: ve || P,
|
|
1123
|
+
active: P || $e.knockout
|
|
1124
1124
|
}
|
|
1125
1125
|
),
|
|
1126
1126
|
X && /* @__PURE__ */ t(
|
|
@@ -1132,7 +1132,7 @@ const ri = ({
|
|
|
1132
1132
|
},
|
|
1133
1133
|
onMouseLeave: () => et(!1),
|
|
1134
1134
|
tooltip: "Distress Texture",
|
|
1135
|
-
tooltipDisabled:
|
|
1135
|
+
tooltipDisabled: Qe || de,
|
|
1136
1136
|
active: de || $e.distress
|
|
1137
1137
|
}
|
|
1138
1138
|
),
|
|
@@ -1180,20 +1180,20 @@ const ri = ({
|
|
|
1180
1180
|
{
|
|
1181
1181
|
icon: "gravity-ui:circles-intersection",
|
|
1182
1182
|
onClick: () => {
|
|
1183
|
-
|
|
1183
|
+
Pe(!0), se();
|
|
1184
1184
|
},
|
|
1185
|
-
onMouseLeave: () =>
|
|
1185
|
+
onMouseLeave: () => Pe(!1),
|
|
1186
1186
|
tooltip: "Blend Mode",
|
|
1187
1187
|
tooltipDisabled: ae || U,
|
|
1188
1188
|
active: U || $e.blendMode
|
|
1189
1189
|
}
|
|
1190
1190
|
),
|
|
1191
|
-
(r || c || w) && /* @__PURE__ */ h(
|
|
1192
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(
|
|
1191
|
+
(r || c || w) && /* @__PURE__ */ h(Je, { open: ue, onOpenChange: A, children: [
|
|
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(Ye, { align: "end", className: "sc:w-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ h("div", { className: "sc:flex sc:items-center sc:gap-1", children: [
|
|
1194
1194
|
r && /* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
1195
1195
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1196
|
-
|
|
1196
|
+
Q,
|
|
1197
1197
|
{
|
|
1198
1198
|
variant: "ghost",
|
|
1199
1199
|
size: "icon",
|
|
@@ -1201,14 +1201,14 @@ const ri = ({
|
|
|
1201
1201
|
r(), A(!1);
|
|
1202
1202
|
},
|
|
1203
1203
|
"aria-label": "Move Forward",
|
|
1204
|
-
children: /* @__PURE__ */ t(
|
|
1204
|
+
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-5" })
|
|
1205
1205
|
}
|
|
1206
1206
|
) }),
|
|
1207
1207
|
/* @__PURE__ */ t(ge, { children: "Move Forward" })
|
|
1208
1208
|
] }),
|
|
1209
1209
|
c && /* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
1210
1210
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1211
|
-
|
|
1211
|
+
Q,
|
|
1212
1212
|
{
|
|
1213
1213
|
variant: "ghost",
|
|
1214
1214
|
size: "icon",
|
|
@@ -1216,14 +1216,14 @@ const ri = ({
|
|
|
1216
1216
|
c(), A(!1);
|
|
1217
1217
|
},
|
|
1218
1218
|
"aria-label": "Move Backward",
|
|
1219
|
-
children: /* @__PURE__ */ t(
|
|
1219
|
+
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-5" })
|
|
1220
1220
|
}
|
|
1221
1221
|
) }),
|
|
1222
1222
|
/* @__PURE__ */ t(ge, { children: "Move Backward" })
|
|
1223
1223
|
] }),
|
|
1224
1224
|
w && /* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
1225
1225
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1226
|
-
|
|
1226
|
+
Q,
|
|
1227
1227
|
{
|
|
1228
1228
|
variant: "ghost",
|
|
1229
1229
|
size: "icon",
|
|
@@ -1231,7 +1231,7 @@ const ri = ({
|
|
|
1231
1231
|
A(!1), w();
|
|
1232
1232
|
},
|
|
1233
1233
|
"aria-label": "Delete",
|
|
1234
|
-
children: /* @__PURE__ */ t(
|
|
1234
|
+
children: /* @__PURE__ */ t(J, { icon: le.trash, className: "sc:size-5" })
|
|
1235
1235
|
}
|
|
1236
1236
|
) }),
|
|
1237
1237
|
/* @__PURE__ */ t(ge, { children: "Delete" })
|
|
@@ -1239,7 +1239,7 @@ const ri = ({
|
|
|
1239
1239
|
] }) })
|
|
1240
1240
|
] }),
|
|
1241
1241
|
n && o && /* @__PURE__ */ h(he, { delay: 300, children: [
|
|
1242
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1242
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", size: "sm", onClick: o, children: "Ungroup" }) }),
|
|
1243
1243
|
/* @__PURE__ */ t(ge, { children: "Ungroup this group" })
|
|
1244
1244
|
] })
|
|
1245
1245
|
] });
|
|
@@ -1282,7 +1282,7 @@ const ri = ({
|
|
|
1282
1282
|
strokeExpanded: B = !1,
|
|
1283
1283
|
onStrokeToggle: U,
|
|
1284
1284
|
shadowExpanded: se = !1,
|
|
1285
|
-
onShadowToggle:
|
|
1285
|
+
onShadowToggle: P,
|
|
1286
1286
|
blendModeExpanded: ee = !1,
|
|
1287
1287
|
onBlendModeToggle: de,
|
|
1288
1288
|
knockoutExpanded: X = !1,
|
|
@@ -1292,7 +1292,7 @@ const ri = ({
|
|
|
1292
1292
|
imageMaskExpanded: A = !1,
|
|
1293
1293
|
onImageMaskToggle: te
|
|
1294
1294
|
}) => {
|
|
1295
|
-
const [De, W] = T(!1), [xe, Ce] = T(!1), [we, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1), [p, C] = T(!1), [R, $] = T(!1), [G, ke] = T(!1), [H, ae] = T(!1), [
|
|
1295
|
+
const [De, W] = T(!1), [xe, Ce] = T(!1), [we, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1), [p, C] = T(!1), [R, $] = T(!1), [G, ke] = T(!1), [H, ae] = T(!1), [Pe, ve] = T(!1), [We, Qe] = T(!1), [et, tt] = T(!1), [yt, ct] = T(!1), [$e, l] = T(!1), [ce, at] = T(!1), ie = He(() => Zs.map((Ct) => Ct.color), []), rt = He(() => n && n.length > 0 ? n : ie, [n, ie]), Le = vs(e), Kt = (Ct) => {
|
|
1296
1296
|
const wt = e.clone();
|
|
1297
1297
|
wt.transformData.fillColor = Ct.target.value, delete wt.transformData.fill, s(wt);
|
|
1298
1298
|
}, xt = {
|
|
@@ -1477,18 +1477,18 @@ const ri = ({
|
|
|
1477
1477
|
},
|
|
1478
1478
|
onMouseLeave: () => ve(!1),
|
|
1479
1479
|
tooltip: "Stroke",
|
|
1480
|
-
tooltipDisabled:
|
|
1480
|
+
tooltipDisabled: Pe || B,
|
|
1481
1481
|
active: B || Le.stroke
|
|
1482
1482
|
}
|
|
1483
1483
|
),
|
|
1484
|
-
|
|
1484
|
+
P && /* @__PURE__ */ t(
|
|
1485
1485
|
j,
|
|
1486
1486
|
{
|
|
1487
1487
|
icon: "gravity-ui:square-dashed-circle",
|
|
1488
1488
|
onClick: () => {
|
|
1489
|
-
|
|
1489
|
+
Qe(!0), P();
|
|
1490
1490
|
},
|
|
1491
|
-
onMouseLeave: () =>
|
|
1491
|
+
onMouseLeave: () => Qe(!1),
|
|
1492
1492
|
tooltip: "Shadow",
|
|
1493
1493
|
tooltipDisabled: We || se,
|
|
1494
1494
|
active: se || Le.shadow
|
|
@@ -1507,12 +1507,12 @@ const ri = ({
|
|
|
1507
1507
|
active: ee || Le.blendMode
|
|
1508
1508
|
}
|
|
1509
1509
|
),
|
|
1510
|
-
(i || f || m) && /* @__PURE__ */ h(
|
|
1511
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(
|
|
1510
|
+
(i || f || m) && /* @__PURE__ */ h(Je, { open: De, onOpenChange: W, children: [
|
|
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(Ye, { align: "end", className: "sc:w-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ h("div", { className: "sc:flex sc:items-center sc:gap-1", children: [
|
|
1513
1513
|
i && /* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
1514
1514
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1515
|
-
|
|
1515
|
+
Q,
|
|
1516
1516
|
{
|
|
1517
1517
|
variant: "ghost",
|
|
1518
1518
|
size: "icon",
|
|
@@ -1520,14 +1520,14 @@ const ri = ({
|
|
|
1520
1520
|
i(), W(!1);
|
|
1521
1521
|
},
|
|
1522
1522
|
"aria-label": "Move Forward",
|
|
1523
|
-
children: /* @__PURE__ */ t(
|
|
1523
|
+
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-5" })
|
|
1524
1524
|
}
|
|
1525
1525
|
) }),
|
|
1526
1526
|
/* @__PURE__ */ t(ge, { children: "Move Forward" })
|
|
1527
1527
|
] }),
|
|
1528
1528
|
f && /* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
1529
1529
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1530
|
-
|
|
1530
|
+
Q,
|
|
1531
1531
|
{
|
|
1532
1532
|
variant: "ghost",
|
|
1533
1533
|
size: "icon",
|
|
@@ -1535,14 +1535,14 @@ const ri = ({
|
|
|
1535
1535
|
f(), W(!1);
|
|
1536
1536
|
},
|
|
1537
1537
|
"aria-label": "Move Backward",
|
|
1538
|
-
children: /* @__PURE__ */ t(
|
|
1538
|
+
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-5" })
|
|
1539
1539
|
}
|
|
1540
1540
|
) }),
|
|
1541
1541
|
/* @__PURE__ */ t(ge, { children: "Move Backward" })
|
|
1542
1542
|
] }),
|
|
1543
1543
|
m && /* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
1544
1544
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1545
|
-
|
|
1545
|
+
Q,
|
|
1546
1546
|
{
|
|
1547
1547
|
variant: "ghost",
|
|
1548
1548
|
size: "icon",
|
|
@@ -1550,7 +1550,7 @@ const ri = ({
|
|
|
1550
1550
|
W(!1), m();
|
|
1551
1551
|
},
|
|
1552
1552
|
"aria-label": "Delete",
|
|
1553
|
-
children: /* @__PURE__ */ t(
|
|
1553
|
+
children: /* @__PURE__ */ t(J, { icon: le.trash, className: "sc:size-5" })
|
|
1554
1554
|
}
|
|
1555
1555
|
) }),
|
|
1556
1556
|
/* @__PURE__ */ t(ge, { children: "Delete" })
|
|
@@ -1558,7 +1558,7 @@ const ri = ({
|
|
|
1558
1558
|
] }) })
|
|
1559
1559
|
] }),
|
|
1560
1560
|
r && c && /* @__PURE__ */ h(he, { delay: 300, children: [
|
|
1561
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1561
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", size: "sm", onClick: c, children: "Ungroup" }) }),
|
|
1562
1562
|
/* @__PURE__ */ t(ge, { children: "Ungroup this group" })
|
|
1563
1563
|
] })
|
|
1564
1564
|
] });
|
|
@@ -1591,7 +1591,7 @@ const ri = ({
|
|
|
1591
1591
|
] }),
|
|
1592
1592
|
/* @__PURE__ */ h(he, { delay: 300, children: [
|
|
1593
1593
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1594
|
-
|
|
1594
|
+
Q,
|
|
1595
1595
|
{
|
|
1596
1596
|
variant: I ? "default" : "ghost",
|
|
1597
1597
|
onClick: x,
|
|
@@ -1601,7 +1601,7 @@ const ri = ({
|
|
|
1601
1601
|
) }),
|
|
1602
1602
|
/* @__PURE__ */ t(ge, { children: I ? "Disable Stroke" : "Enable Stroke" })
|
|
1603
1603
|
] }),
|
|
1604
|
-
I && /* @__PURE__ */ h(
|
|
1604
|
+
I && /* @__PURE__ */ h(Je, { open: r, onOpenChange: c, children: [
|
|
1605
1605
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1606
1606
|
"button",
|
|
1607
1607
|
{
|
|
@@ -1612,7 +1612,7 @@ const ri = ({
|
|
|
1612
1612
|
) }),
|
|
1613
1613
|
/* @__PURE__ */ t(Ye, { align: "start", className: "sc:p-0", children: /* @__PURE__ */ h("div", { className: "sc:bg-bg-primary sc:rounded-xl sc:shadow-lg sc:p-6 sc:min-w-[240px]", children: [
|
|
1614
1614
|
/* @__PURE__ */ t("div", { className: "sc:grid sc:grid-cols-6 sc:gap-sm sc:mb-md", children: Zs.map((z) => /* @__PURE__ */ t(
|
|
1615
|
-
|
|
1615
|
+
Q,
|
|
1616
1616
|
{
|
|
1617
1617
|
onClick: () => w(z.color),
|
|
1618
1618
|
"aria-label": z.name,
|
|
@@ -1632,8 +1632,8 @@ const ri = ({
|
|
|
1632
1632
|
)
|
|
1633
1633
|
] }) })
|
|
1634
1634
|
] }),
|
|
1635
|
-
I && /* @__PURE__ */ h(
|
|
1636
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ h(
|
|
1635
|
+
I && /* @__PURE__ */ h(Je, { open: b, onOpenChange: m, children: [
|
|
1636
|
+
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ h(Q, { variant: "ghost", className: "sc:px-xl sc:text-base", children: [
|
|
1637
1637
|
k,
|
|
1638
1638
|
"px"
|
|
1639
1639
|
] }) }),
|
|
@@ -1658,7 +1658,7 @@ const ri = ({
|
|
|
1658
1658
|
/* @__PURE__ */ t("div", { className: "sc:w-px sc:h-6 sc:bg-border-primary sc:mx-xs" }),
|
|
1659
1659
|
/* @__PURE__ */ h(he, { delay: 300, children: [
|
|
1660
1660
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1661
|
-
|
|
1661
|
+
Q,
|
|
1662
1662
|
{
|
|
1663
1663
|
variant: D ? "default" : "ghost",
|
|
1664
1664
|
onClick: g,
|
|
@@ -1668,7 +1668,7 @@ const ri = ({
|
|
|
1668
1668
|
) }),
|
|
1669
1669
|
/* @__PURE__ */ t(ge, { children: D ? "Disable Fill" : "Enable Fill" })
|
|
1670
1670
|
] }),
|
|
1671
|
-
D && /* @__PURE__ */ h(
|
|
1671
|
+
D && /* @__PURE__ */ h(Je, { open: i, onOpenChange: f, children: [
|
|
1672
1672
|
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1673
1673
|
"button",
|
|
1674
1674
|
{
|
|
@@ -1679,7 +1679,7 @@ const ri = ({
|
|
|
1679
1679
|
) }),
|
|
1680
1680
|
/* @__PURE__ */ t(Ye, { align: "start", className: "sc:p-0", children: /* @__PURE__ */ h("div", { className: "sc:bg-bg-primary sc:rounded-xl sc:shadow-lg sc:p-6 sc:min-w-[240px]", children: [
|
|
1681
1681
|
/* @__PURE__ */ t("div", { className: "sc:grid sc:grid-cols-6 sc:gap-sm sc:mb-md", children: Zs.map((z) => /* @__PURE__ */ t(
|
|
1682
|
-
|
|
1682
|
+
Q,
|
|
1683
1683
|
{
|
|
1684
1684
|
onClick: () => y(z.color),
|
|
1685
1685
|
"aria-label": z.name,
|
|
@@ -1701,11 +1701,11 @@ const ri = ({
|
|
|
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__ */ h(he, { delay: 300, children: [
|
|
1704
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1704
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", onClick: n, children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-[18px]" }) }) }),
|
|
1705
1705
|
/* @__PURE__ */ t(ge, { children: "Move Forward" })
|
|
1706
1706
|
] }),
|
|
1707
1707
|
o && /* @__PURE__ */ h(he, { delay: 300, children: [
|
|
1708
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1708
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", onClick: o, children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-[18px]" }) }) }),
|
|
1709
1709
|
/* @__PURE__ */ t(ge, { children: "Move Backward" })
|
|
1710
1710
|
] })
|
|
1711
1711
|
] });
|
|
@@ -1745,12 +1745,12 @@ const ri = ({
|
|
|
1745
1745
|
o("texture");
|
|
1746
1746
|
}
|
|
1747
1747
|
}, I = s === "transparent";
|
|
1748
|
-
return /* @__PURE__ */ h(
|
|
1749
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1748
|
+
return /* @__PURE__ */ h(Je, { open: i, onOpenChange: f, children: [
|
|
1749
|
+
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: i ? "default" : "ghost", "aria-label": "Background", children: /* @__PURE__ */ t(J, { icon: le.palette, className: "sc:size-[18px]" }) }) }),
|
|
1750
1750
|
/* @__PURE__ */ t(Ye, { className: "sc:w-auto sc:p-3", children: /* @__PURE__ */ h("div", { className: "sc:flex sc:min-w-[220px] sc:flex-col sc:gap-3", children: [
|
|
1751
1751
|
/* @__PURE__ */ h("div", { className: "sc:flex sc:gap-1 sc:border-b sc:border-divider sc:pb-3", children: [
|
|
1752
1752
|
/* @__PURE__ */ t(
|
|
1753
|
-
|
|
1753
|
+
Q,
|
|
1754
1754
|
{
|
|
1755
1755
|
variant: "ghost",
|
|
1756
1756
|
size: "sm",
|
|
@@ -1760,7 +1760,7 @@ const ri = ({
|
|
|
1760
1760
|
}
|
|
1761
1761
|
),
|
|
1762
1762
|
/* @__PURE__ */ t(
|
|
1763
|
-
|
|
1763
|
+
Q,
|
|
1764
1764
|
{
|
|
1765
1765
|
variant: "ghost",
|
|
1766
1766
|
size: "sm",
|
|
@@ -1770,7 +1770,7 @@ const ri = ({
|
|
|
1770
1770
|
}
|
|
1771
1771
|
),
|
|
1772
1772
|
/* @__PURE__ */ t(
|
|
1773
|
-
|
|
1773
|
+
Q,
|
|
1774
1774
|
{
|
|
1775
1775
|
variant: "ghost",
|
|
1776
1776
|
size: "sm",
|
|
@@ -1783,7 +1783,7 @@ const ri = ({
|
|
|
1783
1783
|
] }),
|
|
1784
1784
|
b === "color" && /* @__PURE__ */ h("div", { className: "sc:flex sc:flex-col sc:gap-3", children: [
|
|
1785
1785
|
/* @__PURE__ */ h(
|
|
1786
|
-
|
|
1786
|
+
Q,
|
|
1787
1787
|
{
|
|
1788
1788
|
variant: "ghost",
|
|
1789
1789
|
className: `sc:flex sc:w-full sc:cursor-pointer sc:items-center sc:justify-start sc:gap-2 sc:rounded-lg ${I ? "sc:bg-primary/10" : ""}`,
|
|
@@ -2047,21 +2047,21 @@ const dc = ({ distressTexture: e, onChange: s }) => {
|
|
|
2047
2047
|
}
|
|
2048
2048
|
),
|
|
2049
2049
|
/* @__PURE__ */ h(he, { delay: 300, children: [
|
|
2050
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2050
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", onClick: E, "aria-label": "Save", children: /* @__PURE__ */ t(J, { icon: le.check, className: "sc:size-4" }) }) }),
|
|
2051
2051
|
/* @__PURE__ */ t(ge, { children: "Save" })
|
|
2052
2052
|
] }),
|
|
2053
2053
|
/* @__PURE__ */ h(he, { delay: 300, children: [
|
|
2054
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2054
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", onClick: L, "aria-label": "Cancel", children: /* @__PURE__ */ t(J, { icon: le.close, className: "sc:size-4" }) }) }),
|
|
2055
2055
|
/* @__PURE__ */ t(ge, { children: "Cancel" })
|
|
2056
2056
|
] })
|
|
2057
2057
|
] }) : /* @__PURE__ */ h("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__ */ h(he, { delay: 300, children: [
|
|
2060
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2060
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", onClick: k, "aria-label": "Rename", children: /* @__PURE__ */ t(J, { icon: le.pencil, className: "sc:size-4" }) }) }),
|
|
2061
2061
|
/* @__PURE__ */ t(ge, { children: "Rename" })
|
|
2062
2062
|
] }),
|
|
2063
2063
|
/* @__PURE__ */ h(he, { delay: 300, children: [
|
|
2064
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2064
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", onClick: q, disabled: s.length <= 1, "aria-label": "Delete", children: /* @__PURE__ */ t(J, { icon: le.trash, className: "sc:size-4" }) }) }),
|
|
2065
2065
|
/* @__PURE__ */ t(ge, { children: "Delete" })
|
|
2066
2066
|
] })
|
|
2067
2067
|
] }),
|
|
@@ -2084,8 +2084,8 @@ const dc = ({ distressTexture: e, onChange: s }) => {
|
|
|
2084
2084
|
Math.round(e.height)
|
|
2085
2085
|
] }),
|
|
2086
2086
|
/* @__PURE__ */ t(Wt, { orientation: "vertical", className: "sc:h-6" }),
|
|
2087
|
-
/* @__PURE__ */ h(
|
|
2088
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2087
|
+
/* @__PURE__ */ h(Je, { open: w, onOpenChange: y, children: [
|
|
2088
|
+
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: w ? "default" : "ghost", "aria-label": "More options", children: /* @__PURE__ */ t(J, { icon: le.menu, className: "sc:size-6" }) }) }),
|
|
2089
2089
|
/* @__PURE__ */ t(Ye, { align: "end", children: /* @__PURE__ */ h("div", { className: "sc:flex sc:flex-col sc:gap-2 sc:min-w-[240px]", children: [
|
|
2090
2090
|
/* @__PURE__ */ h("div", { className: "sc:flex sc:items-center sc:gap-3", children: [
|
|
2091
2091
|
/* @__PURE__ */ t(
|
|
@@ -2138,7 +2138,7 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2138
2138
|
_s.subscribe,
|
|
2139
2139
|
_s.list,
|
|
2140
2140
|
_s.list
|
|
2141
|
-
),
|
|
2141
|
+
), P = V(null), [ee, de] = T(!1), [X, K] = T(
|
|
2142
2142
|
null
|
|
2143
2143
|
), Y = He(() => {
|
|
2144
2144
|
const p = /* @__PURE__ */ new Set(), C = [];
|
|
@@ -2266,8 +2266,8 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2266
2266
|
if (!R.current) return;
|
|
2267
2267
|
const ve = new IntersectionObserver(
|
|
2268
2268
|
(We) => {
|
|
2269
|
-
We.forEach((
|
|
2270
|
-
|
|
2269
|
+
We.forEach((Qe) => {
|
|
2270
|
+
Qe.isIntersecting && !G && Ce(p.name);
|
|
2271
2271
|
});
|
|
2272
2272
|
},
|
|
2273
2273
|
{ rootMargin: "600px" }
|
|
@@ -2277,7 +2277,7 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2277
2277
|
}, [p.name, G]);
|
|
2278
2278
|
let ke = "", H = !1;
|
|
2279
2279
|
v === "name" ? (ke = p.name, H = !1) : v === "preview" ? (ke = i || p.name, H = C) : (ke = i || p.name, H = !0);
|
|
2280
|
-
const ae = v === "preview" && !H,
|
|
2280
|
+
const ae = v === "preview" && !H, Pe = /* @__PURE__ */ h(
|
|
2281
2281
|
Ht,
|
|
2282
2282
|
{
|
|
2283
2283
|
ref: (ve) => {
|
|
@@ -2334,7 +2334,7 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2334
2334
|
);
|
|
2335
2335
|
return ae ? /* @__PURE__ */ h(he, { delayDuration: 200, children: [
|
|
2336
2336
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2337
|
-
|
|
2337
|
+
Q,
|
|
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%" },
|
|
@@ -2391,7 +2391,7 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2391
2391
|
}
|
|
2392
2392
|
) }),
|
|
2393
2393
|
/* @__PURE__ */ t(ge, { side: "top", children: /* @__PURE__ */ t("p", { children: p.name }) })
|
|
2394
|
-
] }, p.name) : /* @__PURE__ */ t(Fe.Fragment, { children:
|
|
2394
|
+
] }, p.name) : /* @__PURE__ */ t(Fe.Fragment, { children: Pe }, p.name);
|
|
2395
2395
|
},
|
|
2396
2396
|
(p, C) => p.font.name === C.font.name && p.isUsedInDocument === C.isUsedInDocument
|
|
2397
2397
|
), Ee = He(() => {
|
|
@@ -2514,7 +2514,7 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2514
2514
|
}
|
|
2515
2515
|
),
|
|
2516
2516
|
/* @__PURE__ */ t(
|
|
2517
|
-
|
|
2517
|
+
Q,
|
|
2518
2518
|
{
|
|
2519
2519
|
variant: "secondary",
|
|
2520
2520
|
onClick: () => {
|
|
@@ -2522,17 +2522,17 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
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",
|
|
2525
|
-
children: v === "both" ? /* @__PURE__ */ t(
|
|
2525
|
+
children: v === "both" ? /* @__PURE__ */ t(J, { icon: "lucide:credit-card", className: "sc:size-[22px]" }) : v === "name" ? /* @__PURE__ */ t(J, { icon: "lucide:type", className: "sc:size-[22px]" }) : /* @__PURE__ */ t(J, { icon: "lucide:text-cursor", className: "sc:size-[22px]" })
|
|
2526
2526
|
}
|
|
2527
2527
|
),
|
|
2528
2528
|
/* @__PURE__ */ t(
|
|
2529
|
-
|
|
2529
|
+
Q,
|
|
2530
2530
|
{
|
|
2531
2531
|
variant: "secondary",
|
|
2532
2532
|
onClick: () => E(k === "grid" ? "masonry" : "grid"),
|
|
2533
2533
|
"aria-label": k === "grid" ? "Switch to masonry view" : "Switch to grid view",
|
|
2534
2534
|
className: "sc:h-10 sc:w-10 sc:p-0",
|
|
2535
|
-
children: k === "grid" ? /* @__PURE__ */ t(
|
|
2535
|
+
children: k === "grid" ? /* @__PURE__ */ t(J, { icon: "lucide:grid-2x2", className: "sc:size-[22px]" }) : /* @__PURE__ */ t(J, { icon: "lucide:grid-3x3", className: "sc:size-[22px]" })
|
|
2536
2536
|
}
|
|
2537
2537
|
)
|
|
2538
2538
|
] }) }),
|
|
@@ -2551,7 +2551,7 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2551
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((p) => {
|
|
2552
2552
|
const C = p === "all" ? "All" : wr[p];
|
|
2553
2553
|
return /* @__PURE__ */ t(
|
|
2554
|
-
|
|
2554
|
+
Q,
|
|
2555
2555
|
{
|
|
2556
2556
|
size: "sm",
|
|
2557
2557
|
variant: y === p ? "default" : "secondary",
|
|
@@ -2602,7 +2602,7 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2602
2602
|
/* @__PURE__ */ t(
|
|
2603
2603
|
"input",
|
|
2604
2604
|
{
|
|
2605
|
-
ref:
|
|
2605
|
+
ref: P,
|
|
2606
2606
|
type: "file",
|
|
2607
2607
|
accept: ".woff2,.woff,.ttf,.otf,font/woff2,font/woff,font/ttf,font/otf",
|
|
2608
2608
|
className: "sc:hidden",
|
|
@@ -2613,19 +2613,19 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2613
2613
|
}
|
|
2614
2614
|
),
|
|
2615
2615
|
/* @__PURE__ */ h(
|
|
2616
|
-
|
|
2616
|
+
Q,
|
|
2617
2617
|
{
|
|
2618
2618
|
variant: "secondary",
|
|
2619
2619
|
"data-sc-part": "font-picker-upload",
|
|
2620
2620
|
"data-testid": "font-upload-button",
|
|
2621
2621
|
onClick: () => {
|
|
2622
2622
|
var p;
|
|
2623
|
-
return (p =
|
|
2623
|
+
return (p = P.current) == null ? void 0 : p.click();
|
|
2624
2624
|
},
|
|
2625
2625
|
disabled: ee,
|
|
2626
2626
|
"aria-label": "Upload a font",
|
|
2627
2627
|
children: [
|
|
2628
|
-
/* @__PURE__ */ t(
|
|
2628
|
+
/* @__PURE__ */ t(J, { icon: "lucide:upload", className: "sc:size-4" }),
|
|
2629
2629
|
ee ? "Uploading…" : "Upload font"
|
|
2630
2630
|
]
|
|
2631
2631
|
}
|
|
@@ -2725,14 +2725,14 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2725
2725
|
), x = (g) => {
|
|
2726
2726
|
g !== m && s(g);
|
|
2727
2727
|
};
|
|
2728
|
-
return /* @__PURE__ */ h(
|
|
2729
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "Text Effects", children: /* @__PURE__ */ t(
|
|
2728
|
+
return /* @__PURE__ */ h(Je, { open: f, onOpenChange: b, children: [
|
|
2729
|
+
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "Text Effects", children: /* @__PURE__ */ t(J, { icon: le.wand, className: "sc:size-6" }) }) }),
|
|
2730
2730
|
/* @__PURE__ */ t(Ye, { align: "start", className: "sc:w-[280px] sc:p-0", maxZIndex: !0, children: /* @__PURE__ */ h("div", { className: "sc:space-y-4 sc:p-6", children: [
|
|
2731
2731
|
/* @__PURE__ */ h("div", { className: "sc:space-y-2", children: [
|
|
2732
2732
|
/* @__PURE__ */ t(Me, { children: "Text Effect" }),
|
|
2733
2733
|
/* @__PURE__ */ h($r, { value: m, onValueChange: x, children: [
|
|
2734
2734
|
/* @__PURE__ */ t(qo, { children: /* @__PURE__ */ t(jr, { placeholder: "Select effect" }) }),
|
|
2735
|
-
/* @__PURE__ */ t(Zo, { style: { zIndex: 2147483647 }, children: y.map((g) => /* @__PURE__ */ t(
|
|
2735
|
+
/* @__PURE__ */ t(Zo, { style: { zIndex: 2147483647 }, children: y.map((g) => /* @__PURE__ */ t(Jo, { value: g.id, children: g.label }, g.id)) })
|
|
2736
2736
|
] })
|
|
2737
2737
|
] }),
|
|
2738
2738
|
w.length > 0 && /* @__PURE__ */ t(hi, { element: e, controls: w, onUpdate: n })
|
|
@@ -2740,11 +2740,11 @@ const $t = bs("FontBrowserDrawer"), fi = ({
|
|
|
2740
2740
|
] });
|
|
2741
2741
|
}, gi = ({ items: e }) => {
|
|
2742
2742
|
const [s, n] = T(!1);
|
|
2743
|
-
return /* @__PURE__ */ h(
|
|
2744
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(
|
|
2743
|
+
return /* @__PURE__ */ h(Je, { open: s, onOpenChange: n, children: [
|
|
2744
|
+
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(J, { icon: le.moreHorizontal, className: "sc:size-6" }) }) }),
|
|
2745
2745
|
/* @__PURE__ */ t(Ye, { 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__ */ h(he, { delay: 300, children: [
|
|
2746
2746
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2747
|
-
|
|
2747
|
+
Q,
|
|
2748
2748
|
{
|
|
2749
2749
|
variant: o.active ? "default" : "ghost",
|
|
2750
2750
|
size: "icon",
|
|
@@ -2842,12 +2842,12 @@ function ki({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2842
2842
|
const [r, c] = T(!1), i = (f) => {
|
|
2843
2843
|
c(f), o == null || o(f);
|
|
2844
2844
|
};
|
|
2845
|
-
return /* @__PURE__ */ h(
|
|
2846
|
-
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ t("button", { className: "sc-toolbar-btn", "aria-label": "More options", children: /* @__PURE__ */ t(
|
|
2845
|
+
return /* @__PURE__ */ h(Je, { open: r, onOpenChange: i, children: [
|
|
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(Ye, { align: "end", className: "sc:w-auto sc:p-1", maxZIndex: !0, children: /* @__PURE__ */ h("div", { className: "sc:flex sc:items-center sc:gap-1", children: [
|
|
2848
2848
|
/* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
2849
2849
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2850
|
-
|
|
2850
|
+
Q,
|
|
2851
2851
|
{
|
|
2852
2852
|
variant: "ghost",
|
|
2853
2853
|
size: "icon",
|
|
@@ -2855,14 +2855,14 @@ function ki({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2855
2855
|
e(), i(!1);
|
|
2856
2856
|
},
|
|
2857
2857
|
"aria-label": "Move Forward",
|
|
2858
|
-
children: /* @__PURE__ */ t(
|
|
2858
|
+
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-bring-forward", className: "sc:size-5" })
|
|
2859
2859
|
}
|
|
2860
2860
|
) }),
|
|
2861
2861
|
/* @__PURE__ */ t(ge, { children: "Move Forward" })
|
|
2862
2862
|
] }),
|
|
2863
2863
|
/* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
2864
2864
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2865
|
-
|
|
2865
|
+
Q,
|
|
2866
2866
|
{
|
|
2867
2867
|
variant: "ghost",
|
|
2868
2868
|
size: "icon",
|
|
@@ -2870,14 +2870,14 @@ function ki({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2870
2870
|
s(), i(!1);
|
|
2871
2871
|
},
|
|
2872
2872
|
"aria-label": "Move Backward",
|
|
2873
|
-
children: /* @__PURE__ */ t(
|
|
2873
|
+
children: /* @__PURE__ */ t(J, { icon: "hugeicons:layer-send-backward", className: "sc:size-5" })
|
|
2874
2874
|
}
|
|
2875
2875
|
) }),
|
|
2876
2876
|
/* @__PURE__ */ t(ge, { children: "Move Backward" })
|
|
2877
2877
|
] }),
|
|
2878
2878
|
/* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
2879
2879
|
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2880
|
-
|
|
2880
|
+
Q,
|
|
2881
2881
|
{
|
|
2882
2882
|
variant: "ghost",
|
|
2883
2883
|
size: "icon",
|
|
@@ -2885,7 +2885,7 @@ function ki({ onMoveForward: e, onMoveBackward: s, onDelete: n, onOpenChange: o
|
|
|
2885
2885
|
i(!1), n();
|
|
2886
2886
|
},
|
|
2887
2887
|
"aria-label": "Delete",
|
|
2888
|
-
children: /* @__PURE__ */ t(
|
|
2888
|
+
children: /* @__PURE__ */ t(J, { icon: le.trash, className: "sc:size-5" })
|
|
2889
2889
|
}
|
|
2890
2890
|
) }),
|
|
2891
2891
|
/* @__PURE__ */ t(ge, { children: "Delete" })
|
|
@@ -2921,7 +2921,7 @@ function Ti({
|
|
|
2921
2921
|
getMoreMenuItems: B,
|
|
2922
2922
|
onMoveForward: U,
|
|
2923
2923
|
onMoveBackward: se,
|
|
2924
|
-
onDelete:
|
|
2924
|
+
onDelete: P,
|
|
2925
2925
|
elementForProperties: ee,
|
|
2926
2926
|
elements: de,
|
|
2927
2927
|
isTransformMenuOpen: X,
|
|
@@ -2933,7 +2933,7 @@ function Ti({
|
|
|
2933
2933
|
onFontBrowserToggle: De,
|
|
2934
2934
|
onTextMoreMenuOpenChange: W
|
|
2935
2935
|
}) {
|
|
2936
|
-
const [xe, Ce] = T(!1), [we, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1), p = vs(ee), [C, R] = T(!1), [$, G] = T(!1), [ke, H] = T(!1), [ae,
|
|
2936
|
+
const [xe, Ce] = T(!1), [we, Re] = T(!1), [Ee, ye] = T(!1), [Ie, ze] = T(!1), p = vs(ee), [C, R] = T(!1), [$, G] = T(!1), [ke, H] = T(!1), [ae, Pe] = T(!1), [ve, We] = T(!1), [Qe, et] = T(!1);
|
|
2937
2937
|
return /* @__PURE__ */ h("div", { className: "sc-toolbar-items", children: [
|
|
2938
2938
|
/* @__PURE__ */ t(
|
|
2939
2939
|
fi,
|
|
@@ -3054,9 +3054,9 @@ function Ti({
|
|
|
3054
3054
|
{
|
|
3055
3055
|
icon: "lucide:scissors",
|
|
3056
3056
|
onClick: () => {
|
|
3057
|
-
|
|
3057
|
+
Pe(!0), k();
|
|
3058
3058
|
},
|
|
3059
|
-
onMouseLeave: () =>
|
|
3059
|
+
onMouseLeave: () => Pe(!1),
|
|
3060
3060
|
tooltip: "Clip / Knockout",
|
|
3061
3061
|
tooltipDisabled: ae || D,
|
|
3062
3062
|
active: D || p.knockout
|
|
@@ -3084,7 +3084,7 @@ function Ti({
|
|
|
3084
3084
|
},
|
|
3085
3085
|
onMouseLeave: () => et(!1),
|
|
3086
3086
|
tooltip: "Image Mask",
|
|
3087
|
-
tooltipDisabled:
|
|
3087
|
+
tooltipDisabled: Qe || z,
|
|
3088
3088
|
active: z || p.imageMask
|
|
3089
3089
|
}
|
|
3090
3090
|
),
|
|
@@ -3108,7 +3108,7 @@ function Ti({
|
|
|
3108
3108
|
{
|
|
3109
3109
|
onMoveForward: U,
|
|
3110
3110
|
onMoveBackward: se,
|
|
3111
|
-
onDelete:
|
|
3111
|
+
onDelete: P,
|
|
3112
3112
|
onOpenChange: W
|
|
3113
3113
|
}
|
|
3114
3114
|
),
|
|
@@ -3201,7 +3201,7 @@ function Di(e = {}) {
|
|
|
3201
3201
|
Z(() => {
|
|
3202
3202
|
f !== b.current && (b.current = f, c && c instanceof je && (c.transformType === "circle" && "getEffectiveFontSize" in c ? w(Math.round(c.getEffectiveFontSize())) : c.fontSize !== void 0 && w(Math.round(c.fontSize)), c.color !== void 0 && x(c.color), c.fontFamily !== void 0 && N(c.fontFamily), M(c.textAlign || "center")));
|
|
3203
3203
|
}, [f, c]);
|
|
3204
|
-
const I = m, D = y, k = g, E = v, L = c instanceof je ? 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, U = (L == null ? void 0 : L.italic) ?? !1, se = (L == null ? void 0 : L.underline) ?? !1,
|
|
3204
|
+
const I = m, D = y, k = g, E = v, L = c instanceof je ? 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, U = (L == null ? void 0 : L.italic) ?? !1, se = (L == null ? void 0 : L.underline) ?? !1, P = (L == null ? void 0 : L.letterCase) ?? "none", ee = S(
|
|
3205
3205
|
(p) => {
|
|
3206
3206
|
if (w(p), !c || !(c instanceof je)) return;
|
|
3207
3207
|
const C = c.clone();
|
|
@@ -3302,9 +3302,9 @@ function Di(e = {}) {
|
|
|
3302
3302
|
}
|
|
3303
3303
|
}, [se, c, i, s]), Re = S(() => {
|
|
3304
3304
|
if (!c) return;
|
|
3305
|
-
const p =
|
|
3305
|
+
const p = P === "uppercase" ? "none" : "uppercase", C = c.clone();
|
|
3306
3306
|
C.letterCase = p, i(C);
|
|
3307
|
-
}, [
|
|
3307
|
+
}, [P, c, i]), Ee = S(() => P === "uppercase", [P]), ye = S(() => {
|
|
3308
3308
|
const p = ["left", "center", "right"], C = p.indexOf(E), R = p[(C + 1) % p.length];
|
|
3309
3309
|
K(R);
|
|
3310
3310
|
}, [E, K]), Ie = S(() => {
|
|
@@ -3347,7 +3347,7 @@ function Di(e = {}) {
|
|
|
3347
3347
|
bold: B,
|
|
3348
3348
|
italic: U,
|
|
3349
3349
|
underline: se,
|
|
3350
|
-
letterCase:
|
|
3350
|
+
letterCase: P,
|
|
3351
3351
|
letterSpacing: z,
|
|
3352
3352
|
lineHeight: q,
|
|
3353
3353
|
handleFontSizeChange: Y,
|
|
@@ -3679,13 +3679,13 @@ const hc = [
|
|
|
3679
3679
|
const k = () => {
|
|
3680
3680
|
var A, te, De, W;
|
|
3681
3681
|
const E = ((A = g.current) == null ? void 0 : A.offsetWidth) || 0, L = ((te = g.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, U = ((W = (De = f == null ? void 0 : f.current) == null ? void 0 : De.getZoom) == null ? void 0 : W.call(De)) || 1, se = i == null ? void 0 : i.current;
|
|
3682
|
-
let
|
|
3682
|
+
let P, ee;
|
|
3683
3683
|
if (se) {
|
|
3684
3684
|
const xe = se.getBoundingClientRect();
|
|
3685
|
-
|
|
3686
|
-
} else s ? (
|
|
3685
|
+
P = xe.left + (M.x - q) * U, ee = xe.top + (M.y - B) * U;
|
|
3686
|
+
} else s ? (P = s.left + (M.x - q) * U, ee = s.top + (M.y - B) * U) : (P = window.innerWidth / 2 - M.width * U / 2, ee = window.innerHeight / 2 - M.height * U / 2);
|
|
3687
3687
|
const de = M.width * U, X = M.height * U, K = 12;
|
|
3688
|
-
let Y = ee - L - K, ue =
|
|
3688
|
+
let Y = ee - L - K, ue = P + de / 2;
|
|
3689
3689
|
if (E > 0) {
|
|
3690
3690
|
const Ce = E / 2 + 20, we = window.innerWidth - E / 2 - 20;
|
|
3691
3691
|
ue = Math.max(Ce, Math.min(we, ue));
|
|
@@ -3765,7 +3765,7 @@ const hc = [
|
|
|
3765
3765
|
onImageMaskToggle: M,
|
|
3766
3766
|
onUngroup: I
|
|
3767
3767
|
}) => {
|
|
3768
|
-
const [D, k] = T(!1), [E, L] = T(!1), [z, q] = T(!1), [B, U] = T(!1), [se,
|
|
3768
|
+
const [D, k] = T(!1), [E, L] = T(!1), [z, q] = T(!1), [B, U] = T(!1), [se, P] = T(!1), [ee, de] = T(!1), [X, K] = T(!1), [Y, ue] = T(!1), A = vs(e ?? null);
|
|
3769
3769
|
return /* @__PURE__ */ h("div", { className: "sc-toolbar-items", children: [
|
|
3770
3770
|
/* @__PURE__ */ t(
|
|
3771
3771
|
j,
|
|
@@ -3824,9 +3824,9 @@ const hc = [
|
|
|
3824
3824
|
{
|
|
3825
3825
|
icon: "gravity-ui:circles-intersection",
|
|
3826
3826
|
onClick: () => {
|
|
3827
|
-
|
|
3827
|
+
P(!0), w();
|
|
3828
3828
|
},
|
|
3829
|
-
onMouseLeave: () =>
|
|
3829
|
+
onMouseLeave: () => P(!1),
|
|
3830
3830
|
tooltip: "Blend Mode",
|
|
3831
3831
|
tooltipDisabled: se || m,
|
|
3832
3832
|
active: m || A.blendMode
|
|
@@ -3872,7 +3872,7 @@ const hc = [
|
|
|
3872
3872
|
}
|
|
3873
3873
|
),
|
|
3874
3874
|
/* @__PURE__ */ h(he, { delayDuration: 300, children: [
|
|
3875
|
-
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(
|
|
3875
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ t(Q, { variant: "ghost", size: "sm", onClick: I, children: "Ungroup" }) }),
|
|
3876
3876
|
/* @__PURE__ */ t(ge, { children: "Ungroup this group" })
|
|
3877
3877
|
] })
|
|
3878
3878
|
] });
|
|
@@ -4203,7 +4203,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4203
4203
|
i("Contrast", "contrast"),
|
|
4204
4204
|
i("Saturation", "saturation"),
|
|
4205
4205
|
/* @__PURE__ */ t("div", { className: "sc:flex sc:justify-end", children: /* @__PURE__ */ t(
|
|
4206
|
-
|
|
4206
|
+
Q,
|
|
4207
4207
|
{
|
|
4208
4208
|
variant: "ghost",
|
|
4209
4209
|
size: "sm",
|
|
@@ -4383,7 +4383,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4383
4383
|
] })
|
|
4384
4384
|
}
|
|
4385
4385
|
);
|
|
4386
|
-
},
|
|
4386
|
+
}, Ji = ({ value: e, onChange: s, documentColors: n, imageColors: o }) => /* @__PURE__ */ t(
|
|
4387
4387
|
"div",
|
|
4388
4388
|
{
|
|
4389
4389
|
className: "sc-text-color-panel sc:flex sc:flex-col",
|
|
@@ -4391,7 +4391,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4391
4391
|
style: { touchAction: "pan-y" },
|
|
4392
4392
|
children: /* @__PURE__ */ t("div", { className: mc, children: /* @__PURE__ */ t(Et, { value: e, onChange: s, documentColors: n, imageColors: o, embedded: !0 }) })
|
|
4393
4393
|
}
|
|
4394
|
-
),
|
|
4394
|
+
), Pi = ({
|
|
4395
4395
|
mode: e,
|
|
4396
4396
|
fill: s,
|
|
4397
4397
|
stroke: n,
|
|
@@ -4461,7 +4461,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4461
4461
|
] })
|
|
4462
4462
|
] })
|
|
4463
4463
|
}
|
|
4464
|
-
),
|
|
4464
|
+
), Qi = ({
|
|
4465
4465
|
textureUrl: e,
|
|
4466
4466
|
opacity: s,
|
|
4467
4467
|
onTextureChange: n,
|
|
@@ -4791,7 +4791,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4791
4791
|
}
|
|
4792
4792
|
)
|
|
4793
4793
|
] }) : e === "shapeColor" ? /* @__PURE__ */ h("div", { className: "sc:relative sc:flex sc:size-6 sc:items-center sc:justify-center sc:md:size-5", children: [
|
|
4794
|
-
/* @__PURE__ */ t(
|
|
4794
|
+
/* @__PURE__ */ t(J, { icon: "mdi:format-color-fill", className: "sc:text-primary sc:size-5 sc:md:size-4" }),
|
|
4795
4795
|
/* @__PURE__ */ t(
|
|
4796
4796
|
"div",
|
|
4797
4797
|
{
|
|
@@ -4799,7 +4799,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4799
4799
|
style: { background: o || "#3b82f6" }
|
|
4800
4800
|
}
|
|
4801
4801
|
)
|
|
4802
|
-
] }) : typeof s == "string" ? /* @__PURE__ */ t(
|
|
4802
|
+
] }) : typeof s == "string" ? /* @__PURE__ */ t(J, { icon: s, className: "sc:text-primary sc:size-6 sc:md:size-5" }) : /* @__PURE__ */ t(Ve, { children: s }), Ae = ({ isOpen: e, children: s }) => /* @__PURE__ */ t(
|
|
4803
4803
|
"div",
|
|
4804
4804
|
{
|
|
4805
4805
|
className: "sc-secondary-toolbar-panel-wrapper",
|
|
@@ -4888,7 +4888,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4888
4888
|
isImageMaskPanelOpen: U,
|
|
4889
4889
|
// Panel content
|
|
4890
4890
|
alignPanel: se,
|
|
4891
|
-
cornerRadiusPanel:
|
|
4891
|
+
cornerRadiusPanel: P,
|
|
4892
4892
|
cropPanelContent: ee,
|
|
4893
4893
|
rotationPanel: de,
|
|
4894
4894
|
opacityPanel: X,
|
|
@@ -4940,7 +4940,7 @@ const hs = ({ element: e, onElementUpdate: s, className: n }) => {
|
|
|
4940
4940
|
}
|
|
4941
4941
|
),
|
|
4942
4942
|
/* @__PURE__ */ t(Ae, { isOpen: i, children: se }),
|
|
4943
|
-
/* @__PURE__ */ t(Ae, { isOpen: f, children:
|
|
4943
|
+
/* @__PURE__ */ t(Ae, { isOpen: f, children: P }),
|
|
4944
4944
|
/* @__PURE__ */ t(Ae, { isOpen: b, children: ee }),
|
|
4945
4945
|
/* @__PURE__ */ t(Ae, { isOpen: m, children: de }),
|
|
4946
4946
|
/* @__PURE__ */ t(Ae, { isOpen: w, children: X }),
|
|
@@ -5079,7 +5079,7 @@ function ul(e, s) {
|
|
|
5079
5079
|
return n;
|
|
5080
5080
|
}
|
|
5081
5081
|
const fs = /* @__PURE__ */ new Map(), Bs = /* @__PURE__ */ new Map();
|
|
5082
|
-
function
|
|
5082
|
+
function Js(e) {
|
|
5083
5083
|
if (e.length === 0) return { rRange: 0, gRange: 0, bRange: 0 };
|
|
5084
5084
|
let s = 255, n = 0, o = 255, r = 0, c = 255, i = 0;
|
|
5085
5085
|
for (const f of e)
|
|
@@ -5096,8 +5096,8 @@ function pl(e) {
|
|
|
5096
5096
|
function hl(e) {
|
|
5097
5097
|
const s = fl(e), n = e.pixels.slice().sort((i, f) => i[s] - f[s]), o = n.length >> 1, r = n.slice(0, o), c = n.slice(o);
|
|
5098
5098
|
return [
|
|
5099
|
-
{ pixels: r, ...
|
|
5100
|
-
{ pixels: c, ...
|
|
5099
|
+
{ pixels: r, ...Js(r) },
|
|
5100
|
+
{ pixels: c, ...Js(c) }
|
|
5101
5101
|
];
|
|
5102
5102
|
}
|
|
5103
5103
|
function ml(e) {
|
|
@@ -5113,7 +5113,7 @@ function ml(e) {
|
|
|
5113
5113
|
}
|
|
5114
5114
|
function gl(e, s) {
|
|
5115
5115
|
if (e.length === 0) return [];
|
|
5116
|
-
const n = [{ pixels: e, ...
|
|
5116
|
+
const n = [{ pixels: e, ...Js(e) }];
|
|
5117
5117
|
for (; n.length < s; ) {
|
|
5118
5118
|
let o = -1, r = 0;
|
|
5119
5119
|
for (let i = 0; i < n.length; i++) {
|
|
@@ -5253,8 +5253,8 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5253
5253
|
onLayerThumbnailClick: q,
|
|
5254
5254
|
partAttr: B
|
|
5255
5255
|
}) => {
|
|
5256
|
-
var Vn, Yn, Xn, qn, Kn, Gn, Zn,
|
|
5257
|
-
const { panOffset: U } = Ro(), { multiSelection: se, setSelectedId:
|
|
5256
|
+
var Vn, Yn, Xn, qn, Kn, Gn, Zn, Jn, Pn, Qn, eo, to, so, no, oo, co, ao, ro, io;
|
|
5257
|
+
const { panOffset: U } = Ro(), { multiSelection: se, setSelectedId: P } = fr(), {
|
|
5258
5258
|
expandedPanelType: ee,
|
|
5259
5259
|
setExpandedPanelType: de,
|
|
5260
5260
|
setIsToolbarMenuOpen: X,
|
|
@@ -5274,7 +5274,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5274
5274
|
executeAddElement: ye,
|
|
5275
5275
|
executeReorderElement: Ie,
|
|
5276
5276
|
refreshArtboards: ze
|
|
5277
|
-
} = ms(), { removeBackground: p } = Lo(), C = Di({ canvasEditorRef: Ce }), [R, $] = T("root"), [G, ke] = T(null), [H, ae] = T(null), [
|
|
5277
|
+
} = ms(), { removeBackground: p } = Lo(), C = Di({ canvasEditorRef: Ce }), [R, $] = T("root"), [G, ke] = T(null), [H, ae] = T(null), [Pe, ve] = T(!1), [We, Qe] = T(!1), [et] = T(!1), [tt, yt] = T(!1), [ct, $e] = T(!1), [l, ce] = T(() => N && {
|
|
5278
5278
|
cornerRadius: { type: "cornerRadius", icon: "lucide:square-round-corner", label: "Corner Radius" },
|
|
5279
5279
|
crop: { type: "crop", icon: "lucide:crop", label: "Crop" },
|
|
5280
5280
|
rotation: { type: "rotation", icon: le.rotateLeft, label: "Rotate" },
|
|
@@ -5283,7 +5283,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5283
5283
|
}[N] || null), [at, ie] = T(!1), [rt, Le] = T(!1), [Kt, xt] = T(!1), [vt, it] = T(!1), [Ct, wt] = T(null), [Gt, kt] = T(null), [lt, en] = T({ width: 0, height: 0 }), ut = V(null), ft = V(null), Cs = V(0), tn = V(!1), sn = V(!1), ws = V(null), yc = V(void 0), Zt = V(null), nn = V(ee), on = V(void 0), cn = V(void 0), an = V(!1), rn = V(!1), xc = V(!!N), ln = V(!1), dn = V(l), un = V(null), fn = V(() => {
|
|
5284
5284
|
}), ks = V(void 0), pn = V(void 0);
|
|
5285
5285
|
rn.current = K;
|
|
5286
|
-
const d = te || A,
|
|
5286
|
+
const d = te || A, Jt = d == null ? void 0 : d.id, pt = A == null ? void 0 : A.id, It = d == null ? void 0 : d.transformType, { fontColor: Ts, getEffectiveStyle: vc, handleFontColorChange: Ns } = C, Rt = !!(A && !K), O = S(
|
|
5287
5287
|
(a) => {
|
|
5288
5288
|
if (A)
|
|
5289
5289
|
if (te) {
|
|
@@ -5347,7 +5347,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5347
5347
|
}, [p, Ss, d, bn]);
|
|
5348
5348
|
Z(() => {
|
|
5349
5349
|
Ds(null);
|
|
5350
|
-
}, [
|
|
5350
|
+
}, [Jt]);
|
|
5351
5351
|
const kc = S(
|
|
5352
5352
|
(a) => {
|
|
5353
5353
|
if (!d || d.transformType !== "shape") return;
|
|
@@ -5407,7 +5407,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5407
5407
|
);
|
|
5408
5408
|
}, [I]), Lc = S(() => {
|
|
5409
5409
|
M ? M() : ce((a) => (a == null ? void 0 : a.type) === "crop" ? null : { type: "crop", icon: "lucide:crop", label: "Crop" });
|
|
5410
|
-
}, [M]),
|
|
5410
|
+
}, [M]), Pt = S(() => {
|
|
5411
5411
|
ce(
|
|
5412
5412
|
(a) => (a == null ? void 0 : a.type) === "rotation" ? null : { type: "rotation", icon: le.rotateLeft, label: "Rotate" }
|
|
5413
5413
|
);
|
|
@@ -5460,7 +5460,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5460
5460
|
ce(
|
|
5461
5461
|
(a) => (a == null ? void 0 : a.type) === "textColor" ? null : { type: "textColor", icon: le.palette, label: "Font Color" }
|
|
5462
5462
|
);
|
|
5463
|
-
}, []),
|
|
5463
|
+
}, []), Qt = S(() => {
|
|
5464
5464
|
ce(
|
|
5465
5465
|
(a) => (a == null ? void 0 : a.type) === "compositing" ? null : { type: "compositing", icon: "lucide:scissors", label: "Clip / Knockout" }
|
|
5466
5466
|
);
|
|
@@ -5509,8 +5509,8 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5509
5509
|
}
|
|
5510
5510
|
}, [A, Y, Ie]), Es = S(() => {
|
|
5511
5511
|
const a = te || A;
|
|
5512
|
-
a && (Ee(a),
|
|
5513
|
-
}, [te, A, Ee,
|
|
5512
|
+
a && (Ee(a), P(null));
|
|
5513
|
+
}, [te, A, Ee, P]), Kc = S(() => {
|
|
5514
5514
|
if (!d) return;
|
|
5515
5515
|
const a = d.clone();
|
|
5516
5516
|
a.locked = !d.locked, O(a);
|
|
@@ -5524,8 +5524,8 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5524
5524
|
const fe = _.clone();
|
|
5525
5525
|
return fe.x = _.x + a.x, fe.y = _.y + a.y, fe;
|
|
5526
5526
|
});
|
|
5527
|
-
Ee(a), F.forEach((_) => ye(_, u)),
|
|
5528
|
-
}, [A, W, Ee, ye,
|
|
5527
|
+
Ee(a), F.forEach((_) => ye(_, u)), P(F.length > 0 ? F[0].id : null);
|
|
5528
|
+
}, [A, W, Ee, ye, P]), Gc = S(
|
|
5529
5529
|
(a) => {
|
|
5530
5530
|
if (!d) return;
|
|
5531
5531
|
const u = d.clone();
|
|
@@ -5537,7 +5537,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5537
5537
|
const a = d.clone();
|
|
5538
5538
|
let u = Math.floor(a.rotation / 90) * 90 + 90;
|
|
5539
5539
|
u = (u % 360 + 360) % 360, u > 180 && (u -= 360), a.rotation = u, O(a);
|
|
5540
|
-
}, [d, O]),
|
|
5540
|
+
}, [d, O]), Jc = S(
|
|
5541
5541
|
(a) => {
|
|
5542
5542
|
if (!d) return;
|
|
5543
5543
|
const u = d.clone();
|
|
@@ -5560,9 +5560,9 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5560
5560
|
}
|
|
5561
5561
|
},
|
|
5562
5562
|
[d, te, O, vn]
|
|
5563
|
-
),
|
|
5563
|
+
), Pc = S(() => {
|
|
5564
5564
|
Lt.current = !1;
|
|
5565
|
-
}, []),
|
|
5565
|
+
}, []), Qc = S(() => {
|
|
5566
5566
|
Lt.current = !1, Is({ ...Bo }), Lt.current = !1;
|
|
5567
5567
|
}, [Is]), ea = S(
|
|
5568
5568
|
(a) => {
|
|
@@ -5940,14 +5940,14 @@ const Do = ({ services: e, ...s }) => {
|
|
|
5940
5940
|
return () => clearTimeout(F);
|
|
5941
5941
|
}
|
|
5942
5942
|
}, [Rt, K, pt, e, It]), Z(() => {
|
|
5943
|
-
if (vt && H && Ct ===
|
|
5943
|
+
if (vt && H && Ct === Jt) {
|
|
5944
5944
|
it(!1), ie(!0);
|
|
5945
5945
|
const a = setTimeout(() => {
|
|
5946
5946
|
ie(!1);
|
|
5947
5947
|
}, 200);
|
|
5948
5948
|
return () => clearTimeout(a);
|
|
5949
5949
|
}
|
|
5950
|
-
}, [vt, H, Ct,
|
|
5950
|
+
}, [vt, H, Ct, Jt]), Mo(() => {
|
|
5951
5951
|
if (e !== "embedded") return;
|
|
5952
5952
|
const a = cn.current;
|
|
5953
5953
|
if (a !== void 0 && It !== void 0 && a !== It && Cs.current > 0 && Gt === null) {
|
|
@@ -6045,7 +6045,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6045
6045
|
adjustExpanded: (l == null ? void 0 : l.type) === "adjust",
|
|
6046
6046
|
onAdjustToggle: Ac,
|
|
6047
6047
|
rotationExpanded: (l == null ? void 0 : l.type) === "rotation",
|
|
6048
|
-
onRotationToggle:
|
|
6048
|
+
onRotationToggle: Pt,
|
|
6049
6049
|
opacityExpanded: (l == null ? void 0 : l.type) === "opacity",
|
|
6050
6050
|
onOpacityToggle: Ms,
|
|
6051
6051
|
strokeExpanded: (l == null ? void 0 : l.type) === "stroke",
|
|
@@ -6055,7 +6055,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6055
6055
|
blendModeExpanded: (l == null ? void 0 : l.type) === "blendMode",
|
|
6056
6056
|
onBlendModeToggle: os,
|
|
6057
6057
|
knockoutExpanded: (l == null ? void 0 : l.type) === "compositing",
|
|
6058
|
-
onKnockoutToggle:
|
|
6058
|
+
onKnockoutToggle: Qt,
|
|
6059
6059
|
distressTextureExpanded: (l == null ? void 0 : l.type) === "distressTexture",
|
|
6060
6060
|
onDistressTextureToggle: es,
|
|
6061
6061
|
imageMaskExpanded: (l == null ? void 0 : l.type) === "imageMask",
|
|
@@ -6067,7 +6067,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6067
6067
|
{
|
|
6068
6068
|
element: A,
|
|
6069
6069
|
rotationExpanded: (l == null ? void 0 : l.type) === "rotation",
|
|
6070
|
-
onRotationToggle:
|
|
6070
|
+
onRotationToggle: Pt,
|
|
6071
6071
|
opacityExpanded: (l == null ? void 0 : l.type) === "opacity",
|
|
6072
6072
|
onOpacityToggle: Ms,
|
|
6073
6073
|
strokeExpanded: (l == null ? void 0 : l.type) === "stroke",
|
|
@@ -6077,7 +6077,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6077
6077
|
blendModeExpanded: (l == null ? void 0 : l.type) === "blendMode",
|
|
6078
6078
|
onBlendModeToggle: os,
|
|
6079
6079
|
knockoutExpanded: (l == null ? void 0 : l.type) === "compositing",
|
|
6080
|
-
onKnockoutToggle:
|
|
6080
|
+
onKnockoutToggle: Qt,
|
|
6081
6081
|
distressTextureExpanded: (l == null ? void 0 : l.type) === "distressTexture",
|
|
6082
6082
|
onDistressTextureToggle: es,
|
|
6083
6083
|
imageMaskExpanded: (l == null ? void 0 : l.type) === "imageMask",
|
|
@@ -6099,7 +6099,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6099
6099
|
onOpenShapeTypeDrawer: ha,
|
|
6100
6100
|
onDelete: Es,
|
|
6101
6101
|
rotationExpanded: (l == null ? void 0 : l.type) === "rotation",
|
|
6102
|
-
onRotationToggle:
|
|
6102
|
+
onRotationToggle: Pt,
|
|
6103
6103
|
cornerRadiusExpanded: (l == null ? void 0 : l.type) === "shapeCornerRadius",
|
|
6104
6104
|
onCornerRadiusToggle: $c,
|
|
6105
6105
|
transparencyExpanded: (l == null ? void 0 : l.type) === "shapeTransparency",
|
|
@@ -6119,7 +6119,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6119
6119
|
blendModeExpanded: (l == null ? void 0 : l.type) === "blendMode",
|
|
6120
6120
|
onBlendModeToggle: os,
|
|
6121
6121
|
knockoutExpanded: (l == null ? void 0 : l.type) === "compositing",
|
|
6122
|
-
onKnockoutToggle:
|
|
6122
|
+
onKnockoutToggle: Qt,
|
|
6123
6123
|
distressTextureExpanded: (l == null ? void 0 : l.type) === "distressTexture",
|
|
6124
6124
|
onDistressTextureToggle: es,
|
|
6125
6125
|
imageMaskExpanded: (l == null ? void 0 : l.type) === "imageMask",
|
|
@@ -6139,7 +6139,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6139
6139
|
Ti,
|
|
6140
6140
|
{
|
|
6141
6141
|
toolbar: C,
|
|
6142
|
-
stableElementId:
|
|
6142
|
+
stableElementId: Jt,
|
|
6143
6143
|
viewportWidth: c,
|
|
6144
6144
|
colorPickerValue: Rs,
|
|
6145
6145
|
isColorActive: (l == null ? void 0 : l.type) === "textColor",
|
|
@@ -6153,11 +6153,11 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6153
6153
|
onBlendModeToggle: os,
|
|
6154
6154
|
hasGlyphs: f,
|
|
6155
6155
|
expandedPanel: l,
|
|
6156
|
-
onRotationToggle:
|
|
6156
|
+
onRotationToggle: Pt,
|
|
6157
6157
|
onOpacityToggle: Ms,
|
|
6158
6158
|
onFontSizeToggle: Fc,
|
|
6159
6159
|
knockoutExpanded: (l == null ? void 0 : l.type) === "compositing",
|
|
6160
|
-
onKnockoutToggle:
|
|
6160
|
+
onKnockoutToggle: Qt,
|
|
6161
6161
|
distressTextureExpanded: (l == null ? void 0 : l.type) === "distressTexture",
|
|
6162
6162
|
onDistressTextureToggle: es,
|
|
6163
6163
|
imageMaskExpanded: (l == null ? void 0 : l.type) === "imageMask",
|
|
@@ -6169,7 +6169,7 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6169
6169
|
elementForProperties: d,
|
|
6170
6170
|
elements: Y,
|
|
6171
6171
|
isTransformMenuOpen: We,
|
|
6172
|
-
onTransformMenuOpenChange:
|
|
6172
|
+
onTransformMenuOpenChange: Qe,
|
|
6173
6173
|
elementUpdateHandler: O,
|
|
6174
6174
|
showUngroupButton: !!te && (A == null ? void 0 : A.transformType) === "group",
|
|
6175
6175
|
onUngroup: rs,
|
|
@@ -6241,13 +6241,13 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6241
6241
|
) })
|
|
6242
6242
|
] })
|
|
6243
6243
|
}
|
|
6244
|
-
) : null, zs = (l == null ? void 0 : l.type) === "align", Ls = (l == null ? void 0 : l.type) === "cornerRadius", As = (l == null ? void 0 : l.type) === "crop", Sn = (l == null ? void 0 : l.type) === "rotation", Dn = (l == null ? void 0 : l.type) === "opacity", Mn = (l == null ? void 0 : l.type) === "adjust", En = (l == null ? void 0 : l.type) === "fontSize", In = (l == null ? void 0 : l.type) === "shapeCornerRadius", Rn = (l == null ? void 0 : l.type) === "shapeTransparency", zn = (l == null ? void 0 : l.type) === "shapeSides", Ln = (l == null ? void 0 : l.type) === "shapePoints", An = (l == null ? void 0 : l.type) === "shapeInnerRadius", Fn = (l == null ? void 0 : l.type) === "shapeColor", On = (l == null ? void 0 : l.type) === "textColor", _n = (l == null ? void 0 : l.type) === "compositing", Bn = (l == null ? void 0 : l.type) === "distressTexture", Un = (l == null ? void 0 : l.type) === "stroke", $n = (l == null ? void 0 : l.type) === "shadow", jn = (l == null ? void 0 : l.type) === "blendMode", Hn = (l == null ? void 0 : l.type) === "imageMask", Wn = (d == null ? void 0 : d.transformType) === "image" && ((qn = d.transformData) == null ? void 0 : qn.borderRadius) || 0, va = (d == null ? void 0 : d.rotation) || 0, Ca = (d == null ? void 0 : d.opacity) ?? 1, wa = ((Kn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Kn.borderRadius) || 0, ka = ((Gn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Gn.fillOpacity) ?? 1, Ta = ((Zn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Zn.sides) || 5, Na = ((
|
|
6244
|
+
) : null, zs = (l == null ? void 0 : l.type) === "align", Ls = (l == null ? void 0 : l.type) === "cornerRadius", As = (l == null ? void 0 : l.type) === "crop", Sn = (l == null ? void 0 : l.type) === "rotation", Dn = (l == null ? void 0 : l.type) === "opacity", Mn = (l == null ? void 0 : l.type) === "adjust", En = (l == null ? void 0 : l.type) === "fontSize", In = (l == null ? void 0 : l.type) === "shapeCornerRadius", Rn = (l == null ? void 0 : l.type) === "shapeTransparency", zn = (l == null ? void 0 : l.type) === "shapeSides", Ln = (l == null ? void 0 : l.type) === "shapePoints", An = (l == null ? void 0 : l.type) === "shapeInnerRadius", Fn = (l == null ? void 0 : l.type) === "shapeColor", On = (l == null ? void 0 : l.type) === "textColor", _n = (l == null ? void 0 : l.type) === "compositing", Bn = (l == null ? void 0 : l.type) === "distressTexture", Un = (l == null ? void 0 : l.type) === "stroke", $n = (l == null ? void 0 : l.type) === "shadow", jn = (l == null ? void 0 : l.type) === "blendMode", Hn = (l == null ? void 0 : l.type) === "imageMask", Wn = (d == null ? void 0 : d.transformType) === "image" && ((qn = d.transformData) == null ? void 0 : qn.borderRadius) || 0, va = (d == null ? void 0 : d.rotation) || 0, Ca = (d == null ? void 0 : d.opacity) ?? 1, wa = ((Kn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Kn.borderRadius) || 0, ka = ((Gn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Gn.fillOpacity) ?? 1, Ta = ((Zn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Zn.sides) || 5, Na = ((Jn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Jn.points) || 5, Sa = ((Pn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Pn.innerRadius) || 0.4, Da = ((Qn = ne == null ? void 0 : ne.transformData) == null ? void 0 : Qn.fillColor) || "#3b82f6", Ma = (eo = ne == null ? void 0 : ne.transformData) == null ? void 0 : eo.fill, Ea = ((to = d == null ? void 0 : d.knockoutParts) == null ? void 0 : to.fill) ?? !1, Ia = ((so = d == null ? void 0 : d.knockoutParts) == null ? void 0 : so.stroke) ?? !1, Ra = ((no = d == null ? void 0 : d.knockoutParts) == null ? void 0 : no.scope) ?? "group", za = (d == null ? void 0 : d.blendMode) === "clip" ? "clip" : "knockout", La = zs && d ? /* @__PURE__ */ t(gc, { onAlign: yn }) : null, Aa = Ls && (d == null ? void 0 : d.transformType) === "image" ? /* @__PURE__ */ t(Ui, { value: Wn, onChange: hn }) : null, Fa = As && (d == null ? void 0 : d.transformType) === "image" ? /* @__PURE__ */ t(cl, { element: d, onElementUpdate: O }) : null, Oa = Sn && d ? /* @__PURE__ */ t($i, { value: va, onChange: Gc, onRotate90: Zc }) : null, _a = Dn && d ? /* @__PURE__ */ t(Hi, { value: Ca, onChange: Jc }) : null, Ba = (d == null ? void 0 : d.transformType) === "image" ? (oo = d.transformData) == null ? void 0 : oo.adjustments : void 0, Ua = Mn && (d == null ? void 0 : d.transformType) === "image" ? /* @__PURE__ */ t(
|
|
6245
6245
|
Wi,
|
|
6246
6246
|
{
|
|
6247
6247
|
adjustments: Ba,
|
|
6248
6248
|
onChange: Is,
|
|
6249
|
-
onChangeEnd:
|
|
6250
|
-
onReset:
|
|
6249
|
+
onChangeEnd: Pc,
|
|
6250
|
+
onReset: Qc
|
|
6251
6251
|
}
|
|
6252
6252
|
) : null, $a = En ? /* @__PURE__ */ t(
|
|
6253
6253
|
ji,
|
|
@@ -6261,8 +6261,8 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6261
6261
|
lineHeightValue: Uc,
|
|
6262
6262
|
onLineHeightChange: C.handleLineHeightChange
|
|
6263
6263
|
}
|
|
6264
|
-
) : null, ja = In && ne ? /* @__PURE__ */ t(Vi, { value: wa, onChange: kc }) : null, Ha = Rn && ne ? /* @__PURE__ */ t(Yi, { value: ka, onChange: Tc }) : null, Wa = zn && ne ? /* @__PURE__ */ t(Xi, { value: Ta, onChange: Nc }) : null, Va = Ln && ne ? /* @__PURE__ */ t(qi, { value: Na, onChange: Sc }) : null, Ya = An && ne ? /* @__PURE__ */ t(Ki, { value: Sa, onChange: Dc }) : null, Xa = Fn && ne ? /* @__PURE__ */ t(Zi, { value: Da, onChange: Mc, fill: Ma, onFillChange: Ec, documentColors: At, imageColors: Ft }) : null, qa = On && d ? /* @__PURE__ */ t(
|
|
6265
|
-
|
|
6264
|
+
) : null, ja = In && ne ? /* @__PURE__ */ t(Vi, { value: wa, onChange: kc }) : null, Ha = Rn && ne ? /* @__PURE__ */ t(Yi, { value: ka, onChange: Tc }) : null, Wa = zn && ne ? /* @__PURE__ */ t(Xi, { value: Ta, onChange: Nc }) : null, Va = Ln && ne ? /* @__PURE__ */ t(qi, { value: Na, onChange: Sc }) : null, Ya = An && ne ? /* @__PURE__ */ t(Ki, { value: Sa, onChange: Dc }) : null, Xa = Fn && ne ? /* @__PURE__ */ t(Zi, { value: Da, onChange: Mc, fill: Ma, onFillChange: Ec, documentColors: At, imageColors: Ft }) : null, qa = On && d ? /* @__PURE__ */ t(Ji, { value: Rs, onChange: ma, documentColors: At, imageColors: Ft }) : null, Ka = _n && d ? /* @__PURE__ */ t(
|
|
6265
|
+
Pi,
|
|
6266
6266
|
{
|
|
6267
6267
|
mode: za,
|
|
6268
6268
|
fill: Ea,
|
|
@@ -6289,21 +6289,21 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6289
6289
|
documentColors: At,
|
|
6290
6290
|
imageColors: Ft
|
|
6291
6291
|
}
|
|
6292
|
-
) : null,
|
|
6292
|
+
) : null, Ja = jn && d ? /* @__PURE__ */ t(
|
|
6293
6293
|
ol,
|
|
6294
6294
|
{
|
|
6295
6295
|
blendMode: Fo(d.blendMode) ? d.blendMode : "normal",
|
|
6296
6296
|
onChange: fa
|
|
6297
6297
|
}
|
|
6298
|
-
) : null,
|
|
6299
|
-
|
|
6298
|
+
) : null, Pa = Bn && d ? /* @__PURE__ */ t(
|
|
6299
|
+
Qi,
|
|
6300
6300
|
{
|
|
6301
6301
|
textureUrl: ((co = d.distressEffect) == null ? void 0 : co.textureUrl) ?? "",
|
|
6302
6302
|
opacity: Math.round((((ao = d.distressEffect) == null ? void 0 : ao.textureOpacity) ?? 0.5) * 100),
|
|
6303
6303
|
onTextureChange: oa,
|
|
6304
6304
|
onOpacityChange: ca
|
|
6305
6305
|
}
|
|
6306
|
-
) : null, Xe = (ro = d == null ? void 0 : d.masks) == null ? void 0 : ro.find((a) => a.id === "quick-image-mask"),
|
|
6306
|
+
) : null, Xe = (ro = d == null ? void 0 : d.masks) == null ? void 0 : ro.find((a) => a.id === "quick-image-mask"), Qa = Hn && d ? /* @__PURE__ */ t(
|
|
6307
6307
|
el,
|
|
6308
6308
|
{
|
|
6309
6309
|
imageUrl: ((io = Xe == null ? void 0 : Xe.maskElement) == null ? void 0 : io.imageUrl) ?? "",
|
|
@@ -6413,11 +6413,11 @@ const Do = ({ services: e, ...s }) => {
|
|
|
6413
6413
|
textColorPanel: qa,
|
|
6414
6414
|
strokePanel: Ga,
|
|
6415
6415
|
shadowPanel: Za,
|
|
6416
|
-
blendModePanel:
|
|
6416
|
+
blendModePanel: Ja,
|
|
6417
6417
|
knockoutPanel: Ka,
|
|
6418
|
-
distressTexturePanel:
|
|
6418
|
+
distressTexturePanel: Pa,
|
|
6419
6419
|
alignPanel: La,
|
|
6420
|
-
imageMaskPanel:
|
|
6420
|
+
imageMaskPanel: Qa
|
|
6421
6421
|
}
|
|
6422
6422
|
) : null, nr = lt.width > 0 ? Math.max(lt.width, 200) : 280, or = e === "floating" && Ls && (d == null ? void 0 : d.transformType) === "image" && H ? /* @__PURE__ */ t(
|
|
6423
6423
|
il,
|
|
@@ -6509,7 +6509,7 @@ export {
|
|
|
6509
6509
|
fi as F,
|
|
6510
6510
|
ri as I,
|
|
6511
6511
|
gi as M,
|
|
6512
|
-
|
|
6512
|
+
Je as P,
|
|
6513
6513
|
ii as S,
|
|
6514
6514
|
wi as T,
|
|
6515
6515
|
vi as U,
|
|
@@ -6534,4 +6534,4 @@ export {
|
|
|
6534
6534
|
Ol as s,
|
|
6535
6535
|
Ei as u
|
|
6536
6536
|
};
|
|
6537
|
-
//# sourceMappingURL=ContextualToolbars-
|
|
6537
|
+
//# sourceMappingURL=ContextualToolbars-DSJykxdc.js.map
|