exodeui 6.3.39 → 6.3.40
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/index.js +23 -23
- package/dist/index.mjs +690 -685
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -83,9 +83,9 @@ function ps(g) {
|
|
|
83
83
|
b.widths[G] = z.widths[Y];
|
|
84
84
|
const N = z.kinds[Y];
|
|
85
85
|
if (N === 2) {
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
` ||
|
|
86
|
+
const Q = _[Y];
|
|
87
|
+
Q === `
|
|
88
|
+
` || Q === "\r" ? b.kinds[G] = 2 : b.kinds[G] = 0;
|
|
89
89
|
} else
|
|
90
90
|
b.kinds[G] = N;
|
|
91
91
|
}
|
|
@@ -222,15 +222,15 @@ function Es(g, t, i) {
|
|
|
222
222
|
return u.forEach((A) => {
|
|
223
223
|
let W = w, z = M;
|
|
224
224
|
h ? L ? z = n.top + (p - n.top - n.bottom - A.height) / 2 : P && (z = p - n.bottom - A.height) : k ? W = n.left + (l - n.left - n.right - A.width) / 2 : T && (W = l - n.right - A.width), A.children.forEach((Y) => {
|
|
225
|
-
var F,
|
|
225
|
+
var F, tt;
|
|
226
226
|
let G = W, N = z;
|
|
227
227
|
h ? k ? G += (A.width - Y.w) / 2 : T && (G += A.width - Y.w) : L ? N += (A.height - Y.h) / 2 : P && (N += A.height - Y.h);
|
|
228
|
-
const
|
|
228
|
+
const Q = ((F = Y.original.layoutProps) == null ? void 0 : F.width) === "fill", x = ((tt = Y.original.layoutProps) == null ? void 0 : tt.height) === "fill";
|
|
229
229
|
C.push({
|
|
230
230
|
id: Y.id,
|
|
231
231
|
x: G + Y.w / 2 - l / 2,
|
|
232
232
|
y: N + Y.h / 2 - p / 2,
|
|
233
|
-
width:
|
|
233
|
+
width: Q && h ? A.width : void 0,
|
|
234
234
|
height: x ? h ? void 0 : A.height : void 0
|
|
235
235
|
}), h ? z += Y.h + s : W += Y.w + s;
|
|
236
236
|
}), h ? w += A.width + s : M += A.height + s;
|
|
@@ -246,24 +246,24 @@ function As(g, t, i) {
|
|
|
246
246
|
y ? M = (p - v) / 2 : S && (M = p - v), C ? I = (c - b) / 2 : w && (I = c - b);
|
|
247
247
|
const k = [];
|
|
248
248
|
return t.forEach((T, L) => {
|
|
249
|
-
var
|
|
249
|
+
var tt, X;
|
|
250
250
|
const P = L % d.length || 0, _ = Math.floor(L / d.length) || 0;
|
|
251
251
|
_ >= u.length && u.push(100);
|
|
252
252
|
const E = d[P], A = u[_];
|
|
253
|
-
let W = r.left + M + d.slice(0, P).reduce((
|
|
253
|
+
let W = r.left + M + d.slice(0, P).reduce((et, R) => et + R + n, 0), z = r.top + I + u.slice(0, _).reduce((et, R) => et + R + a, 0);
|
|
254
254
|
const Y = i(T.id), G = T.geometry;
|
|
255
|
-
let N = (Y == null ? void 0 : Y.width) ?? G.width ?? 100,
|
|
255
|
+
let N = (Y == null ? void 0 : Y.width) ?? G.width ?? 100, Q = (Y == null ? void 0 : Y.height) ?? G.height ?? 100;
|
|
256
256
|
if (G.type === "Ellipse" || G.type === "Polygon" || G.type === "Star") {
|
|
257
|
-
const
|
|
258
|
-
N =
|
|
257
|
+
const et = (Y == null ? void 0 : Y.radius) ?? G.radius ?? (Y == null ? void 0 : Y.outer_radius) ?? G.outer_radius ?? 50;
|
|
258
|
+
N = et * 2, Q = et * 2;
|
|
259
259
|
}
|
|
260
|
-
N *= T.transform.scale_x || 1,
|
|
260
|
+
N *= T.transform.scale_x || 1, Q *= T.transform.scale_y || 1;
|
|
261
261
|
let x = W, F = z;
|
|
262
|
-
y ? x += (E - N) / 2 : S && (x += E - N), C ? F += (A -
|
|
262
|
+
y ? x += (E - N) / 2 : S && (x += E - N), C ? F += (A - Q) / 2 : w && (F += A - Q), k.push({
|
|
263
263
|
id: T.id,
|
|
264
264
|
x: x + N / 2 - f / 2,
|
|
265
|
-
y: F +
|
|
266
|
-
width: ((
|
|
265
|
+
y: F + Q / 2 - l / 2,
|
|
266
|
+
width: ((tt = T.layoutProps) == null ? void 0 : tt.width) === "fill" ? E : void 0,
|
|
267
267
|
height: ((X = T.layoutProps) == null ? void 0 : X.height) === "fill" ? A : void 0
|
|
268
268
|
});
|
|
269
269
|
}), { childUpdates: k };
|
|
@@ -593,22 +593,22 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
|
|
|
593
593
|
if (I && k && I.length !== void 0 && k.length !== void 0) {
|
|
594
594
|
const T = I.length * (I.scale_y ?? 1), L = I.rotation * Math.PI / 180, P = I.x - T * Math.sin(L), _ = I.y + T * Math.cos(L), E = k.length * (k.scale_y ?? 1), A = k.rotation * Math.PI / 180, W = k.x - E * Math.sin(A), z = k.y + E * Math.cos(A);
|
|
595
595
|
let Y = null, G = null, N = !1;
|
|
596
|
-
const
|
|
597
|
-
if (Math.hypot(I.x - k.x, I.y - k.y) <
|
|
596
|
+
const Q = 1;
|
|
597
|
+
if (Math.hypot(I.x - k.x, I.y - k.y) < Q || Math.hypot(I.x - W, I.y - z) < Q ? (Y = I.x, G = I.y) : (Math.hypot(P - k.x, _ - k.y) < Q || Math.hypot(P - W, _ - z) < Q) && (Y = P, G = _, N = !0), Y !== null && G !== null) {
|
|
598
598
|
const x = i[m[0].boneId] || [1, 0, 0, 1, 0, 0], F = x[0] * x[3] - x[1] * x[2];
|
|
599
|
-
let
|
|
599
|
+
let tt = 0, X = 0;
|
|
600
600
|
if (F !== 0) {
|
|
601
|
-
const
|
|
601
|
+
const et = (x[2] * x[5] - x[3] * x[4]) / F, R = (x[1] * x[4] - x[0] * x[5]) / F, O = Math.atan2(-x[1], x[3]);
|
|
602
602
|
if (!N)
|
|
603
|
-
|
|
603
|
+
tt = et, X = R;
|
|
604
604
|
else {
|
|
605
|
-
const ot = -x[2] / F, yt = x[0] / F, bt = Math.hypot(ot, yt),
|
|
606
|
-
|
|
605
|
+
const ot = -x[2] / F, yt = x[0] / F, bt = Math.hypot(ot, yt), pt = I.length * bt;
|
|
606
|
+
tt = et - pt * Math.sin(O), X = R + pt * Math.cos(O);
|
|
607
607
|
}
|
|
608
|
-
const D = Math.hypot(v -
|
|
608
|
+
const D = Math.hypot(v - tt, b - X), q = Math.hypot(l - Y, p - G);
|
|
609
609
|
if (q > 0 && D > 0) {
|
|
610
|
-
const ot = Math.max(q, 0.01), yt = Math.min(D / ot, 3), bt = Y + (l - Y) * yt,
|
|
611
|
-
l = l * (1 -
|
|
610
|
+
const ot = Math.max(q, 0.01), yt = Math.min(D / ot, 3), bt = Y + (l - Y) * yt, pt = G + (p - G) * yt, Et = m[0].amount, It = m[1].amount, vt = Math.min(Et, It) * 2, Yt = 1 - Math.pow(1 - vt, 4);
|
|
611
|
+
l = l * (1 - Yt) + bt * Yt, p = p * (1 - Yt) + pt * Yt;
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
}
|
|
@@ -1992,7 +1992,7 @@ class ci {
|
|
|
1992
1992
|
let C = y.geometry;
|
|
1993
1993
|
if (y.type === "Frame" || y.type === "Group" || !C || C.type !== "Path" && C.type !== "Ellipse" && C.type !== "Rectangle") {
|
|
1994
1994
|
const F = (m = this.artboard) == null ? void 0 : m.objects.find(
|
|
1995
|
-
(
|
|
1995
|
+
(tt) => tt.parentId === y.id && tt.type === "Shape" && tt.geometry && (tt.geometry.type === "Path" || tt.geometry.type === "Ellipse" || tt.geometry.type === "Rectangle")
|
|
1996
1996
|
);
|
|
1997
1997
|
F && (C = F.geometry);
|
|
1998
1998
|
}
|
|
@@ -2000,11 +2000,11 @@ class ci {
|
|
|
2000
2000
|
const w = (r.distance || 0) / 100, M = S.width || C.width || 0, I = S.height || C.height || 0, k = this.getPointOnPath(C, M, I, w), T = S.rotation * Math.PI / 180, L = Math.cos(T), P = Math.sin(T), _ = k.x * S.scale_x * L - k.y * S.scale_y * P, E = k.x * S.scale_x * P + k.y * S.scale_y * L;
|
|
2001
2001
|
let A = S.rotation + (r.offsetRotation || 0);
|
|
2002
2002
|
if (r.orient) {
|
|
2003
|
-
const F = Math.cos(k.angle),
|
|
2004
|
-
A = Math.atan2(
|
|
2003
|
+
const F = Math.cos(k.angle), tt = Math.sin(k.angle), X = F * S.scale_x * L - tt * S.scale_y * P, et = F * S.scale_x * P + tt * S.scale_y * L;
|
|
2004
|
+
A = Math.atan2(et, X) * 180 / Math.PI + (r.offsetRotation || 0);
|
|
2005
2005
|
}
|
|
2006
|
-
const W = A * Math.PI / 180, z = Math.cos(W), Y = Math.sin(W), G = (r.offsetX || 0) * z - (r.offsetY || 0) * Y, N = (r.offsetX || 0) * Y + (r.offsetY || 0) * z,
|
|
2007
|
-
if (e.x = e.x + (
|
|
2006
|
+
const W = A * Math.PI / 180, z = Math.cos(W), Y = Math.sin(W), G = (r.offsetX || 0) * z - (r.offsetY || 0) * Y, N = (r.offsetX || 0) * Y + (r.offsetY || 0) * z, Q = S.x + _ + G, x = S.y + E + N;
|
|
2007
|
+
if (e.x = e.x + (Q - e.x) * h, e.y = e.y + (x - e.y) * h, r.orient) {
|
|
2008
2008
|
let F = (A - e.rotation) % 360;
|
|
2009
2009
|
F > 180 && (F -= 360), F < -180 && (F += 360), e.rotation = e.rotation + F * h;
|
|
2010
2010
|
}
|
|
@@ -2284,8 +2284,8 @@ class ci {
|
|
|
2284
2284
|
b.forEach((_, E) => {
|
|
2285
2285
|
const A = _.data || [], W = I / Math.max(A.length - 1, 1);
|
|
2286
2286
|
A.forEach((z, Y) => {
|
|
2287
|
-
const G = C.x - y / 2 + w + Y * W, N = C.y + S / 2 - M - z / T * k,
|
|
2288
|
-
|
|
2287
|
+
const G = C.x - y / 2 + w + Y * W, N = C.y + S / 2 - M - z / T * k, Q = Math.sqrt((i - G) ** 2 + (o - N) ** 2);
|
|
2288
|
+
Q < L && (L = Q, P = { dIdx: E, pIdx: Y, val: z, label: _.label || `Dataset ${E + 1}` });
|
|
2289
2289
|
});
|
|
2290
2290
|
}), P && L < 20 && this.onGraphPointClick && this.onGraphPointClick({ objectId: c.id, componentName: c.name, datasetIndex: P.dIdx, pointIndex: P.pIdx, value: P.val, label: P.label }), this.onComponentChange && this.onComponentChange({ objectId: c.id, componentName: c.name, variant: "linegraph", property: "click", value: (P == null ? void 0 : P.val) ?? null });
|
|
2291
2291
|
}
|
|
@@ -2586,14 +2586,14 @@ class ci {
|
|
|
2586
2586
|
}
|
|
2587
2587
|
const _ = this.objectStates.get(c.id);
|
|
2588
2588
|
if (_) {
|
|
2589
|
-
const E = l.isRelative !== !1, A = E ? ((u = c.transform) == null ? void 0 : u.x) ?? 0 : 0, W = E ? ((v = c.transform) == null ? void 0 : v.y) ?? 0 : 0, z = E ? ((b = c.transform) == null ? void 0 : b.rotation) ?? 0 : 0, Y = E ? ((m = c.transform) == null ? void 0 : m.scale_x) ?? 1 : 0, G = E ? ((y = c.transform) == null ? void 0 : y.scale_y) ?? 1 : 0, N = E ? ((S = c.style) == null ? void 0 : S.opacity) ?? 100 : 0,
|
|
2589
|
+
const E = l.isRelative !== !1, A = E ? ((u = c.transform) == null ? void 0 : u.x) ?? 0 : 0, W = E ? ((v = c.transform) == null ? void 0 : v.y) ?? 0 : 0, z = E ? ((b = c.transform) == null ? void 0 : b.rotation) ?? 0 : 0, Y = E ? ((m = c.transform) == null ? void 0 : m.scale_x) ?? 1 : 0, G = E ? ((y = c.transform) == null ? void 0 : y.scale_y) ?? 1 : 0, N = E ? ((S = c.style) == null ? void 0 : S.opacity) ?? 100 : 0, Q = t * 60, x = (F, tt) => {
|
|
2590
2590
|
let X = L;
|
|
2591
2591
|
if (T) {
|
|
2592
|
-
const
|
|
2593
|
-
let R = _[
|
|
2594
|
-
R === void 0 && (R = _[F] ??
|
|
2592
|
+
const et = `_internal_${F}_${l.id}`;
|
|
2593
|
+
let R = _[et];
|
|
2594
|
+
R === void 0 && (R = _[F] ?? tt), X = R + P * Q, _[et] = X, l.step && l.step > 0 && (X = Math.round(X / l.step) * l.step);
|
|
2595
2595
|
} else
|
|
2596
|
-
X =
|
|
2596
|
+
X = tt + L;
|
|
2597
2597
|
_[F] = X;
|
|
2598
2598
|
};
|
|
2599
2599
|
l.targetProperty === "x" || l.targetProperty === "transform.x" ? x("x", A) : l.targetProperty === "y" || l.targetProperty === "transform.y" ? x("y", W) : l.targetProperty === "rotation" || l.targetProperty === "r" || l.targetProperty === "transform.rotation" ? x("rotation", z) : l.targetProperty === "scaleX" || l.targetProperty === "transform.scale_x" ? x("scale_x", Y) : l.targetProperty === "scaleY" || l.targetProperty === "transform.scale_y" ? x("scale_y", G) : (l.targetProperty === "opacity" || l.targetProperty === "transform.opacity") && x("opacity", N);
|
|
@@ -2950,20 +2950,20 @@ class ci {
|
|
|
2950
2950
|
}
|
|
2951
2951
|
*/
|
|
2952
2952
|
renderObject(t, i, o) {
|
|
2953
|
-
var u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N,
|
|
2953
|
+
var u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, Q, x, F, tt;
|
|
2954
2954
|
const e = this.objectStates.get(i.id);
|
|
2955
2955
|
if (!e) {
|
|
2956
2956
|
this.warn("No state for object:", i.id);
|
|
2957
2957
|
return;
|
|
2958
2958
|
}
|
|
2959
|
-
this.frameCount % 60, t.roundRect || (t.roundRect = (X,
|
|
2959
|
+
this.frameCount % 60, t.roundRect || (t.roundRect = (X, et, R, O, D) => (this.drawRoundRect(t, X, et, R, O, D), t));
|
|
2960
2960
|
const s = e.geometry ? this.deepMerge(i.geometry, e.geometry) : i.geometry;
|
|
2961
2961
|
let n = e.style ? this.deepMerge(i.style, e.style) : i.style, a = (s == null ? void 0 : s.width) || ((u = i.geometry) == null ? void 0 : u.width) || i.width || 0, r = (s == null ? void 0 : s.height) || ((v = i.geometry) == null ? void 0 : v.height) || i.height || 0;
|
|
2962
2962
|
if ((a === 0 || r === 0) && (s != null && s.points) && Array.isArray(s.points) && s.points.length > 0) {
|
|
2963
|
-
let X = 1 / 0,
|
|
2963
|
+
let X = 1 / 0, et = -1 / 0, R = 1 / 0, O = -1 / 0;
|
|
2964
2964
|
s.points.forEach((D) => {
|
|
2965
|
-
X = Math.min(X, D.x),
|
|
2966
|
-
}), a === 0 && (a =
|
|
2965
|
+
X = Math.min(X, D.x), et = Math.max(et, D.x), R = Math.min(R, D.y), O = Math.max(O, D.y);
|
|
2966
|
+
}), a === 0 && (a = et - X), r === 0 && (r = O - R);
|
|
2967
2967
|
}
|
|
2968
2968
|
const h = (X) => {
|
|
2969
2969
|
if (X)
|
|
@@ -2973,48 +2973,48 @@ class ci {
|
|
|
2973
2973
|
if (delete l.cornerRadius, l.corner_radius = f, l.type === "Path" && i.weights && i.bindMatrices && l.points) {
|
|
2974
2974
|
const X = this.getGlobalTransform(i.id);
|
|
2975
2975
|
if (X) {
|
|
2976
|
-
const
|
|
2976
|
+
const et = li(
|
|
2977
2977
|
l.points,
|
|
2978
2978
|
i.weights,
|
|
2979
2979
|
i.bindMatrices,
|
|
2980
2980
|
X,
|
|
2981
2981
|
(R) => this.getGlobalTransform(R)
|
|
2982
2982
|
);
|
|
2983
|
-
l = { ...l, points:
|
|
2983
|
+
l = { ...l, points: et };
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
2986
2986
|
if (e.visible === !1)
|
|
2987
2987
|
return;
|
|
2988
2988
|
const p = i.repeaterConfig, c = p && p.isEnabled && p.count > 1, d = c ? p.count : 1;
|
|
2989
2989
|
for (let X = 0; X < d; X++) {
|
|
2990
|
-
let
|
|
2990
|
+
let et = e.x !== void 0 ? e.x : ((b = e.transform) == null ? void 0 : b.x) ?? 0, R = e.y !== void 0 ? e.y : ((m = e.transform) == null ? void 0 : m.y) ?? 0, O = e.rotation !== void 0 ? e.rotation : ((y = e.transform) == null ? void 0 : y.rotation) ?? 0, D = e.scale_x !== void 0 ? e.scale_x : ((S = e.transform) == null ? void 0 : S.scale_x) ?? 1, q = e.scale_y !== void 0 ? e.scale_y : ((C = e.transform) == null ? void 0 : C.scale_y) ?? 1;
|
|
2991
2991
|
if (c && X > 0) {
|
|
2992
2992
|
if (p.type === "Linear") {
|
|
2993
|
-
const ht = p.offsetX || 0,
|
|
2994
|
-
|
|
2993
|
+
const ht = p.offsetX || 0, mt = p.offsetY || 0, at = p.rotation || 0, B = p.scale !== void 0 ? p.scale : 1;
|
|
2994
|
+
et += X * ht, R += X * mt, O += X * at, D *= Math.pow(B, X), q *= Math.pow(B, X);
|
|
2995
2995
|
} else if (p.type === "Grid") {
|
|
2996
|
-
const ht = p.cols || Math.ceil(Math.sqrt(p.count)),
|
|
2997
|
-
|
|
2996
|
+
const ht = p.cols || Math.ceil(Math.sqrt(p.count)), mt = p.gapX || 0, at = p.gapY || 0, B = Math.floor(X / ht), K = X % ht, j = a + mt, kt = r + at;
|
|
2997
|
+
et += K * j, R += B * kt;
|
|
2998
2998
|
} else if (p.type === "Radial") {
|
|
2999
|
-
const ht = p.radius || 100,
|
|
3000
|
-
|
|
2999
|
+
const ht = p.radius || 100, mt = p.startAngle || 0, B = (p.endAngle || 360) - mt, K = p.count > 1 ? B / (B === 360 ? p.count : p.count - 1) : 0, j = mt + X * K, kt = j * Math.PI / 180;
|
|
3000
|
+
et = e.x + ht * Math.cos(kt), R = e.y + ht * Math.sin(kt), O += j;
|
|
3001
3001
|
}
|
|
3002
3002
|
}
|
|
3003
3003
|
const ot = i.type === "Group" || i.type === "Frame" || i.type === "Component", yt = a > 0 && r > 0;
|
|
3004
3004
|
if (!ot && yt) {
|
|
3005
3005
|
const ht = (((w = n.shadow) == null ? void 0 : w.isEnabled) !== !1 ? (((M = n.shadow) == null ? void 0 : M.blur) || 0) + 10 : 0) + (((I = n.blur) == null ? void 0 : I.isEnabled) !== !1 && ((k = n.blur) == null ? void 0 : k.radius) || 0) + 20;
|
|
3006
|
-
if (!this.isObjectInView(t,
|
|
3006
|
+
if (!this.isObjectInView(t, et, R, a, r, ht))
|
|
3007
3007
|
continue;
|
|
3008
3008
|
}
|
|
3009
3009
|
this.debug_objectsRendered++, t.save();
|
|
3010
|
-
const bt = [],
|
|
3011
|
-
|
|
3010
|
+
const bt = [], pt = n.blur || ((T = i.style) == null ? void 0 : T.blur);
|
|
3011
|
+
pt && pt.amount > 0 && bt.push(`blur(${pt.amount}px)`);
|
|
3012
3012
|
const Et = n.effects || ((L = i.style) == null ? void 0 : L.effects) || [];
|
|
3013
3013
|
let It = Et.find((ht) => ht.isEnabled !== !1 && (ht.type === "BackgroundBlur" || ht.type === "LayerBlur"));
|
|
3014
3014
|
It || (It = n.effect || ((P = i.style) == null ? void 0 : P.effect) || Et.find((ht) => ht.isEnabled !== !1));
|
|
3015
|
-
const
|
|
3016
|
-
|
|
3017
|
-
const
|
|
3015
|
+
const vt = It, Yt = (vt == null ? void 0 : vt.isEnabled) !== !1, se = vt == null ? void 0 : vt.type, fe = (vt == null ? void 0 : vt.radius) ?? 10;
|
|
3016
|
+
Yt && se === "LayerBlur" ? bt.push(`blur(${fe}px)`) : Yt && se === "BackgroundBlur" && (n === i.style && (n = { ...n }), n.fill = { type: "None" });
|
|
3017
|
+
const st = ((_ = s == null ? void 0 : s.type) == null ? void 0 : _.toLowerCase().includes("image")) || ((E = i.type) == null ? void 0 : E.toLowerCase().includes("image")), gt = n.adjustments && Object.keys(n.adjustments).length > 0 ? n.adjustments : null, Rt = s != null && s.adjustments && Object.keys(s.adjustments).length > 0 ? s.adjustments : null, Pt = st ? Rt || gt : gt || Rt, dt = st && !Pt ? {
|
|
3018
3018
|
exposure: 0,
|
|
3019
3019
|
contrast: 0,
|
|
3020
3020
|
saturation: 100,
|
|
@@ -3025,35 +3025,35 @@ class ci {
|
|
|
3025
3025
|
blur: 0,
|
|
3026
3026
|
negative: 0,
|
|
3027
3027
|
hue: 0
|
|
3028
|
-
} :
|
|
3028
|
+
} : Pt;
|
|
3029
3029
|
if (e && dt && (e.geometry = e.geometry || {}, e.geometry.adjustments = { ...dt }), dt) {
|
|
3030
|
-
const ht = (dt.exposure || 0) / 100,
|
|
3031
|
-
let
|
|
3032
|
-
if (ht !== 0 && (
|
|
3033
|
-
<feComponentTransfer in="${
|
|
3030
|
+
const ht = (dt.exposure || 0) / 100, mt = dt.contrast || 0, at = 1 + (dt.saturation || 0) / 100, B = (dt.temperature || 0) / 200, K = (dt.tint || 0) / 200, j = (dt.highlights || 0) / 500, kt = (dt.shadows || 0) / 500;
|
|
3031
|
+
let At = "", Tt = "SourceGraphic";
|
|
3032
|
+
if (ht !== 0 && (At += `
|
|
3033
|
+
<feComponentTransfer in="${Tt}" result="exposure">
|
|
3034
3034
|
<feFuncR type="linear" slope="1" intercept="${ht}"/>
|
|
3035
3035
|
<feFuncG type="linear" slope="1" intercept="${ht}"/>
|
|
3036
3036
|
<feFuncB type="linear" slope="1" intercept="${ht}"/>
|
|
3037
|
-
</feComponentTransfer>`,
|
|
3038
|
-
const Mt = (
|
|
3039
|
-
|
|
3040
|
-
<feComponentTransfer in="${
|
|
3037
|
+
</feComponentTransfer>`, Tt = "exposure"), mt !== 0) {
|
|
3038
|
+
const Mt = (mt + 100) / 100, $ = 0.5 * (1 - Mt);
|
|
3039
|
+
At += `
|
|
3040
|
+
<feComponentTransfer in="${Tt}" result="contrast">
|
|
3041
3041
|
<feFuncR type="linear" slope="${Mt}" intercept="${$}"/>
|
|
3042
3042
|
<feFuncG type="linear" slope="${Mt}" intercept="${$}"/>
|
|
3043
3043
|
<feFuncB type="linear" slope="${Mt}" intercept="${$}"/>
|
|
3044
|
-
</feComponentTransfer>`,
|
|
3044
|
+
</feComponentTransfer>`, Tt = "contrast";
|
|
3045
3045
|
}
|
|
3046
|
-
if (at !== 1 && (
|
|
3046
|
+
if (at !== 1 && (At += `<feColorMatrix in="${Tt}" type="saturate" values="${at}" result="saturate"/>`, Tt = "saturate"), dt.hue && (At += `<feColorMatrix in="${Tt}" type="hueRotate" values="${dt.hue}" result="hue"/>`, Tt = "hue"), dt.negative) {
|
|
3047
3047
|
const Mt = 1 - dt.negative / 50;
|
|
3048
|
-
|
|
3049
|
-
<feColorMatrix in="${
|
|
3048
|
+
At += `
|
|
3049
|
+
<feColorMatrix in="${Tt}" type="matrix" result="invert"
|
|
3050
3050
|
values="${Mt} 0 0 0 ${1 - Mt}
|
|
3051
3051
|
0 ${Mt} 0 0 ${1 - Mt}
|
|
3052
3052
|
0 0 ${Mt} 0 ${1 - Mt}
|
|
3053
|
-
0 0 0 1 0"/>`,
|
|
3053
|
+
0 0 0 1 0"/>`, Tt = "invert";
|
|
3054
3054
|
}
|
|
3055
|
-
if (B !== 0 ||
|
|
3056
|
-
const Mt = 1 +
|
|
3055
|
+
if (B !== 0 || K !== 0 || j !== 0 || kt !== 0) {
|
|
3056
|
+
const Mt = 1 + j + kt, $ = Mt * (1 + B - K / 2), Wt = Mt * (1 + K), Kt = Mt * (1 - B - K / 2), te = dt.shadows * 0.1 / 255, Jt = [
|
|
3057
3057
|
$,
|
|
3058
3058
|
0,
|
|
3059
3059
|
0,
|
|
@@ -3075,10 +3075,10 @@ class ci {
|
|
|
3075
3075
|
1,
|
|
3076
3076
|
0
|
|
3077
3077
|
].join(" ");
|
|
3078
|
-
|
|
3078
|
+
At += `<feColorMatrix in="${Tt}" type="matrix" values="${Jt}" result="advanced"/>`, Tt = "advanced";
|
|
3079
3079
|
}
|
|
3080
|
-
if (dt.blur && (
|
|
3081
|
-
const Mt = `<svg xmlns="http://www.w3.org/2000/svg"><filter id="f" color-interpolation-filters="sRGB">${
|
|
3080
|
+
if (dt.blur && (At += `<feGaussianBlur in="${Tt}" stdDeviation="${dt.blur}" result="blur"/>`, Tt = "blur"), At) {
|
|
3081
|
+
const Mt = `<svg xmlns="http://www.w3.org/2000/svg"><filter id="f" color-interpolation-filters="sRGB">${At}</filter></svg>`, $ = btoa(Mt);
|
|
3082
3082
|
bt.push(`url('data:image/svg+xml;base64,${$}#f')`);
|
|
3083
3083
|
}
|
|
3084
3084
|
}
|
|
@@ -3127,41 +3127,41 @@ class ci {
|
|
|
3127
3127
|
feather: i.maskFeather || 0,
|
|
3128
3128
|
isVisible: !0
|
|
3129
3129
|
}] : []);
|
|
3130
|
-
let
|
|
3130
|
+
let ne = !1;
|
|
3131
3131
|
const me = Vt.filter((ht) => ht.isVisible !== !1 && o.has(ht.maskId));
|
|
3132
3132
|
if (me.length > 0) {
|
|
3133
|
-
const ht = me[0],
|
|
3134
|
-
at && at.visible !== !1 && (
|
|
3133
|
+
const ht = me[0], mt = o.get(ht.maskId), at = this.objectStates.get(mt.id);
|
|
3134
|
+
at && at.visible !== !1 && (ne = !0, (!this.maskBuffer || this.maskBuffer.width !== this.canvasWidth || this.maskBuffer.height !== this.canvasHeight) && (this.maskBuffer = document.createElement("canvas"), this.maskBuffer.width = this.canvasWidth, this.maskBuffer.height = this.canvasHeight, this.maskCtx = this.maskBuffer.getContext("2d", { willReadFrequently: !0 }), this.maskCtx && (this.maskCtx.imageSmoothingEnabled = !0, this.maskCtx.imageSmoothingQuality = "high")), this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, this.maskBuffer.width, this.maskBuffer.height), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), i.parentId && this.applyAbsoluteTransform(this.maskCtx, i.parentId, o), this.maskCtx.save(), this.maskCtx.globalAlpha = 1, t = this.maskCtx, t.filter = Ot.filter);
|
|
3135
3135
|
}
|
|
3136
|
-
t.translate(Math.round(
|
|
3136
|
+
t.translate(Math.round(et), Math.round(R)), t.rotate(O * Math.PI / 180);
|
|
3137
3137
|
const ye = e.skew_x || 0, Ut = e.skew_y || 0;
|
|
3138
3138
|
if (ye !== 0 || Ut !== 0) {
|
|
3139
|
-
const ht = Math.tan(ye * Math.PI / 180),
|
|
3140
|
-
t.transform(1 + ht *
|
|
3139
|
+
const ht = Math.tan(ye * Math.PI / 180), mt = Math.tan(Ut * Math.PI / 180);
|
|
3140
|
+
t.transform(1 + ht * mt, mt, ht, 1, 0, 0);
|
|
3141
3141
|
}
|
|
3142
3142
|
const Se = e.rotate_x !== void 0 ? e.rotate_x : ((A = e.transform) == null ? void 0 : A.rotate_x) ?? 0, Pe = e.rotate_y !== void 0 ? e.rotate_y : ((W = e.transform) == null ? void 0 : W.rotate_y) ?? 0, Ce = 1 + (e.translate_z !== void 0 ? e.translate_z : ((z = e.transform) == null ? void 0 : z.translate_z) ?? 0) / 1e3, Ae = (e.flip_x === !0 ? -1 : 1) * Math.cos(Pe * Math.PI / 180) * Ce, xe = (e.flip_y === !0 ? -1 : 1) * Math.cos(Se * Math.PI / 180) * Ce;
|
|
3143
3143
|
t.scale(
|
|
3144
3144
|
D * Ae,
|
|
3145
3145
|
q * xe
|
|
3146
3146
|
), n.shadow && n.shadow.isEnabled !== !0 && ((n.shadow.blur || 0) > 0 || Math.abs(n.shadow.offsetX || 0) > 0 || Math.abs(n.shadow.offsetY || 0) > 0) && (n.shadow.isEnabled = !0);
|
|
3147
|
-
const
|
|
3148
|
-
if (
|
|
3149
|
-
let ht =
|
|
3147
|
+
const ie = n.shadow;
|
|
3148
|
+
if (ie && ie.isEnabled !== !1) {
|
|
3149
|
+
let ht = ie.color || "#000000";
|
|
3150
3150
|
(G = (Y = this.artboard) == null ? void 0 : Y.tokens) != null && G.colors && this.artboard.tokens.colors[ht] && (ht = this.artboard.tokens.colors[ht]);
|
|
3151
|
-
const
|
|
3152
|
-
let
|
|
3151
|
+
const mt = this.normalizeOpacity(ie.opacity ?? 100), at = ie.spread || 0, K = (ie.blur || 0) + at * 1.5;
|
|
3152
|
+
let j = ht;
|
|
3153
3153
|
if (ht.startsWith("#")) {
|
|
3154
|
-
const
|
|
3155
|
-
|
|
3154
|
+
const Tt = ht.replace("#", ""), xt = parseInt(Tt.substring(0, 2), 16), Mt = parseInt(Tt.substring(2, 4), 16), $ = parseInt(Tt.substring(4, 6), 16);
|
|
3155
|
+
j = `rgba(${xt}, ${Mt}, ${$}, ${mt})`;
|
|
3156
3156
|
} else if (ht.startsWith("rgba")) {
|
|
3157
|
-
const
|
|
3158
|
-
if (
|
|
3159
|
-
const
|
|
3160
|
-
|
|
3157
|
+
const Tt = ht.match(/[\d.]+/g);
|
|
3158
|
+
if (Tt && Tt.length >= 4) {
|
|
3159
|
+
const xt = Tt[0], Mt = Tt[1], $ = Tt[2], Wt = Tt[3];
|
|
3160
|
+
j = `rgba(${xt}, ${Mt}, ${$}, ${parseFloat(Wt) * mt})`;
|
|
3161
3161
|
}
|
|
3162
3162
|
}
|
|
3163
|
-
const
|
|
3164
|
-
t.shadowColor =
|
|
3163
|
+
const kt = t.getTransform(), At = Math.sqrt(kt.a * kt.a + kt.b * kt.b) || 1;
|
|
3164
|
+
t.shadowColor = j, t.shadowBlur = K * At, t.shadowOffsetX = (ie.offsetX || 0) * At, t.shadowOffsetY = (ie.offsetY || 0) * At;
|
|
3165
3165
|
} else
|
|
3166
3166
|
t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
|
|
3167
3167
|
const jt = i.liquidFill || ((N = i.style) == null ? void 0 : N.liquidFill);
|
|
@@ -3169,32 +3169,32 @@ class ci {
|
|
|
3169
3169
|
t.save();
|
|
3170
3170
|
const ht = jt.fillLevel ?? 0.5;
|
|
3171
3171
|
t.beginPath();
|
|
3172
|
-
const
|
|
3173
|
-
t.rect(-a / 2,
|
|
3172
|
+
const mt = r / 2 - r * ht;
|
|
3173
|
+
t.rect(-a / 2, mt, a, r * ht), t.clip(), t.fillStyle = jt.color || "#3b82f6", t.globalAlpha = t.globalAlpha * (jt.opacity ?? 1);
|
|
3174
3174
|
}
|
|
3175
3175
|
if ((s == null ? void 0 : s.type) === "Text")
|
|
3176
3176
|
this._renderText(t, i, l, n, e, a, r, !1, !1, D, q);
|
|
3177
3177
|
else if ((s == null ? void 0 : s.type) === "Image") {
|
|
3178
3178
|
const ht = s.originalSrc || s.src;
|
|
3179
3179
|
if (ht) {
|
|
3180
|
-
let
|
|
3181
|
-
|
|
3182
|
-
this.log(`[ExodeUI] Image loaded successfully, size: ${
|
|
3183
|
-
},
|
|
3184
|
-
console.error("[ExodeUI] Image load failed:",
|
|
3185
|
-
},
|
|
3186
|
-
const at = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, B = (((
|
|
3180
|
+
let mt = this.imageCache.get(ht);
|
|
3181
|
+
mt || (mt = new Image(), mt.onload = () => {
|
|
3182
|
+
this.log(`[ExodeUI] Image loaded successfully, size: ${mt.naturalWidth}x${mt.naturalHeight}`);
|
|
3183
|
+
}, mt.onerror = (K) => {
|
|
3184
|
+
console.error("[ExodeUI] Image load failed:", K, `Src preview: ${ht.substring(0, 100)}...`);
|
|
3185
|
+
}, mt.src = ht, this.imageCache.set(ht, mt));
|
|
3186
|
+
const at = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, B = (((Q = n.stroke) == null ? void 0 : Q.alignment) || "center").toLowerCase();
|
|
3187
3187
|
if (at && (B === "outside" || B === "center") && this.applyStrokeAlignment(t, n, l, a, r, f, D, q), n.fill && n.fill.type !== "None") {
|
|
3188
3188
|
t.save();
|
|
3189
|
-
const
|
|
3190
|
-
t.fillStyle =
|
|
3189
|
+
const K = t.globalAlpha, j = this.createCanvasFill(t, n.fill, a, r);
|
|
3190
|
+
t.fillStyle = j || n.fill.color || "transparent", t.globalAlpha = K * this.normalizeOpacity(n.fill.opacity ?? 100), f !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = K, t.restore();
|
|
3191
3191
|
}
|
|
3192
|
-
|
|
3192
|
+
mt.complete && mt.naturalWidth > 0 ? (f !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.clip(), t.drawImage(mt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(mt, -a / 2, -r / 2, a, r), at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q)) : at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
|
|
3193
3193
|
}
|
|
3194
3194
|
} else if (s.type === "SVG") {
|
|
3195
3195
|
const ht = s.svgContent;
|
|
3196
3196
|
if (ht) {
|
|
3197
|
-
const
|
|
3197
|
+
const mt = n.palette || [], at = n.fill, B = n.stroke, K = at ? this.normalizeOpacity(at.opacity ?? 100) : 1, j = (at == null ? void 0 : at.type) === "Solid" && (!B || B.isEnabled === !1 || B.type === "Solid" && B.color === at.color), kt = at && at.type !== "None" ? j ? "monochrome" : at.type === "Solid" ? (at.color || "") + "|opacity:" + K : JSON.stringify(at.stops || []) + "|opacity:" + K : "", At = B && B.isEnabled !== !1 && (B.width || 0) > 0 ? j ? [
|
|
3198
3198
|
"monochrome",
|
|
3199
3199
|
B.width || 0,
|
|
3200
3200
|
B.trimStart ?? 0,
|
|
@@ -3213,87 +3213,87 @@ class ci {
|
|
|
3213
3213
|
B.trimEnd ?? 1,
|
|
3214
3214
|
B.trimOffset ?? 0,
|
|
3215
3215
|
B.dashOffset ?? 0
|
|
3216
|
-
].join("|") : "nostroke",
|
|
3216
|
+
].join("|") : "nostroke", Tt = [
|
|
3217
3217
|
i.id,
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3218
|
+
mt.join("_"),
|
|
3219
|
+
kt,
|
|
3220
|
+
At,
|
|
3221
3221
|
e.opacity ?? 100,
|
|
3222
3222
|
e.visible !== !1 ? "v" : "h"
|
|
3223
3223
|
].join("_");
|
|
3224
|
-
let
|
|
3225
|
-
if (!
|
|
3226
|
-
|
|
3224
|
+
let xt = this.imageCache.get(Tt);
|
|
3225
|
+
if (!xt) {
|
|
3226
|
+
xt = new Image(), xt.crossOrigin = "anonymous";
|
|
3227
3227
|
let $ = ht;
|
|
3228
3228
|
$.match(/xmlns=["']http:\/\/www\.w3\.org\/2000\/svg["']/i) || ($ = $.replace(/<svg([^>]*)>/i, (rt, V) => `<svg xmlns="http://www.w3.org/2000/svg"${V}>`));
|
|
3229
3229
|
let Wt = s.width || a || 100, Kt = s.height || r || 100;
|
|
3230
3230
|
const te = $.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
|
|
3231
3231
|
if (te && (Wt = parseFloat(te[1]), Kt = parseFloat(te[2])), $ = $.replace(/<svg([^>]*)>/i, (rt, V) => {
|
|
3232
|
-
let
|
|
3233
|
-
return
|
|
3234
|
-
}), s.colors && s.colors.length > 0 &&
|
|
3235
|
-
if (
|
|
3236
|
-
const
|
|
3237
|
-
$ = $.replace(
|
|
3232
|
+
let it = V.replace(/\b(?:width|height)=["'][^"']*["']/gi, " ");
|
|
3233
|
+
return it.match(/\bviewBox=/i) || (it += ` viewBox="0 0 ${Wt} ${Kt}"`), it.match(/\bpreserveAspectRatio=/i) || (it += ' preserveAspectRatio="none"'), it += ' width="100%" height="100%"', `<svg${it}>`;
|
|
3234
|
+
}), s.colors && s.colors.length > 0 && mt.length > 0 && s.colors.forEach((rt, V) => {
|
|
3235
|
+
if (mt[V]) {
|
|
3236
|
+
const it = rt.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), nt = new RegExp(it, "gi");
|
|
3237
|
+
$ = $.replace(nt, mt[V]);
|
|
3238
3238
|
}
|
|
3239
3239
|
}), at && at.type && at.type !== "None") {
|
|
3240
3240
|
if (at.type === "Solid" && at.color) {
|
|
3241
|
-
const rt =
|
|
3242
|
-
$ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (
|
|
3241
|
+
const rt = j ? "#FFFFFF" : at.color, V = j ? 1 : this.normalizeOpacity(at.opacity ?? 100);
|
|
3242
|
+
$ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (it) => /fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(it) ? it : `fill="${rt}"`), $ = $.replace(/fill\s*:\s*[^;"')]+/gi, (it) => /fill\s*:\s*(none|transparent)/i.test(it) ? it : `fill:${rt}`), V < 1 && ($ = $.replace(/\bfill-opacity\s*=\s*["'][^"']*["']/gi, `fill-opacity="${V}"`), $ = $.replace(/fill-opacity\s*:\s*[^;"')]+/gi, `fill-opacity:${V}`), $.match(/\bfill-opacity\s*=/i) || ($ = $.replace(/(<svg[^>]*>)/i, `$1<g fill-opacity="${V}">`), $ = $.replace(/<\/svg>/i, "</g></svg>")));
|
|
3243
3243
|
} else if (at.type === "LinearGradient" || at.type === "RadialGradient" || at.type === "Linear" || at.type === "Radial") {
|
|
3244
|
-
const rt = "exode-fill", V = this.normalizeOpacity(at.opacity ?? 100),
|
|
3245
|
-
const
|
|
3246
|
-
return `<stop offset="${
|
|
3244
|
+
const rt = "exode-fill", V = this.normalizeOpacity(at.opacity ?? 100), it = (at.stops || []).map((St) => {
|
|
3245
|
+
const Xt = St.offset !== void 0 ? St.offset : St.pos ?? 0, Qt = this.normalizeOpacity(St.opacity ?? 100) * V;
|
|
3246
|
+
return `<stop offset="${Xt * 100}%" stop-color="${St.color || "#000"}" stop-opacity="${Qt}"/>`;
|
|
3247
3247
|
}).join("");
|
|
3248
|
-
let
|
|
3248
|
+
let nt = "";
|
|
3249
3249
|
if (at.type === "LinearGradient" || at.type === "Linear") {
|
|
3250
|
-
const
|
|
3251
|
-
|
|
3250
|
+
const St = (Ht, Nt) => Array.isArray(Ht) ? Ht[Nt] ?? (Nt === 0 ? 0 : 1) : Ht && typeof Ht == "object" ? Ht[Nt === 0 ? "x" : "y"] ?? (Nt === 0 ? 0 : 1) : Nt === 0 ? 0 : 1, Xt = St(at.start, 0) * 100, Qt = St(at.start, 1) * 100, oe = St(at.end, 0) * 100, Gt = St(at.end, 1) * 100;
|
|
3251
|
+
nt = `<linearGradient id="${rt}" x1="${Xt}%" y1="${Qt}%" x2="${oe}%" y2="${Gt}%" gradientUnits="objectBoundingBox">${it}</linearGradient>`;
|
|
3252
3252
|
} else {
|
|
3253
|
-
const
|
|
3254
|
-
|
|
3253
|
+
const St = (Gt, Ht) => Array.isArray(Gt) ? Gt[Ht] ?? 0.5 : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? 0.5 : 0.5, Xt = St(at.center, 0) * 100, Qt = St(at.center, 1) * 100, oe = (at.radius ?? 0.5) * 100;
|
|
3254
|
+
nt = `<radialGradient id="${rt}" cx="${Xt}%" cy="${Qt}%" r="${oe}%" gradientUnits="objectBoundingBox">${it}</radialGradient>`;
|
|
3255
3255
|
}
|
|
3256
|
-
/<defs>/i.test($) ? $ = $.replace(/<defs>/i, `<defs>${
|
|
3256
|
+
/<defs>/i.test($) ? $ = $.replace(/<defs>/i, `<defs>${nt}`) : $ = $.replace(/<svg([^>]*)>/i, `<svg$1><defs>${nt}</defs>`), $ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (St) => /fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(St) ? St : `fill="url(#${rt})"`), $ = $.replace(/fill\s*:\s*[^;"')]+/gi, (St) => /fill\s*:\s*(none|transparent)/i.test(St) ? St : `fill:url(#${rt})`);
|
|
3257
3257
|
}
|
|
3258
3258
|
}
|
|
3259
|
-
const Jt = (rt, V,
|
|
3260
|
-
const
|
|
3261
|
-
const Ht = Gt.offset !== void 0 ? Gt.offset : Gt.pos ?? 0, Nt = this.normalizeOpacity(Gt.opacity ?? 100) *
|
|
3259
|
+
const Jt = (rt, V, it = 1) => {
|
|
3260
|
+
const nt = (rt.stops || []).map((Gt) => {
|
|
3261
|
+
const Ht = Gt.offset !== void 0 ? Gt.offset : Gt.pos ?? 0, Nt = this.normalizeOpacity(Gt.opacity ?? 100) * it;
|
|
3262
3262
|
return `<stop offset="${Ht * 100}%" stop-color="${Gt.color || "#000"}" stop-opacity="${Nt}"/>`;
|
|
3263
|
-
}).join(""),
|
|
3263
|
+
}).join(""), St = (Gt, Ht, Nt = 0.5) => Array.isArray(Gt) ? Gt[Ht] ?? Nt : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? Nt : Nt;
|
|
3264
3264
|
if (rt.type === "LinearGradient" || rt.type === "Linear") {
|
|
3265
|
-
const Gt =
|
|
3266
|
-
return `<linearGradient id="${V}" x1="${Gt}%" y1="${Ht}%" x2="${Nt}%" y2="${Ie}%" gradientUnits="objectBoundingBox">${
|
|
3265
|
+
const Gt = St(rt.start, 0, 0) * 100, Ht = St(rt.start, 1, 0) * 100, Nt = St(rt.end, 0, 1) * 100, Ie = St(rt.end, 1, 1) * 100;
|
|
3266
|
+
return `<linearGradient id="${V}" x1="${Gt}%" y1="${Ht}%" x2="${Nt}%" y2="${Ie}%" gradientUnits="objectBoundingBox">${nt}</linearGradient>`;
|
|
3267
3267
|
}
|
|
3268
|
-
const
|
|
3269
|
-
return `<radialGradient id="${V}" cx="${
|
|
3268
|
+
const Xt = St(rt.center, 0, 0.5) * 100, Qt = St(rt.center, 1, 0.5) * 100, oe = (rt.radius ?? 0.5) * 100;
|
|
3269
|
+
return `<radialGradient id="${V}" cx="${Xt}%" cy="${Qt}%" r="${oe}%" gradientUnits="objectBoundingBox">${nt}</radialGradient>`;
|
|
3270
3270
|
}, ut = (rt, V) => /<defs>/i.test(rt) ? rt.replace(/<defs>/i, `<defs>${V}`) : rt.replace(/(<svg[^>]*>)/i, `$1<defs>${V}</defs>`);
|
|
3271
3271
|
if (B && B.isEnabled !== !1 && (B.width || 0) > 0) {
|
|
3272
|
-
const rt =
|
|
3273
|
-
let
|
|
3274
|
-
const
|
|
3275
|
-
if (
|
|
3276
|
-
if (
|
|
3277
|
-
|
|
3278
|
-
else if (
|
|
3272
|
+
const rt = j ? 1 : this.normalizeOpacity(B.opacity ?? 100), V = j ? "#FFFFFF" : B.color || (at == null ? void 0 : at.color) || "#000000";
|
|
3273
|
+
let it = "";
|
|
3274
|
+
const nt = B.fill;
|
|
3275
|
+
if (nt && nt.type) {
|
|
3276
|
+
if (nt.type === "Solid")
|
|
3277
|
+
it = nt.color || B.color || "#000000";
|
|
3278
|
+
else if (nt.type === "LinearGradient" || nt.type === "RadialGradient" || nt.type === "Linear" || nt.type === "Radial") {
|
|
3279
3279
|
const zt = "exode-stroke";
|
|
3280
|
-
$ = ut($, Jt(
|
|
3280
|
+
$ = ut($, Jt(nt, zt, rt)), it = `url(#${zt})`;
|
|
3281
3281
|
}
|
|
3282
3282
|
}
|
|
3283
|
-
|
|
3283
|
+
it || (it = V), $.match(/\bstroke\s*=\s*["']/i) ? $ = $.replace(
|
|
3284
3284
|
/\bstroke\s*=\s*["'][^"']*["']/gi,
|
|
3285
|
-
(zt) => /stroke\s*=\s*["']\s*(none|transparent)\s*["']/i.test(zt) ? zt : `stroke="${
|
|
3286
|
-
) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke="${
|
|
3285
|
+
(zt) => /stroke\s*=\s*["']\s*(none|transparent)\s*["']/i.test(zt) ? zt : `stroke="${it}"`
|
|
3286
|
+
) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke="${it}"`), $ = $.replace(
|
|
3287
3287
|
new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`, "gi"),
|
|
3288
|
-
`stroke:${
|
|
3288
|
+
`stroke:${it}`
|
|
3289
3289
|
);
|
|
3290
|
-
let
|
|
3290
|
+
let St = s.width || a || 100, Xt = s.height || r || 100;
|
|
3291
3291
|
const Qt = ht.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
|
|
3292
3292
|
if (Qt) {
|
|
3293
|
-
const zt = parseFloat(Qt[1]),
|
|
3294
|
-
!isNaN(zt) && !isNaN(
|
|
3293
|
+
const zt = parseFloat(Qt[1]), ae = parseFloat(Qt[2]);
|
|
3294
|
+
!isNaN(zt) && !isNaN(ae) && (St = zt, Xt = ae);
|
|
3295
3295
|
}
|
|
3296
|
-
const
|
|
3296
|
+
const oe = Math.max(1e-3, a / St), Gt = Math.max(1e-3, r / Xt), Ht = (oe + Gt) / 2, Nt = (B.width || 1) / Ht;
|
|
3297
3297
|
$.match(/\bstroke-width\s*=\s*["']/i) ? $ = $.replace(/\bstroke-width\s*=\s*["'][^"']*["']/gi, `stroke-width="${Nt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-width="${Nt}"`), $ = $.replace(/stroke-width\s*:\s*[^;"')]+/gi, `stroke-width:${Nt}`), $.match(/\bstroke-opacity\s*=\s*["']/i) ? $ = $.replace(/\bstroke-opacity\s*=\s*["'][^"']*["']/gi, `stroke-opacity="${rt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-opacity="${rt}"`), $ = $.replace(/stroke-opacity\s*:\s*[^;"')]+/gi, `stroke-opacity:${rt}`);
|
|
3298
3298
|
const Ie = B.lineCap || "round";
|
|
3299
3299
|
$.match(/\bstroke-linecap\s*=\s*["']/i) ? $ = $.replace(/\bstroke-linecap\s*=\s*["'][^"']*["']/gi, `stroke-linecap="${Ie}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linecap="${Ie}"`), $ = $.replace(/stroke-linecap\s*:\s*[^;"')]+/gi, `stroke-linecap:${Ie}`);
|
|
@@ -3301,14 +3301,14 @@ class ci {
|
|
|
3301
3301
|
$.match(/\bstroke-linejoin\s*=\s*["']/i) ? $ = $.replace(/\bstroke-linejoin\s*=\s*["'][^"']*["']/gi, `stroke-linejoin="${Le}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linejoin="${Le}"`), $ = $.replace(/stroke-linejoin\s*:\s*[^;"')]+/gi, `stroke-linejoin:${Le}`);
|
|
3302
3302
|
const Re = B.trimStart ?? 0, Oe = B.trimEnd ?? 1, Fe = B.trimOffset ?? 0, $e = B.dashOffset ?? 0, Ye = Re !== 0 || Oe !== 1 || Fe !== 0 || $e !== 0;
|
|
3303
3303
|
if (Ye) {
|
|
3304
|
-
const zt = Math.max(0, Math.min(1, Re)),
|
|
3305
|
-
this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${zt}, End: ${
|
|
3306
|
-
const we = (
|
|
3304
|
+
const zt = Math.max(0, Math.min(1, Re)), ae = Math.max(0, Math.min(1, Oe));
|
|
3305
|
+
this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${zt}, End: ${ae}`);
|
|
3306
|
+
const we = (St + Xt) * 2, Be = (Fe % 1 + 1) % 1, We = ($e % 1 + 1) % 1;
|
|
3307
3307
|
let de = "", ce = 0;
|
|
3308
|
-
if (zt >=
|
|
3308
|
+
if (zt >= ae)
|
|
3309
3309
|
de = `0 ${we}`, ce = 0;
|
|
3310
3310
|
else {
|
|
3311
|
-
const he = we * (
|
|
3311
|
+
const he = we * (ae - zt), ke = we - he;
|
|
3312
3312
|
ce = -(we * (zt + Be + We)), de = `${he} ${ke}`;
|
|
3313
3313
|
}
|
|
3314
3314
|
$.match(/\bstroke-dasharray\s*=/i) ? $ = $.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi, `stroke-dasharray="${de}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-dasharray="${de}"`), $ = $.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi, `stroke-dasharray:${de}`), $.match(/\bstroke-dashoffset\s*=/i) ? $ = $.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi, `stroke-dashoffset="${ce}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-dashoffset="${ce}"`), $ = $.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi, `stroke-dashoffset:${ce}`);
|
|
@@ -3317,17 +3317,17 @@ class ci {
|
|
|
3317
3317
|
$ = $.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi, `stroke-dasharray="${zt}"`), $ = $.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi, `stroke-dasharray:${zt}`), B.dashOffset && ($ = $.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi, `stroke-dashoffset="${B.dashOffset}"`), $ = $.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi, `stroke-dashoffset:${B.dashOffset}`));
|
|
3318
3318
|
}
|
|
3319
3319
|
if (!/\bstroke\s*=\s*["']/i.test(ht) && !new RegExp("(?<![a-z-])stroke\\s*:", "i").test(ht)) {
|
|
3320
|
-
let zt = "",
|
|
3320
|
+
let zt = "", ae = "";
|
|
3321
3321
|
if (Ye) {
|
|
3322
3322
|
const de = s.width || a || 100, ce = s.height || r || 100, he = (de + ce) * 2, ke = Math.max(0, Math.min(1, Re)), Xe = Math.max(0, Math.min(1, Oe)), Ve = (Fe % 1 + 1) % 1, Ne = ($e % 1 + 1) % 1;
|
|
3323
3323
|
if (ke >= Xe)
|
|
3324
|
-
zt = ` stroke-dasharray="0 ${he}"`,
|
|
3324
|
+
zt = ` stroke-dasharray="0 ${he}"`, ae = ' stroke-dashoffset="0"';
|
|
3325
3325
|
else {
|
|
3326
3326
|
const De = he * (Xe - ke), He = he - De, H = -(he * (ke + Ve + Ne));
|
|
3327
|
-
zt = ` stroke-dasharray="${De} ${He}"`,
|
|
3327
|
+
zt = ` stroke-dasharray="${De} ${He}"`, ae = ` stroke-dashoffset="${H}"`;
|
|
3328
3328
|
}
|
|
3329
|
-
} else (x = B.dashArray) != null && x.length && (zt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (
|
|
3330
|
-
const we = ` stroke-linecap="${B.lineCap || "round"}"`, Be = ` stroke-linejoin="${B.lineJoin || "round"}"`, We = `stroke="${
|
|
3329
|
+
} else (x = B.dashArray) != null && x.length && (zt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (ae = ` stroke-dashoffset="${B.dashOffset}"`));
|
|
3330
|
+
const we = ` stroke-linecap="${B.lineCap || "round"}"`, Be = ` stroke-linejoin="${B.lineJoin || "round"}"`, We = `stroke="${it}" stroke-width="${Nt}" stroke-opacity="${rt}"${we}${Be}${zt}${ae}`;
|
|
3331
3331
|
$ = $.replace(
|
|
3332
3332
|
/(<svg[^>]*>)(\s*(?:<defs>[\s\S]*?<\/defs>)?)/i,
|
|
3333
3333
|
(de, ce, he) => `${ce}${he}<g ${We}>`
|
|
@@ -3335,19 +3335,19 @@ class ci {
|
|
|
3335
3335
|
}
|
|
3336
3336
|
} else B && B.isEnabled === !1 && ($ = $.replace(/\bstroke\s*=\s*["'][^"']*["']/gi, 'stroke="none"'), $ = $.replace(new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`, "gi"), "stroke:none"));
|
|
3337
3337
|
const ct = new Blob([$], { type: "image/svg+xml" }), Ct = URL.createObjectURL(ct);
|
|
3338
|
-
|
|
3338
|
+
xt.onload = () => {
|
|
3339
3339
|
if (URL.revokeObjectURL(Ct), this.frameCount % 900 === 0) {
|
|
3340
|
-
const rt = this.imageCache.get(
|
|
3340
|
+
const rt = this.imageCache.get(Tt);
|
|
3341
3341
|
rt && this.debugLog(`SVG Payload Ready: ${i.name || i.id} (${rt.naturalWidth}x${rt.naturalHeight})`);
|
|
3342
3342
|
}
|
|
3343
|
-
},
|
|
3343
|
+
}, xt.onerror = () => {
|
|
3344
3344
|
URL.revokeObjectURL(Ct), this.debugLog(`SVG Error: Failed to load payload for ${i.name || i.id}`);
|
|
3345
|
-
},
|
|
3345
|
+
}, xt.src = Ct, this.imageCache.set(Tt, xt);
|
|
3346
3346
|
}
|
|
3347
3347
|
let Mt = null;
|
|
3348
|
-
if (
|
|
3348
|
+
if (xt.complete && xt.naturalWidth > 0 ? (Mt = xt, this.lastValidSvgImgMap.set(i.id, xt)) : Mt = this.lastValidSvgImgMap.get(i.id) || null, Mt && Mt.complete && Mt.naturalWidth > 0) {
|
|
3349
3349
|
const $ = Math.max(1, a), Wt = Math.max(1, r);
|
|
3350
|
-
if (
|
|
3350
|
+
if (j && (at == null ? void 0 : at.type) === "Solid") {
|
|
3351
3351
|
this.maskBuffer || (this.maskBuffer = document.createElement("canvas"), this.maskCtx = this.maskBuffer.getContext("2d")), this.maskBuffer.width = $, this.maskBuffer.height = Wt, this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, $, Wt), this.maskCtx.drawImage(Mt, 0, 0, $, Wt), this.maskCtx.globalCompositeOperation = "source-in";
|
|
3352
3352
|
const Kt = at.color || "#000000", te = this.normalizeOpacity(at.opacity ?? 100);
|
|
3353
3353
|
this.maskCtx.fillStyle = Kt, this.maskCtx.globalAlpha = te, this.maskCtx.fillRect(0, 0, $, Wt), t.drawImage(this.maskBuffer, -$ / 2, -Wt / 2, $, Wt);
|
|
@@ -3357,54 +3357,59 @@ class ci {
|
|
|
3357
3357
|
} else if (l.type === "LineGraph")
|
|
3358
3358
|
this.renderLineGraph(t, l, a, r);
|
|
3359
3359
|
else if (i.type === "Shape") {
|
|
3360
|
-
|
|
3361
|
-
|
|
3360
|
+
this.applyPath(t, l, a, r, f), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`);
|
|
3361
|
+
const ht = Yt && se === "BackgroundBlur";
|
|
3362
|
+
if (ht)
|
|
3363
|
+
this.applyBackgroundBlurGlass(t, l, a, r, f, vt);
|
|
3364
|
+
else if (n.fill) {
|
|
3365
|
+
const at = t.globalAlpha;
|
|
3362
3366
|
if (((F = n.fill) == null ? void 0 : F.type) === "Image" && (n.fill.originalSrc || n.fill.src)) {
|
|
3363
|
-
const
|
|
3364
|
-
let
|
|
3365
|
-
|
|
3367
|
+
const B = n.fill.originalSrc || n.fill.src;
|
|
3368
|
+
let K = this.imageCache.get(B);
|
|
3369
|
+
K || (K = new Image(), K.src = B, this.imageCache.set(B, K)), K.complete && K.naturalWidth > 0 && (t.save(), this.applyPath(t, l, a, r, f), t.clip(), this.renderFittedImage(t, K, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
|
|
3366
3370
|
} else {
|
|
3367
|
-
const
|
|
3368
|
-
t.fillStyle =
|
|
3371
|
+
const B = this.createCanvasFill(t, n.fill, a, r);
|
|
3372
|
+
t.fillStyle = B || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = at * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, l, a, r, f), t.fill();
|
|
3369
3373
|
}
|
|
3370
|
-
t.globalAlpha =
|
|
3374
|
+
t.globalAlpha = at;
|
|
3371
3375
|
}
|
|
3372
|
-
t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
|
|
3376
|
+
t.restore(), n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1 ? this.applyStrokeAlignment(t, n, l, a, r, f, D, q) : ht && (t.save(), t.globalAlpha = 1, t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1.5, this.applyPath(t, l, a, r, f), t.stroke(), t.restore());
|
|
3373
3377
|
} else if (i.type === "Frame" || i.type === "Group" && !i.isStructuralGroup) {
|
|
3374
|
-
const ht = e.width ?? s.width ?? i.width ?? a,
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
+
const ht = e.width ?? s.width ?? i.width ?? a, mt = e.height ?? s.height ?? i.height ?? r, at = f;
|
|
3379
|
+
t.save(), t.beginPath(), this.drawRoundRect(t, -ht / 2, -mt / 2, ht, mt, at);
|
|
3380
|
+
const B = Yt && se === "BackgroundBlur", K = { type: "Rectangle" };
|
|
3381
|
+
if (B)
|
|
3382
|
+
this.applyBackgroundBlurGlass(t, K, ht, mt, at, vt);
|
|
3383
|
+
else if (n.fill && n.fill.type !== "None") {
|
|
3384
|
+
const kt = t.globalAlpha, At = this.createCanvasFill(t, n.fill, ht, mt);
|
|
3385
|
+
t.fillStyle = At || n.fill.color || "transparent", t.globalAlpha = kt * this.normalizeOpacity(n.fill.opacity ?? 100), t.fill(), t.globalAlpha = kt;
|
|
3378
3386
|
}
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
} else i.type === "Group" && i.isStructuralGroup || (i.type === "Component" && i.variant === "inputbox" ? this.renderInputBox(t, i) : i.type === "Component" && i.variant === "button" ? this.renderButton(t, i) : i.type === "Component" && i.variant === "toggle_button" ? this.renderToggleButton(t, i) : i.type === "Toggle" || i.type === "Component" && i.variant === "toggle" ? this.renderToggle(t, i) : i.type === "Slider" || i.type === "Component" && i.variant === "slider" ? this.renderSlider(t, i) : i.type === "Dropdown" || i.type === "Component" && i.variant === "dropdown" ? this.renderDropdown(t, i) : i.type === "ListView" || i.type === "Component" && i.variant === "listview" ? this.renderListView(t, i) : i.type === "Checkbox" || i.type === "Component" && i.variant === "checkbox" ? this.renderCheckbox(t, i) : i.type === "RadioGroup" || i.type === "Component" && i.variant === "radiogroup" ? this.renderRadioGroup(t, i) : i.type === "BarChart" || i.type === "Component" && i.variant === "barchart" ? this.renderBarChart(t, i) : i.type === "PieChart" || i.type === "Component" && i.variant === "piechart" ? this.renderPieChart(t, i) : i.type === "Joystick" || i.type === "Component" && i.variant === "joystick" ? this.renderJoystick(t, i) : this.frameCount % 300 === 0 && this.warn("[Engine] Unhandled object type in renderObject:", i.type, "Geo:", (j = i.geometry) == null ? void 0 : j.type));
|
|
3384
|
-
if (this.applyArtEffectOverlay(t, i, l, a, r, f), Xt && le === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, l, a, r, f, St), jt && jt.enabled && t.restore(), i.children && i.children.length > 0) {
|
|
3385
|
-
const pt = i.type === "Frame", at = i.clipsContent !== void 0 ? i.clipsContent : i.clipContent !== void 0 ? i.clipContent : pt;
|
|
3387
|
+
t.restore(), n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1 ? this.applyStrokeAlignment(t, n, K, ht, mt, at, D, q) : B && (t.save(), t.globalAlpha = 1, t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1.5, this.applyPath(t, K, ht, mt, at), t.stroke(), t.restore());
|
|
3388
|
+
} else i.type === "Group" && i.isStructuralGroup || (i.type === "Component" && i.variant === "inputbox" ? this.renderInputBox(t, i) : i.type === "Component" && i.variant === "button" ? this.renderButton(t, i) : i.type === "Component" && i.variant === "toggle_button" ? this.renderToggleButton(t, i) : i.type === "Toggle" || i.type === "Component" && i.variant === "toggle" ? this.renderToggle(t, i) : i.type === "Slider" || i.type === "Component" && i.variant === "slider" ? this.renderSlider(t, i) : i.type === "Dropdown" || i.type === "Component" && i.variant === "dropdown" ? this.renderDropdown(t, i) : i.type === "ListView" || i.type === "Component" && i.variant === "listview" ? this.renderListView(t, i) : i.type === "Checkbox" || i.type === "Component" && i.variant === "checkbox" ? this.renderCheckbox(t, i) : i.type === "RadioGroup" || i.type === "Component" && i.variant === "radiogroup" ? this.renderRadioGroup(t, i) : i.type === "BarChart" || i.type === "Component" && i.variant === "barchart" ? this.renderBarChart(t, i) : i.type === "PieChart" || i.type === "Component" && i.variant === "piechart" ? this.renderPieChart(t, i) : i.type === "Joystick" || i.type === "Component" && i.variant === "joystick" ? this.renderJoystick(t, i) : this.frameCount % 300 === 0 && this.warn("[Engine] Unhandled object type in renderObject:", i.type, "Geo:", (tt = i.geometry) == null ? void 0 : tt.type));
|
|
3389
|
+
if (this.applyArtEffectOverlay(t, i, l, a, r, f), Yt && se === "BackgroundBlur" && i.type !== "Shape" && i.type !== "Frame" && i.type !== "Group" && (this.applyBackgroundBlurGlass(t, l, a, r, f, vt), (!n.stroke || n.stroke.width === 0 || n.stroke.isEnabled === !1) && (t.save(), t.globalAlpha = 1, t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1.5, this.applyPath(t, l, a, r, f), t.stroke(), t.restore())), jt && jt.enabled && t.restore(), i.children && i.children.length > 0) {
|
|
3390
|
+
const mt = i.type === "Frame", at = i.clipsContent !== void 0 ? i.clipsContent : i.clipContent !== void 0 ? i.clipContent : mt;
|
|
3386
3391
|
if (t.save(), at) {
|
|
3387
3392
|
t.beginPath();
|
|
3388
|
-
const
|
|
3389
|
-
this.drawRoundRect(t, -
|
|
3393
|
+
const K = e.width ?? (s == null ? void 0 : s.width) ?? i.width ?? 0, j = e.height ?? (s == null ? void 0 : s.height) ?? i.height ?? 0, kt = e.cornerRadius ?? (s == null ? void 0 : s.corner_radius) ?? i.cornerRadius ?? 0;
|
|
3394
|
+
this.drawRoundRect(t, -K / 2, -j / 2, K, j, kt), t.clip();
|
|
3390
3395
|
}
|
|
3391
3396
|
let B = 0;
|
|
3392
|
-
for (i.children.forEach((
|
|
3393
|
-
const
|
|
3394
|
-
if (!
|
|
3395
|
-
const
|
|
3396
|
-
if (
|
|
3397
|
-
const
|
|
3398
|
-
this.applyObjectTransform(t,
|
|
3399
|
-
const Mt = (
|
|
3400
|
-
this.applyPath(t,
|
|
3397
|
+
for (i.children.forEach((K) => {
|
|
3398
|
+
const j = o.get(K);
|
|
3399
|
+
if (!j) return;
|
|
3400
|
+
const kt = this.objectStates.get(K), At = (kt == null ? void 0 : kt.geometry) || j.geometry;
|
|
3401
|
+
if (At && At.isMask && (kt == null ? void 0 : kt.visible) !== !1) {
|
|
3402
|
+
const Tt = At.width || 0, xt = At.height || 0;
|
|
3403
|
+
this.applyObjectTransform(t, K);
|
|
3404
|
+
const Mt = (kt == null ? void 0 : kt.corner_radius) ?? (At == null ? void 0 : At.corner_radius) ?? 0;
|
|
3405
|
+
this.applyPath(t, At, Tt, xt, Mt), t.clip(), B++;
|
|
3401
3406
|
} else
|
|
3402
|
-
this.renderObject(t,
|
|
3407
|
+
this.renderObject(t, j, o);
|
|
3403
3408
|
}); B > 0; )
|
|
3404
3409
|
t.restore(), B--;
|
|
3405
3410
|
t.restore();
|
|
3406
3411
|
}
|
|
3407
|
-
if (
|
|
3412
|
+
if (ne) {
|
|
3408
3413
|
this.maskCtx.restore(), (e.masks || (i.maskedBy ? [{
|
|
3409
3414
|
maskId: i.maskedBy,
|
|
3410
3415
|
inverted: i.maskInverted === !0,
|
|
@@ -3414,71 +3419,71 @@ class ci {
|
|
|
3414
3419
|
isVisible: !0
|
|
3415
3420
|
}] : [])).filter((B) => B.isVisible !== !1 && o.has(B.maskId)).forEach((B) => {
|
|
3416
3421
|
var Mt, $, Wt, Kt, te, Jt;
|
|
3417
|
-
const
|
|
3422
|
+
const K = o.get(B.maskId), j = this.objectStates.get(K.id), kt = B.feather || 0, At = B.inverted === !0, Tt = B.opacity !== void 0 ? typeof B.opacity == "number" ? B.opacity : B.opacity / 100 : 1;
|
|
3418
3423
|
if ((B.type || "alpha") === "luma") {
|
|
3419
|
-
(!this.lumaBuffer || this.lumaBuffer.width !== this.maskBuffer.width || this.lumaBuffer.height !== this.maskBuffer.height) && (this.lumaBuffer = document.createElement("canvas"), this.lumaBuffer.width = this.maskBuffer.width, this.lumaBuffer.height = this.maskBuffer.height, this.lumaCtx = this.lumaBuffer.getContext("2d", { willReadFrequently: !0 }), this.lumaCtx && (this.lumaCtx.imageSmoothingEnabled = !0, this.lumaCtx.imageSmoothingQuality = "high")), this.lumaCtx.setTransform(1, 0, 0, 1, 0, 0), this.lumaCtx.globalCompositeOperation = "source-over", this.lumaCtx.globalAlpha = 1, this.lumaCtx.filter = "none", this.lumaCtx.clearRect(0, 0, this.lumaBuffer.width, this.lumaBuffer.height), this.lumaCtx.save(), this.rootTransform && this.lumaCtx.setTransform(this.rootTransform), this.applyAbsoluteTransform(this.lumaCtx,
|
|
3420
|
-
const ut = (
|
|
3421
|
-
if (((Mt =
|
|
3422
|
-
const
|
|
3423
|
-
this._renderText(this.lumaCtx,
|
|
3424
|
-
} else if ((($ =
|
|
3425
|
-
const
|
|
3426
|
-
if (
|
|
3427
|
-
let
|
|
3428
|
-
|
|
3424
|
+
(!this.lumaBuffer || this.lumaBuffer.width !== this.maskBuffer.width || this.lumaBuffer.height !== this.maskBuffer.height) && (this.lumaBuffer = document.createElement("canvas"), this.lumaBuffer.width = this.maskBuffer.width, this.lumaBuffer.height = this.maskBuffer.height, this.lumaCtx = this.lumaBuffer.getContext("2d", { willReadFrequently: !0 }), this.lumaCtx && (this.lumaCtx.imageSmoothingEnabled = !0, this.lumaCtx.imageSmoothingQuality = "high")), this.lumaCtx.setTransform(1, 0, 0, 1, 0, 0), this.lumaCtx.globalCompositeOperation = "source-over", this.lumaCtx.globalAlpha = 1, this.lumaCtx.filter = "none", this.lumaCtx.clearRect(0, 0, this.lumaBuffer.width, this.lumaBuffer.height), this.lumaCtx.save(), this.rootTransform && this.lumaCtx.setTransform(this.rootTransform), this.applyAbsoluteTransform(this.lumaCtx, K.id, o), kt > 0 && (this.lumaCtx.filter = `blur(${kt}px)`), this.lumaCtx.globalAlpha = Tt;
|
|
3425
|
+
const ut = (j == null ? void 0 : j.width) || K.geometry.width || 0, ct = (j == null ? void 0 : j.height) || K.geometry.height || 0, Ct = (j == null ? void 0 : j.corner_radius) ?? K.corner_radius ?? 0;
|
|
3426
|
+
if (((Mt = K.geometry) == null ? void 0 : Mt.type) === "Text") {
|
|
3427
|
+
const nt = j != null && j.geometry ? this.deepMerge(K.geometry, j.geometry) : K.geometry, St = j != null && j.style ? this.deepMerge(K.style, j.style) : K.style;
|
|
3428
|
+
this._renderText(this.lumaCtx, K, { ...nt, width: ut, height: ct, corner_radius: Ct }, St, j, ut, ct, !0, !1, D, q);
|
|
3429
|
+
} else if ((($ = K.geometry) == null ? void 0 : $.type) === "Image") {
|
|
3430
|
+
const nt = K.geometry.src;
|
|
3431
|
+
if (nt) {
|
|
3432
|
+
let St = this.imageCache.get(nt);
|
|
3433
|
+
St || (St = new Image(), St.src = nt, this.imageCache.set(nt, St)), St.complete && St.naturalWidth > 0 ? this.lumaCtx.drawImage(St, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.lumaCtx, K.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
|
|
3429
3434
|
}
|
|
3430
|
-
} else if (((Wt =
|
|
3431
|
-
const
|
|
3432
|
-
if (
|
|
3433
|
-
const
|
|
3434
|
-
let
|
|
3435
|
-
if (!
|
|
3436
|
-
|
|
3437
|
-
const Qt = new Blob([
|
|
3438
|
-
|
|
3435
|
+
} else if (((Wt = K.geometry) == null ? void 0 : Wt.type) === "SVG") {
|
|
3436
|
+
const nt = K.geometry.svgContent;
|
|
3437
|
+
if (nt) {
|
|
3438
|
+
const St = `__lumamask_${K.id}`;
|
|
3439
|
+
let Xt = this.imageCache.get(St);
|
|
3440
|
+
if (!Xt) {
|
|
3441
|
+
Xt = new Image();
|
|
3442
|
+
const Qt = new Blob([nt], { type: "image/svg+xml" });
|
|
3443
|
+
Xt.src = URL.createObjectURL(Qt), Xt.onload = () => {
|
|
3439
3444
|
this.artboard && this.reset();
|
|
3440
|
-
}, this.imageCache.set(
|
|
3445
|
+
}, this.imageCache.set(St, Xt);
|
|
3441
3446
|
}
|
|
3442
|
-
|
|
3447
|
+
Xt.complete && Xt.naturalWidth > 0 ? this.lumaCtx.drawImage(Xt, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.lumaCtx, K.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
|
|
3443
3448
|
}
|
|
3444
3449
|
} else
|
|
3445
|
-
this.applyPath(this.lumaCtx,
|
|
3450
|
+
this.applyPath(this.lumaCtx, K.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill();
|
|
3446
3451
|
this.lumaCtx.restore();
|
|
3447
|
-
const rt = this.maskCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight), V = this.lumaCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight).data,
|
|
3448
|
-
for (let
|
|
3449
|
-
const
|
|
3450
|
-
let
|
|
3451
|
-
|
|
3452
|
+
const rt = this.maskCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight), V = this.lumaCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight).data, it = rt.data;
|
|
3453
|
+
for (let nt = 0; nt < it.length; nt += 4) {
|
|
3454
|
+
const St = V[nt], Xt = V[nt + 1], Qt = V[nt + 2];
|
|
3455
|
+
let oe = (0.299 * St + 0.587 * Xt + 0.114 * Qt) / 255;
|
|
3456
|
+
At && (oe = 1 - oe), it[nt + 3] *= oe;
|
|
3452
3457
|
}
|
|
3453
3458
|
this.maskCtx.putImageData(rt, 0, 0);
|
|
3454
3459
|
} else {
|
|
3455
|
-
this.maskCtx.save(), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), this.maskCtx.globalCompositeOperation =
|
|
3456
|
-
const ut = (
|
|
3457
|
-
if (((Kt =
|
|
3458
|
-
const rt =
|
|
3459
|
-
this._renderText(this.maskCtx,
|
|
3460
|
-
} else if (((te =
|
|
3461
|
-
const rt =
|
|
3460
|
+
this.maskCtx.save(), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), this.maskCtx.globalCompositeOperation = At ? "destination-out" : "destination-in", kt > 0 && (this.maskCtx.filter = `blur(${kt}px)`), this.maskCtx.globalAlpha = Tt, this.applyAbsoluteTransform(this.maskCtx, K.id, o);
|
|
3461
|
+
const ut = (j == null ? void 0 : j.width) || K.geometry.width || 0, ct = (j == null ? void 0 : j.height) || K.geometry.height || 0, Ct = (j == null ? void 0 : j.corner_radius) ?? K.corner_radius ?? 0;
|
|
3462
|
+
if (((Kt = K.geometry) == null ? void 0 : Kt.type) === "Text") {
|
|
3463
|
+
const rt = j != null && j.geometry ? this.deepMerge(K.geometry, j.geometry) : K.geometry, V = j != null && j.style ? this.deepMerge(K.style, j.style) : K.style;
|
|
3464
|
+
this._renderText(this.maskCtx, K, { ...rt, width: ut, height: ct, corner_radius: Ct }, V, j, ut, ct, !0, !1, D, q);
|
|
3465
|
+
} else if (((te = K.geometry) == null ? void 0 : te.type) === "Image") {
|
|
3466
|
+
const rt = K.geometry.src;
|
|
3462
3467
|
if (rt) {
|
|
3463
3468
|
let V = this.imageCache.get(rt);
|
|
3464
|
-
V || (V = new Image(), V.src = rt, this.imageCache.set(rt, V)), V.complete && V.naturalWidth > 0 ? this.maskCtx.drawImage(V, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.maskCtx,
|
|
3469
|
+
V || (V = new Image(), V.src = rt, this.imageCache.set(rt, V)), V.complete && V.naturalWidth > 0 ? this.maskCtx.drawImage(V, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.maskCtx, K.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
|
|
3465
3470
|
}
|
|
3466
|
-
} else if (((Jt =
|
|
3467
|
-
const rt =
|
|
3471
|
+
} else if (((Jt = K.geometry) == null ? void 0 : Jt.type) === "SVG") {
|
|
3472
|
+
const rt = K.geometry.svgContent;
|
|
3468
3473
|
if (rt) {
|
|
3469
|
-
const V = `__alphamask_${
|
|
3470
|
-
let
|
|
3471
|
-
if (!
|
|
3472
|
-
|
|
3473
|
-
const
|
|
3474
|
-
|
|
3474
|
+
const V = `__alphamask_${K.id}`;
|
|
3475
|
+
let it = this.imageCache.get(V);
|
|
3476
|
+
if (!it) {
|
|
3477
|
+
it = new Image();
|
|
3478
|
+
const nt = new Blob([rt], { type: "image/svg+xml" });
|
|
3479
|
+
it.src = URL.createObjectURL(nt), it.onload = () => {
|
|
3475
3480
|
this.artboard && this.reset();
|
|
3476
|
-
}, this.imageCache.set(V,
|
|
3481
|
+
}, this.imageCache.set(V, it);
|
|
3477
3482
|
}
|
|
3478
|
-
|
|
3483
|
+
it.complete && it.naturalWidth > 0 ? this.maskCtx.drawImage(it, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.maskCtx, K.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
|
|
3479
3484
|
}
|
|
3480
3485
|
} else
|
|
3481
|
-
this.applyPath(this.maskCtx,
|
|
3486
|
+
this.applyPath(this.maskCtx, K.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill();
|
|
3482
3487
|
this.maskCtx.restore();
|
|
3483
3488
|
}
|
|
3484
3489
|
}), Ot.save(), Ot.setTransform(1, 0, 0, 1, 0, 0);
|
|
@@ -3489,33 +3494,33 @@ class ci {
|
|
|
3489
3494
|
}
|
|
3490
3495
|
}
|
|
3491
3496
|
_renderText(t, i, o, e, s, n, a, r = !1, h = !1, f = 1, l = 1) {
|
|
3492
|
-
var yt, bt,
|
|
3497
|
+
var yt, bt, pt, Et, It, vt, Yt, se, fe;
|
|
3493
3498
|
let p = o.text || "";
|
|
3494
3499
|
if (o.textInputId && !r) {
|
|
3495
|
-
const
|
|
3496
|
-
|
|
3500
|
+
const st = this.inputs.get(o.textInputId);
|
|
3501
|
+
st !== void 0 && (p = String(st), s.geometry && s.geometry.type === "Text" && (s.geometry.text = p));
|
|
3497
3502
|
}
|
|
3498
3503
|
if (o.svgPath) {
|
|
3499
|
-
const
|
|
3504
|
+
const st = o.svgPath;
|
|
3500
3505
|
t.save();
|
|
3501
|
-
const
|
|
3502
|
-
t.fillStyle =
|
|
3503
|
-
const
|
|
3504
|
-
t.fill(
|
|
3506
|
+
const gt = ((yt = e == null ? void 0 : e.fill) == null ? void 0 : yt.color) || "#000000", Rt = ((bt = e == null ? void 0 : e.fill) == null ? void 0 : bt.opacity) !== void 0 ? (pt = e == null ? void 0 : e.fill) == null ? void 0 : pt.opacity : 1;
|
|
3507
|
+
t.fillStyle = gt, t.globalAlpha *= Rt;
|
|
3508
|
+
const Pt = new Path2D(st);
|
|
3509
|
+
t.fill(Pt), t.restore();
|
|
3505
3510
|
return;
|
|
3506
3511
|
}
|
|
3507
3512
|
let c = p || "";
|
|
3508
|
-
o.enableSegments === !0 && o.segments && Array.isArray(o.segments) && (c = o.segments.map((
|
|
3513
|
+
o.enableSegments === !0 && o.segments && Array.isArray(o.segments) && (c = o.segments.map((st) => st && st.text ? st.text : "").join(""));
|
|
3509
3514
|
const d = o.textCase || "none";
|
|
3510
|
-
d === "uppercase" ? c = c.toUpperCase() : d === "lowercase" ? c = c.toLowerCase() : d === "capitalize" && (c = c.replace(/\b\w/g, (
|
|
3515
|
+
d === "uppercase" ? c = c.toUpperCase() : d === "lowercase" ? c = c.toLowerCase() : d === "capitalize" && (c = c.replace(/\b\w/g, (st) => st.toUpperCase()));
|
|
3511
3516
|
let u = ((Et = o.fontWeight) == null ? void 0 : Et.toString()) || "400", v = o.fontStyle || "normal";
|
|
3512
3517
|
u.toLowerCase().includes("italic") && (v = "italic", u = u.replace(/italic/gi, "").trim() || "400");
|
|
3513
3518
|
const b = this.mapFontWeight(u), m = Math.max(1, o.fontSize || 32);
|
|
3514
3519
|
let y = o.fontFamily || "Inter";
|
|
3515
3520
|
const S = ["Bold", "SemiBold", "Medium", "Regular", "Light", "Thin", "ExtraBold", "Black", "Italic"];
|
|
3516
|
-
S.forEach((
|
|
3517
|
-
const
|
|
3518
|
-
|
|
3521
|
+
S.forEach((st) => {
|
|
3522
|
+
const gt = new RegExp(`[\\s-]${st}$`, "i");
|
|
3523
|
+
gt.test(y) && (y = y.replace(gt, "").trim());
|
|
3519
3524
|
});
|
|
3520
3525
|
const M = `${o.smallCaps === !0 ? "small-caps " : ""}${v} ${b} ${m}px "${y}", sans-serif`;
|
|
3521
3526
|
t.font = M;
|
|
@@ -3527,8 +3532,8 @@ class ci {
|
|
|
3527
3532
|
if (typeof o.letterSpacing == "number")
|
|
3528
3533
|
T = o.letterSpacing;
|
|
3529
3534
|
else if (typeof o.letterSpacing == "object" && o.letterSpacing.value !== void 0) {
|
|
3530
|
-
const
|
|
3531
|
-
T =
|
|
3535
|
+
const st = o.letterSpacing;
|
|
3536
|
+
T = st.unit === "PERCENT" ? st.value / 100 * m : st.value;
|
|
3532
3537
|
}
|
|
3533
3538
|
t.letterSpacing !== void 0 && (t.letterSpacing = `${T}px`);
|
|
3534
3539
|
const L = o.kerning || "auto", P = o.kerningValue || 0;
|
|
@@ -3536,7 +3541,7 @@ class ci {
|
|
|
3536
3541
|
const _ = o.paragraphSpacing || 0;
|
|
3537
3542
|
let E = o.lineHeight ?? 1.2;
|
|
3538
3543
|
typeof E == "string" && (E = parseFloat(E)), E > 5 && m > 0 && (E = E / m);
|
|
3539
|
-
const A = (E || 1.2) * m, W = o.isPointText === !0 || !o.width || o.width <= 0, z = ((It = o.padding) == null ? void 0 : It.left) || ((
|
|
3544
|
+
const A = (E || 1.2) * m, W = o.isPointText === !0 || !o.width || o.width <= 0, z = ((It = o.padding) == null ? void 0 : It.left) || ((vt = o.padding) == null ? void 0 : vt.right) || 0, Y = W ? 1e5 : o.width && o.width > 0 ? Math.ceil(o.width) - z * 2 : 1e5;
|
|
3540
3545
|
o.autoHeight;
|
|
3541
3546
|
const G = ps({
|
|
3542
3547
|
text: c,
|
|
@@ -3555,87 +3560,87 @@ class ci {
|
|
|
3555
3560
|
hyphenation: o.hyphenation,
|
|
3556
3561
|
composer: o.composer,
|
|
3557
3562
|
balanceRaggedLines: o.balanceRaggedLines
|
|
3558
|
-
}), N = G.lines || [],
|
|
3559
|
-
let
|
|
3560
|
-
if (X === 0 ||
|
|
3561
|
-
let
|
|
3563
|
+
}), N = G.lines || [], Q = G.maxFontSize || m, x = this.fontLeadingFactors[y] ?? 0.5, F = (A - m) * x;
|
|
3564
|
+
let tt = G.height, X = n, et = a;
|
|
3565
|
+
if (X === 0 || et === 0 || X >= 1e5) {
|
|
3566
|
+
let st = 0, gt = 0;
|
|
3562
3567
|
const Rt = G.fullText || c;
|
|
3563
|
-
(N || []).forEach((
|
|
3564
|
-
const dt =
|
|
3565
|
-
Ft >
|
|
3566
|
-
` || Rt[
|
|
3567
|
-
` &&
|
|
3568
|
-
}), (X === 0 || X >= 1e5) && (X =
|
|
3568
|
+
(N || []).forEach((Pt) => {
|
|
3569
|
+
const dt = Pt.text || "", Ft = t.measureText(dt).width + (dt.length > 0 ? (dt.length - 1) * T : 0);
|
|
3570
|
+
Ft > st && (st = Ft), gt += dt.length, gt < Rt.length && (Rt[gt] === `
|
|
3571
|
+
` || Rt[gt] === "\r") && (gt++, Rt[gt - 1] === "\r" && Rt[gt] === `
|
|
3572
|
+
` && gt++);
|
|
3573
|
+
}), (X === 0 || X >= 1e5) && (X = st), et === 0 && (et = tt || 0);
|
|
3569
3574
|
}
|
|
3570
|
-
let R = -
|
|
3571
|
-
a > 0 && a >
|
|
3575
|
+
let R = -tt / 2;
|
|
3576
|
+
a > 0 && a > tt && (I === "top" ? R = -a / 2 : I === "middle" || I === "center" ? R = -tt / 2 : I === "bottom" && (R = a / 2 - tt)), R += F;
|
|
3572
3577
|
let O = null, D = 0;
|
|
3573
3578
|
if (o.pathId && this.artboard) {
|
|
3574
|
-
const
|
|
3575
|
-
if (
|
|
3576
|
-
const
|
|
3577
|
-
O = { geo: Rt, obj:
|
|
3579
|
+
const st = this.artboard.objects.find((gt) => gt.id === o.pathId);
|
|
3580
|
+
if (st && st.type === "Shape" && ((Yt = st.geometry) == null ? void 0 : Yt.type) === "Path") {
|
|
3581
|
+
const gt = this.objectStates.get(st.id), Rt = gt != null && gt.geometry ? this.deepMerge(st.geometry, gt.geometry) : st.geometry, Pt = (gt == null ? void 0 : gt.scale_x) !== void 0 ? (st.width || 0) * gt.scale_x : st.width || 0, dt = (gt == null ? void 0 : gt.scale_y) !== void 0 ? (st.height || 0) * gt.scale_y : st.height || 0;
|
|
3582
|
+
O = { geo: Rt, obj: st, w: Pt, h: dt }, D = this.getPerimeter(Rt, Pt, dt);
|
|
3578
3583
|
}
|
|
3579
3584
|
}
|
|
3580
|
-
const q = (
|
|
3581
|
-
var
|
|
3582
|
-
if (T === 0 && (!o.enableSegments || !((
|
|
3585
|
+
const q = (st, gt) => {
|
|
3586
|
+
var Pt, dt;
|
|
3587
|
+
if (T === 0 && (!o.enableSegments || !((Pt = o.segments) != null && Pt.length))) return t.measureText(st).width;
|
|
3583
3588
|
let Rt = 0;
|
|
3584
|
-
for (let Ft = 0; Ft <
|
|
3585
|
-
const Dt =
|
|
3589
|
+
for (let Ft = 0; Ft < st.length; Ft++) {
|
|
3590
|
+
const Dt = gt + Ft;
|
|
3586
3591
|
let $t = 0;
|
|
3587
3592
|
if (o.enableSegments === !0 && ((dt = o.segments) == null ? void 0 : dt.length) > 0) {
|
|
3588
3593
|
let Ot = 0, Vt = null;
|
|
3589
|
-
for (const
|
|
3590
|
-
if (Dt < Ot + (
|
|
3591
|
-
Vt =
|
|
3594
|
+
for (const ne of o.segments) {
|
|
3595
|
+
if (Dt < Ot + (ne.text || "").length) {
|
|
3596
|
+
Vt = ne;
|
|
3592
3597
|
break;
|
|
3593
3598
|
}
|
|
3594
|
-
Ot += (
|
|
3599
|
+
Ot += (ne.text || "").length;
|
|
3595
3600
|
}
|
|
3596
3601
|
if (Vt) {
|
|
3597
3602
|
t.save();
|
|
3598
|
-
let
|
|
3603
|
+
let ne = Vt.fontFamily || o.fontFamily || "Inter";
|
|
3599
3604
|
const me = this.mapFontWeight((Vt.fontWeight || o.fontWeight || "400").toString()), ye = Vt.fontStyle || v, Ut = Vt.fontSize || m;
|
|
3600
|
-
t.font = `${ye} ${me} ${Ut}px "${
|
|
3605
|
+
t.font = `${ye} ${me} ${Ut}px "${ne}", sans-serif`, $t = t.measureText(st[Ft]).width, t.restore();
|
|
3601
3606
|
} else
|
|
3602
|
-
$t = t.measureText(
|
|
3607
|
+
$t = t.measureText(st[Ft]).width;
|
|
3603
3608
|
} else
|
|
3604
|
-
$t = t.measureText(
|
|
3609
|
+
$t = t.measureText(st[Ft]).width;
|
|
3605
3610
|
Rt += $t + T;
|
|
3606
3611
|
}
|
|
3607
|
-
return Rt - (
|
|
3608
|
-
}, ot = (
|
|
3612
|
+
return Rt - (st.length > 0 ? T : 0);
|
|
3613
|
+
}, ot = (st, gt, Rt, Pt, dt) => {
|
|
3609
3614
|
var me, ye;
|
|
3610
3615
|
const Dt = (dt === 0 || c[dt - 1] === `
|
|
3611
3616
|
` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, $t = (!r || h) && (i.behaviors || []).some(
|
|
3612
3617
|
(Ut) => Ut.enabled && (Ut.type.toString().includes("Text") || ["Typewriter", "Scramble", "Wave", "Bounce", "GlitchText", "Reveal3D", "RevealSlide", "RevealBlur"].includes(Ut.type))
|
|
3613
|
-
), Ot = !o.pathId && !$t && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Vt = o.baselineShift || 0,
|
|
3618
|
+
), Ot = !o.pathId && !$t && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Vt = o.baselineShift || 0, ne = Rt + Vt;
|
|
3614
3619
|
if (Ot)
|
|
3615
|
-
t.font = M,
|
|
3620
|
+
t.font = M, Pt ? t.strokeText(st, gt + Dt, ne) : t.fillText(st, gt + Dt, ne);
|
|
3616
3621
|
else {
|
|
3617
|
-
const Ut = q(
|
|
3618
|
-
let Se =
|
|
3622
|
+
const Ut = q(st, dt);
|
|
3623
|
+
let Se = gt + Dt;
|
|
3619
3624
|
k === "center" ? Se -= Ut / 2 : k === "right" && (Se -= Ut);
|
|
3620
|
-
const Pe = dt +
|
|
3621
|
-
` || c[dt +
|
|
3625
|
+
const Pe = dt + st.length >= c.length || c[dt + st.length] === `
|
|
3626
|
+
` || c[dt + st.length] === "\r";
|
|
3622
3627
|
let Ee = 0, Ce = 0;
|
|
3623
3628
|
const Ae = o.justifyMinWordSpacing, xe = o.justifyMaxWordSpacing;
|
|
3624
3629
|
if (k === "justify" && !Pe && Ut > 0 && !o.pathId) {
|
|
3625
|
-
const
|
|
3626
|
-
for (let B = 0; B <
|
|
3627
|
-
|
|
3630
|
+
const mt = W ? Ut : Y - z * 2 + 0, at = Math.max(0, mt - Ut);
|
|
3631
|
+
for (let B = 0; B < st.length; B++)
|
|
3632
|
+
st[B] === " " && Ce++;
|
|
3628
3633
|
if (Ce > 0) {
|
|
3629
3634
|
const B = t.measureText(" ").width;
|
|
3630
|
-
let
|
|
3631
|
-
Ee = Math.max(0, Math.min(at / Ce,
|
|
3635
|
+
let K = Ae || B * 0.5, j = xe || B * 2.5;
|
|
3636
|
+
Ee = Math.max(0, Math.min(at / Ce, j - K));
|
|
3632
3637
|
}
|
|
3633
3638
|
}
|
|
3634
|
-
let
|
|
3635
|
-
o.pathId && D > 0 && O && (k === "center" ?
|
|
3639
|
+
let ie = o.pathOffset || 0;
|
|
3640
|
+
o.pathId && D > 0 && O && (k === "center" ? ie += D / 2 - Ut / 2 : k === "right" && (ie += D - Ut));
|
|
3636
3641
|
let jt = Se;
|
|
3637
3642
|
const ht = r && !h ? [] : ((me = i.behaviors) == null ? void 0 : me.filter(
|
|
3638
|
-
(
|
|
3643
|
+
(mt) => [
|
|
3639
3644
|
U.Typewriter,
|
|
3640
3645
|
U.Scramble,
|
|
3641
3646
|
U.Wave,
|
|
@@ -3665,106 +3670,106 @@ class ci {
|
|
|
3665
3670
|
U.TextZing,
|
|
3666
3671
|
U.TextPerspective,
|
|
3667
3672
|
U.TextMirror
|
|
3668
|
-
].includes(
|
|
3673
|
+
].includes(mt.type) && mt.enabled
|
|
3669
3674
|
)) || [];
|
|
3670
|
-
for (let
|
|
3671
|
-
let at =
|
|
3672
|
-
const B = dt +
|
|
3673
|
-
let
|
|
3675
|
+
for (let mt = 0; mt < st.length; mt++) {
|
|
3676
|
+
let at = st[mt];
|
|
3677
|
+
const B = dt + mt;
|
|
3678
|
+
let K = 0, j = 0, kt = 1, At = 1, Tt = 0, xt = 1, Mt = at;
|
|
3674
3679
|
ht.forEach((ut) => {
|
|
3675
3680
|
const ct = ut.settings || {}, Ct = ct.strength || 1, rt = Date.now();
|
|
3676
3681
|
if (ut.type === U.Typewriter)
|
|
3677
|
-
this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.05) < 0 && (
|
|
3682
|
+
this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.05) < 0 && (xt = 0);
|
|
3678
3683
|
else if (ut.type === U.Scramble)
|
|
3679
3684
|
Math.max(0, Math.min(1, this.currentTime / (ct.duration || 1.5)) - B * 0.02) < 1 && Math.random() < 0.3 && (Mt = "$%#@!*&"[Math.floor(Math.random() * 7)]);
|
|
3680
3685
|
else if (ut.type === U.Wave)
|
|
3681
|
-
|
|
3686
|
+
j += Math.sin(this.currentTime * 5 * (ct.speed || 1) + B * (ct.frequency || 1)) * (ct.amplitude || 20) * Ct;
|
|
3682
3687
|
else if (ut.type === U.Bounce) {
|
|
3683
3688
|
const V = Math.max(0, this.currentTime % 2 - B * (ct.stagger || 0.1));
|
|
3684
|
-
V < 1 && (
|
|
3689
|
+
V < 1 && (j -= Math.abs(Math.sin(V * Math.PI)) * (ct.height || 50) * Ct);
|
|
3685
3690
|
} else if (ut.type === U.TextTrail) {
|
|
3686
3691
|
const V = this.pointerHistory[Math.max(0, this.pointerHistory.length - 1 - B * (ct.delay || 5))];
|
|
3687
|
-
V && (
|
|
3692
|
+
V && (K += (V.x - (s.x + jt)) * Ct * 0.2, j += (V.y - (s.y + Rt + j)) * Ct * 0.2);
|
|
3688
3693
|
} else if (ut.type === U.Reveal3D) {
|
|
3689
3694
|
const V = Math.max(0, Math.min(1, this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.1)));
|
|
3690
|
-
|
|
3695
|
+
kt *= V, At *= V, xt = V;
|
|
3691
3696
|
} else if (ut.type === U.RevealSlide) {
|
|
3692
|
-
const V = Math.max(0, Math.min(1, this.currentTime * 1.5 - B * 0.05)),
|
|
3693
|
-
|
|
3697
|
+
const V = Math.max(0, Math.min(1, this.currentTime * 1.5 - B * 0.05)), it = (1 - V) * (ct.distance || 40) * Ct, nt = ct.direction || "up";
|
|
3698
|
+
nt === "up" ? j -= it : nt === "down" ? j += it : nt === "left" ? K -= it : nt === "right" && (K += it), xt = V;
|
|
3694
3699
|
} else if (ut.type === U.RevealBlur) {
|
|
3695
3700
|
const V = Math.max(0, Math.min(1, this.currentTime * 1.2 - B * 0.1));
|
|
3696
|
-
|
|
3701
|
+
xt = V, K += (1 - V) * 5;
|
|
3697
3702
|
} else if (ut.type === U.TextLiquid) {
|
|
3698
3703
|
const V = Math.max(0, Math.sin(rt * 1e-3 * (ct.speed || 1) + B * 0.5));
|
|
3699
|
-
|
|
3704
|
+
j += V * (ct.amplitude || 10) * Ct, At *= 1 + V * 0.2;
|
|
3700
3705
|
} else if (ut.type === U.TextVortex) {
|
|
3701
|
-
const V = rt * 2e-3 * (ct.speed || 1) + B * 0.2,
|
|
3702
|
-
|
|
3706
|
+
const V = rt * 2e-3 * (ct.speed || 1) + B * 0.2, it = (1 - (Math.sin(rt * 1e-3) * 0.5 + 0.5)) * (ct.radius || 50);
|
|
3707
|
+
K += Math.cos(V) * it * Ct, j += Math.sin(V) * it * Ct;
|
|
3703
3708
|
} else if (ut.type === U.TextExplosion) {
|
|
3704
|
-
const V = ct.force || 1,
|
|
3705
|
-
if (
|
|
3706
|
-
const
|
|
3707
|
-
|
|
3709
|
+
const V = ct.force || 1, it = this.currentTime % 2;
|
|
3710
|
+
if (it < 1) {
|
|
3711
|
+
const nt = (B / st.length - 0.5) * Math.PI * 2, St = it * 100 * V;
|
|
3712
|
+
K += Math.cos(nt) * St * Ct, j += Math.sin(nt) * St * Ct, xt = 1 - it;
|
|
3708
3713
|
}
|
|
3709
3714
|
} else if (ut.type === U.TextRain) {
|
|
3710
|
-
const V = ct.speed || 1,
|
|
3711
|
-
|
|
3715
|
+
const V = ct.speed || 1, it = ct.height || 100, nt = (rt * 1e-3 * V + B * 0.1) % 1;
|
|
3716
|
+
j -= (1 - nt) * it * Ct, xt = nt > 0.1 ? 1 : nt * 10;
|
|
3712
3717
|
} else if (ut.type === U.TextGravity) {
|
|
3713
|
-
const V = ct.gravity || 9.8,
|
|
3714
|
-
|
|
3718
|
+
const V = ct.gravity || 9.8, it = this.currentTime % 3 / 3, nt = 0.5 * V * Math.pow(it * 10, 2);
|
|
3719
|
+
nt < 100 ? j += nt * Ct : j += 100 * Ct;
|
|
3715
3720
|
} else if (ut.type === U.TextMatrix) {
|
|
3716
3721
|
const V = ct.speed || 1;
|
|
3717
3722
|
if (Math.random() < 0.1 * V) {
|
|
3718
|
-
const
|
|
3719
|
-
Mt =
|
|
3723
|
+
const nt = "0123456789ABCDEF!@#$%^&*";
|
|
3724
|
+
Mt = nt[Math.floor(Math.random() * nt.length)];
|
|
3720
3725
|
}
|
|
3721
|
-
|
|
3726
|
+
xt = 0.3 + (Math.sin(rt * 0.01 * V + B) + 1) / 2 * 0.7;
|
|
3722
3727
|
} else if (ut.type === U.TextNeon) {
|
|
3723
3728
|
const V = Math.random() > 0.95 ? 0.5 : 1;
|
|
3724
|
-
|
|
3729
|
+
xt = (0.7 + (Math.sin(rt * 5e-3) + 1) / 2 * 0.3) * V;
|
|
3725
3730
|
} else if (ut.type === U.TextDissolve)
|
|
3726
|
-
Math.sin(B * 1.5 + rt * 2e-3 * (ct.speed || 1)) > 0.5 && (
|
|
3731
|
+
Math.sin(B * 1.5 + rt * 2e-3 * (ct.speed || 1)) > 0.5 && (xt = 0);
|
|
3727
3732
|
else if (ut.type === U.TextOrganic) {
|
|
3728
|
-
const V = ct.speed || 1,
|
|
3729
|
-
|
|
3733
|
+
const V = ct.speed || 1, it = ct.amplitude || 10;
|
|
3734
|
+
K += Math.sin(rt * 2e-3 * V + B) * it * Ct, j += Math.cos(rt * 15e-4 * V + B * 0.7) * it * Ct;
|
|
3730
3735
|
} else if (ut.type === U.TextBreathe) {
|
|
3731
|
-
const
|
|
3732
|
-
|
|
3736
|
+
const it = 1 + (Math.sin(rt * 3e-3 + B * 0.2) + 1) / 2 * 0.2 * Ct;
|
|
3737
|
+
kt *= it, At *= it;
|
|
3733
3738
|
} else if (ut.type === U.TextSpin) {
|
|
3734
3739
|
const V = ct.speed || 1;
|
|
3735
|
-
|
|
3740
|
+
Tt += rt * 0.01 * V + B;
|
|
3736
3741
|
} else if (ut.type === U.TextMagnet) {
|
|
3737
3742
|
const V = this.pointerHistory[this.pointerHistory.length - 1];
|
|
3738
3743
|
if (V) {
|
|
3739
|
-
const
|
|
3740
|
-
|
|
3744
|
+
const it = V.x - (s.x + jt), nt = V.y - (s.y + Rt);
|
|
3745
|
+
Tt = Math.atan2(nt, it);
|
|
3741
3746
|
}
|
|
3742
3747
|
} else if (ut.type === U.TextPerspective) {
|
|
3743
|
-
const V =
|
|
3744
|
-
|
|
3748
|
+
const V = st.length / 2, it = (B - V) / V, nt = 1 - Math.abs(it) * 0.3 * Ct;
|
|
3749
|
+
kt *= nt, At *= nt, K += it * 20 * Ct;
|
|
3745
3750
|
} else if (ut.type === U.TextMirror)
|
|
3746
|
-
|
|
3751
|
+
xt *= 0.8;
|
|
3747
3752
|
else if (ut.type === U.TextFloral) {
|
|
3748
|
-
const V = ct.speed || 1,
|
|
3749
|
-
|
|
3753
|
+
const V = ct.speed || 1, it = ct.stagger || 0.1, nt = (rt * 1e-3 * V + B * it) % 2;
|
|
3754
|
+
nt < 1 && (kt *= nt, At *= nt, Tt += nt * Math.PI);
|
|
3750
3755
|
} else if (ut.type === U.TextSmoke) {
|
|
3751
|
-
const V = ct.speed || 1,
|
|
3752
|
-
|
|
3756
|
+
const V = ct.speed || 1, it = ct.height || 50, nt = (rt * 5e-4 * V + B * 0.2) % 1;
|
|
3757
|
+
j -= nt * it * Ct, K += Math.sin(rt * 2e-3 + B) * 5 * Ct, xt = 1 - nt;
|
|
3753
3758
|
} else if (ut.type === U.TextVariable) {
|
|
3754
|
-
const V = ct.speed || 1,
|
|
3755
|
-
|
|
3759
|
+
const V = ct.speed || 1, it = ct.intensity || 1.5, nt = (Math.sin(rt * 4e-3 * V + B * 0.3) + 1) / 2;
|
|
3760
|
+
kt *= 1 + nt * (it - 1) * Ct;
|
|
3756
3761
|
} else if (ut.type === U.TextZing) {
|
|
3757
|
-
const V = ct.speed || 2,
|
|
3758
|
-
|
|
3762
|
+
const V = ct.speed || 2, it = ct.distance || 100, nt = (rt * 2e-3 * V + B * 0.05) % 1;
|
|
3763
|
+
K += (1 - nt) * it * Ct, xt = nt;
|
|
3759
3764
|
} else if (ut.type === U.TextElastic) {
|
|
3760
|
-
const V = ct.stiffness || 0.2,
|
|
3761
|
-
|
|
3765
|
+
const V = ct.stiffness || 0.2, it = ct.damping || 0.1, nt = Math.sin(rt * 0.01) * Math.exp(-rt * 1e-3 * it);
|
|
3766
|
+
At *= 1 + nt * V * Ct;
|
|
3762
3767
|
} else if (ut.type === U.TextGlitch3D) {
|
|
3763
3768
|
const V = ct.intensity || 5;
|
|
3764
|
-
Math.random() < 0.2 && (
|
|
3769
|
+
Math.random() < 0.2 && (K += (Math.random() - 0.5) * V, j += (Math.random() - 0.5) * V, xt = 0.8);
|
|
3765
3770
|
} else if (ut.type === U.GlitchText) {
|
|
3766
3771
|
const V = ct.intensity || 5;
|
|
3767
|
-
Math.random() < 0.1 && (
|
|
3772
|
+
Math.random() < 0.1 && (K += (Math.random() - 0.5) * V, j += (Math.random() - 0.5) * V, Math.random() < 0.05 && (xt = 0.5));
|
|
3768
3773
|
}
|
|
3769
3774
|
});
|
|
3770
3775
|
let $ = null, Wt = o.textDecoration || "none", Kt = m;
|
|
@@ -3779,61 +3784,61 @@ class ci {
|
|
|
3779
3784
|
}
|
|
3780
3785
|
if (ct) {
|
|
3781
3786
|
let Ct = ct.fontFamily || o.fontFamily || "Inter";
|
|
3782
|
-
S.forEach((
|
|
3783
|
-
const
|
|
3784
|
-
|
|
3787
|
+
S.forEach((it) => {
|
|
3788
|
+
const nt = new RegExp(`[\\s-]${it}$`, "i");
|
|
3789
|
+
nt.test(Ct) && (Ct = Ct.replace(nt, "").trim());
|
|
3785
3790
|
});
|
|
3786
3791
|
const rt = this.mapFontWeight((ct.fontWeight || o.fontWeight || "400").toString()), V = ct.fontStyle || v;
|
|
3787
|
-
Kt = ct.fontSize || m, t.font = `${V} ${rt} ${Kt}px "${Ct}", sans-serif`, ct.fill && ($ = ct.fill), ct.textDecoration && (Wt = ct.textDecoration), Kt <
|
|
3792
|
+
Kt = ct.fontSize || m, t.font = `${V} ${rt} ${Kt}px "${Ct}", sans-serif`, ct.fill && ($ = ct.fill), ct.textDecoration && (Wt = ct.textDecoration), Kt < Q && (j += (Q - Kt) * 0.85);
|
|
3788
3793
|
}
|
|
3789
3794
|
} else
|
|
3790
3795
|
t.font = M;
|
|
3791
3796
|
const te = t.globalAlpha;
|
|
3792
|
-
t.globalAlpha *=
|
|
3797
|
+
t.globalAlpha *= xt, t.save();
|
|
3793
3798
|
const Jt = t.measureText(Mt).width;
|
|
3794
3799
|
if (O && D > 0) {
|
|
3795
|
-
const ut = jt - Se + Jt / 2, Ct = (
|
|
3796
|
-
t.translate(rt.x +
|
|
3800
|
+
const ut = jt - Se + Jt / 2, Ct = (ie + ut) / D, rt = this.getPointOnPath(O.geo, O.w, O.h, Math.abs(Ct % 1)), V = rt.angle, it = Rt + j + (o.pathOffsetY || 0), nt = o.pathSide === "right" ? -1 : 1, St = Math.cos(V + Math.PI / 2) * it * nt, Xt = Math.sin(V + Math.PI / 2) * it * nt;
|
|
3801
|
+
t.translate(rt.x + St + K, rt.y + Xt), t.rotate(V + Tt + (nt === -1 ? Math.PI : 0));
|
|
3797
3802
|
} else
|
|
3798
|
-
t.translate(jt +
|
|
3799
|
-
if (t.scale(
|
|
3800
|
-
const ut = this.createCanvasFill(t, $, X,
|
|
3803
|
+
t.translate(jt + K + Jt / 2, Rt + j), Tt !== 0 && t.rotate(Tt);
|
|
3804
|
+
if (t.scale(kt, At), $ && !r && !h) {
|
|
3805
|
+
const ut = this.createCanvasFill(t, $, X, et);
|
|
3801
3806
|
t.fillStyle = ut || $.color || "#000000";
|
|
3802
3807
|
} else if (!r && !h) {
|
|
3803
|
-
const ut = this.createCanvasFill(t, e.fill, X,
|
|
3808
|
+
const ut = this.createCanvasFill(t, e.fill, X, et);
|
|
3804
3809
|
t.fillStyle = ut || e.fill.color || "#000000";
|
|
3805
3810
|
}
|
|
3806
|
-
if (
|
|
3811
|
+
if (xt > 0)
|
|
3807
3812
|
if (r || h) {
|
|
3808
|
-
const ut = h ? "#000000" : this.createCanvasFill(t, e.fill, X,
|
|
3813
|
+
const ut = h ? "#000000" : this.createCanvasFill(t, e.fill, X, et);
|
|
3809
3814
|
t.fillStyle = ut || e.fill.color || "#ffffff", t.fillText(Mt, -Jt / 2, 0);
|
|
3810
|
-
} else
|
|
3815
|
+
} else Pt ? t.strokeText(Mt, -Jt / 2, 0) : t.fillText(Mt, -Jt / 2, 0);
|
|
3811
3816
|
Wt !== "none" && !r && this.drawTextDecoration(t, Wt, 0, 0, Jt, Kt), t.restore(), t.globalAlpha = te, k === "justify" && Ee > 0 && Mt === " " && !Pe ? jt += Jt + T + Ee : jt += Jt + T;
|
|
3812
3817
|
}
|
|
3813
3818
|
}
|
|
3814
3819
|
};
|
|
3815
3820
|
if (r) {
|
|
3816
|
-
let
|
|
3821
|
+
let st = 0, gt = R;
|
|
3817
3822
|
(N || []).forEach((Rt) => {
|
|
3818
|
-
const
|
|
3819
|
-
dt !== -1 && (
|
|
3823
|
+
const Pt = Rt.text || "", dt = c.indexOf(Pt, st);
|
|
3824
|
+
dt !== -1 && (st = dt);
|
|
3820
3825
|
let Ft = -X / 2;
|
|
3821
|
-
k === "center" ? Ft = 0 : k === "right" && (Ft = X / 2), ot(
|
|
3826
|
+
k === "center" ? Ft = 0 : k === "right" && (Ft = X / 2), ot(Pt, Ft, gt, !1, st), st += Pt.length, gt += A;
|
|
3822
3827
|
});
|
|
3823
3828
|
} else if (h) {
|
|
3824
|
-
let
|
|
3829
|
+
let st = 0, gt = R;
|
|
3825
3830
|
(N || []).forEach((Rt) => {
|
|
3826
|
-
const
|
|
3831
|
+
const Pt = Rt.text || "";
|
|
3827
3832
|
let dt = -X / 2;
|
|
3828
|
-
k === "center" ? dt = 0 : k === "right" && (dt = X / 2), ot(
|
|
3829
|
-
` || c[
|
|
3830
|
-
` &&
|
|
3833
|
+
k === "center" ? dt = 0 : k === "right" && (dt = X / 2), ot(Pt, dt, gt, !1, st), st += Pt.length, st < c.length && (c[st] === `
|
|
3834
|
+
` || c[st] === "\r") && (st++, c[st - 1] === "\r" && c[st] === `
|
|
3835
|
+
` && st++), gt += A;
|
|
3831
3836
|
});
|
|
3832
3837
|
} else {
|
|
3833
3838
|
if (e.fill) {
|
|
3834
|
-
const
|
|
3835
|
-
t.fillStyle = Rt || e.fill.color || "#000000", t.globalAlpha =
|
|
3836
|
-
const
|
|
3839
|
+
const gt = t.globalAlpha, Rt = this.createCanvasFill(t, e.fill, X, et);
|
|
3840
|
+
t.fillStyle = Rt || e.fill.color || "#000000", t.globalAlpha = gt * this.normalizeOpacity(e.fill.opacity ?? 100);
|
|
3841
|
+
const Pt = G.fullText || (o.enableSegments ? (o.segments || []).map((Dt) => {
|
|
3837
3842
|
let $t = Dt.text || "";
|
|
3838
3843
|
const Ot = Dt.textCase || o.textCase || "none";
|
|
3839
3844
|
return Ot === "uppercase" ? $t.toUpperCase() : Ot === "lowercase" ? $t.toLowerCase() : Ot === "capitalize" ? $t.replace(/\b\w/g, (Vt) => Vt.toUpperCase()) : $t;
|
|
@@ -3842,52 +3847,52 @@ class ci {
|
|
|
3842
3847
|
(N || []).forEach((Dt) => {
|
|
3843
3848
|
const $t = Dt.text || "";
|
|
3844
3849
|
let Ot = -X / 2;
|
|
3845
|
-
k === "center" ? Ot = 0 : k === "right" && (Ot = X / 2), ot($t, Ot, Ft, !1, dt), dt += $t.length, Ft += A, dt <
|
|
3846
|
-
` ||
|
|
3850
|
+
k === "center" ? Ot = 0 : k === "right" && (Ot = X / 2), ot($t, Ot, Ft, !1, dt), dt += $t.length, Ft += A, dt < Pt.length && (Pt[dt] === `
|
|
3851
|
+
` || Pt[dt] === "\r") && (_ > 0 && (Ft += _), dt++, Pt[dt - 1] === "\r" && Pt[dt] === `
|
|
3847
3852
|
` && dt++);
|
|
3848
|
-
}), t.globalAlpha =
|
|
3853
|
+
}), t.globalAlpha = gt;
|
|
3849
3854
|
}
|
|
3850
|
-
const
|
|
3851
|
-
if (
|
|
3852
|
-
let
|
|
3853
|
-
(N || []).forEach((Rt,
|
|
3855
|
+
const st = o.paragraphRule;
|
|
3856
|
+
if (st && (((se = st.top) == null ? void 0 : se.width) > 0 || ((fe = st.bottom) == null ? void 0 : fe.width) > 0)) {
|
|
3857
|
+
let gt = 0;
|
|
3858
|
+
(N || []).forEach((Rt, Pt) => {
|
|
3854
3859
|
var Dt, $t;
|
|
3855
|
-
const Ft =
|
|
3856
|
-
` || c[
|
|
3857
|
-
if (Ft &&
|
|
3858
|
-
if (((Dt =
|
|
3859
|
-
const Ot = R +
|
|
3860
|
-
t.strokeStyle =
|
|
3860
|
+
const Ft = gt === 0 || gt < c.length && (c[gt] === `
|
|
3861
|
+
` || c[gt] === "\r");
|
|
3862
|
+
if (Ft && Pt > 0 && gt++, Ft) {
|
|
3863
|
+
if (((Dt = st.top) == null ? void 0 : Dt.width) > 0) {
|
|
3864
|
+
const Ot = R + Pt * A - st.top.offset;
|
|
3865
|
+
t.strokeStyle = st.top.color || "#000000", t.lineWidth = st.top.width, t.beginPath();
|
|
3861
3866
|
const Vt = -n / 2 + A * 0.2;
|
|
3862
3867
|
t.moveTo(Vt, Ot), t.lineTo(n / 2 - A * 0.2, Ot), t.stroke();
|
|
3863
3868
|
}
|
|
3864
|
-
if ((($t =
|
|
3865
|
-
const Ot = R + (
|
|
3866
|
-
t.strokeStyle =
|
|
3869
|
+
if ((($t = st.bottom) == null ? void 0 : $t.width) > 0) {
|
|
3870
|
+
const Ot = R + (Pt + 1) * A - st.bottom.offset;
|
|
3871
|
+
t.strokeStyle = st.bottom.color || "#000000", t.lineWidth = st.bottom.width, t.beginPath();
|
|
3867
3872
|
const Vt = -n / 2 + A * 0.2;
|
|
3868
3873
|
t.moveTo(Vt, Ot), t.lineTo(n / 2 - A * 0.2, Ot), t.stroke();
|
|
3869
3874
|
}
|
|
3870
3875
|
}
|
|
3871
|
-
|
|
3876
|
+
gt += (Rt.text || "").length;
|
|
3872
3877
|
});
|
|
3873
3878
|
}
|
|
3874
3879
|
if (e.stroke && e.stroke.width > 0) {
|
|
3875
|
-
const
|
|
3880
|
+
const gt = t.globalAlpha;
|
|
3876
3881
|
e.fill && e.fill.type !== "None" && e.fill.isEnabled !== !1 && e.fill.opacity !== 0 && e.fill.color !== "transparent" && e.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0), t.strokeStyle = e.stroke.color;
|
|
3877
|
-
let
|
|
3882
|
+
let Pt = 1;
|
|
3878
3883
|
if (this.rootTransform) {
|
|
3879
3884
|
const Dt = t.getTransform(), $t = Math.sqrt(Dt.a * Dt.a + Dt.b * Dt.b) || 1, Ot = this.rootTransform, Vt = Math.sqrt(Ot.a * Ot.a + Ot.b * Ot.b) || 1;
|
|
3880
|
-
|
|
3885
|
+
Pt = $t / Vt;
|
|
3881
3886
|
} else
|
|
3882
|
-
|
|
3883
|
-
t.lineWidth = (e.stroke.width || 1) / (
|
|
3887
|
+
Pt = (Math.abs(f) + Math.abs(l)) / 2 || 1;
|
|
3888
|
+
t.lineWidth = (e.stroke.width || 1) / (Pt || 1), t.globalAlpha = gt * this.normalizeOpacity(e.stroke.opacity ?? 100);
|
|
3884
3889
|
let dt = 0, Ft = R;
|
|
3885
3890
|
(N || []).forEach((Dt) => {
|
|
3886
3891
|
let $t = -X / 2;
|
|
3887
3892
|
k === "center" ? $t = 0 : k === "right" && ($t = X / 2), ot(Dt.text, $t, Ft, !0, dt), dt += (Dt.text || "").length, Ft += A, dt < c.length && (c[dt] === `
|
|
3888
3893
|
` || c[dt] === "\r") && (_ > 0 && (Ft += _), dt++, c[dt - 1] === "\r" && c[dt] === `
|
|
3889
3894
|
` && dt++);
|
|
3890
|
-
}), t.globalAlpha =
|
|
3895
|
+
}), t.globalAlpha = gt;
|
|
3891
3896
|
}
|
|
3892
3897
|
}
|
|
3893
3898
|
}
|
|
@@ -4254,7 +4259,7 @@ class ci {
|
|
|
4254
4259
|
const d = t.createPattern(this._noiseTileCanvas, "repeat");
|
|
4255
4260
|
d && (t.fillStyle = d, t.fillRect(-o / 2, -e / 2, o, e));
|
|
4256
4261
|
}
|
|
4257
|
-
t.restore()
|
|
4262
|
+
t.restore();
|
|
4258
4263
|
}
|
|
4259
4264
|
applyPath(t, i, o, e, s) {
|
|
4260
4265
|
i != null && i.data && (i.type === "Path" || i.type === "Subtract" || i.type === "Union" || i.type === "Intersect" || i.type === "Exclude" || i.type), t.beginPath(), this._tracePath(t, i, o, e, s);
|
|
@@ -4360,59 +4365,59 @@ class ci {
|
|
|
4360
4365
|
}
|
|
4361
4366
|
const P = (D, q) => {
|
|
4362
4367
|
if (!D.visible || !D.svgPath) return;
|
|
4363
|
-
const ot = D.size || 14, yt = D.offset ?? 16, bt = D.color || "#ffffff",
|
|
4364
|
-
if (t.save(), t.translate(
|
|
4365
|
-
const It = new Path2D(Et),
|
|
4366
|
-
t.scale(
|
|
4368
|
+
const ot = D.size || 14, yt = D.offset ?? 16, bt = D.color || "#ffffff", pt = q ? -(s / 2) + yt : s / 2 - yt, Et = D.svgPath;
|
|
4369
|
+
if (t.save(), t.translate(pt, 0), !Et.startsWith("<svg")) {
|
|
4370
|
+
const It = new Path2D(Et), vt = ot / 24;
|
|
4371
|
+
t.scale(vt, vt), t.translate(-12, -12), t.fillStyle = bt, t.fill(It);
|
|
4367
4372
|
}
|
|
4368
4373
|
t.restore();
|
|
4369
4374
|
};
|
|
4370
4375
|
P(c, !0), P(d, !1);
|
|
4371
4376
|
const _ = e.text || "", E = e.placeholder || "Enter text...", A = !_, W = _ || E, z = A ? M : w, Y = I, G = e.fontFamily || "Inter", N = e.fontWeight || 400;
|
|
4372
4377
|
t.font = `${N} ${Y}px "${G}", sans-serif`, t.fillStyle = z, t.textAlign = "left", t.textBaseline = u ? "top" : "middle";
|
|
4373
|
-
const
|
|
4374
|
-
if (t.save(), t.beginPath(), t.rect(
|
|
4375
|
-
const D =
|
|
4378
|
+
const Q = e.inputPadding ?? 16, x = c.visible ? (c.offset ?? 16) + (c.size || 14) / 2 + 8 : Q, F = d.visible ? (d.offset ?? 16) + (d.size || 14) / 2 + 8 : Q, tt = -(s / 2) + x, X = s - x - F, et = e.inputType === "password" ? "•".repeat(W.length) : W;
|
|
4379
|
+
if (t.save(), t.beginPath(), t.rect(tt - 2, -n / 2 + 4, X + 4, n - 8), t.clip(), u) {
|
|
4380
|
+
const D = et.split(`
|
|
4376
4381
|
`);
|
|
4377
|
-
let q = -n / 2 +
|
|
4382
|
+
let q = -n / 2 + Q;
|
|
4378
4383
|
const ot = Y * 1.2;
|
|
4379
4384
|
let yt = 0;
|
|
4380
|
-
D.forEach((bt,
|
|
4385
|
+
D.forEach((bt, pt) => {
|
|
4381
4386
|
const Et = bt.split(" ");
|
|
4382
4387
|
let It = "";
|
|
4383
|
-
for (let
|
|
4384
|
-
const
|
|
4385
|
-
t.measureText(
|
|
4388
|
+
for (let vt = 0; vt < Et.length; vt++) {
|
|
4389
|
+
const Yt = It + Et[vt] + " ";
|
|
4390
|
+
t.measureText(Yt).width > X && vt > 0 ? (t.fillText(It, tt, q), It = Et[vt] + " ", q += ot) : It = Yt;
|
|
4386
4391
|
}
|
|
4387
|
-
t.fillText(It,
|
|
4388
|
-
}), a && !A && Math.floor(performance.now() / 500) % 2 === 0 && t.fillRect(
|
|
4392
|
+
t.fillText(It, tt, q), yt = t.measureText(It).width, pt < D.length - 1 && (q += ot, yt = 0);
|
|
4393
|
+
}), a && !A && Math.floor(performance.now() / 500) % 2 === 0 && t.fillRect(tt + yt, q, 1.5, Y);
|
|
4389
4394
|
} else {
|
|
4390
|
-
const q = t.measureText(
|
|
4395
|
+
const q = t.measureText(et).width;
|
|
4391
4396
|
let ot = 0;
|
|
4392
|
-
if (q > X && (ot = q - X), t.fillText(
|
|
4393
|
-
const bt =
|
|
4397
|
+
if (q > X && (ot = q - X), t.fillText(et, tt - ot, 0), a && !A && Math.floor(performance.now() / 500) % 2 === 0) {
|
|
4398
|
+
const bt = tt + q - ot;
|
|
4394
4399
|
t.fillRect(bt, -(Y / 2), 1.5, Y);
|
|
4395
4400
|
}
|
|
4396
4401
|
}
|
|
4397
4402
|
if (t.restore(), l.visible !== !1) {
|
|
4398
4403
|
const D = l.text || "Label", q = l.fontSize || 12, ot = l.color || "rgba(156, 163, 175, 1)", yt = l.offset ?? 8;
|
|
4399
4404
|
t.font = `600 ${q}px "${G}", sans-serif`, t.fillStyle = ot, t.textAlign = "left", t.textBaseline = "bottom";
|
|
4400
|
-
const bt = -(s / 2),
|
|
4401
|
-
t.fillText(D, bt,
|
|
4405
|
+
const bt = -(s / 2), pt = -(n / 2) - yt;
|
|
4406
|
+
t.fillText(D, bt, pt);
|
|
4402
4407
|
}
|
|
4403
4408
|
if (p.visible === !0) {
|
|
4404
4409
|
const D = p.text || "Helper text", q = p.fontSize || 11, ot = f === "error" ? "rgba(239, 68, 68, 1)" : p.color || "rgba(156, 163, 175, 1)", yt = p.offset ?? 6;
|
|
4405
4410
|
t.font = `400 ${q}px "${G}", sans-serif`, t.fillStyle = ot, t.textAlign = "left", t.textBaseline = "top";
|
|
4406
|
-
const bt = -(s / 2),
|
|
4407
|
-
t.fillText(D, bt,
|
|
4411
|
+
const bt = -(s / 2), pt = n / 2 + yt;
|
|
4412
|
+
t.fillText(D, bt, pt);
|
|
4408
4413
|
}
|
|
4409
4414
|
}
|
|
4410
4415
|
renderSlider(t, i) {
|
|
4411
|
-
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.geometry) || i.geometry, s = (o == null ? void 0 : o.options) || i.options || {}, n = e.width || 200, a = s.value ?? 50, r = s.min ?? 0, f = (s.max ?? 100) - r, l = f === 0 ? 0 : (a - r) / f, p = s.trackHeight || 4, c = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", u = s.trackPath || "", v = s.accentColor || "#3b82f6", b = s.inactiveColor || "#374151", m = s.thumbShape || "Ellipse", y = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", M = s.thumbPath || "", I = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", L = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, _ = s.tooltipOffsetY ?? -25, E = (X,
|
|
4416
|
+
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.geometry) || i.geometry, s = (o == null ? void 0 : o.options) || i.options || {}, n = e.width || 200, a = s.value ?? 50, r = s.min ?? 0, f = (s.max ?? 100) - r, l = f === 0 ? 0 : (a - r) / f, p = s.trackHeight || 4, c = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", u = s.trackPath || "", v = s.accentColor || "#3b82f6", b = s.inactiveColor || "#374151", m = s.thumbShape || "Ellipse", y = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", M = s.thumbPath || "", I = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", L = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, _ = s.tooltipOffsetY ?? -25, E = (X, et, R, O, D, q, ot) => {
|
|
4412
4417
|
if ((X === "Custom" || X === "Icon") && ot)
|
|
4413
4418
|
try {
|
|
4414
4419
|
const yt = new Path2D(ot);
|
|
4415
|
-
if (t.save(), t.translate(
|
|
4420
|
+
if (t.save(), t.translate(et, R), X === "Icon") {
|
|
4416
4421
|
const bt = Math.min(O, D) / 24;
|
|
4417
4422
|
t.scale(bt, bt), t.translate(-12, -12);
|
|
4418
4423
|
}
|
|
@@ -4422,28 +4427,28 @@ class ci {
|
|
|
4422
4427
|
console.error("Error drawing slider shape in engine:", yt);
|
|
4423
4428
|
}
|
|
4424
4429
|
if (t.beginPath(), X === "Ellipse")
|
|
4425
|
-
t.ellipse(
|
|
4430
|
+
t.ellipse(et, R, O / 2, D / 2, 0, 0, Math.PI * 2);
|
|
4426
4431
|
else if (X === "Rectangle")
|
|
4427
|
-
this.drawRoundRect(t,
|
|
4432
|
+
this.drawRoundRect(t, et - O / 2, R - D / 2, O, D, q);
|
|
4428
4433
|
else if (X === "Triangle")
|
|
4429
|
-
t.moveTo(
|
|
4434
|
+
t.moveTo(et, R - D / 2), t.lineTo(et + O / 2, R + D / 2), t.lineTo(et - O / 2, R + D / 2), t.closePath();
|
|
4430
4435
|
else if (X === "Diamond")
|
|
4431
|
-
t.moveTo(
|
|
4436
|
+
t.moveTo(et, R - D / 2), t.lineTo(et + O / 2, R), t.lineTo(et, R + D / 2), t.lineTo(et - O / 2, R), t.closePath();
|
|
4432
4437
|
else if (X === "Polygon") {
|
|
4433
4438
|
const yt = i.geometry.sides || 3, bt = i.geometry.radius || Math.min(O, D) / 2;
|
|
4434
|
-
for (let
|
|
4435
|
-
const Et =
|
|
4436
|
-
|
|
4439
|
+
for (let pt = 0; pt < yt; pt++) {
|
|
4440
|
+
const Et = pt * 2 * Math.PI / yt - Math.PI / 2, It = et + bt * Math.cos(Et), vt = R + bt * Math.sin(Et);
|
|
4441
|
+
pt === 0 ? t.moveTo(It, vt) : t.lineTo(It, vt);
|
|
4437
4442
|
}
|
|
4438
4443
|
t.closePath();
|
|
4439
4444
|
} else if (X === "Star") {
|
|
4440
|
-
const bt = Math.min(O, D) / 2,
|
|
4445
|
+
const bt = Math.min(O, D) / 2, pt = bt / 2;
|
|
4441
4446
|
for (let Et = 0; Et < 10; Et++) {
|
|
4442
|
-
const It = Et % 2 === 0 ? bt :
|
|
4443
|
-
t.lineTo(
|
|
4447
|
+
const It = Et % 2 === 0 ? bt : pt, vt = Et * Math.PI / 5 - Math.PI / 2;
|
|
4448
|
+
t.lineTo(et + It * Math.cos(vt), R + It * Math.sin(vt));
|
|
4444
4449
|
}
|
|
4445
4450
|
t.closePath();
|
|
4446
|
-
} else X === "Line" && (t.moveTo(
|
|
4451
|
+
} else X === "Line" && (t.moveTo(et - O / 2, R), t.lineTo(et + O / 2, R));
|
|
4447
4452
|
t.fill();
|
|
4448
4453
|
}, A = this.createCanvasFill(t, b, n, p);
|
|
4449
4454
|
A && (t.fillStyle = A, t.strokeStyle = A), d === "Line" ? (t.lineWidth = p, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo(n / 2, 0), t.stroke()) : E(d, 0, 0, n, p, c, u);
|
|
@@ -4455,24 +4460,24 @@ class ci {
|
|
|
4455
4460
|
t.save(), t.translate(z, 0);
|
|
4456
4461
|
const G = t.getTransform(), N = Math.sqrt(G.a * G.a + G.b * G.b) || 1;
|
|
4457
4462
|
t.shadowColor = "rgba(0,0,0,0.2)", t.shadowBlur = 4 * N, t.shadowOffsetY = 1 * N;
|
|
4458
|
-
const
|
|
4459
|
-
if (
|
|
4463
|
+
const Q = this.createCanvasFill(t, w, y, S);
|
|
4464
|
+
if (Q && (t.fillStyle = Q), E(m, 0, 0, y, S, C, m === "Icon" ? I : M), t.restore(), k) {
|
|
4460
4465
|
t.save(), t.translate(z + P, _);
|
|
4461
4466
|
const X = Math.round(a).toString();
|
|
4462
4467
|
t.font = "10px Inter, sans-serif";
|
|
4463
|
-
const
|
|
4468
|
+
const et = t.measureText(X), R = 6, O = 4, D = et.width + R * 2, q = 14 + O;
|
|
4464
4469
|
t.beginPath(), this.drawRoundRect(t, -D / 2, -q / 2, D, q, 4), t.fillStyle = T, t.fill(), t.fillStyle = L, t.textAlign = "center", t.textBaseline = "middle", t.fillText(X, 0, 0), t.restore();
|
|
4465
4470
|
}
|
|
4466
|
-
const x = s.label || {}, F = s.helperText || {},
|
|
4471
|
+
const x = s.label || {}, F = s.helperText || {}, tt = s.fontFamily || "Inter";
|
|
4467
4472
|
if (x.visible !== !1) {
|
|
4468
|
-
const X = x.text || "Label",
|
|
4469
|
-
t.font = `600 ${
|
|
4473
|
+
const X = x.text || "Label", et = x.fontSize || 12, R = x.color || "rgba(156, 163, 175, 1)", O = x.offset ?? 8;
|
|
4474
|
+
t.font = `600 ${et}px "${tt}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "bottom";
|
|
4470
4475
|
const D = -(n / 2), q = -(p / 2) - O;
|
|
4471
4476
|
t.fillText(X, D, q);
|
|
4472
4477
|
}
|
|
4473
4478
|
if (F.visible === !0) {
|
|
4474
|
-
const X = F.text || "Helper text",
|
|
4475
|
-
t.font = `400 ${
|
|
4479
|
+
const X = F.text || "Helper text", et = F.fontSize || 11, R = F.color || "rgba(156, 163, 175, 1)", O = F.offset ?? 6;
|
|
4480
|
+
t.font = `400 ${et}px "${tt}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "top";
|
|
4476
4481
|
const D = -(n / 2), q = p / 2 + O;
|
|
4477
4482
|
t.fillText(X, D, q);
|
|
4478
4483
|
}
|
|
@@ -4514,20 +4519,20 @@ class ci {
|
|
|
4514
4519
|
if (t.save(), t.beginPath(), t.rect(a + m, r, P, n), t.clip(), t.fillText(w, a + m, 0), t.restore(), p && !f) {
|
|
4515
4520
|
const E = r + n + 4, A = e.optionsList || [], W = e.itemHeight || 32, z = e.listPadding ?? 4, Y = A.length * W + z * 2, G = e.listCornerRadius ?? h;
|
|
4516
4521
|
t.save();
|
|
4517
|
-
const N = e.listShadow || {},
|
|
4522
|
+
const N = e.listShadow || {}, Q = t.getTransform(), x = Math.sqrt(Q.a * Q.a + Q.b * Q.b) || 1;
|
|
4518
4523
|
t.shadowColor = typeof N.color == "string" ? N.color : ((_ = N.color) == null ? void 0 : _.color) || "rgba(0,0,0,0.15)", t.shadowBlur = (N.blur ?? 12) * x, t.shadowOffsetY = (N.offsetY ?? 6) * x, t.shadowOffsetX = (N.offsetX ?? 0) * x, t.beginPath(), this.drawRoundRect(t, a, E, s, Y, G), t.fillStyle = this.createCanvasFill(t, typeof e.listBackgroundColor == "string" ? { type: "Solid", color: e.listBackgroundColor } : e.listBackgroundColor || { type: "Solid", color: "#ffffff" }, s, Y) || "#ffffff", t.fill();
|
|
4519
4524
|
const F = e.listBorderWidth ?? 1;
|
|
4520
4525
|
F > 0 && (t.shadowColor = "transparent", t.strokeStyle = this.createCanvasFill(t, typeof e.listBorderColor == "string" ? { type: "Solid", color: e.listBorderColor } : e.listBorderColor || { type: "Solid", color: d }, s, Y) || "#e5e7eb", t.lineWidth = F, t.stroke()), t.restore();
|
|
4521
|
-
const
|
|
4522
|
-
t.font = `${I} ${
|
|
4526
|
+
const tt = e.itemFontSize || M, X = e.itemFontFamily || k;
|
|
4527
|
+
t.font = `${I} ${tt}px ${X}`, A.forEach((et, R) => {
|
|
4523
4528
|
const O = E + z + R * W;
|
|
4524
|
-
if (
|
|
4529
|
+
if (et === e.selectedOption)
|
|
4525
4530
|
t.fillStyle = this.createCanvasFill(t, typeof e.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: e.itemSelectedBackgroundColor } : e.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, s, W) || "#f3f4f6", t.fillRect(a + F, O, s - F * 2, W), t.fillStyle = e.itemSelectedColor || e.accentColor || u || "#374151";
|
|
4526
4531
|
else if (t.fillStyle = e.listTextColor || u || "#333333", this.activeDropdownId === i.id && this._lastPointerPos) {
|
|
4527
4532
|
const q = this._lastPointerPos.y - (E + z), ot = Math.floor(q / W);
|
|
4528
4533
|
R === ot && (t.fillStyle = this.createCanvasFill(t, typeof e.itemHoverBackgroundColor == "string" ? { type: "Solid", color: e.itemHoverBackgroundColor } : e.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, s, W) || "#f9fafb", t.fillRect(a + F, O, s - F * 2, W), t.fillStyle = e.itemHoverColor || u);
|
|
4529
4534
|
}
|
|
4530
|
-
t.fillText(
|
|
4535
|
+
t.fillText(et, a + m, O + W / 2);
|
|
4531
4536
|
});
|
|
4532
4537
|
}
|
|
4533
4538
|
t.globalAlpha = v;
|
|
@@ -4560,7 +4565,7 @@ class ci {
|
|
|
4560
4565
|
t.font = `${l.fontWeight || 600} ${d}px "${u}", sans-serif`, t.fillStyle = c, t.textAlign = "center", t.textBaseline = "middle", t.fillText(l.text || "Toggle", 0, 0), t.restore();
|
|
4561
4566
|
}
|
|
4562
4567
|
renderToggle(t, i) {
|
|
4563
|
-
var G, N,
|
|
4568
|
+
var G, N, Q, x, F, tt, X, et, R, O, D, q;
|
|
4564
4569
|
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((G = i.geometry) == null ? void 0 : G.width) || 52, n = ((N = i.geometry) == null ? void 0 : N.height) || 30, a = -s / 2, r = -n / 2, h = e.checked ?? !1, f = e.cornerRadius ?? e.corner_radius ?? n / 2, l = e.toggleStyle || {}, p = l.backgroundColor || e.activeColor || "#10b981", c = l.borderColor || e.borderColor || "transparent", d = l.borderWidth ?? e.borderWidth ?? 0, u = l.knobColor || e.knobColor || "#ffffff", v = h ? p : e.inactiveColor || "#374151", b = h ? c : e.borderColor || "transparent", m = h ? d : e.borderWidth ?? 0, y = h ? u : e.knobColor || "#ffffff";
|
|
4565
4570
|
e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, f);
|
|
4566
4571
|
const S = this.createCanvasFill(t, v, s, n);
|
|
@@ -4574,22 +4579,22 @@ class ci {
|
|
|
4574
4579
|
const P = this.createCanvasFill(t, y, w, w);
|
|
4575
4580
|
P && (t.fillStyle = P, t.fill()), e.disabled && (t.globalAlpha *= 2);
|
|
4576
4581
|
let _ = !1, E = !1;
|
|
4577
|
-
const A = (h ? (
|
|
4582
|
+
const A = (h ? (Q = l.leftLabel) == null ? void 0 : Q.text : null) || ((x = e.leftLabel) == null ? void 0 : x.text) || "", W = (h ? (F = l.leftLabel) == null ? void 0 : F.color : null) || ((tt = e.leftLabel) == null ? void 0 : tt.color) || "#f3f4f6";
|
|
4578
4583
|
if ((X = e.leftLabel) != null && X.enabled && A) {
|
|
4579
4584
|
const ot = e.leftLabel;
|
|
4580
4585
|
t.font = `${ot.fontWeight || 400} ${ot.fontSize || 12}px "${ot.fontFamily || "Inter"}", sans-serif`, t.fillStyle = W, t.textBaseline = "middle", t.textAlign = "right", t.fillText(A, a - (ot.gap || 8), 0), _ = !0;
|
|
4581
4586
|
}
|
|
4582
|
-
const z = (h ? (
|
|
4587
|
+
const z = (h ? (et = l.rightLabel) == null ? void 0 : et.text : null) || ((R = e.rightLabel) == null ? void 0 : R.text) || "", Y = (h ? (O = l.rightLabel) == null ? void 0 : O.color : null) || ((D = e.rightLabel) == null ? void 0 : D.color) || "#f3f4f6";
|
|
4583
4588
|
if ((q = e.rightLabel) != null && q.enabled && z) {
|
|
4584
4589
|
const ot = e.rightLabel;
|
|
4585
4590
|
t.font = `${ot.fontWeight || 400} ${ot.fontSize || 12}px "${ot.fontFamily || "Inter"}", sans-serif`, t.fillStyle = Y, t.textBaseline = "middle", t.textAlign = "left", t.fillText(z, a + s + (ot.gap || 8), 0), E = !0;
|
|
4586
4591
|
}
|
|
4587
4592
|
if (!_ && !E && e.label && e.label.text) {
|
|
4588
|
-
const ot = e.label, yt = ot.fontSize || 14, bt = ot.fontWeight || 400,
|
|
4589
|
-
t.font = `${bt} ${yt}px "${
|
|
4593
|
+
const ot = e.label, yt = ot.fontSize || 14, bt = ot.fontWeight || 400, pt = ot.fontFamily || "Inter";
|
|
4594
|
+
t.font = `${bt} ${yt}px "${pt}", sans-serif`, t.fillStyle = ot.color || "#f3f4f6", t.textBaseline = "middle";
|
|
4590
4595
|
const Et = ot.gap || 10;
|
|
4591
|
-
let It = 0,
|
|
4592
|
-
ot.position === "left" ? (t.textAlign = "right", It = a - Et,
|
|
4596
|
+
let It = 0, vt = 0;
|
|
4597
|
+
ot.position === "left" ? (t.textAlign = "right", It = a - Et, vt = 0) : ot.position === "right" ? (t.textAlign = "left", It = a + s + Et, vt = 0) : ot.position === "top" ? (t.textAlign = "center", It = 0, vt = r - Et, t.textBaseline = "bottom") : ot.position === "bottom" ? (t.textAlign = "center", It = 0, vt = r + n + Et, t.textBaseline = "top") : (t.textAlign = "left", It = a + s + Et, vt = 0), t.fillText(ot.text, It, vt);
|
|
4593
4598
|
}
|
|
4594
4599
|
}
|
|
4595
4600
|
renderCheckbox(t, i) {
|
|
@@ -4784,10 +4789,10 @@ class ci {
|
|
|
4784
4789
|
s.datasets.forEach((W, z) => {
|
|
4785
4790
|
const Y = W.data[_] ?? 0;
|
|
4786
4791
|
if (Y === 0) return;
|
|
4787
|
-
const G = Y / u * M, N = Math.min(s.barWidth * d + s.barGap, P - 8),
|
|
4792
|
+
const G = Y / u * M, N = Math.min(s.barWidth * d + s.barGap, P - 8), Q = E - N / 2, x = A;
|
|
4788
4793
|
A += G;
|
|
4789
4794
|
const F = s._resolveColor(W.color, z);
|
|
4790
|
-
t.beginPath(), t.fillStyle = s._makeGradient(t, F, x,
|
|
4795
|
+
t.beginPath(), t.fillStyle = s._makeGradient(t, F, x, Q, x + G, Q), s._drawRoundedBar(t, x, Q, G, N, z === d - 1 ? s.barCornerRadius : 0, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
|
|
4791
4796
|
});
|
|
4792
4797
|
}
|
|
4793
4798
|
} else {
|
|
@@ -4799,10 +4804,10 @@ class ci {
|
|
|
4799
4804
|
s.datasets.forEach((W, z) => {
|
|
4800
4805
|
const Y = W.data[_] ?? 0;
|
|
4801
4806
|
if (Y === 0) return;
|
|
4802
|
-
const G = Y / u * I, N = Math.min(s.barWidth * d + s.barGap, P - 8),
|
|
4807
|
+
const G = Y / u * I, N = Math.min(s.barWidth * d + s.barGap, P - 8), Q = E - N / 2, x = A - G;
|
|
4803
4808
|
A -= G;
|
|
4804
4809
|
const F = s._resolveColor(W.color, z);
|
|
4805
|
-
t.beginPath(), t.fillStyle = s._makeGradient(t, F,
|
|
4810
|
+
t.beginPath(), t.fillStyle = s._makeGradient(t, F, Q, x, Q, x + G), s._drawRoundedBar(t, Q, x, N, G, z === d - 1 ? s.barCornerRadius : 0, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
|
|
4806
4811
|
});
|
|
4807
4812
|
}
|
|
4808
4813
|
}
|
|
@@ -4813,10 +4818,10 @@ class ci {
|
|
|
4813
4818
|
s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", C - 5, W), s.enableShadows && (t.shadowColor = s.shadowColor));
|
|
4814
4819
|
const z = W - _ / 2;
|
|
4815
4820
|
s.datasets.forEach((Y, G) => {
|
|
4816
|
-
const N = Y.data[A] ?? 0,
|
|
4817
|
-
if (
|
|
4818
|
-
const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E : E -
|
|
4819
|
-
t.beginPath(), t.fillStyle = s._makeGradient(t,
|
|
4821
|
+
const N = Y.data[A] ?? 0, Q = Math.abs(N / u * M);
|
|
4822
|
+
if (Q < 1) return;
|
|
4823
|
+
const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E : E - Q, tt = s._resolveColor(Y.color, G);
|
|
4824
|
+
t.beginPath(), t.fillStyle = s._makeGradient(t, tt, F, x, F + Q, x), s._drawRoundedBar(t, F, x, Q, s.barWidth, s.barCornerRadius, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? tt : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = N >= 0 ? "left" : "right", t.textBaseline = "middle", t.fillStyle = s.valueColor === "auto" ? tt : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), N >= 0 ? F + Q + 4 : F - 4, x + s.barWidth / 2), s.enableShadows && (t.shadowColor = s.shadowColor));
|
|
4820
4825
|
});
|
|
4821
4826
|
}
|
|
4822
4827
|
} else {
|
|
@@ -4826,10 +4831,10 @@ class ci {
|
|
|
4826
4831
|
s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", W, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
|
|
4827
4832
|
const z = W - _ / 2;
|
|
4828
4833
|
s.datasets.forEach((Y, G) => {
|
|
4829
|
-
const N = Y.data[A] ?? 0,
|
|
4830
|
-
if (
|
|
4831
|
-
const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E -
|
|
4832
|
-
t.beginPath(), t.fillStyle = s._makeGradient(t,
|
|
4834
|
+
const N = Y.data[A] ?? 0, Q = Math.abs(N / u * I);
|
|
4835
|
+
if (Q < 1) return;
|
|
4836
|
+
const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E - Q : E, tt = s._resolveColor(Y.color, G);
|
|
4837
|
+
t.beginPath(), t.fillStyle = s._makeGradient(t, tt, x, F, x, F + Q), s._drawRoundedBar(t, x, F, s.barWidth, Q, s.barCornerRadius, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? tt : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = N >= 0 ? "bottom" : "top", t.fillStyle = s.valueColor === "auto" ? tt : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), x + s.barWidth / 2, N >= 0 ? F - 4 : F + Q + 4), s.enableShadows && (t.shadowColor = s.shadowColor));
|
|
4833
4838
|
});
|
|
4834
4839
|
}
|
|
4835
4840
|
}
|
|
@@ -5182,9 +5187,9 @@ class ci {
|
|
|
5182
5187
|
const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
|
|
5183
5188
|
t.fill();
|
|
5184
5189
|
}
|
|
5185
|
-
const
|
|
5186
|
-
if (
|
|
5187
|
-
t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth =
|
|
5190
|
+
const Q = e.borderWidth ?? 0;
|
|
5191
|
+
if (Q > 0) {
|
|
5192
|
+
t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth = Q, t.beginPath();
|
|
5188
5193
|
const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
|
|
5189
5194
|
t.stroke();
|
|
5190
5195
|
}
|
|
@@ -5203,52 +5208,52 @@ class ci {
|
|
|
5203
5208
|
const P = typeof v == "number" ? v : f === "vertical" ? v[0] : v[3];
|
|
5204
5209
|
let _ = (f === "vertical" ? r : a) + u + P;
|
|
5205
5210
|
if (t.textBaseline = "middle", l.forEach((G, N) => {
|
|
5206
|
-
const
|
|
5207
|
-
let
|
|
5208
|
-
if (
|
|
5209
|
-
const
|
|
5210
|
-
|
|
5211
|
+
const Q = e.listLayout || "linear", x = Q === "circular" ? d : f === "vertical" ? s : d, F = Q === "circular" || f === "vertical" ? c : n;
|
|
5212
|
+
let tt = 0, X = 0, et = 0;
|
|
5213
|
+
if (Q === "circular") {
|
|
5214
|
+
const vt = l.length || 1, Yt = Math.PI * 2 / vt, se = e.circularStartAngle || 0, fe = e.circularRadius || 100, st = u * 0.01 + se * Math.PI / 180, gt = N * Yt + st, Rt = a + s / 2, Pt = r + n / 2;
|
|
5215
|
+
tt = Rt + Math.cos(gt) * fe - x / 2, X = Pt + Math.sin(gt) * fe - F / 2, et = gt + (e.itemRotation || 0) * Math.PI / 180;
|
|
5211
5216
|
} else
|
|
5212
|
-
|
|
5217
|
+
tt = f === "vertical" ? a : _, X = f === "vertical" ? _ : r, et = (e.itemRotation || 0) * Math.PI / 180;
|
|
5213
5218
|
const R = C === N, O = w === N, D = O && e.activeItemShape ? e.activeItemShape : e.itemShape || "rectangle", q = O && e.activeItemShape ? e.activeItemPath : e.itemPath || "", ot = e.itemCornerRadius || 0;
|
|
5214
|
-
if (t.save(),
|
|
5215
|
-
const
|
|
5216
|
-
t.fillStyle =
|
|
5217
|
-
const
|
|
5218
|
-
t.globalAlpha =
|
|
5219
|
+
if (t.save(), et !== 0 && (t.translate(tt + x / 2, X + F / 2), t.rotate(et), t.translate(-(tt + x / 2), -(X + F / 2))), O) {
|
|
5220
|
+
const vt = this.createCanvasFill(t, m, x, F);
|
|
5221
|
+
t.fillStyle = vt || m;
|
|
5222
|
+
const Yt = t.globalAlpha;
|
|
5223
|
+
t.globalAlpha = Yt * 0.8, t.beginPath(), this.drawCustomShape(t, D, q, tt, X, x, F, ot) || (t.rect(tt, X, x, F), t.fill()), t.globalAlpha = Yt;
|
|
5219
5224
|
} else if (R)
|
|
5220
|
-
t.fillStyle = b ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", t.beginPath(), this.drawCustomShape(t, D, q,
|
|
5225
|
+
t.fillStyle = b ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", t.beginPath(), this.drawCustomShape(t, D, q, tt, X, x, F, ot) || (t.rect(tt, X, x, F), t.fill());
|
|
5221
5226
|
else if (S !== "transparent") {
|
|
5222
|
-
const
|
|
5223
|
-
t.fillStyle =
|
|
5227
|
+
const vt = this.createCanvasFill(t, S, x, F);
|
|
5228
|
+
t.fillStyle = vt || S, t.beginPath(), this.drawCustomShape(t, D, q, tt, X, x, F, ot) || (t.rect(tt, X, x, F), t.fill());
|
|
5224
5229
|
}
|
|
5225
5230
|
if (O || R) {
|
|
5226
|
-
const
|
|
5227
|
-
t.fillStyle =
|
|
5231
|
+
const vt = this.createCanvasFill(t, m, f === "vertical" ? 3 : x, f === "vertical" ? F : 3);
|
|
5232
|
+
t.fillStyle = vt || m, f === "vertical" ? t.fillRect(tt, X, 3, F) : t.fillRect(tt, X + F - 3, x, 3);
|
|
5228
5233
|
}
|
|
5229
5234
|
const yt = O ? "#ffffff" : b ? "rgba(255, 255, 255, 0.9)" : y;
|
|
5230
5235
|
t.fillStyle = yt, t.font = O || R ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
|
|
5231
|
-
const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`,
|
|
5232
|
-
f === "horizontal" ||
|
|
5233
|
-
const It =
|
|
5236
|
+
const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`, pt = tt + (f === "vertical" ? 16 : x / 2), Et = X + F / 2;
|
|
5237
|
+
f === "horizontal" || Q === "circular" ? t.textAlign = "center" : t.textAlign = "left";
|
|
5238
|
+
const It = Q === "circular" ? tt + x / 2 : pt;
|
|
5234
5239
|
t.fillText(bt, It, Et), t.restore(), _ += (f === "vertical" ? c : d) + p;
|
|
5235
5240
|
}), t.restore(), e.showScrollbar !== !1) {
|
|
5236
|
-
const G = (l.length || 0) * (f === "vertical" ? c : d) + ((l.length || 0) - 1) * p, N = f === "vertical" ? n : s,
|
|
5237
|
-
if (G > N ||
|
|
5238
|
-
const F = e.scrollbarColor || "rgba(255,255,255,0.3)",
|
|
5241
|
+
const G = (l.length || 0) * (f === "vertical" ? c : d) + ((l.length || 0) - 1) * p, N = f === "vertical" ? n : s, Q = e.listLayout || "linear", x = e.containerShape === "circle" || Q === "circular";
|
|
5242
|
+
if (G > N || Q === "circular" && l.length > 0) {
|
|
5243
|
+
const F = e.scrollbarColor || "rgba(255,255,255,0.3)", tt = e.scrollbarWidth || 4;
|
|
5239
5244
|
if (x) {
|
|
5240
|
-
const X = Math.min(s, n) / 2 -
|
|
5241
|
-
if (t.strokeStyle = F, t.lineWidth =
|
|
5245
|
+
const X = Math.min(s, n) / 2 - tt / 2 - 2, et = a + s / 2, R = r + n / 2;
|
|
5246
|
+
if (t.strokeStyle = F, t.lineWidth = tt, t.lineCap = "round", t.beginPath(), Q === "circular") {
|
|
5242
5247
|
const O = Math.PI / 4, D = -(u * 0.01) - Math.PI / 2;
|
|
5243
|
-
t.arc(
|
|
5248
|
+
t.arc(et, R, X, D, D + O);
|
|
5244
5249
|
} else {
|
|
5245
5250
|
const O = Math.PI / 2, D = N / G, q = O * D, ot = -u / G * O, bt = -Math.PI / 4 + ot;
|
|
5246
|
-
t.arc(
|
|
5251
|
+
t.arc(et, R, X, bt, bt + q);
|
|
5247
5252
|
}
|
|
5248
5253
|
t.stroke();
|
|
5249
5254
|
} else {
|
|
5250
|
-
const X = N / G,
|
|
5251
|
-
t.fillStyle = F, f === "vertical" ? t.fillRect(a + s -
|
|
5255
|
+
const X = N / G, et = N * X, R = -u / G * N;
|
|
5256
|
+
t.fillStyle = F, f === "vertical" ? t.fillRect(a + s - tt - 2, r + R, tt, et) : t.fillRect(a + R, r + n - tt - 2, et, tt);
|
|
5252
5257
|
}
|
|
5253
5258
|
}
|
|
5254
5259
|
}
|
|
@@ -5293,18 +5298,18 @@ class ci {
|
|
|
5293
5298
|
let T = (h === "vertical" ? I : M) + c + k;
|
|
5294
5299
|
const L = e.listLayout || "linear", P = n.length || 1, _ = Math.PI * 2 / P, E = e.circularStartAngle || 0, A = e.circularRadius || 100, W = c * 0.01 + E * Math.PI / 180;
|
|
5295
5300
|
for (let G = 0; G < n.length; G++) {
|
|
5296
|
-
const N = L === "circular" ? p : h === "vertical" ? a : p,
|
|
5297
|
-
let x = 0, F = 0,
|
|
5301
|
+
const N = L === "circular" ? p : h === "vertical" ? a : p, Q = L === "circular" || h === "vertical" ? l : r;
|
|
5302
|
+
let x = 0, F = 0, tt = 0;
|
|
5298
5303
|
if (L === "circular") {
|
|
5299
|
-
const X = G * _ + W,
|
|
5300
|
-
x =
|
|
5304
|
+
const X = G * _ + W, et = M + a / 2, R = I + r / 2;
|
|
5305
|
+
x = et + Math.cos(X) * A - N / 2, F = R + Math.sin(X) * A - Q / 2, tt = X + (e.itemRotation || 0) * Math.PI / 180;
|
|
5301
5306
|
} else
|
|
5302
|
-
x = h === "vertical" ? M : T, F = h === "vertical" ? T : I,
|
|
5303
|
-
if (
|
|
5304
|
-
const X = x + N / 2,
|
|
5305
|
-
if (q >= x && q <= x + N && ot >= F && ot <= F +
|
|
5307
|
+
x = h === "vertical" ? M : T, F = h === "vertical" ? T : I, tt = (e.itemRotation || 0) * Math.PI / 180;
|
|
5308
|
+
if (tt !== 0) {
|
|
5309
|
+
const X = x + N / 2, et = F + Q / 2, R = C - X, O = w - et, D = -tt, q = R * Math.cos(D) - O * Math.sin(D) + X, ot = R * Math.sin(D) + O * Math.cos(D) + et;
|
|
5310
|
+
if (q >= x && q <= x + N && ot >= F && ot <= F + Q)
|
|
5306
5311
|
return G;
|
|
5307
|
-
} else if (C >= x && C <= x + N && w >= F && w <= F +
|
|
5312
|
+
} else if (C >= x && C <= x + N && w >= F && w <= F + Q)
|
|
5308
5313
|
return G;
|
|
5309
5314
|
T += (h === "vertical" ? l : p) + f;
|
|
5310
5315
|
}
|
|
@@ -5324,120 +5329,120 @@ class ci {
|
|
|
5324
5329
|
if (!e.behaviors || e.behaviors.length === 0) return;
|
|
5325
5330
|
const s = this.objectStates.get(e.id);
|
|
5326
5331
|
s && e.behaviors.forEach((n) => {
|
|
5327
|
-
var p, c, d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N,
|
|
5332
|
+
var p, c, d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, Q, x, F, tt, X, et, R, O, D, q, ot, yt, bt, pt, Et, It, vt, Yt, se, fe, st, gt, Rt, Pt, dt, Ft, Dt, $t, Ot, Vt, ne, me, ye, Ut, Se, Pe, Ee, Ce, Ae, xe, ie, jt, ht, mt, at, B, K, j, kt, At, Tt, xt, Mt, $, Wt, Kt, te, Jt, ut, ct, Ct, rt, V, it, nt, St, Xt, Qt, oe, Gt, Ht, Nt, Ie, Le, Re, Oe, Fe, $e, Ye, zt, ae, we, Be, We, de, ce, he, ke, Xe, Ve, Ne, De, He;
|
|
5328
5333
|
if (!n.enabled) return;
|
|
5329
5334
|
const a = n.startTime || 0, r = n.endTime || 1 / 0;
|
|
5330
5335
|
if (this.currentTime < a || this.currentTime > r) return;
|
|
5331
5336
|
const h = s.x - i, f = s.y - o, l = Math.sqrt(h * h + f * f);
|
|
5332
5337
|
if (this.frameCount % 240 === 0 && Math.random() < 0.1 && this.log(`[ExodeUI] Executing ${n.type} on ${e.name}`), n.type === U.Proximity) {
|
|
5333
|
-
const H = ((p = n.settings) == null ? void 0 : p.radius) || 300,
|
|
5334
|
-
let
|
|
5335
|
-
l < H && (
|
|
5336
|
-
this.applyBehaviorSensor(s, ft,
|
|
5338
|
+
const H = ((p = n.settings) == null ? void 0 : p.radius) || 300, Z = ((c = n.settings) == null ? void 0 : c.falloff) || "smooth";
|
|
5339
|
+
let J = 0;
|
|
5340
|
+
l < H && (Z === "linear" ? J = 1 - l / H : J = Math.pow(1 - l / H, 2)), n.sensors.forEach((ft) => {
|
|
5341
|
+
this.applyBehaviorSensor(s, ft, J, t, n.settings, e, h, f, l);
|
|
5337
5342
|
});
|
|
5338
5343
|
} else if (n.type === U.Magnetic) {
|
|
5339
|
-
const H = ((d = n.settings) == null ? void 0 : d.radius) || 400,
|
|
5344
|
+
const H = ((d = n.settings) == null ? void 0 : d.radius) || 400, Z = ((u = n.settings) == null ? void 0 : u.strength) || 0.5;
|
|
5340
5345
|
if (l < H && l > 5) {
|
|
5341
|
-
const
|
|
5342
|
-
s.x -= ft * t * 10, s.y -=
|
|
5346
|
+
const J = 1 - l / H, ft = h * J * Z, _t = f * J * Z;
|
|
5347
|
+
s.x -= ft * t * 10, s.y -= _t * t * 10;
|
|
5343
5348
|
}
|
|
5344
5349
|
} else if (n.type === U.Repel) {
|
|
5345
|
-
const H = ((v = n.settings) == null ? void 0 : v.radius) || 300,
|
|
5350
|
+
const H = ((v = n.settings) == null ? void 0 : v.radius) || 300, Z = ((b = n.settings) == null ? void 0 : b.strength) || 1;
|
|
5346
5351
|
if (l < H) {
|
|
5347
|
-
const
|
|
5348
|
-
s.x += h / (l || 1) *
|
|
5352
|
+
const J = Math.pow(1 - l / H, 2);
|
|
5353
|
+
s.x += h / (l || 1) * J * 60 * Z * t * 5, s.y += f / (l || 1) * J * 60 * Z * t * 5;
|
|
5349
5354
|
}
|
|
5350
5355
|
} else if (n.type === U.Orbit) {
|
|
5351
|
-
const H = ((m = n.settings) == null ? void 0 : m.speed) || 1,
|
|
5352
|
-
s.x += Math.cos(
|
|
5356
|
+
const H = ((m = n.settings) == null ? void 0 : m.speed) || 1, Z = ((y = n.settings) == null ? void 0 : y.radius) || 30, J = this.currentTime * H * Math.PI * 2;
|
|
5357
|
+
s.x += Math.cos(J) * Z * t * 5, s.y += Math.sin(J) * Z * t * 5, s.rotation += 2 * t * 5;
|
|
5353
5358
|
} else if (n.type === U.Vortex) {
|
|
5354
|
-
const H = ((S = n.settings) == null ? void 0 : S.radius) || 400,
|
|
5359
|
+
const H = ((S = n.settings) == null ? void 0 : S.radius) || 400, Z = ((C = n.settings) == null ? void 0 : C.speed) || 2, J = ((w = n.settings) == null ? void 0 : w.strength) || 1;
|
|
5355
5360
|
if (l < H) {
|
|
5356
|
-
const ft = Math.pow(1 - l / H, 1.5),
|
|
5357
|
-
s.x += Lt * ft *
|
|
5361
|
+
const ft = Math.pow(1 - l / H, 1.5), _t = this.currentTime * Z * Math.PI * 2, Lt = Math.cos(_t) * 30 - h * 0.4, Bt = Math.sin(_t) * 30 - f * 0.4;
|
|
5362
|
+
s.x += Lt * ft * J * t * 5, s.y += Bt * ft * J * t * 5, s.rotation += 5 * ft * J * t * 5, s.scale_x *= 1 - ft * 0.1 * J * t, s.scale_y *= 1 - ft * 0.1 * J * t;
|
|
5358
5363
|
}
|
|
5359
5364
|
} else if (n.type === U.Fluid) {
|
|
5360
|
-
const H = ((M = n.settings) == null ? void 0 : M.radius) || 300,
|
|
5365
|
+
const H = ((M = n.settings) == null ? void 0 : M.radius) || 300, Z = ((I = n.settings) == null ? void 0 : I.strength) || 1;
|
|
5361
5366
|
if (l < H) {
|
|
5362
|
-
const
|
|
5363
|
-
s.x += ft * 10 * t * 5, s.y +=
|
|
5367
|
+
const J = Math.pow(1 - l / H, 1.2), ft = h / (l || 1) * J * 1.2 * Z, _t = f / (l || 1) * J * 1.2 * Z;
|
|
5368
|
+
s.x += ft * 10 * t * 5, s.y += _t * 10 * t * 5, s.scale_x *= 1 + J * 0.3 * Z * t, s.scale_y *= 1 + J * 0.3 * Z * t;
|
|
5364
5369
|
}
|
|
5365
5370
|
} else if (n.type === U.Elastic) {
|
|
5366
|
-
const H = ((k = n.settings) == null ? void 0 : k.radius) || 300,
|
|
5371
|
+
const H = ((k = n.settings) == null ? void 0 : k.radius) || 300, Z = ((T = n.settings) == null ? void 0 : T.strength) || 1;
|
|
5367
5372
|
if (l < H) {
|
|
5368
|
-
const
|
|
5369
|
-
s.scale_x *= 1 +
|
|
5373
|
+
const J = 1 - l / H;
|
|
5374
|
+
s.scale_x *= 1 + J * 0.4 * Z * t, s.scale_y *= 1 + J * 0.4 * Z * t;
|
|
5370
5375
|
}
|
|
5371
5376
|
} else if (n.type === U.Holographic) {
|
|
5372
|
-
const H = s.x - this.canvasWidth / 2,
|
|
5373
|
-
if (s.x -= H / 1e3 *
|
|
5377
|
+
const H = s.x - this.canvasWidth / 2, Z = s.y - this.canvasHeight / 2, J = ((L = n.settings) == null ? void 0 : L.factor) || 25;
|
|
5378
|
+
if (s.x -= H / 1e3 * J * t * 5, s.y -= Z / 1e3 * J * t * 5, s.style) {
|
|
5374
5379
|
const ft = 1 - Math.min(1, l / 400);
|
|
5375
5380
|
s.style.exposure = (s.style.exposure || 1) + ft * 0.5 * t;
|
|
5376
5381
|
}
|
|
5377
5382
|
} else if (n.type === U.Sticky) {
|
|
5378
|
-
const H = ((P = n.settings) == null ? void 0 : P.radius) || 80,
|
|
5383
|
+
const H = ((P = n.settings) == null ? void 0 : P.radius) || 80, Z = ((_ = n.settings) == null ? void 0 : _.strength) || 1;
|
|
5379
5384
|
if (l < H) {
|
|
5380
|
-
const
|
|
5381
|
-
s.x -= h *
|
|
5385
|
+
const J = Math.pow(1 - l / H, 2);
|
|
5386
|
+
s.x -= h * J * Z * t * 10, s.y -= f * J * Z * t * 10, s.scale_x *= 1 - J * 0.1 * Z * t, s.scale_y *= 1 - J * 0.1 * Z * t;
|
|
5382
5387
|
}
|
|
5383
5388
|
} else if (n.type === U.Dilation) {
|
|
5384
|
-
const H = ((E = n.settings) == null ? void 0 : E.size) || 120,
|
|
5389
|
+
const H = ((E = n.settings) == null ? void 0 : E.size) || 120, Z = ((A = n.settings) == null ? void 0 : A.strength) || 1;
|
|
5385
5390
|
if (l < H) {
|
|
5386
|
-
const
|
|
5387
|
-
s.scale_x *= 1 +
|
|
5391
|
+
const J = 1 - l / H;
|
|
5392
|
+
s.scale_x *= 1 + J * 0.5 * Z * t, s.scale_y *= 1 + J * 0.5 * Z * t;
|
|
5388
5393
|
}
|
|
5389
5394
|
} else if (n.type === U.Parallax) {
|
|
5390
|
-
const H = ((W = n.settings) == null ? void 0 : W.factor) || 15,
|
|
5391
|
-
s.x = this.lerp(s.x ?? ((x = e.transform) == null ? void 0 : x.x) ?? 0, ee, be), s.y = this.lerp(s.y ?? ((F = e.transform) == null ? void 0 : F.y) ?? 0, ue, be), s.rotate_x = this.lerp(s.rotate_x ?? ((
|
|
5395
|
+
const H = ((W = n.settings) == null ? void 0 : W.factor) || 15, Z = ((z = n.settings) == null ? void 0 : z.strength) || 1, J = this.canvasWidth / 2, ft = this.canvasHeight / 2, _t = this._lastPointerPos || { x: J, y: ft }, Lt = (_t.x - J) / J, Bt = (_t.y - ft) / ft, ee = (((Y = e.transform) == null ? void 0 : Y.x) ?? 0) + Lt * H * Z, ue = (((G = e.transform) == null ? void 0 : G.y) ?? 0) + Bt * H * Z, Te = (((N = e.transform) == null ? void 0 : N.rotate_x) ?? 0) - Bt * H * 1.5 * Z, re = (((Q = e.transform) == null ? void 0 : Q.rotate_y) ?? 0) + Lt * H * 1.5 * Z, be = Math.min(1, 10 * t);
|
|
5396
|
+
s.x = this.lerp(s.x ?? ((x = e.transform) == null ? void 0 : x.x) ?? 0, ee, be), s.y = this.lerp(s.y ?? ((F = e.transform) == null ? void 0 : F.y) ?? 0, ue, be), s.rotate_x = this.lerp(s.rotate_x ?? ((tt = e.transform) == null ? void 0 : tt.rotate_x) ?? 0, Te, be), s.rotate_y = this.lerp(s.rotate_y ?? ((X = e.transform) == null ? void 0 : X.rotate_y) ?? 0, re, be);
|
|
5392
5397
|
} else if (n.type === U.Fold) {
|
|
5393
5398
|
if (l < 300) {
|
|
5394
|
-
const H = 1 - l / 300,
|
|
5395
|
-
s.skew_x = this.lerp(s.skew_x ?? ((
|
|
5399
|
+
const H = 1 - l / 300, Z = (h > 0 ? -1 : 1) * H * 10, J = 1 - H * 0.1, ft = f / 300 * H * 20, _t = -(h / 300) * H * 20, Lt = Math.min(1, 10 * t);
|
|
5400
|
+
s.skew_x = this.lerp(s.skew_x ?? ((et = e.transform) == null ? void 0 : et.skew_x) ?? 0, Z, Lt), s.scale_y = this.lerp(s.scale_y ?? ((R = e.transform) == null ? void 0 : R.scale_y) ?? 1, (((O = e.transform) == null ? void 0 : O.scale_y) ?? 1) * J, Lt), s.rotate_x = this.lerp(s.rotate_x ?? ((D = e.transform) == null ? void 0 : D.rotate_x) ?? 0, ft, Lt), s.rotate_y = this.lerp(s.rotate_y ?? ((q = e.transform) == null ? void 0 : q.rotate_y) ?? 0, _t, Lt), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "fold_overlay", intensity: ((ot = n.settings) == null ? void 0 : ot.opacity) ?? 0.5 };
|
|
5396
5401
|
}
|
|
5397
5402
|
} else if (n.type === U.Crumple) {
|
|
5398
5403
|
if (l < 300) {
|
|
5399
|
-
const H = 1 - l / 300,
|
|
5400
|
-
s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0,
|
|
5404
|
+
const H = 1 - l / 300, Z = H * (Math.random() - 0.5) * 5, J = H * (Math.random() - 0.5) * 0.05, ft = Math.min(1, 15 * t);
|
|
5405
|
+
s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0, Z, ft), s.scale_x = this.lerp(s.scale_x ?? ((bt = e.transform) == null ? void 0 : bt.scale_x) ?? 1, (((pt = e.transform) == null ? void 0 : pt.scale_x) ?? 1) * (1 + J), ft), s.scale_y = this.lerp(s.scale_y ?? ((Et = e.transform) == null ? void 0 : Et.scale_y) ?? 1, (((It = e.transform) == null ? void 0 : It.scale_y) ?? 1) * (1 + J), ft), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "crumple_overlay", intensity: ((vt = n.settings) == null ? void 0 : vt.intensity) ?? 1, scale: ((Yt = n.settings) == null ? void 0 : Yt.scale) ?? 2 };
|
|
5401
5406
|
}
|
|
5402
5407
|
} else if (n.type === U.Squash) {
|
|
5403
|
-
const H = ((
|
|
5404
|
-
l < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((fe = e.transform) == null ? void 0 : fe.scale_y) ?? 1) * H, 0.3), s.scale_x = this.lerp(s.scale_x ?? 1, (((
|
|
5408
|
+
const H = ((se = n.settings) == null ? void 0 : se.strength) || 0.8;
|
|
5409
|
+
l < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((fe = e.transform) == null ? void 0 : fe.scale_y) ?? 1) * H, 0.3), s.scale_x = this.lerp(s.scale_x ?? 1, (((st = e.transform) == null ? void 0 : st.scale_x) ?? 1) * (1 + (1 - H) * 0.4), 0.3)) : (s.scale_y = this.lerp(s.scale_y ?? 1, ((gt = e.transform) == null ? void 0 : gt.scale_y) ?? 1, 0.2), s.scale_x = this.lerp(s.scale_x ?? 1, ((Rt = e.transform) == null ? void 0 : Rt.scale_x) ?? 1, 0.2));
|
|
5405
5410
|
} else if (n.type === U.TextCounter) {
|
|
5406
|
-
const H = ((
|
|
5411
|
+
const H = ((Pt = n.settings) == null ? void 0 : Pt.duration) || 2, Z = ((dt = n.settings) == null ? void 0 : dt.from) || 0, J = ((Ft = n.settings) == null ? void 0 : Ft.to) || 100;
|
|
5407
5412
|
n._runtimeStart === void 0 && (n._runtimeStart = this.currentTime);
|
|
5408
|
-
const ft = this.currentTime - n._runtimeStart,
|
|
5413
|
+
const ft = this.currentTime - n._runtimeStart, _t = Math.min(1, ft / H), Lt = Math.floor(Z + (J - Z) * _t);
|
|
5409
5414
|
if (((Dt = e.geometry) == null ? void 0 : Dt.type) === "Text") {
|
|
5410
5415
|
const Bt = (($t = n.settings) == null ? void 0 : $t.prefix) || "", ee = ((Ot = n.settings) == null ? void 0 : Ot.suffix) || "";
|
|
5411
5416
|
s.geometry || (s.geometry = { ...e.geometry }), s.geometry.text = `${Bt}${Lt}${ee}`;
|
|
5412
5417
|
}
|
|
5413
5418
|
} else if (n.type === U.Spotlight) {
|
|
5414
|
-
const H = ((Vt = n.settings) == null ? void 0 : Vt.radius) || 250,
|
|
5419
|
+
const H = ((Vt = n.settings) == null ? void 0 : Vt.radius) || 250, Z = ((ne = n.settings) == null ? void 0 : ne.strength) || 1.5;
|
|
5415
5420
|
if (l < H) {
|
|
5416
|
-
const
|
|
5417
|
-
s.style || (s.style = { ...e.style }), s.style.adjustments || (s.style.adjustments = { ...(me = e.style) == null ? void 0 : me.adjustments }), s.style.adjustments.exposure = (((Ut = (ye = e.style) == null ? void 0 : ye.adjustments) == null ? void 0 : Ut.exposure) || 0) +
|
|
5421
|
+
const J = Math.pow(1 - l / H, 2);
|
|
5422
|
+
s.style || (s.style = { ...e.style }), s.style.adjustments || (s.style.adjustments = { ...(me = e.style) == null ? void 0 : me.adjustments }), s.style.adjustments.exposure = (((Ut = (ye = e.style) == null ? void 0 : ye.adjustments) == null ? void 0 : Ut.exposure) || 0) + J * Z * 50;
|
|
5418
5423
|
} else
|
|
5419
5424
|
(Se = s.style) != null && Se.adjustments && (s.style.adjustments.exposure = this.lerp(s.style.adjustments.exposure || 0, ((Ee = (Pe = e.style) == null ? void 0 : Pe.adjustments) == null ? void 0 : Ee.exposure) || 0, 0.1));
|
|
5420
5425
|
} else if (n.type === U.Noise || n.type === U.Float) {
|
|
5421
|
-
const H = (((Ce = n.settings) == null ? void 0 : Ce.frequency) || ((Ae = n.settings) == null ? void 0 : Ae.speed) || 1) * 2e-3,
|
|
5422
|
-
s.x += Math.sin(
|
|
5426
|
+
const H = (((Ce = n.settings) == null ? void 0 : Ce.frequency) || ((Ae = n.settings) == null ? void 0 : Ae.speed) || 1) * 2e-3, Z = (((xe = n.settings) == null ? void 0 : xe.amplitude) || ((ie = n.settings) == null ? void 0 : ie.range) || 50) * (((jt = n.settings) == null ? void 0 : jt.strength) || 1), J = Date.now();
|
|
5427
|
+
s.x += Math.sin(J * H) * Z * t, s.y += Math.cos(J * H * 0.8) * Z * t, s.rotation += Math.sin(J * H * 0.5) * 5 * t;
|
|
5423
5428
|
} else if (n.type === U.Pulse) {
|
|
5424
|
-
const H = (((ht = n.settings) == null ? void 0 : ht.speed) || 1) * 5e-3,
|
|
5425
|
-
s.scale_x *= 1 +
|
|
5429
|
+
const H = (((ht = n.settings) == null ? void 0 : ht.speed) || 1) * 5e-3, Z = (((mt = n.settings) == null ? void 0 : mt.scale) || 1.2) - 1, J = Math.sin(Date.now() * H), ft = ((at = n.settings) == null ? void 0 : at.strength) || 1;
|
|
5430
|
+
s.scale_x *= 1 + J * Z * ft * t, s.scale_y *= 1 + J * Z * ft * t, s.style && (s.style.exposure = (s.style.exposure || 1) + Math.max(0, J) * 0.1 * ft * t);
|
|
5426
5431
|
} else if (n.type === U.Draggable) {
|
|
5427
|
-
const H = ((B = n.settings) == null ? void 0 : B.radius) || 150,
|
|
5428
|
-
if (l < H ||
|
|
5429
|
-
const
|
|
5430
|
-
this.applyBehaviorSensor(s, Zt.PositionX, ft *
|
|
5432
|
+
const H = ((B = n.settings) == null ? void 0 : B.radius) || 150, Z = this.draggingBehaviors.has(e.id);
|
|
5433
|
+
if (l < H || Z) {
|
|
5434
|
+
const J = ((K = n.settings) == null ? void 0 : K.strength) || 1, ft = Z ? 1 : Math.max(0, 1 - l / H);
|
|
5435
|
+
this.applyBehaviorSensor(s, Zt.PositionX, ft * J, t, n.settings), this.applyBehaviorSensor(s, Zt.PositionY, ft * J, t, n.settings);
|
|
5431
5436
|
}
|
|
5432
5437
|
} else if (n.type === U.Scroll) {
|
|
5433
|
-
const H = ((
|
|
5434
|
-
(H === "vertical" || H === "both") && (s.y += this.scrollOffset.y *
|
|
5438
|
+
const H = ((j = n.settings) == null ? void 0 : j.axis) || "vertical", Z = ((kt = n.settings) == null ? void 0 : kt.factor) || 0.5, J = ((At = n.settings) == null ? void 0 : At.strength) || 1, ft = ((Tt = n.settings) == null ? void 0 : Tt.scaleFactor) || 0;
|
|
5439
|
+
(H === "vertical" || H === "both") && (s.y += this.scrollOffset.y * Z * J * t), (H === "horizontal" || H === "both") && (s.x += this.scrollOffset.x * Z * J * t), ft !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * ft * t, s.scale_y *= 1 + this.scrollOffset.y * ft * t);
|
|
5435
5440
|
} else if (n.type === U.LookAt) {
|
|
5436
|
-
const H = ((
|
|
5437
|
-
s.rotation +=
|
|
5441
|
+
const H = ((xt = n.settings) == null ? void 0 : xt.factor) || 1, Z = ((Mt = n.settings) == null ? void 0 : Mt.strength) || 1, J = Math.atan2(-f, -h) * (180 / Math.PI), ft = s.rotation, _t = (J - ft + 180) % 360 - 180;
|
|
5442
|
+
s.rotation += _t * H * Z * t * 10;
|
|
5438
5443
|
} else if (n.type === U.Scan) {
|
|
5439
|
-
const H = ((($ = n.settings) == null ? void 0 : $.speed) || 1) * 4e-3,
|
|
5440
|
-
s.style && (s.style.exposure = (s.style.exposure || 1) +
|
|
5444
|
+
const H = ((($ = n.settings) == null ? void 0 : $.speed) || 1) * 4e-3, Z = ((Wt = n.settings) == null ? void 0 : Wt.strength) || 1, J = (Math.sin(Date.now() * H) + 1) / 2;
|
|
5445
|
+
s.style && (s.style.exposure = (s.style.exposure || 1) + J * Z * t * 5), s.x += (J - 0.5) * 20 * Z * t;
|
|
5441
5446
|
} else if (n.type === U.Glint)
|
|
5442
5447
|
s.style = s.style || { ...e.style }, s.style.artEffect = {
|
|
5443
5448
|
enabled: !0,
|
|
@@ -5445,18 +5450,18 @@ class ci {
|
|
|
5445
5450
|
intensity: ((Kt = n.settings) == null ? void 0 : Kt.strength) ?? 0.8
|
|
5446
5451
|
};
|
|
5447
5452
|
else if (n.type === U.Ratchet) {
|
|
5448
|
-
const H = ((te = n.settings) == null ? void 0 : te.steps) || 12,
|
|
5449
|
-
s.rotation = this.lerp(s.rotation,
|
|
5453
|
+
const H = ((te = n.settings) == null ? void 0 : te.steps) || 12, Z = (((Jt = n.settings) == null ? void 0 : Jt.speed) || 1) * 30, J = Math.floor(s.rotation / (360 / H)) * (360 / H);
|
|
5454
|
+
s.rotation = this.lerp(s.rotation, J + Z * t, 0.1);
|
|
5450
5455
|
} else if (n.type === U.Jitter && l < 300) {
|
|
5451
|
-
const H = ((ut = n.settings) == null ? void 0 : ut.strength) || 1,
|
|
5452
|
-
s.x += (Math.random() - 0.5) *
|
|
5456
|
+
const H = ((ut = n.settings) == null ? void 0 : ut.strength) || 1, Z = (((ct = n.settings) == null ? void 0 : ct.intensity) || 5) * H;
|
|
5457
|
+
s.x += (Math.random() - 0.5) * Z * t * 60, s.y += (Math.random() - 0.5) * Z * t * 60, s.rotation += (Math.random() - 0.5) * Z * t * 120;
|
|
5453
5458
|
} else if (n.type === U.Follower) {
|
|
5454
5459
|
const H = (Ct = n.settings) == null ? void 0 : Ct.targetId;
|
|
5455
5460
|
if (H) {
|
|
5456
|
-
const
|
|
5457
|
-
if (
|
|
5458
|
-
const
|
|
5459
|
-
s.x += ft *
|
|
5461
|
+
const Z = this.objectStates.get(H);
|
|
5462
|
+
if (Z) {
|
|
5463
|
+
const J = ((rt = n.settings) == null ? void 0 : rt.stiffness) || 0.1, ft = Z.x - s.x, _t = Z.y - s.y;
|
|
5464
|
+
s.x += ft * J * t * 60, s.y += _t * J * t * 60;
|
|
5460
5465
|
}
|
|
5461
5466
|
}
|
|
5462
5467
|
} else if (n.type === U.Wrap)
|
|
@@ -5465,55 +5470,55 @@ class ci {
|
|
|
5465
5470
|
const H = ((V = n.settings) == null ? void 0 : V.strength) || 9.8;
|
|
5466
5471
|
s.y += H * t * 10;
|
|
5467
5472
|
} else if (n.type === U.Velocity) {
|
|
5468
|
-
const H = ((
|
|
5469
|
-
s.x += H * t * 10, s.y +=
|
|
5473
|
+
const H = ((it = n.settings) == null ? void 0 : it.vx) || 0, Z = ((nt = n.settings) == null ? void 0 : nt.vy) || 0;
|
|
5474
|
+
s.x += H * t * 10, s.y += Z * t * 10;
|
|
5470
5475
|
} else if (n.type === U.Shear) {
|
|
5471
|
-
const H = ((
|
|
5472
|
-
if (l <
|
|
5473
|
-
const
|
|
5474
|
-
s.skew_x = this.lerp(s.skew_x || 0, (((Qt = e.transform) == null ? void 0 : Qt.skew_x) || 0) +
|
|
5476
|
+
const H = ((St = n.settings) == null ? void 0 : St.strength) || 1, Z = ((Xt = n.settings) == null ? void 0 : Xt.radius) || 300;
|
|
5477
|
+
if (l < Z) {
|
|
5478
|
+
const J = 1 - l / Z;
|
|
5479
|
+
s.skew_x = this.lerp(s.skew_x || 0, (((Qt = e.transform) == null ? void 0 : Qt.skew_x) || 0) + J * H * 30, 0.1);
|
|
5475
5480
|
} else
|
|
5476
|
-
s.skew_x = this.lerp(s.skew_x || 0, ((
|
|
5481
|
+
s.skew_x = this.lerp(s.skew_x || 0, ((oe = e.transform) == null ? void 0 : oe.skew_x) || 0, 0.05);
|
|
5477
5482
|
} else if (n.type === U.Lens) {
|
|
5478
|
-
const H = ((Gt = n.settings) == null ? void 0 : Gt.radius) || 200,
|
|
5483
|
+
const H = ((Gt = n.settings) == null ? void 0 : Gt.radius) || 200, Z = ((Ht = n.settings) == null ? void 0 : Ht.strength) || 0.5;
|
|
5479
5484
|
if (l < H) {
|
|
5480
|
-
const
|
|
5481
|
-
s.scale_x = this.lerp(s.scale_x ?? 1, (((Nt = e.transform) == null ? void 0 : Nt.scale_x) ?? 1) * (1 +
|
|
5485
|
+
const J = Math.pow(1 - l / H, 2);
|
|
5486
|
+
s.scale_x = this.lerp(s.scale_x ?? 1, (((Nt = e.transform) == null ? void 0 : Nt.scale_x) ?? 1) * (1 + J * Z), 0.2), s.scale_y = this.lerp(s.scale_y ?? 1, (((Ie = e.transform) == null ? void 0 : Ie.scale_y) ?? 1) * (1 + J * Z), 0.2);
|
|
5482
5487
|
} else
|
|
5483
5488
|
s.scale_x = this.lerp(s.scale_x ?? 1, ((Le = e.transform) == null ? void 0 : Le.scale_x) ?? 1, 0.1), s.scale_y = this.lerp(s.scale_y ?? 1, ((Re = e.transform) == null ? void 0 : Re.scale_y) ?? 1, 0.1);
|
|
5484
5489
|
} else if (n.type === U.LayoutAnimation) {
|
|
5485
|
-
const H = ((Oe = n.settings) == null ? void 0 : Oe.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"],
|
|
5490
|
+
const H = ((Oe = n.settings) == null ? void 0 : Oe.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"], Z = ((Fe = n.settings) == null ? void 0 : Fe.duration) || 0.3;
|
|
5486
5491
|
this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
|
|
5487
|
-
const
|
|
5492
|
+
const J = this._layoutAnimCache.get(e.id);
|
|
5488
5493
|
for (const ft of H) {
|
|
5489
|
-
const
|
|
5490
|
-
if (
|
|
5491
|
-
const Lt =
|
|
5494
|
+
const _t = this.getObjectProperty(s, e, ft);
|
|
5495
|
+
if (_t === void 0) continue;
|
|
5496
|
+
const Lt = J.get(ft);
|
|
5492
5497
|
if (!Lt)
|
|
5493
|
-
|
|
5494
|
-
from:
|
|
5495
|
-
to:
|
|
5498
|
+
J.set(ft, {
|
|
5499
|
+
from: _t,
|
|
5500
|
+
to: _t,
|
|
5496
5501
|
startTime: this.currentTime,
|
|
5497
5502
|
duration: 0
|
|
5498
5503
|
});
|
|
5499
|
-
else if (Lt.to !==
|
|
5504
|
+
else if (Lt.to !== _t) {
|
|
5500
5505
|
const ee = this.getObjectProperty(s, e, ft);
|
|
5501
|
-
|
|
5506
|
+
J.set(ft, {
|
|
5502
5507
|
from: ee ?? Lt.from,
|
|
5503
|
-
to:
|
|
5508
|
+
to: _t,
|
|
5504
5509
|
startTime: this.currentTime,
|
|
5505
|
-
duration: (($e = n.settings) == null ? void 0 : $e.duration) ??
|
|
5510
|
+
duration: (($e = n.settings) == null ? void 0 : $e.duration) ?? Z
|
|
5506
5511
|
});
|
|
5507
5512
|
}
|
|
5508
|
-
const Bt =
|
|
5513
|
+
const Bt = J.get(ft);
|
|
5509
5514
|
if (Bt.duration > 0 && Bt.from !== Bt.to) {
|
|
5510
|
-
const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((Ye = n.settings) == null ? void 0 : Ye.easing) || "easeOutCubic"),
|
|
5511
|
-
this.setObjectProperty(s, e, ft,
|
|
5515
|
+
const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((Ye = n.settings) == null ? void 0 : Ye.easing) || "easeOutCubic"), re = Bt.from + (Bt.to - Bt.from) * Te;
|
|
5516
|
+
this.setObjectProperty(s, e, ft, re);
|
|
5512
5517
|
}
|
|
5513
5518
|
}
|
|
5514
5519
|
} else if (n.type === U.StateReactive) {
|
|
5515
5520
|
this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
|
|
5516
|
-
const H = this._layoutAnimCache.get(e.id),
|
|
5521
|
+
const H = this._layoutAnimCache.get(e.id), Z = ((zt = n.settings) == null ? void 0 : zt.defaultDuration) || 0.3, J = [
|
|
5517
5522
|
"x",
|
|
5518
5523
|
"y",
|
|
5519
5524
|
"scale_x",
|
|
@@ -5528,97 +5533,97 @@ class ci {
|
|
|
5528
5533
|
"style.shadow.offsetX",
|
|
5529
5534
|
"style.shadow.offsetY"
|
|
5530
5535
|
];
|
|
5531
|
-
for (const ft of
|
|
5532
|
-
const
|
|
5533
|
-
if (
|
|
5536
|
+
for (const ft of J) {
|
|
5537
|
+
const _t = this.getObjectProperty(s, e, ft);
|
|
5538
|
+
if (_t === void 0 || typeof _t != "number") continue;
|
|
5534
5539
|
const Lt = H.get(ft);
|
|
5535
5540
|
if (!Lt)
|
|
5536
5541
|
H.set(ft, {
|
|
5537
|
-
from:
|
|
5538
|
-
to:
|
|
5542
|
+
from: _t,
|
|
5543
|
+
to: _t,
|
|
5539
5544
|
startTime: this.currentTime,
|
|
5540
5545
|
duration: 0
|
|
5541
5546
|
});
|
|
5542
|
-
else if (Lt.to !==
|
|
5547
|
+
else if (Lt.to !== _t) {
|
|
5543
5548
|
const ee = this.getObjectProperty(s, e, ft);
|
|
5544
5549
|
H.set(ft, {
|
|
5545
5550
|
from: ee ?? Lt.from,
|
|
5546
|
-
to:
|
|
5551
|
+
to: _t,
|
|
5547
5552
|
startTime: this.currentTime,
|
|
5548
|
-
duration:
|
|
5553
|
+
duration: Z
|
|
5549
5554
|
});
|
|
5550
5555
|
}
|
|
5551
5556
|
const Bt = H.get(ft);
|
|
5552
5557
|
if (Bt.duration > 0 && Bt.from !== Bt.to) {
|
|
5553
|
-
const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((
|
|
5554
|
-
this.setObjectProperty(s, e, ft,
|
|
5558
|
+
const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((ae = n.settings) == null ? void 0 : ae.defaultEasing) || "easeOutCubic"), re = Bt.from + (Bt.to - Bt.from) * Te;
|
|
5559
|
+
this.setObjectProperty(s, e, ft, re);
|
|
5555
5560
|
}
|
|
5556
5561
|
}
|
|
5557
5562
|
} else if (n.type === U.SpringChain) {
|
|
5558
|
-
const H = ((we = n.settings) == null ? void 0 : we.connections) || [],
|
|
5563
|
+
const H = ((we = n.settings) == null ? void 0 : we.connections) || [], Z = ((Be = n.settings) == null ? void 0 : Be.globalDamping) || 0.3;
|
|
5559
5564
|
this._springChainState.has(e.id) || this._springChainState.set(e.id, /* @__PURE__ */ new Map());
|
|
5560
|
-
const
|
|
5561
|
-
for (const
|
|
5562
|
-
if (!
|
|
5563
|
-
const Lt = this.objectStates.get(
|
|
5564
|
-
|
|
5565
|
+
const J = this._springChainState.get(e.id);
|
|
5566
|
+
for (const _t of H) {
|
|
5567
|
+
if (!J.has(_t.targetId)) {
|
|
5568
|
+
const Lt = this.objectStates.get(_t.targetId);
|
|
5569
|
+
J.set(_t.targetId, {
|
|
5565
5570
|
x: (Lt == null ? void 0 : Lt.x) ?? 0,
|
|
5566
5571
|
y: (Lt == null ? void 0 : Lt.y) ?? 0,
|
|
5567
5572
|
vx: 0,
|
|
5568
5573
|
vy: 0
|
|
5569
5574
|
});
|
|
5570
5575
|
}
|
|
5571
|
-
|
|
5576
|
+
J.has(e.id) || J.set(e.id, { x: s.x, y: s.y, vx: 0, vy: 0 });
|
|
5572
5577
|
}
|
|
5573
|
-
const ft =
|
|
5578
|
+
const ft = J.get(e.id);
|
|
5574
5579
|
if (ft) {
|
|
5575
5580
|
ft.x = s.x, ft.y = s.y;
|
|
5576
|
-
for (const
|
|
5577
|
-
const Lt =
|
|
5581
|
+
for (const _t of H) {
|
|
5582
|
+
const Lt = J.get(_t.targetId);
|
|
5578
5583
|
if (!Lt) continue;
|
|
5579
|
-
const Bt = Lt.x - ft.x, ee = Lt.y - ft.y, ue = Math.sqrt(Bt * Bt + ee * ee) || 1e-3,
|
|
5580
|
-
ft.vx += be * t * 10, ft.vy += Ue * t * 10, Lt.vx -= be * t * 10, Lt.vy -= Ue * t * 10, ft.vx *= 1 -
|
|
5581
|
-
const pe = this.objectStates.get(
|
|
5584
|
+
const Bt = Lt.x - ft.x, ee = Lt.y - ft.y, ue = Math.sqrt(Bt * Bt + ee * ee) || 1e-3, re = (ue - (_t.restLength || 50)) * (_t.stiffness || 0.8), be = Bt / ue * re, Ue = ee / ue * re;
|
|
5585
|
+
ft.vx += be * t * 10, ft.vy += Ue * t * 10, Lt.vx -= be * t * 10, Lt.vy -= Ue * t * 10, ft.vx *= 1 - Z * t * 10, ft.vy *= 1 - Z * t * 10, Lt.vx *= 1 - Z * t * 10, Lt.vy *= 1 - Z * t * 10;
|
|
5586
|
+
const pe = this.objectStates.get(_t.targetId);
|
|
5582
5587
|
pe && (pe.x += Lt.vx * t, pe.y += Lt.vy * t);
|
|
5583
5588
|
}
|
|
5584
5589
|
s.x += ft.vx * t, s.y += ft.vy * t;
|
|
5585
5590
|
}
|
|
5586
5591
|
} else if (n.type === U.ParticleEmitter) {
|
|
5587
|
-
const H = ((We = n.settings) == null ? void 0 : We.rate) || 10,
|
|
5592
|
+
const H = ((We = n.settings) == null ? void 0 : We.rate) || 10, Z = ((de = n.settings) == null ? void 0 : de.speed) || 100, J = ((ce = n.settings) == null ? void 0 : ce.size) || 5, ft = ((he = n.settings) == null ? void 0 : he.lifetime) || 2, _t = ((ke = n.settings) == null ? void 0 : ke.gravity) || 0, Lt = ((Xe = n.settings) == null ? void 0 : Xe.color) || "#ffffff", Bt = ((Ve = n.settings) == null ? void 0 : Ve.maxParticles) || 200, ee = (Ne = n.settings) != null && Ne.rateInputId ? this.inputs.get(n.settings.rateInputId) ?? H : H, ue = (De = n.settings) != null && De.gravityInputId ? this.inputs.get(n.settings.gravityInputId) ?? _t : _t, Te = (He = n.settings) != null && He.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? Z : Z;
|
|
5588
5593
|
this._emitterPools.has(e.id) || this._emitterPools.set(e.id, []);
|
|
5589
|
-
const
|
|
5594
|
+
const re = this._emitterPools.get(e.id);
|
|
5590
5595
|
let be = 0;
|
|
5591
5596
|
n._pendingBurst && n._pendingBurst > 0 && (be = n._pendingBurst, n._pendingBurst = 0);
|
|
5592
5597
|
const Ue = Math.floor(ee * t) + (be || 0);
|
|
5593
|
-
for (let pe = 0; pe < Math.min(Ue, Bt -
|
|
5594
|
-
const
|
|
5595
|
-
|
|
5598
|
+
for (let pe = 0; pe < Math.min(Ue, Bt - re.length); pe++) {
|
|
5599
|
+
const le = Math.random() * Math.PI * 2, ss = Te * (0.5 + Math.random() * 0.5);
|
|
5600
|
+
re.push({
|
|
5596
5601
|
x: s.x,
|
|
5597
5602
|
y: s.y,
|
|
5598
|
-
vx: Math.cos(
|
|
5599
|
-
vy: Math.sin(
|
|
5603
|
+
vx: Math.cos(le) * ss,
|
|
5604
|
+
vy: Math.sin(le) * ss,
|
|
5600
5605
|
life: 0,
|
|
5601
5606
|
maxLife: ft * (0.5 + Math.random() * 0.5),
|
|
5602
|
-
size:
|
|
5607
|
+
size: J * (0.5 + Math.random()),
|
|
5603
5608
|
color: Lt,
|
|
5604
5609
|
opacity: 1
|
|
5605
5610
|
});
|
|
5606
5611
|
}
|
|
5607
|
-
for (let pe =
|
|
5608
|
-
const
|
|
5609
|
-
|
|
5612
|
+
for (let pe = re.length - 1; pe >= 0; pe--) {
|
|
5613
|
+
const le = re[pe];
|
|
5614
|
+
le.vy += ue * t * 10, le.x += le.vx * t, le.y += le.vy * t, le.life += t, le.opacity = Math.max(0, 1 - le.life / le.maxLife), le.life >= le.maxLife && re.splice(pe, 1);
|
|
5610
5615
|
}
|
|
5611
5616
|
}
|
|
5612
5617
|
});
|
|
5613
5618
|
});
|
|
5614
5619
|
}
|
|
5615
5620
|
applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, h = 1) {
|
|
5616
|
-
var d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N,
|
|
5621
|
+
var d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, Q;
|
|
5617
5622
|
const f = (s == null ? void 0 : s.intensity) || (s == null ? void 0 : s.strength) || 1, l = Math.min(1, 15 * e), p = h > 0 ? a / h : 0, c = h > 0 ? r / h : 0;
|
|
5618
5623
|
switch (i) {
|
|
5619
5624
|
case Zt.Scale: {
|
|
5620
|
-
const x = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1,
|
|
5621
|
-
t.scale_x = (t.scale_x ?? x) * (1 - l) +
|
|
5625
|
+
const x = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1, tt = x * (1 + o * f * 0.4), X = F * (1 + o * f * 0.4);
|
|
5626
|
+
t.scale_x = (t.scale_x ?? x) * (1 - l) + tt * l, t.scale_y = (t.scale_y ?? F) * (1 - l) + X * l;
|
|
5622
5627
|
break;
|
|
5623
5628
|
}
|
|
5624
5629
|
case Zt.Opacity: {
|
|
@@ -5693,7 +5698,7 @@ class ci {
|
|
|
5693
5698
|
}
|
|
5694
5699
|
case Zt.LetterSpacing: {
|
|
5695
5700
|
t.geometry || (t.geometry = {});
|
|
5696
|
-
const x = ((
|
|
5701
|
+
const x = ((Q = n == null ? void 0 : n.geometry) == null ? void 0 : Q.letterSpacing) || 0, F = x + o * f * 10;
|
|
5697
5702
|
t.geometry.letterSpacing = (t.geometry.letterSpacing ?? x) * (1 - l) + F * l;
|
|
5698
5703
|
break;
|
|
5699
5704
|
}
|
|
@@ -5806,9 +5811,9 @@ const yi = Ss(({
|
|
|
5806
5811
|
}, P) => {
|
|
5807
5812
|
const _ = _e(null), E = _e(null);
|
|
5808
5813
|
E.current || (E.current = new ci());
|
|
5809
|
-
const A = _e(void 0), W = _e(0), z = _e(null), Y = _e(y), G = _e(null), [, N] = Qe(g || null),
|
|
5810
|
-
Cs(P, () => _.current), ve(() => (
|
|
5811
|
-
|
|
5814
|
+
const A = _e(void 0), W = _e(0), z = _e(null), Y = _e(y), G = _e(null), [, N] = Qe(g || null), Q = _e(!0);
|
|
5815
|
+
Cs(P, () => _.current), ve(() => (Q.current = !0, () => {
|
|
5816
|
+
Q.current = !1, A.current && cancelAnimationFrame(A.current);
|
|
5812
5817
|
}), []), ve(() => {
|
|
5813
5818
|
E.current.setLayout(e, s);
|
|
5814
5819
|
}, [e, s]), ve(() => {
|
|
@@ -5830,7 +5835,7 @@ const yi = Ss(({
|
|
|
5830
5835
|
})();
|
|
5831
5836
|
}, [g, t, y]), ve(() => {
|
|
5832
5837
|
const R = (O) => {
|
|
5833
|
-
if (!E.current || !
|
|
5838
|
+
if (!E.current || !Q.current) return;
|
|
5834
5839
|
const D = E.current, q = _.current;
|
|
5835
5840
|
if (!q) return;
|
|
5836
5841
|
const ot = q.getContext("2d");
|
|
@@ -5839,12 +5844,12 @@ const yi = Ss(({
|
|
|
5839
5844
|
W.current === 0 && (W.current = yt);
|
|
5840
5845
|
let bt = yt - W.current;
|
|
5841
5846
|
bt > 0.1 && (bt = 0.1), W.current = yt;
|
|
5842
|
-
const
|
|
5843
|
-
(q.width !== It || q.height !==
|
|
5847
|
+
const pt = q.getBoundingClientRect(), Et = window.devicePixelRatio || 1, It = Math.round(pt.width * Et), vt = Math.round(pt.height * Et);
|
|
5848
|
+
(q.width !== It || q.height !== vt) && (q.width = It, q.height = vt);
|
|
5844
5849
|
try {
|
|
5845
5850
|
o ? D.advance(bt) : m !== void 0 && D.seek(m), D.render(ot, q.width, q.height);
|
|
5846
|
-
} catch (
|
|
5847
|
-
console.error("[ExodeUICanvas] Error in animation loop:",
|
|
5851
|
+
} catch (Yt) {
|
|
5852
|
+
console.error("[ExodeUICanvas] Error in animation loop:", Yt), d && d(`[Error] Animation loop crashed: ${Yt}`, "error");
|
|
5848
5853
|
}
|
|
5849
5854
|
A.current = requestAnimationFrame(R);
|
|
5850
5855
|
};
|
|
@@ -5874,14 +5879,14 @@ const yi = Ss(({
|
|
|
5874
5879
|
window.removeEventListener("keydown", R), window.removeEventListener("keyup", O);
|
|
5875
5880
|
};
|
|
5876
5881
|
}, [T]);
|
|
5877
|
-
const [F,
|
|
5882
|
+
const [F, tt] = Qe([]);
|
|
5878
5883
|
ve(() => {
|
|
5879
5884
|
if (g && g.objects) {
|
|
5880
5885
|
const R = g.objects.filter((O) => {
|
|
5881
5886
|
var D, q;
|
|
5882
5887
|
return O.type === "Joystick" && ((D = O.inputBinding) == null ? void 0 : D.type) === "keyboard" && ((q = O.inputBinding.keyboardConfig) == null ? void 0 : q.showVirtualKeyboard);
|
|
5883
5888
|
});
|
|
5884
|
-
|
|
5889
|
+
tt(R);
|
|
5885
5890
|
}
|
|
5886
5891
|
}, [g]);
|
|
5887
5892
|
const [, X] = Qe(0);
|
|
@@ -5893,21 +5898,21 @@ const yi = Ss(({
|
|
|
5893
5898
|
};
|
|
5894
5899
|
return R = requestAnimationFrame(O), () => cancelAnimationFrame(R);
|
|
5895
5900
|
}, [F.length]);
|
|
5896
|
-
const
|
|
5897
|
-
const O = R.inputBinding.keyboardConfig, D = (
|
|
5901
|
+
const et = () => F.map((R) => {
|
|
5902
|
+
const O = R.inputBinding.keyboardConfig, D = (pt) => {
|
|
5898
5903
|
var It;
|
|
5899
|
-
const Et = { key:
|
|
5904
|
+
const Et = { key: pt, code: pt, preventDefault: () => {
|
|
5900
5905
|
} };
|
|
5901
5906
|
(It = E.current) == null || It.handleKeyDown(Et);
|
|
5902
|
-
}, q = (
|
|
5907
|
+
}, q = (pt) => {
|
|
5903
5908
|
var It;
|
|
5904
|
-
const Et = { key:
|
|
5909
|
+
const Et = { key: pt, code: pt, preventDefault: () => {
|
|
5905
5910
|
} };
|
|
5906
5911
|
(It = E.current) == null || It.handleKeyUp(Et);
|
|
5907
|
-
}, ot = E.current, yt = (
|
|
5912
|
+
}, ot = E.current, yt = (pt) => ot && ot.activeKeys ? ot.activeKeys.has(pt.toLowerCase()) : !1, bt = (pt) => ({
|
|
5908
5913
|
width: "50px",
|
|
5909
5914
|
height: "50px",
|
|
5910
|
-
background:
|
|
5915
|
+
background: pt ? "rgba(255, 255, 255, 0.4)" : "rgba(0, 0, 0, 0.4)",
|
|
5911
5916
|
border: "1px solid rgba(255, 255, 255, 0.2)",
|
|
5912
5917
|
borderRadius: "12px",
|
|
5913
5918
|
display: "flex",
|
|
@@ -5920,7 +5925,7 @@ const yi = Ss(({
|
|
|
5920
5925
|
cursor: "pointer",
|
|
5921
5926
|
backdropFilter: "blur(8px)",
|
|
5922
5927
|
transition: "background 0.1s",
|
|
5923
|
-
boxShadow:
|
|
5928
|
+
boxShadow: pt ? "none" : "0 4px 6px rgba(0,0,0,0.1)"
|
|
5924
5929
|
});
|
|
5925
5930
|
return /* @__PURE__ */ Je("div", { style: {
|
|
5926
5931
|
position: "absolute",
|
|
@@ -5940,11 +5945,11 @@ const yi = Ss(({
|
|
|
5940
5945
|
onMouseDown: () => D(O.upKey),
|
|
5941
5946
|
onMouseUp: () => q(O.upKey),
|
|
5942
5947
|
onMouseLeave: () => q(O.upKey),
|
|
5943
|
-
onTouchStart: (
|
|
5944
|
-
|
|
5948
|
+
onTouchStart: (pt) => {
|
|
5949
|
+
pt.preventDefault(), D(O.upKey);
|
|
5945
5950
|
},
|
|
5946
|
-
onTouchEnd: (
|
|
5947
|
-
|
|
5951
|
+
onTouchEnd: (pt) => {
|
|
5952
|
+
pt.preventDefault(), q(O.upKey);
|
|
5948
5953
|
},
|
|
5949
5954
|
children: O.upKey.toUpperCase()
|
|
5950
5955
|
}
|
|
@@ -5957,11 +5962,11 @@ const yi = Ss(({
|
|
|
5957
5962
|
onMouseDown: () => D(O.leftKey),
|
|
5958
5963
|
onMouseUp: () => q(O.leftKey),
|
|
5959
5964
|
onMouseLeave: () => q(O.leftKey),
|
|
5960
|
-
onTouchStart: (
|
|
5961
|
-
|
|
5965
|
+
onTouchStart: (pt) => {
|
|
5966
|
+
pt.preventDefault(), D(O.leftKey);
|
|
5962
5967
|
},
|
|
5963
|
-
onTouchEnd: (
|
|
5964
|
-
|
|
5968
|
+
onTouchEnd: (pt) => {
|
|
5969
|
+
pt.preventDefault(), q(O.leftKey);
|
|
5965
5970
|
},
|
|
5966
5971
|
children: O.leftKey.toUpperCase()
|
|
5967
5972
|
}
|
|
@@ -5973,11 +5978,11 @@ const yi = Ss(({
|
|
|
5973
5978
|
onMouseDown: () => D(O.downKey),
|
|
5974
5979
|
onMouseUp: () => q(O.downKey),
|
|
5975
5980
|
onMouseLeave: () => q(O.downKey),
|
|
5976
|
-
onTouchStart: (
|
|
5977
|
-
|
|
5981
|
+
onTouchStart: (pt) => {
|
|
5982
|
+
pt.preventDefault(), D(O.downKey);
|
|
5978
5983
|
},
|
|
5979
|
-
onTouchEnd: (
|
|
5980
|
-
|
|
5984
|
+
onTouchEnd: (pt) => {
|
|
5985
|
+
pt.preventDefault(), q(O.downKey);
|
|
5981
5986
|
},
|
|
5982
5987
|
children: O.downKey.toUpperCase()
|
|
5983
5988
|
}
|
|
@@ -5989,11 +5994,11 @@ const yi = Ss(({
|
|
|
5989
5994
|
onMouseDown: () => D(O.rightKey),
|
|
5990
5995
|
onMouseUp: () => q(O.rightKey),
|
|
5991
5996
|
onMouseLeave: () => q(O.rightKey),
|
|
5992
|
-
onTouchStart: (
|
|
5993
|
-
|
|
5997
|
+
onTouchStart: (pt) => {
|
|
5998
|
+
pt.preventDefault(), D(O.rightKey);
|
|
5994
5999
|
},
|
|
5995
|
-
onTouchEnd: (
|
|
5996
|
-
|
|
6000
|
+
onTouchEnd: (pt) => {
|
|
6001
|
+
pt.preventDefault(), q(O.rightKey);
|
|
5997
6002
|
},
|
|
5998
6003
|
children: O.rightKey.toUpperCase()
|
|
5999
6004
|
}
|
|
@@ -6032,7 +6037,7 @@ const yi = Ss(({
|
|
|
6032
6037
|
}
|
|
6033
6038
|
}
|
|
6034
6039
|
),
|
|
6035
|
-
|
|
6040
|
+
et()
|
|
6036
6041
|
] });
|
|
6037
6042
|
});
|
|
6038
6043
|
function bi() {
|
|
@@ -6139,7 +6144,7 @@ const vi = ({ artboard: g, config: t }) => {
|
|
|
6139
6144
|
]
|
|
6140
6145
|
}
|
|
6141
6146
|
);
|
|
6142
|
-
}, hi = "6.3.
|
|
6147
|
+
}, hi = "6.3.39", fi = {
|
|
6143
6148
|
version: hi
|
|
6144
6149
|
}, Si = fi.version;
|
|
6145
6150
|
export {
|