@snowcone-app/canvas 0.43.6 → 0.43.7
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-DnYgiWjt.js → CanvasRenderer-DIug_mjX.js} +4 -4
- package/dist/{CanvasRenderer-DnYgiWjt.js.map → CanvasRenderer-DIug_mjX.js.map} +1 -1
- package/dist/{CanvasStateV1-B51bXTyy.js → CanvasStateV1-BWd358xJ.js} +3 -3
- package/dist/{CanvasStateV1-B51bXTyy.js.map → CanvasStateV1-BWd358xJ.js.map} +1 -1
- package/dist/{ContextualToolbars-DtlxDatY.js → ContextualToolbars-CspkC1T3.js} +6 -6
- package/dist/{ContextualToolbars-DtlxDatY.js.map → ContextualToolbars-CspkC1T3.js.map} +1 -1
- package/dist/{EditorCanvasImpl-B5IEg9tq.js → EditorCanvasImpl-DpssZT6w.js} +8 -8
- package/dist/{EditorCanvasImpl-B5IEg9tq.js.map → EditorCanvasImpl-DpssZT6w.js.map} +1 -1
- package/dist/{ExportManager-vAuaoF5Q.js → ExportManager-BDH9jW4Q.js} +3 -3
- package/dist/{ExportManager-vAuaoF5Q.js.map → ExportManager-BDH9jW4Q.js.map} +1 -1
- package/dist/{FontAnalyzer-D9R2PYsy.js → FontAnalyzer-CyhywbAM.js} +336 -325
- package/dist/FontAnalyzer-CyhywbAM.js.map +1 -0
- package/dist/{ImagePanel-kybrF6yT.js → ImagePanel-CIGpLY3B.js} +6 -6
- package/dist/{ImagePanel-kybrF6yT.js.map → ImagePanel-CIGpLY3B.js.map} +1 -1
- package/dist/{SnowconeCanvas-rAUrO9PR.js → SnowconeCanvas-Bs34CUv5.js} +10 -10
- package/dist/{SnowconeCanvas-rAUrO9PR.js.map → SnowconeCanvas-Bs34CUv5.js.map} +1 -1
- package/dist/advanced.mjs +15 -15
- package/dist/{custom-icons-Dlfrg3A_.js → custom-icons-sT5sNRcG.js} +2 -2
- package/dist/{custom-icons-Dlfrg3A_.js.map → custom-icons-sT5sNRcG.js.map} +1 -1
- package/dist/{design-builder-C8s1r4MF.js → design-builder-CwfefZJC.js} +2 -2
- package/dist/{design-builder-C8s1r4MF.js.map → design-builder-CwfefZJC.js.map} +1 -1
- package/dist/{embed-BXa1jr7S.js → embed-BcYaDLRo.js} +10 -10
- package/dist/{embed-BXa1jr7S.js.map → embed-BcYaDLRo.js.map} +1 -1
- package/dist/embed.mjs +7 -7
- package/dist/{export-worker.bundle.string-C6Zm9Wt-.js → export-worker.bundle.string-BL30CYzH.js} +18 -3
- package/dist/{export-worker.bundle.string-C6Zm9Wt-.js.map → export-worker.bundle.string-BL30CYzH.js.map} +1 -1
- package/dist/fonts/fontWeights.d.ts +6 -0
- package/dist/{guards-B0PNEbK6.js → guards-Dvw7Qch0.js} +2 -2
- package/dist/{guards-B0PNEbK6.js.map → guards-Dvw7Qch0.js.map} +1 -1
- package/dist/index.mjs +9 -9
- package/dist/internals.mjs +6 -6
- package/dist/{template-fields-ZZEdYB5H.js → template-fields-DF1ijCl9.js} +5 -5
- package/dist/{template-fields-ZZEdYB5H.js.map → template-fields-DF1ijCl9.js.map} +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{useCommands-d5UM6Cnc.js → useCommands-wwGeWCn6.js} +7 -7
- package/dist/{useCommands-d5UM6Cnc.js.map → useCommands-wwGeWCn6.js.map} +1 -1
- package/dist/{usePieceGuideBundle-BPVWvChD.js → usePieceGuideBundle-BWQINIJR.js} +2 -2
- package/dist/{usePieceGuideBundle-BPVWvChD.js.map → usePieceGuideBundle-BWQINIJR.js.map} +1 -1
- package/dist/{validation-C8qNtk6j.js → validation-B6sLZULE.js} +11 -11
- package/dist/{validation-C8qNtk6j.js.map → validation-B6sLZULE.js.map} +1 -1
- package/dist/workers/export-worker.bundle.string.d.ts +1 -1
- package/example/package.json +1 -1
- package/package.json +2 -2
- package/dist/FontAnalyzer-D9R2PYsy.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Se(o) {
|
|
2
2
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
3
3
|
}
|
|
4
|
-
var
|
|
4
|
+
var qt = { exports: {} }, B = qt.exports = {}, _, X;
|
|
5
5
|
function Ft() {
|
|
6
6
|
throw new Error("setTimeout has not been defined");
|
|
7
7
|
}
|
|
@@ -20,7 +20,7 @@ function Mt() {
|
|
|
20
20
|
X = Mt;
|
|
21
21
|
}
|
|
22
22
|
})();
|
|
23
|
-
function
|
|
23
|
+
function jt(o) {
|
|
24
24
|
if (_ === setTimeout)
|
|
25
25
|
return setTimeout(o, 0);
|
|
26
26
|
if ((_ === Ft || !_) && setTimeout)
|
|
@@ -35,7 +35,7 @@ function qt(o) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Ce(o) {
|
|
39
39
|
if (X === clearTimeout)
|
|
40
40
|
return clearTimeout(o);
|
|
41
41
|
if ((X === Mt || !X) && clearTimeout)
|
|
@@ -51,19 +51,19 @@ function xe(o) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
var z = [], Q = !1, J, ft = -1;
|
|
54
|
-
function
|
|
55
|
-
!Q || !J || (Q = !1, J.length ? z = J.concat(z) : ft = -1, z.length &&
|
|
54
|
+
function ve() {
|
|
55
|
+
!Q || !J || (Q = !1, J.length ? z = J.concat(z) : ft = -1, z.length && Zt());
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Zt() {
|
|
58
58
|
if (!Q) {
|
|
59
|
-
var o =
|
|
59
|
+
var o = jt(ve);
|
|
60
60
|
Q = !0;
|
|
61
61
|
for (var t = z.length; t; ) {
|
|
62
62
|
for (J = z, z = []; ++ft < t; )
|
|
63
63
|
J && J[ft].run();
|
|
64
64
|
ft = -1, t = z.length;
|
|
65
65
|
}
|
|
66
|
-
J = null, Q = !1,
|
|
66
|
+
J = null, Q = !1, Ce(o);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
B.nextTick = function(o) {
|
|
@@ -71,12 +71,12 @@ B.nextTick = function(o) {
|
|
|
71
71
|
if (arguments.length > 1)
|
|
72
72
|
for (var e = 1; e < arguments.length; e++)
|
|
73
73
|
t[e - 1] = arguments[e];
|
|
74
|
-
z.push(new
|
|
74
|
+
z.push(new Kt(o, t)), z.length === 1 && !Q && jt(Zt);
|
|
75
75
|
};
|
|
76
|
-
function
|
|
76
|
+
function Kt(o, t) {
|
|
77
77
|
this.fun = o, this.array = t;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
Kt.prototype.run = function() {
|
|
80
80
|
this.fun.apply(null, this.array);
|
|
81
81
|
};
|
|
82
82
|
B.title = "browser";
|
|
@@ -111,8 +111,8 @@ B.chdir = function(o) {
|
|
|
111
111
|
B.umask = function() {
|
|
112
112
|
return 0;
|
|
113
113
|
};
|
|
114
|
-
var
|
|
115
|
-
const mt = /* @__PURE__ */
|
|
114
|
+
var Te = qt.exports;
|
|
115
|
+
const mt = /* @__PURE__ */ Se(Te);
|
|
116
116
|
let Xt = 1;
|
|
117
117
|
class at {
|
|
118
118
|
constructor(t = {}) {
|
|
@@ -275,7 +275,7 @@ class at {
|
|
|
275
275
|
this.x = t, this.y = e;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
class
|
|
278
|
+
class Fs {
|
|
279
279
|
constructor() {
|
|
280
280
|
this.artboards = /* @__PURE__ */ new Map(), this.elementToArtboard = /* @__PURE__ */ new Map(), this.activeArtboardId = null, this.placeholderIds = /* @__PURE__ */ new Set();
|
|
281
281
|
}
|
|
@@ -545,7 +545,7 @@ const D = {
|
|
|
545
545
|
return t > 180 && (t -= 360), t;
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
|
-
let
|
|
548
|
+
let Fe = 1;
|
|
549
549
|
class tt {
|
|
550
550
|
/** Whether this element clips content below it (derived from blendMode === 'clip') */
|
|
551
551
|
get isClipping() {
|
|
@@ -555,7 +555,7 @@ class tt {
|
|
|
555
555
|
t ? (this.blendMode = "clip", this.knockoutParts || (this.knockoutParts = { fill: !0, scope: "group" })) : this.blendMode === "clip" && (this.blendMode = "normal");
|
|
556
556
|
}
|
|
557
557
|
constructor(t = {}) {
|
|
558
|
-
this.id = t.id || `element-${
|
|
558
|
+
this.id = t.id || `element-${Fe++}`, this.x = t.x !== void 0 ? t.x : 100, this.y = t.y !== void 0 ? t.y : 100, this.rotation = t.rotation !== void 0 ? t.rotation : 0, this.opacity = t.opacity !== void 0 ? t.opacity : 1, this.transformType = t.transformType || "custom", this.transformData = t.transformData || {}, this.blendMode = t.blendMode, this.knockoutParts = t.knockoutParts, this.stroke = t.stroke, this.masks = t.masks, this.distressEffect = t.distressEffect, this.shadow = t.shadow, t.isClipping && !t.blendMode && (this.blendMode = "clip", this.knockoutParts || (this.knockoutParts = { fill: !0, scope: "group" })), this.name = t.name, this.visible = t.visible !== void 0 ? t.visible : !0, this.locked = t.locked !== void 0 ? t.locked : !1;
|
|
559
559
|
}
|
|
560
560
|
/**
|
|
561
561
|
* Get visual bounding box (tight fit around actual rendered content)
|
|
@@ -816,7 +816,7 @@ class P {
|
|
|
816
816
|
return new P(t);
|
|
817
817
|
}
|
|
818
818
|
}
|
|
819
|
-
const
|
|
819
|
+
const Qt = [
|
|
820
820
|
// Bold/Display Fonts - Perfect for statements and headlines (49 fonts)
|
|
821
821
|
{
|
|
822
822
|
name: "Bebas Neue",
|
|
@@ -2292,10 +2292,10 @@ const Te = [
|
|
|
2292
2292
|
description: "Humanist monospace"
|
|
2293
2293
|
}
|
|
2294
2294
|
];
|
|
2295
|
-
function
|
|
2296
|
-
return
|
|
2295
|
+
function Me() {
|
|
2296
|
+
return Qt.map((o) => o.name);
|
|
2297
2297
|
}
|
|
2298
|
-
const
|
|
2298
|
+
const Ms = {
|
|
2299
2299
|
system: "System Fonts",
|
|
2300
2300
|
display: "Bold & Display",
|
|
2301
2301
|
"sans-serif": "Sans Serif",
|
|
@@ -2307,26 +2307,26 @@ const vs = {
|
|
|
2307
2307
|
decorative: "Decorative & Unique",
|
|
2308
2308
|
monospace: "Monospace"
|
|
2309
2309
|
};
|
|
2310
|
-
function
|
|
2310
|
+
function te(o) {
|
|
2311
2311
|
if (typeof window > "u" || typeof document > "u")
|
|
2312
2312
|
return "oklch(0% 0 0)";
|
|
2313
2313
|
const t = o || document.documentElement;
|
|
2314
2314
|
return getComputedStyle(t).getPropertyValue("--accent").trim() || "oklch(0% 0 0)";
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2316
|
+
function Ae(o) {
|
|
2317
2317
|
return typeof window > "u" || typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") || "light";
|
|
2318
2318
|
}
|
|
2319
|
-
function
|
|
2320
|
-
return
|
|
2319
|
+
function ee() {
|
|
2320
|
+
return Ae().includes("dark") ? "#60a5fa" : "#3b82f6";
|
|
2321
2321
|
}
|
|
2322
|
-
function
|
|
2322
|
+
function As(o) {
|
|
2323
2323
|
if (typeof window > "u" || typeof document > "u")
|
|
2324
2324
|
return "#FF0000";
|
|
2325
2325
|
const t = o || document.documentElement;
|
|
2326
2326
|
return getComputedStyle(t).getPropertyValue("--color-spacing-indicator").trim() || "#FF0000";
|
|
2327
2327
|
}
|
|
2328
|
-
function
|
|
2329
|
-
const e =
|
|
2328
|
+
function Is(o = 0.1, t) {
|
|
2329
|
+
const e = te(t);
|
|
2330
2330
|
if (e.startsWith("oklch("))
|
|
2331
2331
|
return `${e.slice(0, -1)} / ${o})`;
|
|
2332
2332
|
if (e.startsWith("#")) {
|
|
@@ -2335,71 +2335,71 @@ function Fs(o = 0.1, t) {
|
|
|
2335
2335
|
}
|
|
2336
2336
|
return e;
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2338
|
+
function Ds(o) {
|
|
2339
2339
|
if (typeof window > "u" || typeof document > "u")
|
|
2340
2340
|
return "oklch(0% 0 0 / 0.45)";
|
|
2341
2341
|
const t = o || document.documentElement;
|
|
2342
2342
|
return getComputedStyle(t).getPropertyValue("--color-text-selection").trim() || "oklch(0% 0 0 / 0.45)";
|
|
2343
2343
|
}
|
|
2344
|
-
function
|
|
2344
|
+
function ks(o) {
|
|
2345
2345
|
if (typeof window > "u" || typeof document > "u")
|
|
2346
2346
|
return "#b5f747";
|
|
2347
2347
|
const t = o || document.documentElement;
|
|
2348
2348
|
return getComputedStyle(t).getPropertyValue("--color-accent-hover").trim() || "#b5f747";
|
|
2349
2349
|
}
|
|
2350
|
-
function
|
|
2350
|
+
function Ie(o) {
|
|
2351
2351
|
if (typeof window > "u" || typeof document > "u")
|
|
2352
2352
|
return "oklch(0.2103 0.0059 285.89)";
|
|
2353
2353
|
const t = o || document.documentElement;
|
|
2354
2354
|
return getComputedStyle(t).getPropertyValue("--foreground").trim() || "oklch(0.2103 0.0059 285.89)";
|
|
2355
2355
|
}
|
|
2356
|
-
function
|
|
2356
|
+
function Es(o) {
|
|
2357
2357
|
if (typeof window > "u" || typeof document > "u")
|
|
2358
2358
|
return "oklch(0.9607 0 0)";
|
|
2359
2359
|
const t = o || document.documentElement;
|
|
2360
2360
|
return getComputedStyle(t).getPropertyValue("--background").trim() || "oklch(0.9607 0 0)";
|
|
2361
2361
|
}
|
|
2362
|
-
function
|
|
2363
|
-
const t =
|
|
2362
|
+
function Os(o) {
|
|
2363
|
+
const t = Ie(o);
|
|
2364
2364
|
return t.startsWith("oklch(") ? `${t.slice(0, -1)} / 0.2)` : "rgba(0,0,0,0.2)";
|
|
2365
2365
|
}
|
|
2366
|
-
function
|
|
2366
|
+
function Bs(o) {
|
|
2367
2367
|
if (typeof window > "u" || typeof document > "u")
|
|
2368
2368
|
return "oklch(0% 0 0 / 0.2)";
|
|
2369
2369
|
const t = document.documentElement;
|
|
2370
2370
|
return getComputedStyle(t).getPropertyValue("--divider").trim() || "oklch(0% 0 0 / 0.2)";
|
|
2371
2371
|
}
|
|
2372
|
-
function
|
|
2372
|
+
function Rs(o) {
|
|
2373
2373
|
if (typeof window > "u" || typeof document > "u")
|
|
2374
2374
|
return "oklch(0% 0 0 / 0.5)";
|
|
2375
2375
|
const t = document.documentElement, e = getComputedStyle(t).getPropertyValue("--foreground").trim();
|
|
2376
2376
|
return e.startsWith("oklch(") ? `${e.slice(0, -1)} / 0.5)` : e || "oklch(0% 0 0 / 0.5)";
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2378
|
+
function Hs(o) {
|
|
2379
2379
|
if (typeof window > "u" || typeof document > "u")
|
|
2380
2380
|
return "#b5f747";
|
|
2381
2381
|
const t = document.documentElement;
|
|
2382
2382
|
return getComputedStyle(t).getPropertyValue("--color-accent-hover-border").trim() || "#b5f747";
|
|
2383
2383
|
}
|
|
2384
|
-
function
|
|
2384
|
+
function Ps(o) {
|
|
2385
2385
|
if (typeof window > "u" || typeof document > "u")
|
|
2386
2386
|
return "oklch(0.2103 0.0059 285.89)";
|
|
2387
2387
|
const t = document.documentElement;
|
|
2388
2388
|
return getComputedStyle(t).getPropertyValue("--foreground").trim() || "oklch(0.2103 0.0059 285.89)";
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function Ls(o) {
|
|
2391
2391
|
if (typeof window > "u" || typeof document > "u")
|
|
2392
2392
|
return "oklch(1 0 0)";
|
|
2393
2393
|
const t = document.documentElement;
|
|
2394
2394
|
return getComputedStyle(t).getPropertyValue("--background").trim() || "oklch(1 0 0)";
|
|
2395
2395
|
}
|
|
2396
|
-
function
|
|
2396
|
+
function Ws(o) {
|
|
2397
2397
|
if (typeof window > "u" || typeof document > "u")
|
|
2398
2398
|
return "oklch(0.2103 0.0059 285.89 / 0.5)";
|
|
2399
2399
|
const t = document.documentElement, e = getComputedStyle(t).getPropertyValue("--foreground").trim();
|
|
2400
2400
|
return e.startsWith("oklch(") ? `${e.slice(0, -1)} / 0.5)` : e || "oklch(0.2103 0.0059 285.89 / 0.5)";
|
|
2401
2401
|
}
|
|
2402
|
-
const
|
|
2402
|
+
const Ns = 1, _s = "#ffffff", De = 20, Xs = 6, zs = 24, ke = 16, Ee = 36, Oe = 24, Ys = 4, Us = "#FFFFFF", Gs = 2, $s = 0.1, Vs = Me(), Js = [8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96, 128], Z = 0, se = 1.2, ie = 50, Be = 8, Re = 999, He = /* @__PURE__ */ new Set([
|
|
2403
2403
|
"Arial",
|
|
2404
2404
|
"Arial Black",
|
|
2405
2405
|
"Verdana",
|
|
@@ -2420,9 +2420,9 @@ const Ps = 1, Ls = "#ffffff", Ie = 20, Ws = 6, Ns = 24, De = 16, ke = 36, Ee = 2
|
|
|
2420
2420
|
"Monaco",
|
|
2421
2421
|
"Consolas",
|
|
2422
2422
|
"Courier"
|
|
2423
|
-
]),
|
|
2424
|
-
var
|
|
2425
|
-
class
|
|
2423
|
+
]), Pe = 0.3;
|
|
2424
|
+
var Le = /* @__PURE__ */ ((o) => (o[o.DEBUG = 0] = "DEBUG", o[o.INFO = 1] = "INFO", o[o.WARN = 2] = "WARN", o[o.ERROR = 3] = "ERROR", o[o.NONE = 4] = "NONE", o))(Le || {});
|
|
2425
|
+
class We {
|
|
2426
2426
|
constructor() {
|
|
2427
2427
|
var t;
|
|
2428
2428
|
this.level = 0, this.enabled = typeof mt < "u" && ((t = mt.env) == null ? void 0 : t.NODE_ENV) !== "production";
|
|
@@ -2479,10 +2479,10 @@ class Le {
|
|
|
2479
2479
|
* Create a scoped logger with a prefix for a specific module
|
|
2480
2480
|
*/
|
|
2481
2481
|
scope(t) {
|
|
2482
|
-
return new
|
|
2482
|
+
return new Ne(this, t);
|
|
2483
2483
|
}
|
|
2484
2484
|
}
|
|
2485
|
-
class
|
|
2485
|
+
class Ne {
|
|
2486
2486
|
constructor(t, e) {
|
|
2487
2487
|
this.logger = t, this.scopeName = e;
|
|
2488
2488
|
}
|
|
@@ -2499,8 +2499,8 @@ class We {
|
|
|
2499
2499
|
this.logger.error(`[${this.scopeName}] ${t}`, ...e);
|
|
2500
2500
|
}
|
|
2501
2501
|
}
|
|
2502
|
-
const
|
|
2503
|
-
function
|
|
2502
|
+
const _e = new We(), wt = (o) => _e.scope(o), oe = wt("ImageLoadEvents"), At = /* @__PURE__ */ new Set();
|
|
2503
|
+
function qs(o) {
|
|
2504
2504
|
return At.add(o), () => {
|
|
2505
2505
|
At.delete(o);
|
|
2506
2506
|
};
|
|
@@ -2510,22 +2510,22 @@ function st(o) {
|
|
|
2510
2510
|
try {
|
|
2511
2511
|
t(o);
|
|
2512
2512
|
} catch (e) {
|
|
2513
|
-
|
|
2513
|
+
oe.error("Listener error:", e);
|
|
2514
2514
|
}
|
|
2515
2515
|
});
|
|
2516
2516
|
}
|
|
2517
2517
|
const It = /* @__PURE__ */ new Set();
|
|
2518
|
-
function
|
|
2518
|
+
function js(o) {
|
|
2519
2519
|
return It.add(o), () => {
|
|
2520
2520
|
It.delete(o);
|
|
2521
2521
|
};
|
|
2522
2522
|
}
|
|
2523
|
-
function
|
|
2523
|
+
function Xe(o) {
|
|
2524
2524
|
It.forEach((t) => {
|
|
2525
2525
|
try {
|
|
2526
2526
|
t(o);
|
|
2527
2527
|
} catch (e) {
|
|
2528
|
-
|
|
2528
|
+
oe.error("Failure-listener error:", e);
|
|
2529
2529
|
}
|
|
2530
2530
|
});
|
|
2531
2531
|
}
|
|
@@ -2611,7 +2611,7 @@ class q {
|
|
|
2611
2611
|
this.cache.clear();
|
|
2612
2612
|
}
|
|
2613
2613
|
}
|
|
2614
|
-
const
|
|
2614
|
+
const Zs = Object.freeze({
|
|
2615
2615
|
brightness: 1,
|
|
2616
2616
|
contrast: 1,
|
|
2617
2617
|
saturation: 1
|
|
@@ -2619,7 +2619,7 @@ const Js = Object.freeze({
|
|
|
2619
2619
|
function Pt(o) {
|
|
2620
2620
|
return o ? Math.abs(o.brightness - 1) < Ct && Math.abs(o.contrast - 1) < Ct && Math.abs(o.saturation - 1) < Ct : !0;
|
|
2621
2621
|
}
|
|
2622
|
-
function
|
|
2622
|
+
function ze(o) {
|
|
2623
2623
|
if (Pt(o)) return;
|
|
2624
2624
|
const t = (e) => Math.round(e * 100) / 100;
|
|
2625
2625
|
return {
|
|
@@ -2628,16 +2628,16 @@ function Xe(o) {
|
|
|
2628
2628
|
saturation: t(o.saturation)
|
|
2629
2629
|
};
|
|
2630
2630
|
}
|
|
2631
|
-
function
|
|
2631
|
+
function Ks(o) {
|
|
2632
2632
|
if (Pt(o)) return "neutral";
|
|
2633
2633
|
const t = o;
|
|
2634
2634
|
return `b${t.brightness}c${t.contrast}s${t.saturation}`;
|
|
2635
2635
|
}
|
|
2636
2636
|
let Dt = null;
|
|
2637
|
-
function
|
|
2637
|
+
function Qs(o) {
|
|
2638
2638
|
Dt = o;
|
|
2639
2639
|
}
|
|
2640
|
-
function
|
|
2640
|
+
function Ye(o, t) {
|
|
2641
2641
|
if (Pt(t)) return o;
|
|
2642
2642
|
if (!Dt)
|
|
2643
2643
|
throw new Error(
|
|
@@ -2645,29 +2645,29 @@ function ze(o, t) {
|
|
|
2645
2645
|
);
|
|
2646
2646
|
return Dt(o, t);
|
|
2647
2647
|
}
|
|
2648
|
-
const kt = "frame",
|
|
2649
|
-
function
|
|
2648
|
+
const kt = "frame", re = Object.freeze({ cropX: 0, cropY: 0, cropWidth: 1, cropHeight: 1 });
|
|
2649
|
+
function Ue(o) {
|
|
2650
2650
|
return Math.abs(o.cropX ?? 0) < 1e-9 && Math.abs(o.cropY ?? 0) < 1e-9 && Math.abs((o.cropWidth ?? 1) - 1) < 1e-9 && Math.abs((o.cropHeight ?? 1) - 1) < 1e-9;
|
|
2651
2651
|
}
|
|
2652
2652
|
function Et(o, t) {
|
|
2653
2653
|
return t && (o == null ? void 0 : o.maskedCrop) !== kt;
|
|
2654
2654
|
}
|
|
2655
2655
|
function Ot(o, t) {
|
|
2656
|
-
return !o || Et(o, t) ? { ...
|
|
2656
|
+
return !o || Et(o, t) ? { ...re } : {
|
|
2657
2657
|
cropX: o.cropX ?? 0,
|
|
2658
2658
|
cropY: o.cropY ?? 0,
|
|
2659
2659
|
cropWidth: o.cropWidth ?? 1,
|
|
2660
2660
|
cropHeight: o.cropHeight ?? 1
|
|
2661
2661
|
};
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2663
|
+
function ti(o, t) {
|
|
2664
2664
|
const e = Ot(o, t);
|
|
2665
2665
|
return { width: ((o == null ? void 0 : o.width) ?? 0) * e.cropWidth, height: ((o == null ? void 0 : o.height) ?? 0) * e.cropHeight };
|
|
2666
2666
|
}
|
|
2667
|
-
function
|
|
2667
|
+
function ei(o) {
|
|
2668
2668
|
return Array.isArray(o == null ? void 0 : o.masks) && o.masks.length > 0;
|
|
2669
2669
|
}
|
|
2670
|
-
const it = wt("ImageElement"), zt = 3e4, vt = 3,
|
|
2670
|
+
const it = wt("ImageElement"), zt = 3e4, vt = 3, Ge = 1e3;
|
|
2671
2671
|
function S(o) {
|
|
2672
2672
|
return o.transformData;
|
|
2673
2673
|
}
|
|
@@ -2686,8 +2686,8 @@ class bt extends tt {
|
|
|
2686
2686
|
flipHorizontal: ((l = t.transformData) == null ? void 0 : l.flipHorizontal) ?? !1,
|
|
2687
2687
|
flipVertical: ((c = t.transformData) == null ? void 0 : c.flipVertical) ?? !1,
|
|
2688
2688
|
borderRadius: ((g = t.transformData) == null ? void 0 : g.borderRadius) ?? 0
|
|
2689
|
-
}, Et(t.transformData, this.hasMasks()) && Object.assign(this.transformData,
|
|
2690
|
-
const e =
|
|
2689
|
+
}, Et(t.transformData, this.hasMasks()) && Object.assign(this.transformData, re), this.transformData.maskedCrop = kt;
|
|
2690
|
+
const e = ze((d = t.transformData) == null ? void 0 : d.adjustments);
|
|
2691
2691
|
e && (this.transformData.adjustments = e), this.imageUrl = t.imageUrl || "", this.imageLoaded = !1, this.imageElement = null, this.imageAspectRatio = t.imageAspectRatio || 1, this.isSvg = ((u = t.imageUrl) == null ? void 0 : u.toLowerCase().endsWith(".svg")) || !1, this.preserveDimensions = t.preserveDimensions ?? !1, this.imageLoadState = t.imageUrl ? "loading" : "loaded", this.imageLoadError = null, this.isCropping = !1, this.onLoadCallback = t.onLoadCallback || null, this.imageUrl && this.loadImage(this.imageUrl);
|
|
2692
2692
|
}
|
|
2693
2693
|
/**
|
|
@@ -2745,7 +2745,7 @@ class bt extends tt {
|
|
|
2745
2745
|
*/
|
|
2746
2746
|
handleLoadFailure(t, e, s = "error") {
|
|
2747
2747
|
if (this.retryAttempt++, this.retryAttempt < vt) {
|
|
2748
|
-
const i =
|
|
2748
|
+
const i = Ge * Math.pow(2, this.retryAttempt - 1);
|
|
2749
2749
|
it.warn(`Image load attempt ${this.retryAttempt} failed, retrying in ${i}ms:`, t), this.imageLoadState = "retrying", this.imageLoadError = e, st(this.id), this.loadTimeoutId = setTimeout(() => {
|
|
2750
2750
|
this.attemptLoadRegularImage(t);
|
|
2751
2751
|
}, i);
|
|
@@ -2764,7 +2764,7 @@ class bt extends tt {
|
|
|
2764
2764
|
typeof fetch == "function" && i && (s = (await fetch(t, { method: "GET" })).status);
|
|
2765
2765
|
} catch {
|
|
2766
2766
|
}
|
|
2767
|
-
|
|
2767
|
+
Xe({
|
|
2768
2768
|
elementId: this.id,
|
|
2769
2769
|
url: t,
|
|
2770
2770
|
isProxied: t.includes("/api/image-proxy"),
|
|
@@ -2908,7 +2908,7 @@ class bt extends tt {
|
|
|
2908
2908
|
this.renderPlaceholder(t);
|
|
2909
2909
|
return;
|
|
2910
2910
|
}
|
|
2911
|
-
const i =
|
|
2911
|
+
const i = Ye(
|
|
2912
2912
|
this.imageElement,
|
|
2913
2913
|
this.transformData.adjustments
|
|
2914
2914
|
), r = i.width, h = i.height;
|
|
@@ -3017,8 +3017,8 @@ class bt extends tt {
|
|
|
3017
3017
|
if (this.isCropping) {
|
|
3018
3018
|
const k = i.x, M = i.y, E = S(i).cropWidth * S(i).width, R = S(i).cropHeight * S(i).height;
|
|
3019
3019
|
this.x = k, this.y = M;
|
|
3020
|
-
const H = E / this.transformData.width, O = R / this.transformData.height, W = k - A, N = M - U, _t = new P(this).worldDeltaToLocal(W, N),
|
|
3021
|
-
this.transformData.cropX =
|
|
3020
|
+
const H = E / this.transformData.width, O = R / this.transformData.height, W = k - A, N = M - U, _t = new P(this).worldDeltaToLocal(W, N), me = _t.dx, pe = _t.dy, ye = this.transformData.width / 2 + me, we = this.transformData.height / 2 + pe, be = ye / this.transformData.width - H / 2, xe = we / this.transformData.height - O / 2;
|
|
3021
|
+
this.transformData.cropX = be, this.transformData.cropY = xe, this.transformData.cropWidth = H, this.transformData.cropHeight = O;
|
|
3022
3022
|
} else {
|
|
3023
3023
|
const k = (this.transformData.cropX + this.transformData.cropWidth / 2) * this.transformData.width - this.transformData.width / 2, M = (this.transformData.cropY + this.transformData.cropHeight / 2) * this.transformData.height - this.transformData.height / 2, E = k, R = M, O = new P(this).localDeltaToWorld(E, R), W = O.dx, N = O.dy;
|
|
3024
3024
|
this.x = A + W, this.y = U + N;
|
|
@@ -3073,7 +3073,7 @@ class bt extends tt {
|
|
|
3073
3073
|
*/
|
|
3074
3074
|
setPhotoZoom(t) {
|
|
3075
3075
|
const e = this.transformData, s = Ot(e, this.hasMasks());
|
|
3076
|
-
if (
|
|
3076
|
+
if (Ue(s) && !(t > 1)) return;
|
|
3077
3077
|
const i = e.width * s.cropWidth, r = e.height * s.cropHeight;
|
|
3078
3078
|
if (!(i > 0) || !(r > 0) || !(e.width > 0) || !(e.height > 0)) return;
|
|
3079
3079
|
const h = e.width / e.height, a = Math.max(i, r * h), n = Math.min(10, Math.max(1, Number.isFinite(t) ? t : 1)), l = a * n, c = l / h, g = Math.min(1, i / l), d = Math.min(1, r / c), u = s.cropX + s.cropWidth / 2, f = s.cropY + s.cropHeight / 2;
|
|
@@ -3154,7 +3154,7 @@ class bt extends tt {
|
|
|
3154
3154
|
if (!this.isCropping || this.isFrameLockedInCrop()) return null;
|
|
3155
3155
|
const i = this.getCropBoxBounds();
|
|
3156
3156
|
if (!i) return null;
|
|
3157
|
-
const r = this.worldToLocal(t, e), h = 1 / s, a =
|
|
3157
|
+
const r = this.worldToLocal(t, e), h = 1 / s, a = ke * h, n = Ee * h, l = Oe * h, c = [
|
|
3158
3158
|
{ x: i.x, y: i.y, anchor: "top-left" },
|
|
3159
3159
|
{ x: i.x + i.width, y: i.y, anchor: "top-right" },
|
|
3160
3160
|
{ x: i.x, y: i.y + i.height, anchor: "bottom-left" },
|
|
@@ -3385,29 +3385,29 @@ class bt extends tt {
|
|
|
3385
3385
|
this.clearLoadTimeout(), this.releaseImageCache(), this.revokeSvgBlobUrl(), this.imageElement = null, this.onLoadCallback = null, this.imageLoadError = null;
|
|
3386
3386
|
}
|
|
3387
3387
|
}
|
|
3388
|
-
const
|
|
3388
|
+
const ne = /* @__PURE__ */ new Map();
|
|
3389
3389
|
let Bt = null;
|
|
3390
|
-
function
|
|
3390
|
+
function ae(o) {
|
|
3391
3391
|
return new Error(
|
|
3392
3392
|
`[paint-registry] no painter registered for ${o}. Element painting requires the rendering engine: import 'src/rendering/element-painters.js' (every paint driver — CanvasRenderer, ExportManager, ElementPreviewRenderer — does this; a direct element.render() call in a test must import it too).`
|
|
3393
3393
|
);
|
|
3394
3394
|
}
|
|
3395
|
-
function
|
|
3396
|
-
|
|
3395
|
+
function si(o, t) {
|
|
3396
|
+
ne.set(o, t);
|
|
3397
3397
|
}
|
|
3398
3398
|
function ut(o) {
|
|
3399
|
-
const t =
|
|
3400
|
-
if (!t) throw
|
|
3399
|
+
const t = ne.get(o);
|
|
3400
|
+
if (!t) throw ae(`text transform "${o}"`);
|
|
3401
3401
|
return t;
|
|
3402
3402
|
}
|
|
3403
|
-
function
|
|
3403
|
+
function ii(o) {
|
|
3404
3404
|
Bt = o;
|
|
3405
3405
|
}
|
|
3406
|
-
function
|
|
3407
|
-
if (!Bt) throw
|
|
3406
|
+
function $e() {
|
|
3407
|
+
if (!Bt) throw ae("group clipping");
|
|
3408
3408
|
return Bt;
|
|
3409
3409
|
}
|
|
3410
|
-
const
|
|
3410
|
+
const Ve = [
|
|
3411
3411
|
"multiply",
|
|
3412
3412
|
"screen",
|
|
3413
3413
|
"overlay",
|
|
@@ -3610,68 +3610,68 @@ class L {
|
|
|
3610
3610
|
return new L(t.spans);
|
|
3611
3611
|
}
|
|
3612
3612
|
}
|
|
3613
|
-
function
|
|
3613
|
+
function oi(o) {
|
|
3614
3614
|
return o.type === "custom";
|
|
3615
3615
|
}
|
|
3616
|
-
function
|
|
3616
|
+
function ri(o) {
|
|
3617
3617
|
return o.type === "circle";
|
|
3618
3618
|
}
|
|
3619
|
-
function
|
|
3619
|
+
function ni(o) {
|
|
3620
3620
|
return o.type === "arch";
|
|
3621
3621
|
}
|
|
3622
|
-
function
|
|
3622
|
+
function ai(o) {
|
|
3623
3623
|
return o.type === "wave";
|
|
3624
3624
|
}
|
|
3625
|
-
function
|
|
3625
|
+
function hi(o) {
|
|
3626
3626
|
return o.type === "flag";
|
|
3627
3627
|
}
|
|
3628
|
-
function
|
|
3628
|
+
function li(o) {
|
|
3629
3629
|
return o.type === "image";
|
|
3630
3630
|
}
|
|
3631
|
-
function
|
|
3631
|
+
function ci(o) {
|
|
3632
3632
|
return o.type === "group";
|
|
3633
3633
|
}
|
|
3634
|
-
function
|
|
3634
|
+
function di(o) {
|
|
3635
3635
|
return o.transformType !== "image" && o.transformType !== "group";
|
|
3636
3636
|
}
|
|
3637
|
-
function
|
|
3637
|
+
function gi(o) {
|
|
3638
3638
|
return o.transformType === "image";
|
|
3639
3639
|
}
|
|
3640
|
-
function
|
|
3640
|
+
function fi(o) {
|
|
3641
3641
|
return o.transformType === "custom";
|
|
3642
3642
|
}
|
|
3643
|
-
function
|
|
3643
|
+
function ui(o) {
|
|
3644
3644
|
return o.transformType === "circle";
|
|
3645
3645
|
}
|
|
3646
|
-
function
|
|
3646
|
+
function mi(o) {
|
|
3647
3647
|
return o.transformType === "group";
|
|
3648
3648
|
}
|
|
3649
|
-
function
|
|
3649
|
+
function pi(o) {
|
|
3650
3650
|
return o.transformType === "shape";
|
|
3651
3651
|
}
|
|
3652
|
-
function
|
|
3652
|
+
function yi(o) {
|
|
3653
3653
|
return o.transformType === "path";
|
|
3654
3654
|
}
|
|
3655
|
-
function
|
|
3655
|
+
function wi(o) {
|
|
3656
3656
|
return o.type === "shape";
|
|
3657
3657
|
}
|
|
3658
|
-
function
|
|
3658
|
+
function bi(o) {
|
|
3659
3659
|
return o.type === "path";
|
|
3660
3660
|
}
|
|
3661
|
-
function
|
|
3661
|
+
function xi(o) {
|
|
3662
3662
|
var t;
|
|
3663
3663
|
return ((t = o.stroke) == null ? void 0 : t.enabled) === !0;
|
|
3664
3664
|
}
|
|
3665
|
-
function
|
|
3665
|
+
function Si(o) {
|
|
3666
3666
|
return Array.isArray(o.masks) && o.masks.length > 0;
|
|
3667
3667
|
}
|
|
3668
|
-
function
|
|
3668
|
+
function Ci(o) {
|
|
3669
3669
|
return o.blendMode === "knockout" || o.blendMode === "clip";
|
|
3670
3670
|
}
|
|
3671
|
-
function
|
|
3672
|
-
return
|
|
3671
|
+
function vi(o) {
|
|
3672
|
+
return Ve.includes(o);
|
|
3673
3673
|
}
|
|
3674
|
-
function
|
|
3674
|
+
function Ti(o) {
|
|
3675
3675
|
var t;
|
|
3676
3676
|
return ((t = o.distressEffect) == null ? void 0 : t.enabled) === !0;
|
|
3677
3677
|
}
|
|
@@ -3783,7 +3783,7 @@ class j extends tt {
|
|
|
3783
3783
|
* Update font size
|
|
3784
3784
|
*/
|
|
3785
3785
|
setFontSize(t) {
|
|
3786
|
-
this.fontSize = Math.max(
|
|
3786
|
+
this.fontSize = Math.max(Be, Math.min(Re, t));
|
|
3787
3787
|
}
|
|
3788
3788
|
/**
|
|
3789
3789
|
* Update color
|
|
@@ -3817,20 +3817,20 @@ class j extends tt {
|
|
|
3817
3817
|
};
|
|
3818
3818
|
}
|
|
3819
3819
|
}
|
|
3820
|
-
function
|
|
3820
|
+
function Je(o) {
|
|
3821
3821
|
return Array.from(o).length;
|
|
3822
3822
|
}
|
|
3823
3823
|
function xt(o, t, e) {
|
|
3824
|
-
return e ? o + e *
|
|
3824
|
+
return e ? o + e * Je(t) : o;
|
|
3825
3825
|
}
|
|
3826
|
-
function
|
|
3826
|
+
function qe(o, t, e) {
|
|
3827
3827
|
const s = Array.from(t), i = [0];
|
|
3828
3828
|
let r = "";
|
|
3829
3829
|
for (let h = 0; h < s.length; h++)
|
|
3830
3830
|
r += s[h], i.push(o.measureText(r).width + e * (h + 1));
|
|
3831
3831
|
return i;
|
|
3832
3832
|
}
|
|
3833
|
-
function
|
|
3833
|
+
function je(o, t, e) {
|
|
3834
3834
|
switch (o.textAlign) {
|
|
3835
3835
|
case "center":
|
|
3836
3836
|
return t - e / 2;
|
|
@@ -3841,23 +3841,23 @@ function qe(o, t, e) {
|
|
|
3841
3841
|
return t;
|
|
3842
3842
|
}
|
|
3843
3843
|
}
|
|
3844
|
-
function
|
|
3844
|
+
function he(o, t, e, s, i, r) {
|
|
3845
3845
|
if (!r || e.length === 0) {
|
|
3846
3846
|
t[o](e, s, i);
|
|
3847
3847
|
return;
|
|
3848
3848
|
}
|
|
3849
|
-
const h =
|
|
3849
|
+
const h = qe(t, e, r), a = h[h.length - 1], n = je(t, s, a), l = t.textAlign;
|
|
3850
3850
|
t.textAlign = "left";
|
|
3851
3851
|
const c = Array.from(e);
|
|
3852
3852
|
for (let g = 0; g < c.length; g++)
|
|
3853
3853
|
t[o](c[g], n + h[g], i);
|
|
3854
3854
|
t.textAlign = l;
|
|
3855
3855
|
}
|
|
3856
|
-
function
|
|
3857
|
-
|
|
3856
|
+
function Fi(o, t, e, s, i) {
|
|
3857
|
+
he("fillText", o, t, e, s, i);
|
|
3858
3858
|
}
|
|
3859
|
-
function
|
|
3860
|
-
|
|
3859
|
+
function Mi(o, t, e, s, i) {
|
|
3860
|
+
he("strokeText", o, t, e, s, i);
|
|
3861
3861
|
}
|
|
3862
3862
|
let lt = null;
|
|
3863
3863
|
function St() {
|
|
@@ -3975,7 +3975,7 @@ function Ut(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
|
|
|
3975
3975
|
}
|
|
3976
3976
|
});
|
|
3977
3977
|
let w;
|
|
3978
|
-
const b = (n == null ? void 0 : n.lineHeight) ??
|
|
3978
|
+
const b = (n == null ? void 0 : n.lineHeight) ?? se;
|
|
3979
3979
|
if (p === 1)
|
|
3980
3980
|
w = y.height;
|
|
3981
3981
|
else if (p === 0)
|
|
@@ -3991,7 +3991,7 @@ function Ut(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
|
|
|
3991
3991
|
};
|
|
3992
3992
|
}
|
|
3993
3993
|
let ct = null;
|
|
3994
|
-
function
|
|
3994
|
+
function Ze() {
|
|
3995
3995
|
if (!ct)
|
|
3996
3996
|
if (typeof OffscreenCanvas < "u")
|
|
3997
3997
|
ct = new OffscreenCanvas(1, 1).getContext("2d");
|
|
@@ -4001,8 +4001,8 @@ function je() {
|
|
|
4001
4001
|
throw new Error("No canvas context available");
|
|
4002
4002
|
return ct;
|
|
4003
4003
|
}
|
|
4004
|
-
function
|
|
4005
|
-
const s =
|
|
4004
|
+
function Ke(o, t, e) {
|
|
4005
|
+
const s = Ze(), i = [], r = t + Rt(t), h = (p, w) => {
|
|
4006
4006
|
const b = w.fontSize || e.fontSize, x = w.fontFamily || e.fontFamily, T = w.bold !== void 0 ? w.bold : e.bold || !1, I = w.italic !== void 0 ? w.italic : e.italic || !1, C = w.letterSpacing !== void 0 ? w.letterSpacing : e.letterSpacing ?? 0;
|
|
4007
4007
|
return s.font = ht(b, x, T, I), xt(s.measureText(p).width, p, C);
|
|
4008
4008
|
}, a = (p, w) => p.fontSize === w.fontSize && p.fontFamily === w.fontFamily && p.color === w.color && p.bold === w.bold && p.italic === w.italic && p.underline === w.underline && p.strikethrough === w.strikethrough && p.letterSpacing === w.letterSpacing, n = [];
|
|
@@ -4079,7 +4079,7 @@ function Ze(o, t, e) {
|
|
|
4079
4079
|
}), m += I;
|
|
4080
4080
|
}), y(), i.length === 0 && i.push([]), i;
|
|
4081
4081
|
}
|
|
4082
|
-
function
|
|
4082
|
+
function Qe(o) {
|
|
4083
4083
|
const t = [];
|
|
4084
4084
|
let e = [];
|
|
4085
4085
|
return o.spans.forEach((s) => {
|
|
@@ -4093,10 +4093,10 @@ function Ke(o) {
|
|
|
4093
4093
|
function ot(o) {
|
|
4094
4094
|
return typeof o.width == "number" ? o.width : void 0;
|
|
4095
4095
|
}
|
|
4096
|
-
function
|
|
4096
|
+
function le(o, t) {
|
|
4097
4097
|
o.width = t;
|
|
4098
4098
|
}
|
|
4099
|
-
function
|
|
4099
|
+
function ts(o, t, e) {
|
|
4100
4100
|
const s = e.transformData, i = ot(s), r = i !== void 0 ? i : e.width ?? 0, h = t / r, a = e.fontSize ?? o.fontSize, n = a * h;
|
|
4101
4101
|
let l;
|
|
4102
4102
|
if (n < 16 ? l = Math.round(n) : l = Math.round(n * 2) / 2, o.setFontSize(l), e.richText && e.richText instanceof L && typeof o.setRichText == "function") {
|
|
@@ -4111,30 +4111,30 @@ function Qe(o, t, e) {
|
|
|
4111
4111
|
const c = o.transformData;
|
|
4112
4112
|
if (ot(c) !== void 0 && i !== void 0) {
|
|
4113
4113
|
const d = a > 0 ? l / a : h, u = i * d;
|
|
4114
|
-
|
|
4114
|
+
le(c, Math.max(20, Math.ceil(u)));
|
|
4115
4115
|
}
|
|
4116
4116
|
}
|
|
4117
|
-
function
|
|
4117
|
+
function es(o, t, e, s) {
|
|
4118
4118
|
if (t !== "middle-left" && t !== "middle-right")
|
|
4119
4119
|
return;
|
|
4120
4120
|
o.fontSize = s.fontSize ?? o.fontSize;
|
|
4121
4121
|
const i = o.transformData;
|
|
4122
4122
|
if (ot(i) !== void 0) {
|
|
4123
|
-
|
|
4123
|
+
le(i, Math.max(ie, e));
|
|
4124
4124
|
const h = D.toRadiansInverse(o.rotation), a = Math.cos(h), n = Math.sin(h), l = s.transformData, g = ot(l) ?? s.width ?? 0, u = (ot(i) ?? 0) - g;
|
|
4125
4125
|
t === "middle-left" ? (o.x = s.x - u / 2 * a, o.y = s.y - u / 2 * n) : t === "middle-right" && (o.x = s.x + u / 2 * a, o.y = s.y + u / 2 * n);
|
|
4126
4126
|
}
|
|
4127
4127
|
}
|
|
4128
|
-
function
|
|
4128
|
+
function ce(o, t, e, s, i) {
|
|
4129
4129
|
const r = t.includes("top") || t.includes("bottom"), h = t.includes("middle");
|
|
4130
|
-
r ?
|
|
4130
|
+
r ? ts(o, e, i) : h && es(o, t, e, i);
|
|
4131
4131
|
}
|
|
4132
|
-
class
|
|
4132
|
+
class ss extends j {
|
|
4133
4133
|
// Temporary property used during resize operations only
|
|
4134
4134
|
constructor(t = {}) {
|
|
4135
4135
|
super(t), this.transformType = "custom";
|
|
4136
4136
|
const e = t.transformData, s = (e == null ? void 0 : e.width) !== void 0 ? e.width : Math.max(
|
|
4137
|
-
|
|
4137
|
+
ie,
|
|
4138
4138
|
Yt(this.text, this.fontSize, this.fontFamily, this.bold, this.italic, this.letterSpacing ?? 0) + Z * 2
|
|
4139
4139
|
);
|
|
4140
4140
|
this.transformData = {
|
|
@@ -4148,9 +4148,9 @@ class es extends j {
|
|
|
4148
4148
|
* Returns the total height based on the tallest font in each line
|
|
4149
4149
|
*/
|
|
4150
4150
|
calculateRichTextHeight() {
|
|
4151
|
-
const t = this.getRichText(), e = this.transformData.width - Z * 2, s =
|
|
4151
|
+
const t = this.getRichText(), e = this.transformData.width - Z * 2, s = Qe(t), i = [];
|
|
4152
4152
|
if (s.forEach((n) => {
|
|
4153
|
-
|
|
4153
|
+
Ke(n, e, {
|
|
4154
4154
|
fontSize: this.fontSize,
|
|
4155
4155
|
fontFamily: this.fontFamily,
|
|
4156
4156
|
bold: this.bold,
|
|
@@ -4168,7 +4168,7 @@ class es extends j {
|
|
|
4168
4168
|
r = Math.max(r, f.height), h = Math.max(h, f.ascent);
|
|
4169
4169
|
});
|
|
4170
4170
|
});
|
|
4171
|
-
const a = this.fontSize * (this.lineHeight ??
|
|
4171
|
+
const a = this.fontSize * (this.lineHeight ?? se);
|
|
4172
4172
|
if (i.length === 1)
|
|
4173
4173
|
return r;
|
|
4174
4174
|
{
|
|
@@ -4299,7 +4299,7 @@ class es extends j {
|
|
|
4299
4299
|
* Side handles: only width changes - text re-wraps naturally
|
|
4300
4300
|
*/
|
|
4301
4301
|
resize(t, e, s, i) {
|
|
4302
|
-
if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0),
|
|
4302
|
+
if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0), ce(this, t, e, s, i), this._lockedLineCount !== void 0 && this._lockedLineCount > 0) {
|
|
4303
4303
|
const a = Yt(
|
|
4304
4304
|
this.text,
|
|
4305
4305
|
this.fontSize,
|
|
@@ -4352,7 +4352,7 @@ class es extends j {
|
|
|
4352
4352
|
};
|
|
4353
4353
|
}
|
|
4354
4354
|
}
|
|
4355
|
-
function
|
|
4355
|
+
function is(o, t, e, s) {
|
|
4356
4356
|
const i = D.toRadians(s), r = Math.cos(i), h = Math.sin(i);
|
|
4357
4357
|
let a = 0, n = 0;
|
|
4358
4358
|
e === "top-left" ? (a = o.width, n = o.height) : e === "top-right" ? (a = 0, n = o.height) : e === "bottom-left" ? (a = o.width, n = 0) : e === "bottom-right" && (a = 0, n = 0);
|
|
@@ -4362,14 +4362,14 @@ function ss(o, t, e, s) {
|
|
|
4362
4362
|
const u = l - (g * r - d * h), f = c - (g * h + d * r);
|
|
4363
4363
|
return { x: u, y: f };
|
|
4364
4364
|
}
|
|
4365
|
-
function
|
|
4366
|
-
const i = o.width / 2, r = o.height +
|
|
4365
|
+
function Ai(o, t, e, s = 1) {
|
|
4366
|
+
const i = o.width / 2, r = o.height + De / s, h = o.x + i, a = o.y + r, n = D.toRadians(t), l = Math.cos(n), c = Math.sin(n), g = h - e.x, d = a - e.y, u = g * l - d * c, f = g * c + d * l;
|
|
4367
4367
|
return {
|
|
4368
4368
|
x: e.x + u,
|
|
4369
4369
|
y: e.y + f
|
|
4370
4370
|
};
|
|
4371
4371
|
}
|
|
4372
|
-
function
|
|
4372
|
+
function Ii(o, t, e) {
|
|
4373
4373
|
const s = D.toRadians(t), i = Math.cos(s), r = Math.sin(s), h = (c, g) => {
|
|
4374
4374
|
const d = o.x + c, u = o.y + g, f = d - e.x, m = u - e.y, y = f * i - m * r, p = f * r + m * i;
|
|
4375
4375
|
return {
|
|
@@ -4377,7 +4377,7 @@ function Fi(o, t, e) {
|
|
|
4377
4377
|
y: e.y + p
|
|
4378
4378
|
};
|
|
4379
4379
|
}, { width: a, height: n } = o, l = (c, g, d, u) => {
|
|
4380
|
-
const f = h(d, u), m =
|
|
4380
|
+
const f = h(d, u), m = os(
|
|
4381
4381
|
f.x,
|
|
4382
4382
|
f.y,
|
|
4383
4383
|
e.x,
|
|
@@ -4406,11 +4406,11 @@ function Fi(o, t, e) {
|
|
|
4406
4406
|
l("edge", "middle-bottom", a / 2, n)
|
|
4407
4407
|
];
|
|
4408
4408
|
}
|
|
4409
|
-
function
|
|
4409
|
+
function Di(o, t, e, s, i) {
|
|
4410
4410
|
const r = o - e, h = t - s;
|
|
4411
4411
|
return r * r + h * h <= i * i;
|
|
4412
4412
|
}
|
|
4413
|
-
function
|
|
4413
|
+
function ki(o, t, e, s) {
|
|
4414
4414
|
const i = D.toRadiansInverse(s), r = Math.cos(i), h = Math.sin(i), a = o - e.x, n = t - e.y, l = a * r - n * h, c = a * h + n * r;
|
|
4415
4415
|
return l >= 0 && l <= e.width && c >= 0 && c <= e.height;
|
|
4416
4416
|
}
|
|
@@ -4418,19 +4418,19 @@ function et(o, t, e = "Arial", s = !1, i = !1) {
|
|
|
4418
4418
|
const h = document.createElement("canvas").getContext("2d"), a = s ? "bold" : "normal", n = i ? "italic" : "normal";
|
|
4419
4419
|
return h.font = `${n} ${a} ${t}px ${e}`, h.measureText(o).width;
|
|
4420
4420
|
}
|
|
4421
|
-
function
|
|
4421
|
+
function Ei(o) {
|
|
4422
4422
|
return {
|
|
4423
4423
|
x: o.x + o.width / 2,
|
|
4424
4424
|
y: o.y + o.height / 2
|
|
4425
4425
|
};
|
|
4426
4426
|
}
|
|
4427
|
-
function
|
|
4427
|
+
function Oi(o, t, e, s) {
|
|
4428
4428
|
return Math.atan2(s - t, e - o);
|
|
4429
4429
|
}
|
|
4430
|
-
function
|
|
4430
|
+
function Bi(o, t, e) {
|
|
4431
4431
|
return Math.abs(o - t) <= e;
|
|
4432
4432
|
}
|
|
4433
|
-
function
|
|
4433
|
+
function os(o, t, e, s, i, r = 0, h = "") {
|
|
4434
4434
|
const a = o - e, n = t - s;
|
|
4435
4435
|
let l = Math.atan2(n, a) * (180 / Math.PI);
|
|
4436
4436
|
if (l = (l % 360 + 360) % 360, i === "corner") {
|
|
@@ -4447,17 +4447,17 @@ function is(o, t, e, s, i, r = 0, h = "") {
|
|
|
4447
4447
|
return c >= 45 && c < 135 ? "ns-resize" : "ew-resize";
|
|
4448
4448
|
}
|
|
4449
4449
|
}
|
|
4450
|
-
function
|
|
4450
|
+
function rs(o) {
|
|
4451
4451
|
if (!o.getTransform)
|
|
4452
4452
|
return 1;
|
|
4453
4453
|
const t = o.getTransform();
|
|
4454
4454
|
return Math.sqrt(t.a * t.a + t.b * t.b);
|
|
4455
4455
|
}
|
|
4456
|
-
function
|
|
4457
|
-
const s =
|
|
4456
|
+
function Ri(o, t, e = []) {
|
|
4457
|
+
const s = rs(o);
|
|
4458
4458
|
o.lineWidth = s > 0 ? t / s : t, e.length > 0 && o.setLineDash(s > 0 ? e.map((i) => i / s) : e);
|
|
4459
4459
|
}
|
|
4460
|
-
class
|
|
4460
|
+
class ns extends j {
|
|
4461
4461
|
constructor(t = {}) {
|
|
4462
4462
|
super(t), this.transformType = "circle";
|
|
4463
4463
|
const e = t.transformData;
|
|
@@ -4513,7 +4513,7 @@ class rs extends j {
|
|
|
4513
4513
|
resize(t, e, s, i) {
|
|
4514
4514
|
const r = i.transformData, h = (e + s) / 2, a = (i.width + i.height) / 2, n = h / a, l = r.scale * n, c = Math.max(0.1, Math.min(10, l));
|
|
4515
4515
|
this.transformData.scale = c;
|
|
4516
|
-
const g = this.getBoundingBox(), d =
|
|
4516
|
+
const g = this.getBoundingBox(), d = is(
|
|
4517
4517
|
{
|
|
4518
4518
|
x: i.x - r.radius * r.scale,
|
|
4519
4519
|
y: i.y - r.radius * r.scale,
|
|
@@ -4587,7 +4587,7 @@ class rs extends j {
|
|
|
4587
4587
|
};
|
|
4588
4588
|
}
|
|
4589
4589
|
}
|
|
4590
|
-
class
|
|
4590
|
+
class as extends j {
|
|
4591
4591
|
constructor(t = {}) {
|
|
4592
4592
|
super(t), this.transformType = "arch";
|
|
4593
4593
|
const e = t.transformData;
|
|
@@ -4692,14 +4692,14 @@ const rt = {
|
|
|
4692
4692
|
frequency: 2,
|
|
4693
4693
|
// Standard flag frequency
|
|
4694
4694
|
width: 200
|
|
4695
|
-
}, as = {
|
|
4696
|
-
archHeight: 0.5
|
|
4697
4695
|
}, hs = {
|
|
4698
|
-
|
|
4696
|
+
archHeight: 0.5
|
|
4699
4697
|
}, ls = {
|
|
4698
|
+
leanAmount: 0
|
|
4699
|
+
}, cs = {
|
|
4700
4700
|
ascendAngle: -15
|
|
4701
4701
|
};
|
|
4702
|
-
class
|
|
4702
|
+
class ds extends j {
|
|
4703
4703
|
constructor(t = {}) {
|
|
4704
4704
|
super(t), this.transformType = "wave";
|
|
4705
4705
|
const e = t.transformData;
|
|
@@ -4734,7 +4734,7 @@ class cs extends j {
|
|
|
4734
4734
|
{ x: f / 2, y: r }
|
|
4735
4735
|
// bottom-right
|
|
4736
4736
|
].forEach((x) => {
|
|
4737
|
-
const T = x.x, I = x.y + w *
|
|
4737
|
+
const T = x.x, I = x.y + w * Pe * x.x, C = m + T, F = p + I;
|
|
4738
4738
|
h = Math.min(h, C), a = Math.max(a, C), n = Math.min(n, F), l = Math.max(l, F);
|
|
4739
4739
|
}), c += f;
|
|
4740
4740
|
});
|
|
@@ -4747,7 +4747,7 @@ class cs extends j {
|
|
|
4747
4747
|
};
|
|
4748
4748
|
}
|
|
4749
4749
|
resize(t, e, s, i) {
|
|
4750
|
-
|
|
4750
|
+
ce(this, t, e, s, i);
|
|
4751
4751
|
}
|
|
4752
4752
|
getEnabledAnchors() {
|
|
4753
4753
|
return ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
@@ -4768,7 +4768,7 @@ class cs extends j {
|
|
|
4768
4768
|
};
|
|
4769
4769
|
}
|
|
4770
4770
|
}
|
|
4771
|
-
class
|
|
4771
|
+
class gs extends j {
|
|
4772
4772
|
constructor(t = {}) {
|
|
4773
4773
|
super(t), this.transformType = "flag";
|
|
4774
4774
|
const e = t.transformData;
|
|
@@ -4864,7 +4864,7 @@ class ds extends j {
|
|
|
4864
4864
|
};
|
|
4865
4865
|
}
|
|
4866
4866
|
}
|
|
4867
|
-
class
|
|
4867
|
+
class fs extends j {
|
|
4868
4868
|
constructor(t = {}) {
|
|
4869
4869
|
super(t), this.transformType = "lean";
|
|
4870
4870
|
const e = t.transformData;
|
|
@@ -4954,7 +4954,7 @@ class gs extends j {
|
|
|
4954
4954
|
};
|
|
4955
4955
|
}
|
|
4956
4956
|
}
|
|
4957
|
-
class
|
|
4957
|
+
class us extends j {
|
|
4958
4958
|
constructor(t = {}) {
|
|
4959
4959
|
super(t), this.transformType = "ascend";
|
|
4960
4960
|
const e = t.transformData;
|
|
@@ -5047,23 +5047,23 @@ class fs extends j {
|
|
|
5047
5047
|
};
|
|
5048
5048
|
}
|
|
5049
5049
|
}
|
|
5050
|
-
class
|
|
5050
|
+
class ms extends Error {
|
|
5051
5051
|
constructor(t, e, s = {}) {
|
|
5052
5052
|
super(`[Editor] ${t}: ${e}`), this.name = "EditorError", this.code = t, this.data = { code: t, ...s };
|
|
5053
5053
|
}
|
|
5054
5054
|
}
|
|
5055
|
-
function
|
|
5055
|
+
function Hi(o) {
|
|
5056
5056
|
return o instanceof Error && o.name === "EditorError" && "code" in o;
|
|
5057
5057
|
}
|
|
5058
|
-
function
|
|
5058
|
+
function Pi() {
|
|
5059
5059
|
var o;
|
|
5060
5060
|
return typeof mt < "u" && ((o = mt.env) == null ? void 0 : o.NODE_ENV) !== "production";
|
|
5061
5061
|
}
|
|
5062
|
-
const
|
|
5062
|
+
const de = "#3b82f6", Gt = ["solid", "linear", "radial"];
|
|
5063
5063
|
function V(o, t) {
|
|
5064
|
-
return new
|
|
5064
|
+
return new ms("E_INVALID_FILL", o, t);
|
|
5065
5065
|
}
|
|
5066
|
-
function
|
|
5066
|
+
function ps(o) {
|
|
5067
5067
|
if (typeof o != "object" || o === null)
|
|
5068
5068
|
throw V(
|
|
5069
5069
|
`shape fill must be an object ({ type: "solid" | "linear" | "radial", ... }), got ${JSON.stringify(o)}.`,
|
|
@@ -5119,7 +5119,7 @@ function Vt(o, t) {
|
|
|
5119
5119
|
}
|
|
5120
5120
|
function dt(o, t) {
|
|
5121
5121
|
const { fill: e } = t;
|
|
5122
|
-
if (!e) return t.fillColor ||
|
|
5122
|
+
if (!e) return t.fillColor || de;
|
|
5123
5123
|
if (e.type === "solid") return e.color;
|
|
5124
5124
|
const s = t.width ?? 100, i = t.height ?? 100;
|
|
5125
5125
|
if (e.type === "linear") {
|
|
@@ -5132,8 +5132,8 @@ function dt(o, t) {
|
|
|
5132
5132
|
const r = Math.sqrt(s * s + i * i) / 2;
|
|
5133
5133
|
return Vt(o.createRadialGradient(0, 0, 0, 0, 0, r), e.stops);
|
|
5134
5134
|
}
|
|
5135
|
-
function
|
|
5136
|
-
if (!o) return t ||
|
|
5135
|
+
function Li(o, t) {
|
|
5136
|
+
if (!o) return t || de;
|
|
5137
5137
|
switch (o.type) {
|
|
5138
5138
|
case "solid":
|
|
5139
5139
|
return o.color;
|
|
@@ -5148,7 +5148,7 @@ class Wt extends tt {
|
|
|
5148
5148
|
var i, r, h, a, n, l, c, g, d, u, f, m;
|
|
5149
5149
|
super(t), this.transformType = "shape";
|
|
5150
5150
|
const e = (i = t.transformData) == null ? void 0 : i.fill;
|
|
5151
|
-
e !== void 0 &&
|
|
5151
|
+
e !== void 0 && ps(e);
|
|
5152
5152
|
const s = "rectangle";
|
|
5153
5153
|
this.transformData = {
|
|
5154
5154
|
type: "shape",
|
|
@@ -5162,7 +5162,7 @@ class Wt extends tt {
|
|
|
5162
5162
|
sides: ((g = t.transformData) == null ? void 0 : g.sides) ?? 5,
|
|
5163
5163
|
points: ((d = t.transformData) == null ? void 0 : d.points) ?? 5,
|
|
5164
5164
|
innerRadius: ((u = t.transformData) == null ? void 0 : u.innerRadius) ?? 0.4,
|
|
5165
|
-
fillColor: ((f = t.transformData) == null ? void 0 : f.fillColor) ||
|
|
5165
|
+
fillColor: ((f = t.transformData) == null ? void 0 : f.fillColor) || ee(),
|
|
5166
5166
|
fillOpacity: ((m = t.transformData) == null ? void 0 : m.fillOpacity) ?? 1,
|
|
5167
5167
|
// Deep-copy so a config's stops array is never aliased by the element
|
|
5168
5168
|
...e !== void 0 && { fill: $t(e) }
|
|
@@ -5649,7 +5649,7 @@ class Nt extends tt {
|
|
|
5649
5649
|
width: ((i = t.transformData) == null ? void 0 : i.width) || 200,
|
|
5650
5650
|
height: ((r = t.transformData) == null ? void 0 : r.height) || 200,
|
|
5651
5651
|
fillEnabled: ((h = t.transformData) == null ? void 0 : h.fillEnabled) ?? !1,
|
|
5652
|
-
fillColor: ((a = t.transformData) == null ? void 0 : a.fillColor) ||
|
|
5652
|
+
fillColor: ((a = t.transformData) == null ? void 0 : a.fillColor) || ee(),
|
|
5653
5653
|
fillOpacity: ((n = t.transformData) == null ? void 0 : n.fillOpacity) ?? 1,
|
|
5654
5654
|
strokeEnabled: ((l = t.transformData) == null ? void 0 : l.strokeEnabled) ?? !0,
|
|
5655
5655
|
strokeColor: ((c = t.transformData) == null ? void 0 : c.strokeColor) || "#000000",
|
|
@@ -5945,7 +5945,7 @@ class Nt extends tt {
|
|
|
5945
5945
|
};
|
|
5946
5946
|
}
|
|
5947
5947
|
}
|
|
5948
|
-
const
|
|
5948
|
+
const ys = {
|
|
5949
5949
|
circle: [
|
|
5950
5950
|
{
|
|
5951
5951
|
key: "reverse",
|
|
@@ -5958,7 +5958,7 @@ const ps = {
|
|
|
5958
5958
|
{
|
|
5959
5959
|
key: "archHeight",
|
|
5960
5960
|
label: "Arch Height",
|
|
5961
|
-
defaultInternalValue:
|
|
5961
|
+
defaultInternalValue: hs.archHeight,
|
|
5962
5962
|
// Slider 0-100 maps to internal -1 to 1
|
|
5963
5963
|
toSlider: (o) => (o + 1) / 2 * 100,
|
|
5964
5964
|
fromSlider: (o) => o / 100 * 2 - 1,
|
|
@@ -6011,7 +6011,7 @@ const ps = {
|
|
|
6011
6011
|
{
|
|
6012
6012
|
key: "leanAmount",
|
|
6013
6013
|
label: "Lean Amount",
|
|
6014
|
-
defaultInternalValue:
|
|
6014
|
+
defaultInternalValue: ls.leanAmount,
|
|
6015
6015
|
// Slider 0-100 maps to internal -0.5 to 0.5
|
|
6016
6016
|
// Display as -100% to 100%
|
|
6017
6017
|
toSlider: (o) => (o + 0.5) * 100,
|
|
@@ -6023,7 +6023,7 @@ const ps = {
|
|
|
6023
6023
|
{
|
|
6024
6024
|
key: "ascendAngle",
|
|
6025
6025
|
label: "Ascend Amount",
|
|
6026
|
-
defaultInternalValue:
|
|
6026
|
+
defaultInternalValue: cs.ascendAngle,
|
|
6027
6027
|
// Slider 0-100 maps to internal angle +30° to -30°
|
|
6028
6028
|
// Display: slider 0 = -100% (down), slider 50 = 0%, slider 100 = +100% (up)
|
|
6029
6029
|
toSlider: (o) => (30 - o) / 60 * 100,
|
|
@@ -6099,17 +6099,17 @@ const ps = {
|
|
|
6099
6099
|
toDisplay: (o) => `${(o * 100).toFixed(0)}%`
|
|
6100
6100
|
}
|
|
6101
6101
|
]
|
|
6102
|
-
},
|
|
6103
|
-
{ id: "custom", label: "CUSTOM", Component:
|
|
6102
|
+
}, ge = [
|
|
6103
|
+
{ id: "custom", label: "CUSTOM", Component: ss },
|
|
6104
6104
|
// NOTE: distort transform is not yet implemented. Removed from registry
|
|
6105
6105
|
// to prevent it from appearing in UI that iterates over registered transforms.
|
|
6106
6106
|
// Re-add with a valid Component when implementation is ready.
|
|
6107
|
-
{ id: "circle", label: "CIRCLE", Component:
|
|
6108
|
-
{ id: "lean", label: "LEAN", Component:
|
|
6109
|
-
{ id: "arch", label: "ARCH", Component:
|
|
6110
|
-
{ id: "ascend", label: "ASCEND", Component:
|
|
6111
|
-
{ id: "wave", label: "WAVE", Component:
|
|
6112
|
-
{ id: "flag", label: "FLAG", Component:
|
|
6107
|
+
{ id: "circle", label: "CIRCLE", Component: ns },
|
|
6108
|
+
{ id: "lean", label: "LEAN", Component: fs },
|
|
6109
|
+
{ id: "arch", label: "ARCH", Component: as },
|
|
6110
|
+
{ id: "ascend", label: "ASCEND", Component: us },
|
|
6111
|
+
{ id: "wave", label: "WAVE", Component: ds },
|
|
6112
|
+
{ id: "flag", label: "FLAG", Component: gs },
|
|
6113
6113
|
{ id: "shape", label: "SHAPE", Component: Wt },
|
|
6114
6114
|
{ id: "path", label: "PATH", Component: Nt },
|
|
6115
6115
|
{ id: "image", label: "IMAGE", Component: bt },
|
|
@@ -6119,9 +6119,9 @@ const ps = {
|
|
|
6119
6119
|
{ id: "group", label: "GROUP", get Component() {
|
|
6120
6120
|
return yt;
|
|
6121
6121
|
} }
|
|
6122
|
-
],
|
|
6123
|
-
function
|
|
6124
|
-
if (
|
|
6122
|
+
], fe = new Set(ge.map((o) => o.id)), pt = /* @__PURE__ */ new Map();
|
|
6123
|
+
function Wi(o, t) {
|
|
6124
|
+
if (fe.has(o))
|
|
6125
6125
|
throw new Error(
|
|
6126
6126
|
`Cannot register transform type "${o}": conflicts with built-in type`
|
|
6127
6127
|
);
|
|
@@ -6131,19 +6131,19 @@ function Hi(o, t) {
|
|
|
6131
6131
|
);
|
|
6132
6132
|
pt.set(o, t);
|
|
6133
6133
|
}
|
|
6134
|
-
function
|
|
6135
|
-
if (
|
|
6134
|
+
function Ni(o) {
|
|
6135
|
+
if (fe.has(o))
|
|
6136
6136
|
throw new Error(
|
|
6137
6137
|
`Cannot unregister transform type "${o}": built-in types cannot be removed`
|
|
6138
6138
|
);
|
|
6139
6139
|
return pt.delete(o);
|
|
6140
6140
|
}
|
|
6141
|
-
function
|
|
6142
|
-
const t =
|
|
6141
|
+
function ws(o) {
|
|
6142
|
+
const t = ge.find((e) => e.id === o);
|
|
6143
6143
|
return t || pt.get(o);
|
|
6144
6144
|
}
|
|
6145
|
-
function
|
|
6146
|
-
return
|
|
6145
|
+
function _i(o) {
|
|
6146
|
+
return ys[o] || [];
|
|
6147
6147
|
}
|
|
6148
6148
|
class yt extends tt {
|
|
6149
6149
|
constructor(t = {}) {
|
|
@@ -6160,7 +6160,7 @@ class yt extends tt {
|
|
|
6160
6160
|
*/
|
|
6161
6161
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- JSON deserialization: config comes from toJSON() and constructors accept Partial<Config> with varying signatures
|
|
6162
6162
|
_reconstructChildFromJSON(t) {
|
|
6163
|
-
const e = t.transformType || t.type, s =
|
|
6163
|
+
const e = t.transformType || t.type, s = ws(e);
|
|
6164
6164
|
if (!s || !s.Component)
|
|
6165
6165
|
throw new Error(`Unknown transform type: ${e}`);
|
|
6166
6166
|
return new s.Component(t);
|
|
@@ -6247,7 +6247,7 @@ class yt extends tt {
|
|
|
6247
6247
|
*/
|
|
6248
6248
|
render(t, e = !1, s = !1) {
|
|
6249
6249
|
const i = this.children.filter((h) => h.visible !== !1);
|
|
6250
|
-
i.some((h) => h.isClipping) ?
|
|
6250
|
+
i.some((h) => h.isClipping) ? $e()(t, i) : i.forEach((h) => {
|
|
6251
6251
|
h.render(t, !1);
|
|
6252
6252
|
}), e ? this._renderGroupOutline(t, 1) : s && this._renderGroupOutline(t, 0.3);
|
|
6253
6253
|
}
|
|
@@ -6257,7 +6257,7 @@ class yt extends tt {
|
|
|
6257
6257
|
*/
|
|
6258
6258
|
_renderGroupOutline(t, e = 1) {
|
|
6259
6259
|
const s = this.getOrientedBoundingBox();
|
|
6260
|
-
t.save(), t.globalAlpha = e, t.strokeStyle =
|
|
6260
|
+
t.save(), t.globalAlpha = e, t.strokeStyle = te(), t.lineWidth = 2, t.setLineDash([5, 5]);
|
|
6261
6261
|
const i = this._rotationCenterX || this.x, r = this._rotationCenterY || this.y;
|
|
6262
6262
|
this.rotation !== 0 && (t.translate(i, r), t.rotate(-this.rotation * Math.PI / 180), t.translate(-i, -r)), t.strokeRect(s.x, s.y, s.width, s.height), t.setLineDash([]), t.restore();
|
|
6263
6263
|
}
|
|
@@ -6604,7 +6604,7 @@ class $ {
|
|
|
6604
6604
|
throw new Error("Command.undo() must be implemented");
|
|
6605
6605
|
}
|
|
6606
6606
|
}
|
|
6607
|
-
class
|
|
6607
|
+
class Xi extends $ {
|
|
6608
6608
|
constructor(t, e, s, i) {
|
|
6609
6609
|
super(), this.elementId = t, this.oldElement = e ? e.clone() : null, this.newElement = s ? s.clone() : null, this.onUpdate = i;
|
|
6610
6610
|
}
|
|
@@ -6615,7 +6615,7 @@ class Wi extends $ {
|
|
|
6615
6615
|
this.oldElement && this.onUpdate(this.oldElement);
|
|
6616
6616
|
}
|
|
6617
6617
|
}
|
|
6618
|
-
class
|
|
6618
|
+
class zi extends $ {
|
|
6619
6619
|
constructor(t, e, s) {
|
|
6620
6620
|
super(), this.element = t.clone(), this.onAdd = e, this.onRemove = s;
|
|
6621
6621
|
}
|
|
@@ -6626,7 +6626,7 @@ class Ni extends $ {
|
|
|
6626
6626
|
this.onRemove(this.element.id);
|
|
6627
6627
|
}
|
|
6628
6628
|
}
|
|
6629
|
-
class
|
|
6629
|
+
class Yi extends $ {
|
|
6630
6630
|
constructor(t, e, s) {
|
|
6631
6631
|
super(), this.element = t.clone(), this.onAdd = e, this.onRemove = s;
|
|
6632
6632
|
}
|
|
@@ -6637,7 +6637,7 @@ class _i extends $ {
|
|
|
6637
6637
|
this.onAdd(this.element);
|
|
6638
6638
|
}
|
|
6639
6639
|
}
|
|
6640
|
-
class
|
|
6640
|
+
class bs extends $ {
|
|
6641
6641
|
constructor(t) {
|
|
6642
6642
|
super(), this.commands = t;
|
|
6643
6643
|
}
|
|
@@ -6669,7 +6669,7 @@ class gt {
|
|
|
6669
6669
|
executeBatch(t) {
|
|
6670
6670
|
if (t.length === 0)
|
|
6671
6671
|
return;
|
|
6672
|
-
const e = new
|
|
6672
|
+
const e = new bs(t);
|
|
6673
6673
|
this.execute(e);
|
|
6674
6674
|
}
|
|
6675
6675
|
/**
|
|
@@ -6714,7 +6714,7 @@ class gt {
|
|
|
6714
6714
|
};
|
|
6715
6715
|
}
|
|
6716
6716
|
}
|
|
6717
|
-
class
|
|
6717
|
+
class Ui extends $ {
|
|
6718
6718
|
constructor(t, e) {
|
|
6719
6719
|
super(), this.artboard = t.clone(), this.artboardManager = e;
|
|
6720
6720
|
}
|
|
@@ -6734,7 +6734,7 @@ class Xi extends $ {
|
|
|
6734
6734
|
this.artboardManager.deleteArtboard(this.artboard.id);
|
|
6735
6735
|
}
|
|
6736
6736
|
}
|
|
6737
|
-
class
|
|
6737
|
+
class Gi extends $ {
|
|
6738
6738
|
constructor(t, e) {
|
|
6739
6739
|
super(), this.artboard = t.clone(), this.artboardManager = e, this.elementsOnArtboard = t.getElementIds();
|
|
6740
6740
|
}
|
|
@@ -6757,7 +6757,7 @@ class zi extends $ {
|
|
|
6757
6757
|
});
|
|
6758
6758
|
}
|
|
6759
6759
|
}
|
|
6760
|
-
class
|
|
6760
|
+
class $i extends $ {
|
|
6761
6761
|
constructor(t, e, s, i) {
|
|
6762
6762
|
super(), this.artboardId = t, this.oldProperties = { ...e }, this.newProperties = { ...s }, this.artboardManager = i;
|
|
6763
6763
|
}
|
|
@@ -6768,7 +6768,7 @@ class Yi extends $ {
|
|
|
6768
6768
|
this.artboardManager.updateArtboard(this.artboardId, this.oldProperties);
|
|
6769
6769
|
}
|
|
6770
6770
|
}
|
|
6771
|
-
class
|
|
6771
|
+
class Vi extends $ {
|
|
6772
6772
|
constructor(t, e, s, i, r) {
|
|
6773
6773
|
super(), this.draggedId = t, this.targetId = e, this.position = s, this.oldOrder = [...i], this.onReorder = r, this.newOrder = this.calculateNewOrder();
|
|
6774
6774
|
}
|
|
@@ -6788,8 +6788,8 @@ class Ui extends $ {
|
|
|
6788
6788
|
this.onReorder(this.oldOrder);
|
|
6789
6789
|
}
|
|
6790
6790
|
}
|
|
6791
|
-
const
|
|
6792
|
-
class
|
|
6791
|
+
const xs = wt("HybridHistoryManager");
|
|
6792
|
+
class Ji {
|
|
6793
6793
|
constructor(t, e = 50) {
|
|
6794
6794
|
this.commandExecutedCallbacks = [], this.globalHistory = new gt(e), this.artboardHistories = /* @__PURE__ */ new Map(), this.lastOperation = null, this.artboardManager = t, this.maxHistorySize = e;
|
|
6795
6795
|
}
|
|
@@ -6811,7 +6811,7 @@ class Gi {
|
|
|
6811
6811
|
try {
|
|
6812
6812
|
i(t, e, s);
|
|
6813
6813
|
} catch (r) {
|
|
6814
|
-
|
|
6814
|
+
xs.error("Error in command executed callback:", r);
|
|
6815
6815
|
}
|
|
6816
6816
|
}
|
|
6817
6817
|
/**
|
|
@@ -7083,12 +7083,23 @@ class Gi {
|
|
|
7083
7083
|
return this.canRedoGlobal() ? "Redo artboard operation" : "Nothing to redo";
|
|
7084
7084
|
}
|
|
7085
7085
|
}
|
|
7086
|
+
let Jt = null;
|
|
7087
|
+
function Ss(o) {
|
|
7088
|
+
return Jt ?? (Jt = new Map(Qt.filter((t) => {
|
|
7089
|
+
var e;
|
|
7090
|
+
return (e = t.weights) == null ? void 0 : e.length;
|
|
7091
|
+
}).map((t) => [t.name, t.weights]))), Jt.get(o);
|
|
7092
|
+
}
|
|
7093
|
+
function Cs(o, t) {
|
|
7094
|
+
const e = Ss(o);
|
|
7095
|
+
return !e || e.includes(t) ? t : e.reduce((s, i) => Math.abs(i - t) < Math.abs(s - t) ? i : s, e[0]);
|
|
7096
|
+
}
|
|
7086
7097
|
const G = wt("FontAnalyzer");
|
|
7087
7098
|
let Tt = null;
|
|
7088
|
-
async function
|
|
7099
|
+
async function vs() {
|
|
7089
7100
|
return Tt || (Tt = await import("./browser-module-DFvKXBUE.js")), Tt;
|
|
7090
7101
|
}
|
|
7091
|
-
class
|
|
7102
|
+
class Ts {
|
|
7092
7103
|
constructor() {
|
|
7093
7104
|
this.fontCache = /* @__PURE__ */ new Map(), this.failedFonts = /* @__PURE__ */ new Set(), this.CACHE_DURATION = 1e3 * 60 * 30, this.MAX_CACHE_SIZE = 5;
|
|
7094
7105
|
}
|
|
@@ -7108,13 +7119,13 @@ class Ss {
|
|
|
7108
7119
|
* Check if a font is a system font
|
|
7109
7120
|
*/
|
|
7110
7121
|
isSystemFont(t) {
|
|
7111
|
-
return
|
|
7122
|
+
return He.has(t);
|
|
7112
7123
|
}
|
|
7113
7124
|
/**
|
|
7114
7125
|
* Get Google Fonts API URL for a specific font family
|
|
7115
7126
|
*/
|
|
7116
7127
|
getGoogleFontUrl(t, e = 400) {
|
|
7117
|
-
return `https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g, "+")}:wght@${e}&display=swap`;
|
|
7128
|
+
return `https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g, "+")}:wght@${Cs(t, e)}&display=swap`;
|
|
7118
7129
|
}
|
|
7119
7130
|
/**
|
|
7120
7131
|
* Extract actual font file URL from Google Fonts CSS
|
|
@@ -7156,7 +7167,7 @@ class Ss {
|
|
|
7156
7167
|
const h = await fetch(r);
|
|
7157
7168
|
if (!h.ok)
|
|
7158
7169
|
return G.error(`Font fetch failed: ${h.status} ${h.statusText}`), this.failedFonts.add(s), null;
|
|
7159
|
-
const a = await h.arrayBuffer(), n = new Uint8Array(a), c = (await
|
|
7170
|
+
const a = await h.arrayBuffer(), n = new Uint8Array(a), c = (await vs()).create(n), g = "fonts" in c ? c.fonts[0] : c;
|
|
7160
7171
|
return this.fontCache.set(s, {
|
|
7161
7172
|
font: g,
|
|
7162
7173
|
url: r,
|
|
@@ -7507,145 +7518,145 @@ class Ss {
|
|
|
7507
7518
|
};
|
|
7508
7519
|
}
|
|
7509
7520
|
}
|
|
7510
|
-
const
|
|
7521
|
+
const qi = new Ts();
|
|
7511
7522
|
export {
|
|
7512
7523
|
Ot as $,
|
|
7513
7524
|
at as A,
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7525
|
+
zi as B,
|
|
7526
|
+
ns as C,
|
|
7527
|
+
Ui as D,
|
|
7517
7528
|
K as E,
|
|
7518
|
-
|
|
7529
|
+
gs as F,
|
|
7519
7530
|
yt as G,
|
|
7520
|
-
|
|
7531
|
+
Ji as H,
|
|
7521
7532
|
bt as I,
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7533
|
+
Gi as J,
|
|
7534
|
+
$i as K,
|
|
7535
|
+
fs as L,
|
|
7536
|
+
Vi as M,
|
|
7537
|
+
Be as N,
|
|
7538
|
+
Re as O,
|
|
7528
7539
|
Nt as P,
|
|
7529
|
-
|
|
7530
|
-
|
|
7540
|
+
_s as Q,
|
|
7541
|
+
Yi as R,
|
|
7531
7542
|
Wt as S,
|
|
7532
7543
|
j as T,
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7544
|
+
Xi as U,
|
|
7545
|
+
hs as V,
|
|
7546
|
+
ds as W,
|
|
7536
7547
|
rt as X,
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7548
|
+
Hi as Y,
|
|
7549
|
+
Pi as Z,
|
|
7550
|
+
ei as _,
|
|
7551
|
+
Ks as a,
|
|
7552
|
+
ze as a$,
|
|
7553
|
+
Ue as a0,
|
|
7554
|
+
te as a1,
|
|
7555
|
+
os as a2,
|
|
7556
|
+
ke as a3,
|
|
7546
7557
|
P as a4,
|
|
7547
|
-
|
|
7558
|
+
Oi as a5,
|
|
7548
7559
|
D as a6,
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7560
|
+
Bi as a7,
|
|
7561
|
+
Ys as a8,
|
|
7562
|
+
Bs as a9,
|
|
7563
|
+
xi as aA,
|
|
7564
|
+
ni as aB,
|
|
7565
|
+
ui as aC,
|
|
7566
|
+
ri as aD,
|
|
7567
|
+
fi as aE,
|
|
7568
|
+
oi as aF,
|
|
7569
|
+
hi as aG,
|
|
7570
|
+
mi as aH,
|
|
7571
|
+
ci as aI,
|
|
7572
|
+
gi as aJ,
|
|
7573
|
+
li as aK,
|
|
7574
|
+
Ci as aL,
|
|
7575
|
+
yi as aM,
|
|
7576
|
+
bi as aN,
|
|
7577
|
+
pi as aO,
|
|
7578
|
+
wi as aP,
|
|
7579
|
+
di as aQ,
|
|
7580
|
+
ai as aR,
|
|
7581
|
+
se as aS,
|
|
7582
|
+
si as aT,
|
|
7583
|
+
ii as aU,
|
|
7573
7584
|
q as aV,
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7585
|
+
ti as aW,
|
|
7586
|
+
vi as aX,
|
|
7587
|
+
Qt as aY,
|
|
7588
|
+
ps as aZ,
|
|
7578
7589
|
$t as a_,
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7590
|
+
Rs as aa,
|
|
7591
|
+
Os as ab,
|
|
7592
|
+
Ie as ac,
|
|
7593
|
+
Es as ad,
|
|
7594
|
+
ks as ae,
|
|
7584
7595
|
Z as af,
|
|
7585
7596
|
ht as ag,
|
|
7586
7597
|
xt as ah,
|
|
7587
|
-
|
|
7588
|
-
|
|
7598
|
+
Mi as ai,
|
|
7599
|
+
Fi as aj,
|
|
7589
7600
|
Ut as ak,
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
+
Pe as al,
|
|
7602
|
+
As as am,
|
|
7603
|
+
Gs as an,
|
|
7604
|
+
Us as ao,
|
|
7605
|
+
Ds as ap,
|
|
7606
|
+
Xs as aq,
|
|
7607
|
+
zs as ar,
|
|
7608
|
+
Ns as as,
|
|
7609
|
+
Js as at,
|
|
7610
|
+
Wi as au,
|
|
7611
|
+
Ni as av,
|
|
7601
7612
|
tt as aw,
|
|
7602
7613
|
L as ax,
|
|
7603
|
-
|
|
7604
|
-
|
|
7614
|
+
Ti as ay,
|
|
7615
|
+
Si as az,
|
|
7605
7616
|
dt as b,
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7617
|
+
Li as b0,
|
|
7618
|
+
Ms as b1,
|
|
7619
|
+
ge as b2,
|
|
7620
|
+
_i as b3,
|
|
7621
|
+
Vs as b4,
|
|
7622
|
+
ls as b5,
|
|
7612
7623
|
nt as b6,
|
|
7613
|
-
|
|
7614
|
-
|
|
7624
|
+
Zs as b7,
|
|
7625
|
+
Ve as b8,
|
|
7615
7626
|
Lt as b9,
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7627
|
+
ee as ba,
|
|
7628
|
+
Ps as bb,
|
|
7629
|
+
Ls as bc,
|
|
7630
|
+
Ws as bd,
|
|
7631
|
+
$s as be,
|
|
7632
|
+
Ri as bf,
|
|
7633
|
+
De as bg,
|
|
7634
|
+
Is as bh,
|
|
7635
|
+
Hs as bi,
|
|
7636
|
+
Ei as bj,
|
|
7626
7637
|
wt as c,
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7638
|
+
as as d,
|
|
7639
|
+
Fs as e,
|
|
7640
|
+
us as f,
|
|
7641
|
+
ss as g,
|
|
7642
|
+
Le as h,
|
|
7632
7643
|
Pt as i,
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7644
|
+
is as j,
|
|
7645
|
+
Ii as k,
|
|
7646
|
+
Ai as l,
|
|
7647
|
+
Di as m,
|
|
7648
|
+
ki as n,
|
|
7649
|
+
_e as o,
|
|
7639
7650
|
mt as p,
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7651
|
+
ws as q,
|
|
7652
|
+
Qs as r,
|
|
7653
|
+
Qe as s,
|
|
7654
|
+
ms as t,
|
|
7655
|
+
qs as u,
|
|
7645
7656
|
Ht as v,
|
|
7646
|
-
|
|
7657
|
+
Ke as w,
|
|
7647
7658
|
Yt as x,
|
|
7648
|
-
|
|
7649
|
-
|
|
7659
|
+
js as y,
|
|
7660
|
+
qi as z
|
|
7650
7661
|
};
|
|
7651
|
-
//# sourceMappingURL=FontAnalyzer-
|
|
7662
|
+
//# sourceMappingURL=FontAnalyzer-CyhywbAM.js.map
|