@snowcone-app/canvas 0.21.0 → 0.21.2
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/README.md +7 -2
- package/dist/{CanvasRenderer-CwiYq8qg.js → CanvasRenderer-B0szG0Us.js} +45 -44
- package/dist/{CanvasRenderer-CwiYq8qg.js.map → CanvasRenderer-B0szG0Us.js.map} +1 -1
- package/dist/{CanvasStateV1-BFabcAKC.js → CanvasStateV1-DmZ1Qvvn.js} +38 -38
- package/dist/{CanvasStateV1-BFabcAKC.js.map → CanvasStateV1-DmZ1Qvvn.js.map} +1 -1
- package/dist/{ContextualToolbars--vTtorNg.js → ContextualToolbars-BYnovWnN.js} +1372 -1422
- package/dist/ContextualToolbars-BYnovWnN.js.map +1 -0
- package/dist/{EditorCanvasImpl-2ZgIUVpK.js → EditorCanvasImpl-BmLHjXe7.js} +8 -8
- package/dist/{EditorCanvasImpl-2ZgIUVpK.js.map → EditorCanvasImpl-BmLHjXe7.js.map} +1 -1
- package/dist/{ExportManager-DK7CdI-G.js → ExportManager-DoU4VK6h.js} +603 -498
- package/dist/ExportManager-DoU4VK6h.js.map +1 -0
- package/dist/{FontAnalyzer-BpsTYowD.js → FontAnalyzer-CwIpgTGd.js} +309 -299
- package/dist/{FontAnalyzer-BpsTYowD.js.map → FontAnalyzer-CwIpgTGd.js.map} +1 -1
- package/dist/{SnowconeCanvas-DqZicdxK.js → SnowconeCanvas-Bj2773ym.js} +9 -9
- package/dist/{SnowconeCanvas-DqZicdxK.js.map → SnowconeCanvas-Bj2773ym.js.map} +1 -1
- package/dist/{UnifiedFontService-B1PGVu8O.js → UnifiedFontService-C8gaspRD.js} +812 -816
- package/dist/UnifiedFontService-C8gaspRD.js.map +1 -0
- package/dist/advanced.mjs +13 -13
- package/dist/{design-builder-CPF60RU2.js → design-builder-CT4DHIPe.js} +2 -2
- package/dist/{design-builder-CPF60RU2.js.map → design-builder-CT4DHIPe.js.map} +1 -1
- package/dist/{editorErrors-CK1RISFa.js → editorErrors-B2mb1sVN.js} +2 -2
- package/dist/{editorErrors-CK1RISFa.js.map → editorErrors-B2mb1sVN.js.map} +1 -1
- package/dist/{embed-2tp6Ue90.js → embed-pM7ZkFuz.js} +10 -10
- package/dist/{embed-2tp6Ue90.js.map → embed-pM7ZkFuz.js.map} +1 -1
- package/dist/embed.mjs +6 -6
- package/dist/index.mjs +8 -8
- package/dist/internals.mjs +11 -11
- package/dist/rendering/element-painters.d.ts +4 -2
- package/dist/{template-fields-FgImixyv.js → template-fields-BsnHMf1i.js} +6 -6
- package/dist/{template-fields-FgImixyv.js.map → template-fields-BsnHMf1i.js.map} +1 -1
- package/dist/testing.mjs +4 -4
- package/dist/{usePieceGuideBundle-Ctnu5k2D.js → usePieceGuideBundle-CbJJg66S.js} +2 -2
- package/dist/{usePieceGuideBundle-Ctnu5k2D.js.map → usePieceGuideBundle-CbJJg66S.js.map} +1 -1
- package/dist/{validation-3YEMnKLB.js → validation-DdVeWnlo.js} +9 -9
- package/dist/{validation-3YEMnKLB.js.map → validation-DdVeWnlo.js.map} +1 -1
- package/example/package.json +1 -1
- package/example/src/Widget.tsx +3 -0
- package/package.json +3 -2
- package/dist/ContextualToolbars--vTtorNg.js.map +0 -1
- package/dist/ExportManager-DK7CdI-G.js.map +0 -1
- package/dist/UnifiedFontService-B1PGVu8O.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function
|
|
1
|
+
function te(r) {
|
|
2
2
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
3
3
|
}
|
|
4
|
-
var
|
|
4
|
+
var Rt = { exports: {} }, E = Rt.exports = {}, W, z;
|
|
5
5
|
function xt() {
|
|
6
6
|
throw new Error("setTimeout has not been defined");
|
|
7
7
|
}
|
|
@@ -20,7 +20,7 @@ function bt() {
|
|
|
20
20
|
z = bt;
|
|
21
21
|
}
|
|
22
22
|
})();
|
|
23
|
-
function
|
|
23
|
+
function Ht(r) {
|
|
24
24
|
if (W === setTimeout)
|
|
25
25
|
return setTimeout(r, 0);
|
|
26
26
|
if ((W === xt || !W) && setTimeout)
|
|
@@ -35,7 +35,7 @@ function Rt(r) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function ee(r) {
|
|
39
39
|
if (z === clearTimeout)
|
|
40
40
|
return clearTimeout(r);
|
|
41
41
|
if ((z === bt || !z) && clearTimeout)
|
|
@@ -51,19 +51,19 @@ function Qt(r) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
var X = [], K = !1, V, dt = -1;
|
|
54
|
-
function
|
|
55
|
-
!K || !V || (K = !1, V.length ? X = V.concat(X) : dt = -1, X.length &&
|
|
54
|
+
function oe() {
|
|
55
|
+
!K || !V || (K = !1, V.length ? X = V.concat(X) : dt = -1, X.length && Pt());
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Pt() {
|
|
58
58
|
if (!K) {
|
|
59
|
-
var r =
|
|
59
|
+
var r = Ht(oe);
|
|
60
60
|
K = !0;
|
|
61
61
|
for (var t = X.length; t; ) {
|
|
62
62
|
for (V = X, X = []; ++dt < t; )
|
|
63
63
|
V && V[dt].run();
|
|
64
64
|
dt = -1, t = X.length;
|
|
65
65
|
}
|
|
66
|
-
V = null, K = !1,
|
|
66
|
+
V = null, K = !1, ee(r);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
E.nextTick = function(r) {
|
|
@@ -71,12 +71,12 @@ E.nextTick = function(r) {
|
|
|
71
71
|
if (arguments.length > 1)
|
|
72
72
|
for (var e = 1; e < arguments.length; e++)
|
|
73
73
|
t[e - 1] = arguments[e];
|
|
74
|
-
X.push(new
|
|
74
|
+
X.push(new Lt(r, t)), X.length === 1 && !K && Ht(Pt);
|
|
75
75
|
};
|
|
76
|
-
function
|
|
76
|
+
function Lt(r, t) {
|
|
77
77
|
this.fun = r, this.array = t;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
Lt.prototype.run = function() {
|
|
80
80
|
this.fun.apply(null, this.array);
|
|
81
81
|
};
|
|
82
82
|
E.title = "browser";
|
|
@@ -111,12 +111,12 @@ E.chdir = function(r) {
|
|
|
111
111
|
E.umask = function() {
|
|
112
112
|
return 0;
|
|
113
113
|
};
|
|
114
|
-
var
|
|
115
|
-
const
|
|
116
|
-
let
|
|
114
|
+
var ie = Rt.exports;
|
|
115
|
+
const Dt = /* @__PURE__ */ te(ie);
|
|
116
|
+
let It = 1;
|
|
117
117
|
class nt {
|
|
118
118
|
constructor(t = {}) {
|
|
119
|
-
this.transformType = "artboard", this.id = t.id || `artboard-${
|
|
119
|
+
this.transformType = "artboard", this.id = t.id || `artboard-${It++}`, this.name = t.name || `Artboard ${It}`, this.x = t.x !== void 0 ? t.x : 0, this.y = t.y !== void 0 ? t.y : 0, this.width = t.width || 1920, this.height = t.height || 1080, this.backgroundColor = t.backgroundColor || "#ffffff", t.backgroundType ? this.backgroundType = t.backgroundType : t.backgroundColor === "transparent" ? this.backgroundType = "transparent" : t.backgroundTexture ? this.backgroundType = "texture" : this.backgroundType = "color", this.backgroundTexture = t.backgroundTexture, this.exportBackground = t.exportBackground ?? !1, this.clipShape = t.clipShape, this.previewBackgroundColor = t.previewBackgroundColor, this.role = t.role, this.distressTexture = t.distressTexture ? { ...t.distressTexture } : void 0, this.imageMask = t.imageMask ? { ...t.imageMask } : void 0, this.elementIds = new Set(t.elementIds || []);
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Get bounding box of the artboard
|
|
@@ -272,7 +272,7 @@ class nt {
|
|
|
272
272
|
this.x = t, this.y = e;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
class
|
|
275
|
+
class qe {
|
|
276
276
|
constructor() {
|
|
277
277
|
this.artboards = /* @__PURE__ */ new Map(), this.elementToArtboard = /* @__PURE__ */ new Map(), this.activeArtboardId = null;
|
|
278
278
|
}
|
|
@@ -519,7 +519,7 @@ const D = {
|
|
|
519
519
|
return t > 180 && (t -= 360), t;
|
|
520
520
|
}
|
|
521
521
|
};
|
|
522
|
-
let
|
|
522
|
+
let se = 1;
|
|
523
523
|
class Q {
|
|
524
524
|
/** Whether this element clips content below it (derived from blendMode === 'clip') */
|
|
525
525
|
get isClipping() {
|
|
@@ -529,7 +529,7 @@ class Q {
|
|
|
529
529
|
t ? (this.blendMode = "clip", this.knockoutParts || (this.knockoutParts = { fill: !0, scope: "group" })) : this.blendMode === "clip" && (this.blendMode = "normal");
|
|
530
530
|
}
|
|
531
531
|
constructor(t = {}) {
|
|
532
|
-
this.id = t.id || `element-${
|
|
532
|
+
this.id = t.id || `element-${se++}`, 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, 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;
|
|
533
533
|
}
|
|
534
534
|
/**
|
|
535
535
|
* Get visual bounding box (tight fit around actual rendered content)
|
|
@@ -781,7 +781,7 @@ class R {
|
|
|
781
781
|
return new R(t);
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
|
-
const
|
|
784
|
+
const re = [
|
|
785
785
|
// Bold/Display Fonts - Perfect for statements and headlines (49 fonts)
|
|
786
786
|
{
|
|
787
787
|
name: "Bebas Neue",
|
|
@@ -2257,10 +2257,10 @@ const ie = [
|
|
|
2257
2257
|
description: "Humanist monospace"
|
|
2258
2258
|
}
|
|
2259
2259
|
];
|
|
2260
|
-
function
|
|
2261
|
-
return
|
|
2260
|
+
function ne() {
|
|
2261
|
+
return re.map((r) => r.name);
|
|
2262
2262
|
}
|
|
2263
|
-
const
|
|
2263
|
+
const je = {
|
|
2264
2264
|
system: "System Fonts",
|
|
2265
2265
|
display: "Bold & Display",
|
|
2266
2266
|
"sans-serif": "Sans Serif",
|
|
@@ -2272,26 +2272,26 @@ const qe = {
|
|
|
2272
2272
|
decorative: "Decorative & Unique",
|
|
2273
2273
|
monospace: "Monospace"
|
|
2274
2274
|
};
|
|
2275
|
-
function
|
|
2275
|
+
function Wt(r) {
|
|
2276
2276
|
if (typeof window > "u" || typeof document > "u")
|
|
2277
2277
|
return "oklch(0% 0 0)";
|
|
2278
2278
|
const t = r || document.documentElement;
|
|
2279
2279
|
return getComputedStyle(t).getPropertyValue("--accent").trim() || "oklch(0% 0 0)";
|
|
2280
2280
|
}
|
|
2281
|
-
function
|
|
2281
|
+
function ae(r) {
|
|
2282
2282
|
return typeof window > "u" || typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") || "light";
|
|
2283
2283
|
}
|
|
2284
|
-
function
|
|
2285
|
-
return
|
|
2284
|
+
function zt() {
|
|
2285
|
+
return ae().includes("dark") ? "#60a5fa" : "#3b82f6";
|
|
2286
2286
|
}
|
|
2287
|
-
function
|
|
2287
|
+
function Ze(r) {
|
|
2288
2288
|
if (typeof window > "u" || typeof document > "u")
|
|
2289
2289
|
return "#FF0000";
|
|
2290
2290
|
const t = r || document.documentElement;
|
|
2291
2291
|
return getComputedStyle(t).getPropertyValue("--color-spacing-indicator").trim() || "#FF0000";
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2294
|
-
const e =
|
|
2293
|
+
function Ke(r = 0.1, t) {
|
|
2294
|
+
const e = Wt(t);
|
|
2295
2295
|
if (e.startsWith("oklch("))
|
|
2296
2296
|
return `${e.slice(0, -1)} / ${r})`;
|
|
2297
2297
|
if (e.startsWith("#")) {
|
|
@@ -2300,71 +2300,71 @@ function Ze(r = 0.1, t) {
|
|
|
2300
2300
|
}
|
|
2301
2301
|
return e;
|
|
2302
2302
|
}
|
|
2303
|
-
function
|
|
2303
|
+
function Qe(r) {
|
|
2304
2304
|
if (typeof window > "u" || typeof document > "u")
|
|
2305
2305
|
return "oklch(0% 0 0 / 0.45)";
|
|
2306
2306
|
const t = r || document.documentElement;
|
|
2307
2307
|
return getComputedStyle(t).getPropertyValue("--color-text-selection").trim() || "oklch(0% 0 0 / 0.45)";
|
|
2308
2308
|
}
|
|
2309
|
-
function
|
|
2309
|
+
function to(r) {
|
|
2310
2310
|
if (typeof window > "u" || typeof document > "u")
|
|
2311
2311
|
return "#b5f747";
|
|
2312
2312
|
const t = r || document.documentElement;
|
|
2313
2313
|
return getComputedStyle(t).getPropertyValue("--color-accent-hover").trim() || "#b5f747";
|
|
2314
2314
|
}
|
|
2315
|
-
function
|
|
2315
|
+
function he(r) {
|
|
2316
2316
|
if (typeof window > "u" || typeof document > "u")
|
|
2317
2317
|
return "oklch(0.2103 0.0059 285.89)";
|
|
2318
2318
|
const t = r || document.documentElement;
|
|
2319
2319
|
return getComputedStyle(t).getPropertyValue("--foreground").trim() || "oklch(0.2103 0.0059 285.89)";
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2321
|
+
function eo(r) {
|
|
2322
2322
|
if (typeof window > "u" || typeof document > "u")
|
|
2323
2323
|
return "oklch(0.9607 0 0)";
|
|
2324
2324
|
const t = r || document.documentElement;
|
|
2325
2325
|
return getComputedStyle(t).getPropertyValue("--background").trim() || "oklch(0.9607 0 0)";
|
|
2326
2326
|
}
|
|
2327
|
-
function
|
|
2328
|
-
const t =
|
|
2327
|
+
function oo(r) {
|
|
2328
|
+
const t = he(r);
|
|
2329
2329
|
return t.startsWith("oklch(") ? `${t.slice(0, -1)} / 0.2)` : "rgba(0,0,0,0.2)";
|
|
2330
2330
|
}
|
|
2331
|
-
function
|
|
2331
|
+
function io(r) {
|
|
2332
2332
|
if (typeof window > "u" || typeof document > "u")
|
|
2333
2333
|
return "oklch(0% 0 0 / 0.2)";
|
|
2334
2334
|
const t = document.documentElement;
|
|
2335
2335
|
return getComputedStyle(t).getPropertyValue("--divider").trim() || "oklch(0% 0 0 / 0.2)";
|
|
2336
2336
|
}
|
|
2337
|
-
function
|
|
2337
|
+
function so(r) {
|
|
2338
2338
|
if (typeof window > "u" || typeof document > "u")
|
|
2339
2339
|
return "oklch(0% 0 0 / 0.5)";
|
|
2340
2340
|
const t = document.documentElement, e = getComputedStyle(t).getPropertyValue("--foreground").trim();
|
|
2341
2341
|
return e.startsWith("oklch(") ? `${e.slice(0, -1)} / 0.5)` : e || "oklch(0% 0 0 / 0.5)";
|
|
2342
2342
|
}
|
|
2343
|
-
function
|
|
2343
|
+
function ro(r) {
|
|
2344
2344
|
if (typeof window > "u" || typeof document > "u")
|
|
2345
2345
|
return "#b5f747";
|
|
2346
2346
|
const t = document.documentElement;
|
|
2347
2347
|
return getComputedStyle(t).getPropertyValue("--color-accent-hover-border").trim() || "#b5f747";
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function no(r) {
|
|
2350
2350
|
if (typeof window > "u" || typeof document > "u")
|
|
2351
2351
|
return "oklch(0.2103 0.0059 285.89)";
|
|
2352
2352
|
const t = document.documentElement;
|
|
2353
2353
|
return getComputedStyle(t).getPropertyValue("--foreground").trim() || "oklch(0.2103 0.0059 285.89)";
|
|
2354
2354
|
}
|
|
2355
|
-
function
|
|
2355
|
+
function ao(r) {
|
|
2356
2356
|
if (typeof window > "u" || typeof document > "u")
|
|
2357
2357
|
return "oklch(1 0 0)";
|
|
2358
2358
|
const t = document.documentElement;
|
|
2359
2359
|
return getComputedStyle(t).getPropertyValue("--background").trim() || "oklch(1 0 0)";
|
|
2360
2360
|
}
|
|
2361
|
-
function
|
|
2361
|
+
function ho(r) {
|
|
2362
2362
|
if (typeof window > "u" || typeof document > "u")
|
|
2363
2363
|
return "oklch(0.2103 0.0059 285.89 / 0.5)";
|
|
2364
2364
|
const t = document.documentElement, e = getComputedStyle(t).getPropertyValue("--foreground").trim();
|
|
2365
2365
|
return e.startsWith("oklch(") ? `${e.slice(0, -1)} / 0.5)` : e || "oklch(0.2103 0.0059 285.89 / 0.5)";
|
|
2366
2366
|
}
|
|
2367
|
-
const
|
|
2367
|
+
const lo = 1, co = "#ffffff", le = 20, go = 6, fo = 24, ce = 16, de = 36, ge = 24, uo = 4, mo = "#FFFFFF", po = 2, yo = 0.1, wo = ne(), xo = [8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96, 128], j = 0, Xt = 1.2, Yt = 50, fe = 8, ue = 999, me = /* @__PURE__ */ new Set([
|
|
2368
2368
|
"Arial",
|
|
2369
2369
|
"Arial Black",
|
|
2370
2370
|
"Verdana",
|
|
@@ -2385,12 +2385,12 @@ const ho = 1, lo = "#ffffff", ae = 20, co = 6, go = 24, he = 16, le = 36, ce = 2
|
|
|
2385
2385
|
"Monaco",
|
|
2386
2386
|
"Consolas",
|
|
2387
2387
|
"Courier"
|
|
2388
|
-
]),
|
|
2389
|
-
var
|
|
2390
|
-
class
|
|
2388
|
+
]), pe = 0.3;
|
|
2389
|
+
var ye = /* @__PURE__ */ ((r) => (r[r.DEBUG = 0] = "DEBUG", r[r.INFO = 1] = "INFO", r[r.WARN = 2] = "WARN", r[r.ERROR = 3] = "ERROR", r[r.NONE = 4] = "NONE", r))(ye || {});
|
|
2390
|
+
class we {
|
|
2391
2391
|
constructor() {
|
|
2392
2392
|
var t;
|
|
2393
|
-
this.level = 0, this.enabled = typeof
|
|
2393
|
+
this.level = 0, this.enabled = typeof Dt < "u" && ((t = Dt.env) == null ? void 0 : t.NODE_ENV) !== "production";
|
|
2394
2394
|
}
|
|
2395
2395
|
// Only enabled in development by default
|
|
2396
2396
|
/**
|
|
@@ -2444,10 +2444,10 @@ class pe {
|
|
|
2444
2444
|
* Create a scoped logger with a prefix for a specific module
|
|
2445
2445
|
*/
|
|
2446
2446
|
scope(t) {
|
|
2447
|
-
return new
|
|
2447
|
+
return new xe(this, t);
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
|
-
class
|
|
2450
|
+
class xe {
|
|
2451
2451
|
constructor(t, e) {
|
|
2452
2452
|
this.logger = t, this.scopeName = e;
|
|
2453
2453
|
}
|
|
@@ -2464,8 +2464,8 @@ class ye {
|
|
|
2464
2464
|
this.logger.error(`[${this.scopeName}] ${t}`, ...e);
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
2467
|
-
const
|
|
2468
|
-
function
|
|
2467
|
+
const be = new we(), mt = (r) => be.scope(r), Se = mt("ImageLoadEvents"), St = /* @__PURE__ */ new Set();
|
|
2468
|
+
function bo(r) {
|
|
2469
2469
|
return St.add(r), () => {
|
|
2470
2470
|
St.delete(r);
|
|
2471
2471
|
};
|
|
@@ -2475,7 +2475,7 @@ function et(r) {
|
|
|
2475
2475
|
try {
|
|
2476
2476
|
t(r);
|
|
2477
2477
|
} catch (e) {
|
|
2478
|
-
|
|
2478
|
+
Se.error("Listener error:", e);
|
|
2479
2479
|
}
|
|
2480
2480
|
});
|
|
2481
2481
|
}
|
|
@@ -2561,7 +2561,7 @@ class J {
|
|
|
2561
2561
|
this.cache.clear();
|
|
2562
2562
|
}
|
|
2563
2563
|
}
|
|
2564
|
-
const ot = mt("ImageElement"),
|
|
2564
|
+
const ot = mt("ImageElement"), kt = 3e4, Et = 3, Ce = 1e3;
|
|
2565
2565
|
function C(r) {
|
|
2566
2566
|
return r.transformData;
|
|
2567
2567
|
}
|
|
@@ -2628,21 +2628,21 @@ class pt extends Q {
|
|
|
2628
2628
|
}, this.loadTimeoutId = setTimeout(() => {
|
|
2629
2629
|
if (i) return;
|
|
2630
2630
|
s(), o.src = "";
|
|
2631
|
-
const l = new Error(`Image load timed out after ${
|
|
2631
|
+
const l = new Error(`Image load timed out after ${kt}ms: ${t}`);
|
|
2632
2632
|
this.handleLoadFailure(t, l);
|
|
2633
|
-
},
|
|
2633
|
+
}, kt), (!o.src || o.src !== t) && (o.src = t), !i && o.complete && o.naturalWidth > 0 && ((h = o.onload) == null || h.call(o, new Event("load")));
|
|
2634
2634
|
}
|
|
2635
2635
|
/**
|
|
2636
2636
|
* Handle a load failure - either retry with backoff or set error state.
|
|
2637
2637
|
*/
|
|
2638
2638
|
handleLoadFailure(t, e) {
|
|
2639
|
-
if (this.retryAttempt++, this.retryAttempt <
|
|
2640
|
-
const o =
|
|
2639
|
+
if (this.retryAttempt++, this.retryAttempt < Et) {
|
|
2640
|
+
const o = Ce * Math.pow(2, this.retryAttempt - 1);
|
|
2641
2641
|
ot.warn(`Image load attempt ${this.retryAttempt} failed, retrying in ${o}ms:`, t), this.imageLoadState = "retrying", this.imageLoadError = e, et(this.id), this.loadTimeoutId = setTimeout(() => {
|
|
2642
2642
|
this.attemptLoadRegularImage(t);
|
|
2643
2643
|
}, o);
|
|
2644
2644
|
} else
|
|
2645
|
-
ot.error(`Image load failed after ${
|
|
2645
|
+
ot.error(`Image load failed after ${Et} attempts:`, t), this.imageLoaded = !1, this.imageLoadState = "error", this.imageLoadError = e, et(this.id);
|
|
2646
2646
|
}
|
|
2647
2647
|
/**
|
|
2648
2648
|
* Clear any pending load timeout
|
|
@@ -2885,8 +2885,8 @@ class pt extends Q {
|
|
|
2885
2885
|
if (this.isCropping) {
|
|
2886
2886
|
const I = i.x, O = i.y, B = C(i).cropWidth * C(i).width, L = C(i).cropHeight * C(i).height;
|
|
2887
2887
|
this.x = I, this.y = O;
|
|
2888
|
-
const _ = B / this.transformData.width, H = L / this.transformData.height, G = I - M, $ = O - k,
|
|
2889
|
-
this.transformData.cropX =
|
|
2888
|
+
const _ = B / this.transformData.width, H = L / this.transformData.height, G = I - M, $ = O - k, At = new R(this).worldDeltaToLocal(G, $), Jt = At.dx, qt = At.dy, jt = this.transformData.width / 2 + Jt, Zt = this.transformData.height / 2 + qt, Kt = jt / this.transformData.width - _ / 2, Qt = Zt / this.transformData.height - H / 2;
|
|
2889
|
+
this.transformData.cropX = Kt, this.transformData.cropY = Qt, this.transformData.cropWidth = _, this.transformData.cropHeight = H;
|
|
2890
2890
|
} else {
|
|
2891
2891
|
const I = (this.transformData.cropX + this.transformData.cropWidth / 2) * this.transformData.width - this.transformData.width / 2, O = (this.transformData.cropY + this.transformData.cropHeight / 2) * this.transformData.height - this.transformData.height / 2, B = I, L = O, H = new R(this).localDeltaToWorld(B, L), G = H.dx, $ = H.dy;
|
|
2892
2892
|
this.x = M + G, this.y = k + $;
|
|
@@ -2988,7 +2988,7 @@ class pt extends Q {
|
|
|
2988
2988
|
if (!this.isCropping) return null;
|
|
2989
2989
|
const i = this.getCropBoxBounds();
|
|
2990
2990
|
if (!i) return null;
|
|
2991
|
-
const s = this.worldToLocal(t, e), a = 1 / o, n =
|
|
2991
|
+
const s = this.worldToLocal(t, e), a = 1 / o, n = ce * a, h = de * a, l = ge * a, c = [
|
|
2992
2992
|
{ x: i.x, y: i.y, anchor: "top-left" },
|
|
2993
2993
|
{ x: i.x + i.width, y: i.y, anchor: "top-right" },
|
|
2994
2994
|
{ x: i.x, y: i.y + i.height, anchor: "bottom-left" },
|
|
@@ -3212,19 +3212,27 @@ class pt extends Q {
|
|
|
3212
3212
|
this.clearLoadTimeout(), this.releaseImageCache(), this.revokeSvgBlobUrl(), this.imageElement = null, this.onLoadCallback = null, this.imageLoadError = null;
|
|
3213
3213
|
}
|
|
3214
3214
|
}
|
|
3215
|
-
const
|
|
3216
|
-
|
|
3215
|
+
const _t = /* @__PURE__ */ new Map();
|
|
3216
|
+
let Ct = null;
|
|
3217
|
+
function Nt(r) {
|
|
3217
3218
|
return new Error(
|
|
3218
3219
|
`[paint-registry] no painter registered for ${r}. 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).`
|
|
3219
3220
|
);
|
|
3220
3221
|
}
|
|
3222
|
+
function So(r, t) {
|
|
3223
|
+
_t.set(r, t);
|
|
3224
|
+
}
|
|
3221
3225
|
function gt(r) {
|
|
3222
|
-
const t =
|
|
3223
|
-
if (!t) throw
|
|
3226
|
+
const t = _t.get(r);
|
|
3227
|
+
if (!t) throw Nt(`text transform "${r}"`);
|
|
3224
3228
|
return t;
|
|
3225
3229
|
}
|
|
3226
|
-
function
|
|
3227
|
-
|
|
3230
|
+
function Co(r) {
|
|
3231
|
+
Ct = r;
|
|
3232
|
+
}
|
|
3233
|
+
function Te() {
|
|
3234
|
+
if (!Ct) throw Nt("group clipping");
|
|
3235
|
+
return Ct;
|
|
3228
3236
|
}
|
|
3229
3237
|
class P {
|
|
3230
3238
|
constructor(t = []) {
|
|
@@ -3422,65 +3430,65 @@ class P {
|
|
|
3422
3430
|
return new P(t.spans);
|
|
3423
3431
|
}
|
|
3424
3432
|
}
|
|
3425
|
-
function
|
|
3433
|
+
function To(r) {
|
|
3426
3434
|
return r.type === "custom";
|
|
3427
3435
|
}
|
|
3428
|
-
function
|
|
3436
|
+
function vo(r) {
|
|
3429
3437
|
return r.type === "circle";
|
|
3430
3438
|
}
|
|
3431
|
-
function
|
|
3439
|
+
function Fo(r) {
|
|
3432
3440
|
return r.type === "arch";
|
|
3433
3441
|
}
|
|
3434
|
-
function
|
|
3442
|
+
function Mo(r) {
|
|
3435
3443
|
return r.type === "wave";
|
|
3436
3444
|
}
|
|
3437
|
-
function
|
|
3445
|
+
function Ao(r) {
|
|
3438
3446
|
return r.type === "flag";
|
|
3439
3447
|
}
|
|
3440
|
-
function
|
|
3448
|
+
function Do(r) {
|
|
3441
3449
|
return r.type === "image";
|
|
3442
3450
|
}
|
|
3443
|
-
function
|
|
3451
|
+
function Io(r) {
|
|
3444
3452
|
return r.type === "group";
|
|
3445
3453
|
}
|
|
3446
|
-
function
|
|
3454
|
+
function ko(r) {
|
|
3447
3455
|
return r.transformType !== "image" && r.transformType !== "group";
|
|
3448
3456
|
}
|
|
3449
|
-
function
|
|
3457
|
+
function Eo(r) {
|
|
3450
3458
|
return r.transformType === "image";
|
|
3451
3459
|
}
|
|
3452
|
-
function
|
|
3460
|
+
function Oo(r) {
|
|
3453
3461
|
return r.transformType === "custom";
|
|
3454
3462
|
}
|
|
3455
|
-
function
|
|
3463
|
+
function Bo(r) {
|
|
3456
3464
|
return r.transformType === "circle";
|
|
3457
3465
|
}
|
|
3458
|
-
function
|
|
3466
|
+
function Ro(r) {
|
|
3459
3467
|
return r.transformType === "group";
|
|
3460
3468
|
}
|
|
3461
|
-
function
|
|
3469
|
+
function Ho(r) {
|
|
3462
3470
|
return r.transformType === "shape";
|
|
3463
3471
|
}
|
|
3464
|
-
function
|
|
3472
|
+
function Po(r) {
|
|
3465
3473
|
return r.transformType === "path";
|
|
3466
3474
|
}
|
|
3467
|
-
function
|
|
3475
|
+
function Lo(r) {
|
|
3468
3476
|
return r.type === "shape";
|
|
3469
3477
|
}
|
|
3470
|
-
function
|
|
3478
|
+
function Wo(r) {
|
|
3471
3479
|
return r.type === "path";
|
|
3472
3480
|
}
|
|
3473
|
-
function
|
|
3481
|
+
function zo(r) {
|
|
3474
3482
|
var t;
|
|
3475
3483
|
return ((t = r.stroke) == null ? void 0 : t.enabled) === !0;
|
|
3476
3484
|
}
|
|
3477
|
-
function
|
|
3485
|
+
function Xo(r) {
|
|
3478
3486
|
return Array.isArray(r.masks) && r.masks.length > 0;
|
|
3479
3487
|
}
|
|
3480
|
-
function
|
|
3488
|
+
function Yo(r) {
|
|
3481
3489
|
return r.blendMode === "knockout" || r.blendMode === "clip";
|
|
3482
3490
|
}
|
|
3483
|
-
function
|
|
3491
|
+
function _o(r) {
|
|
3484
3492
|
var t;
|
|
3485
3493
|
return ((t = r.distressEffect) == null ? void 0 : t.enabled) === !0;
|
|
3486
3494
|
}
|
|
@@ -3589,7 +3597,7 @@ class q extends Q {
|
|
|
3589
3597
|
* Update font size
|
|
3590
3598
|
*/
|
|
3591
3599
|
setFontSize(t) {
|
|
3592
|
-
this.fontSize = Math.max(
|
|
3600
|
+
this.fontSize = Math.max(fe, Math.min(ue, t));
|
|
3593
3601
|
}
|
|
3594
3602
|
/**
|
|
3595
3603
|
* Update color
|
|
@@ -3638,7 +3646,7 @@ function at(r, t, e = !1, o = !1) {
|
|
|
3638
3646
|
const i = [];
|
|
3639
3647
|
return o && i.push("italic"), e && i.push("bold"), i.push(`${r}px`), i.push(t), i.join(" ");
|
|
3640
3648
|
}
|
|
3641
|
-
function
|
|
3649
|
+
function vt(r, t, e, o, i = !1, s = !1, a, n = !1) {
|
|
3642
3650
|
const l = yt().getContext("2d");
|
|
3643
3651
|
if (l.font = at(e, o, i, s), r.trim().length === 0)
|
|
3644
3652
|
return [r];
|
|
@@ -3647,7 +3655,7 @@ function Tt(r, t, e, o, i = !1, s = !1, a, n = !1) {
|
|
|
3647
3655
|
const M = r.split(`
|
|
3648
3656
|
`), k = [];
|
|
3649
3657
|
for (let I = 0; I < M.length; I++) {
|
|
3650
|
-
const O = M[I], B =
|
|
3658
|
+
const O = M[I], B = vt(O, t, e, o, i, s, void 0, n);
|
|
3651
3659
|
k.push(...B);
|
|
3652
3660
|
}
|
|
3653
3661
|
return k;
|
|
@@ -3697,25 +3705,25 @@ function Tt(r, t, e, o, i = !1, s = !1, a, n = !1) {
|
|
|
3697
3705
|
}
|
|
3698
3706
|
return w;
|
|
3699
3707
|
}
|
|
3700
|
-
function
|
|
3708
|
+
function Ot(r, t, e, o = !1, i = !1) {
|
|
3701
3709
|
const a = yt().getContext("2d");
|
|
3702
3710
|
return a.font = at(t, e, o, i), a.measureText(r).width;
|
|
3703
3711
|
}
|
|
3704
|
-
function
|
|
3712
|
+
function Tt(r, t, e = !1, o = !1) {
|
|
3705
3713
|
const s = yt().getContext("2d");
|
|
3706
3714
|
s.font = at(r, t, e, o);
|
|
3707
3715
|
const n = s.measureText("ÁÉÍgjpqy"), h = n.actualBoundingBoxAscent || r * 0.8, l = n.actualBoundingBoxDescent || r * 0.2, c = h + l;
|
|
3708
3716
|
return { ascent: h, descent: l, height: c };
|
|
3709
3717
|
}
|
|
3710
|
-
function
|
|
3711
|
-
const h =
|
|
3718
|
+
function Bt(r, t, e, o, i = !1, s = !1, a, n = !1) {
|
|
3719
|
+
const h = vt(r, t, e, o, i, s, a, n), l = r.includes(`
|
|
3712
3720
|
`), c = h.map((x, b) => ({
|
|
3713
3721
|
isParagraphStart: !l && b === 0,
|
|
3714
3722
|
isParagraphEnd: !l && b === h.length - 1
|
|
3715
3723
|
})), d = yt().getContext("2d");
|
|
3716
3724
|
d.font = at(e, o, i, s);
|
|
3717
3725
|
let f = 0;
|
|
3718
|
-
const u =
|
|
3726
|
+
const u = Tt(e, o, i, s);
|
|
3719
3727
|
let m = 0;
|
|
3720
3728
|
h.forEach((x, b) => {
|
|
3721
3729
|
const S = c[b].isParagraphStart, v = c[b].isParagraphEnd;
|
|
@@ -3734,7 +3742,7 @@ function Ot(r, t, e, o, i = !1, s = !1, a, n = !1) {
|
|
|
3734
3742
|
}
|
|
3735
3743
|
});
|
|
3736
3744
|
let p;
|
|
3737
|
-
const y =
|
|
3745
|
+
const y = Xt;
|
|
3738
3746
|
if (m === 1)
|
|
3739
3747
|
p = u.height;
|
|
3740
3748
|
else if (m === 0)
|
|
@@ -3750,7 +3758,7 @@ function Ot(r, t, e, o, i = !1, s = !1, a, n = !1) {
|
|
|
3750
3758
|
};
|
|
3751
3759
|
}
|
|
3752
3760
|
let lt = null;
|
|
3753
|
-
function
|
|
3761
|
+
function ve() {
|
|
3754
3762
|
if (!lt)
|
|
3755
3763
|
if (typeof OffscreenCanvas < "u")
|
|
3756
3764
|
lt = new OffscreenCanvas(1, 1).getContext("2d");
|
|
@@ -3760,8 +3768,8 @@ function Te() {
|
|
|
3760
3768
|
throw new Error("No canvas context available");
|
|
3761
3769
|
return lt;
|
|
3762
3770
|
}
|
|
3763
|
-
function
|
|
3764
|
-
const o =
|
|
3771
|
+
function Fe(r, t, e) {
|
|
3772
|
+
const o = ve(), i = [], s = (p, y) => {
|
|
3765
3773
|
const x = y.fontSize || e.fontSize, b = y.fontFamily || e.fontFamily, S = y.bold !== void 0 ? y.bold : e.bold || !1, v = y.italic !== void 0 ? y.italic : e.italic || !1;
|
|
3766
3774
|
return o.font = at(x, b, S, v), o.measureText(p).width;
|
|
3767
3775
|
}, a = (p, y) => p.fontSize === y.fontSize && p.fontFamily === y.fontFamily && p.color === y.color && p.bold === y.bold && p.italic === y.italic && p.underline === y.underline && p.strikethrough === y.strikethrough, n = [];
|
|
@@ -3838,7 +3846,7 @@ function ve(r, t, e) {
|
|
|
3838
3846
|
}), u += v;
|
|
3839
3847
|
}), m(), i.length === 0 && i.push([]), i;
|
|
3840
3848
|
}
|
|
3841
|
-
function
|
|
3849
|
+
function Me(r) {
|
|
3842
3850
|
const t = [];
|
|
3843
3851
|
let e = [];
|
|
3844
3852
|
return r.spans.forEach((o) => {
|
|
@@ -3852,10 +3860,10 @@ function Fe(r) {
|
|
|
3852
3860
|
function it(r) {
|
|
3853
3861
|
return typeof r.width == "number" ? r.width : void 0;
|
|
3854
3862
|
}
|
|
3855
|
-
function
|
|
3863
|
+
function Ut(r, t) {
|
|
3856
3864
|
r.width = t;
|
|
3857
3865
|
}
|
|
3858
|
-
function
|
|
3866
|
+
function Ae(r, t, e) {
|
|
3859
3867
|
const o = e.transformData, i = it(o), s = i !== void 0 ? i : e.width ?? 0, a = t / s, n = e.fontSize ?? r.fontSize, h = n * a;
|
|
3860
3868
|
let l;
|
|
3861
3869
|
if (h < 16 ? l = Math.round(h) : l = Math.round(h * 2) / 2, r.setFontSize(l), e.richText && e.richText instanceof P && typeof r.setRichText == "function") {
|
|
@@ -3870,31 +3878,31 @@ function Me(r, t, e) {
|
|
|
3870
3878
|
const c = r.transformData;
|
|
3871
3879
|
if (it(c) !== void 0 && i !== void 0) {
|
|
3872
3880
|
const d = n > 0 ? l / n : a, f = i * d;
|
|
3873
|
-
|
|
3881
|
+
Ut(c, Math.max(20, Math.ceil(f)));
|
|
3874
3882
|
}
|
|
3875
3883
|
}
|
|
3876
|
-
function
|
|
3884
|
+
function De(r, t, e, o) {
|
|
3877
3885
|
if (t !== "middle-left" && t !== "middle-right")
|
|
3878
3886
|
return;
|
|
3879
3887
|
r.fontSize = o.fontSize ?? r.fontSize;
|
|
3880
3888
|
const i = r.transformData;
|
|
3881
3889
|
if (it(i) !== void 0) {
|
|
3882
|
-
|
|
3890
|
+
Ut(i, Math.max(Yt, e));
|
|
3883
3891
|
const a = D.toRadiansInverse(r.rotation), n = Math.cos(a), h = Math.sin(a), l = o.transformData, g = it(l) ?? o.width ?? 0, f = (it(i) ?? 0) - g;
|
|
3884
3892
|
t === "middle-left" ? (r.x = o.x - f / 2 * n, r.y = o.y - f / 2 * h) : t === "middle-right" && (r.x = o.x + f / 2 * n, r.y = o.y + f / 2 * h);
|
|
3885
3893
|
}
|
|
3886
3894
|
}
|
|
3887
|
-
function
|
|
3895
|
+
function Gt(r, t, e, o, i) {
|
|
3888
3896
|
const s = t.includes("top") || t.includes("bottom"), a = t.includes("middle");
|
|
3889
|
-
s ?
|
|
3897
|
+
s ? Ae(r, e, i) : a && De(r, t, e, i);
|
|
3890
3898
|
}
|
|
3891
|
-
class
|
|
3899
|
+
class Ie extends q {
|
|
3892
3900
|
// Temporary property used during resize operations only
|
|
3893
3901
|
constructor(t = {}) {
|
|
3894
3902
|
super(t), this.transformType = "custom";
|
|
3895
3903
|
const e = t.transformData, o = (e == null ? void 0 : e.width) !== void 0 ? e.width : Math.max(
|
|
3896
|
-
|
|
3897
|
-
|
|
3904
|
+
Yt,
|
|
3905
|
+
Ot(this.text, this.fontSize, this.fontFamily, this.bold, this.italic) + j * 2
|
|
3898
3906
|
);
|
|
3899
3907
|
this.transformData = {
|
|
3900
3908
|
type: "custom",
|
|
@@ -3907,9 +3915,9 @@ class De extends q {
|
|
|
3907
3915
|
* Returns the total height based on the tallest font in each line
|
|
3908
3916
|
*/
|
|
3909
3917
|
calculateRichTextHeight() {
|
|
3910
|
-
const t = this.getRichText(), e = this.transformData.width - j * 2, o =
|
|
3918
|
+
const t = this.getRichText(), e = this.transformData.width - j * 2, o = Me(t), i = [];
|
|
3911
3919
|
if (o.forEach((h) => {
|
|
3912
|
-
|
|
3920
|
+
Fe(h, e, {
|
|
3913
3921
|
fontSize: this.fontSize,
|
|
3914
3922
|
fontFamily: this.fontFamily,
|
|
3915
3923
|
bold: this.bold,
|
|
@@ -3922,15 +3930,15 @@ class De extends q {
|
|
|
3922
3930
|
let s = 0, a = 0;
|
|
3923
3931
|
i.forEach((h) => {
|
|
3924
3932
|
h.forEach((l) => {
|
|
3925
|
-
const c = l.style.fontSize !== void 0 ? l.style.fontSize : this.fontSize, g = l.style.fontFamily !== void 0 ? l.style.fontFamily : this.fontFamily, d = l.style.bold !== void 0 ? l.style.bold : this.bold, f = l.style.italic !== void 0 ? l.style.italic : this.italic, u =
|
|
3933
|
+
const c = l.style.fontSize !== void 0 ? l.style.fontSize : this.fontSize, g = l.style.fontFamily !== void 0 ? l.style.fontFamily : this.fontFamily, d = l.style.bold !== void 0 ? l.style.bold : this.bold, f = l.style.italic !== void 0 ? l.style.italic : this.italic, u = Tt(c, g, d, f);
|
|
3926
3934
|
s = Math.max(s, u.height), a = Math.max(a, u.ascent);
|
|
3927
3935
|
});
|
|
3928
3936
|
});
|
|
3929
|
-
const n = this.fontSize *
|
|
3937
|
+
const n = this.fontSize * Xt;
|
|
3930
3938
|
if (i.length === 1)
|
|
3931
3939
|
return s;
|
|
3932
3940
|
{
|
|
3933
|
-
const h =
|
|
3941
|
+
const h = Tt(this.fontSize, this.fontFamily, this.bold, this.italic), l = (i.length - 1) * n + h.height, c = Math.max(0, a - h.ascent), g = Math.max(0, s - a - (h.height - h.ascent));
|
|
3934
3942
|
return l + c + g;
|
|
3935
3943
|
}
|
|
3936
3944
|
}
|
|
@@ -3952,7 +3960,7 @@ class De extends q {
|
|
|
3952
3960
|
getBoundingBox() {
|
|
3953
3961
|
const t = this.transformData.width - j * 2;
|
|
3954
3962
|
let e;
|
|
3955
|
-
return this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e =
|
|
3963
|
+
return this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Bt(
|
|
3956
3964
|
this.text,
|
|
3957
3965
|
t,
|
|
3958
3966
|
this.fontSize,
|
|
@@ -3978,7 +3986,7 @@ class De extends q {
|
|
|
3978
3986
|
getVisualBoundingBox() {
|
|
3979
3987
|
const t = this.transformData.width - j * 2;
|
|
3980
3988
|
let e;
|
|
3981
|
-
this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e =
|
|
3989
|
+
this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Bt(
|
|
3982
3990
|
this.text,
|
|
3983
3991
|
t,
|
|
3984
3992
|
this.fontSize,
|
|
@@ -4044,7 +4052,7 @@ class De extends q {
|
|
|
4044
4052
|
* Override getTransformStartData to capture initial line count
|
|
4045
4053
|
*/
|
|
4046
4054
|
getTransformStartData() {
|
|
4047
|
-
const t = super.getTransformStartData(), e = this.transformData.width - j * 2, o =
|
|
4055
|
+
const t = super.getTransformStartData(), e = this.transformData.width - j * 2, o = vt(this.text, e, this.fontSize, this.fontFamily, this.bold, this.italic);
|
|
4048
4056
|
return t.lineCount = o.length, t;
|
|
4049
4057
|
}
|
|
4050
4058
|
/**
|
|
@@ -4053,8 +4061,8 @@ class De extends q {
|
|
|
4053
4061
|
* Side handles: only width changes - text re-wraps naturally
|
|
4054
4062
|
*/
|
|
4055
4063
|
resize(t, e, o, i) {
|
|
4056
|
-
if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0),
|
|
4057
|
-
const n =
|
|
4064
|
+
if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0), Gt(this, t, e, o, i), this._lockedLineCount !== void 0 && this._lockedLineCount > 0) {
|
|
4065
|
+
const n = Ot(this.text, this.fontSize, this.fontFamily, this.bold, this.italic) / this._lockedLineCount + j * 2;
|
|
4058
4066
|
this.transformData.width < n && (this.transformData.width = Math.ceil(n));
|
|
4059
4067
|
}
|
|
4060
4068
|
}
|
|
@@ -4098,7 +4106,7 @@ class De extends q {
|
|
|
4098
4106
|
};
|
|
4099
4107
|
}
|
|
4100
4108
|
}
|
|
4101
|
-
function
|
|
4109
|
+
function ke(r, t, e, o) {
|
|
4102
4110
|
const i = D.toRadians(o), s = Math.cos(i), a = Math.sin(i);
|
|
4103
4111
|
let n = 0, h = 0;
|
|
4104
4112
|
e === "top-left" ? (n = r.width, h = r.height) : e === "top-right" ? (n = 0, h = r.height) : e === "bottom-left" ? (n = r.width, h = 0) : e === "bottom-right" && (n = 0, h = 0);
|
|
@@ -4108,14 +4116,14 @@ function Ie(r, t, e, o) {
|
|
|
4108
4116
|
const f = l - (g * s - d * a), u = c - (g * a + d * s);
|
|
4109
4117
|
return { x: f, y: u };
|
|
4110
4118
|
}
|
|
4111
|
-
function
|
|
4112
|
-
const i = r.width / 2, s = r.height +
|
|
4119
|
+
function No(r, t, e, o = 1) {
|
|
4120
|
+
const i = r.width / 2, s = r.height + le / o, a = r.x + i, n = r.y + s, h = D.toRadians(t), l = Math.cos(h), c = Math.sin(h), g = a - e.x, d = n - e.y, f = g * l - d * c, u = g * c + d * l;
|
|
4113
4121
|
return {
|
|
4114
4122
|
x: e.x + f,
|
|
4115
4123
|
y: e.y + u
|
|
4116
4124
|
};
|
|
4117
4125
|
}
|
|
4118
|
-
function
|
|
4126
|
+
function Uo(r, t, e) {
|
|
4119
4127
|
const o = D.toRadians(t), i = Math.cos(o), s = Math.sin(o), a = (c, g) => {
|
|
4120
4128
|
const d = r.x + c, f = r.y + g, u = d - e.x, m = f - e.y, p = u * i - m * s, y = u * s + m * i;
|
|
4121
4129
|
return {
|
|
@@ -4123,7 +4131,7 @@ function Yo(r, t, e) {
|
|
|
4123
4131
|
y: e.y + y
|
|
4124
4132
|
};
|
|
4125
4133
|
}, { width: n, height: h } = r, l = (c, g, d, f) => {
|
|
4126
|
-
const u = a(d, f), m =
|
|
4134
|
+
const u = a(d, f), m = Ee(
|
|
4127
4135
|
u.x,
|
|
4128
4136
|
u.y,
|
|
4129
4137
|
e.x,
|
|
@@ -4152,11 +4160,11 @@ function Yo(r, t, e) {
|
|
|
4152
4160
|
l("edge", "middle-bottom", n / 2, h)
|
|
4153
4161
|
];
|
|
4154
4162
|
}
|
|
4155
|
-
function
|
|
4163
|
+
function Go(r, t, e, o, i) {
|
|
4156
4164
|
const s = r - e, a = t - o;
|
|
4157
4165
|
return s * s + a * a <= i * i;
|
|
4158
4166
|
}
|
|
4159
|
-
function
|
|
4167
|
+
function $o(r, t, e, o) {
|
|
4160
4168
|
const i = D.toRadiansInverse(o), s = Math.cos(i), a = Math.sin(i), n = r - e.x, h = t - e.y, l = n * s - h * a, c = n * a + h * s;
|
|
4161
4169
|
return l >= 0 && l <= e.width && c >= 0 && c <= e.height;
|
|
4162
4170
|
}
|
|
@@ -4164,19 +4172,19 @@ function tt(r, t, e = "Arial", o = !1, i = !1) {
|
|
|
4164
4172
|
const a = document.createElement("canvas").getContext("2d"), n = o ? "bold" : "normal", h = i ? "italic" : "normal";
|
|
4165
4173
|
return a.font = `${h} ${n} ${t}px ${e}`, a.measureText(r).width;
|
|
4166
4174
|
}
|
|
4167
|
-
function
|
|
4175
|
+
function Vo(r) {
|
|
4168
4176
|
return {
|
|
4169
4177
|
x: r.x + r.width / 2,
|
|
4170
4178
|
y: r.y + r.height / 2
|
|
4171
4179
|
};
|
|
4172
4180
|
}
|
|
4173
|
-
function
|
|
4181
|
+
function Jo(r, t, e, o) {
|
|
4174
4182
|
return Math.atan2(o - t, e - r);
|
|
4175
4183
|
}
|
|
4176
|
-
function
|
|
4184
|
+
function qo(r, t, e) {
|
|
4177
4185
|
return Math.abs(r - t) <= e;
|
|
4178
4186
|
}
|
|
4179
|
-
function
|
|
4187
|
+
function Ee(r, t, e, o, i, s = 0, a = "") {
|
|
4180
4188
|
const n = r - e, h = t - o;
|
|
4181
4189
|
let l = Math.atan2(h, n) * (180 / Math.PI);
|
|
4182
4190
|
if (l = (l % 360 + 360) % 360, i === "corner") {
|
|
@@ -4193,17 +4201,17 @@ function ke(r, t, e, o, i, s = 0, a = "") {
|
|
|
4193
4201
|
return c >= 45 && c < 135 ? "ns-resize" : "ew-resize";
|
|
4194
4202
|
}
|
|
4195
4203
|
}
|
|
4196
|
-
function
|
|
4204
|
+
function Oe(r) {
|
|
4197
4205
|
if (!r.getTransform)
|
|
4198
4206
|
return 1;
|
|
4199
4207
|
const t = r.getTransform();
|
|
4200
4208
|
return Math.sqrt(t.a * t.a + t.b * t.b);
|
|
4201
4209
|
}
|
|
4202
|
-
function
|
|
4203
|
-
const o =
|
|
4210
|
+
function jo(r, t, e = []) {
|
|
4211
|
+
const o = Oe(r);
|
|
4204
4212
|
r.lineWidth = o > 0 ? t / o : t, e.length > 0 && r.setLineDash(o > 0 ? e.map((i) => i / o) : e);
|
|
4205
4213
|
}
|
|
4206
|
-
class
|
|
4214
|
+
class Be extends q {
|
|
4207
4215
|
constructor(t = {}) {
|
|
4208
4216
|
super(t), this.transformType = "circle";
|
|
4209
4217
|
const e = t.transformData;
|
|
@@ -4259,7 +4267,7 @@ class Oe extends q {
|
|
|
4259
4267
|
resize(t, e, o, i) {
|
|
4260
4268
|
const s = i.transformData, a = (e + o) / 2, n = (i.width + i.height) / 2, h = a / n, l = s.scale * h, c = Math.max(0.1, Math.min(10, l));
|
|
4261
4269
|
this.transformData.scale = c;
|
|
4262
|
-
const g = this.getBoundingBox(), d =
|
|
4270
|
+
const g = this.getBoundingBox(), d = ke(
|
|
4263
4271
|
{
|
|
4264
4272
|
x: i.x - s.radius * s.scale,
|
|
4265
4273
|
y: i.y - s.radius * s.scale,
|
|
@@ -4333,7 +4341,7 @@ class Oe extends q {
|
|
|
4333
4341
|
};
|
|
4334
4342
|
}
|
|
4335
4343
|
}
|
|
4336
|
-
class
|
|
4344
|
+
class Re extends q {
|
|
4337
4345
|
constructor(t = {}) {
|
|
4338
4346
|
super(t), this.transformType = "arch";
|
|
4339
4347
|
const e = t.transformData;
|
|
@@ -4438,14 +4446,14 @@ const st = {
|
|
|
4438
4446
|
frequency: 2,
|
|
4439
4447
|
// Standard flag frequency
|
|
4440
4448
|
width: 200
|
|
4441
|
-
}, Re = {
|
|
4442
|
-
archHeight: 0.5
|
|
4443
4449
|
}, He = {
|
|
4444
|
-
|
|
4450
|
+
archHeight: 0.5
|
|
4445
4451
|
}, Pe = {
|
|
4452
|
+
leanAmount: 0
|
|
4453
|
+
}, Le = {
|
|
4446
4454
|
ascendAngle: -15
|
|
4447
4455
|
};
|
|
4448
|
-
class
|
|
4456
|
+
class We extends q {
|
|
4449
4457
|
constructor(t = {}) {
|
|
4450
4458
|
super(t), this.transformType = "wave";
|
|
4451
4459
|
const e = t.transformData;
|
|
@@ -4480,7 +4488,7 @@ class Le extends q {
|
|
|
4480
4488
|
{ x: u / 2, y: s }
|
|
4481
4489
|
// bottom-right
|
|
4482
4490
|
].forEach((S) => {
|
|
4483
|
-
const v = S.x, w = S.y + x *
|
|
4491
|
+
const v = S.x, w = S.y + x * pe * S.x, T = m + v, F = y + w;
|
|
4484
4492
|
a = Math.min(a, T), n = Math.max(n, T), h = Math.min(h, F), l = Math.max(l, F);
|
|
4485
4493
|
}), c += u;
|
|
4486
4494
|
});
|
|
@@ -4493,7 +4501,7 @@ class Le extends q {
|
|
|
4493
4501
|
};
|
|
4494
4502
|
}
|
|
4495
4503
|
resize(t, e, o, i) {
|
|
4496
|
-
|
|
4504
|
+
Gt(this, t, e, o, i);
|
|
4497
4505
|
}
|
|
4498
4506
|
getEnabledAnchors() {
|
|
4499
4507
|
return ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
@@ -4514,7 +4522,7 @@ class Le extends q {
|
|
|
4514
4522
|
};
|
|
4515
4523
|
}
|
|
4516
4524
|
}
|
|
4517
|
-
class
|
|
4525
|
+
class ze extends q {
|
|
4518
4526
|
constructor(t = {}) {
|
|
4519
4527
|
super(t), this.transformType = "flag";
|
|
4520
4528
|
const e = t.transformData;
|
|
@@ -4610,7 +4618,7 @@ class We extends q {
|
|
|
4610
4618
|
};
|
|
4611
4619
|
}
|
|
4612
4620
|
}
|
|
4613
|
-
class
|
|
4621
|
+
class Xe extends q {
|
|
4614
4622
|
constructor(t = {}) {
|
|
4615
4623
|
super(t), this.transformType = "lean";
|
|
4616
4624
|
const e = t.transformData;
|
|
@@ -4700,7 +4708,7 @@ class ze extends q {
|
|
|
4700
4708
|
};
|
|
4701
4709
|
}
|
|
4702
4710
|
}
|
|
4703
|
-
class
|
|
4711
|
+
class Ye extends q {
|
|
4704
4712
|
constructor(t = {}) {
|
|
4705
4713
|
super(t), this.transformType = "ascend";
|
|
4706
4714
|
const e = t.transformData;
|
|
@@ -4793,7 +4801,7 @@ class Xe extends q {
|
|
|
4793
4801
|
};
|
|
4794
4802
|
}
|
|
4795
4803
|
}
|
|
4796
|
-
class
|
|
4804
|
+
class Ft extends Q {
|
|
4797
4805
|
constructor(t = {}) {
|
|
4798
4806
|
var o, i, s, a, n, h, l, c, g, d, f;
|
|
4799
4807
|
super(t), this.transformType = "shape";
|
|
@@ -4810,7 +4818,7 @@ class vt extends Q {
|
|
|
4810
4818
|
sides: ((l = t.transformData) == null ? void 0 : l.sides) ?? 5,
|
|
4811
4819
|
points: ((c = t.transformData) == null ? void 0 : c.points) ?? 5,
|
|
4812
4820
|
innerRadius: ((g = t.transformData) == null ? void 0 : g.innerRadius) ?? 0.4,
|
|
4813
|
-
fillColor: ((d = t.transformData) == null ? void 0 : d.fillColor) ||
|
|
4821
|
+
fillColor: ((d = t.transformData) == null ? void 0 : d.fillColor) || zt(),
|
|
4814
4822
|
fillOpacity: ((f = t.transformData) == null ? void 0 : f.fillOpacity) ?? 1
|
|
4815
4823
|
};
|
|
4816
4824
|
}
|
|
@@ -5258,7 +5266,7 @@ class vt extends Q {
|
|
|
5258
5266
|
* Clone this element
|
|
5259
5267
|
*/
|
|
5260
5268
|
clone() {
|
|
5261
|
-
return new
|
|
5269
|
+
return new Ft(this.toJSON());
|
|
5262
5270
|
}
|
|
5263
5271
|
/**
|
|
5264
5272
|
* Serialize to JSON
|
|
@@ -5280,7 +5288,7 @@ class vt extends Q {
|
|
|
5280
5288
|
};
|
|
5281
5289
|
}
|
|
5282
5290
|
}
|
|
5283
|
-
class
|
|
5291
|
+
class Mt extends Q {
|
|
5284
5292
|
constructor(t = {}) {
|
|
5285
5293
|
var e, o, i, s, a, n, h, l, c, g;
|
|
5286
5294
|
super(t), this.transformType = "path", this.transformData = {
|
|
@@ -5290,7 +5298,7 @@ class Ft extends Q {
|
|
|
5290
5298
|
width: ((i = t.transformData) == null ? void 0 : i.width) || 200,
|
|
5291
5299
|
height: ((s = t.transformData) == null ? void 0 : s.height) || 200,
|
|
5292
5300
|
fillEnabled: ((a = t.transformData) == null ? void 0 : a.fillEnabled) ?? !1,
|
|
5293
|
-
fillColor: ((n = t.transformData) == null ? void 0 : n.fillColor) ||
|
|
5301
|
+
fillColor: ((n = t.transformData) == null ? void 0 : n.fillColor) || zt(),
|
|
5294
5302
|
fillOpacity: ((h = t.transformData) == null ? void 0 : h.fillOpacity) ?? 1,
|
|
5295
5303
|
strokeEnabled: ((l = t.transformData) == null ? void 0 : l.strokeEnabled) ?? !0,
|
|
5296
5304
|
strokeColor: ((c = t.transformData) == null ? void 0 : c.strokeColor) || "#000000",
|
|
@@ -5556,7 +5564,7 @@ class Ft extends Q {
|
|
|
5556
5564
|
* Clone this element
|
|
5557
5565
|
*/
|
|
5558
5566
|
clone() {
|
|
5559
|
-
return new
|
|
5567
|
+
return new Mt(this.toJSON());
|
|
5560
5568
|
}
|
|
5561
5569
|
/**
|
|
5562
5570
|
* Serialize to JSON
|
|
@@ -5586,7 +5594,7 @@ class Ft extends Q {
|
|
|
5586
5594
|
};
|
|
5587
5595
|
}
|
|
5588
5596
|
}
|
|
5589
|
-
const
|
|
5597
|
+
const _e = {
|
|
5590
5598
|
circle: [
|
|
5591
5599
|
{
|
|
5592
5600
|
key: "reverse",
|
|
@@ -5599,7 +5607,7 @@ const Ye = {
|
|
|
5599
5607
|
{
|
|
5600
5608
|
key: "archHeight",
|
|
5601
5609
|
label: "Arch Height",
|
|
5602
|
-
defaultInternalValue:
|
|
5610
|
+
defaultInternalValue: He.archHeight,
|
|
5603
5611
|
// Slider 0-100 maps to internal -1 to 1
|
|
5604
5612
|
toSlider: (r) => (r + 1) / 2 * 100,
|
|
5605
5613
|
fromSlider: (r) => r / 100 * 2 - 1,
|
|
@@ -5652,7 +5660,7 @@ const Ye = {
|
|
|
5652
5660
|
{
|
|
5653
5661
|
key: "leanAmount",
|
|
5654
5662
|
label: "Lean Amount",
|
|
5655
|
-
defaultInternalValue:
|
|
5663
|
+
defaultInternalValue: Pe.leanAmount,
|
|
5656
5664
|
// Slider 0-100 maps to internal -0.5 to 0.5
|
|
5657
5665
|
// Display as -100% to 100%
|
|
5658
5666
|
toSlider: (r) => (r + 0.5) * 100,
|
|
@@ -5664,7 +5672,7 @@ const Ye = {
|
|
|
5664
5672
|
{
|
|
5665
5673
|
key: "ascendAngle",
|
|
5666
5674
|
label: "Ascend Amount",
|
|
5667
|
-
defaultInternalValue:
|
|
5675
|
+
defaultInternalValue: Le.ascendAngle,
|
|
5668
5676
|
// Slider 0-100 maps to internal angle +30° to -30°
|
|
5669
5677
|
// Display: slider 0 = -100% (down), slider 50 = 0%, slider 100 = +100% (up)
|
|
5670
5678
|
toSlider: (r) => (30 - r) / 60 * 100,
|
|
@@ -5740,19 +5748,19 @@ const Ye = {
|
|
|
5740
5748
|
toDisplay: (r) => `${(r * 100).toFixed(0)}%`
|
|
5741
5749
|
}
|
|
5742
5750
|
]
|
|
5743
|
-
},
|
|
5744
|
-
{ id: "custom", label: "CUSTOM", Component:
|
|
5751
|
+
}, $t = [
|
|
5752
|
+
{ id: "custom", label: "CUSTOM", Component: Ie },
|
|
5745
5753
|
// NOTE: distort transform is not yet implemented. Removed from registry
|
|
5746
5754
|
// to prevent it from appearing in UI that iterates over registered transforms.
|
|
5747
5755
|
// Re-add with a valid Component when implementation is ready.
|
|
5748
|
-
{ id: "circle", label: "CIRCLE", Component:
|
|
5749
|
-
{ id: "lean", label: "LEAN", Component:
|
|
5750
|
-
{ id: "arch", label: "ARCH", Component:
|
|
5751
|
-
{ id: "ascend", label: "ASCEND", Component:
|
|
5752
|
-
{ id: "wave", label: "WAVE", Component:
|
|
5753
|
-
{ id: "flag", label: "FLAG", Component:
|
|
5754
|
-
{ id: "shape", label: "SHAPE", Component:
|
|
5755
|
-
{ id: "path", label: "PATH", Component:
|
|
5756
|
+
{ id: "circle", label: "CIRCLE", Component: Be },
|
|
5757
|
+
{ id: "lean", label: "LEAN", Component: Xe },
|
|
5758
|
+
{ id: "arch", label: "ARCH", Component: Re },
|
|
5759
|
+
{ id: "ascend", label: "ASCEND", Component: Ye },
|
|
5760
|
+
{ id: "wave", label: "WAVE", Component: We },
|
|
5761
|
+
{ id: "flag", label: "FLAG", Component: ze },
|
|
5762
|
+
{ id: "shape", label: "SHAPE", Component: Ft },
|
|
5763
|
+
{ id: "path", label: "PATH", Component: Mt },
|
|
5756
5764
|
{ id: "image", label: "IMAGE", Component: pt },
|
|
5757
5765
|
// Use a getter to break circular dependency: GroupElement imports getTransformById
|
|
5758
5766
|
// from this module, so GroupElement may be in the TDZ during module evaluation.
|
|
@@ -5760,9 +5768,9 @@ const Ye = {
|
|
|
5760
5768
|
{ id: "group", label: "GROUP", get Component() {
|
|
5761
5769
|
return ut;
|
|
5762
5770
|
} }
|
|
5763
|
-
],
|
|
5764
|
-
function
|
|
5765
|
-
if (
|
|
5771
|
+
], Vt = new Set($t.map((r) => r.id)), ft = /* @__PURE__ */ new Map();
|
|
5772
|
+
function Zo(r, t) {
|
|
5773
|
+
if (Vt.has(r))
|
|
5766
5774
|
throw new Error(
|
|
5767
5775
|
`Cannot register transform type "${r}": conflicts with built-in type`
|
|
5768
5776
|
);
|
|
@@ -5772,19 +5780,19 @@ function Jo(r, t) {
|
|
|
5772
5780
|
);
|
|
5773
5781
|
ft.set(r, t);
|
|
5774
5782
|
}
|
|
5775
|
-
function
|
|
5776
|
-
if (
|
|
5783
|
+
function Ko(r) {
|
|
5784
|
+
if (Vt.has(r))
|
|
5777
5785
|
throw new Error(
|
|
5778
5786
|
`Cannot unregister transform type "${r}": built-in types cannot be removed`
|
|
5779
5787
|
);
|
|
5780
5788
|
return ft.delete(r);
|
|
5781
5789
|
}
|
|
5782
|
-
function
|
|
5783
|
-
const t =
|
|
5790
|
+
function Ne(r) {
|
|
5791
|
+
const t = $t.find((e) => e.id === r);
|
|
5784
5792
|
return t || ft.get(r);
|
|
5785
5793
|
}
|
|
5786
|
-
function
|
|
5787
|
-
return
|
|
5794
|
+
function Qo(r) {
|
|
5795
|
+
return _e[r] || [];
|
|
5788
5796
|
}
|
|
5789
5797
|
class ut extends Q {
|
|
5790
5798
|
constructor(t = {}) {
|
|
@@ -5801,7 +5809,7 @@ class ut extends Q {
|
|
|
5801
5809
|
*/
|
|
5802
5810
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- JSON deserialization: config comes from toJSON() and constructors accept Partial<Config> with varying signatures
|
|
5803
5811
|
_reconstructChildFromJSON(t) {
|
|
5804
|
-
const e = t.transformType || t.type, o =
|
|
5812
|
+
const e = t.transformType || t.type, o = Ne(e);
|
|
5805
5813
|
if (!o || !o.Component)
|
|
5806
5814
|
throw new Error(`Unknown transform type: ${e}`);
|
|
5807
5815
|
return new o.Component(t);
|
|
@@ -5888,7 +5896,7 @@ class ut extends Q {
|
|
|
5888
5896
|
*/
|
|
5889
5897
|
render(t, e = !1, o = !1) {
|
|
5890
5898
|
const i = this.children.filter((a) => a.visible !== !1);
|
|
5891
|
-
i.some((a) => a.isClipping) ?
|
|
5899
|
+
i.some((a) => a.isClipping) ? Te()(t, i) : i.forEach((a) => {
|
|
5892
5900
|
a.render(t, !1);
|
|
5893
5901
|
}), e ? this._renderGroupOutline(t, 1) : o && this._renderGroupOutline(t, 0.3);
|
|
5894
5902
|
}
|
|
@@ -5898,7 +5906,7 @@ class ut extends Q {
|
|
|
5898
5906
|
*/
|
|
5899
5907
|
_renderGroupOutline(t, e = 1) {
|
|
5900
5908
|
const o = this.getOrientedBoundingBox();
|
|
5901
|
-
t.save(), t.globalAlpha = e, t.strokeStyle =
|
|
5909
|
+
t.save(), t.globalAlpha = e, t.strokeStyle = Wt(), t.lineWidth = 2, t.setLineDash([5, 5]);
|
|
5902
5910
|
const i = this._rotationCenterX || this.x, s = this._rotationCenterY || this.y;
|
|
5903
5911
|
this.rotation !== 0 && (t.translate(i, s), t.rotate(-this.rotation * Math.PI / 180), t.translate(-i, -s)), t.strokeRect(o.x, o.y, o.width, o.height), t.setLineDash([]), t.restore();
|
|
5904
5912
|
}
|
|
@@ -6239,7 +6247,7 @@ class U {
|
|
|
6239
6247
|
throw new Error("Command.undo() must be implemented");
|
|
6240
6248
|
}
|
|
6241
6249
|
}
|
|
6242
|
-
class
|
|
6250
|
+
class ti extends U {
|
|
6243
6251
|
constructor(t, e, o, i) {
|
|
6244
6252
|
super(), this.elementId = t, this.oldElement = e ? e.clone() : null, this.newElement = o ? o.clone() : null, this.onUpdate = i;
|
|
6245
6253
|
}
|
|
@@ -6250,7 +6258,7 @@ class Zo extends U {
|
|
|
6250
6258
|
this.oldElement && this.onUpdate(this.oldElement);
|
|
6251
6259
|
}
|
|
6252
6260
|
}
|
|
6253
|
-
class
|
|
6261
|
+
class ei extends U {
|
|
6254
6262
|
constructor(t, e, o) {
|
|
6255
6263
|
super(), this.element = t.clone(), this.onAdd = e, this.onRemove = o;
|
|
6256
6264
|
}
|
|
@@ -6261,7 +6269,7 @@ class Ko extends U {
|
|
|
6261
6269
|
this.onRemove(this.element.id);
|
|
6262
6270
|
}
|
|
6263
6271
|
}
|
|
6264
|
-
class
|
|
6272
|
+
class oi extends U {
|
|
6265
6273
|
constructor(t, e, o) {
|
|
6266
6274
|
super(), this.element = t.clone(), this.onAdd = e, this.onRemove = o;
|
|
6267
6275
|
}
|
|
@@ -6272,7 +6280,7 @@ class Qo extends U {
|
|
|
6272
6280
|
this.onAdd(this.element);
|
|
6273
6281
|
}
|
|
6274
6282
|
}
|
|
6275
|
-
class
|
|
6283
|
+
class Ue extends U {
|
|
6276
6284
|
constructor(t) {
|
|
6277
6285
|
super(), this.commands = t;
|
|
6278
6286
|
}
|
|
@@ -6304,7 +6312,7 @@ class ct {
|
|
|
6304
6312
|
executeBatch(t) {
|
|
6305
6313
|
if (t.length === 0)
|
|
6306
6314
|
return;
|
|
6307
|
-
const e = new
|
|
6315
|
+
const e = new Ue(t);
|
|
6308
6316
|
this.execute(e);
|
|
6309
6317
|
}
|
|
6310
6318
|
/**
|
|
@@ -6349,7 +6357,7 @@ class ct {
|
|
|
6349
6357
|
};
|
|
6350
6358
|
}
|
|
6351
6359
|
}
|
|
6352
|
-
class
|
|
6360
|
+
class ii extends U {
|
|
6353
6361
|
constructor(t, e) {
|
|
6354
6362
|
super(), this.artboard = t.clone(), this.artboardManager = e;
|
|
6355
6363
|
}
|
|
@@ -6369,7 +6377,7 @@ class ti extends U {
|
|
|
6369
6377
|
this.artboardManager.deleteArtboard(this.artboard.id);
|
|
6370
6378
|
}
|
|
6371
6379
|
}
|
|
6372
|
-
class
|
|
6380
|
+
class si extends U {
|
|
6373
6381
|
constructor(t, e) {
|
|
6374
6382
|
super(), this.artboard = t.clone(), this.artboardManager = e, this.elementsOnArtboard = t.getElementIds();
|
|
6375
6383
|
}
|
|
@@ -6392,7 +6400,7 @@ class ei extends U {
|
|
|
6392
6400
|
});
|
|
6393
6401
|
}
|
|
6394
6402
|
}
|
|
6395
|
-
class
|
|
6403
|
+
class ri extends U {
|
|
6396
6404
|
constructor(t, e, o, i) {
|
|
6397
6405
|
super(), this.artboardId = t, this.oldProperties = { ...e }, this.newProperties = { ...o }, this.artboardManager = i;
|
|
6398
6406
|
}
|
|
@@ -6403,7 +6411,7 @@ class oi extends U {
|
|
|
6403
6411
|
this.artboardManager.updateArtboard(this.artboardId, this.oldProperties);
|
|
6404
6412
|
}
|
|
6405
6413
|
}
|
|
6406
|
-
class
|
|
6414
|
+
class ni extends U {
|
|
6407
6415
|
constructor(t, e, o, i, s) {
|
|
6408
6416
|
super(), this.draggedId = t, this.targetId = e, this.position = o, this.oldOrder = [...i], this.onReorder = s, this.newOrder = this.calculateNewOrder();
|
|
6409
6417
|
}
|
|
@@ -6423,8 +6431,8 @@ class ii extends U {
|
|
|
6423
6431
|
this.onReorder(this.oldOrder);
|
|
6424
6432
|
}
|
|
6425
6433
|
}
|
|
6426
|
-
const
|
|
6427
|
-
class
|
|
6434
|
+
const Ge = mt("HybridHistoryManager");
|
|
6435
|
+
class ai {
|
|
6428
6436
|
constructor(t, e = 50) {
|
|
6429
6437
|
this.commandExecutedCallbacks = [], this.globalHistory = new ct(e), this.artboardHistories = /* @__PURE__ */ new Map(), this.lastOperation = null, this.artboardManager = t, this.maxHistorySize = e;
|
|
6430
6438
|
}
|
|
@@ -6446,7 +6454,7 @@ class si {
|
|
|
6446
6454
|
try {
|
|
6447
6455
|
i(t, e, o);
|
|
6448
6456
|
} catch (s) {
|
|
6449
|
-
|
|
6457
|
+
Ge.error("Error in command executed callback:", s);
|
|
6450
6458
|
}
|
|
6451
6459
|
}
|
|
6452
6460
|
/**
|
|
@@ -6710,10 +6718,10 @@ class si {
|
|
|
6710
6718
|
}
|
|
6711
6719
|
const N = mt("FontAnalyzer");
|
|
6712
6720
|
let wt = null;
|
|
6713
|
-
async function
|
|
6721
|
+
async function $e() {
|
|
6714
6722
|
return wt || (wt = await import("./browser-module-DFvKXBUE.js")), wt;
|
|
6715
6723
|
}
|
|
6716
|
-
class
|
|
6724
|
+
class Ve {
|
|
6717
6725
|
constructor() {
|
|
6718
6726
|
this.fontCache = /* @__PURE__ */ new Map(), this.failedFonts = /* @__PURE__ */ new Set(), this.CACHE_DURATION = 1e3 * 60 * 30, this.MAX_CACHE_SIZE = 5;
|
|
6719
6727
|
}
|
|
@@ -6733,7 +6741,7 @@ class $e {
|
|
|
6733
6741
|
* Check if a font is a system font
|
|
6734
6742
|
*/
|
|
6735
6743
|
isSystemFont(t) {
|
|
6736
|
-
return
|
|
6744
|
+
return me.has(t);
|
|
6737
6745
|
}
|
|
6738
6746
|
/**
|
|
6739
6747
|
* Get Google Fonts API URL for a specific font family
|
|
@@ -6781,7 +6789,7 @@ class $e {
|
|
|
6781
6789
|
const a = await fetch(s);
|
|
6782
6790
|
if (!a.ok)
|
|
6783
6791
|
return N.error(`Font fetch failed: ${a.status} ${a.statusText}`), this.failedFonts.add(o), null;
|
|
6784
|
-
const n = await a.arrayBuffer(), h = new Uint8Array(n), c = (await
|
|
6792
|
+
const n = await a.arrayBuffer(), h = new Uint8Array(n), c = (await $e()).create(h), g = "fonts" in c ? c.fonts[0] : c;
|
|
6785
6793
|
return this.fontCache.set(o, {
|
|
6786
6794
|
font: g,
|
|
6787
6795
|
url: s,
|
|
@@ -7132,121 +7140,123 @@ class $e {
|
|
|
7132
7140
|
};
|
|
7133
7141
|
}
|
|
7134
7142
|
}
|
|
7135
|
-
const
|
|
7143
|
+
const hi = new Ve();
|
|
7136
7144
|
export {
|
|
7137
|
-
|
|
7145
|
+
Me as $,
|
|
7138
7146
|
nt as A,
|
|
7139
7147
|
Q as B,
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7148
|
+
re as C,
|
|
7149
|
+
Re as D,
|
|
7150
|
+
qe as E,
|
|
7151
|
+
xo as F,
|
|
7144
7152
|
ut as G,
|
|
7145
|
-
|
|
7153
|
+
Ye as H,
|
|
7146
7154
|
pt as I,
|
|
7147
|
-
|
|
7148
|
-
|
|
7155
|
+
Be as J,
|
|
7156
|
+
Ie as K,
|
|
7149
7157
|
Z as L,
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7158
|
+
ze as M,
|
|
7159
|
+
ai as N,
|
|
7160
|
+
Xe as O,
|
|
7161
|
+
Mt as P,
|
|
7162
|
+
ye as Q,
|
|
7155
7163
|
P as R,
|
|
7156
|
-
|
|
7164
|
+
Ft as S,
|
|
7157
7165
|
q as T,
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7166
|
+
ke as U,
|
|
7167
|
+
Uo as V,
|
|
7168
|
+
We as W,
|
|
7169
|
+
No as X,
|
|
7170
|
+
Go as Y,
|
|
7171
|
+
$o as Z,
|
|
7172
|
+
be as _,
|
|
7173
|
+
Xo as a,
|
|
7174
|
+
Fe as a0,
|
|
7167
7175
|
at as a1,
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7176
|
+
Ot as a2,
|
|
7177
|
+
Tt as a3,
|
|
7178
|
+
Bt as a4,
|
|
7171
7179
|
j as a5,
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7180
|
+
Xt as a6,
|
|
7181
|
+
pe as a7,
|
|
7182
|
+
So as a8,
|
|
7183
|
+
Co as a9,
|
|
7184
|
+
ro as aA,
|
|
7185
|
+
Jo as aB,
|
|
7186
|
+
ce as aC,
|
|
7187
|
+
Vo as aD,
|
|
7188
|
+
Ee as aE,
|
|
7189
|
+
qo as aF,
|
|
7190
|
+
uo as aG,
|
|
7191
|
+
io as aH,
|
|
7192
|
+
so as aI,
|
|
7193
|
+
oo as aJ,
|
|
7194
|
+
he as aK,
|
|
7195
|
+
eo as aL,
|
|
7196
|
+
to as aM,
|
|
7197
|
+
Ze as aN,
|
|
7198
|
+
po as aO,
|
|
7199
|
+
mo as aP,
|
|
7200
|
+
Qe as aQ,
|
|
7201
|
+
go as aR,
|
|
7202
|
+
fo as aS,
|
|
7203
|
+
lo as aT,
|
|
7204
|
+
je as aU,
|
|
7205
|
+
$t as aV,
|
|
7206
|
+
Qo as aW,
|
|
7207
|
+
wo as aX,
|
|
7208
|
+
Pe as aY,
|
|
7209
|
+
rt as aZ,
|
|
7210
|
+
J as aa,
|
|
7211
|
+
ti as ab,
|
|
7212
|
+
ei as ac,
|
|
7213
|
+
oi as ad,
|
|
7214
|
+
ii as ae,
|
|
7215
|
+
si as af,
|
|
7216
|
+
ri as ag,
|
|
7217
|
+
ni as ah,
|
|
7218
|
+
fe as ai,
|
|
7219
|
+
ue as aj,
|
|
7220
|
+
co as ak,
|
|
7221
|
+
He as al,
|
|
7222
|
+
st as am,
|
|
7223
|
+
bo as an,
|
|
7224
|
+
vt as ao,
|
|
7225
|
+
zt as ap,
|
|
7216
7226
|
no as aq,
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
+
Wt as ar,
|
|
7228
|
+
ao as as,
|
|
7229
|
+
ho as at,
|
|
7230
|
+
D as au,
|
|
7231
|
+
R as av,
|
|
7232
|
+
yo as aw,
|
|
7233
|
+
jo as ax,
|
|
7234
|
+
le as ay,
|
|
7235
|
+
Ke as az,
|
|
7236
|
+
zo as b,
|
|
7227
7237
|
mt as c,
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7238
|
+
Bo as d,
|
|
7239
|
+
vo as e,
|
|
7240
|
+
Oo as f,
|
|
7241
|
+
Ne as g,
|
|
7242
|
+
_o as h,
|
|
7243
|
+
Fo as i,
|
|
7244
|
+
To as j,
|
|
7245
|
+
Ao as k,
|
|
7246
|
+
Ro as l,
|
|
7247
|
+
Io as m,
|
|
7248
|
+
Eo as n,
|
|
7249
|
+
Do as o,
|
|
7250
|
+
Yo as p,
|
|
7251
|
+
Po as q,
|
|
7252
|
+
Zo as r,
|
|
7253
|
+
Wo as s,
|
|
7254
|
+
Ho as t,
|
|
7255
|
+
Ko as u,
|
|
7256
|
+
Lo as v,
|
|
7257
|
+
ko as w,
|
|
7258
|
+
Mo as x,
|
|
7259
|
+
Dt as y,
|
|
7260
|
+
hi as z
|
|
7251
7261
|
};
|
|
7252
|
-
//# sourceMappingURL=FontAnalyzer-
|
|
7262
|
+
//# sourceMappingURL=FontAnalyzer-CwIpgTGd.js.map
|