exodeui 6.3.38 → 6.3.39
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 +2 -2
- package/dist/index.mjs +820 -820
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -40,15 +40,15 @@ function ps(g) {
|
|
|
40
40
|
lineHeight: n = 1.2,
|
|
41
41
|
width: a = 200,
|
|
42
42
|
letterSpacing: r = 0,
|
|
43
|
-
paragraphSpacing:
|
|
44
|
-
paragraphIndent:
|
|
43
|
+
paragraphSpacing: h = 0,
|
|
44
|
+
paragraphIndent: f = 0,
|
|
45
45
|
textCase: l = "none",
|
|
46
46
|
segments: p = [],
|
|
47
47
|
enableSegments: c = !1
|
|
48
48
|
} = g;
|
|
49
49
|
let d = String(t || "");
|
|
50
50
|
l === "uppercase" ? d = d.toUpperCase() : l === "lowercase" ? d = d.toLowerCase() : l === "capitalize" && (d = d.replace(/\b\w/g, (k) => k.toUpperCase())), g.hyphenation === !0 && (d = Ts(d));
|
|
51
|
-
const u = `${s} ${e} ${o}px "${i}", sans-serif`, v = `${d}|${u}|${r}|${
|
|
51
|
+
const u = `${s} ${e} ${o}px "${i}", sans-serif`, v = `${d}|${u}|${r}|${h}|${f}|${c}|${JSON.stringify(p)}|hyp:${!!g.hyphenation}|comp:${g.composer}|bal:${!!g.balanceRaggedLines}`;
|
|
52
52
|
let b = Ge.get(v);
|
|
53
53
|
const m = typeof CanvasRenderingContext2D < "u" ? CanvasRenderingContext2D.prototype.measureText : null, y = function(k) {
|
|
54
54
|
if (!m) return { width: 0, fontBoundingBoxAscent: 0, fontBoundingBoxDescent: 0 };
|
|
@@ -107,11 +107,11 @@ function ps(g) {
|
|
|
107
107
|
k && Ge.delete(k);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
110
|
+
if (f > 0 && b && b.widths && !b.indentApplied) {
|
|
111
111
|
const k = [...b.widths], T = b.fullText || d;
|
|
112
112
|
let L = !0;
|
|
113
113
|
for (let P = 0; P < T.length; P++)
|
|
114
|
-
L && k[P] !== void 0 && (k[P] +=
|
|
114
|
+
L && k[P] !== void 0 && (k[P] += f, L = !1), (T[P] === `
|
|
115
115
|
` || T[P] === "\r") && (L = !0, T[P] === "\r" && T[P + 1] === `
|
|
116
116
|
` && P++);
|
|
117
117
|
b = { ...b, widths: k, indentApplied: !0 };
|
|
@@ -136,12 +136,12 @@ function ps(g) {
|
|
|
136
136
|
r !== 0 && m && (CanvasRenderingContext2D.prototype.measureText = m);
|
|
137
137
|
}
|
|
138
138
|
let w = (C == null ? void 0 : C.height) !== void 0 && C.height > 0 ? C.height : (((I = C == null ? void 0 : C.lines) == null ? void 0 : I.length) || 0) * S * o;
|
|
139
|
-
if (
|
|
139
|
+
if (h > 0 && C && C.lines && C.lines.length > 1) {
|
|
140
140
|
let k = 0;
|
|
141
141
|
const T = b.fullText || t;
|
|
142
142
|
for (let L = 0; L < C.lines.length - 1; L++)
|
|
143
143
|
k += C.lines[L].text.length, (T[k] === `
|
|
144
|
-
` || T[k] === "\r") && (w +=
|
|
144
|
+
` || T[k] === "\r") && (w += h, k++, T[k - 1] === "\r" && T[k] === `
|
|
145
145
|
` && k++);
|
|
146
146
|
}
|
|
147
147
|
let M = (C == null ? void 0 : C.lines) || [];
|
|
@@ -160,15 +160,15 @@ function is(g, t, i) {
|
|
|
160
160
|
}
|
|
161
161
|
const e = o.split(/\s+/).filter(Boolean), s = new Array(e.length).fill(0);
|
|
162
162
|
let n = t - (e.length - 1) * i, a = 0;
|
|
163
|
-
if (e.forEach((r,
|
|
163
|
+
if (e.forEach((r, h) => {
|
|
164
164
|
if (r.endsWith("px")) {
|
|
165
|
-
const
|
|
166
|
-
s[
|
|
167
|
-
} else r.endsWith("fr") ? a += parseFloat(r) : r === "auto" && (s[
|
|
165
|
+
const f = parseFloat(r);
|
|
166
|
+
s[h] = f, n -= f;
|
|
167
|
+
} else r.endsWith("fr") ? a += parseFloat(r) : r === "auto" && (s[h] = 100, n -= 100);
|
|
168
168
|
}), a > 0 && n > 0) {
|
|
169
169
|
const r = n / a;
|
|
170
|
-
e.forEach((
|
|
171
|
-
|
|
170
|
+
e.forEach((h, f) => {
|
|
171
|
+
h.endsWith("fr") && (s[f] = r * parseFloat(h));
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
return s;
|
|
@@ -183,7 +183,7 @@ function ns(g, t, i) {
|
|
|
183
183
|
}
|
|
184
184
|
function Es(g, t, i) {
|
|
185
185
|
var _, E;
|
|
186
|
-
const o = g.autoLayout, { direction: e, spacing: s, padding: n, align: a, wrap: r } = o,
|
|
186
|
+
const o = g.autoLayout, { direction: e, spacing: s, padding: n, align: a, wrap: r } = o, h = e === "vertical", f = t.map((A) => {
|
|
187
187
|
const W = i(A.id), z = A.geometry;
|
|
188
188
|
let Y = (W == null ? void 0 : W.width) ?? z.width ?? 100, G = (W == null ? void 0 : W.height) ?? z.height ?? 100;
|
|
189
189
|
if (z.type === "Ellipse" || z.type === "Polygon" || z.type === "Star") {
|
|
@@ -213,35 +213,35 @@ function Es(g, t, i) {
|
|
|
213
213
|
const c = ((_ = g.layoutProps) == null ? void 0 : _.width) === "hug", d = ((E = g.layoutProps) == null ? void 0 : E.height) === "hug", u = [];
|
|
214
214
|
let v = [], b = 0, m = 0;
|
|
215
215
|
const y = l - n.left - n.right, S = p - n.top - n.bottom;
|
|
216
|
-
|
|
217
|
-
r && v.length > 0 && (
|
|
218
|
-
}), v.length > 0 && u.push({ children: v, width: b, height: m }), c && !
|
|
216
|
+
f.forEach((A) => {
|
|
217
|
+
r && v.length > 0 && (h ? m + s + A.h > S : b + s + A.w > y) ? (u.push({ children: v, width: b, height: m }), v = [A], b = A.w, m = A.h) : (v.push(A), h ? (b = Math.max(b, A.w), m += (v.length > 1 ? s : 0) + A.h) : (b += (v.length > 1 ? s : 0) + A.w, m = Math.max(m, A.h)));
|
|
218
|
+
}), v.length > 0 && u.push({ children: v, width: b, height: m }), c && !h && (l = Math.max(...u.map((A) => A.width), 0) + n.left + n.right), d && h && (p = Math.max(...u.map((A) => A.height), 0) + n.top + n.bottom);
|
|
219
219
|
const C = [];
|
|
220
220
|
let w = n.left, M = n.top;
|
|
221
221
|
const I = a.toLowerCase(), k = I === "center" || I.endsWith("-center"), T = I.endsWith("-right"), L = I === "center" || I.startsWith("center-"), P = I.startsWith("bottom-");
|
|
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
225
|
var F, j;
|
|
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
228
|
const J = ((F = Y.original.layoutProps) == null ? void 0 : F.width) === "fill", x = ((j = Y.original.layoutProps) == null ? void 0 : j.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: J &&
|
|
234
|
-
height: x ?
|
|
235
|
-
}),
|
|
236
|
-
}),
|
|
233
|
+
width: J && h ? A.width : void 0,
|
|
234
|
+
height: x ? h ? void 0 : A.height : void 0
|
|
235
|
+
}), h ? z += Y.h + s : W += Y.w + s;
|
|
236
|
+
}), h ? w += A.width + s : M += A.height + s;
|
|
237
237
|
}), { frameWidth: c ? l : void 0, frameHeight: d ? p : void 0, childUpdates: C };
|
|
238
238
|
}
|
|
239
239
|
function As(g, t, i) {
|
|
240
240
|
const o = g.autoLayout;
|
|
241
241
|
if (!o) return { childUpdates: [] };
|
|
242
|
-
const { gridColumns: e, gridRows: s, columnGap: n = 0, rowGap: a = 0, padding: r, align:
|
|
243
|
-
let
|
|
244
|
-
const p =
|
|
242
|
+
const { gridColumns: e, gridRows: s, columnGap: n = 0, rowGap: a = 0, padding: r, align: h } = o;
|
|
243
|
+
let f = g.width, l = g.height;
|
|
244
|
+
const p = f - r.left - r.right, c = l - r.top - r.bottom, d = is(e || "1fr", p, n), u = is(s || "auto", c, a), v = d.length > 0 ? d.reduce((T, L) => T + L, 0) + (d.length - 1) * n : 0, b = u.length > 0 ? u.reduce((T, L) => T + L, 0) + (u.length - 1) * a : 0, m = h.toLowerCase(), y = m === "center" || m.endsWith("-center"), S = m.endsWith("-right"), C = m === "center" || m.startsWith("center-"), w = m.startsWith("bottom-");
|
|
245
245
|
let M = 0, I = 0;
|
|
246
246
|
y ? M = (p - v) / 2 : S && (M = p - v), C ? I = (c - b) / 2 : w && (I = c - b);
|
|
247
247
|
const k = [];
|
|
@@ -250,7 +250,7 @@ function As(g, t, i) {
|
|
|
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((tt,
|
|
253
|
+
let W = r.left + M + d.slice(0, P).reduce((tt, R) => tt + R + n, 0), z = r.top + I + u.slice(0, _).reduce((tt, R) => tt + R + a, 0);
|
|
254
254
|
const Y = i(T.id), G = T.geometry;
|
|
255
255
|
let N = (Y == null ? void 0 : Y.width) ?? G.width ?? 100, J = (Y == null ? void 0 : Y.height) ?? G.height ?? 100;
|
|
256
256
|
if (G.type === "Ellipse" || G.type === "Polygon" || G.type === "Star") {
|
|
@@ -261,7 +261,7 @@ function As(g, t, i) {
|
|
|
261
261
|
let x = W, F = z;
|
|
262
262
|
y ? x += (E - N) / 2 : S && (x += E - N), C ? F += (A - J) / 2 : w && (F += A - J), k.push({
|
|
263
263
|
id: T.id,
|
|
264
|
-
x: x + N / 2 -
|
|
264
|
+
x: x + N / 2 - f / 2,
|
|
265
265
|
y: F + J / 2 - l / 2,
|
|
266
266
|
width: ((j = T.layoutProps) == null ? void 0 : j.width) === "fill" ? E : void 0,
|
|
267
267
|
height: ((X = T.layoutProps) == null ? void 0 : X.height) === "fill" ? A : void 0
|
|
@@ -404,8 +404,8 @@ class xs {
|
|
|
404
404
|
const e = new qt.Vector2(t.anchorA.x, t.anchorA.y), s = new qt.Vector2(t.anchorB.x, t.anchorB.y);
|
|
405
405
|
let n;
|
|
406
406
|
if (t.type === "Distance") {
|
|
407
|
-
const a = t.length ?? 100, r = t.stiffness ?? 100,
|
|
408
|
-
n = qt.JointData.spring(a, r,
|
|
407
|
+
const a = t.length ?? 100, r = t.stiffness ?? 100, h = t.damping ?? 10;
|
|
408
|
+
n = qt.JointData.spring(a, r, h, e, s);
|
|
409
409
|
} else
|
|
410
410
|
n = qt.JointData.revolute(e, s);
|
|
411
411
|
try {
|
|
@@ -427,27 +427,27 @@ class xs {
|
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0,
|
|
430
|
+
const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os = (g) => g * g, as = (g) => g * (2 - g), rs = (g) => g < 0.5 ? 2 * g * g : -1 + (4 - 2 * g) * g, Os = (g) => g * g * g, Fs = (g) => --g * g * g + 1, $s = (g) => g < 0.5 ? 4 * g * g * g : (g - 1) * (2 * g - 2) * (2 * g - 2) + 1, Bs = (g) => g * g * g * g, Ws = (g) => 1 - --g * g * g * g, Ys = (g) => g < 0.5 ? 8 * g * g * g * g : 1 - 8 * --g * g * g * g, Xs = (g) => g * g * g * g * g, Ds = (g) => 1 + --g * g * g * g * g, Gs = (g) => g < 0.5 ? 16 * g * g * g * g * g : 1 + 16 * --g * g * g * g * g, zs = (g) => 1 - Math.cos(g * Math.PI / 2), Vs = (g) => Math.sin(g * Math.PI / 2), Ns = (g) => -(Math.cos(Math.PI * g) - 1) / 2, Hs = (g) => g === 0 ? 0 : Math.pow(2, 10 * (g - 1)), Us = (g) => g === 1 ? 1 : 1 - Math.pow(2, -10 * g), qs = (g) => g === 0 ? 0 : g === 1 ? 1 : g < 0.5 ? Math.pow(2, 20 * g - 10) / 2 : (2 - Math.pow(2, -20 * g + 10)) / 2, Ks = (g) => 1 - Math.sqrt(1 - g * g), Js = (g) => Math.sqrt(1 - --g * g), Qs = (g) => g < 0.5 ? (1 - Math.sqrt(1 - 4 * g * g)) / 2 : (Math.sqrt(1 - (-2 * g + 2) * (-2 * g + 2)) + 1) / 2, je = 1.70158, qe = je * 1.525, ms = je + 1, Zs = (g) => ms * g * g * g - je * g * g, js = (g) => 1 + ms * Math.pow(g - 1, 3) + je * Math.pow(g - 1, 2), ti = (g) => g < 0.5 ? Math.pow(2 * g, 2) * ((qe + 1) * 2 * g - qe) / 2 : (Math.pow(2 * g - 2, 2) * ((qe + 1) * (g * 2 - 2) + qe) + 2) / 2, ys = 2 * Math.PI / 3, ls = 2 * Math.PI / 4.5, ei = (g) => g === 0 ? 0 : g === 1 ? 1 : -Math.pow(2, 10 * g - 10) * Math.sin((g * 10 - 10.75) * ys), si = (g) => g === 0 ? 0 : g === 1 ? 1 : Math.pow(2, -10 * g) * Math.sin((g * 10 - 0.75) * ys) + 1, ii = (g) => g === 0 ? 0 : g === 1 ? 1 : g < 0.5 ? -(Math.pow(2, 20 * g - 10) * Math.sin((20 * g - 11.125) * ls)) / 2 : Math.pow(2, -20 * g + 10) * Math.sin((20 * g - 11.125) * ls) / 2 + 1, Ze = (g) => g < 1 / 2.75 ? 7.5625 * g * g : g < 2 / 2.75 ? 7.5625 * (g -= 1.5 / 2.75) * g + 0.75 : g < 2.5 / 2.75 ? 7.5625 * (g -= 2.25 / 2.75) * g + 0.9375 : 7.5625 * (g -= 2.625 / 2.75) * g + 0.984375, ni = (g) => 1 - Ze(1 - g), oi = Ze, ai = (g) => g < 0.5 ? (1 - Ze(1 - 2 * g)) / 2 : (1 + Ze(2 * g - 1)) / 2, es = /* @__PURE__ */ new Map(), ze = (g, t, i, o) => {
|
|
431
431
|
const e = `${g},${t},${i},${o}`;
|
|
432
432
|
if (es.has(e)) return es.get(e);
|
|
433
|
-
const s = (
|
|
434
|
-
let l =
|
|
433
|
+
const s = (f) => (1 - 3 * i + 3 * g) * f * f * f + (3 * i - 6 * g) * f * f + 3 * g * f, n = (f) => (1 - 3 * o + 3 * t) * f * f * f + (3 * o - 6 * t) * f * f + 3 * t * f, a = (f) => 3 * (1 - 3 * i + 3 * g) * f * f + 2 * (3 * i - 6 * g) * f + 3 * g, r = (f) => {
|
|
434
|
+
let l = f;
|
|
435
435
|
for (let p = 0; p < 8; p++) {
|
|
436
|
-
const c = s(l) -
|
|
436
|
+
const c = s(l) - f;
|
|
437
437
|
if (Math.abs(c) < 1e-6) return l;
|
|
438
438
|
const d = a(l);
|
|
439
439
|
if (Math.abs(d) < 1e-6) break;
|
|
440
440
|
l = l - c / d;
|
|
441
441
|
}
|
|
442
442
|
return l;
|
|
443
|
-
},
|
|
444
|
-
return es.set(e,
|
|
443
|
+
}, h = (f) => f === 0 ? 0 : f === 1 ? 1 : n(r(f));
|
|
444
|
+
return es.set(e, h), h;
|
|
445
445
|
}, cs = (g) => {
|
|
446
446
|
const t = g.match(/cubic-bezier\s*\(\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*\)/);
|
|
447
447
|
if (!t) return null;
|
|
448
448
|
const [, i, o, e, s] = t.map(Number);
|
|
449
449
|
return ze(i, o, e, s);
|
|
450
|
-
},
|
|
450
|
+
}, hs = {
|
|
451
451
|
ease: ze(0.25, 0.1, 0.25, 1),
|
|
452
452
|
"ease-in": ze(0.42, 0, 1, 1),
|
|
453
453
|
"ease-out": ze(0, 0, 0.58, 1),
|
|
@@ -460,7 +460,7 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Os = (g) => g < 1 ? 0 : 1, os =
|
|
|
460
460
|
EaseOutQuad: as,
|
|
461
461
|
EaseInOutQuad: rs,
|
|
462
462
|
// Cubic
|
|
463
|
-
EaseInCubic:
|
|
463
|
+
EaseInCubic: Os,
|
|
464
464
|
EaseOutCubic: Fs,
|
|
465
465
|
EaseInOutCubic: $s,
|
|
466
466
|
// Quartic
|
|
@@ -501,25 +501,25 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Os = (g) => g < 1 ? 0 : 1, os =
|
|
|
501
501
|
EaseInOut: rs,
|
|
502
502
|
// Discrete
|
|
503
503
|
StepStart: Ls,
|
|
504
|
-
StepEnd:
|
|
504
|
+
StepEnd: Rs
|
|
505
505
|
}, ri = (g) => {
|
|
506
506
|
const t = g.trim(), i = t.toLowerCase();
|
|
507
507
|
if (Ke[t]) return Ke[t];
|
|
508
508
|
const o = Object.keys(Ke).find((s) => s.toLowerCase() === i);
|
|
509
509
|
if (o) return Ke[o];
|
|
510
|
-
const e = Object.keys(
|
|
510
|
+
const e = Object.keys(fs).find((s) => s.toLowerCase() === i);
|
|
511
511
|
if (e) {
|
|
512
|
-
const s = cs(
|
|
512
|
+
const s = cs(fs[e].value);
|
|
513
513
|
if (s) return s;
|
|
514
514
|
}
|
|
515
|
-
if (
|
|
516
|
-
return
|
|
515
|
+
if (hs[i])
|
|
516
|
+
return hs[i];
|
|
517
517
|
if (i.startsWith("cubic-bezier")) {
|
|
518
518
|
const s = cs(t);
|
|
519
519
|
if (s) return s;
|
|
520
520
|
}
|
|
521
521
|
return gs;
|
|
522
|
-
},
|
|
522
|
+
}, fs = {
|
|
523
523
|
Snappy: {
|
|
524
524
|
label: "Snappy",
|
|
525
525
|
description: "High energy, quick arrival.",
|
|
@@ -572,10 +572,10 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Os = (g) => g < 1 ? 0 : 1, os =
|
|
|
572
572
|
}
|
|
573
573
|
}, li = (g, t, i, o, e) => {
|
|
574
574
|
if (!g || !t || !i) return g;
|
|
575
|
-
const s = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r,
|
|
575
|
+
const s = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r, h, f) => {
|
|
576
576
|
let l = 0, p = 0;
|
|
577
|
-
const c = o.rotation * Math.PI / 180, d = Math.cos(c), u = Math.sin(c), v = r * s * d -
|
|
578
|
-
|
|
577
|
+
const c = o.rotation * Math.PI / 180, d = Math.cos(c), u = Math.sin(c), v = r * s * d - h * n * u + o.x, b = r * s * u + h * n * d + o.y;
|
|
578
|
+
f.forEach((I) => {
|
|
579
579
|
const k = e(I.boneId);
|
|
580
580
|
if (!k) return;
|
|
581
581
|
const T = {
|
|
@@ -587,7 +587,7 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Os = (g) => g < 1 ? 0 : 1, os =
|
|
|
587
587
|
}, L = i[I.boneId] || [1, 0, 0, 1, 0, 0], P = v * L[0] + b * L[2] + L[4], _ = v * L[1] + b * L[3] + L[5], E = T.rotation * Math.PI / 180, A = Math.cos(E), W = Math.sin(E), z = P * T.scaleX * A - _ * T.scaleY * W + T.x, Y = P * T.scaleX * W + _ * T.scaleY * A + T.y;
|
|
588
588
|
l += z * I.amount, p += Y * I.amount;
|
|
589
589
|
});
|
|
590
|
-
const m = [...
|
|
590
|
+
const m = [...f].sort((I, k) => k.amount - I.amount);
|
|
591
591
|
if (m.length >= 2 && m[0].amount > 0 && m[1].amount > 0) {
|
|
592
592
|
const I = e(m[0].boneId), k = e(m[1].boneId);
|
|
593
593
|
if (I && k && I.length !== void 0 && k.length !== void 0) {
|
|
@@ -598,12 +598,12 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Os = (g) => g < 1 ? 0 : 1, os =
|
|
|
598
598
|
const x = i[m[0].boneId] || [1, 0, 0, 1, 0, 0], F = x[0] * x[3] - x[1] * x[2];
|
|
599
599
|
let j = 0, X = 0;
|
|
600
600
|
if (F !== 0) {
|
|
601
|
-
const tt = (x[2] * x[5] - x[3] * x[4]) / F,
|
|
601
|
+
const tt = (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
|
-
j = tt, X =
|
|
603
|
+
j = tt, X = R;
|
|
604
604
|
else {
|
|
605
605
|
const ot = -x[2] / F, yt = x[0] / F, bt = Math.hypot(ot, yt), gt = I.length * bt;
|
|
606
|
-
j = tt - gt * Math.sin(
|
|
606
|
+
j = tt - gt * Math.sin(O), X = R + gt * Math.cos(O);
|
|
607
607
|
}
|
|
608
608
|
const D = Math.hypot(v - j, b - X), q = Math.hypot(l - Y, p - G);
|
|
609
609
|
if (q > 0 && D > 0) {
|
|
@@ -620,16 +620,16 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Os = (g) => g < 1 ? 0 : 1, os =
|
|
|
620
620
|
y: (-w * C + M * S) / n
|
|
621
621
|
};
|
|
622
622
|
};
|
|
623
|
-
return g.map((r,
|
|
624
|
-
const
|
|
625
|
-
if (!
|
|
626
|
-
const l = { ...r, ...a(r.x, r.y,
|
|
623
|
+
return g.map((r, h) => {
|
|
624
|
+
const f = t[h];
|
|
625
|
+
if (!f || f.length === 0) return { ...r };
|
|
626
|
+
const l = { ...r, ...a(r.x, r.y, f) };
|
|
627
627
|
if (r.in_x !== void 0 && r.in_y !== void 0) {
|
|
628
|
-
const p = a(r.in_x, r.in_y,
|
|
628
|
+
const p = a(r.in_x, r.in_y, f);
|
|
629
629
|
l.in_x = p.x, l.in_y = p.y;
|
|
630
630
|
}
|
|
631
631
|
if (r.out_x !== void 0 && r.out_y !== void 0) {
|
|
632
|
-
const p = a(r.out_x, r.out_y,
|
|
632
|
+
const p = a(r.out_x, r.out_y, f);
|
|
633
633
|
l.out_x = p.x, l.out_y = p.y;
|
|
634
634
|
}
|
|
635
635
|
return l;
|
|
@@ -909,7 +909,7 @@ class ci {
|
|
|
909
909
|
}
|
|
910
910
|
svgPathToPoints(t) {
|
|
911
911
|
const i = /([MLHVCSQTAZmlhvcsqtaz])([^MLHVCSQTAZmlhvcsqtaz]*)/g, o = /[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g, e = [];
|
|
912
|
-
let s = !1, n = 0, a = 0, r = 0,
|
|
912
|
+
let s = !1, n = 0, a = 0, r = 0, h = 0, f = 0, l = 0, p;
|
|
913
913
|
for (; (p = i.exec(t)) !== null; ) {
|
|
914
914
|
const c = p[1], d = (p[2].match(o) || []).map(parseFloat), u = c === c.toLowerCase(), v = c.toUpperCase();
|
|
915
915
|
let b = 0;
|
|
@@ -920,7 +920,7 @@ class ci {
|
|
|
920
920
|
switch (v) {
|
|
921
921
|
case "M": {
|
|
922
922
|
const S = y();
|
|
923
|
-
for (
|
|
923
|
+
for (f = n = S.x, l = a = S.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a, moveTo: !0 }); b < d.length; ) {
|
|
924
924
|
const C = y();
|
|
925
925
|
n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a });
|
|
926
926
|
}
|
|
@@ -947,17 +947,17 @@ class ci {
|
|
|
947
947
|
const M = e[e.length - 1];
|
|
948
948
|
M.out_x = S.x, M.out_y = S.y;
|
|
949
949
|
}
|
|
950
|
-
n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x,
|
|
950
|
+
n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x, h = C.y;
|
|
951
951
|
}
|
|
952
952
|
break;
|
|
953
953
|
case "S":
|
|
954
954
|
for (; b < d.length; ) {
|
|
955
|
-
const S = { x: 2 * n - r, y: 2 * a -
|
|
955
|
+
const S = { x: 2 * n - r, y: 2 * a - h }, C = y(), w = y();
|
|
956
956
|
if (e.length > 0) {
|
|
957
957
|
const M = e[e.length - 1];
|
|
958
958
|
M.out_x = S.x, M.out_y = S.y;
|
|
959
959
|
}
|
|
960
|
-
n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x,
|
|
960
|
+
n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x, h = C.y;
|
|
961
961
|
}
|
|
962
962
|
break;
|
|
963
963
|
case "Q":
|
|
@@ -967,17 +967,17 @@ class ci {
|
|
|
967
967
|
const w = e[e.length - 1];
|
|
968
968
|
w.out_x = w.x + 2 / 3 * (S.x - w.x), w.out_y = w.y + 2 / 3 * (S.y - w.y);
|
|
969
969
|
}
|
|
970
|
-
n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x,
|
|
970
|
+
n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x, h = S.y;
|
|
971
971
|
}
|
|
972
972
|
break;
|
|
973
973
|
case "T":
|
|
974
974
|
for (; b < d.length; ) {
|
|
975
|
-
const S = { x: 2 * n - r, y: 2 * a -
|
|
975
|
+
const S = { x: 2 * n - r, y: 2 * a - h }, C = y();
|
|
976
976
|
if (e.length > 0) {
|
|
977
977
|
const w = e[e.length - 1];
|
|
978
978
|
w.out_x = w.x + 2 / 3 * (S.x - w.x), w.out_y = w.y + 2 / 3 * (S.y - w.y);
|
|
979
979
|
}
|
|
980
|
-
n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x,
|
|
980
|
+
n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x, h = S.y;
|
|
981
981
|
}
|
|
982
982
|
break;
|
|
983
983
|
case "Z":
|
|
@@ -987,7 +987,7 @@ class ci {
|
|
|
987
987
|
const C = [...e].reverse().find((w) => w.moveTo) || e[0];
|
|
988
988
|
C && Math.hypot(C.x - S.x, C.y - S.y) < 0.1 && (C.in_x = S.in_x, C.in_y = S.in_y, e.pop(), e.length > 0 && (e[e.length - 1].closePath = !0));
|
|
989
989
|
}
|
|
990
|
-
n =
|
|
990
|
+
n = f, a = l;
|
|
991
991
|
break;
|
|
992
992
|
default:
|
|
993
993
|
if (d.length >= 2) {
|
|
@@ -1064,20 +1064,20 @@ class ci {
|
|
|
1064
1064
|
if (!t) return;
|
|
1065
1065
|
let i = this.decompressStrings(t);
|
|
1066
1066
|
const o = [], e = /* @__PURE__ */ new Set(), s = (r) => {
|
|
1067
|
-
r && r.forEach((
|
|
1068
|
-
if (e.has(
|
|
1069
|
-
const
|
|
1070
|
-
e.add(
|
|
1067
|
+
r && r.forEach((h) => {
|
|
1068
|
+
if (e.has(h.id)) return;
|
|
1069
|
+
const f = { ...h }, l = f.childrenObjects || [];
|
|
1070
|
+
e.add(f.id), o.push(f), s(l);
|
|
1071
1071
|
});
|
|
1072
1072
|
};
|
|
1073
1073
|
if (s(i.objects || []), o.length > (i.objects || []).length && this.log(`[Engine] Flattened artboard from ${(i.objects || []).length} to ${o.length} objects.`), i.objects = o, this.artboard = i, this.currentTime = 0, this.objectStates.clear(), this.log(`[ExodeUIEngine] Loading artboard: "${(n = this.artboard) == null ? void 0 : n.name}" with ${(a = this.artboard) == null ? void 0 : a.objects.length} objects`), this.artboard && this.artboard.objects) {
|
|
1074
1074
|
const r = /* @__PURE__ */ new Map();
|
|
1075
|
-
this.artboard.objects.forEach((
|
|
1076
|
-
r.set(
|
|
1077
|
-
}), this.artboard.objects.forEach((
|
|
1078
|
-
if (
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1075
|
+
this.artboard.objects.forEach((h) => {
|
|
1076
|
+
r.set(h.id, h), h.children || (h.children = []);
|
|
1077
|
+
}), this.artboard.objects.forEach((h) => {
|
|
1078
|
+
if (h.parentId) {
|
|
1079
|
+
const f = r.get(h.parentId);
|
|
1080
|
+
f && (f.children || (f.children = []), f.children.includes(h.id) || f.children.push(h.id));
|
|
1081
1081
|
}
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
@@ -1127,11 +1127,11 @@ class ci {
|
|
|
1127
1127
|
reset() {
|
|
1128
1128
|
if (!this.artboard) return;
|
|
1129
1129
|
if (this.objectStates.clear(), this.objectVelocities.clear(), this.currentTime = 0, this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.logicNodeValues.clear(), this.justFiredTriggers.clear(), this.inputs.set("mouseX", 0), this.inputs.set("mouseY", 0), this.inputs.set("scrollX", 0), this.inputs.set("scrollY", 0), this.inputs.set("isMouseDown", !1), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this._layoutAnimCache.clear(), this._springChainState.clear(), this._emitterPools.clear(), this.artboard.objects.forEach((i) => {
|
|
1130
|
-
var n, a, r,
|
|
1131
|
-
const o = i.width ?? ((n = i.geometry) == null ? void 0 : n.width) ?? 0, e = i.height ?? ((a = i.geometry) == null ? void 0 : a.height) ?? 0, s = i.cornerRadius ?? i.corner_radius ?? ((r = i.geometry) == null ? void 0 : r.corner_radius) ?? ((
|
|
1130
|
+
var n, a, r, h, f, l, p;
|
|
1131
|
+
const o = i.width ?? ((n = i.geometry) == null ? void 0 : n.width) ?? 0, e = i.height ?? ((a = i.geometry) == null ? void 0 : a.height) ?? 0, s = i.cornerRadius ?? i.corner_radius ?? ((r = i.geometry) == null ? void 0 : r.corner_radius) ?? ((h = i.geometry) == null ? void 0 : h.cornerRadius) ?? 0;
|
|
1132
1132
|
this.objectStates.set(i.id, {
|
|
1133
1133
|
...i.transform || {},
|
|
1134
|
-
x: ((
|
|
1134
|
+
x: ((f = i.transform) == null ? void 0 : f.x) ?? i.x ?? 0,
|
|
1135
1135
|
y: ((l = i.transform) == null ? void 0 : l.y) ?? i.y ?? 0,
|
|
1136
1136
|
width: o,
|
|
1137
1137
|
height: e,
|
|
@@ -1168,14 +1168,14 @@ class ci {
|
|
|
1168
1168
|
if ((s = e.physics) != null && s.enabled && e.type === "Shape") {
|
|
1169
1169
|
const a = this.objectStates.get(e.id);
|
|
1170
1170
|
if (!a) return;
|
|
1171
|
-
const r = e.geometry.width || 100,
|
|
1171
|
+
const r = e.geometry.width || 100, h = e.geometry.height || 100;
|
|
1172
1172
|
this.physicsEngine.createBody({
|
|
1173
1173
|
id: e.id,
|
|
1174
1174
|
type: ((n = e.geometry) == null ? void 0 : n.type) || "Rectangle",
|
|
1175
1175
|
x: a.x,
|
|
1176
1176
|
y: a.y,
|
|
1177
1177
|
width: r,
|
|
1178
|
-
height:
|
|
1178
|
+
height: h,
|
|
1179
1179
|
rotation: a.rotation * (Math.PI / 180),
|
|
1180
1180
|
// Convert deg to rad
|
|
1181
1181
|
isStatic: e.physics.bodyType === "Static",
|
|
@@ -1212,8 +1212,8 @@ class ci {
|
|
|
1212
1212
|
n.forEach((a) => {
|
|
1213
1213
|
const r = this.objectStates.get(a.id);
|
|
1214
1214
|
if (r) {
|
|
1215
|
-
const
|
|
1216
|
-
!t && (
|
|
1215
|
+
const h = Math.abs(r.x - a.x), f = Math.abs(r.y - a.y);
|
|
1216
|
+
!t && (h > 20 || f > 20) ? (r.x += (a.x - r.x) * o, r.y += (a.y - r.y) * o) : (r.x = a.x, r.y = a.y), a.width !== void 0 && (r.width = a.width), a.height !== void 0 && (r.height = a.height);
|
|
1217
1217
|
}
|
|
1218
1218
|
});
|
|
1219
1219
|
};
|
|
@@ -1224,10 +1224,10 @@ class ci {
|
|
|
1224
1224
|
this.artboard.objects.forEach((n) => {
|
|
1225
1225
|
var a;
|
|
1226
1226
|
if (n.type === "Frame" && ((a = n.autoLayout) != null && a.enabled) && n.children && n.children.length > 0) {
|
|
1227
|
-
const r = n.children.map((l) => i.get(l)).filter((l) => !!l),
|
|
1228
|
-
if (!
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1227
|
+
const r = n.children.map((l) => i.get(l)).filter((l) => !!l), h = this.objectStates.get(n.id);
|
|
1228
|
+
if (!h) return;
|
|
1229
|
+
const f = ns(h, r, (l) => this.objectStates.get(l));
|
|
1230
|
+
f.frameWidth !== void 0 && (h.width = f.frameWidth), f.frameHeight !== void 0 && (h.height = f.frameHeight), e(f.childUpdates);
|
|
1231
1231
|
}
|
|
1232
1232
|
});
|
|
1233
1233
|
}
|
|
@@ -1278,21 +1278,21 @@ class ci {
|
|
|
1278
1278
|
const a = this.activeStateMachine.layers.find((r) => r.name === t);
|
|
1279
1279
|
if (a)
|
|
1280
1280
|
for (const r of i) {
|
|
1281
|
-
const
|
|
1282
|
-
if (
|
|
1283
|
-
if (
|
|
1284
|
-
e.push({ animation: null, state:
|
|
1285
|
-
const l = this.artboard.animations.find((p) => p.id ===
|
|
1281
|
+
const h = a.states.find((f) => f.id === r);
|
|
1282
|
+
if (h)
|
|
1283
|
+
if (h.isBlendState && h.blendAnimations && h.blendAnimations.length > 0)
|
|
1284
|
+
e.push({ animation: null, state: h }), h.blendAnimations.forEach((f) => {
|
|
1285
|
+
const l = this.artboard.animations.find((p) => p.id === f.animationId);
|
|
1286
1286
|
l && (s = Math.max(s, l.duration));
|
|
1287
1287
|
});
|
|
1288
1288
|
else {
|
|
1289
|
-
let
|
|
1290
|
-
|
|
1289
|
+
let f = null;
|
|
1290
|
+
h.animationId && (f = this.artboard.animations.find((l) => l.id === h.animationId) || null), f || (f = this.artboard.animations.find(
|
|
1291
1291
|
(l) => {
|
|
1292
1292
|
var p, c;
|
|
1293
|
-
return l.name ===
|
|
1293
|
+
return l.name === h.name || l.id === h.name || (h.name === "Entry" || h.id === "entry") && (((p = l.name) == null ? void 0 : p.toLowerCase()) === "onload" || ((c = l.name) == null ? void 0 : c.toLowerCase()) === "intro");
|
|
1294
1294
|
}
|
|
1295
|
-
) || null),
|
|
1295
|
+
) || null), f && ((n = this.artboard.animationFlow) != null && n.some((p) => (p.trigger === "on_load" || p.trigger === "after_delay") && p.targetAnimationId === (f == null ? void 0 : f.id)) || (e.push({ animation: f, state: h }), s = Math.max(s, f.duration)));
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
@@ -1338,22 +1338,22 @@ class ci {
|
|
|
1338
1338
|
var n, a, r;
|
|
1339
1339
|
let o;
|
|
1340
1340
|
if (this.inputs.has(t)) {
|
|
1341
|
-
const
|
|
1342
|
-
|
|
1341
|
+
const h = (n = this.activeStateMachine) == null ? void 0 : n.inputs.find((f) => f.id === t);
|
|
1342
|
+
h && typeof h.value == "object" && (o = h.value.type);
|
|
1343
1343
|
} else {
|
|
1344
|
-
const
|
|
1345
|
-
if (
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1344
|
+
const h = this.inputNameMap.get(t);
|
|
1345
|
+
if (h && h.length > 0) {
|
|
1346
|
+
const f = (a = this.activeStateMachine) == null ? void 0 : a.inputs.find((l) => l.id === h[0]);
|
|
1347
|
+
f && typeof f.value == "object" && (o = f.value.type);
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
let e = i;
|
|
1351
1351
|
o === "Trigger" && (i === 1 ? e = !0 : i === 0 && (e = !1)), this.inputs.has(t) && this.setInternalInput(t, e);
|
|
1352
1352
|
const s = this.inputNameMap.get(t);
|
|
1353
|
-
s && s.forEach((
|
|
1354
|
-
if (
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1353
|
+
s && s.forEach((h) => this.setInternalInput(h, e)), o === "Trigger" && e === !0 && (this.justFiredTriggers.add(t), s && s.forEach((h) => this.justFiredTriggers.add(h))), Array.isArray(e) && ((r = this.artboard) == null || r.objects.forEach((h) => {
|
|
1354
|
+
if (h.inputId === t || h.name === t) {
|
|
1355
|
+
const f = this.objectStates.get(h.id);
|
|
1356
|
+
f && f.options && (h.type === "ListView" || h.variant === "listview" ? f.options.items = e : (h.type === "Dropdown" || h.variant === "dropdown") && (f.options.optionsList = e));
|
|
1357
1357
|
}
|
|
1358
1358
|
})), this.evaluateTransitions(), this.evaluateVariableTriggers(t, e);
|
|
1359
1359
|
}
|
|
@@ -1363,42 +1363,42 @@ class ci {
|
|
|
1363
1363
|
o.forEach((s) => {
|
|
1364
1364
|
if (s.trigger === "variable" && s.conditionVariableId && s.targetAnimationId && (s.conditionVariableId === t || e && e.includes(s.conditionVariableId))) {
|
|
1365
1365
|
const a = s.conditionOperator || "IsTrue", r = s.conditionValue;
|
|
1366
|
-
let
|
|
1366
|
+
let h = !1;
|
|
1367
1367
|
switch (a) {
|
|
1368
1368
|
case "Equal":
|
|
1369
1369
|
case "==":
|
|
1370
|
-
|
|
1370
|
+
h = i == r;
|
|
1371
1371
|
break;
|
|
1372
1372
|
case "NotEqual":
|
|
1373
1373
|
case "!=":
|
|
1374
|
-
|
|
1374
|
+
h = i != r;
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "GreaterThan":
|
|
1377
1377
|
case ">":
|
|
1378
|
-
|
|
1378
|
+
h = i > r;
|
|
1379
1379
|
break;
|
|
1380
1380
|
case "LessThan":
|
|
1381
1381
|
case "<":
|
|
1382
|
-
|
|
1382
|
+
h = i < r;
|
|
1383
1383
|
break;
|
|
1384
1384
|
case "GreaterEqual":
|
|
1385
1385
|
case ">=":
|
|
1386
|
-
|
|
1386
|
+
h = i >= r;
|
|
1387
1387
|
break;
|
|
1388
1388
|
case "LessEqual":
|
|
1389
1389
|
case "<=":
|
|
1390
|
-
|
|
1390
|
+
h = i <= r;
|
|
1391
1391
|
break;
|
|
1392
1392
|
case "IsTrue":
|
|
1393
|
-
|
|
1393
|
+
h = !!i;
|
|
1394
1394
|
break;
|
|
1395
1395
|
case "IsFalse":
|
|
1396
|
-
|
|
1396
|
+
h = !i;
|
|
1397
1397
|
break;
|
|
1398
1398
|
}
|
|
1399
|
-
if (
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1399
|
+
if (h) {
|
|
1400
|
+
const f = s.delay || 0;
|
|
1401
|
+
f <= 0 ? this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id) : setTimeout(() => this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id), f);
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
1404
|
});
|
|
@@ -1421,7 +1421,7 @@ class ci {
|
|
|
1421
1421
|
const s = this.findGlobalTransition(t, i.currentStateIds);
|
|
1422
1422
|
s && (o.length = 0, o.push(s.targetStateId), e = !0, s.conditions && (s.conditions || []).forEach((n) => {
|
|
1423
1423
|
var r;
|
|
1424
|
-
const a = (r = this.activeStateMachine) == null ? void 0 : r.inputs.find((
|
|
1424
|
+
const a = (r = this.activeStateMachine) == null ? void 0 : r.inputs.find((h) => h.id === n.inputId);
|
|
1425
1425
|
a && typeof a.value == "object" && a.value.type === "Trigger" && this.setInternalInput(n.inputId, !1);
|
|
1426
1426
|
}));
|
|
1427
1427
|
}
|
|
@@ -1498,7 +1498,7 @@ class ci {
|
|
|
1498
1498
|
});
|
|
1499
1499
|
}
|
|
1500
1500
|
evaluateLogicTree(t, i = null, o = /* @__PURE__ */ new Set()) {
|
|
1501
|
-
var a, r,
|
|
1501
|
+
var a, r, h, f, l, p;
|
|
1502
1502
|
if (o.has(t))
|
|
1503
1503
|
return this.inputs.get(t) ?? this.logicNodeValues.get(t) ?? 0;
|
|
1504
1504
|
o.add(t);
|
|
@@ -1708,7 +1708,7 @@ class ci {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
case wt.SPRING_PULL: {
|
|
1710
1710
|
const u = c("objectId", ""), v = c("forceX", 0), b = c("forceY", 0);
|
|
1711
|
-
u && ((
|
|
1711
|
+
u && ((h = this.artboard) == null || h.objects.forEach((m) => {
|
|
1712
1712
|
m.behaviors && m.behaviors.forEach((y) => {
|
|
1713
1713
|
var S;
|
|
1714
1714
|
if (y.type === U.SpringChain && ((S = y.settings) != null && S.connections) && (y.settings.connections.some((w) => w.targetId === u) || m.id === u)) {
|
|
@@ -1745,7 +1745,7 @@ class ci {
|
|
|
1745
1745
|
}
|
|
1746
1746
|
case wt.EMIT: {
|
|
1747
1747
|
const u = c("objectId", ""), v = c("count", 20);
|
|
1748
|
-
u && ((
|
|
1748
|
+
u && ((f = this.artboard) == null || f.objects.forEach((b) => {
|
|
1749
1749
|
b.behaviors && b.behaviors.forEach((m) => {
|
|
1750
1750
|
m.type === U.ParticleEmitter && b.id === u && (m._pendingBurst = (m._pendingBurst || 0) + v);
|
|
1751
1751
|
});
|
|
@@ -1841,11 +1841,11 @@ class ci {
|
|
|
1841
1841
|
}), i.forEach((o) => {
|
|
1842
1842
|
this.layerStates.delete(o), this.debugLog(`[Engine] Cleaned up completed global layer: ${o}`);
|
|
1843
1843
|
}), this.solveConstraints(t), this.solveBehaviors(t), this.activeTriggers.forEach((o, e) => {
|
|
1844
|
-
var s, n, a, r,
|
|
1844
|
+
var s, n, a, r, h, f, l;
|
|
1845
1845
|
if (o.phase === "entry")
|
|
1846
1846
|
o.time += t, o.time >= o.animation.duration && ((a = (n = (s = this.artboard) == null ? void 0 : s.objects.find((p) => p.id === e)) == null ? void 0 : n.triggers) == null || a.find((p) => p.id === o.triggerId), o.phase = "hold", o.elapsedHold = 0, o.time = o.animation.duration), this.applyAnimation(o.animation, o.time, o.filterObjectIds || o.filterObjectId || void 0);
|
|
1847
1847
|
else if (o.phase === "hold") {
|
|
1848
|
-
const p = (
|
|
1848
|
+
const p = (f = (h = (r = this.artboard) == null ? void 0 : r.objects.find((u) => u.id === e)) == null ? void 0 : h.triggers) == null ? void 0 : f.find((u) => u.id === o.triggerId), c = (p == null ? void 0 : p.duration) || 0;
|
|
1849
1849
|
o.elapsedHold += t * 1e3;
|
|
1850
1850
|
let d = o.elapsedHold >= c;
|
|
1851
1851
|
if ((p == null ? void 0 : p.eventType) === "hover" && !this.activeHoverIds.has(e) && (d = !0), ((p == null ? void 0 : p.eventType) === "onHold" || (p == null ? void 0 : p.eventType) === "pointerDown") && !this.isMouseDown && (d = !0), d)
|
|
@@ -1864,7 +1864,7 @@ class ci {
|
|
|
1864
1864
|
if (o && o.isEnabled && o.triggerType === "visible") {
|
|
1865
1865
|
const a = this.objectStates.get(i.id);
|
|
1866
1866
|
if (a && a.visible !== !1) {
|
|
1867
|
-
const r = this.getGlobalTransform(i.id),
|
|
1867
|
+
const r = this.getGlobalTransform(i.id), h = (((s = i.geometry) == null ? void 0 : s.width) || 100) * (r.scale_x || 1), f = (((n = i.geometry) == null ? void 0 : n.height) || 100) * (r.scale_y || 1), l = 50, p = r.x + h / 2 >= -this.canvasWidth / 2 - l && r.x - h / 2 <= this.canvasWidth / 2 + l && r.y + f / 2 >= -this.canvasHeight / 2 - l && r.y - f / 2 <= this.canvasHeight / 2 + l, c = `analytics_${i.id}`, d = this.wasInView.has(c);
|
|
1868
1868
|
p && !d && this.fireAnalyticsEvent(i.id, "visible"), p ? this.wasInView.add(c) : this.wasInView.delete(c);
|
|
1869
1869
|
}
|
|
1870
1870
|
}
|
|
@@ -1873,7 +1873,7 @@ class ci {
|
|
|
1873
1873
|
o.length !== 0 && o.forEach((e) => {
|
|
1874
1874
|
const s = e.triggers || [e.event || e.trigger];
|
|
1875
1875
|
s && s.forEach((n) => {
|
|
1876
|
-
var r,
|
|
1876
|
+
var r, h, f;
|
|
1877
1877
|
const a = n.toLowerCase();
|
|
1878
1878
|
if (a === "on interval" || a === "oninterval") {
|
|
1879
1879
|
const l = e.intervalValue || 2e3, p = this.periodicTriggerTimes.get(e.id) || 0;
|
|
@@ -1886,12 +1886,12 @@ class ci {
|
|
|
1886
1886
|
if (a === "scroll into view" || a === "scrollintoview") {
|
|
1887
1887
|
const l = this.objectStates.get(i.id);
|
|
1888
1888
|
if (l && l.visible !== !1) {
|
|
1889
|
-
const p = this.getGlobalTransform(i.id), c = (((r = i.geometry) == null ? void 0 : r.width) || 100) * (p.scale_x || 1), d = (((
|
|
1889
|
+
const p = this.getGlobalTransform(i.id), c = (((r = i.geometry) == null ? void 0 : r.width) || 100) * (p.scale_x || 1), d = (((h = i.geometry) == null ? void 0 : h.height) || 100) * (p.scale_y || 1), u = 50, v = p.x + c / 2 >= -this.canvasWidth / 2 - u && p.x - c / 2 <= this.canvasWidth / 2 + u && p.y + d / 2 >= -this.canvasHeight / 2 - u && p.y - d / 2 <= this.canvasHeight / 2 + u, b = this.wasInView.has(i.id);
|
|
1890
1890
|
v && !b && (!e.conditions || this.checkConditions(e.conditions)) && this.fireEventForObject(i.id, "Scroll Into View"), v ? this.wasInView.add(i.id) : this.wasInView.delete(i.id);
|
|
1891
1891
|
}
|
|
1892
1892
|
}
|
|
1893
1893
|
if (a === "scroll progress" || a === "scrollprogress") {
|
|
1894
|
-
const l = Math.abs(this.scrollOffset.y) / (((
|
|
1894
|
+
const l = Math.abs(this.scrollOffset.y) / (((f = this.artboard) == null ? void 0 : f.height) || 1e3), p = this.scrollProgressLastValue.get(e.id) || 0;
|
|
1895
1895
|
Math.abs(l - p) > 1e-3 && (this.scrollProgressLastValue.set(e.id, l), (e.action === "Set Input" || e.action === "setInput") && this.updateInput(e.targetInputId, l));
|
|
1896
1896
|
}
|
|
1897
1897
|
});
|
|
@@ -1905,17 +1905,17 @@ class ci {
|
|
|
1905
1905
|
if (!o) return;
|
|
1906
1906
|
const e = this.getGlobalTransform(i.id);
|
|
1907
1907
|
if (i.constraints.forEach((s, n) => {
|
|
1908
|
-
var
|
|
1909
|
-
const a = ((
|
|
1908
|
+
var f, l, p, c, d, u, v, b, m;
|
|
1909
|
+
const a = ((f = o.constraints) == null ? void 0 : f[n]) || {}, r = { ...s, ...a }, h = r.strength ?? 1;
|
|
1910
1910
|
if (r.type === "Translation") {
|
|
1911
1911
|
const y = this.getGlobalTransform(r.targetId);
|
|
1912
1912
|
if (y) {
|
|
1913
1913
|
const S = r.offsetX || 0, C = r.offsetY || 0, w = y.x + S, M = y.y + C, I = r.useSpring;
|
|
1914
1914
|
if (I) {
|
|
1915
1915
|
const T = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: L, y: P, vx: _, vy: E } = this.computeSpring(e.x, e.y, T.vx, T.vy, w, M, r, t);
|
|
1916
|
-
r.copyX && (e.x = e.x + (L - e.x) *
|
|
1916
|
+
r.copyX && (e.x = e.x + (L - e.x) * h), r.copyY && (e.y = e.y + (P - e.y) * h), this.objectVelocities.set(i.id, { vx: _, vy: E });
|
|
1917
1917
|
} else
|
|
1918
|
-
r.copyX && (e.x = e.x + (w - e.x) *
|
|
1918
|
+
r.copyX && (e.x = e.x + (w - e.x) * h), r.copyY && (e.y = e.y + (M - e.y) * h);
|
|
1919
1919
|
let k = !1;
|
|
1920
1920
|
if ((l = r.limitX) != null && l.enabled) {
|
|
1921
1921
|
const T = e.x;
|
|
@@ -1931,17 +1931,17 @@ class ci {
|
|
|
1931
1931
|
const y = this.getGlobalTransform(r.targetId);
|
|
1932
1932
|
if (y) {
|
|
1933
1933
|
let C = (y.rotation + (r.offset || 0) - e.rotation) % 360;
|
|
1934
|
-
C > 180 && (C -= 360), C < -180 && (C += 360), e.rotation = e.rotation + C *
|
|
1934
|
+
C > 180 && (C -= 360), C < -180 && (C += 360), e.rotation = e.rotation + C * h;
|
|
1935
1935
|
}
|
|
1936
1936
|
} else if (r.type === "Scale") {
|
|
1937
1937
|
const y = this.getGlobalTransform(r.targetId);
|
|
1938
|
-
y && (r.copyX && (e.scale_x = e.scale_x + (y.scale_x - e.scale_x) *
|
|
1938
|
+
y && (r.copyX && (e.scale_x = e.scale_x + (y.scale_x - e.scale_x) * h), r.copyY && (e.scale_y = e.scale_y + (y.scale_y - e.scale_y) * h));
|
|
1939
1939
|
} else if (r.type === "Transform") {
|
|
1940
1940
|
const y = this.getGlobalTransform(r.targetId);
|
|
1941
1941
|
if (y) {
|
|
1942
|
-
e.x = e.x + (y.x - e.x) *
|
|
1942
|
+
e.x = e.x + (y.x - e.x) * h, e.y = e.y + (y.y - e.y) * h;
|
|
1943
1943
|
let S = (y.rotation - e.rotation) % 360;
|
|
1944
|
-
S > 180 && (S -= 360), S < -180 && (S += 360), e.rotation = e.rotation + S *
|
|
1944
|
+
S > 180 && (S -= 360), S < -180 && (S += 360), e.rotation = e.rotation + S * h, e.scale_x = e.scale_x + (y.scale_x - e.scale_x) * h, e.scale_y = e.scale_y + (y.scale_y - e.scale_y) * h;
|
|
1945
1945
|
}
|
|
1946
1946
|
} else if (r.type === "FollowPointer") {
|
|
1947
1947
|
const y = ((c = this._lastPointerPos) == null ? void 0 : c.x) ?? e.x, S = ((d = this._lastPointerPos) == null ? void 0 : d.y) ?? e.y, C = r.useSpring;
|
|
@@ -1949,7 +1949,7 @@ class ci {
|
|
|
1949
1949
|
const M = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: I, y: k, vx: T, vy: L } = this.computeSpring(e.x, e.y, M.vx, M.vy, y, S, r, t);
|
|
1950
1950
|
e.x = I, e.y = k, this.objectVelocities.set(i.id, { vx: T, vy: L });
|
|
1951
1951
|
} else
|
|
1952
|
-
e.x = e.x + (y - e.x) *
|
|
1952
|
+
e.x = e.x + (y - e.x) * h, e.y = e.y + (S - e.y) * h;
|
|
1953
1953
|
let w = !1;
|
|
1954
1954
|
if ((u = r.limitX) != null && u.enabled) {
|
|
1955
1955
|
const M = e.x;
|
|
@@ -1981,7 +1981,7 @@ class ci {
|
|
|
1981
1981
|
}
|
|
1982
1982
|
if (w > 0) {
|
|
1983
1983
|
const k = e.x === y.x && e.y === y.y ? 1 : I / w;
|
|
1984
|
-
e.x = e.x + (y.x + S * k - e.x) *
|
|
1984
|
+
e.x = e.x + (y.x + S * k - e.x) * h, e.y = e.y + (y.y + C * k - e.y) * h;
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
1987
|
} else if (r.type === "FollowPath") {
|
|
@@ -2004,15 +2004,15 @@ class ci {
|
|
|
2004
2004
|
A = Math.atan2(tt, X) * 180 / Math.PI + (r.offsetRotation || 0);
|
|
2005
2005
|
}
|
|
2006
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, J = S.x + _ + G, x = S.y + E + N;
|
|
2007
|
-
if (e.x = e.x + (J - e.x) *
|
|
2007
|
+
if (e.x = e.x + (J - e.x) * h, e.y = e.y + (x - e.y) * h, r.orient) {
|
|
2008
2008
|
let F = (A - e.rotation) % 360;
|
|
2009
|
-
F > 180 && (F -= 360), F < -180 && (F += 360), e.rotation = e.rotation + F *
|
|
2009
|
+
F > 180 && (F -= 360), F < -180 && (F += 360), e.rotation = e.rotation + F * h;
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
2012
2012
|
}
|
|
2013
2013
|
} else if (r.type === "IK") {
|
|
2014
2014
|
const y = this.getGlobalTransform(r.targetId);
|
|
2015
|
-
y && this.solveIK(i, y, r.boneCount || 2,
|
|
2015
|
+
y && this.solveIK(i, y, r.boneCount || 2, h);
|
|
2016
2016
|
}
|
|
2017
2017
|
}), i.constraints.some((s) => s.type !== "IK")) {
|
|
2018
2018
|
const s = this.globalToLocal(i.parentId, e);
|
|
@@ -2034,10 +2034,10 @@ class ci {
|
|
|
2034
2034
|
scale_y: (i.scale_y ?? 1) * (i.flip_y ? -1 : 1),
|
|
2035
2035
|
length: e
|
|
2036
2036
|
};
|
|
2037
|
-
const s = this.getGlobalTransform(o.parentId), n = s.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n),
|
|
2037
|
+
const s = this.getGlobalTransform(o.parentId), n = s.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), h = s.x + (i.x * s.scale_x * a - i.y * s.scale_y * r), f = s.y + (i.x * s.scale_x * r + i.y * s.scale_y * a);
|
|
2038
2038
|
return {
|
|
2039
|
-
x:
|
|
2040
|
-
y:
|
|
2039
|
+
x: h,
|
|
2040
|
+
y: f,
|
|
2041
2041
|
rotation: s.rotation + i.rotation,
|
|
2042
2042
|
scale_x: s.scale_x * (i.scale_x ?? 1) * (i.flip_x ? -1 : 1),
|
|
2043
2043
|
scale_y: s.scale_y * (i.scale_y ?? 1) * (i.flip_y ? -1 : 1),
|
|
@@ -2046,7 +2046,7 @@ class ci {
|
|
|
2046
2046
|
}
|
|
2047
2047
|
globalToLocal(t, i) {
|
|
2048
2048
|
if (!t) return i;
|
|
2049
|
-
const o = this.getGlobalTransform(t), e = o.scale_x === 0 ? 0 : 1 / o.scale_x, s = o.scale_y === 0 ? 0 : 1 / o.scale_y, n = -o.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n),
|
|
2049
|
+
const o = this.getGlobalTransform(t), e = o.scale_x === 0 ? 0 : 1 / o.scale_x, s = o.scale_y === 0 ? 0 : 1 / o.scale_y, n = -o.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), h = i.x - o.x, f = i.y - o.y, l = (h * a - f * r) * e, p = (h * r + f * a) * s;
|
|
2050
2050
|
return {
|
|
2051
2051
|
x: l,
|
|
2052
2052
|
y: p,
|
|
@@ -2056,11 +2056,11 @@ class ci {
|
|
|
2056
2056
|
};
|
|
2057
2057
|
}
|
|
2058
2058
|
solveIK(t, i, o, e) {
|
|
2059
|
-
var
|
|
2059
|
+
var h;
|
|
2060
2060
|
const s = [];
|
|
2061
2061
|
let n = t.id;
|
|
2062
|
-
for (let
|
|
2063
|
-
const l = (
|
|
2062
|
+
for (let f = 0; f < o && n; f++) {
|
|
2063
|
+
const l = (h = this.artboard) == null ? void 0 : h.objects.find((p) => p.id === n);
|
|
2064
2064
|
if (!l) break;
|
|
2065
2065
|
s.push({
|
|
2066
2066
|
id: n,
|
|
@@ -2070,7 +2070,7 @@ class ci {
|
|
|
2070
2070
|
}
|
|
2071
2071
|
if (s.length < 2) return;
|
|
2072
2072
|
const a = s.reverse(), r = 5;
|
|
2073
|
-
for (let
|
|
2073
|
+
for (let f = 0; f < r; f++) {
|
|
2074
2074
|
const l = this.getGlobalTransform(t.id);
|
|
2075
2075
|
for (let p = a.length - 2; p >= 0; p--) {
|
|
2076
2076
|
const c = a[p], d = this.getGlobalTransform(c.id), u = l.x - d.x, v = l.y - d.y, b = i.x - d.x, m = i.y - d.y, y = Math.sqrt(u * u + v * v), S = Math.sqrt(b * b + m * m);
|
|
@@ -2085,7 +2085,7 @@ class ci {
|
|
|
2085
2085
|
}
|
|
2086
2086
|
}
|
|
2087
2087
|
computeSpring(t, i, o, e, s, n, a, r) {
|
|
2088
|
-
const
|
|
2088
|
+
const h = a.stiffness ?? 100, f = a.damping ?? 10, l = a.mass ?? 1, p = -h * (t - s), c = -h * (i - n), d = -f * o, u = -f * e, v = (p + d) / l, b = (c + u) / l, m = o + v * r, y = e + b * r, S = t + m * r, C = i + y * r;
|
|
2089
2089
|
return { x: S, y: C, vx: m, vy: y };
|
|
2090
2090
|
}
|
|
2091
2091
|
handlePointerInput(t, i, o, e, s) {
|
|
@@ -2109,7 +2109,7 @@ class ci {
|
|
|
2109
2109
|
this._totalScroll.x += t, this._totalScroll.y += i, this.scrollOffset = { x: this._totalScroll.x, y: this._totalScroll.y }, this.updateInput("scrollX", this._totalScroll.x), this.updateInput("scrollY", this._totalScroll.y);
|
|
2110
2110
|
}
|
|
2111
2111
|
handlePointerEvent(t, i, o) {
|
|
2112
|
-
var r,
|
|
2112
|
+
var r, h, f, l, p;
|
|
2113
2113
|
if (!this.artboard) return;
|
|
2114
2114
|
t === "down" ? (this.isMouseDown = !0, this.updateInput("isMouseDown", !0)) : (t === "up" || t === "blur") && (this.isMouseDown = !1, this.updateInput("isMouseDown", !1));
|
|
2115
2115
|
let e = null;
|
|
@@ -2290,11 +2290,11 @@ class ci {
|
|
|
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
|
}
|
|
2292
2292
|
if (t === "click") {
|
|
2293
|
-
const v = (
|
|
2293
|
+
const v = (h = this.artboard) == null ? void 0 : h.objects.find((y) => y.id === e.id), b = this.focusedId, m = (v == null ? void 0 : v.type) === "InputBox" || (v == null ? void 0 : v.type) === "Component" && v.variant === "inputbox";
|
|
2294
2294
|
if (v && m) {
|
|
2295
2295
|
if (this.focusedId = e.id, this.log(`[Engine] Focus set to: ${e.id}`), b !== this.focusedId) {
|
|
2296
2296
|
if (b) {
|
|
2297
|
-
const y = (
|
|
2297
|
+
const y = (f = this.artboard) == null ? void 0 : f.objects.find((S) => S.id === b);
|
|
2298
2298
|
y && this.onInputBlur && this.onInputBlur(y.name);
|
|
2299
2299
|
}
|
|
2300
2300
|
this.onInputFocus && this.onInputFocus(v.name);
|
|
@@ -2346,8 +2346,8 @@ class ci {
|
|
|
2346
2346
|
this.artboard && (this.activeKeys.delete(t.key.toLowerCase()), this.activeKeys.delete(t.code));
|
|
2347
2347
|
}
|
|
2348
2348
|
fireEventForObject(t, i) {
|
|
2349
|
-
var
|
|
2350
|
-
const o = (
|
|
2349
|
+
var f, l, p, c, d;
|
|
2350
|
+
const o = (f = this.artboard) == null ? void 0 : f.objects.find((u) => u.id === t);
|
|
2351
2351
|
if (!o) return;
|
|
2352
2352
|
const e = /* @__PURE__ */ new Set([i, i.toLowerCase()]), s = i.toLowerCase();
|
|
2353
2353
|
s === "onclick" || s === "click" || s === "onpointerdown" || s === "pointerdown" ? this.fireAnalyticsEvent(t, "click") : (s === "onpointerenter" || s === "hover" || s === "move") && this.fireAnalyticsEvent(t, "hover"), s === "onclick" || s === "click" ? (e.add("click"), e.add("onclick")) : s === "onpointerdown" || s === "pointerdown" ? (e.add("pointerdown"), e.add("onpointerdown")) : s === "onpointerup" || s === "pointerup" ? (e.add("pointerup"), e.add("onpointerup")) : s === "onpointerenter" || s === "hover" || s === "move" ? (e.add("hover"), e.add("onpointerenter")) : s === "onpointerleave" || s === "blur" ? (e.add("onpointerleave"), e.add("blur")) : s === "drag" || s === "ondrag" ? (e.add("drag"), e.add("ondrag")) : s === "toggle" || s === "ontoggle" ? (e.add("toggle"), e.add("ontoggle")) : s === "toggle true" || s === "toggle_true" || s === "toggletrue" ? (e.add("toggle true"), e.add("toggle_true"), e.add("toggletrue")) : (s === "toggle false" || s === "toggle_false" || s === "togglefalse") && (e.add("toggle false"), e.add("toggle_false"), e.add("togglefalse"));
|
|
@@ -2394,51 +2394,51 @@ class ci {
|
|
|
2394
2394
|
}
|
|
2395
2395
|
this.onTrigger && this.onTrigger(i, a.action);
|
|
2396
2396
|
}
|
|
2397
|
-
const
|
|
2397
|
+
const h = (o.triggers || []).find((u) => {
|
|
2398
2398
|
const v = u.eventType.toLowerCase();
|
|
2399
2399
|
let b = !1;
|
|
2400
2400
|
return (e.has(v) || v === "click" && e.has("onclick") || v === "hover" && (e.has("onpointerenter") || e.has("hover")) || v === "pointerdown" && e.has("onpointerdown") || v === "pointerup" && e.has("onpointerup")) && (b = !0), b && u.conditions && u.conditions.length > 0 ? this.checkConditions(u.conditions) : b;
|
|
2401
2401
|
});
|
|
2402
|
-
if (
|
|
2403
|
-
this.log(`[Engine] Trigger matched: ${i} (as ${
|
|
2404
|
-
const u = (d = (c = this.artboard) == null ? void 0 : c.animations) == null ? void 0 : d.find((v) => v.id ===
|
|
2402
|
+
if (h && h.entryAnimationId) {
|
|
2403
|
+
this.log(`[Engine] Trigger matched: ${i} (as ${h.eventType}) -> Animation ${h.entryAnimationId}`);
|
|
2404
|
+
const u = (d = (c = this.artboard) == null ? void 0 : c.animations) == null ? void 0 : d.find((v) => v.id === h.entryAnimationId);
|
|
2405
2405
|
u && (this.activeTriggers.set(o.id, {
|
|
2406
|
-
triggerId:
|
|
2406
|
+
triggerId: h.id,
|
|
2407
2407
|
animation: u,
|
|
2408
2408
|
time: 0,
|
|
2409
2409
|
phase: "entry",
|
|
2410
2410
|
elapsedHold: 0,
|
|
2411
|
-
filterObjectId:
|
|
2412
|
-
}), this.onTrigger && this.onTrigger(
|
|
2411
|
+
filterObjectId: h.targetObjectId
|
|
2412
|
+
}), this.onTrigger && this.onTrigger(h.name, u.name));
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
2415
|
fireAnalyticsEvent(t, i) {
|
|
2416
|
-
var r,
|
|
2417
|
-
const o = (r = this.artboard) == null ? void 0 : r.objects.find((
|
|
2416
|
+
var r, h;
|
|
2417
|
+
const o = (r = this.artboard) == null ? void 0 : r.objects.find((f) => f.id === t);
|
|
2418
2418
|
if (!o) return;
|
|
2419
|
-
const e = (
|
|
2419
|
+
const e = (h = o.style) == null ? void 0 : h.analytics;
|
|
2420
2420
|
if (!e || !e.isEnabled || e.triggerType !== i) return;
|
|
2421
2421
|
const s = e.eventName || `${o.name.toLowerCase().replace(/\s+/g, "_")}_interacted`, n = {};
|
|
2422
|
-
e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((
|
|
2423
|
-
if (
|
|
2424
|
-
n[
|
|
2425
|
-
else if (
|
|
2426
|
-
const l = this.inputs.get(
|
|
2427
|
-
n[
|
|
2422
|
+
e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((f) => {
|
|
2423
|
+
if (f.type === "literal")
|
|
2424
|
+
n[f.key] = f.value;
|
|
2425
|
+
else if (f.type === "variable") {
|
|
2426
|
+
const l = this.inputs.get(f.value);
|
|
2427
|
+
n[f.key] = l !== void 0 ? l : "";
|
|
2428
2428
|
}
|
|
2429
2429
|
}), this.log(`[ExodeUI Analytics] Dispatching event "${s}" via ${i} trigger:`, n);
|
|
2430
2430
|
const a = e.platforms || { ga4: !0, meta: !0, mixpanel: !1 };
|
|
2431
2431
|
if (a.ga4) {
|
|
2432
|
-
const
|
|
2433
|
-
typeof
|
|
2432
|
+
const f = window;
|
|
2433
|
+
typeof f.gtag == "function" ? (f.gtag("event", s, n), this.log(`[ExodeUI Analytics] GA4: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] GA4: window.gtag is not a function. Event "${s}" skipped.`);
|
|
2434
2434
|
}
|
|
2435
2435
|
if (a.meta) {
|
|
2436
|
-
const
|
|
2437
|
-
typeof
|
|
2436
|
+
const f = window;
|
|
2437
|
+
typeof f.fbq == "function" ? (f.fbq("track", s, n), this.log(`[ExodeUI Analytics] Meta Pixel: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] Meta Pixel: window.fbq is not a function. Event "${s}" skipped.`);
|
|
2438
2438
|
}
|
|
2439
2439
|
if (a.mixpanel) {
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2440
|
+
const f = window;
|
|
2441
|
+
f.mixpanel && typeof f.mixpanel.track == "function" ? (f.mixpanel.track(s, n), this.log(`[ExodeUI Analytics] Mixpanel: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] Mixpanel: window.mixpanel.track is not a function. Event "${s}" skipped.`);
|
|
2442
2442
|
}
|
|
2443
2443
|
}
|
|
2444
2444
|
initGlobalAnimationTriggers() {
|
|
@@ -2488,9 +2488,9 @@ class ci {
|
|
|
2488
2488
|
scaleY: i.scale_y ?? 1,
|
|
2489
2489
|
rotation: i.rotation ?? 0
|
|
2490
2490
|
};
|
|
2491
|
-
const e = this.getWorldTransform(o.parentId), s = e.rotation * (Math.PI / 180), n = Math.cos(s), a = Math.sin(s), r = i.x * e.scaleX,
|
|
2491
|
+
const e = this.getWorldTransform(o.parentId), s = e.rotation * (Math.PI / 180), n = Math.cos(s), a = Math.sin(s), r = i.x * e.scaleX, h = i.y * e.scaleY, f = e.x + (r * n - h * a), l = e.y + (r * a + h * n);
|
|
2492
2492
|
return {
|
|
2493
|
-
x:
|
|
2493
|
+
x: f,
|
|
2494
2494
|
y: l,
|
|
2495
2495
|
scaleX: (i.scale_x ?? 1) * e.scaleX,
|
|
2496
2496
|
scaleY: (i.scale_y ?? 1) * e.scaleY,
|
|
@@ -2500,14 +2500,14 @@ class ci {
|
|
|
2500
2500
|
hitTest(t, i, o) {
|
|
2501
2501
|
var y, S;
|
|
2502
2502
|
if (!this.objectStates.get(t.id)) return !1;
|
|
2503
|
-
const s = ((y = t.geometry) == null ? void 0 : y.width) ?? t.width ?? 100, n = ((S = t.geometry) == null ? void 0 : S.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x,
|
|
2503
|
+
const s = ((y = t.geometry) == null ? void 0 : y.width) ?? t.width ?? 100, n = ((S = t.geometry) == null ? void 0 : S.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, h = o - a.y, f = -a.rotation * (Math.PI / 180), l = Math.cos(f), p = Math.sin(f), c = r * l - h * p, d = r * p + h * l, u = a.scaleX, v = a.scaleY, b = s * Math.abs(u), m = n * Math.abs(v);
|
|
2504
2504
|
return Math.abs(c) <= b / 2 && Math.abs(d) <= m / 2;
|
|
2505
2505
|
}
|
|
2506
2506
|
updateSliderValueFromPointer(t, i, o) {
|
|
2507
2507
|
var M;
|
|
2508
2508
|
const e = this.objectStates.get(t.id);
|
|
2509
2509
|
if (!e) return;
|
|
2510
|
-
const s = t.options || {}, n = ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = i - a.x,
|
|
2510
|
+
const s = t.options || {}, n = ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = i - a.x, h = o - a.y, f = -a.rotation * (Math.PI / 180), l = Math.cos(f), p = Math.sin(f), c = r * l - h * p, d = s.thumbWidth ?? 16, u = n - d;
|
|
2511
2511
|
let b = (c + u / 2) / u;
|
|
2512
2512
|
b = Math.max(0, Math.min(1, b));
|
|
2513
2513
|
const m = s.min ?? 0, y = s.max ?? 100, S = s.step || 1;
|
|
@@ -2526,8 +2526,8 @@ class ci {
|
|
|
2526
2526
|
var M, I;
|
|
2527
2527
|
const e = this.objectStates.get(t.id);
|
|
2528
2528
|
if (!e) return;
|
|
2529
|
-
const s = (e == null ? void 0 : e.width) !== void 0 ? e.width : ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 100, n = (e == null ? void 0 : e.height) !== void 0 ? e.height : ((I = t.geometry) == null ? void 0 : I.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x,
|
|
2530
|
-
let c = (r * l -
|
|
2529
|
+
const s = (e == null ? void 0 : e.width) !== void 0 ? e.width : ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 100, n = (e == null ? void 0 : e.height) !== void 0 ? e.height : ((I = t.geometry) == null ? void 0 : I.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, h = o - a.y, f = -a.rotation * (Math.PI / 180), l = Math.cos(f), p = Math.sin(f);
|
|
2530
|
+
let c = (r * l - h * p) / Math.max(1e-3, Math.abs(a.scaleX || 1)), d = (r * p + h * l) / Math.max(1e-3, Math.abs(a.scaleY || 1));
|
|
2531
2531
|
t.handleOrigin === "top-left" ? (c -= s / 2, d -= n / 2) : t.handleOrigin === "bottom-right" && (c += s / 2, d += n / 2);
|
|
2532
2532
|
const u = Math.min(s, n) * 0.45, v = Math.min(s, n) * 0.15, b = u - v;
|
|
2533
2533
|
let m = c / b, y = d / b;
|
|
@@ -2544,28 +2544,28 @@ class ci {
|
|
|
2544
2544
|
if (!e) return;
|
|
2545
2545
|
let s = e.handleX ?? o.handleX ?? 0, n = e.handleY ?? o.handleY ?? 0;
|
|
2546
2546
|
if (((a = o.inputBinding) == null ? void 0 : a.type) === "keyboard" && o.inputBinding.keyboardConfig) {
|
|
2547
|
-
const
|
|
2548
|
-
let
|
|
2549
|
-
const c = (
|
|
2547
|
+
const h = o.inputBinding.keyboardConfig;
|
|
2548
|
+
let f = s, l = n;
|
|
2549
|
+
const c = (h.speed || 5) * t;
|
|
2550
2550
|
let d = !1;
|
|
2551
|
-
this.activeKeys.has(
|
|
2552
|
-
const u = Math.sqrt(
|
|
2553
|
-
u > 1 && (
|
|
2551
|
+
this.activeKeys.has(h.upKey.toLowerCase()) && (l -= c, d = !0), this.activeKeys.has(h.downKey.toLowerCase()) && (l += c, d = !0), this.activeKeys.has(h.leftKey.toLowerCase()) && (f -= c, d = !0), this.activeKeys.has(h.rightKey.toLowerCase()) && (f += c, d = !0), o.joystickType === "1D_X" && (l = 0), o.joystickType === "1D_Y" && (f = 0);
|
|
2552
|
+
const u = Math.sqrt(f * f + l * l);
|
|
2553
|
+
u > 1 && (f /= u, l /= u), !d && o.isSpringReturn !== !1 && (f += (0 - f) * (10 * t), l += (0 - l) * (10 * t), Math.abs(f) < 0.01 && (f = 0), Math.abs(l) < 0.01 && (l = 0)), s = f, n = l;
|
|
2554
2554
|
} else if (((r = o.inputBinding) == null ? void 0 : r.type) === "mouse" && o.inputBinding.mouseConfig) {
|
|
2555
|
-
const
|
|
2556
|
-
let
|
|
2557
|
-
const p =
|
|
2558
|
-
|
|
2559
|
-
const d = Math.sqrt(
|
|
2560
|
-
d > 1 && (
|
|
2555
|
+
const h = o.inputBinding.mouseConfig;
|
|
2556
|
+
let f = s, l = n;
|
|
2557
|
+
const p = h.sensitivity || 0.01, c = Math.abs(this._mouseDelta.dx) > 0 || Math.abs(this._mouseDelta.dy) > 0;
|
|
2558
|
+
h.axisX && (f += this._mouseDelta.dx * p), h.axisY && (l += this._mouseDelta.dy * p), o.joystickType === "1D_X" && (l = 0), o.joystickType === "1D_Y" && (f = 0);
|
|
2559
|
+
const d = Math.sqrt(f * f + l * l);
|
|
2560
|
+
d > 1 && (f /= d, l /= d), !c && o.isSpringReturn !== !1 && (f += (0 - f) * (10 * t), l += (0 - l) * (10 * t), Math.abs(f) < 0.01 && (f = 0), Math.abs(l) < 0.01 && (l = 0)), s = f, n = l;
|
|
2561
2561
|
}
|
|
2562
2562
|
if (e.handleX = s, e.handleY = n, o.handleX = s, o.handleY = n, o.bindings && o.bindings.length > 0) {
|
|
2563
|
-
const
|
|
2564
|
-
let
|
|
2565
|
-
|
|
2563
|
+
const h = Math.sqrt(s * s + n * n);
|
|
2564
|
+
let f = Math.atan2(n, s) * (180 / Math.PI);
|
|
2565
|
+
f < 0 && (f += 360), o.bindings.forEach((l) => {
|
|
2566
2566
|
var d, u, v, b, m, y, S, C;
|
|
2567
2567
|
let p = 0;
|
|
2568
|
-
l.sourceAxis === "x" ? p = o.invertX ? -s : s : l.sourceAxis === "y" ? p = o.invertY ? -n : n : l.sourceAxis === "distance" ? p =
|
|
2568
|
+
l.sourceAxis === "x" ? p = o.invertX ? -s : s : l.sourceAxis === "y" ? p = o.invertY ? -n : n : l.sourceAxis === "distance" ? p = h : l.sourceAxis === "angle" && (p = f);
|
|
2569
2569
|
const c = (d = this.artboard) == null ? void 0 : d.objects.find((w) => w.id === l.targetObjectId);
|
|
2570
2570
|
if (c) {
|
|
2571
2571
|
if (l.actionType === "bind" && l.targetProperty && l.isContinuous !== !1) {
|
|
@@ -2590,8 +2590,8 @@ class ci {
|
|
|
2590
2590
|
let X = L;
|
|
2591
2591
|
if (T) {
|
|
2592
2592
|
const tt = `_internal_${F}_${l.id}`;
|
|
2593
|
-
let
|
|
2594
|
-
|
|
2593
|
+
let R = _[tt];
|
|
2594
|
+
R === void 0 && (R = _[F] ?? j), X = R + P * J, _[tt] = X, l.step && l.step > 0 && (X = Math.round(X / l.step) * l.step);
|
|
2595
2595
|
} else
|
|
2596
2596
|
X = j + L;
|
|
2597
2597
|
_[F] = X;
|
|
@@ -2613,7 +2613,7 @@ class ci {
|
|
|
2613
2613
|
}), this._mouseDelta.dx = 0, this._mouseDelta.dy = 0);
|
|
2614
2614
|
}
|
|
2615
2615
|
applyBlendState(t, i) {
|
|
2616
|
-
var
|
|
2616
|
+
var h, f, l, p, c, d, u, v;
|
|
2617
2617
|
if (!t.blendAnimations || t.blendAnimations.length === 0) return;
|
|
2618
2618
|
let o = 0, e = 0;
|
|
2619
2619
|
t.blendInputX && (o = this.inputs.get(t.blendInputX) ?? 0), t.blendInputY && (e = this.inputs.get(t.blendInputY) ?? 0);
|
|
@@ -2622,7 +2622,7 @@ class ci {
|
|
|
2622
2622
|
if (t.blendType === "1D") {
|
|
2623
2623
|
const b = [...t.blendAnimations].sort((m, y) => m.position[0] - y.position[0]);
|
|
2624
2624
|
if (b.length === 1) {
|
|
2625
|
-
const m = (
|
|
2625
|
+
const m = (f = (h = this.artboard) == null ? void 0 : h.animations) == null ? void 0 : f.find((y) => y.id === b[0].animationId);
|
|
2626
2626
|
m && (s.push({ anim: m, weight: 1 }), n = 1);
|
|
2627
2627
|
} else {
|
|
2628
2628
|
let m = 0;
|
|
@@ -2729,20 +2729,20 @@ class ci {
|
|
|
2729
2729
|
let r = e.property;
|
|
2730
2730
|
if (a && (r === "x" || r === "y" || r === "rotation"))
|
|
2731
2731
|
return;
|
|
2732
|
-
const
|
|
2733
|
-
if (!
|
|
2732
|
+
const h = this.objectStates.get(s);
|
|
2733
|
+
if (!h) {
|
|
2734
2734
|
this.frameCount % 600 === 0 && this.debugLog(`Skipping track: Object ${s} not found in state`);
|
|
2735
2735
|
return;
|
|
2736
2736
|
}
|
|
2737
|
-
const
|
|
2738
|
-
if (
|
|
2737
|
+
const f = this.interpolate(e.keyframes, i);
|
|
2738
|
+
if (f !== void 0) {
|
|
2739
2739
|
if (this.frameCount % 240 === 0) {
|
|
2740
|
-
const d = (n == null ? void 0 : n.name) || s, u = typeof
|
|
2740
|
+
const d = (n == null ? void 0 : n.name) || s, u = typeof f == "object" ? JSON.stringify(f).slice(0, 50) : f;
|
|
2741
2741
|
this.debugLog(`[Anim] Applying ${r} = ${u} to ${d}`);
|
|
2742
2742
|
}
|
|
2743
2743
|
if (r.includes(".")) {
|
|
2744
2744
|
const d = (r || "").split(".");
|
|
2745
|
-
let u =
|
|
2745
|
+
let u = h;
|
|
2746
2746
|
for (let v = 0; v < d.length - 1; v++) {
|
|
2747
2747
|
if (typeof u[d[v]] != "object" || u[d[v]] === null) {
|
|
2748
2748
|
let b = n;
|
|
@@ -2756,17 +2756,17 @@ class ci {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
u = u[d[v]];
|
|
2758
2758
|
}
|
|
2759
|
-
u[d[d.length - 1]] =
|
|
2759
|
+
u[d[d.length - 1]] = f, d[d.length - 1] === "color" && (d[d.length - 2] === "fill" || d[d.length - 2] === "stroke") && (u.type = "Solid");
|
|
2760
2760
|
} else
|
|
2761
|
-
r === "fill" ? (
|
|
2761
|
+
r === "fill" ? (h.style || (h.style = {}), h.style.fill = f) : r === "stroke" ? (h.style || (h.style = {}), h.style.stroke = f) : h[r] = f;
|
|
2762
2762
|
if (this.physicsEngine && ((c = n == null ? void 0 : n.physics) != null && c.enabled) && n.physics.bodyType === "Static")
|
|
2763
2763
|
if (r === "x") {
|
|
2764
2764
|
const d = this.physicsEngine.getPosition(s);
|
|
2765
|
-
d && this.physicsEngine.setPosition(s,
|
|
2765
|
+
d && this.physicsEngine.setPosition(s, f, d.y);
|
|
2766
2766
|
} else if (r === "y") {
|
|
2767
2767
|
const d = this.physicsEngine.getPosition(s);
|
|
2768
|
-
d && this.physicsEngine.setPosition(s, d.x,
|
|
2769
|
-
} else r === "rotation" && this.physicsEngine.setRotation(s,
|
|
2768
|
+
d && this.physicsEngine.setPosition(s, d.x, f);
|
|
2769
|
+
} else r === "rotation" && this.physicsEngine.setRotation(s, f * (Math.PI / 180));
|
|
2770
2770
|
}
|
|
2771
2771
|
});
|
|
2772
2772
|
}
|
|
@@ -2790,8 +2790,8 @@ class ci {
|
|
|
2790
2790
|
}
|
|
2791
2791
|
if (Array.isArray(o.value) && Array.isArray(e.value))
|
|
2792
2792
|
return o.value.length === e.value.length ? o.value.map((a, r) => {
|
|
2793
|
-
const
|
|
2794
|
-
return typeof a == "number" && typeof
|
|
2793
|
+
const h = e.value[r];
|
|
2794
|
+
return typeof a == "number" && typeof h == "number" ? a + (h - a) * n : n < 0.5 ? a : h;
|
|
2795
2795
|
}) : n < 0.5 ? o.value : e.value;
|
|
2796
2796
|
if (typeof o.value == "object" && typeof e.value == "object" && o.value !== null && e.value !== null) {
|
|
2797
2797
|
if (o.value.width !== void 0 && o.value.color !== void 0)
|
|
@@ -2799,9 +2799,9 @@ class ci {
|
|
|
2799
2799
|
if (o.value.type && e.value.type)
|
|
2800
2800
|
return this.interpolateFill(o.value, e.value, n);
|
|
2801
2801
|
const a = {};
|
|
2802
|
-
return (/* @__PURE__ */ new Set([...Object.keys(o.value), ...Object.keys(e.value)])).forEach((
|
|
2803
|
-
const
|
|
2804
|
-
typeof
|
|
2802
|
+
return (/* @__PURE__ */ new Set([...Object.keys(o.value), ...Object.keys(e.value)])).forEach((h) => {
|
|
2803
|
+
const f = o.value[h], l = e.value[h];
|
|
2804
|
+
typeof f == "number" && typeof l == "number" ? a[h] = f + (l - f) * n : f === void 0 ? a[h] = l : l === void 0 ? a[h] = f : a[h] = n < 0.5 ? f : l;
|
|
2805
2805
|
}), a;
|
|
2806
2806
|
}
|
|
2807
2807
|
return typeof o.value == "number" && typeof e.value == "number" ? o.value + (e.value - o.value) * n : n < 0.5 ? o.value : e.value;
|
|
@@ -2820,11 +2820,11 @@ class ci {
|
|
|
2820
2820
|
g: parseInt(b.substring(2, 4), 16),
|
|
2821
2821
|
b: parseInt(b.substring(4, 6), 16)
|
|
2822
2822
|
};
|
|
2823
|
-
}, r = a(s),
|
|
2823
|
+
}, r = a(s), h = a(n), f = Math.round(r.r + (h.r - r.r) * o), l = Math.round(r.g + (h.g - r.g) * o), p = Math.round(r.b + (h.b - r.b) * o), c = (v) => {
|
|
2824
2824
|
const b = Math.max(0, Math.min(255, v)).toString(16);
|
|
2825
2825
|
return b.length === 1 ? "0" + b : b;
|
|
2826
2826
|
};
|
|
2827
|
-
return `#${c(
|
|
2827
|
+
return `#${c(f)}${c(l)}${c(p)}`;
|
|
2828
2828
|
}
|
|
2829
2829
|
interpolateStops(t, i, o) {
|
|
2830
2830
|
return !t || !i || t.length !== i.length ? o < 0.5 ? t : i : t.map((e, s) => {
|
|
@@ -2881,46 +2881,46 @@ class ci {
|
|
|
2881
2881
|
}
|
|
2882
2882
|
}
|
|
2883
2883
|
(this.artboard.clipContent === !0 || this.artboard.clip_content === !0) && (t.beginPath(), t.rect(0, 0, s, n), t.clip());
|
|
2884
|
-
const
|
|
2885
|
-
this.artboard.objects.forEach((p) =>
|
|
2884
|
+
const h = /* @__PURE__ */ new Map();
|
|
2885
|
+
this.artboard.objects.forEach((p) => h.set(p.id, p)), this.artboard.objects.filter((p) => !p.parentId).map((p, c) => {
|
|
2886
2886
|
const d = this.objectStates.get(p.id), u = (d == null ? void 0 : d.zIndex) ?? c;
|
|
2887
2887
|
return { obj: p, zIndex: u };
|
|
2888
2888
|
}).sort((p, c) => p.zIndex - c.zIndex).forEach(({ obj: p }) => {
|
|
2889
|
-
this.renderObject(t, p,
|
|
2889
|
+
this.renderObject(t, p, h);
|
|
2890
2890
|
}), this._emitterPools.forEach((p, c) => {
|
|
2891
|
-
if (!(p.length === 0 || !
|
|
2891
|
+
if (!(p.length === 0 || !h.get(c)))
|
|
2892
2892
|
for (const u of p)
|
|
2893
2893
|
t.save(), t.globalAlpha = u.opacity, t.fillStyle = u.color, t.beginPath(), t.arc(u.x, u.y, Math.max(1, u.size * u.opacity), 0, Math.PI * 2), t.fill(), t.restore();
|
|
2894
2894
|
}), this.lastRenderTime = performance.now() - e, this.debugMode && this.frameCount % 60 === 0 && this.log(`[Engine Debug] Rendered ${this.debug_objectsRendered}/${this.debug_objectsTotal} objects in ${this.lastRenderTime.toFixed(2)}ms`), t.restore();
|
|
2895
2895
|
}
|
|
2896
2896
|
isObjectInView(t, i, o, e, s, n = 0) {
|
|
2897
|
-
const a = t.getTransform(), r = i * a.a + o * a.c + a.e,
|
|
2898
|
-
return r + p >= 0 && r - p <= this.canvasWidth &&
|
|
2897
|
+
const a = t.getTransform(), r = i * a.a + o * a.c + a.e, h = i * a.b + o * a.d + a.f, f = Math.sqrt(a.a * a.a + a.b * a.b), l = Math.sqrt(a.c * a.c + a.d * a.d), p = (e / 2 + n) * f, c = (s / 2 + n) * l;
|
|
2898
|
+
return r + p >= 0 && r - p <= this.canvasWidth && h + c >= 0 && h - c <= this.canvasHeight;
|
|
2899
2899
|
}
|
|
2900
2900
|
calculateTransform(t, i, o, e, s, n) {
|
|
2901
|
-
let a = 1, r = 1,
|
|
2902
|
-
const
|
|
2901
|
+
let a = 1, r = 1, h = 1;
|
|
2902
|
+
const f = o / e, l = t / i;
|
|
2903
2903
|
switch (s) {
|
|
2904
2904
|
case "Contain":
|
|
2905
|
-
l >
|
|
2905
|
+
l > f ? h = i / e : h = t / o, a = r = h;
|
|
2906
2906
|
break;
|
|
2907
2907
|
case "Cover":
|
|
2908
|
-
l >
|
|
2908
|
+
l > f ? h = t / o : h = i / e, a = r = h;
|
|
2909
2909
|
break;
|
|
2910
2910
|
case "Fill":
|
|
2911
2911
|
a = t / o, r = i / e;
|
|
2912
2912
|
break;
|
|
2913
2913
|
case "FitWidth":
|
|
2914
|
-
|
|
2914
|
+
h = t / o, a = r = h;
|
|
2915
2915
|
break;
|
|
2916
2916
|
case "FitHeight":
|
|
2917
|
-
|
|
2917
|
+
h = i / e, a = r = h;
|
|
2918
2918
|
break;
|
|
2919
2919
|
case "None":
|
|
2920
2920
|
a = r = 1;
|
|
2921
2921
|
break;
|
|
2922
2922
|
case "ScaleDown":
|
|
2923
|
-
|
|
2923
|
+
h = Math.min(t / o, i / e), h > 1 && (h = 1), a = r = h;
|
|
2924
2924
|
break;
|
|
2925
2925
|
default:
|
|
2926
2926
|
a = r = 1;
|
|
@@ -2956,21 +2956,21 @@ class ci {
|
|
|
2956
2956
|
this.warn("No state for object:", i.id);
|
|
2957
2957
|
return;
|
|
2958
2958
|
}
|
|
2959
|
-
this.frameCount % 60, t.roundRect || (t.roundRect = (X, tt,
|
|
2959
|
+
this.frameCount % 60, t.roundRect || (t.roundRect = (X, tt, R, O, D) => (this.drawRoundRect(t, X, tt, 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, tt = -1 / 0,
|
|
2963
|
+
let X = 1 / 0, tt = -1 / 0, R = 1 / 0, O = -1 / 0;
|
|
2964
2964
|
s.points.forEach((D) => {
|
|
2965
|
-
X = Math.min(X, D.x), tt = Math.max(tt, D.x),
|
|
2966
|
-
}), a === 0 && (a = tt - X), r === 0 && (r =
|
|
2965
|
+
X = Math.min(X, D.x), tt = Math.max(tt, D.x), R = Math.min(R, D.y), O = Math.max(O, D.y);
|
|
2966
|
+
}), a === 0 && (a = tt - X), r === 0 && (r = O - R);
|
|
2967
2967
|
}
|
|
2968
|
-
const
|
|
2968
|
+
const h = (X) => {
|
|
2969
2969
|
if (X)
|
|
2970
2970
|
return X.corner_radius ?? X.cornerRadius;
|
|
2971
|
-
},
|
|
2971
|
+
}, f = h(e) ?? h(n) ?? h(s) ?? h(i.style) ?? h(i.geometry) ?? 0;
|
|
2972
2972
|
let l = { ...s, width: a, height: r };
|
|
2973
|
-
if (delete l.cornerRadius, l.corner_radius =
|
|
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
2976
|
const tt = li(
|
|
@@ -2978,7 +2978,7 @@ class ci {
|
|
|
2978
2978
|
i.weights,
|
|
2979
2979
|
i.bindMatrices,
|
|
2980
2980
|
X,
|
|
2981
|
-
(
|
|
2981
|
+
(R) => this.getGlobalTransform(R)
|
|
2982
2982
|
);
|
|
2983
2983
|
l = { ...l, points: tt };
|
|
2984
2984
|
}
|
|
@@ -2987,34 +2987,34 @@ class ci {
|
|
|
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 tt = e.x !== void 0 ? e.x : ((b = e.transform) == null ? void 0 : b.x) ?? 0,
|
|
2990
|
+
let tt = 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
|
|
2994
|
-
tt += X *
|
|
2993
|
+
const ht = p.offsetX || 0, pt = p.offsetY || 0, at = p.rotation || 0, B = p.scale !== void 0 ? p.scale : 1;
|
|
2994
|
+
tt += X * ht, R += X * pt, O += X * at, D *= Math.pow(B, X), q *= Math.pow(B, X);
|
|
2995
2995
|
} else if (p.type === "Grid") {
|
|
2996
|
-
const
|
|
2997
|
-
tt += nt * Z,
|
|
2996
|
+
const ht = p.cols || Math.ceil(Math.sqrt(p.count)), pt = p.gapX || 0, at = p.gapY || 0, B = Math.floor(X / ht), nt = X % ht, Z = a + pt, Pt = r + at;
|
|
2997
|
+
tt += nt * Z, R += B * Pt;
|
|
2998
2998
|
} else if (p.type === "Radial") {
|
|
2999
|
-
const
|
|
3000
|
-
tt = e.x +
|
|
2999
|
+
const ht = p.radius || 100, pt = p.startAngle || 0, B = (p.endAngle || 360) - pt, nt = p.count > 1 ? B / (B === 360 ? p.count : p.count - 1) : 0, Z = pt + X * nt, Pt = Z * Math.PI / 180;
|
|
3000
|
+
tt = e.x + ht * Math.cos(Pt), R = e.y + ht * Math.sin(Pt), O += Z;
|
|
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
|
-
const
|
|
3006
|
-
if (!this.isObjectInView(t, tt,
|
|
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, tt, R, a, r, ht))
|
|
3007
3007
|
continue;
|
|
3008
3008
|
}
|
|
3009
3009
|
this.debug_objectsRendered++, t.save();
|
|
3010
3010
|
const bt = [], gt = n.blur || ((T = i.style) == null ? void 0 : T.blur);
|
|
3011
3011
|
gt && gt.amount > 0 && bt.push(`blur(${gt.amount}px)`);
|
|
3012
3012
|
const Et = n.effects || ((L = i.style) == null ? void 0 : L.effects) || [];
|
|
3013
|
-
let It = Et.find((
|
|
3014
|
-
It || (It = n.effect || ((P = i.style) == null ? void 0 : P.effect) || Et.find((
|
|
3015
|
-
const St = It, Xt = (St == null ? void 0 : St.isEnabled) !== !1, le = St == null ? void 0 : St.type,
|
|
3016
|
-
Xt && le === "LayerBlur" ? bt.push(`blur(${
|
|
3017
|
-
const et = ((_ = s == null ? void 0 : s.type) == null ? void 0 : _.toLowerCase().includes("image")) || ((E = i.type) == null ? void 0 : E.toLowerCase().includes("image")), mt = n.adjustments && Object.keys(n.adjustments).length > 0 ? n.adjustments : null,
|
|
3013
|
+
let It = Et.find((ht) => ht.isEnabled !== !1 && (ht.type === "BackgroundBlur" || ht.type === "LayerBlur"));
|
|
3014
|
+
It || (It = n.effect || ((P = i.style) == null ? void 0 : P.effect) || Et.find((ht) => ht.isEnabled !== !1));
|
|
3015
|
+
const St = It, Xt = (St == null ? void 0 : St.isEnabled) !== !1, le = St == null ? void 0 : St.type, fe = (St == null ? void 0 : St.radius) ?? 10;
|
|
3016
|
+
Xt && le === "LayerBlur" ? bt.push(`blur(${fe}px)`) : Xt && le === "BackgroundBlur" && (n === i.style && (n = { ...n }), n.fill = { type: "None" });
|
|
3017
|
+
const et = ((_ = s == null ? void 0 : s.type) == null ? void 0 : _.toLowerCase().includes("image")) || ((E = i.type) == null ? void 0 : E.toLowerCase().includes("image")), mt = 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, _t = et ? Rt || mt : mt || Rt, dt = et && !_t ? {
|
|
3018
3018
|
exposure: 0,
|
|
3019
3019
|
contrast: 0,
|
|
3020
3020
|
saturation: 100,
|
|
@@ -3027,13 +3027,13 @@ class ci {
|
|
|
3027
3027
|
hue: 0
|
|
3028
3028
|
} : _t;
|
|
3029
3029
|
if (e && dt && (e.geometry = e.geometry || {}, e.geometry.adjustments = { ...dt }), dt) {
|
|
3030
|
-
const
|
|
3030
|
+
const ht = (dt.exposure || 0) / 100, pt = dt.contrast || 0, at = 1 + (dt.saturation || 0) / 100, B = (dt.temperature || 0) / 200, nt = (dt.tint || 0) / 200, Z = (dt.highlights || 0) / 500, Pt = (dt.shadows || 0) / 500;
|
|
3031
3031
|
let xt = "", kt = "SourceGraphic";
|
|
3032
|
-
if (
|
|
3032
|
+
if (ht !== 0 && (xt += `
|
|
3033
3033
|
<feComponentTransfer in="${kt}" result="exposure">
|
|
3034
|
-
<feFuncR type="linear" slope="1" intercept="${
|
|
3035
|
-
<feFuncG type="linear" slope="1" intercept="${
|
|
3036
|
-
<feFuncB type="linear" slope="1" intercept="${
|
|
3034
|
+
<feFuncR type="linear" slope="1" intercept="${ht}"/>
|
|
3035
|
+
<feFuncG type="linear" slope="1" intercept="${ht}"/>
|
|
3036
|
+
<feFuncB type="linear" slope="1" intercept="${ht}"/>
|
|
3037
3037
|
</feComponentTransfer>`, kt = "exposure"), pt !== 0) {
|
|
3038
3038
|
const Mt = (pt + 100) / 100, $ = 0.5 * (1 - Mt);
|
|
3039
3039
|
xt += `
|
|
@@ -3087,7 +3087,7 @@ class ci {
|
|
|
3087
3087
|
t.globalAlpha = Ft * Dt;
|
|
3088
3088
|
const $t = e.compositeOperation || e.blendMode;
|
|
3089
3089
|
if ($t && $t !== "Normal") {
|
|
3090
|
-
const
|
|
3090
|
+
const ht = $t.toLowerCase();
|
|
3091
3091
|
[
|
|
3092
3092
|
"multiply",
|
|
3093
3093
|
"screen",
|
|
@@ -3117,9 +3117,9 @@ class ci {
|
|
|
3117
3117
|
"xor",
|
|
3118
3118
|
"multiply",
|
|
3119
3119
|
"screen"
|
|
3120
|
-
].includes(
|
|
3120
|
+
].includes(ht) && (t.globalCompositeOperation = ht);
|
|
3121
3121
|
}
|
|
3122
|
-
const
|
|
3122
|
+
const Ot = t, Vt = e.masks || (i.maskedBy ? [{
|
|
3123
3123
|
maskId: i.maskedBy,
|
|
3124
3124
|
inverted: i.maskInverted === !0,
|
|
3125
3125
|
type: i.maskType || "alpha",
|
|
@@ -3128,16 +3128,16 @@ class ci {
|
|
|
3128
3128
|
isVisible: !0
|
|
3129
3129
|
}] : []);
|
|
3130
3130
|
let ie = !1;
|
|
3131
|
-
const me = Vt.filter((
|
|
3131
|
+
const me = Vt.filter((ht) => ht.isVisible !== !1 && o.has(ht.maskId));
|
|
3132
3132
|
if (me.length > 0) {
|
|
3133
|
-
const
|
|
3134
|
-
at && at.visible !== !1 && (ie = !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 =
|
|
3133
|
+
const ht = me[0], pt = o.get(ht.maskId), at = this.objectStates.get(pt.id);
|
|
3134
|
+
at && at.visible !== !1 && (ie = !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(tt), Math.round(
|
|
3136
|
+
t.translate(Math.round(tt), 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
|
|
3140
|
-
t.transform(1 +
|
|
3139
|
+
const ht = Math.tan(ye * Math.PI / 180), pt = Math.tan(Ut * Math.PI / 180);
|
|
3140
|
+
t.transform(1 + ht * pt, pt, 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(
|
|
@@ -3146,15 +3146,15 @@ class ci {
|
|
|
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
3147
|
const se = n.shadow;
|
|
3148
3148
|
if (se && se.isEnabled !== !1) {
|
|
3149
|
-
let
|
|
3150
|
-
(G = (Y = this.artboard) == null ? void 0 : Y.tokens) != null && G.colors && this.artboard.tokens.colors[
|
|
3149
|
+
let ht = se.color || "#000000";
|
|
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
3151
|
const pt = this.normalizeOpacity(se.opacity ?? 100), at = se.spread || 0, nt = (se.blur || 0) + at * 1.5;
|
|
3152
|
-
let Z =
|
|
3153
|
-
if (
|
|
3154
|
-
const kt =
|
|
3152
|
+
let Z = ht;
|
|
3153
|
+
if (ht.startsWith("#")) {
|
|
3154
|
+
const kt = ht.replace("#", ""), At = parseInt(kt.substring(0, 2), 16), Mt = parseInt(kt.substring(2, 4), 16), $ = parseInt(kt.substring(4, 6), 16);
|
|
3155
3155
|
Z = `rgba(${At}, ${Mt}, ${$}, ${pt})`;
|
|
3156
|
-
} else if (
|
|
3157
|
-
const kt =
|
|
3156
|
+
} else if (ht.startsWith("rgba")) {
|
|
3157
|
+
const kt = ht.match(/[\d.]+/g);
|
|
3158
3158
|
if (kt && kt.length >= 4) {
|
|
3159
3159
|
const At = kt[0], Mt = kt[1], $ = kt[2], Wt = kt[3];
|
|
3160
3160
|
Z = `rgba(${At}, ${Mt}, ${$}, ${parseFloat(Wt) * pt})`;
|
|
@@ -3167,33 +3167,33 @@ class ci {
|
|
|
3167
3167
|
const jt = i.liquidFill || ((N = i.style) == null ? void 0 : N.liquidFill);
|
|
3168
3168
|
if (jt && jt.enabled) {
|
|
3169
3169
|
t.save();
|
|
3170
|
-
const
|
|
3170
|
+
const ht = jt.fillLevel ?? 0.5;
|
|
3171
3171
|
t.beginPath();
|
|
3172
|
-
const pt = r / 2 - r *
|
|
3173
|
-
t.rect(-a / 2, pt, a, r *
|
|
3172
|
+
const pt = r / 2 - r * ht;
|
|
3173
|
+
t.rect(-a / 2, pt, 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
|
-
const
|
|
3179
|
-
if (
|
|
3180
|
-
let pt = this.imageCache.get(
|
|
3178
|
+
const ht = s.originalSrc || s.src;
|
|
3179
|
+
if (ht) {
|
|
3180
|
+
let pt = this.imageCache.get(ht);
|
|
3181
3181
|
pt || (pt = new Image(), pt.onload = () => {
|
|
3182
3182
|
this.log(`[ExodeUI] Image loaded successfully, size: ${pt.naturalWidth}x${pt.naturalHeight}`);
|
|
3183
3183
|
}, pt.onerror = (nt) => {
|
|
3184
|
-
console.error("[ExodeUI] Image load failed:", nt, `Src preview: ${
|
|
3185
|
-
}, pt.src =
|
|
3184
|
+
console.error("[ExodeUI] Image load failed:", nt, `Src preview: ${ht.substring(0, 100)}...`);
|
|
3185
|
+
}, pt.src = ht, this.imageCache.set(ht, pt));
|
|
3186
3186
|
const at = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, B = (((J = n.stroke) == null ? void 0 : J.alignment) || "center").toLowerCase();
|
|
3187
|
-
if (at && (B === "outside" || B === "center") && this.applyStrokeAlignment(t, n, l, a, r,
|
|
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
3189
|
const nt = t.globalAlpha, Z = this.createCanvasFill(t, n.fill, a, r);
|
|
3190
|
-
t.fillStyle = Z || n.fill.color || "transparent", t.globalAlpha = nt * this.normalizeOpacity(n.fill.opacity ?? 100),
|
|
3190
|
+
t.fillStyle = Z || n.fill.color || "transparent", t.globalAlpha = nt * 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 = nt, t.restore();
|
|
3191
3191
|
}
|
|
3192
|
-
pt.complete && pt.naturalWidth > 0 ? (
|
|
3192
|
+
pt.complete && pt.naturalWidth > 0 ? (f !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.clip(), t.drawImage(pt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(pt, -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
|
-
const
|
|
3196
|
-
if (
|
|
3195
|
+
const ht = s.svgContent;
|
|
3196
|
+
if (ht) {
|
|
3197
3197
|
const pt = n.palette || [], at = n.fill, B = n.stroke, nt = at ? this.normalizeOpacity(at.opacity ?? 100) : 1, Z = (at == null ? void 0 : at.type) === "Solid" && (!B || B.isEnabled === !1 || B.type === "Solid" && B.color === at.color), Pt = at && at.type !== "None" ? Z ? "monochrome" : at.type === "Solid" ? (at.color || "") + "|opacity:" + nt : JSON.stringify(at.stops || []) + "|opacity:" + nt : "", xt = B && B.isEnabled !== !1 && (B.width || 0) > 0 ? Z ? [
|
|
3198
3198
|
"monochrome",
|
|
3199
3199
|
B.width || 0,
|
|
@@ -3224,7 +3224,7 @@ class ci {
|
|
|
3224
3224
|
let At = this.imageCache.get(kt);
|
|
3225
3225
|
if (!At) {
|
|
3226
3226
|
At = new Image(), At.crossOrigin = "anonymous";
|
|
3227
|
-
let $ =
|
|
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);
|
|
@@ -3288,7 +3288,7 @@ class ci {
|
|
|
3288
3288
|
`stroke:${st}`
|
|
3289
3289
|
);
|
|
3290
3290
|
let vt = s.width || a || 100, Yt = s.height || r || 100;
|
|
3291
|
-
const Qt =
|
|
3291
|
+
const Qt = ht.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
|
|
3292
3292
|
if (Qt) {
|
|
3293
3293
|
const zt = parseFloat(Qt[1]), oe = parseFloat(Qt[2]);
|
|
3294
3294
|
!isNaN(zt) && !isNaN(oe) && (vt = zt, Yt = oe);
|
|
@@ -3299,38 +3299,38 @@ class ci {
|
|
|
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}`);
|
|
3300
3300
|
const Le = B.lineJoin || "round";
|
|
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
|
-
const
|
|
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,
|
|
3304
|
+
const zt = Math.max(0, Math.min(1, Re)), oe = Math.max(0, Math.min(1, Oe));
|
|
3305
3305
|
this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${zt}, End: ${oe}`);
|
|
3306
3306
|
const we = (vt + Yt) * 2, Be = (Fe % 1 + 1) % 1, We = ($e % 1 + 1) % 1;
|
|
3307
3307
|
let de = "", ce = 0;
|
|
3308
3308
|
if (zt >= oe)
|
|
3309
3309
|
de = `0 ${we}`, ce = 0;
|
|
3310
3310
|
else {
|
|
3311
|
-
const
|
|
3312
|
-
ce = -(we * (zt + Be + We)), de = `${
|
|
3311
|
+
const he = we * (oe - zt), ke = we - he;
|
|
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}`);
|
|
3315
3315
|
} else if (B.dashArray && B.dashArray.length > 0) {
|
|
3316
3316
|
const zt = B.dashArray.join(" ");
|
|
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
|
-
if (!/\bstroke\s*=\s*["']/i.test(
|
|
3319
|
+
if (!/\bstroke\s*=\s*["']/i.test(ht) && !new RegExp("(?<![a-z-])stroke\\s*:", "i").test(ht)) {
|
|
3320
3320
|
let zt = "", oe = "";
|
|
3321
3321
|
if (Ye) {
|
|
3322
|
-
const de = s.width || a || 100, ce = s.height || r || 100,
|
|
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 ${
|
|
3324
|
+
zt = ` stroke-dasharray="0 ${he}"`, oe = ' stroke-dashoffset="0"';
|
|
3325
3325
|
else {
|
|
3326
|
-
const De =
|
|
3326
|
+
const De = he * (Xe - ke), He = he - De, H = -(he * (ke + Ve + Ne));
|
|
3327
3327
|
zt = ` stroke-dasharray="${De} ${He}"`, oe = ` stroke-dashoffset="${H}"`;
|
|
3328
3328
|
}
|
|
3329
3329
|
} else (x = B.dashArray) != null && x.length && (zt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (oe = ` stroke-dashoffset="${B.dashOffset}"`));
|
|
3330
3330
|
const we = ` stroke-linecap="${B.lineCap || "round"}"`, Be = ` stroke-linejoin="${B.lineJoin || "round"}"`, We = `stroke="${st}" stroke-width="${Nt}" stroke-opacity="${rt}"${we}${Be}${zt}${oe}`;
|
|
3331
3331
|
$ = $.replace(
|
|
3332
3332
|
/(<svg[^>]*>)(\s*(?:<defs>[\s\S]*?<\/defs>)?)/i,
|
|
3333
|
-
(de, ce,
|
|
3333
|
+
(de, ce, he) => `${ce}${he}<g ${We}>`
|
|
3334
3334
|
), $ = $.replace(/<\/svg>/i, "</g></svg>");
|
|
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"));
|
|
@@ -3351,37 +3351,37 @@ class ci {
|
|
|
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);
|
|
3354
|
-
} else
|
|
3354
|
+
} else f !== 0 ? (t.save(), this.drawRoundRect(t, -$ / 2, -Wt / 2, $, Wt, f), t.clip(), t.drawImage(Mt, -$ / 2, -Wt / 2, $, Wt), t.restore()) : t.drawImage(Mt, -$ / 2, -Wt / 2, $, Wt);
|
|
3355
3355
|
}
|
|
3356
3356
|
}
|
|
3357
3357
|
} else if (l.type === "LineGraph")
|
|
3358
3358
|
this.renderLineGraph(t, l, a, r);
|
|
3359
3359
|
else if (i.type === "Shape") {
|
|
3360
|
-
if (this.applyPath(t, l, a, r,
|
|
3361
|
-
const
|
|
3360
|
+
if (this.applyPath(t, l, a, r, f), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
|
|
3361
|
+
const ht = t.globalAlpha;
|
|
3362
3362
|
if (((F = n.fill) == null ? void 0 : F.type) === "Image" && (n.fill.originalSrc || n.fill.src)) {
|
|
3363
3363
|
const pt = n.fill.originalSrc || n.fill.src;
|
|
3364
3364
|
let at = this.imageCache.get(pt);
|
|
3365
|
-
at || (at = new Image(), at.src = pt, this.imageCache.set(pt, at)), at.complete && at.naturalWidth > 0 && (t.save(), this.applyPath(t, l, a, r,
|
|
3365
|
+
at || (at = new Image(), at.src = pt, this.imageCache.set(pt, at)), at.complete && at.naturalWidth > 0 && (t.save(), this.applyPath(t, l, a, r, f), t.clip(), this.renderFittedImage(t, at, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
|
|
3366
3366
|
} else {
|
|
3367
3367
|
const pt = this.createCanvasFill(t, n.fill, a, r);
|
|
3368
|
-
t.fillStyle = pt || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha =
|
|
3368
|
+
t.fillStyle = pt || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = ht * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, l, a, r, f), t.fill();
|
|
3369
3369
|
}
|
|
3370
|
-
t.globalAlpha =
|
|
3370
|
+
t.globalAlpha = ht;
|
|
3371
3371
|
}
|
|
3372
|
-
t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, l, a, r,
|
|
3372
|
+
t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
|
|
3373
3373
|
} else if (i.type === "Frame" || i.type === "Group" && !i.isStructuralGroup) {
|
|
3374
|
-
const
|
|
3375
|
-
if (t.save(), t.beginPath(), this.drawRoundRect(t, -
|
|
3376
|
-
const B = t.globalAlpha, nt = this.createCanvasFill(t, n.fill,
|
|
3374
|
+
const ht = e.width ?? s.width ?? i.width ?? a, pt = e.height ?? s.height ?? i.height ?? r, at = f;
|
|
3375
|
+
if (t.save(), t.beginPath(), this.drawRoundRect(t, -ht / 2, -pt / 2, ht, pt, at), n.fill && n.fill.type !== "None") {
|
|
3376
|
+
const B = t.globalAlpha, nt = this.createCanvasFill(t, n.fill, ht, pt);
|
|
3377
3377
|
t.fillStyle = nt || n.fill.color || "transparent", t.globalAlpha = B * this.normalizeOpacity(n.fill.opacity ?? 100), t.fill(), t.globalAlpha = B;
|
|
3378
3378
|
}
|
|
3379
3379
|
if (t.restore(), n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1) {
|
|
3380
3380
|
const B = { type: "Rectangle" };
|
|
3381
|
-
this.applyStrokeAlignment(t, n, B,
|
|
3381
|
+
this.applyStrokeAlignment(t, n, B, ht, pt, at, D, q);
|
|
3382
3382
|
}
|
|
3383
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,
|
|
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
3385
|
const pt = i.type === "Frame", at = i.clipsContent !== void 0 ? i.clipsContent : i.clipContent !== void 0 ? i.clipContent : pt;
|
|
3386
3386
|
if (t.save(), at) {
|
|
3387
3387
|
t.beginPath();
|
|
@@ -3481,15 +3481,15 @@ class ci {
|
|
|
3481
3481
|
this.applyPath(this.maskCtx, nt.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill();
|
|
3482
3482
|
this.maskCtx.restore();
|
|
3483
3483
|
}
|
|
3484
|
-
}),
|
|
3484
|
+
}), Ot.save(), Ot.setTransform(1, 0, 0, 1, 0, 0);
|
|
3485
3485
|
const at = i.maskBlendMode || i.blendMode;
|
|
3486
|
-
at && at !== "Normal" && (
|
|
3486
|
+
at && at !== "Normal" && (Ot.globalCompositeOperation = at.toLowerCase()), Ot.drawImage(this.maskBuffer, 0, 0), Ot.restore(), Ot.restore();
|
|
3487
3487
|
} else
|
|
3488
3488
|
t.restore();
|
|
3489
3489
|
}
|
|
3490
3490
|
}
|
|
3491
|
-
_renderText(t, i, o, e, s, n, a, r = !1,
|
|
3492
|
-
var yt, bt, gt, Et, It, St, Xt, le,
|
|
3491
|
+
_renderText(t, i, o, e, s, n, a, r = !1, h = !1, f = 1, l = 1) {
|
|
3492
|
+
var yt, bt, gt, Et, It, St, Xt, le, fe;
|
|
3493
3493
|
let p = o.text || "";
|
|
3494
3494
|
if (o.textInputId && !r) {
|
|
3495
3495
|
const et = this.inputs.get(o.textInputId);
|
|
@@ -3498,8 +3498,8 @@ class ci {
|
|
|
3498
3498
|
if (o.svgPath) {
|
|
3499
3499
|
const et = o.svgPath;
|
|
3500
3500
|
t.save();
|
|
3501
|
-
const mt = ((yt = e == null ? void 0 : e.fill) == null ? void 0 : yt.color) || "#000000",
|
|
3502
|
-
t.fillStyle = mt, t.globalAlpha *=
|
|
3501
|
+
const mt = ((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 ? (gt = e == null ? void 0 : e.fill) == null ? void 0 : gt.opacity : 1;
|
|
3502
|
+
t.fillStyle = mt, t.globalAlpha *= Rt;
|
|
3503
3503
|
const _t = new Path2D(et);
|
|
3504
3504
|
t.fill(_t), t.restore();
|
|
3505
3505
|
return;
|
|
@@ -3559,39 +3559,39 @@ class ci {
|
|
|
3559
3559
|
let j = G.height, X = n, tt = a;
|
|
3560
3560
|
if (X === 0 || tt === 0 || X >= 1e5) {
|
|
3561
3561
|
let et = 0, mt = 0;
|
|
3562
|
-
const
|
|
3562
|
+
const Rt = G.fullText || c;
|
|
3563
3563
|
(N || []).forEach((_t) => {
|
|
3564
3564
|
const dt = _t.text || "", Ft = t.measureText(dt).width + (dt.length > 0 ? (dt.length - 1) * T : 0);
|
|
3565
|
-
Ft > et && (et = Ft), mt += dt.length, mt <
|
|
3566
|
-
` ||
|
|
3565
|
+
Ft > et && (et = Ft), mt += dt.length, mt < Rt.length && (Rt[mt] === `
|
|
3566
|
+
` || Rt[mt] === "\r") && (mt++, Rt[mt - 1] === "\r" && Rt[mt] === `
|
|
3567
3567
|
` && mt++);
|
|
3568
3568
|
}), (X === 0 || X >= 1e5) && (X = et), tt === 0 && (tt = j || 0);
|
|
3569
3569
|
}
|
|
3570
|
-
let
|
|
3571
|
-
a > 0 && a > j && (I === "top" ?
|
|
3572
|
-
let
|
|
3570
|
+
let R = -j / 2;
|
|
3571
|
+
a > 0 && a > j && (I === "top" ? R = -a / 2 : I === "middle" || I === "center" ? R = -j / 2 : I === "bottom" && (R = a / 2 - j)), R += F;
|
|
3572
|
+
let O = null, D = 0;
|
|
3573
3573
|
if (o.pathId && this.artboard) {
|
|
3574
3574
|
const et = this.artboard.objects.find((mt) => mt.id === o.pathId);
|
|
3575
3575
|
if (et && et.type === "Shape" && ((Xt = et.geometry) == null ? void 0 : Xt.type) === "Path") {
|
|
3576
|
-
const mt = this.objectStates.get(et.id),
|
|
3577
|
-
|
|
3576
|
+
const mt = this.objectStates.get(et.id), Rt = mt != null && mt.geometry ? this.deepMerge(et.geometry, mt.geometry) : et.geometry, _t = (mt == null ? void 0 : mt.scale_x) !== void 0 ? (et.width || 0) * mt.scale_x : et.width || 0, dt = (mt == null ? void 0 : mt.scale_y) !== void 0 ? (et.height || 0) * mt.scale_y : et.height || 0;
|
|
3577
|
+
O = { geo: Rt, obj: et, w: _t, h: dt }, D = this.getPerimeter(Rt, _t, dt);
|
|
3578
3578
|
}
|
|
3579
3579
|
}
|
|
3580
3580
|
const q = (et, mt) => {
|
|
3581
3581
|
var _t, dt;
|
|
3582
3582
|
if (T === 0 && (!o.enableSegments || !((_t = o.segments) != null && _t.length))) return t.measureText(et).width;
|
|
3583
|
-
let
|
|
3583
|
+
let Rt = 0;
|
|
3584
3584
|
for (let Ft = 0; Ft < et.length; Ft++) {
|
|
3585
3585
|
const Dt = mt + Ft;
|
|
3586
3586
|
let $t = 0;
|
|
3587
3587
|
if (o.enableSegments === !0 && ((dt = o.segments) == null ? void 0 : dt.length) > 0) {
|
|
3588
|
-
let
|
|
3588
|
+
let Ot = 0, Vt = null;
|
|
3589
3589
|
for (const ie of o.segments) {
|
|
3590
|
-
if (Dt <
|
|
3590
|
+
if (Dt < Ot + (ie.text || "").length) {
|
|
3591
3591
|
Vt = ie;
|
|
3592
3592
|
break;
|
|
3593
3593
|
}
|
|
3594
|
-
|
|
3594
|
+
Ot += (ie.text || "").length;
|
|
3595
3595
|
}
|
|
3596
3596
|
if (Vt) {
|
|
3597
3597
|
t.save();
|
|
@@ -3602,16 +3602,16 @@ class ci {
|
|
|
3602
3602
|
$t = t.measureText(et[Ft]).width;
|
|
3603
3603
|
} else
|
|
3604
3604
|
$t = t.measureText(et[Ft]).width;
|
|
3605
|
-
|
|
3605
|
+
Rt += $t + T;
|
|
3606
3606
|
}
|
|
3607
|
-
return
|
|
3608
|
-
}, ot = (et, mt,
|
|
3607
|
+
return Rt - (et.length > 0 ? T : 0);
|
|
3608
|
+
}, ot = (et, mt, Rt, _t, dt) => {
|
|
3609
3609
|
var me, ye;
|
|
3610
3610
|
const Dt = (dt === 0 || c[dt - 1] === `
|
|
3611
|
-
` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, $t = (!r ||
|
|
3611
|
+
` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, $t = (!r || h) && (i.behaviors || []).some(
|
|
3612
3612
|
(Ut) => Ut.enabled && (Ut.type.toString().includes("Text") || ["Typewriter", "Scramble", "Wave", "Bounce", "GlitchText", "Reveal3D", "RevealSlide", "RevealBlur"].includes(Ut.type))
|
|
3613
|
-
),
|
|
3614
|
-
if (
|
|
3613
|
+
), Ot = !o.pathId && !$t && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Vt = o.baselineShift || 0, ie = Rt + Vt;
|
|
3614
|
+
if (Ot)
|
|
3615
3615
|
t.font = M, _t ? t.strokeText(et, mt + Dt, ie) : t.fillText(et, mt + Dt, ie);
|
|
3616
3616
|
else {
|
|
3617
3617
|
const Ut = q(et, dt);
|
|
@@ -3632,9 +3632,9 @@ class ci {
|
|
|
3632
3632
|
}
|
|
3633
3633
|
}
|
|
3634
3634
|
let se = o.pathOffset || 0;
|
|
3635
|
-
o.pathId && D > 0 &&
|
|
3635
|
+
o.pathId && D > 0 && O && (k === "center" ? se += D / 2 - Ut / 2 : k === "right" && (se += D - Ut));
|
|
3636
3636
|
let jt = Se;
|
|
3637
|
-
const
|
|
3637
|
+
const ht = r && !h ? [] : ((me = i.behaviors) == null ? void 0 : me.filter(
|
|
3638
3638
|
(pt) => [
|
|
3639
3639
|
U.Typewriter,
|
|
3640
3640
|
U.Scramble,
|
|
@@ -3671,7 +3671,7 @@ class ci {
|
|
|
3671
3671
|
let at = et[pt];
|
|
3672
3672
|
const B = dt + pt;
|
|
3673
3673
|
let nt = 0, Z = 0, Pt = 1, xt = 1, kt = 0, At = 1, Mt = at;
|
|
3674
|
-
|
|
3674
|
+
ht.forEach((ut) => {
|
|
3675
3675
|
const ct = ut.settings || {}, Ct = ct.strength || 1, rt = Date.now();
|
|
3676
3676
|
if (ut.type === U.Typewriter)
|
|
3677
3677
|
this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.05) < 0 && (At = 0);
|
|
@@ -3684,7 +3684,7 @@ class ci {
|
|
|
3684
3684
|
V < 1 && (Z -= Math.abs(Math.sin(V * Math.PI)) * (ct.height || 50) * Ct);
|
|
3685
3685
|
} else if (ut.type === U.TextTrail) {
|
|
3686
3686
|
const V = this.pointerHistory[Math.max(0, this.pointerHistory.length - 1 - B * (ct.delay || 5))];
|
|
3687
|
-
V && (nt += (V.x - (s.x + jt)) * Ct * 0.2, Z += (V.y - (s.y +
|
|
3687
|
+
V && (nt += (V.x - (s.x + jt)) * Ct * 0.2, Z += (V.y - (s.y + Rt + Z)) * Ct * 0.2);
|
|
3688
3688
|
} else if (ut.type === U.Reveal3D) {
|
|
3689
3689
|
const V = Math.max(0, Math.min(1, this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.1)));
|
|
3690
3690
|
Pt *= V, xt *= V, At = V;
|
|
@@ -3736,7 +3736,7 @@ class ci {
|
|
|
3736
3736
|
} else if (ut.type === U.TextMagnet) {
|
|
3737
3737
|
const V = this.pointerHistory[this.pointerHistory.length - 1];
|
|
3738
3738
|
if (V) {
|
|
3739
|
-
const st = V.x - (s.x + jt), it = V.y - (s.y +
|
|
3739
|
+
const st = V.x - (s.x + jt), it = V.y - (s.y + Rt);
|
|
3740
3740
|
kt = Math.atan2(it, st);
|
|
3741
3741
|
}
|
|
3742
3742
|
} else if (ut.type === U.TextPerspective) {
|
|
@@ -3791,21 +3791,21 @@ class ci {
|
|
|
3791
3791
|
const te = t.globalAlpha;
|
|
3792
3792
|
t.globalAlpha *= At, t.save();
|
|
3793
3793
|
const Jt = t.measureText(Mt).width;
|
|
3794
|
-
if (
|
|
3795
|
-
const ut = jt - Se + Jt / 2, Ct = (se + ut) / D, rt = this.getPointOnPath(
|
|
3794
|
+
if (O && D > 0) {
|
|
3795
|
+
const ut = jt - Se + Jt / 2, Ct = (se + ut) / D, rt = this.getPointOnPath(O.geo, O.w, O.h, Math.abs(Ct % 1)), V = rt.angle, st = Rt + Z + (o.pathOffsetY || 0), it = o.pathSide === "right" ? -1 : 1, vt = Math.cos(V + Math.PI / 2) * st * it, Yt = Math.sin(V + Math.PI / 2) * st * it;
|
|
3796
3796
|
t.translate(rt.x + vt + nt, rt.y + Yt), t.rotate(V + kt + (it === -1 ? Math.PI : 0));
|
|
3797
3797
|
} else
|
|
3798
|
-
t.translate(jt + nt + Jt / 2,
|
|
3799
|
-
if (t.scale(Pt, xt), $ && !r && !
|
|
3798
|
+
t.translate(jt + nt + Jt / 2, Rt + Z), kt !== 0 && t.rotate(kt);
|
|
3799
|
+
if (t.scale(Pt, xt), $ && !r && !h) {
|
|
3800
3800
|
const ut = this.createCanvasFill(t, $, X, tt);
|
|
3801
3801
|
t.fillStyle = ut || $.color || "#000000";
|
|
3802
|
-
} else if (!r && !
|
|
3802
|
+
} else if (!r && !h) {
|
|
3803
3803
|
const ut = this.createCanvasFill(t, e.fill, X, tt);
|
|
3804
3804
|
t.fillStyle = ut || e.fill.color || "#000000";
|
|
3805
3805
|
}
|
|
3806
3806
|
if (At > 0)
|
|
3807
|
-
if (r ||
|
|
3808
|
-
const ut =
|
|
3807
|
+
if (r || h) {
|
|
3808
|
+
const ut = h ? "#000000" : this.createCanvasFill(t, e.fill, X, tt);
|
|
3809
3809
|
t.fillStyle = ut || e.fill.color || "#ffffff", t.fillText(Mt, -Jt / 2, 0);
|
|
3810
3810
|
} else _t ? t.strokeText(Mt, -Jt / 2, 0) : t.fillText(Mt, -Jt / 2, 0);
|
|
3811
3811
|
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;
|
|
@@ -3813,17 +3813,17 @@ class ci {
|
|
|
3813
3813
|
}
|
|
3814
3814
|
};
|
|
3815
3815
|
if (r) {
|
|
3816
|
-
let et = 0, mt =
|
|
3817
|
-
(N || []).forEach((
|
|
3818
|
-
const _t =
|
|
3816
|
+
let et = 0, mt = R;
|
|
3817
|
+
(N || []).forEach((Rt) => {
|
|
3818
|
+
const _t = Rt.text || "", dt = c.indexOf(_t, et);
|
|
3819
3819
|
dt !== -1 && (et = dt);
|
|
3820
3820
|
let Ft = -X / 2;
|
|
3821
3821
|
k === "center" ? Ft = 0 : k === "right" && (Ft = X / 2), ot(_t, Ft, mt, !1, et), et += _t.length, mt += A;
|
|
3822
3822
|
});
|
|
3823
|
-
} else if (
|
|
3824
|
-
let et = 0, mt =
|
|
3825
|
-
(N || []).forEach((
|
|
3826
|
-
const _t =
|
|
3823
|
+
} else if (h) {
|
|
3824
|
+
let et = 0, mt = R;
|
|
3825
|
+
(N || []).forEach((Rt) => {
|
|
3826
|
+
const _t = Rt.text || "";
|
|
3827
3827
|
let dt = -X / 2;
|
|
3828
3828
|
k === "center" ? dt = 0 : k === "right" && (dt = X / 2), ot(_t, dt, mt, !1, et), et += _t.length, et < c.length && (c[et] === `
|
|
3829
3829
|
` || c[et] === "\r") && (et++, c[et - 1] === "\r" && c[et] === `
|
|
@@ -3831,44 +3831,44 @@ class ci {
|
|
|
3831
3831
|
});
|
|
3832
3832
|
} else {
|
|
3833
3833
|
if (e.fill) {
|
|
3834
|
-
const mt = t.globalAlpha,
|
|
3835
|
-
t.fillStyle =
|
|
3834
|
+
const mt = t.globalAlpha, Rt = this.createCanvasFill(t, e.fill, X, tt);
|
|
3835
|
+
t.fillStyle = Rt || e.fill.color || "#000000", t.globalAlpha = mt * this.normalizeOpacity(e.fill.opacity ?? 100);
|
|
3836
3836
|
const _t = G.fullText || (o.enableSegments ? (o.segments || []).map((Dt) => {
|
|
3837
3837
|
let $t = Dt.text || "";
|
|
3838
|
-
const
|
|
3839
|
-
return
|
|
3838
|
+
const Ot = Dt.textCase || o.textCase || "none";
|
|
3839
|
+
return Ot === "uppercase" ? $t.toUpperCase() : Ot === "lowercase" ? $t.toLowerCase() : Ot === "capitalize" ? $t.replace(/\b\w/g, (Vt) => Vt.toUpperCase()) : $t;
|
|
3840
3840
|
}).join("") : c);
|
|
3841
|
-
let dt = 0, Ft =
|
|
3841
|
+
let dt = 0, Ft = R;
|
|
3842
3842
|
(N || []).forEach((Dt) => {
|
|
3843
3843
|
const $t = Dt.text || "";
|
|
3844
|
-
let
|
|
3845
|
-
k === "center" ?
|
|
3844
|
+
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 < _t.length && (_t[dt] === `
|
|
3846
3846
|
` || _t[dt] === "\r") && (_ > 0 && (Ft += _), dt++, _t[dt - 1] === "\r" && _t[dt] === `
|
|
3847
3847
|
` && dt++);
|
|
3848
3848
|
}), t.globalAlpha = mt;
|
|
3849
3849
|
}
|
|
3850
3850
|
const et = o.paragraphRule;
|
|
3851
|
-
if (et && (((le = et.top) == null ? void 0 : le.width) > 0 || ((
|
|
3851
|
+
if (et && (((le = et.top) == null ? void 0 : le.width) > 0 || ((fe = et.bottom) == null ? void 0 : fe.width) > 0)) {
|
|
3852
3852
|
let mt = 0;
|
|
3853
|
-
(N || []).forEach((
|
|
3853
|
+
(N || []).forEach((Rt, _t) => {
|
|
3854
3854
|
var Dt, $t;
|
|
3855
3855
|
const Ft = mt === 0 || mt < c.length && (c[mt] === `
|
|
3856
3856
|
` || c[mt] === "\r");
|
|
3857
3857
|
if (Ft && _t > 0 && mt++, Ft) {
|
|
3858
3858
|
if (((Dt = et.top) == null ? void 0 : Dt.width) > 0) {
|
|
3859
|
-
const
|
|
3859
|
+
const Ot = R + _t * A - et.top.offset;
|
|
3860
3860
|
t.strokeStyle = et.top.color || "#000000", t.lineWidth = et.top.width, t.beginPath();
|
|
3861
3861
|
const Vt = -n / 2 + A * 0.2;
|
|
3862
|
-
t.moveTo(Vt,
|
|
3862
|
+
t.moveTo(Vt, Ot), t.lineTo(n / 2 - A * 0.2, Ot), t.stroke();
|
|
3863
3863
|
}
|
|
3864
3864
|
if ((($t = et.bottom) == null ? void 0 : $t.width) > 0) {
|
|
3865
|
-
const
|
|
3865
|
+
const Ot = R + (_t + 1) * A - et.bottom.offset;
|
|
3866
3866
|
t.strokeStyle = et.bottom.color || "#000000", t.lineWidth = et.bottom.width, t.beginPath();
|
|
3867
3867
|
const Vt = -n / 2 + A * 0.2;
|
|
3868
|
-
t.moveTo(Vt,
|
|
3868
|
+
t.moveTo(Vt, Ot), t.lineTo(n / 2 - A * 0.2, Ot), t.stroke();
|
|
3869
3869
|
}
|
|
3870
3870
|
}
|
|
3871
|
-
mt += (
|
|
3871
|
+
mt += (Rt.text || "").length;
|
|
3872
3872
|
});
|
|
3873
3873
|
}
|
|
3874
3874
|
if (e.stroke && e.stroke.width > 0) {
|
|
@@ -3876,12 +3876,12 @@ class ci {
|
|
|
3876
3876
|
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
3877
|
let _t = 1;
|
|
3878
3878
|
if (this.rootTransform) {
|
|
3879
|
-
const Dt = t.getTransform(), $t = Math.sqrt(Dt.a * Dt.a + Dt.b * Dt.b) || 1,
|
|
3879
|
+
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
3880
|
_t = $t / Vt;
|
|
3881
3881
|
} else
|
|
3882
|
-
_t = (Math.abs(
|
|
3882
|
+
_t = (Math.abs(f) + Math.abs(l)) / 2 || 1;
|
|
3883
3883
|
t.lineWidth = (e.stroke.width || 1) / (_t || 1), t.globalAlpha = mt * this.normalizeOpacity(e.stroke.opacity ?? 100);
|
|
3884
|
-
let dt = 0, Ft =
|
|
3884
|
+
let dt = 0, Ft = R;
|
|
3885
3885
|
(N || []).forEach((Dt) => {
|
|
3886
3886
|
let $t = -X / 2;
|
|
3887
3887
|
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] === `
|
|
@@ -3893,22 +3893,22 @@ class ci {
|
|
|
3893
3893
|
}
|
|
3894
3894
|
applyStrokeAlignment(t, i, o, e, s, n, a = 1, r = 1) {
|
|
3895
3895
|
if (!i.stroke || i.stroke.width <= 0 || i.stroke.isEnabled === !1) return;
|
|
3896
|
-
const
|
|
3897
|
-
let
|
|
3896
|
+
const h = i.stroke;
|
|
3897
|
+
let f = 1;
|
|
3898
3898
|
if (this.rootTransform) {
|
|
3899
3899
|
const S = t.getTransform(), C = Math.sqrt(S.a * S.a + S.b * S.b) || 1, w = this.rootTransform, M = Math.sqrt(w.a * w.a + w.b * w.b) || 1;
|
|
3900
|
-
|
|
3900
|
+
f = C / M;
|
|
3901
3901
|
} else
|
|
3902
|
-
|
|
3903
|
-
const l = (
|
|
3904
|
-
if (t.save(), i.fill && i.fill.type !== "None" && i.fill.isEnabled !== !1 && i.fill.opacity !== 0 && i.fill.color !== "transparent" && i.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0),
|
|
3905
|
-
const S = this.createCanvasFill(t,
|
|
3906
|
-
S ? t.strokeStyle = S : t.strokeStyle =
|
|
3902
|
+
f = (Math.abs(a) + Math.abs(r)) / 2 || 1;
|
|
3903
|
+
const l = (h.width || 1) / (f || 1), p = (h.alignment || "center").toLowerCase();
|
|
3904
|
+
if (t.save(), i.fill && i.fill.type !== "None" && i.fill.isEnabled !== !1 && i.fill.opacity !== 0 && i.fill.color !== "transparent" && i.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0), h.fill) {
|
|
3905
|
+
const S = this.createCanvasFill(t, h.fill, e, s);
|
|
3906
|
+
S ? t.strokeStyle = S : t.strokeStyle = h.color || "#000000";
|
|
3907
3907
|
} else
|
|
3908
|
-
t.strokeStyle =
|
|
3908
|
+
t.strokeStyle = h.color || "#000000";
|
|
3909
3909
|
const d = t.globalAlpha;
|
|
3910
|
-
t.globalAlpha = d * this.normalizeOpacity(
|
|
3911
|
-
const u =
|
|
3910
|
+
t.globalAlpha = d * this.normalizeOpacity(h.opacity ?? 100), t.lineWidth = l, t.lineCap = h.lineCap || "round", t.lineJoin = h.lineJoin || "round", h.miterLimit !== void 0 && (t.miterLimit = h.miterLimit);
|
|
3911
|
+
const u = h.trimStart ?? 0, v = h.trimEnd ?? 1, b = h.trimOffset ?? 0, m = h.dashOffset ?? 0, y = h.dashArray || [];
|
|
3912
3912
|
if (u !== 0 || v !== 1 || b !== 0) {
|
|
3913
3913
|
const S = this.getPerimeter(o, e, s);
|
|
3914
3914
|
if (S > 0) {
|
|
@@ -3924,7 +3924,7 @@ class ci {
|
|
|
3924
3924
|
}
|
|
3925
3925
|
}
|
|
3926
3926
|
} else y.length > 0 && (t.setLineDash(y), t.lineDashOffset = m);
|
|
3927
|
-
(o == null ? void 0 : o.type) === "Line" || e === 0 || s === 0 ? (this.applyPath(t, o, e, s, n), t.stroke()) : p === "inside" ? (t.lineWidth = l * 2, t.save(), this.applyPath(t, o, e, s, n), t.clip(), t.stroke(), t.restore()) : p === "outside" ? (t.lineWidth = l * 2,
|
|
3927
|
+
(o == null ? void 0 : o.type) === "Line" || e === 0 || s === 0 ? (this.applyPath(t, o, e, s, n), t.stroke()) : p === "inside" ? (t.lineWidth = l * 2, t.save(), this.applyPath(t, o, e, s, n), t.clip(), t.stroke(), t.restore()) : p === "outside" ? (t.lineWidth = l * 2, t.save(), t.beginPath(), t.rect(-99999, -99999, 199998, 199998), this._tracePath(t, o, e, s, n), t.clip("evenodd"), this.applyPath(t, o, e, s, n), t.stroke(), t.restore()) : (t.lineWidth = l, this.applyPath(t, o, e, s, n), t.stroke()), t.restore();
|
|
3928
3928
|
}
|
|
3929
3929
|
getPerimeter(t, i, o) {
|
|
3930
3930
|
switch (this.ensurePathPoints(t), t == null ? void 0 : t.type) {
|
|
@@ -3933,12 +3933,12 @@ class ci {
|
|
|
3933
3933
|
case "Ellipse": {
|
|
3934
3934
|
const e = Math.abs(i) / 2, s = Math.abs(o) / 2, n = Math.abs(t.sweepAngle ?? 360), a = t.ratio || 0, r = Math.PI * (3 * (e + s) - Math.sqrt((3 * e + s) * (e + 3 * s)));
|
|
3935
3935
|
if (n >= 360 && a <= 0) return r;
|
|
3936
|
-
let
|
|
3936
|
+
let h = n / 360 * r;
|
|
3937
3937
|
if (a > 0) {
|
|
3938
|
-
const
|
|
3939
|
-
|
|
3940
|
-
} else n < 360 && (
|
|
3941
|
-
return isNaN(
|
|
3938
|
+
const f = Math.PI * (3 * (e * a + s * a) - Math.sqrt((3 * e * a + s * a) * (e * a + 3 * s * a)));
|
|
3939
|
+
h += n / 360 * f, n < 360 && (h += 2 * Math.sqrt((e - e * a) ** 2 + (s - s * a) ** 2));
|
|
3940
|
+
} else n < 360 && (h += 2 * Math.max(e, s));
|
|
3941
|
+
return isNaN(h) ? 0 : h;
|
|
3942
3942
|
}
|
|
3943
3943
|
case "Line":
|
|
3944
3944
|
return t.length || Math.sqrt(i * i + o * o);
|
|
@@ -3957,22 +3957,22 @@ class ci {
|
|
|
3957
3957
|
if (e.length < 2) return t.length || 0;
|
|
3958
3958
|
let s = 0, n = e[0].x, a = e[0].y;
|
|
3959
3959
|
for (let r = 1; r < e.length; r++) {
|
|
3960
|
-
const
|
|
3961
|
-
if (
|
|
3962
|
-
n =
|
|
3960
|
+
const h = e[r];
|
|
3961
|
+
if (h.moveTo) {
|
|
3962
|
+
n = h.x, a = h.y;
|
|
3963
3963
|
continue;
|
|
3964
3964
|
}
|
|
3965
|
-
const
|
|
3966
|
-
if (p !== void 0 ||
|
|
3967
|
-
|
|
3965
|
+
const f = n, l = a, p = e[r - 1].out_x, c = e[r - 1].out_y;
|
|
3966
|
+
if (p !== void 0 || h.in_x !== void 0 ? s += this.getBezierLength(
|
|
3967
|
+
f,
|
|
3968
3968
|
l,
|
|
3969
|
-
p ??
|
|
3969
|
+
p ?? f,
|
|
3970
3970
|
c ?? l,
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
) : s += Math.sqrt((
|
|
3971
|
+
h.in_x ?? h.x,
|
|
3972
|
+
h.in_y ?? h.y,
|
|
3973
|
+
h.x,
|
|
3974
|
+
h.y
|
|
3975
|
+
) : s += Math.sqrt((h.x - f) ** 2 + (h.y - l) ** 2), n = h.x, a = h.y, h.closePath || r === e.length - 1 && (t.is_closed || t.isClosed)) {
|
|
3976
3976
|
const d = n, u = a, v = [...e.slice(0, r + 1)].reverse().find((M) => M.moveTo) || e[0], b = v.x, m = v.y, y = e[r].out_x, S = e[r].out_y, C = v.in_x, w = v.in_y;
|
|
3977
3977
|
y !== void 0 || C !== void 0 ? s += this.getBezierLength(
|
|
3978
3978
|
d,
|
|
@@ -3992,22 +3992,22 @@ class ci {
|
|
|
3992
3992
|
return (i + o) * 2;
|
|
3993
3993
|
}
|
|
3994
3994
|
}
|
|
3995
|
-
getBezierLength(t, i, o, e, s, n, a, r,
|
|
3996
|
-
let
|
|
3997
|
-
for (let c = 1; c <=
|
|
3998
|
-
const d = c /
|
|
3999
|
-
|
|
3995
|
+
getBezierLength(t, i, o, e, s, n, a, r, h = 10) {
|
|
3996
|
+
let f = 0, l = t, p = i;
|
|
3997
|
+
for (let c = 1; c <= h; c++) {
|
|
3998
|
+
const d = c / h, u = 1 - d, v = d * d, b = u * u, m = b * u, y = v * d, S = m * t + 3 * b * d * o + 3 * u * v * s + y * a, C = m * i + 3 * b * d * e + 3 * u * v * n + y * r, w = S - l, M = C - p;
|
|
3999
|
+
f += Math.sqrt(w * w + M * M), l = S, p = C;
|
|
4000
4000
|
}
|
|
4001
|
-
return
|
|
4001
|
+
return f;
|
|
4002
4002
|
}
|
|
4003
|
-
getBezierTAtLength(t, i, o, e, s, n, a, r,
|
|
4003
|
+
getBezierTAtLength(t, i, o, e, s, n, a, r, h, f = 20) {
|
|
4004
4004
|
if (t <= 0) return 0;
|
|
4005
4005
|
let l = 0, p = i, c = o;
|
|
4006
|
-
for (let d = 1; d <=
|
|
4007
|
-
const u = d /
|
|
4006
|
+
for (let d = 1; d <= f; d++) {
|
|
4007
|
+
const u = d / f, v = 1 - u, b = u * u, m = v * v, y = m * v, S = b * u, C = y * i + 3 * m * u * e + 3 * v * b * n + S * r, w = y * o + 3 * m * u * s + 3 * v * b * a + S * h, M = C - p, I = w - c, k = Math.sqrt(M * M + I * I);
|
|
4008
4008
|
if (l + k >= t) {
|
|
4009
4009
|
const T = t - l, L = k === 0 ? 0 : T / k;
|
|
4010
|
-
return (d - 1 + L) /
|
|
4010
|
+
return (d - 1 + L) / f;
|
|
4011
4011
|
}
|
|
4012
4012
|
l += k, p = C, c = w;
|
|
4013
4013
|
}
|
|
@@ -4017,11 +4017,11 @@ class ci {
|
|
|
4017
4017
|
if (this.ensurePathPoints(t), (t == null ? void 0 : t.type) === "Path") {
|
|
4018
4018
|
const s = t.points || [];
|
|
4019
4019
|
if (s.length < 2) return { x: 0, y: 0, angle: 0 };
|
|
4020
|
-
let n = 1 / 0, a = -1 / 0, r = 1 / 0,
|
|
4020
|
+
let n = 1 / 0, a = -1 / 0, r = 1 / 0, h = -1 / 0;
|
|
4021
4021
|
s.forEach((m) => {
|
|
4022
|
-
typeof m.x == "number" && typeof m.y == "number" && (n = Math.min(n, m.x), a = Math.max(a, m.x), r = Math.min(r, m.y),
|
|
4022
|
+
typeof m.x == "number" && typeof m.y == "number" && (n = Math.min(n, m.x), a = Math.max(a, m.x), r = Math.min(r, m.y), h = Math.max(h, m.y), m.out_x !== void 0 && (n = Math.min(n, m.out_x), a = Math.max(a, m.out_x)), m.out_y !== void 0 && (r = Math.min(r, m.out_y), h = Math.max(h, m.out_y)), m.in_x !== void 0 && (n = Math.min(n, m.in_x), a = Math.max(a, m.in_x)), m.in_y !== void 0 && (r = Math.min(r, m.in_y), h = Math.max(h, m.in_y)));
|
|
4023
4023
|
});
|
|
4024
|
-
const
|
|
4024
|
+
const f = (n + a) / 2, l = (r + h) / 2, c = this.getPerimeter(t, i, o) * e;
|
|
4025
4025
|
let d = 0;
|
|
4026
4026
|
const u = [];
|
|
4027
4027
|
let v = s[0], b = s[0];
|
|
@@ -4040,27 +4040,27 @@ class ci {
|
|
|
4040
4040
|
if (w ? C = this.getBezierLength(y.x, y.y, y.out_x ?? y.x, y.out_y ?? y.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y) : C = Math.sqrt((S.x - y.x) ** 2 + (S.y - y.y) ** 2), d + C >= c || m === u[u.length - 1]) {
|
|
4041
4041
|
let M = 0;
|
|
4042
4042
|
if (w)
|
|
4043
|
-
return M = this.getBezierTAtLength(c - d, y.x, y.y, y.out_x ?? y.x, y.out_y ?? y.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y, 20), this.getBezierPointAndAngle(M, y, S,
|
|
4043
|
+
return M = this.getBezierTAtLength(c - d, y.x, y.y, y.out_x ?? y.x, y.out_y ?? y.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y, 20), this.getBezierPointAndAngle(M, y, S, f, l);
|
|
4044
4044
|
{
|
|
4045
4045
|
M = C === 0 ? 0 : (c - d) / C;
|
|
4046
|
-
const I = y.x + (S.x - y.x) * M -
|
|
4046
|
+
const I = y.x + (S.x - y.x) * M - f, k = y.y + (S.y - y.y) * M - l, T = Math.atan2(S.y - y.y, S.x - y.x);
|
|
4047
4047
|
return { x: I, y: k, angle: T };
|
|
4048
4048
|
}
|
|
4049
4049
|
}
|
|
4050
4050
|
d += C;
|
|
4051
4051
|
}
|
|
4052
4052
|
} else if (t.type === "Ellipse") {
|
|
4053
|
-
const s = Math.abs(i) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360,
|
|
4054
|
-
return { x:
|
|
4053
|
+
const s = Math.abs(i) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360, h = ((t.startAngle ?? 0) + a * e) * Math.PI / 180, f = s * Math.cos(h), l = n * Math.sin(h), p = -s * Math.sin(h), c = n * Math.cos(h), d = Math.atan2(c, p);
|
|
4054
|
+
return { x: f, y: l, angle: d };
|
|
4055
4055
|
} else if ((t == null ? void 0 : t.type) === "Rectangle") {
|
|
4056
4056
|
const s = Math.abs(i), n = Math.abs(o), r = (s + n) * 2 * e;
|
|
4057
|
-
let
|
|
4058
|
-
return r < s ? (
|
|
4057
|
+
let h = 0, f = 0, l = 0;
|
|
4058
|
+
return r < s ? (h = -s / 2 + r, f = -n / 2, l = 0) : r < s + n ? (h = s / 2, f = -n / 2 + (r - s), l = Math.PI / 2) : r < 2 * s + n ? (h = s / 2 - (r - (s + n)), f = n / 2, l = Math.PI) : (h = -s / 2, f = n / 2 - (r - (2 * s + n)), l = -Math.PI / 2), { x: h, y: f, angle: l };
|
|
4059
4059
|
}
|
|
4060
4060
|
return { x: 0, y: 0, angle: 0 };
|
|
4061
4061
|
}
|
|
4062
4062
|
getBezierPointAndAngle(t, i, o, e, s) {
|
|
4063
|
-
const n = i.x, a = i.y, r = i.out_x ?? i.x,
|
|
4063
|
+
const n = i.x, a = i.y, r = i.out_x ?? i.x, h = i.out_y ?? i.y, f = o.in_x ?? o.x, l = o.in_y ?? o.y, p = o.x, c = o.y, d = 1 - t, u = t * t, v = d * d, b = v * d, m = u * t, y = b * n + 3 * v * t * r + 3 * d * u * f + m * p - e, S = b * a + 3 * v * t * h + 3 * d * u * l + m * c - s, C = 3 * v * (r - n) + 6 * d * t * (f - r) + 3 * u * (p - f), w = 3 * v * (h - a) + 6 * d * t * (l - h) + 3 * u * (c - l), M = Math.atan2(w, C);
|
|
4064
4064
|
return { x: y, y: S, angle: M };
|
|
4065
4065
|
}
|
|
4066
4066
|
applyAbsoluteTransform(t, i, o) {
|
|
@@ -4086,57 +4086,57 @@ class ci {
|
|
|
4086
4086
|
const b = Math.tan(e * Math.PI / 180), m = Math.tan(s * Math.PI / 180);
|
|
4087
4087
|
t.transform(1 + b * m, m, b, 1, 0, 0);
|
|
4088
4088
|
}
|
|
4089
|
-
const n = o.rotate_x !== void 0 ? o.rotate_x : ((d = o.transform) == null ? void 0 : d.rotate_x) ?? 0, a = o.rotate_y !== void 0 ? o.rotate_y : ((u = o.transform) == null ? void 0 : u.rotate_y) ?? 0,
|
|
4089
|
+
const n = o.rotate_x !== void 0 ? o.rotate_x : ((d = o.transform) == null ? void 0 : d.rotate_x) ?? 0, a = o.rotate_y !== void 0 ? o.rotate_y : ((u = o.transform) == null ? void 0 : u.rotate_y) ?? 0, h = 1 + (o.translate_z !== void 0 ? o.translate_z : ((v = o.transform) == null ? void 0 : v.translate_z) ?? 0) / 1e3, f = (o.flip_x === !0 ? -1 : 1) * Math.cos(a * Math.PI / 180) * h, l = (o.flip_y === !0 ? -1 : 1) * Math.cos(n * Math.PI / 180) * h, p = (o.scale_x ?? 1) * f, c = (o.scale_y ?? 1) * l;
|
|
4090
4090
|
t.scale(p, c);
|
|
4091
4091
|
}
|
|
4092
4092
|
applyArtEffectOverlay(t, i, o, e, s, n) {
|
|
4093
4093
|
var c, d, u, v, b;
|
|
4094
4094
|
const a = this.objectStates.get(i.id), r = ((c = a == null ? void 0 : a.style) == null ? void 0 : c.artEffect) || i.artEffect || ((d = i.style) == null ? void 0 : d.artEffect);
|
|
4095
4095
|
if (!r || !r.enabled) return;
|
|
4096
|
-
const
|
|
4097
|
-
if (
|
|
4098
|
-
if (t.save(), this.applyPath(t, o, e, s, n), t.clip(),
|
|
4096
|
+
const h = r.type, f = r.intensity ?? 0.5, l = r.speed ?? 1, p = r.scale ?? 10;
|
|
4097
|
+
if (h === "acid_gradient" || h === "acid_rave" || h === "shimmer" || h === "glint_overlay" || h === "halftone" || h === "noise" || h === "scanlines" || h === "chromatic_aberration" || h === "pixelate" || h === "glitch" || h === "fold_overlay" || h === "crumple_overlay") {
|
|
4098
|
+
if (t.save(), this.applyPath(t, o, e, s, n), t.clip(), h === "shimmer") {
|
|
4099
4099
|
const y = this.currentTime * l % 2 / 2, S = t.createLinearGradient(-e, -s, e, s);
|
|
4100
|
-
S.addColorStop(Math.max(0, y - 0.2), "rgba(255,255,255,0)"), S.addColorStop(y, `rgba(255,255,255,${
|
|
4101
|
-
} else if (
|
|
4100
|
+
S.addColorStop(Math.max(0, y - 0.2), "rgba(255,255,255,0)"), S.addColorStop(y, `rgba(255,255,255,${f * 0.8})`), S.addColorStop(Math.min(1, y + 0.2), "rgba(255,255,255,0)"), t.fillStyle = S, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over";
|
|
4101
|
+
} else if (h === "glint_overlay") {
|
|
4102
4102
|
let S = ((this._lastPointerPos || { x: 0 }).x - (((u = i.transform) == null ? void 0 : u.x) ?? 0) + 300) / 600;
|
|
4103
4103
|
S = Math.max(-0.2, Math.min(1.2, S));
|
|
4104
4104
|
const C = t.createLinearGradient(-e, -s, e, s);
|
|
4105
|
-
C.addColorStop(Math.max(0, S - 0.15), "rgba(255,255,255,0)"), C.addColorStop(Math.max(0, Math.min(1, S)), `rgba(255,255,255,${
|
|
4106
|
-
} else if (
|
|
4105
|
+
C.addColorStop(Math.max(0, S - 0.15), "rgba(255,255,255,0)"), C.addColorStop(Math.max(0, Math.min(1, S)), `rgba(255,255,255,${f})`), C.addColorStop(Math.min(1, S + 0.15), "rgba(255,255,255,0)"), t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over";
|
|
4106
|
+
} else if (h === "fold_overlay") {
|
|
4107
4107
|
const m = this._lastPointerPos || { x: 0, y: 0 }, y = m.x - (((v = i.transform) == null ? void 0 : v.x) ?? 0), S = m.y - (((b = i.transform) == null ? void 0 : b.y) ?? 0), C = t.createLinearGradient(y > 0 ? -e / 2 : e / 2, S > 0 ? -s / 2 : s / 2, y > 0 ? e / 2 : -e / 2, S > 0 ? s / 2 : -s / 2);
|
|
4108
|
-
C.addColorStop(0, `rgba(0,0,0,${
|
|
4109
|
-
} else if (
|
|
4108
|
+
C.addColorStop(0, `rgba(0,0,0,${f * 0.6})`), C.addColorStop(0.4, "rgba(0,0,0,0)"), C.addColorStop(0.5, `rgba(255,255,255,${f * 0.4})`), C.addColorStop(1, `rgba(0,0,0,${f * 0.2})`), t.fillStyle = C, t.globalCompositeOperation = "overlay", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over", t.beginPath(), y > 0 && S > 0 ? (t.moveTo(e / 2 - 40, s / 2), t.lineTo(e / 2, s / 2 - 40), t.lineTo(e / 2 - 40, s / 2 - 40)) : y < 0 && S > 0 ? (t.moveTo(-e / 2 + 40, s / 2), t.lineTo(-e / 2, s / 2 - 40), t.lineTo(-e / 2 + 40, s / 2 - 40)) : y > 0 && S < 0 ? (t.moveTo(e / 2 - 40, -s / 2), t.lineTo(e / 2, -s / 2 + 40), t.lineTo(e / 2 - 40, -s / 2 + 40)) : (t.moveTo(-e / 2 + 40, -s / 2), t.lineTo(-e / 2, -s / 2 + 40), t.lineTo(-e / 2 + 40, -s / 2 + 40)), t.closePath(), t.fillStyle = "#ffffff", t.shadowColor = "rgba(0,0,0,0.5)", t.shadowBlur = 10, t.shadowOffsetX = y > 0 ? -2 : 2, t.shadowOffsetY = S > 0 ? -2 : 2, t.fill();
|
|
4109
|
+
} else if (h === "crumple_overlay") {
|
|
4110
4110
|
const m = Math.floor(e / p), y = document.createElement("canvas");
|
|
4111
4111
|
y.width = m, y.height = Math.floor(s / p);
|
|
4112
4112
|
const S = y.getContext("2d"), C = S.createImageData(y.width, y.height);
|
|
4113
4113
|
for (let w = 0; w < C.data.length; w += 4) {
|
|
4114
4114
|
const M = Math.random() > 0.95 ? 150 : 255;
|
|
4115
|
-
C.data[w] = M, C.data[w + 1] = M, C.data[w + 2] = M, C.data[w + 3] = 255 *
|
|
4115
|
+
C.data[w] = M, C.data[w + 1] = M, C.data[w + 2] = M, C.data[w + 3] = 255 * f;
|
|
4116
4116
|
}
|
|
4117
4117
|
S.putImageData(C, 0, 0), t.globalCompositeOperation = "multiply", t.imageSmoothingEnabled = !1, t.drawImage(y, -e / 2, -s / 2, e, s);
|
|
4118
|
-
} else if (
|
|
4118
|
+
} else if (h === "acid_gradient" || h === "acid_rave") {
|
|
4119
4119
|
const m = this.currentTime * l, y = r.color1, S = r.color2, C = t.createLinearGradient(-e / 2, -s / 2, e / 2, s / 2);
|
|
4120
4120
|
if (y && S) {
|
|
4121
4121
|
const w = m * 60 % 360;
|
|
4122
|
-
C.addColorStop(0, this._shiftHue(y, w,
|
|
4122
|
+
C.addColorStop(0, this._shiftHue(y, w, f * 0.7)), C.addColorStop(1, this._shiftHue(S, (w + 180) % 360, f * 0.7));
|
|
4123
4123
|
} else {
|
|
4124
4124
|
const w = m * 100 % 360, M = (w + 180) % 360;
|
|
4125
|
-
C.addColorStop(0, `hsla(${w}, 80%, 50%, ${
|
|
4125
|
+
C.addColorStop(0, `hsla(${w}, 80%, 50%, ${f * 0.5})`), C.addColorStop(1, `hsla(${M}, 80%, 50%, ${f * 0.5})`);
|
|
4126
4126
|
}
|
|
4127
4127
|
t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s);
|
|
4128
|
-
} else if (
|
|
4129
|
-
const m = Math.max(2, p * (1 -
|
|
4128
|
+
} else if (h === "halftone") {
|
|
4129
|
+
const m = Math.max(2, p * (1 - f * 0.8)), y = document.createElement("canvas");
|
|
4130
4130
|
y.width = m, y.height = m;
|
|
4131
4131
|
const S = y.getContext("2d");
|
|
4132
4132
|
if (S) {
|
|
4133
|
-
S.fillStyle = "black", S.beginPath(), S.arc(m / 2, m / 2, m / 2 *
|
|
4133
|
+
S.fillStyle = "black", S.beginPath(), S.arc(m / 2, m / 2, m / 2 * f, 0, Math.PI * 2), S.fill();
|
|
4134
4134
|
const C = t.createPattern(y, "repeat");
|
|
4135
|
-
C && (t.globalAlpha = 0.3 *
|
|
4135
|
+
C && (t.globalAlpha = 0.3 * f, t.fillStyle = C, t.fillRect(-e / 2, -s / 2, e, s));
|
|
4136
4136
|
}
|
|
4137
|
-
} else if (
|
|
4138
|
-
const m = Math.floor(e * s *
|
|
4139
|
-
t.globalAlpha = 0.4 *
|
|
4137
|
+
} else if (h === "noise") {
|
|
4138
|
+
const m = Math.floor(e * s * f * 0.02);
|
|
4139
|
+
t.globalAlpha = 0.4 * f;
|
|
4140
4140
|
for (let y = 0; y < m; y++) {
|
|
4141
4141
|
const S = Math.random() > 0.5 ? 255 : 0;
|
|
4142
4142
|
t.fillStyle = `rgba(${S}, ${S}, ${S}, ${0.5 + Math.random() * 0.5})`, t.fillRect(
|
|
@@ -4146,15 +4146,15 @@ class ci {
|
|
|
4146
4146
|
2
|
|
4147
4147
|
);
|
|
4148
4148
|
}
|
|
4149
|
-
} else if (
|
|
4150
|
-
t.globalAlpha = 0.2 *
|
|
4149
|
+
} else if (h === "scanlines") {
|
|
4150
|
+
t.globalAlpha = 0.2 * f, t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1;
|
|
4151
4151
|
for (let m = -s / 2; m < s / 2; m += 4)
|
|
4152
4152
|
t.beginPath(), t.moveTo(-e / 2, m), t.lineTo(e / 2, m), t.stroke();
|
|
4153
|
-
} else if (
|
|
4154
|
-
const m = 5 *
|
|
4153
|
+
} else if (h === "chromatic_aberration") {
|
|
4154
|
+
const m = 5 * f;
|
|
4155
4155
|
t.globalCompositeOperation = "screen", t.globalAlpha = 0.5, t.fillStyle = "cyan", t.fillRect(-e / 2 - m, -s / 2, e, s), t.fillStyle = "magenta", t.fillRect(-e / 2 + m, -s / 2, e, s);
|
|
4156
|
-
} else if (
|
|
4157
|
-
const m = Math.max(2, Math.round(p * (1 -
|
|
4156
|
+
} else if (h === "pixelate") {
|
|
4157
|
+
const m = Math.max(2, Math.round(p * (1 - f * 0.5))), y = document.createElement("canvas"), S = Math.max(1, Math.ceil(e / m)), C = Math.max(1, Math.ceil(s / m));
|
|
4158
4158
|
y.width = S, y.height = C;
|
|
4159
4159
|
const w = y.getContext("2d");
|
|
4160
4160
|
if (w) {
|
|
@@ -4162,9 +4162,9 @@ class ci {
|
|
|
4162
4162
|
const M = t.getTransform(), I = M.e - e / 2, k = M.f - s / 2;
|
|
4163
4163
|
w.drawImage(t.canvas, I, k, e, s, 0, 0, S, C), t.imageSmoothingEnabled = !1, t.drawImage(y, 0, 0, S, C, -e / 2, -s / 2, e, s), t.imageSmoothingEnabled = !0;
|
|
4164
4164
|
}
|
|
4165
|
-
} else if (
|
|
4166
|
-
const m = this.currentTime * l, y = r.chaosAmount ?? 0.2, S = Math.max(3, Math.floor(8 *
|
|
4167
|
-
t.globalCompositeOperation = "screen", t.globalAlpha =
|
|
4165
|
+
} else if (h === "glitch") {
|
|
4166
|
+
const m = this.currentTime * l, y = r.chaosAmount ?? 0.2, S = Math.max(3, Math.floor(8 * f)), C = f * e * 0.15;
|
|
4167
|
+
t.globalCompositeOperation = "screen", t.globalAlpha = f * 0.4;
|
|
4168
4168
|
const w = C * 0.3;
|
|
4169
4169
|
t.fillStyle = "rgba(255, 0, 0, 0.4)", t.fillRect(-e / 2 + w, -s / 2, e, s), t.fillStyle = "rgba(0, 255, 255, 0.4)", t.fillRect(-e / 2 - w, -s / 2, e, s), t.globalCompositeOperation = "source-over", t.globalAlpha = 1;
|
|
4170
4170
|
const M = s / S;
|
|
@@ -4187,22 +4187,22 @@ class ci {
|
|
|
4187
4187
|
e = parseInt(c.substring(0, 2), 16) / 255, s = parseInt(c.substring(2, 4), 16) / 255, n = parseInt(c.substring(4, 6), 16) / 255;
|
|
4188
4188
|
}
|
|
4189
4189
|
const a = Math.max(e, s, n), r = Math.min(e, s, n);
|
|
4190
|
-
let
|
|
4190
|
+
let h = 0, f = 0, l = (a + r) / 2;
|
|
4191
4191
|
if (a !== r) {
|
|
4192
4192
|
const c = a - r;
|
|
4193
|
-
switch (
|
|
4193
|
+
switch (f = l > 0.5 ? c / (2 - a - r) : c / (a + r), a) {
|
|
4194
4194
|
case e:
|
|
4195
|
-
|
|
4195
|
+
h = ((s - n) / c + (s < n ? 6 : 0)) / 6;
|
|
4196
4196
|
break;
|
|
4197
4197
|
case s:
|
|
4198
|
-
|
|
4198
|
+
h = ((n - e) / c + 2) / 6;
|
|
4199
4199
|
break;
|
|
4200
4200
|
case n:
|
|
4201
|
-
|
|
4201
|
+
h = ((e - s) / c + 4) / 6;
|
|
4202
4202
|
break;
|
|
4203
4203
|
}
|
|
4204
4204
|
}
|
|
4205
|
-
return `hsla(${(((
|
|
4205
|
+
return `hsla(${(((h * 360 + i) % 360 + 360) % 360).toFixed(0)}, ${(f * 100).toFixed(0)}%, ${(l * 100).toFixed(0)}%, ${o})`;
|
|
4206
4206
|
}
|
|
4207
4207
|
/**
|
|
4208
4208
|
* Simulate CSS `backdrop-filter: blur()` + glass overlay on Canvas2D.
|
|
@@ -4213,7 +4213,7 @@ class ci {
|
|
|
4213
4213
|
* 4. Apply the overlay color tint, sheen highlight, noise grain, and glass border
|
|
4214
4214
|
*/
|
|
4215
4215
|
applyBackgroundBlurGlass(t, i, o, e, s, n) {
|
|
4216
|
-
const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)",
|
|
4216
|
+
const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)", h = n.opacity !== void 0 ? this.normalizeOpacity(n.opacity) : 0.5, f = n.noise ?? 0;
|
|
4217
4217
|
t.save(), this.applyPath(t, i, o, e, s), t.clip();
|
|
4218
4218
|
const l = t.getTransform(), p = t.canvas;
|
|
4219
4219
|
try {
|
|
@@ -4238,10 +4238,10 @@ class ci {
|
|
|
4238
4238
|
}
|
|
4239
4239
|
} catch {
|
|
4240
4240
|
}
|
|
4241
|
-
t.globalCompositeOperation = "source-over", t.globalAlpha =
|
|
4241
|
+
t.globalCompositeOperation = "source-over", t.globalAlpha = h, t.fillStyle = r, t.fillRect(-o / 2, -e / 2, o, e), t.globalAlpha = 1, t.globalCompositeOperation = "source-atop";
|
|
4242
4242
|
const c = t.createLinearGradient(-o / 2, -e / 2, o / 2, e / 2);
|
|
4243
|
-
if (c.addColorStop(0, "rgba(255,255,255,0.12)"), c.addColorStop(0.3, "rgba(255,255,255,0.04)"), c.addColorStop(0.5, "rgba(255,255,255,0.0)"), c.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = c, t.fillRect(-o / 2, -e / 2, o, e),
|
|
4244
|
-
if (t.globalAlpha =
|
|
4243
|
+
if (c.addColorStop(0, "rgba(255,255,255,0.12)"), c.addColorStop(0.3, "rgba(255,255,255,0.04)"), c.addColorStop(0.5, "rgba(255,255,255,0.0)"), c.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = c, t.fillRect(-o / 2, -e / 2, o, e), f > 0) {
|
|
4244
|
+
if (t.globalAlpha = f / 100, !this._noiseTileCanvas) {
|
|
4245
4245
|
const u = document.createElement("canvas");
|
|
4246
4246
|
u.width = 64, u.height = 64;
|
|
4247
4247
|
const v = u.getContext("2d"), b = v.createImageData(64, 64), m = b.data;
|
|
@@ -4267,76 +4267,76 @@ class ci {
|
|
|
4267
4267
|
} else if (i.type === "Line")
|
|
4268
4268
|
t.moveTo(-o / 2, 0), t.lineTo(o / 2, 0);
|
|
4269
4269
|
else if (i.type === "Ellipse") {
|
|
4270
|
-
const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = i,
|
|
4271
|
-
a >= 360 && r <= 0 ? t.ellipse(0, 0,
|
|
4270
|
+
const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = i, h = o / 2, f = e / 2, l = n * Math.PI / 180, p = a * Math.PI / 180, c = l + p;
|
|
4271
|
+
a >= 360 && r <= 0 ? t.ellipse(0, 0, h, f, 0, 0, Math.PI * 2) : (t.ellipse(0, 0, h, f, 0, l, c, !1), r > 0 ? t.ellipse(0, 0, h * r, f * r, 0, c, l, !0) : t.lineTo(0, 0), t.closePath());
|
|
4272
4272
|
} else if (i.type === "Triangle")
|
|
4273
4273
|
t.moveTo(0, -e / 2), t.lineTo(o / 2, e / 2), t.lineTo(-o / 2, e / 2), t.closePath();
|
|
4274
4274
|
else if (i.type === "Polygon") {
|
|
4275
4275
|
const n = i.sides || 3, a = i.radius || Math.min(o, e) / 2;
|
|
4276
4276
|
for (let r = 0; r < n; r++) {
|
|
4277
|
-
const
|
|
4278
|
-
r === 0 ? t.moveTo(
|
|
4277
|
+
const h = r * 2 * Math.PI / n - Math.PI / 2, f = a * Math.cos(h), l = a * Math.sin(h);
|
|
4278
|
+
r === 0 ? t.moveTo(f, l) : t.lineTo(f, l);
|
|
4279
4279
|
}
|
|
4280
4280
|
t.closePath();
|
|
4281
4281
|
} else if (i.type === "Star") {
|
|
4282
4282
|
const n = i.points || 5, a = i.outer_radius || Math.min(o, e) / 2;
|
|
4283
4283
|
let r = i.inner_radius;
|
|
4284
4284
|
r == null ? r = a * 0.382 : r <= 1 && (r = a * r);
|
|
4285
|
-
for (let
|
|
4286
|
-
const
|
|
4287
|
-
|
|
4285
|
+
for (let h = 0; h < n * 2; h++) {
|
|
4286
|
+
const f = h * Math.PI / n - Math.PI / 2, l = h % 2 === 0 ? a : r, p = l * Math.cos(f), c = l * Math.sin(f);
|
|
4287
|
+
h === 0 ? t.moveTo(p, c) : t.lineTo(p, c);
|
|
4288
4288
|
}
|
|
4289
4289
|
t.closePath();
|
|
4290
4290
|
} else if (((i == null ? void 0 : i.type) === "Path" || i.type === "Subtract" || i.type === "Union" || i.type === "Intersect" || i.type === "Exclude" || i.type === "BooleanOperation") && i.points) {
|
|
4291
4291
|
this.frameCount % 300 === 0 && this.log("[Engine] Tracing Path:", i.points.length, "points");
|
|
4292
|
-
let n = 1 / 0, a = -1 / 0, r = 1 / 0,
|
|
4292
|
+
let n = 1 / 0, a = -1 / 0, r = 1 / 0, h = -1 / 0;
|
|
4293
4293
|
if (i.points.forEach((p) => {
|
|
4294
|
-
typeof p.x == "number" && typeof p.y == "number" && (n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y),
|
|
4294
|
+
typeof p.x == "number" && typeof p.y == "number" && (n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y), h = Math.max(h, p.y), p.out_x !== void 0 && (n = Math.min(n, p.out_x), a = Math.max(a, p.out_x)), p.out_y !== void 0 && (r = Math.min(r, p.out_y), h = Math.max(h, p.out_y)), p.in_x !== void 0 && (n = Math.min(n, p.in_x), a = Math.max(a, p.in_x)), p.in_y !== void 0 && (r = Math.min(r, p.in_y), h = Math.max(h, p.in_y)));
|
|
4295
4295
|
}), n === 1 / 0) return;
|
|
4296
|
-
const
|
|
4297
|
-
if (isNaN(
|
|
4298
|
-
this.warn("[Engine] Invalid path center:",
|
|
4296
|
+
const f = (n + a) / 2, l = (r + h) / 2;
|
|
4297
|
+
if (isNaN(f) || isNaN(l)) {
|
|
4298
|
+
this.warn("[Engine] Invalid path center:", f, l);
|
|
4299
4299
|
return;
|
|
4300
4300
|
}
|
|
4301
4301
|
i.points.forEach((p, c) => {
|
|
4302
4302
|
if (c === 0 || p.moveTo)
|
|
4303
|
-
t.moveTo(p.x -
|
|
4303
|
+
t.moveTo(p.x - f, p.y - l);
|
|
4304
4304
|
else {
|
|
4305
4305
|
const d = i.points[c - 1];
|
|
4306
4306
|
if (!d) return;
|
|
4307
|
-
const u = (d.out_x ?? d.x) -
|
|
4308
|
-
isNaN(u) || isNaN(b) || isNaN(p.x) ? t.lineTo(p.x -
|
|
4307
|
+
const u = (d.out_x ?? d.x) - f, v = (d.out_y ?? d.y) - l, b = (p.in_x ?? p.x) - f, m = (p.in_y ?? p.y) - l;
|
|
4308
|
+
isNaN(u) || isNaN(b) || isNaN(p.x) ? t.lineTo(p.x - f, p.y - l) : t.bezierCurveTo(u, v, b, m, p.x - f, p.y - l);
|
|
4309
4309
|
}
|
|
4310
4310
|
if (p.closePath || c === i.points.length - 1 && (i.is_closed || i.isClosed)) {
|
|
4311
4311
|
const d = [...i.points.slice(0, c + 1)].reverse().find((u) => u.moveTo) || i.points[0];
|
|
4312
4312
|
d && (p.out_x !== void 0 || d.in_x !== void 0) && t.bezierCurveTo(
|
|
4313
|
-
(p.out_x ?? p.x) -
|
|
4313
|
+
(p.out_x ?? p.x) - f,
|
|
4314
4314
|
(p.out_y ?? p.y) - l,
|
|
4315
|
-
(d.in_x ?? d.x) -
|
|
4315
|
+
(d.in_x ?? d.x) - f,
|
|
4316
4316
|
(d.in_y ?? d.y) - l,
|
|
4317
|
-
d.x -
|
|
4317
|
+
d.x - f,
|
|
4318
4318
|
d.y - l
|
|
4319
4319
|
), t.closePath();
|
|
4320
4320
|
}
|
|
4321
4321
|
});
|
|
4322
4322
|
} else if (i.points && Array.isArray(i.points)) {
|
|
4323
|
-
let n = 1 / 0, a = -1 / 0, r = 1 / 0,
|
|
4323
|
+
let n = 1 / 0, a = -1 / 0, r = 1 / 0, h = -1 / 0;
|
|
4324
4324
|
i.points.forEach((p) => {
|
|
4325
|
-
n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y),
|
|
4325
|
+
n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y), h = Math.max(h, p.y);
|
|
4326
4326
|
});
|
|
4327
|
-
const
|
|
4327
|
+
const f = (n + a) / 2, l = (r + h) / 2;
|
|
4328
4328
|
i.points.forEach((p, c) => {
|
|
4329
|
-
if (c === 0) t.moveTo(p.x -
|
|
4329
|
+
if (c === 0) t.moveTo(p.x - f, p.y - l);
|
|
4330
4330
|
else {
|
|
4331
4331
|
const d = i.points[c - 1];
|
|
4332
4332
|
d.out_x !== void 0 || p.in_x !== void 0 ? t.bezierCurveTo(
|
|
4333
|
-
(d.out_x ?? d.x) -
|
|
4333
|
+
(d.out_x ?? d.x) - f,
|
|
4334
4334
|
(d.out_y ?? d.y) - l,
|
|
4335
|
-
(p.in_x ?? p.x) -
|
|
4335
|
+
(p.in_x ?? p.x) - f,
|
|
4336
4336
|
(p.in_y ?? p.y) - l,
|
|
4337
|
-
p.x -
|
|
4337
|
+
p.x - f,
|
|
4338
4338
|
p.y - l
|
|
4339
|
-
) : t.lineTo(p.x -
|
|
4339
|
+
) : t.lineTo(p.x - f, p.y - l);
|
|
4340
4340
|
}
|
|
4341
4341
|
(p.closePath || c === i.points.length - 1 && (i.is_closed || i.isClosed)) && t.closePath();
|
|
4342
4342
|
});
|
|
@@ -4344,15 +4344,15 @@ class ci {
|
|
|
4344
4344
|
}
|
|
4345
4345
|
}
|
|
4346
4346
|
renderInputBox(t, i) {
|
|
4347
|
-
var
|
|
4348
|
-
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((
|
|
4347
|
+
var R, O;
|
|
4348
|
+
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((R = i.geometry) == null ? void 0 : R.width) || 250, n = ((O = i.geometry) == null ? void 0 : O.height) || 45, a = this.focusedId === i.id, r = this.lastHoveredObjectId === i.id, h = e.previewState || "default", f = h !== "default" ? h : a ? "focused" : r ? "hovered" : "default", l = e.label || { visible: !0, text: "Label" }, p = e.helperText || { visible: !1, text: "Helper text" }, c = e.leftIcon || { visible: !1 }, d = e.rightIcon || { visible: !1 }, u = e.multiline === !0, v = e.corner_radius ?? 8, b = e.corners || { tl: v, tr: v, bl: v, br: v }, m = [b.tl, b.tr, b.br, b.bl];
|
|
4349
4349
|
let y = e.backgroundColor || "rgba(31, 41, 55, 1)", S = e.borderColor || "rgba(55, 65, 81, 1)", C = e.borderWidth ?? 1.5, w = e.color || "#ffffff", M = e.placeholderColor || "rgba(156, 163, 175, 1)", I = e.fontSize || 14;
|
|
4350
|
-
const k = `${
|
|
4351
|
-
T ? (T.backgroundColor !== void 0 && (y = T.backgroundColor), T.borderColor !== void 0 && (S = T.borderColor), T.borderWidth !== void 0 && (C = T.borderWidth), T.color !== void 0 && (w = T.color), T.placeholderColor !== void 0 && (M = T.placeholderColor), T.fontSize !== void 0 && (I = T.fontSize)) :
|
|
4350
|
+
const k = `${f}Style`, T = e[k];
|
|
4351
|
+
T ? (T.backgroundColor !== void 0 && (y = T.backgroundColor), T.borderColor !== void 0 && (S = T.borderColor), T.borderWidth !== void 0 && (C = T.borderWidth), T.color !== void 0 && (w = T.color), T.placeholderColor !== void 0 && (M = T.placeholderColor), T.fontSize !== void 0 && (I = T.fontSize)) : f === "focused" ? (S = e.focusBorderColor || "rgba(59, 130, 246, 1)", C = Math.max(C, 2)) : f === "hovered" || f === "hover" ? (S = e.hoverBorderColor || S, y = e.hoverBackgroundColor || y) : f === "disabled" ? (y = e.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", S = e.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : f === "error" && (S = "rgba(239, 68, 68, 1)", C = Math.max(C, 2)), t.beginPath(), this.drawRoundRect(t, -s / 2, -n / 2, s, n, m);
|
|
4352
4352
|
const L = this.createCanvasFill(t, y, s, n);
|
|
4353
4353
|
if (L && (t.fillStyle = L, t.fill()), C > 0) {
|
|
4354
4354
|
const D = this.createCanvasFill(t, S, s, n);
|
|
4355
|
-
if (D && (t.strokeStyle = D, t.lineWidth = C, t.stroke()),
|
|
4355
|
+
if (D && (t.strokeStyle = D, t.lineWidth = C, t.stroke()), f === "focused" || f === "focus") {
|
|
4356
4356
|
t.save(), t.beginPath();
|
|
4357
4357
|
const q = m.map((ot) => ot + 2);
|
|
4358
4358
|
this.drawRoundRect(t, -s / 2 - 2, -n / 2 - 2, s + 4, n + 4, q), t.strokeStyle = "rgba(59, 130, 246, 0.3)", t.lineWidth = 2, t.stroke(), t.restore();
|
|
@@ -4401,19 +4401,19 @@ class ci {
|
|
|
4401
4401
|
t.fillText(D, bt, gt);
|
|
4402
4402
|
}
|
|
4403
4403
|
if (p.visible === !0) {
|
|
4404
|
-
const D = p.text || "Helper text", q = p.fontSize || 11, ot =
|
|
4404
|
+
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
4405
|
t.font = `400 ${q}px "${G}", sans-serif`, t.fillStyle = ot, t.textAlign = "left", t.textBaseline = "top";
|
|
4406
4406
|
const bt = -(s / 2), gt = n / 2 + yt;
|
|
4407
4407
|
t.fillText(D, bt, gt);
|
|
4408
4408
|
}
|
|
4409
4409
|
}
|
|
4410
4410
|
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,
|
|
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, tt, R, O, D, q, ot) => {
|
|
4412
4412
|
if ((X === "Custom" || X === "Icon") && ot)
|
|
4413
4413
|
try {
|
|
4414
4414
|
const yt = new Path2D(ot);
|
|
4415
|
-
if (t.save(), t.translate(tt,
|
|
4416
|
-
const bt = Math.min(
|
|
4415
|
+
if (t.save(), t.translate(tt, R), X === "Icon") {
|
|
4416
|
+
const bt = Math.min(O, D) / 24;
|
|
4417
4417
|
t.scale(bt, bt), t.translate(-12, -12);
|
|
4418
4418
|
}
|
|
4419
4419
|
t.fill(yt), t.restore();
|
|
@@ -4422,28 +4422,28 @@ class ci {
|
|
|
4422
4422
|
console.error("Error drawing slider shape in engine:", yt);
|
|
4423
4423
|
}
|
|
4424
4424
|
if (t.beginPath(), X === "Ellipse")
|
|
4425
|
-
t.ellipse(tt,
|
|
4425
|
+
t.ellipse(tt, R, O / 2, D / 2, 0, 0, Math.PI * 2);
|
|
4426
4426
|
else if (X === "Rectangle")
|
|
4427
|
-
this.drawRoundRect(t, tt -
|
|
4427
|
+
this.drawRoundRect(t, tt - O / 2, R - D / 2, O, D, q);
|
|
4428
4428
|
else if (X === "Triangle")
|
|
4429
|
-
t.moveTo(tt,
|
|
4429
|
+
t.moveTo(tt, R - D / 2), t.lineTo(tt + O / 2, R + D / 2), t.lineTo(tt - O / 2, R + D / 2), t.closePath();
|
|
4430
4430
|
else if (X === "Diamond")
|
|
4431
|
-
t.moveTo(tt,
|
|
4431
|
+
t.moveTo(tt, R - D / 2), t.lineTo(tt + O / 2, R), t.lineTo(tt, R + D / 2), t.lineTo(tt - O / 2, R), t.closePath();
|
|
4432
4432
|
else if (X === "Polygon") {
|
|
4433
|
-
const yt = i.geometry.sides || 3, bt = i.geometry.radius || Math.min(
|
|
4433
|
+
const yt = i.geometry.sides || 3, bt = i.geometry.radius || Math.min(O, D) / 2;
|
|
4434
4434
|
for (let gt = 0; gt < yt; gt++) {
|
|
4435
|
-
const Et = gt * 2 * Math.PI / yt - Math.PI / 2, It = tt + bt * Math.cos(Et), St =
|
|
4435
|
+
const Et = gt * 2 * Math.PI / yt - Math.PI / 2, It = tt + bt * Math.cos(Et), St = R + bt * Math.sin(Et);
|
|
4436
4436
|
gt === 0 ? t.moveTo(It, St) : t.lineTo(It, St);
|
|
4437
4437
|
}
|
|
4438
4438
|
t.closePath();
|
|
4439
4439
|
} else if (X === "Star") {
|
|
4440
|
-
const bt = Math.min(
|
|
4440
|
+
const bt = Math.min(O, D) / 2, gt = bt / 2;
|
|
4441
4441
|
for (let Et = 0; Et < 10; Et++) {
|
|
4442
4442
|
const It = Et % 2 === 0 ? bt : gt, St = Et * Math.PI / 5 - Math.PI / 2;
|
|
4443
|
-
t.lineTo(tt + It * Math.cos(St),
|
|
4443
|
+
t.lineTo(tt + It * Math.cos(St), R + It * Math.sin(St));
|
|
4444
4444
|
}
|
|
4445
4445
|
t.closePath();
|
|
4446
|
-
} else X === "Line" && (t.moveTo(tt -
|
|
4446
|
+
} else X === "Line" && (t.moveTo(tt - O / 2, R), t.lineTo(tt + O / 2, R));
|
|
4447
4447
|
t.fill();
|
|
4448
4448
|
}, A = this.createCanvasFill(t, b, n, p);
|
|
4449
4449
|
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);
|
|
@@ -4460,20 +4460,20 @@ class ci {
|
|
|
4460
4460
|
t.save(), t.translate(z + P, _);
|
|
4461
4461
|
const X = Math.round(a).toString();
|
|
4462
4462
|
t.font = "10px Inter, sans-serif";
|
|
4463
|
-
const tt = t.measureText(X),
|
|
4463
|
+
const tt = t.measureText(X), R = 6, O = 4, D = tt.width + R * 2, q = 14 + O;
|
|
4464
4464
|
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
4465
|
}
|
|
4466
4466
|
const x = s.label || {}, F = s.helperText || {}, j = s.fontFamily || "Inter";
|
|
4467
4467
|
if (x.visible !== !1) {
|
|
4468
|
-
const X = x.text || "Label", tt = x.fontSize || 12,
|
|
4469
|
-
t.font = `600 ${tt}px "${j}", sans-serif`, t.fillStyle =
|
|
4470
|
-
const D = -(n / 2), q = -(p / 2) -
|
|
4468
|
+
const X = x.text || "Label", tt = x.fontSize || 12, R = x.color || "rgba(156, 163, 175, 1)", O = x.offset ?? 8;
|
|
4469
|
+
t.font = `600 ${tt}px "${j}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "bottom";
|
|
4470
|
+
const D = -(n / 2), q = -(p / 2) - O;
|
|
4471
4471
|
t.fillText(X, D, q);
|
|
4472
4472
|
}
|
|
4473
4473
|
if (F.visible === !0) {
|
|
4474
|
-
const X = F.text || "Helper text", tt = F.fontSize || 11,
|
|
4475
|
-
t.font = `400 ${tt}px "${j}", sans-serif`, t.fillStyle =
|
|
4476
|
-
const D = -(n / 2), q = p / 2 +
|
|
4474
|
+
const X = F.text || "Helper text", tt = F.fontSize || 11, R = F.color || "rgba(156, 163, 175, 1)", O = F.offset ?? 6;
|
|
4475
|
+
t.font = `400 ${tt}px "${j}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "top";
|
|
4476
|
+
const D = -(n / 2), q = p / 2 + O;
|
|
4477
4477
|
t.fillText(X, D, q);
|
|
4478
4478
|
}
|
|
4479
4479
|
}
|
|
@@ -4481,11 +4481,11 @@ class ci {
|
|
|
4481
4481
|
var _;
|
|
4482
4482
|
const o = this.objectStates.get(i.id);
|
|
4483
4483
|
if (!o) return;
|
|
4484
|
-
const e = o.options || i.options || {}, s = i.geometry.width || 160, n = i.geometry.height || 40, a = -s / 2, r = -n / 2,
|
|
4484
|
+
const e = o.options || i.options || {}, s = i.geometry.width || 160, n = i.geometry.height || 40, a = -s / 2, r = -n / 2, h = e.corner_radius ?? 6, f = e.disabled || e.previewState === "disabled", l = this.lastHoveredObjectId === i.id || e.previewState === "hover", p = (e.isOpen || e.previewState === "active") && !f;
|
|
4485
4485
|
let c = e.backgroundColor, d = e.borderColor, u = e.color || "#333333";
|
|
4486
|
-
|
|
4486
|
+
f ? (c = e.disabledBackgroundColor || "#f3f4f6", d = e.disabledBorderColor || "#e5e7eb", u = e.disabledColor || "#9ca3af") : p ? (c = e.activeBackgroundColor || c, d = e.activeBorderColor || d, u = e.activeColor || u) : l && (c = e.hoverBackgroundColor || c, d = e.hoverBorderColor || d, u = e.hoverColor || u), c || (c = "#ffffff"), d || (d = "#e5e7eb");
|
|
4487
4487
|
const v = t.globalAlpha;
|
|
4488
|
-
t.globalAlpha = v * (e.opacity ?? 1), this.drawRoundRect(t, a, r, s, n,
|
|
4488
|
+
t.globalAlpha = v * (e.opacity ?? 1), this.drawRoundRect(t, a, r, s, n, h), t.fillStyle = this.createCanvasFill(t, typeof c == "string" ? { type: "Solid", color: c } : c, s, n) || "#ffffff", t.fill();
|
|
4489
4489
|
const b = e.borderWidth ?? 1;
|
|
4490
4490
|
b > 0 && (t.strokeStyle = this.createCanvasFill(t, typeof d == "string" ? { type: "Solid", color: d } : d, s, n) || "#e5e7eb", t.lineWidth = b, t.stroke());
|
|
4491
4491
|
const m = 12, y = e.chevronType || "chevron", S = e.chevronSize || 16, C = (p ? e.openIconColor : e.closedIconColor) || e.chevronColor || "#6b7280";
|
|
@@ -4508,40 +4508,40 @@ class ci {
|
|
|
4508
4508
|
}
|
|
4509
4509
|
const w = e.selectedOption || e.placeholder || "Select...", M = e.fontSize || 14, I = e.fontWeight || 400, k = e.fontFamily || "Inter, sans-serif";
|
|
4510
4510
|
t.font = `${I} ${M}px ${k}`;
|
|
4511
|
-
const T =
|
|
4511
|
+
const T = f ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : u;
|
|
4512
4512
|
t.fillStyle = this.createCanvasFill(t, typeof T == "string" ? { type: "Solid", color: T } : T, s, n) || "#333333", t.textAlign = "left", t.textBaseline = "middle";
|
|
4513
4513
|
const L = y === "none" ? 0 : S + 8, P = s - m * 2 - L;
|
|
4514
|
-
if (t.save(), t.beginPath(), t.rect(a + m, r, P, n), t.clip(), t.fillText(w, a + m, 0), t.restore(), p && !
|
|
4515
|
-
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 ??
|
|
4514
|
+
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
|
+
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
4516
|
t.save();
|
|
4517
4517
|
const N = e.listShadow || {}, J = t.getTransform(), x = Math.sqrt(J.a * J.a + J.b * J.b) || 1;
|
|
4518
4518
|
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
4519
|
const F = e.listBorderWidth ?? 1;
|
|
4520
4520
|
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
4521
|
const j = e.itemFontSize || M, X = e.itemFontFamily || k;
|
|
4522
|
-
t.font = `${I} ${j}px ${X}`, A.forEach((tt,
|
|
4523
|
-
const
|
|
4522
|
+
t.font = `${I} ${j}px ${X}`, A.forEach((tt, R) => {
|
|
4523
|
+
const O = E + z + R * W;
|
|
4524
4524
|
if (tt === e.selectedOption)
|
|
4525
|
-
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,
|
|
4525
|
+
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
4526
|
else if (t.fillStyle = e.listTextColor || u || "#333333", this.activeDropdownId === i.id && this._lastPointerPos) {
|
|
4527
4527
|
const q = this._lastPointerPos.y - (E + z), ot = Math.floor(q / W);
|
|
4528
|
-
|
|
4528
|
+
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
4529
|
}
|
|
4530
|
-
t.fillText(tt, a + m,
|
|
4530
|
+
t.fillText(tt, a + m, O + W / 2);
|
|
4531
4531
|
});
|
|
4532
4532
|
}
|
|
4533
4533
|
t.globalAlpha = v;
|
|
4534
4534
|
}
|
|
4535
4535
|
renderButton(t, i) {
|
|
4536
4536
|
if (i.children && i.children.length > 0) return;
|
|
4537
|
-
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = i.geometry || {}, n = s.width || 120, a = s.height || 40, r = this.lastHoveredObjectId === i.id,
|
|
4538
|
-
let d = e.backgroundColor || "#3b82f6", u =
|
|
4539
|
-
|
|
4537
|
+
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = i.geometry || {}, n = s.width || 120, a = s.height || 40, r = this.lastHoveredObjectId === i.id, h = this.activeObjectId === i.id, f = e.label || {}, l = e.hoverStyle || {}, p = e.activeStyle || {}, c = e.icon || { enabled: !1 };
|
|
4538
|
+
let d = e.backgroundColor || "#3b82f6", u = f.color || "#ffffff", v = f.text || "Button", b = s.cornerRadius ?? 8, m = e.borderColor || "transparent", y = e.borderWidth || 0, S = 1;
|
|
4539
|
+
h && p ? (d = p.backgroundColor || d, u = p.color || u, v = p.text || v, S = p.scale ?? 0.95, b = p.cornerRadius ?? b) : r && l && (d = l.backgroundColor || d, u = l.color || u, v = l.text || v, S = l.scale ?? 1, b = l.cornerRadius ?? b, m = l.borderColor || m);
|
|
4540
4540
|
const C = -n / 2, w = -a / 2;
|
|
4541
4541
|
t.save(), t.scale(S, S), t.beginPath(), this.drawRoundRect(t, C, w, n, a, b);
|
|
4542
4542
|
const M = this.createCanvasFill(t, d, n, a);
|
|
4543
4543
|
M && (t.fillStyle = M, t.fill()), (y > 0 || r && l.borderColor) && (t.strokeStyle = m, t.lineWidth = y || (r ? 1 : 0), t.stroke());
|
|
4544
|
-
const I =
|
|
4544
|
+
const I = f.fontSize || 14, k = f.fontFamily || "Inter", T = f.fontWeight || 600;
|
|
4545
4545
|
t.font = `${T} ${I}px "${k}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`, t.fillStyle = u, t.textAlign = "center", t.textBaseline = "middle";
|
|
4546
4546
|
let L = 0;
|
|
4547
4547
|
if (c.enabled && c.svgPath) {
|
|
@@ -4554,32 +4554,32 @@ class ci {
|
|
|
4554
4554
|
}
|
|
4555
4555
|
renderToggleButton(t, i) {
|
|
4556
4556
|
var v, b;
|
|
4557
|
-
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = e.checked ?? !1, n = ((v = i.geometry) == null ? void 0 : v.width) || 120, a = ((b = i.geometry) == null ? void 0 : b.height) || 40, r = -n / 2,
|
|
4558
|
-
t.save(), t.beginPath(), this.drawRoundRect(t, r,
|
|
4557
|
+
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = e.checked ?? !1, n = ((v = i.geometry) == null ? void 0 : v.width) || 120, a = ((b = i.geometry) == null ? void 0 : b.height) || 40, r = -n / 2, h = -a / 2, f = e.corner_radius ?? 8, l = e.label || {}, p = s ? e.accentColor || "#3b82f6" : e.inactiveColor || "#374151", c = s ? e.activeTextColor || "#ffffff" : e.inactiveTextColor || "#9ca3af";
|
|
4558
|
+
t.save(), t.beginPath(), this.drawRoundRect(t, r, h, n, a, f), t.fillStyle = p, t.fill();
|
|
4559
4559
|
const d = l.fontSize || 14, u = l.fontFamily || "Inter";
|
|
4560
4560
|
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
4561
|
}
|
|
4562
4562
|
renderToggle(t, i) {
|
|
4563
|
-
var G, N, J, x, F, j, X, tt,
|
|
4564
|
-
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,
|
|
4565
|
-
e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n,
|
|
4563
|
+
var G, N, J, x, F, j, X, tt, R, O, D, q;
|
|
4564
|
+
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
|
+
e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, f);
|
|
4566
4566
|
const S = this.createCanvasFill(t, v, s, n);
|
|
4567
4567
|
if (S && (t.fillStyle = S, t.fill()), m > 0) {
|
|
4568
4568
|
t.lineWidth = m;
|
|
4569
4569
|
const ot = this.createCanvasFill(t, b, s, n);
|
|
4570
4570
|
ot && (t.strokeStyle = ot, t.stroke());
|
|
4571
4571
|
}
|
|
4572
|
-
const C = 2, w = n - C * 2, M = w / 2, I = a + C, k = a + s - C - w, T =
|
|
4572
|
+
const C = 2, w = n - C * 2, M = w / 2, I = a + C, k = a + s - C - w, T = h ? k : I, L = r + C;
|
|
4573
4573
|
t.beginPath(), t.arc(T + M, L + M, M, 0, Math.PI * 2);
|
|
4574
4574
|
const P = this.createCanvasFill(t, y, w, w);
|
|
4575
4575
|
P && (t.fillStyle = P, t.fill()), e.disabled && (t.globalAlpha *= 2);
|
|
4576
4576
|
let _ = !1, E = !1;
|
|
4577
|
-
const A = (
|
|
4577
|
+
const A = (h ? (J = l.leftLabel) == null ? void 0 : J.text : null) || ((x = e.leftLabel) == null ? void 0 : x.text) || "", W = (h ? (F = l.leftLabel) == null ? void 0 : F.color : null) || ((j = e.leftLabel) == null ? void 0 : j.color) || "#f3f4f6";
|
|
4578
4578
|
if ((X = e.leftLabel) != null && X.enabled && A) {
|
|
4579
4579
|
const ot = e.leftLabel;
|
|
4580
4580
|
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
4581
|
}
|
|
4582
|
-
const z = (
|
|
4582
|
+
const z = (h ? (tt = l.rightLabel) == null ? void 0 : tt.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
4583
|
if ((q = e.rightLabel) != null && q.enabled && z) {
|
|
4584
4584
|
const ot = e.rightLabel;
|
|
4585
4585
|
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;
|
|
@@ -4594,19 +4594,19 @@ class ci {
|
|
|
4594
4594
|
}
|
|
4595
4595
|
renderCheckbox(t, i) {
|
|
4596
4596
|
var S, C;
|
|
4597
|
-
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((S = i.geometry) == null ? void 0 : S.width) || 20, n = ((C = i.geometry) == null ? void 0 : C.height) || 20, a = -s / 2, r = -n / 2,
|
|
4598
|
-
e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n,
|
|
4597
|
+
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((S = i.geometry) == null ? void 0 : S.width) || 20, n = ((C = i.geometry) == null ? void 0 : C.height) || 20, a = -s / 2, r = -n / 2, h = e.cornerRadius ?? 4, f = e.checked ?? !1, l = e.activeColor || "#3b82f6", p = e.inactiveColor || "transparent", c = e.checkColor || "#ffffff", d = e.borderColor || "#4b5563", u = e.borderWidth ?? 2, v = f ? l : p, b = f ? "transparent" : d, m = f ? 0 : u;
|
|
4598
|
+
e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, h);
|
|
4599
4599
|
const y = this.createCanvasFill(t, v, s, n);
|
|
4600
4600
|
if (y && (t.fillStyle = y, t.fill()), m > 0) {
|
|
4601
4601
|
t.lineWidth = m;
|
|
4602
4602
|
const w = this.createCanvasFill(t, b, s, n);
|
|
4603
4603
|
w && (t.strokeStyle = w, t.stroke());
|
|
4604
|
-
} else if (
|
|
4604
|
+
} else if (f) {
|
|
4605
4605
|
t.lineWidth = 1;
|
|
4606
4606
|
const w = this.createCanvasFill(t, l, s, n);
|
|
4607
4607
|
w && (t.strokeStyle = w, t.stroke());
|
|
4608
4608
|
}
|
|
4609
|
-
if (
|
|
4609
|
+
if (f) {
|
|
4610
4610
|
t.save(), t.beginPath();
|
|
4611
4611
|
const w = this.createCanvasFill(t, c, s, n);
|
|
4612
4612
|
t.strokeStyle = w || c, t.lineWidth = Math.max(2, s * 0.12), t.lineCap = "round", t.lineJoin = "round";
|
|
@@ -4623,21 +4623,21 @@ class ci {
|
|
|
4623
4623
|
}
|
|
4624
4624
|
renderRadioGroup(t, i) {
|
|
4625
4625
|
var C, w;
|
|
4626
|
-
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((C = i.geometry) == null ? void 0 : C.width) || 180, n = ((w = i.geometry) == null ? void 0 : w.height) || 100, a = -s / 2, r = -n / 2,
|
|
4626
|
+
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((C = i.geometry) == null ? void 0 : C.width) || 180, n = ((w = i.geometry) == null ? void 0 : w.height) || 100, a = -s / 2, r = -n / 2, h = e.selectedValue, f = e.optionsList || ["Option 1", "Option 2", "Option 3"], l = e.orientation || "vertical", p = e.itemGap !== void 0 ? e.itemGap : 16, c = e.activeColor || "#3b82f6", d = e.inactiveColor || "#4b5563", u = e.textColor || "#ffffff", v = e.fontSize || 14, b = e.fontFamily || "Inter", m = e.fontWeight || 400;
|
|
4627
4627
|
e.disabled && (t.globalAlpha *= 0.5);
|
|
4628
4628
|
const y = 8, S = y * 2;
|
|
4629
4629
|
if (t.save(), t.font = `${m} ${v}px "${b}", sans-serif`, t.textBaseline = "middle", t.textAlign = "left", l === "vertical") {
|
|
4630
4630
|
const M = Math.max(S, v) + p;
|
|
4631
|
-
|
|
4631
|
+
f.forEach((I, k) => {
|
|
4632
4632
|
const T = r + k * M + y;
|
|
4633
4633
|
t.beginPath(), t.arc(a + y, T, y, 0, Math.PI * 2);
|
|
4634
|
-
const L =
|
|
4634
|
+
const L = h === I, P = this.createCanvasFill(t, c, S, S), _ = this.createCanvasFill(t, d, S, S);
|
|
4635
4635
|
L ? (t.strokeStyle = P || c, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(a + y, T, y / 2, 0, Math.PI * 2), t.fillStyle = P || c, t.fill()) : (t.strokeStyle = _ || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(I, a + S + 8, T);
|
|
4636
4636
|
});
|
|
4637
4637
|
} else {
|
|
4638
4638
|
let M = a;
|
|
4639
|
-
|
|
4640
|
-
const k =
|
|
4639
|
+
f.forEach((I) => {
|
|
4640
|
+
const k = h === I, T = t.measureText(I).width;
|
|
4641
4641
|
t.beginPath(), t.arc(M + y, 0, y, 0, Math.PI * 2);
|
|
4642
4642
|
const L = this.createCanvasFill(t, c, S, S), P = this.createCanvasFill(t, d, S, S);
|
|
4643
4643
|
k ? (t.strokeStyle = L || c, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(M + y, 0, y / 2, 0, Math.PI * 2), t.fillStyle = L || c, t.fill()) : (t.strokeStyle = P || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(I, M + S + 6, 0), M += S + 6 + T + p;
|
|
@@ -4715,12 +4715,12 @@ class ci {
|
|
|
4715
4715
|
}
|
|
4716
4716
|
P.beginPath(), Y ? (P.moveTo(_, E + W), P.lineTo(_, E + z), P.quadraticCurveTo(_, E, _ + z, E), P.lineTo(_ + A - z, E), P.quadraticCurveTo(_ + A, E, _ + A, E + z), P.lineTo(_ + A, E + W), P.lineTo(_, E + W)) : (P.moveTo(_, E), P.lineTo(_ + A - z, E), P.quadraticCurveTo(_ + A, E, _ + A, E + z), P.lineTo(_ + A, E + W - z), P.quadraticCurveTo(_ + A, E + W, _ + A - z, E + W), P.lineTo(_, E + W), P.lineTo(_, E)), P.closePath();
|
|
4717
4717
|
}
|
|
4718
|
-
}, n = s.width, a = s.height, r = -n / 2,
|
|
4718
|
+
}, n = s.width, a = s.height, r = -n / 2, h = -a / 2;
|
|
4719
4719
|
if (!s.datasets || s.datasets.length === 0 || s.categories.length === 0) {
|
|
4720
4720
|
t.save(), t.fillStyle = "rgba(99,102,241,0.7)", t.font = "bold 11px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("NO CHART DATA", 0, 0), t.restore();
|
|
4721
4721
|
return;
|
|
4722
4722
|
}
|
|
4723
|
-
const
|
|
4723
|
+
const f = s._getPreset();
|
|
4724
4724
|
let l = -1 / 0, p = 1 / 0;
|
|
4725
4725
|
const c = s.categories.length, d = s.datasets.length;
|
|
4726
4726
|
if (s.chartType === "stacked")
|
|
@@ -4740,19 +4740,19 @@ class ci {
|
|
|
4740
4740
|
isFinite(l) || (l = 10), isFinite(p) || (p = 0), l = Math.max(l, 0), p = Math.min(p, 0);
|
|
4741
4741
|
const u = l - p || 10;
|
|
4742
4742
|
t.save(), s.enableShadows && (t.shadowColor = s.shadowColor, t.shadowBlur = s.shadowBlur, t.shadowOffsetY = s.shadowOffsetY), t.font = s.axisLabelFontSize + "px Inter, sans-serif";
|
|
4743
|
-
const v = s.showYLabels ? t.measureText(l.toFixed(0)).width + 14 : 10, b = s.showXLabels ? s.axisLabelFontSize + 12 : 8, y = (s.showLegend && d > 0 ? s.legendFontSize + 10 : 0) + 8, S = 10, C = r + v, w =
|
|
4744
|
-
if (s.enableShadows && (t.shadowColor = "transparent"), t.beginPath(), t.roundRect(r,
|
|
4743
|
+
const v = s.showYLabels ? t.measureText(l.toFixed(0)).width + 14 : 10, b = s.showXLabels ? s.axisLabelFontSize + 12 : 8, y = (s.showLegend && d > 0 ? s.legendFontSize + 10 : 0) + 8, S = 10, C = r + v, w = h + y, M = n - v - S, I = a - y - b;
|
|
4744
|
+
if (s.enableShadows && (t.shadowColor = "transparent"), t.beginPath(), t.roundRect(r, h, n, a, 10), t.fillStyle = f.cardBackground, t.fill(), t.strokeStyle = f.cardBorderColor, t.lineWidth = 1, t.stroke(), s.chartBackground && s.chartBackground !== "transparent" && (t.beginPath(), t.rect(C, w, M, I), t.fillStyle = s.chartBackground, t.fill()), s.showLegend && d > 0) {
|
|
4745
4745
|
t.font = s.legendFontSize + "px Inter, sans-serif", t.textBaseline = "middle";
|
|
4746
|
-
const P =
|
|
4746
|
+
const P = h + 12;
|
|
4747
4747
|
let _ = C;
|
|
4748
4748
|
s.datasets.forEach((E, A) => {
|
|
4749
4749
|
const W = s._resolveColor(E.color, A), z = E.label || "Series " + (A + 1), Y = 7;
|
|
4750
|
-
t.beginPath(), t.roundRect(_, P - Y / 2, Y, Y, 2), t.fillStyle = W, t.fill(), t.fillStyle =
|
|
4750
|
+
t.beginPath(), t.roundRect(_, P - Y / 2, Y, Y, 2), t.fillStyle = W, t.fill(), t.fillStyle = f.legendColor, t.textAlign = "left", t.fillText(z, _ + Y + 4, P), _ += t.measureText(z).width + Y + 16;
|
|
4751
4751
|
});
|
|
4752
4752
|
}
|
|
4753
4753
|
const k = 4;
|
|
4754
4754
|
if (s.showGridLines) {
|
|
4755
|
-
t.setLineDash(s.gridLineDash || []), t.lineWidth = s.gridLineWidth || 1, t.strokeStyle =
|
|
4755
|
+
t.setLineDash(s.gridLineDash || []), t.lineWidth = s.gridLineWidth || 1, t.strokeStyle = f.gridColor;
|
|
4756
4756
|
for (let P = 0; P <= k; P++)
|
|
4757
4757
|
if (s.orientation === "horizontal") {
|
|
4758
4758
|
const _ = C + P / k * M;
|
|
@@ -4764,7 +4764,7 @@ class ci {
|
|
|
4764
4764
|
t.setLineDash([]);
|
|
4765
4765
|
}
|
|
4766
4766
|
if (s.showYLabels) {
|
|
4767
|
-
t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle =
|
|
4767
|
+
t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = f.axisLabelColor;
|
|
4768
4768
|
for (let P = 0; P <= k; P++)
|
|
4769
4769
|
if (s.orientation === "horizontal") {
|
|
4770
4770
|
const _ = p + P / k * u, E = C + P / k * M;
|
|
@@ -4779,7 +4779,7 @@ class ci {
|
|
|
4779
4779
|
const P = I / c;
|
|
4780
4780
|
for (let _ = 0; _ < c; _++) {
|
|
4781
4781
|
const E = w + _ * P + P / 2;
|
|
4782
|
-
s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle =
|
|
4782
|
+
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[_] || "", C - 5, E), s.enableShadows && (t.shadowColor = s.shadowColor));
|
|
4783
4783
|
let A = C;
|
|
4784
4784
|
s.datasets.forEach((W, z) => {
|
|
4785
4785
|
const Y = W.data[_] ?? 0;
|
|
@@ -4794,7 +4794,7 @@ class ci {
|
|
|
4794
4794
|
const P = M / c;
|
|
4795
4795
|
for (let _ = 0; _ < c; _++) {
|
|
4796
4796
|
const E = C + _ * P + P / 2;
|
|
4797
|
-
s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle =
|
|
4797
|
+
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[_] || "", E, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
|
|
4798
4798
|
let A = w + I;
|
|
4799
4799
|
s.datasets.forEach((W, z) => {
|
|
4800
4800
|
const Y = W.data[_] ?? 0;
|
|
@@ -4810,7 +4810,7 @@ class ci {
|
|
|
4810
4810
|
const P = I / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = C + (0 - p) / u * M;
|
|
4811
4811
|
for (let A = 0; A < c; A++) {
|
|
4812
4812
|
const W = w + A * P + P / 2;
|
|
4813
|
-
s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle =
|
|
4813
|
+
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
4814
|
const z = W - _ / 2;
|
|
4815
4815
|
s.datasets.forEach((Y, G) => {
|
|
4816
4816
|
const N = Y.data[A] ?? 0, J = Math.abs(N / u * M);
|
|
@@ -4823,7 +4823,7 @@ class ci {
|
|
|
4823
4823
|
const P = M / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = w + I - (0 - p) / u * I;
|
|
4824
4824
|
for (let A = 0; A < c; A++) {
|
|
4825
4825
|
const W = C + A * P + P / 2;
|
|
4826
|
-
s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle =
|
|
4826
|
+
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
4827
|
const z = W - _ / 2;
|
|
4828
4828
|
s.datasets.forEach((Y, G) => {
|
|
4829
4829
|
const N = Y.data[A] ?? 0, J = Math.abs(N / u * I);
|
|
@@ -4872,9 +4872,9 @@ class ci {
|
|
|
4872
4872
|
t.save(), t.fillStyle = "rgba(99,102,241,0.8)", t.font = "bold 11px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("EMPTY DATA", 0, 0), t.restore();
|
|
4873
4873
|
return;
|
|
4874
4874
|
}
|
|
4875
|
-
const
|
|
4876
|
-
t.save(), t.beginPath(), t.roundRect(-n / 2, -a / 2, n, a, 10), t.fillStyle =
|
|
4877
|
-
const
|
|
4875
|
+
const h = s._getPreset();
|
|
4876
|
+
t.save(), t.beginPath(), t.roundRect(-n / 2, -a / 2, n, a, 10), t.fillStyle = h.cardBackground, t.fill(), t.strokeStyle = h.cardBorderColor, t.lineWidth = 1, t.stroke();
|
|
4877
|
+
const f = s.showLegend ? Math.ceil(s.slices.length / 2) : 0, l = f > 0 ? f * (s.legendFontSize + 8) + 10 : 0, p = a - l - 16, c = Math.min(n - 24, p) / 2, d = 0, u = -l / 2;
|
|
4878
4878
|
if (s.chartType === "rose") {
|
|
4879
4879
|
const m = Math.max(...s.slices.map((C) => C.value || 0)), y = Math.PI * 2 / s.slices.length, S = c > 0 ? s.sliceGap / c : 0;
|
|
4880
4880
|
s.slices.forEach((C, w) => {
|
|
@@ -4883,7 +4883,7 @@ class ci {
|
|
|
4883
4883
|
const I = M / m * c, k = -Math.PI / 2 + w * y + S / 2, T = k + y - S, L = s._resolveSliceColor(C, w);
|
|
4884
4884
|
if (t.beginPath(), t.moveTo(d, u), t.arc(d, u, I, k, T), t.closePath(), t.fillStyle = L + "cc", t.fill(), t.strokeStyle = L, t.lineWidth = 1.5, t.stroke(), s.showLabels) {
|
|
4885
4885
|
const P = k + (T - k) / 2, _ = d + I * 0.65 * Math.cos(P), E = u + I * 0.65 * Math.sin(P), A = Math.round(M / r * 100);
|
|
4886
|
-
t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle =
|
|
4886
|
+
t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = h.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${A}%`, _, E), t.restore();
|
|
4887
4887
|
}
|
|
4888
4888
|
});
|
|
4889
4889
|
} else {
|
|
@@ -4903,12 +4903,12 @@ class ci {
|
|
|
4903
4903
|
const P = s._resolveSliceColor(w, M);
|
|
4904
4904
|
if (t.beginPath(), t.fillStyle = P, y <= 0 ? (t.moveTo(d, u), t.arc(d, u, c, T, L), t.lineTo(d, u)) : (t.moveTo(d + c * Math.cos(T), u + c * Math.sin(T)), t.arc(d, u, c, T, L), t.arc(d, u, y, L, T, !0), t.closePath()), t.fill(), s.showLabels) {
|
|
4905
4905
|
const _ = T + (L - T) / 2, E = y + (c - y) / 2, A = d + E * Math.cos(_), W = u + E * Math.sin(_), z = Math.round(I / r * 100);
|
|
4906
|
-
t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle =
|
|
4906
|
+
t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = h.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${z}%`, A, W), t.restore();
|
|
4907
4907
|
}
|
|
4908
4908
|
C += k;
|
|
4909
4909
|
}), s.chartType === "donut" && s.showCenterText && y > 14) {
|
|
4910
4910
|
const w = Math.round(r), M = Math.min(Math.floor(y * 0.52), 20), I = Math.min(Math.floor(y * 0.26), 10);
|
|
4911
|
-
t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${M}px Inter, sans-serif`, t.fillStyle =
|
|
4911
|
+
t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${M}px Inter, sans-serif`, t.fillStyle = h.centerTextColor, t.fillText(w.toString(), d, u - I * 0.5), s.centerLabel && (t.font = `${I}px Inter, sans-serif`, t.fillStyle = h.centerLabelColor, t.fillText(s.centerLabel, d, u + M * 0.6));
|
|
4912
4912
|
}
|
|
4913
4913
|
}
|
|
4914
4914
|
if (s.showLegend && s.slices.length > 0) {
|
|
@@ -4916,7 +4916,7 @@ class ci {
|
|
|
4916
4916
|
const m = 2, y = n / m, S = s.legendFontSize + 8, C = a / 2 - l + 10, w = -n / 2 + 10;
|
|
4917
4917
|
s.slices.forEach((M, I) => {
|
|
4918
4918
|
const k = I % m, T = Math.floor(I / m), L = w + k * y, P = C + T * S, _ = s._resolveSliceColor(M, I), E = 7;
|
|
4919
|
-
t.beginPath(), t.roundRect(L, P - E / 2, E, E, 2), t.fillStyle = _, t.fill(), t.textAlign = "left", t.textBaseline = "middle", t.fillStyle =
|
|
4919
|
+
t.beginPath(), t.roundRect(L, P - E / 2, E, E, 2), t.fillStyle = _, t.fill(), t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = h.legendColor;
|
|
4920
4920
|
const A = Math.round((M.value || 0) / r * 100), W = `${M.label || "Item"} ${A}%`, z = y - E - 20;
|
|
4921
4921
|
let Y = W;
|
|
4922
4922
|
for (; t.measureText(Y).width > z && Y.length > 4; )
|
|
@@ -4929,21 +4929,21 @@ class ci {
|
|
|
4929
4929
|
renderJoystick(t, i) {
|
|
4930
4930
|
var u, v, b, m, y;
|
|
4931
4931
|
const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.width) !== void 0 ? o.width : ((u = i.geometry) == null ? void 0 : u.width) ?? i.width ?? 100, s = (o == null ? void 0 : o.height) !== void 0 ? o.height : ((v = i.geometry) == null ? void 0 : v.height) ?? i.height ?? 100, n = Math.min(e, s) * 0.45, a = Math.min(e, s) * 0.15;
|
|
4932
|
-
let r = i.handleX || 0,
|
|
4933
|
-
o && o.handleX !== void 0 && (r = o.handleX), o && o.handleY !== void 0 && (
|
|
4934
|
-
let
|
|
4935
|
-
i.handleOrigin === "top-left" ? (
|
|
4932
|
+
let r = i.handleX || 0, h = i.handleY || 0;
|
|
4933
|
+
o && o.handleX !== void 0 && (r = o.handleX), o && o.handleY !== void 0 && (h = o.handleY), t.save();
|
|
4934
|
+
let f = 0, l = 0;
|
|
4935
|
+
i.handleOrigin === "top-left" ? (f = e / 2, l = s / 2) : i.handleOrigin === "bottom-right" && (f = -e / 2, l = -s / 2), t.translate(f, l), t.beginPath(), i.boundsShape === "square" ? t.rect(-n, -n, n * 2, n * 2) : t.arc(0, 0, n, 0, Math.PI * 2), t.fillStyle = "rgba(0,0,0,0.2)", (b = i.style) != null && b.fill && typeof i.style.fill == "string" ? t.fillStyle = i.style.fill : (m = i.style) != null && m.fill && i.style.fill.type === "solid" && (t.fillStyle = i.style.fill.color), t.fill(), (y = i.style) != null && y.stroke && i.style.stroke.isEnabled !== !1 && (t.lineWidth = i.style.stroke.width || 1, t.strokeStyle = i.style.stroke.color || "#000", t.stroke());
|
|
4936
4936
|
const p = n - a;
|
|
4937
4937
|
let c = 0, d = 0;
|
|
4938
|
-
i.joystickType === "2D" ? (c = r * p, d =
|
|
4938
|
+
i.joystickType === "2D" ? (c = r * p, d = h * p) : i.joystickType === "1D_X" ? (c = r * p, d = 0) : i.joystickType === "1D_Y" && (c = 0, d = h * p), t.beginPath(), t.arc(c, d, a, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill(), t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1, t.stroke(), t.restore();
|
|
4939
4939
|
}
|
|
4940
4940
|
getRadioGroupItemIndexAtPointer(t, i, o) {
|
|
4941
4941
|
var I, k;
|
|
4942
4942
|
const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.optionsList || [];
|
|
4943
4943
|
if (n.length === 0) return null;
|
|
4944
|
-
const a = s.width !== void 0 ? s.width : ((I = t.geometry) == null ? void 0 : I.width) || 180, r = s.height !== void 0 ? s.height : ((k = t.geometry) == null ? void 0 : k.height) || 100,
|
|
4945
|
-
if (
|
|
4946
|
-
const T = Math.max(C, l) +
|
|
4944
|
+
const a = s.width !== void 0 ? s.width : ((I = t.geometry) == null ? void 0 : I.width) || 180, r = s.height !== void 0 ? s.height : ((k = t.geometry) == null ? void 0 : k.height) || 100, h = e.orientation || "vertical", f = e.itemGap !== void 0 ? e.itemGap : 16, l = e.fontSize || 14, p = this.getWorldTransform(t.id), c = i - p.x, d = o - p.y, u = -p.rotation * (Math.PI / 180), v = Math.cos(u), b = Math.sin(u), m = c * v - d * b, y = c * b + d * v, C = 8 * 2, w = -a / 2, M = -r / 2;
|
|
4945
|
+
if (h === "vertical") {
|
|
4946
|
+
const T = Math.max(C, l) + f;
|
|
4947
4947
|
for (let L = 0; L < n.length; L++) {
|
|
4948
4948
|
const P = M + L * T;
|
|
4949
4949
|
if (m >= w && m <= w + a && y >= P && y <= P + T)
|
|
@@ -4952,7 +4952,7 @@ class ci {
|
|
|
4952
4952
|
} else {
|
|
4953
4953
|
let T = w;
|
|
4954
4954
|
for (let L = 0; L < n.length; L++) {
|
|
4955
|
-
const _ = n[L].length * 8, E = C + 6 + _ +
|
|
4955
|
+
const _ = n[L].length * 8, E = C + 6 + _ + f;
|
|
4956
4956
|
if (m >= T && m <= T + E && y >= M && y <= M + r)
|
|
4957
4957
|
return L;
|
|
4958
4958
|
T += E;
|
|
@@ -4997,10 +4997,10 @@ class ci {
|
|
|
4997
4997
|
}
|
|
4998
4998
|
u._resolvedData = v;
|
|
4999
4999
|
}), r < 2) return;
|
|
5000
|
-
const
|
|
5001
|
-
const v =
|
|
5000
|
+
const h = a - n, f = o / (r - 1), l = (u) => {
|
|
5001
|
+
const v = h === 0 ? 0.5 : (u - n) / h;
|
|
5002
5002
|
return e / 2 - v * e;
|
|
5003
|
-
}, p = (u) => u *
|
|
5003
|
+
}, p = (u) => u * f - o / 2, c = i.axisColor || "#333333";
|
|
5004
5004
|
if (i.showXAxis && (t.beginPath(), t.strokeStyle = i.xAxisColor || c, t.lineWidth = 1, t.moveTo(-o / 2, e / 2), t.lineTo(o / 2, e / 2), t.stroke()), i.showYAxis && (t.beginPath(), t.strokeStyle = i.yAxisColor || c, t.lineWidth = 1, t.moveTo(-o / 2, -e / 2), t.lineTo(-o / 2, e / 2), t.stroke()), t.fillStyle = i.axisLabelColor || "#333333", t.font = `${i.axisLabelFontSize || 10}px Inter, sans-serif`, i.showXLabels) {
|
|
5005
5005
|
t.textAlign = "center", t.textBaseline = "top";
|
|
5006
5006
|
for (let u = 0; u < r; u++) {
|
|
@@ -5060,8 +5060,8 @@ class ci {
|
|
|
5060
5060
|
}
|
|
5061
5061
|
}
|
|
5062
5062
|
_catmullRom(t, i, o, e, s) {
|
|
5063
|
-
const n = (o - t) * 0.5, a = (e - i) * 0.5, r = s * s,
|
|
5064
|
-
return (2 * i - 2 * o + n + a) *
|
|
5063
|
+
const n = (o - t) * 0.5, a = (e - i) * 0.5, r = s * s, h = s * r;
|
|
5064
|
+
return (2 * i - 2 * o + n + a) * h + (-3 * i + 3 * o - 2 * n - a) * r + n * s + i;
|
|
5065
5065
|
}
|
|
5066
5066
|
normalizeOpacity(t) {
|
|
5067
5067
|
const i = typeof t == "number" ? t : parseFloat(String(t));
|
|
@@ -5072,19 +5072,19 @@ class ci {
|
|
|
5072
5072
|
if (!i || i.type === "None") return null;
|
|
5073
5073
|
if (typeof i == "string") return i;
|
|
5074
5074
|
if (i.type === "Solid" && i.color) {
|
|
5075
|
-
const r = i.color,
|
|
5076
|
-
return t.fillStyle =
|
|
5075
|
+
const r = i.color, f = (((n = (s = this.artboard) == null ? void 0 : s.tokens) == null ? void 0 : n.colors) || {})[r] || r;
|
|
5076
|
+
return t.fillStyle = f, f;
|
|
5077
5077
|
}
|
|
5078
5078
|
if ((i.type === "LinearGradient" || i.type === "RadialGradient" || i.type === "AngularGradient" || i.type === "DiamondGradient") && i.stops) {
|
|
5079
|
-
const r = (
|
|
5079
|
+
const r = (h, f = 100) => {
|
|
5080
5080
|
var S, C;
|
|
5081
|
-
const p = (((C = (S = this.artboard) == null ? void 0 : S.tokens) == null ? void 0 : C.colors) || {})[
|
|
5081
|
+
const p = (((C = (S = this.artboard) == null ? void 0 : S.tokens) == null ? void 0 : C.colors) || {})[h] || h, c = this.normalizeOpacity(i.opacity ?? 100), u = this.normalizeOpacity(f) * c;
|
|
5082
5082
|
if (u >= 1 && p.startsWith("#")) return p;
|
|
5083
5083
|
const v = p.startsWith("#") ? p.replace("#", "") : "ffffff", b = parseInt(v.substring(0, 2), 16), m = parseInt(v.substring(2, 4), 16), y = parseInt(v.substring(4, 6), 16);
|
|
5084
5084
|
return `rgba(${b}, ${m}, ${y}, ${u})`;
|
|
5085
5085
|
};
|
|
5086
5086
|
if (i.type === "LinearGradient") {
|
|
5087
|
-
const
|
|
5087
|
+
const h = (u, v, b) => Array.isArray(u) ? u[v] ?? (v === 0 ? 0 : 1) : u && typeof u == "object" ? u[b] ?? (v === 0 ? 0 : 1) : v === 0 ? 0 : 1, f = h(i.start, 0, "x") * o - o / 2, l = h(i.start, 1, "y") * e - e / 2, p = h(i.end, 0, "x") * o - o / 2, c = h(i.end, 1, "y") * e - e / 2, d = t.createLinearGradient(f, l, p, c);
|
|
5088
5088
|
if (i.stops.forEach((u) => {
|
|
5089
5089
|
const v = u.offset !== void 0 ? u.offset : u.pos !== void 0 ? u.pos : u.position !== void 0 ? u.position : 0, b = r(u.color || "#000000", u.opacity ?? 100);
|
|
5090
5090
|
d.addColorStop(Math.max(0, Math.min(1, v)), b);
|
|
@@ -5094,7 +5094,7 @@ class ci {
|
|
|
5094
5094
|
}
|
|
5095
5095
|
return d;
|
|
5096
5096
|
} else if (i.type === "RadialGradient") {
|
|
5097
|
-
const
|
|
5097
|
+
const h = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, f = h(i.center, 0, "x") * o - o / 2, l = h(i.center, 1, "y") * e - e / 2, p = (i.radius ?? 0.5) * Math.max(o, e), c = t.createRadialGradient(f, l, 0, f, l, p);
|
|
5098
5098
|
if (i.stops.forEach((d) => {
|
|
5099
5099
|
const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, v = r(d.color || "#000000", d.opacity ?? 100);
|
|
5100
5100
|
c.addColorStop(Math.max(0, Math.min(1, u)), v);
|
|
@@ -5104,7 +5104,7 @@ class ci {
|
|
|
5104
5104
|
}
|
|
5105
5105
|
return c;
|
|
5106
5106
|
} else if (i.type === "AngularGradient") {
|
|
5107
|
-
const
|
|
5107
|
+
const h = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, f = h(i.center || [0.5, 0.5], 0, "x") * o - o / 2, l = h(i.center || [0.5, 0.5], 1, "y") * e - e / 2, p = (i.degree || i.angle || 0) * (Math.PI / 180), c = (a = t.createConicGradient) == null ? void 0 : a.call(t, p, f, l);
|
|
5108
5108
|
if (c) {
|
|
5109
5109
|
if (i.stops.forEach((d) => {
|
|
5110
5110
|
const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, v = r(d.color || "#000000", d.opacity ?? 100);
|
|
@@ -5116,8 +5116,8 @@ class ci {
|
|
|
5116
5116
|
return c;
|
|
5117
5117
|
}
|
|
5118
5118
|
} else if (i.type === "DiamondGradient") {
|
|
5119
|
-
const
|
|
5120
|
-
t.save(), t.translate(
|
|
5119
|
+
const h = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, f = h(i.center || [0.5, 0.5], 0, "x") * o - o / 2, l = h(i.center || [0.5, 0.5], 1, "y") * e - e / 2, p = (i.radius ?? 0.5) * Math.max(o, e);
|
|
5120
|
+
t.save(), t.translate(f, l), t.rotate(Math.PI / 4);
|
|
5121
5121
|
const c = t.createRadialGradient(0, 0, 0, 0, 0, p);
|
|
5122
5122
|
if (i.stops.forEach((d) => {
|
|
5123
5123
|
const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, v = r(d.color || "#000000", d.opacity ?? 100);
|
|
@@ -5132,12 +5132,12 @@ class ci {
|
|
|
5132
5132
|
if (i.type === "Pattern" && i.url) {
|
|
5133
5133
|
let r = this.imageCache.get(i.url);
|
|
5134
5134
|
if (r || (r = new Image(), r.src = i.url, this.imageCache.set(i.url, r)), r.complete && r.naturalWidth > 0) {
|
|
5135
|
-
const
|
|
5136
|
-
if (
|
|
5137
|
-
const
|
|
5138
|
-
|
|
5135
|
+
const h = t.createPattern(r, "repeat");
|
|
5136
|
+
if (h && (i.scaleX !== void 0 || i.offsetX !== void 0)) {
|
|
5137
|
+
const f = new DOMMatrix(), l = i.scaleX ?? 1, p = i.scaleY ?? 1, c = i.offsetX ?? 0, d = i.offsetY ?? 0, u = i.rotation ?? 0;
|
|
5138
|
+
f.translateSelf(c, d), f.rotateSelf(u), f.scaleSelf(l, p), h.setTransform(f);
|
|
5139
5139
|
}
|
|
5140
|
-
return
|
|
5140
|
+
return h;
|
|
5141
5141
|
}
|
|
5142
5142
|
}
|
|
5143
5143
|
return i.color || null;
|
|
@@ -5154,43 +5154,43 @@ class ci {
|
|
|
5154
5154
|
} catch {
|
|
5155
5155
|
a = parseFloat(a) || 0;
|
|
5156
5156
|
}
|
|
5157
|
-
let r = 0,
|
|
5158
|
-
typeof a == "number" ? r =
|
|
5157
|
+
let r = 0, h = 0, f = 0, l = 0;
|
|
5158
|
+
typeof a == "number" ? r = h = f = l = a : Array.isArray(a) ? a.length === 1 ? r = h = f = l = a[0] : a.length === 2 ? (r = f = a[0], h = l = a[1]) : a.length === 3 ? (r = a[0], h = l = a[1], f = a[2]) : a.length >= 4 && (r = a[0], h = a[1], f = a[2], l = a[3]) : a && typeof a == "object" && (r = a.tl ?? a.corner_radius ?? a.cornerRadius ?? 0, h = a.tr ?? a.corner_radius ?? a.cornerRadius ?? 0, f = a.br ?? a.corner_radius ?? a.cornerRadius ?? 0, l = a.bl ?? a.corner_radius ?? a.cornerRadius ?? 0);
|
|
5159
5159
|
const p = Math.min(Math.abs(e) / 2, Math.abs(s) / 2);
|
|
5160
|
-
if (r = Math.min(Math.max(0, r), p),
|
|
5161
|
-
t.roundRect(i, o, e, s, [r,
|
|
5160
|
+
if (r = Math.min(Math.max(0, r), p), h = Math.min(Math.max(0, h), p), f = Math.min(Math.max(0, f), p), l = Math.min(Math.max(0, l), p), t.roundRect) {
|
|
5161
|
+
t.roundRect(i, o, e, s, [r, h, f, l]);
|
|
5162
5162
|
return;
|
|
5163
5163
|
}
|
|
5164
|
-
t.moveTo(i + r, o), t.lineTo(i + e -
|
|
5164
|
+
t.moveTo(i + r, o), t.lineTo(i + e - h, o), t.arcTo(i + e, o, i + e, o + h, h), t.lineTo(i + e, o + s - f), t.arcTo(i + e, o + s, i + e - f, o + s, f), t.lineTo(i + l, o + s), t.arcTo(i, o + s, i, o + s - l, l), t.lineTo(i, o + r), t.arcTo(i, o, i + r, o, r), t.closePath();
|
|
5165
5165
|
}
|
|
5166
5166
|
renderListView(t, i) {
|
|
5167
5167
|
var A, W, z, Y;
|
|
5168
|
-
const o = this.objectStates.get(i.id) || {}, e = o.options || i.options || {}, s = o.width !== void 0 ? o.width : ((A = i.geometry) == null ? void 0 : A.width) || 200, n = o.height !== void 0 ? o.height : ((W = i.geometry) == null ? void 0 : W.height) || 300, a = -s / 2, r = -n / 2,
|
|
5168
|
+
const o = this.objectStates.get(i.id) || {}, e = o.options || i.options || {}, s = o.width !== void 0 ? o.width : ((A = i.geometry) == null ? void 0 : A.width) || 200, n = o.height !== void 0 ? o.height : ((W = i.geometry) == null ? void 0 : W.height) || 300, a = -s / 2, r = -n / 2, h = o.corner_radius !== void 0 ? o.corner_radius : e.corner_radius ?? 0, f = e.orientation || "vertical", l = e.items || [], p = e.itemGap ?? 10, c = e.itemHeight ?? 50, d = e.itemWidth ?? 200, u = e.scrollOffset ?? 0, v = e.padding ?? 0, b = e.glassEffect !== !1, m = e.accentColor || "#3b82f6", y = e.itemTextColor || "#333333", S = e.itemBackgroundColor || "#ffffff", C = e.hoveredIndex ?? null, w = e.activeItemIndex ?? null, M = e.glowIntensity ?? 0, I = e.glowColor || "#3b82f6", k = typeof I == "string" ? I : I.color || ((Y = (z = I.stops) == null ? void 0 : z[0]) == null ? void 0 : Y.color) || "#3b82f6", T = e.opacity !== void 0 ? e.opacity : i.opacity !== void 0 ? i.opacity : 1;
|
|
5169
5169
|
if (t.save(), t.globalAlpha *= T, M > 0) {
|
|
5170
5170
|
const G = t.getTransform(), N = Math.sqrt(G.a * G.a + G.b * G.b) || 1;
|
|
5171
5171
|
t.shadowColor = k, t.shadowBlur = M * 2 * N, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
|
|
5172
5172
|
}
|
|
5173
5173
|
if (b) {
|
|
5174
5174
|
const G = e.listBackgroundColor || "rgba(31, 41, 55, 0.4)", N = this.createCanvasFill(t, G, s, n);
|
|
5175
|
-
t.fillStyle = N || "rgba(31, 41, 55, 0.4)", t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n,
|
|
5175
|
+
t.fillStyle = N || "rgba(31, 41, 55, 0.4)", t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h) || t.fill();
|
|
5176
5176
|
const x = t.createLinearGradient(a, r, a + s, r + n);
|
|
5177
|
-
x.addColorStop(0, "rgba(255, 255, 255, 0.15)"), x.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), x.addColorStop(1, "rgba(255, 255, 255, 0.03)"), t.fillStyle = x, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n,
|
|
5177
|
+
x.addColorStop(0, "rgba(255, 255, 255, 0.15)"), x.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), x.addColorStop(1, "rgba(255, 255, 255, 0.03)"), t.fillStyle = x, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h) || t.fill(), t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h) || t.stroke();
|
|
5178
5178
|
} else {
|
|
5179
5179
|
const G = e.backgroundColor || e.listBackgroundColor || "transparent", N = this.createCanvasFill(t, G, s, n);
|
|
5180
5180
|
if (N) {
|
|
5181
5181
|
t.fillStyle = N, t.beginPath();
|
|
5182
|
-
const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n,
|
|
5182
|
+
const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
|
|
5183
5183
|
t.fill();
|
|
5184
5184
|
}
|
|
5185
5185
|
const J = e.borderWidth ?? 0;
|
|
5186
5186
|
if (J > 0) {
|
|
5187
5187
|
t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth = J, t.beginPath();
|
|
5188
|
-
const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n,
|
|
5188
|
+
const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
|
|
5189
5189
|
t.stroke();
|
|
5190
5190
|
}
|
|
5191
5191
|
}
|
|
5192
5192
|
t.shadowBlur = 0, t.save(), t.beginPath();
|
|
5193
|
-
const L = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n,
|
|
5193
|
+
const L = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
|
|
5194
5194
|
if (e.listLayout !== "circular")
|
|
5195
5195
|
if (L && e.containerShape === "custom")
|
|
5196
5196
|
try {
|
|
@@ -5200,55 +5200,55 @@ class ci {
|
|
|
5200
5200
|
}
|
|
5201
5201
|
else
|
|
5202
5202
|
t.clip();
|
|
5203
|
-
const P = typeof v == "number" ? v :
|
|
5204
|
-
let _ = (
|
|
5203
|
+
const P = typeof v == "number" ? v : f === "vertical" ? v[0] : v[3];
|
|
5204
|
+
let _ = (f === "vertical" ? r : a) + u + P;
|
|
5205
5205
|
if (t.textBaseline = "middle", l.forEach((G, N) => {
|
|
5206
|
-
const J = e.listLayout || "linear", x = J === "circular" ? d :
|
|
5206
|
+
const J = e.listLayout || "linear", x = J === "circular" ? d : f === "vertical" ? s : d, F = J === "circular" || f === "vertical" ? c : n;
|
|
5207
5207
|
let j = 0, X = 0, tt = 0;
|
|
5208
5208
|
if (J === "circular") {
|
|
5209
|
-
const St = l.length || 1, Xt = Math.PI * 2 / St, le = e.circularStartAngle || 0,
|
|
5210
|
-
j =
|
|
5209
|
+
const St = l.length || 1, Xt = Math.PI * 2 / St, le = e.circularStartAngle || 0, fe = e.circularRadius || 100, et = u * 0.01 + le * Math.PI / 180, mt = N * Xt + et, Rt = a + s / 2, _t = r + n / 2;
|
|
5210
|
+
j = Rt + Math.cos(mt) * fe - x / 2, X = _t + Math.sin(mt) * fe - F / 2, tt = mt + (e.itemRotation || 0) * Math.PI / 180;
|
|
5211
5211
|
} else
|
|
5212
|
-
j =
|
|
5213
|
-
const
|
|
5214
|
-
if (t.save(), tt !== 0 && (t.translate(j + x / 2, X + F / 2), t.rotate(tt), t.translate(-(j + x / 2), -(X + F / 2))),
|
|
5212
|
+
j = f === "vertical" ? a : _, X = f === "vertical" ? _ : r, tt = (e.itemRotation || 0) * Math.PI / 180;
|
|
5213
|
+
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(), tt !== 0 && (t.translate(j + x / 2, X + F / 2), t.rotate(tt), t.translate(-(j + x / 2), -(X + F / 2))), O) {
|
|
5215
5215
|
const St = this.createCanvasFill(t, m, x, F);
|
|
5216
5216
|
t.fillStyle = St || m;
|
|
5217
5217
|
const Xt = t.globalAlpha;
|
|
5218
5218
|
t.globalAlpha = Xt * 0.8, t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill()), t.globalAlpha = Xt;
|
|
5219
|
-
} else if (
|
|
5219
|
+
} else if (R)
|
|
5220
5220
|
t.fillStyle = b ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill());
|
|
5221
5221
|
else if (S !== "transparent") {
|
|
5222
5222
|
const St = this.createCanvasFill(t, S, x, F);
|
|
5223
5223
|
t.fillStyle = St || S, t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill());
|
|
5224
5224
|
}
|
|
5225
|
-
if (
|
|
5226
|
-
const St = this.createCanvasFill(t, m,
|
|
5227
|
-
t.fillStyle = St || m,
|
|
5225
|
+
if (O || R) {
|
|
5226
|
+
const St = this.createCanvasFill(t, m, f === "vertical" ? 3 : x, f === "vertical" ? F : 3);
|
|
5227
|
+
t.fillStyle = St || m, f === "vertical" ? t.fillRect(j, X, 3, F) : t.fillRect(j, X + F - 3, x, 3);
|
|
5228
5228
|
}
|
|
5229
|
-
const yt =
|
|
5230
|
-
t.fillStyle = yt, t.font =
|
|
5231
|
-
const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`, gt = j + (
|
|
5232
|
-
|
|
5229
|
+
const yt = O ? "#ffffff" : b ? "rgba(255, 255, 255, 0.9)" : y;
|
|
5230
|
+
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}`, gt = j + (f === "vertical" ? 16 : x / 2), Et = X + F / 2;
|
|
5232
|
+
f === "horizontal" || J === "circular" ? t.textAlign = "center" : t.textAlign = "left";
|
|
5233
5233
|
const It = J === "circular" ? j + x / 2 : gt;
|
|
5234
|
-
t.fillText(bt, It, Et), t.restore(), _ += (
|
|
5234
|
+
t.fillText(bt, It, Et), t.restore(), _ += (f === "vertical" ? c : d) + p;
|
|
5235
5235
|
}), t.restore(), e.showScrollbar !== !1) {
|
|
5236
|
-
const G = (l.length || 0) * (
|
|
5236
|
+
const G = (l.length || 0) * (f === "vertical" ? c : d) + ((l.length || 0) - 1) * p, N = f === "vertical" ? n : s, J = e.listLayout || "linear", x = e.containerShape === "circle" || J === "circular";
|
|
5237
5237
|
if (G > N || J === "circular" && l.length > 0) {
|
|
5238
5238
|
const F = e.scrollbarColor || "rgba(255,255,255,0.3)", j = e.scrollbarWidth || 4;
|
|
5239
5239
|
if (x) {
|
|
5240
|
-
const X = Math.min(s, n) / 2 - j / 2 - 2, tt = a + s / 2,
|
|
5240
|
+
const X = Math.min(s, n) / 2 - j / 2 - 2, tt = a + s / 2, R = r + n / 2;
|
|
5241
5241
|
if (t.strokeStyle = F, t.lineWidth = j, t.lineCap = "round", t.beginPath(), J === "circular") {
|
|
5242
|
-
const
|
|
5243
|
-
t.arc(tt,
|
|
5242
|
+
const O = Math.PI / 4, D = -(u * 0.01) - Math.PI / 2;
|
|
5243
|
+
t.arc(tt, R, X, D, D + O);
|
|
5244
5244
|
} else {
|
|
5245
|
-
const
|
|
5246
|
-
t.arc(tt,
|
|
5245
|
+
const O = Math.PI / 2, D = N / G, q = O * D, ot = -u / G * O, bt = -Math.PI / 4 + ot;
|
|
5246
|
+
t.arc(tt, R, X, bt, bt + q);
|
|
5247
5247
|
}
|
|
5248
5248
|
t.stroke();
|
|
5249
5249
|
} else {
|
|
5250
|
-
const X = N / G, tt = N * X,
|
|
5251
|
-
t.fillStyle = F,
|
|
5250
|
+
const X = N / G, tt = N * X, R = -u / G * N;
|
|
5251
|
+
t.fillStyle = F, f === "vertical" ? t.fillRect(a + s - j - 2, r + R, j, tt) : t.fillRect(a + R, r + n - j - 2, tt, j);
|
|
5252
5252
|
}
|
|
5253
5253
|
}
|
|
5254
5254
|
}
|
|
@@ -5256,15 +5256,15 @@ class ci {
|
|
|
5256
5256
|
}
|
|
5257
5257
|
drawCustomShape(t, i, o, e, s, n, a, r) {
|
|
5258
5258
|
if (i === "circle") {
|
|
5259
|
-
const
|
|
5260
|
-
return t.arc(e + n / 2, s + a / 2,
|
|
5259
|
+
const h = Math.min(n, a) / 2;
|
|
5260
|
+
return t.arc(e + n / 2, s + a / 2, h, 0, Math.PI * 2), !1;
|
|
5261
5261
|
} else if (i === "pill") {
|
|
5262
|
-
const
|
|
5263
|
-
return this.drawListViewRect(t, e, s, n, a,
|
|
5262
|
+
const h = Math.min(n, a) / 2;
|
|
5263
|
+
return this.drawListViewRect(t, e, s, n, a, h), !1;
|
|
5264
5264
|
} else if (i === "custom" && o)
|
|
5265
5265
|
try {
|
|
5266
|
-
const
|
|
5267
|
-
return t.save(), t.translate(e, s), t.scale(n / 100, a / 100), t.fill(
|
|
5266
|
+
const h = new Path2D(o);
|
|
5267
|
+
return t.save(), t.translate(e, s), t.scale(n / 100, a / 100), t.fill(h), t.restore(), !0;
|
|
5268
5268
|
} catch {
|
|
5269
5269
|
return this.drawListViewRect(t, e, s, n, a, r), !1;
|
|
5270
5270
|
}
|
|
@@ -5275,10 +5275,10 @@ class ci {
|
|
|
5275
5275
|
if (!this._lastPointerPos || !this._prevPointerPos) return;
|
|
5276
5276
|
const i = t.options || {}, o = i.orientation || "vertical", e = this._lastPointerPos.x - this._prevPointerPos.x, s = this._lastPointerPos.y - this._prevPointerPos.y;
|
|
5277
5277
|
o === "vertical" ? i.scrollOffset = (i.scrollOffset || 0) + s : i.scrollOffset = (i.scrollOffset || 0) + e;
|
|
5278
|
-
const n = i.listLayout || "linear", a = this.objectStates.get(t.id) || {}, r = i.items || [],
|
|
5278
|
+
const n = i.listLayout || "linear", a = this.objectStates.get(t.id) || {}, r = i.items || [], h = i.itemGap ?? 10, f = i.itemHeight ?? 50, l = i.itemWidth ?? 200, p = a.width !== void 0 ? a.width : ((b = t.geometry) == null ? void 0 : b.width) || 200, c = a.height !== void 0 ? a.height : ((m = t.geometry) == null ? void 0 : m.height) || 300;
|
|
5279
5279
|
if (n === "circular")
|
|
5280
5280
|
return;
|
|
5281
|
-
const d = (r.length || 0) * (o === "vertical" ?
|
|
5281
|
+
const d = (r.length || 0) * (o === "vertical" ? f : l) + ((r.length || 0) - 1) * h, v = Math.max(0, d - (o === "vertical" ? c : p) + (i.padding * 2 || 0));
|
|
5282
5282
|
i.scrollOffset > 0 && (i.scrollOffset = 0), i.scrollOffset < -v && (i.scrollOffset = -v);
|
|
5283
5283
|
}
|
|
5284
5284
|
updateListViewHoverFromPointer(t, i, o) {
|
|
@@ -5289,24 +5289,24 @@ class ci {
|
|
|
5289
5289
|
var z, Y;
|
|
5290
5290
|
const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.items || [];
|
|
5291
5291
|
if (n.length === 0) return null;
|
|
5292
|
-
const a = s.width !== void 0 ? s.width : ((z = t.geometry) == null ? void 0 : z.width) || 200, r = s.height !== void 0 ? s.height : ((Y = t.geometry) == null ? void 0 : Y.height) || 300,
|
|
5293
|
-
let T = (
|
|
5292
|
+
const a = s.width !== void 0 ? s.width : ((z = t.geometry) == null ? void 0 : z.width) || 200, r = s.height !== void 0 ? s.height : ((Y = t.geometry) == null ? void 0 : Y.height) || 300, h = e.orientation || "vertical", f = e.itemGap ?? 10, l = e.itemHeight ?? 50, p = e.itemWidth ?? 200, c = e.scrollOffset ?? 0, d = e.padding ?? 0, u = this.getWorldTransform(t.id), v = i - u.x, b = o - u.y, m = -u.rotation * (Math.PI / 180), y = Math.cos(m), S = Math.sin(m), C = v * y - b * S, w = v * S + b * y, M = -a / 2, I = -r / 2, k = typeof d == "number" ? d : h === "vertical" ? d[0] : d[3];
|
|
5293
|
+
let T = (h === "vertical" ? I : M) + c + k;
|
|
5294
5294
|
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
5295
|
for (let G = 0; G < n.length; G++) {
|
|
5296
|
-
const N = L === "circular" ? p :
|
|
5296
|
+
const N = L === "circular" ? p : h === "vertical" ? a : p, J = L === "circular" || h === "vertical" ? l : r;
|
|
5297
5297
|
let x = 0, F = 0, j = 0;
|
|
5298
5298
|
if (L === "circular") {
|
|
5299
|
-
const X = G * _ + W, tt = M + a / 2,
|
|
5300
|
-
x = tt + Math.cos(X) * A - N / 2, F =
|
|
5299
|
+
const X = G * _ + W, tt = M + a / 2, R = I + r / 2;
|
|
5300
|
+
x = tt + Math.cos(X) * A - N / 2, F = R + Math.sin(X) * A - J / 2, j = X + (e.itemRotation || 0) * Math.PI / 180;
|
|
5301
5301
|
} else
|
|
5302
|
-
x =
|
|
5302
|
+
x = h === "vertical" ? M : T, F = h === "vertical" ? T : I, j = (e.itemRotation || 0) * Math.PI / 180;
|
|
5303
5303
|
if (j !== 0) {
|
|
5304
|
-
const X = x + N / 2, tt = F + J / 2,
|
|
5304
|
+
const X = x + N / 2, tt = F + J / 2, R = C - X, O = w - tt, D = -j, q = R * Math.cos(D) - O * Math.sin(D) + X, ot = R * Math.sin(D) + O * Math.cos(D) + tt;
|
|
5305
5305
|
if (q >= x && q <= x + N && ot >= F && ot <= F + J)
|
|
5306
5306
|
return G;
|
|
5307
5307
|
} else if (C >= x && C <= x + N && w >= F && w <= F + J)
|
|
5308
5308
|
return G;
|
|
5309
|
-
T += (
|
|
5309
|
+
T += (h === "vertical" ? l : p) + f;
|
|
5310
5310
|
}
|
|
5311
5311
|
return null;
|
|
5312
5312
|
}
|
|
@@ -5324,28 +5324,28 @@ class ci {
|
|
|
5324
5324
|
if (!e.behaviors || e.behaviors.length === 0) return;
|
|
5325
5325
|
const s = this.objectStates.get(e.id);
|
|
5326
5326
|
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, J, x, F, j, X, tt,
|
|
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, J, x, F, j, X, tt, R, O, D, q, ot, yt, bt, gt, Et, It, St, Xt, le, fe, et, mt, Rt, _t, dt, Ft, Dt, $t, Ot, Vt, ie, me, ye, Ut, Se, Pe, Ee, Ce, Ae, xe, se, jt, ht, pt, at, B, nt, Z, Pt, xt, kt, At, Mt, $, Wt, Kt, te, Jt, ut, ct, Ct, rt, V, st, it, vt, Yt, Qt, ne, Gt, Ht, Nt, Ie, Le, Re, Oe, Fe, $e, Ye, zt, oe, we, Be, We, de, ce, he, ke, Xe, Ve, Ne, De, He;
|
|
5328
5328
|
if (!n.enabled) return;
|
|
5329
5329
|
const a = n.startTime || 0, r = n.endTime || 1 / 0;
|
|
5330
5330
|
if (this.currentTime < a || this.currentTime > r) return;
|
|
5331
|
-
const
|
|
5331
|
+
const h = s.x - i, f = s.y - o, l = Math.sqrt(h * h + f * f);
|
|
5332
5332
|
if (this.frameCount % 240 === 0 && Math.random() < 0.1 && this.log(`[ExodeUI] Executing ${n.type} on ${e.name}`), n.type === U.Proximity) {
|
|
5333
5333
|
const H = ((p = n.settings) == null ? void 0 : p.radius) || 300, Q = ((c = n.settings) == null ? void 0 : c.falloff) || "smooth";
|
|
5334
5334
|
let K = 0;
|
|
5335
|
-
l < H && (Q === "linear" ? K = 1 - l / H : K = Math.pow(1 - l / H, 2)), n.sensors.forEach((
|
|
5336
|
-
this.applyBehaviorSensor(s,
|
|
5335
|
+
l < H && (Q === "linear" ? K = 1 - l / H : K = Math.pow(1 - l / H, 2)), n.sensors.forEach((ft) => {
|
|
5336
|
+
this.applyBehaviorSensor(s, ft, K, t, n.settings, e, h, f, l);
|
|
5337
5337
|
});
|
|
5338
5338
|
} else if (n.type === U.Magnetic) {
|
|
5339
5339
|
const H = ((d = n.settings) == null ? void 0 : d.radius) || 400, Q = ((u = n.settings) == null ? void 0 : u.strength) || 0.5;
|
|
5340
5340
|
if (l < H && l > 5) {
|
|
5341
|
-
const K = 1 - l / H,
|
|
5342
|
-
s.x -=
|
|
5341
|
+
const K = 1 - l / H, ft = h * K * Q, Tt = f * K * Q;
|
|
5342
|
+
s.x -= ft * t * 10, s.y -= Tt * t * 10;
|
|
5343
5343
|
}
|
|
5344
5344
|
} else if (n.type === U.Repel) {
|
|
5345
5345
|
const H = ((v = n.settings) == null ? void 0 : v.radius) || 300, Q = ((b = n.settings) == null ? void 0 : b.strength) || 1;
|
|
5346
5346
|
if (l < H) {
|
|
5347
5347
|
const K = Math.pow(1 - l / H, 2);
|
|
5348
|
-
s.x +=
|
|
5348
|
+
s.x += h / (l || 1) * K * 60 * Q * t * 5, s.y += f / (l || 1) * K * 60 * Q * t * 5;
|
|
5349
5349
|
}
|
|
5350
5350
|
} else if (n.type === U.Orbit) {
|
|
5351
5351
|
const H = ((m = n.settings) == null ? void 0 : m.speed) || 1, Q = ((y = n.settings) == null ? void 0 : y.radius) || 30, K = this.currentTime * H * Math.PI * 2;
|
|
@@ -5353,14 +5353,14 @@ class ci {
|
|
|
5353
5353
|
} else if (n.type === U.Vortex) {
|
|
5354
5354
|
const H = ((S = n.settings) == null ? void 0 : S.radius) || 400, Q = ((C = n.settings) == null ? void 0 : C.speed) || 2, K = ((w = n.settings) == null ? void 0 : w.strength) || 1;
|
|
5355
5355
|
if (l < H) {
|
|
5356
|
-
const
|
|
5357
|
-
s.x += Lt *
|
|
5356
|
+
const ft = Math.pow(1 - l / H, 1.5), Tt = this.currentTime * Q * Math.PI * 2, Lt = Math.cos(Tt) * 30 - h * 0.4, Bt = Math.sin(Tt) * 30 - f * 0.4;
|
|
5357
|
+
s.x += Lt * ft * K * t * 5, s.y += Bt * ft * K * t * 5, s.rotation += 5 * ft * K * t * 5, s.scale_x *= 1 - ft * 0.1 * K * t, s.scale_y *= 1 - ft * 0.1 * K * t;
|
|
5358
5358
|
}
|
|
5359
5359
|
} else if (n.type === U.Fluid) {
|
|
5360
5360
|
const H = ((M = n.settings) == null ? void 0 : M.radius) || 300, Q = ((I = n.settings) == null ? void 0 : I.strength) || 1;
|
|
5361
5361
|
if (l < H) {
|
|
5362
|
-
const K = Math.pow(1 - l / H, 1.2),
|
|
5363
|
-
s.x +=
|
|
5362
|
+
const K = Math.pow(1 - l / H, 1.2), ft = h / (l || 1) * K * 1.2 * Q, Tt = f / (l || 1) * K * 1.2 * Q;
|
|
5363
|
+
s.x += ft * 10 * t * 5, s.y += Tt * 10 * t * 5, s.scale_x *= 1 + K * 0.3 * Q * t, s.scale_y *= 1 + K * 0.3 * Q * t;
|
|
5364
5364
|
}
|
|
5365
5365
|
} else if (n.type === U.Elastic) {
|
|
5366
5366
|
const H = ((k = n.settings) == null ? void 0 : k.radius) || 300, Q = ((T = n.settings) == null ? void 0 : T.strength) || 1;
|
|
@@ -5371,14 +5371,14 @@ class ci {
|
|
|
5371
5371
|
} else if (n.type === U.Holographic) {
|
|
5372
5372
|
const H = s.x - this.canvasWidth / 2, Q = s.y - this.canvasHeight / 2, K = ((L = n.settings) == null ? void 0 : L.factor) || 25;
|
|
5373
5373
|
if (s.x -= H / 1e3 * K * t * 5, s.y -= Q / 1e3 * K * t * 5, s.style) {
|
|
5374
|
-
const
|
|
5375
|
-
s.style.exposure = (s.style.exposure || 1) +
|
|
5374
|
+
const ft = 1 - Math.min(1, l / 400);
|
|
5375
|
+
s.style.exposure = (s.style.exposure || 1) + ft * 0.5 * t;
|
|
5376
5376
|
}
|
|
5377
5377
|
} else if (n.type === U.Sticky) {
|
|
5378
5378
|
const H = ((P = n.settings) == null ? void 0 : P.radius) || 80, Q = ((_ = n.settings) == null ? void 0 : _.strength) || 1;
|
|
5379
5379
|
if (l < H) {
|
|
5380
5380
|
const K = Math.pow(1 - l / H, 2);
|
|
5381
|
-
s.x -=
|
|
5381
|
+
s.x -= h * K * Q * t * 10, s.y -= f * K * Q * t * 10, s.scale_x *= 1 - K * 0.1 * Q * t, s.scale_y *= 1 - K * 0.1 * Q * t;
|
|
5382
5382
|
}
|
|
5383
5383
|
} else if (n.type === U.Dilation) {
|
|
5384
5384
|
const H = ((E = n.settings) == null ? void 0 : E.size) || 120, Q = ((A = n.settings) == null ? void 0 : A.strength) || 1;
|
|
@@ -5387,27 +5387,27 @@ class ci {
|
|
|
5387
5387
|
s.scale_x *= 1 + K * 0.5 * Q * t, s.scale_y *= 1 + K * 0.5 * Q * t;
|
|
5388
5388
|
}
|
|
5389
5389
|
} else if (n.type === U.Parallax) {
|
|
5390
|
-
const H = ((W = n.settings) == null ? void 0 : W.factor) || 15, Q = ((z = n.settings) == null ? void 0 : z.strength) || 1, K = this.canvasWidth / 2,
|
|
5390
|
+
const H = ((W = n.settings) == null ? void 0 : W.factor) || 15, Q = ((z = n.settings) == null ? void 0 : z.strength) || 1, K = this.canvasWidth / 2, ft = this.canvasHeight / 2, Tt = this._lastPointerPos || { x: K, y: ft }, Lt = (Tt.x - K) / K, Bt = (Tt.y - ft) / ft, ee = (((Y = e.transform) == null ? void 0 : Y.x) ?? 0) + Lt * H * Q, ue = (((G = e.transform) == null ? void 0 : G.y) ?? 0) + Bt * H * Q, Te = (((N = e.transform) == null ? void 0 : N.rotate_x) ?? 0) - Bt * H * 1.5 * Q, ae = (((J = e.transform) == null ? void 0 : J.rotate_y) ?? 0) + Lt * H * 1.5 * Q, be = Math.min(1, 10 * t);
|
|
5391
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 ?? ((j = e.transform) == null ? void 0 : j.rotate_x) ?? 0, Te, be), s.rotate_y = this.lerp(s.rotate_y ?? ((X = e.transform) == null ? void 0 : X.rotate_y) ?? 0, ae, be);
|
|
5392
5392
|
} else if (n.type === U.Fold) {
|
|
5393
5393
|
if (l < 300) {
|
|
5394
|
-
const H = 1 - l / 300, Q = (
|
|
5395
|
-
s.skew_x = this.lerp(s.skew_x ?? ((tt = e.transform) == null ? void 0 : tt.skew_x) ?? 0, Q, Lt), s.scale_y = this.lerp(s.scale_y ?? ((
|
|
5394
|
+
const H = 1 - l / 300, Q = (h > 0 ? -1 : 1) * H * 10, K = 1 - H * 0.1, ft = f / 300 * H * 20, Tt = -(h / 300) * H * 20, Lt = Math.min(1, 10 * t);
|
|
5395
|
+
s.skew_x = this.lerp(s.skew_x ?? ((tt = e.transform) == null ? void 0 : tt.skew_x) ?? 0, Q, 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) * K, 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, Tt, 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
5396
|
}
|
|
5397
5397
|
} else if (n.type === U.Crumple) {
|
|
5398
5398
|
if (l < 300) {
|
|
5399
|
-
const H = 1 - l / 300, Q = H * (Math.random() - 0.5) * 5, K = H * (Math.random() - 0.5) * 0.05,
|
|
5400
|
-
s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0, Q,
|
|
5399
|
+
const H = 1 - l / 300, Q = H * (Math.random() - 0.5) * 5, K = H * (Math.random() - 0.5) * 0.05, ft = Math.min(1, 15 * t);
|
|
5400
|
+
s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0, Q, ft), s.scale_x = this.lerp(s.scale_x ?? ((bt = e.transform) == null ? void 0 : bt.scale_x) ?? 1, (((gt = e.transform) == null ? void 0 : gt.scale_x) ?? 1) * (1 + K), 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 + K), ft), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "crumple_overlay", intensity: ((St = n.settings) == null ? void 0 : St.intensity) ?? 1, scale: ((Xt = n.settings) == null ? void 0 : Xt.scale) ?? 2 };
|
|
5401
5401
|
}
|
|
5402
5402
|
} else if (n.type === U.Squash) {
|
|
5403
5403
|
const H = ((le = n.settings) == null ? void 0 : le.strength) || 0.8;
|
|
5404
|
-
l < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((
|
|
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, (((et = e.transform) == null ? void 0 : et.scale_x) ?? 1) * (1 + (1 - H) * 0.4), 0.3)) : (s.scale_y = this.lerp(s.scale_y ?? 1, ((mt = e.transform) == null ? void 0 : mt.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
5405
|
} else if (n.type === U.TextCounter) {
|
|
5406
5406
|
const H = ((_t = n.settings) == null ? void 0 : _t.duration) || 2, Q = ((dt = n.settings) == null ? void 0 : dt.from) || 0, K = ((Ft = n.settings) == null ? void 0 : Ft.to) || 100;
|
|
5407
5407
|
n._runtimeStart === void 0 && (n._runtimeStart = this.currentTime);
|
|
5408
|
-
const
|
|
5408
|
+
const ft = this.currentTime - n._runtimeStart, Tt = Math.min(1, ft / H), Lt = Math.floor(Q + (K - Q) * Tt);
|
|
5409
5409
|
if (((Dt = e.geometry) == null ? void 0 : Dt.type) === "Text") {
|
|
5410
|
-
const Bt = (($t = n.settings) == null ? void 0 : $t.prefix) || "", ee = ((
|
|
5410
|
+
const Bt = (($t = n.settings) == null ? void 0 : $t.prefix) || "", ee = ((Ot = n.settings) == null ? void 0 : Ot.suffix) || "";
|
|
5411
5411
|
s.geometry || (s.geometry = { ...e.geometry }), s.geometry.text = `${Bt}${Lt}${ee}`;
|
|
5412
5412
|
}
|
|
5413
5413
|
} else if (n.type === U.Spotlight) {
|
|
@@ -5421,19 +5421,19 @@ class ci {
|
|
|
5421
5421
|
const H = (((Ce = n.settings) == null ? void 0 : Ce.frequency) || ((Ae = n.settings) == null ? void 0 : Ae.speed) || 1) * 2e-3, Q = (((xe = n.settings) == null ? void 0 : xe.amplitude) || ((se = n.settings) == null ? void 0 : se.range) || 50) * (((jt = n.settings) == null ? void 0 : jt.strength) || 1), K = Date.now();
|
|
5422
5422
|
s.x += Math.sin(K * H) * Q * t, s.y += Math.cos(K * H * 0.8) * Q * t, s.rotation += Math.sin(K * H * 0.5) * 5 * t;
|
|
5423
5423
|
} else if (n.type === U.Pulse) {
|
|
5424
|
-
const H = (((
|
|
5425
|
-
s.scale_x *= 1 + K * Q *
|
|
5424
|
+
const H = (((ht = n.settings) == null ? void 0 : ht.speed) || 1) * 5e-3, Q = (((pt = n.settings) == null ? void 0 : pt.scale) || 1.2) - 1, K = Math.sin(Date.now() * H), ft = ((at = n.settings) == null ? void 0 : at.strength) || 1;
|
|
5425
|
+
s.scale_x *= 1 + K * Q * ft * t, s.scale_y *= 1 + K * Q * ft * t, s.style && (s.style.exposure = (s.style.exposure || 1) + Math.max(0, K) * 0.1 * ft * t);
|
|
5426
5426
|
} else if (n.type === U.Draggable) {
|
|
5427
5427
|
const H = ((B = n.settings) == null ? void 0 : B.radius) || 150, Q = this.draggingBehaviors.has(e.id);
|
|
5428
5428
|
if (l < H || Q) {
|
|
5429
|
-
const K = ((nt = n.settings) == null ? void 0 : nt.strength) || 1,
|
|
5430
|
-
this.applyBehaviorSensor(s, Zt.PositionX,
|
|
5429
|
+
const K = ((nt = n.settings) == null ? void 0 : nt.strength) || 1, ft = Q ? 1 : Math.max(0, 1 - l / H);
|
|
5430
|
+
this.applyBehaviorSensor(s, Zt.PositionX, ft * K, t, n.settings), this.applyBehaviorSensor(s, Zt.PositionY, ft * K, t, n.settings);
|
|
5431
5431
|
}
|
|
5432
5432
|
} else if (n.type === U.Scroll) {
|
|
5433
|
-
const H = ((Z = n.settings) == null ? void 0 : Z.axis) || "vertical", Q = ((Pt = n.settings) == null ? void 0 : Pt.factor) || 0.5, K = ((xt = n.settings) == null ? void 0 : xt.strength) || 1,
|
|
5434
|
-
(H === "vertical" || H === "both") && (s.y += this.scrollOffset.y * Q * K * t), (H === "horizontal" || H === "both") && (s.x += this.scrollOffset.x * Q * K * t),
|
|
5433
|
+
const H = ((Z = n.settings) == null ? void 0 : Z.axis) || "vertical", Q = ((Pt = n.settings) == null ? void 0 : Pt.factor) || 0.5, K = ((xt = n.settings) == null ? void 0 : xt.strength) || 1, ft = ((kt = n.settings) == null ? void 0 : kt.scaleFactor) || 0;
|
|
5434
|
+
(H === "vertical" || H === "both") && (s.y += this.scrollOffset.y * Q * K * t), (H === "horizontal" || H === "both") && (s.x += this.scrollOffset.x * Q * K * t), ft !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * ft * t, s.scale_y *= 1 + this.scrollOffset.y * ft * t);
|
|
5435
5435
|
} else if (n.type === U.LookAt) {
|
|
5436
|
-
const H = ((At = n.settings) == null ? void 0 : At.factor) || 1, Q = ((Mt = n.settings) == null ? void 0 : Mt.strength) || 1, K = Math.atan2(-
|
|
5436
|
+
const H = ((At = n.settings) == null ? void 0 : At.factor) || 1, Q = ((Mt = n.settings) == null ? void 0 : Mt.strength) || 1, K = Math.atan2(-f, -h) * (180 / Math.PI), ft = s.rotation, Tt = (K - ft + 180) % 360 - 180;
|
|
5437
5437
|
s.rotation += Tt * H * Q * t * 10;
|
|
5438
5438
|
} else if (n.type === U.Scan) {
|
|
5439
5439
|
const H = ((($ = n.settings) == null ? void 0 : $.speed) || 1) * 4e-3, Q = ((Wt = n.settings) == null ? void 0 : Wt.strength) || 1, K = (Math.sin(Date.now() * H) + 1) / 2;
|
|
@@ -5455,8 +5455,8 @@ class ci {
|
|
|
5455
5455
|
if (H) {
|
|
5456
5456
|
const Q = this.objectStates.get(H);
|
|
5457
5457
|
if (Q) {
|
|
5458
|
-
const K = ((rt = n.settings) == null ? void 0 : rt.stiffness) || 0.1,
|
|
5459
|
-
s.x +=
|
|
5458
|
+
const K = ((rt = n.settings) == null ? void 0 : rt.stiffness) || 0.1, ft = Q.x - s.x, Tt = Q.y - s.y;
|
|
5459
|
+
s.x += ft * K * t * 60, s.y += Tt * K * t * 60;
|
|
5460
5460
|
}
|
|
5461
5461
|
}
|
|
5462
5462
|
} else if (n.type === U.Wrap)
|
|
@@ -5480,35 +5480,35 @@ class ci {
|
|
|
5480
5480
|
const K = Math.pow(1 - l / H, 2);
|
|
5481
5481
|
s.scale_x = this.lerp(s.scale_x ?? 1, (((Nt = e.transform) == null ? void 0 : Nt.scale_x) ?? 1) * (1 + K * Q), 0.2), s.scale_y = this.lerp(s.scale_y ?? 1, (((Ie = e.transform) == null ? void 0 : Ie.scale_y) ?? 1) * (1 + K * Q), 0.2);
|
|
5482
5482
|
} else
|
|
5483
|
-
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, ((
|
|
5483
|
+
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
5484
|
} else if (n.type === U.LayoutAnimation) {
|
|
5485
|
-
const H = ((
|
|
5485
|
+
const H = ((Oe = n.settings) == null ? void 0 : Oe.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"], Q = ((Fe = n.settings) == null ? void 0 : Fe.duration) || 0.3;
|
|
5486
5486
|
this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
|
|
5487
5487
|
const K = this._layoutAnimCache.get(e.id);
|
|
5488
|
-
for (const
|
|
5489
|
-
const Tt = this.getObjectProperty(s, e,
|
|
5488
|
+
for (const ft of H) {
|
|
5489
|
+
const Tt = this.getObjectProperty(s, e, ft);
|
|
5490
5490
|
if (Tt === void 0) continue;
|
|
5491
|
-
const Lt = K.get(
|
|
5491
|
+
const Lt = K.get(ft);
|
|
5492
5492
|
if (!Lt)
|
|
5493
|
-
K.set(
|
|
5493
|
+
K.set(ft, {
|
|
5494
5494
|
from: Tt,
|
|
5495
5495
|
to: Tt,
|
|
5496
5496
|
startTime: this.currentTime,
|
|
5497
5497
|
duration: 0
|
|
5498
5498
|
});
|
|
5499
5499
|
else if (Lt.to !== Tt) {
|
|
5500
|
-
const ee = this.getObjectProperty(s, e,
|
|
5501
|
-
K.set(
|
|
5500
|
+
const ee = this.getObjectProperty(s, e, ft);
|
|
5501
|
+
K.set(ft, {
|
|
5502
5502
|
from: ee ?? Lt.from,
|
|
5503
5503
|
to: Tt,
|
|
5504
5504
|
startTime: this.currentTime,
|
|
5505
5505
|
duration: (($e = n.settings) == null ? void 0 : $e.duration) ?? Q
|
|
5506
5506
|
});
|
|
5507
5507
|
}
|
|
5508
|
-
const Bt = K.get(
|
|
5508
|
+
const Bt = K.get(ft);
|
|
5509
5509
|
if (Bt.duration > 0 && Bt.from !== Bt.to) {
|
|
5510
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"), ae = Bt.from + (Bt.to - Bt.from) * Te;
|
|
5511
|
-
this.setObjectProperty(s, e,
|
|
5511
|
+
this.setObjectProperty(s, e, ft, ae);
|
|
5512
5512
|
}
|
|
5513
5513
|
}
|
|
5514
5514
|
} else if (n.type === U.StateReactive) {
|
|
@@ -5528,30 +5528,30 @@ class ci {
|
|
|
5528
5528
|
"style.shadow.offsetX",
|
|
5529
5529
|
"style.shadow.offsetY"
|
|
5530
5530
|
];
|
|
5531
|
-
for (const
|
|
5532
|
-
const Tt = this.getObjectProperty(s, e,
|
|
5531
|
+
for (const ft of K) {
|
|
5532
|
+
const Tt = this.getObjectProperty(s, e, ft);
|
|
5533
5533
|
if (Tt === void 0 || typeof Tt != "number") continue;
|
|
5534
|
-
const Lt = H.get(
|
|
5534
|
+
const Lt = H.get(ft);
|
|
5535
5535
|
if (!Lt)
|
|
5536
|
-
H.set(
|
|
5536
|
+
H.set(ft, {
|
|
5537
5537
|
from: Tt,
|
|
5538
5538
|
to: Tt,
|
|
5539
5539
|
startTime: this.currentTime,
|
|
5540
5540
|
duration: 0
|
|
5541
5541
|
});
|
|
5542
5542
|
else if (Lt.to !== Tt) {
|
|
5543
|
-
const ee = this.getObjectProperty(s, e,
|
|
5544
|
-
H.set(
|
|
5543
|
+
const ee = this.getObjectProperty(s, e, ft);
|
|
5544
|
+
H.set(ft, {
|
|
5545
5545
|
from: ee ?? Lt.from,
|
|
5546
5546
|
to: Tt,
|
|
5547
5547
|
startTime: this.currentTime,
|
|
5548
5548
|
duration: Q
|
|
5549
5549
|
});
|
|
5550
5550
|
}
|
|
5551
|
-
const Bt = H.get(
|
|
5551
|
+
const Bt = H.get(ft);
|
|
5552
5552
|
if (Bt.duration > 0 && Bt.from !== Bt.to) {
|
|
5553
5553
|
const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((oe = n.settings) == null ? void 0 : oe.defaultEasing) || "easeOutCubic"), ae = Bt.from + (Bt.to - Bt.from) * Te;
|
|
5554
|
-
this.setObjectProperty(s, e,
|
|
5554
|
+
this.setObjectProperty(s, e, ft, ae);
|
|
5555
5555
|
}
|
|
5556
5556
|
}
|
|
5557
5557
|
} else if (n.type === U.SpringChain) {
|
|
@@ -5570,21 +5570,21 @@ class ci {
|
|
|
5570
5570
|
}
|
|
5571
5571
|
K.has(e.id) || K.set(e.id, { x: s.x, y: s.y, vx: 0, vy: 0 });
|
|
5572
5572
|
}
|
|
5573
|
-
const
|
|
5574
|
-
if (
|
|
5575
|
-
|
|
5573
|
+
const ft = K.get(e.id);
|
|
5574
|
+
if (ft) {
|
|
5575
|
+
ft.x = s.x, ft.y = s.y;
|
|
5576
5576
|
for (const Tt of H) {
|
|
5577
5577
|
const Lt = K.get(Tt.targetId);
|
|
5578
5578
|
if (!Lt) continue;
|
|
5579
|
-
const Bt = Lt.x -
|
|
5580
|
-
|
|
5579
|
+
const Bt = Lt.x - ft.x, ee = Lt.y - ft.y, ue = Math.sqrt(Bt * Bt + ee * ee) || 1e-3, ae = (ue - (Tt.restLength || 50)) * (Tt.stiffness || 0.8), be = Bt / ue * ae, Ue = ee / ue * ae;
|
|
5580
|
+
ft.vx += be * t * 10, ft.vy += Ue * t * 10, Lt.vx -= be * t * 10, Lt.vy -= Ue * t * 10, ft.vx *= 1 - Q * t * 10, ft.vy *= 1 - Q * t * 10, Lt.vx *= 1 - Q * t * 10, Lt.vy *= 1 - Q * t * 10;
|
|
5581
5581
|
const pe = this.objectStates.get(Tt.targetId);
|
|
5582
5582
|
pe && (pe.x += Lt.vx * t, pe.y += Lt.vy * t);
|
|
5583
5583
|
}
|
|
5584
|
-
s.x +=
|
|
5584
|
+
s.x += ft.vx * t, s.y += ft.vy * t;
|
|
5585
5585
|
}
|
|
5586
5586
|
} else if (n.type === U.ParticleEmitter) {
|
|
5587
|
-
const H = ((We = n.settings) == null ? void 0 : We.rate) || 10, Q = ((de = n.settings) == null ? void 0 : de.speed) || 100, K = ((ce = n.settings) == null ? void 0 : ce.size) || 5,
|
|
5587
|
+
const H = ((We = n.settings) == null ? void 0 : We.rate) || 10, Q = ((de = n.settings) == null ? void 0 : de.speed) || 100, K = ((ce = n.settings) == null ? void 0 : ce.size) || 5, ft = ((he = n.settings) == null ? void 0 : he.lifetime) || 2, Tt = ((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) ?? Tt : Tt, Te = (He = n.settings) != null && He.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? Q : Q;
|
|
5588
5588
|
this._emitterPools.has(e.id) || this._emitterPools.set(e.id, []);
|
|
5589
5589
|
const ae = this._emitterPools.get(e.id);
|
|
5590
5590
|
let be = 0;
|
|
@@ -5598,7 +5598,7 @@ class ci {
|
|
|
5598
5598
|
vx: Math.cos(re) * ss,
|
|
5599
5599
|
vy: Math.sin(re) * ss,
|
|
5600
5600
|
life: 0,
|
|
5601
|
-
maxLife:
|
|
5601
|
+
maxLife: ft * (0.5 + Math.random() * 0.5),
|
|
5602
5602
|
size: K * (0.5 + Math.random()),
|
|
5603
5603
|
color: Lt,
|
|
5604
5604
|
opacity: 1
|
|
@@ -5612,88 +5612,88 @@ class ci {
|
|
|
5612
5612
|
});
|
|
5613
5613
|
});
|
|
5614
5614
|
}
|
|
5615
|
-
applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0,
|
|
5615
|
+
applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, h = 1) {
|
|
5616
5616
|
var d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, J;
|
|
5617
|
-
const
|
|
5617
|
+
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
5618
|
switch (i) {
|
|
5619
5619
|
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, j = x * (1 + o *
|
|
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, j = x * (1 + o * f * 0.4), X = F * (1 + o * f * 0.4);
|
|
5621
5621
|
t.scale_x = (t.scale_x ?? x) * (1 - l) + j * l, t.scale_y = (t.scale_y ?? F) * (1 - l) + X * l;
|
|
5622
5622
|
break;
|
|
5623
5623
|
}
|
|
5624
5624
|
case Zt.Opacity: {
|
|
5625
|
-
const x = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.opacity) ?? 100, F = Math.max(0, Math.min(100, x - o *
|
|
5625
|
+
const x = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.opacity) ?? 100, F = Math.max(0, Math.min(100, x - o * f * 100));
|
|
5626
5626
|
t.opacity = (t.opacity ?? x) * (1 - l) + F * l;
|
|
5627
5627
|
break;
|
|
5628
5628
|
}
|
|
5629
5629
|
case Zt.RotateZ: {
|
|
5630
|
-
const x = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotation) ?? 0, F = x + o *
|
|
5630
|
+
const x = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotation) ?? 0, F = x + o * f * 45;
|
|
5631
5631
|
t.rotation = (t.rotation ?? x) * (1 - l) + F * l;
|
|
5632
5632
|
break;
|
|
5633
5633
|
}
|
|
5634
5634
|
case Zt.RotateX: {
|
|
5635
|
-
const x = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.rotate_x) ?? 0, F = x - c * o *
|
|
5635
|
+
const x = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.rotate_x) ?? 0, F = x - c * o * f * 60;
|
|
5636
5636
|
t.rotate_x = (t.rotate_x ?? x) * (1 - l) + F * l;
|
|
5637
5637
|
break;
|
|
5638
5638
|
}
|
|
5639
5639
|
case Zt.RotateY: {
|
|
5640
|
-
const x = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.rotate_y) ?? 0, F = x + p * o *
|
|
5640
|
+
const x = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.rotate_y) ?? 0, F = x + p * o * f * 60;
|
|
5641
5641
|
t.rotate_y = (t.rotate_y ?? x) * (1 - l) + F * l;
|
|
5642
5642
|
break;
|
|
5643
5643
|
}
|
|
5644
5644
|
case Zt.PositionX: {
|
|
5645
|
-
const x = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.x) ?? 0, F = x - p * o *
|
|
5645
|
+
const x = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.x) ?? 0, F = x - p * o * f * 40;
|
|
5646
5646
|
t.x = (t.x ?? x) * (1 - l) + F * l;
|
|
5647
5647
|
break;
|
|
5648
5648
|
}
|
|
5649
5649
|
case Zt.PositionY: {
|
|
5650
|
-
const x = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.y) ?? 0, F = x - c * o *
|
|
5650
|
+
const x = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.y) ?? 0, F = x - c * o * f * 40;
|
|
5651
5651
|
t.y = (t.y ?? x) * (1 - l) + F * l;
|
|
5652
5652
|
break;
|
|
5653
5653
|
}
|
|
5654
5654
|
case Zt.SkewX: {
|
|
5655
|
-
const x = ((w = n == null ? void 0 : n.transform) == null ? void 0 : w.skew_x) ?? 0, F = x + p * o *
|
|
5655
|
+
const x = ((w = n == null ? void 0 : n.transform) == null ? void 0 : w.skew_x) ?? 0, F = x + p * o * f * 45;
|
|
5656
5656
|
t.skew_x = (t.skew_x ?? x) * (1 - l) + F * l, t.skew_x > 85 && (t.skew_x = 85), t.skew_x < -85 && (t.skew_x = -85);
|
|
5657
5657
|
break;
|
|
5658
5658
|
}
|
|
5659
5659
|
case Zt.Blur: {
|
|
5660
5660
|
t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.blur || (t.style.blur = { ...(M = n == null ? void 0 : n.style) == null ? void 0 : M.blur });
|
|
5661
|
-
const x = ((k = (I = n == null ? void 0 : n.style) == null ? void 0 : I.blur) == null ? void 0 : k.amount) || 0, F = x + o * ((s == null ? void 0 : s.blur) || 20) *
|
|
5661
|
+
const x = ((k = (I = n == null ? void 0 : n.style) == null ? void 0 : I.blur) == null ? void 0 : k.amount) || 0, F = x + o * ((s == null ? void 0 : s.blur) || 20) * f;
|
|
5662
5662
|
t.style.blur.amount = (t.style.blur.amount ?? x) * (1 - l) + F * l;
|
|
5663
5663
|
break;
|
|
5664
5664
|
}
|
|
5665
5665
|
case Zt.Exposure: {
|
|
5666
5666
|
t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(T = n == null ? void 0 : n.style) == null ? void 0 : T.adjustments });
|
|
5667
|
-
const x = ((P = (L = n == null ? void 0 : n.style) == null ? void 0 : L.adjustments) == null ? void 0 : P.exposure) || 0, F = x + o * ((s == null ? void 0 : s.exposure) || 50) *
|
|
5667
|
+
const x = ((P = (L = n == null ? void 0 : n.style) == null ? void 0 : L.adjustments) == null ? void 0 : P.exposure) || 0, F = x + o * ((s == null ? void 0 : s.exposure) || 50) * f;
|
|
5668
5668
|
t.style.adjustments.exposure = (t.style.adjustments.exposure ?? x) * (1 - l) + F * l;
|
|
5669
5669
|
break;
|
|
5670
5670
|
}
|
|
5671
5671
|
case Zt.HueShift: {
|
|
5672
5672
|
t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(_ = n == null ? void 0 : n.style) == null ? void 0 : _.adjustments });
|
|
5673
|
-
const x = ((A = (E = n == null ? void 0 : n.style) == null ? void 0 : E.adjustments) == null ? void 0 : A.hue) || 0, F = x + o * ((s == null ? void 0 : s.hue) || 180) *
|
|
5673
|
+
const x = ((A = (E = n == null ? void 0 : n.style) == null ? void 0 : E.adjustments) == null ? void 0 : A.hue) || 0, F = x + o * ((s == null ? void 0 : s.hue) || 180) * f;
|
|
5674
5674
|
t.style.adjustments.hue = (t.style.adjustments.hue ?? x) * (1 - l) + F * l;
|
|
5675
5675
|
break;
|
|
5676
5676
|
}
|
|
5677
5677
|
case Zt.Negative: {
|
|
5678
5678
|
t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(W = n == null ? void 0 : n.style) == null ? void 0 : W.adjustments });
|
|
5679
|
-
const x = ((Y = (z = n == null ? void 0 : n.style) == null ? void 0 : z.adjustments) == null ? void 0 : Y.negative) || 0, F = x + o * ((s == null ? void 0 : s.negative) || 100) *
|
|
5679
|
+
const x = ((Y = (z = n == null ? void 0 : n.style) == null ? void 0 : z.adjustments) == null ? void 0 : Y.negative) || 0, F = x + o * ((s == null ? void 0 : s.negative) || 100) * f;
|
|
5680
5680
|
t.style.adjustments.negative = (t.style.adjustments.negative ?? x) * (1 - l) + F * l;
|
|
5681
5681
|
break;
|
|
5682
5682
|
}
|
|
5683
5683
|
case Zt.CornerRadius: {
|
|
5684
|
-
const x = ((G = n == null ? void 0 : n.transform) == null ? void 0 : G.corner_radius) || 0, F = x + o *
|
|
5684
|
+
const x = ((G = n == null ? void 0 : n.transform) == null ? void 0 : G.corner_radius) || 0, F = x + o * f * 50;
|
|
5685
5685
|
t.corner_radius = (t.corner_radius ?? x) * (1 - l) + F * l;
|
|
5686
5686
|
break;
|
|
5687
5687
|
}
|
|
5688
5688
|
case Zt.StrokeWidth: {
|
|
5689
5689
|
t.style || (t.style = { ...n == null ? void 0 : n.style });
|
|
5690
|
-
const x = ((N = n == null ? void 0 : n.style) == null ? void 0 : N.borderWidth) || 0, F = x + o *
|
|
5690
|
+
const x = ((N = n == null ? void 0 : n.style) == null ? void 0 : N.borderWidth) || 0, F = x + o * f * 10;
|
|
5691
5691
|
t.style.borderWidth = (t.style.borderWidth ?? x) * (1 - l) + F * l;
|
|
5692
5692
|
break;
|
|
5693
5693
|
}
|
|
5694
5694
|
case Zt.LetterSpacing: {
|
|
5695
5695
|
t.geometry || (t.geometry = {});
|
|
5696
|
-
const x = ((J = n == null ? void 0 : n.geometry) == null ? void 0 : J.letterSpacing) || 0, F = x + o *
|
|
5696
|
+
const x = ((J = n == null ? void 0 : n.geometry) == null ? void 0 : J.letterSpacing) || 0, F = x + o * f * 10;
|
|
5697
5697
|
t.geometry.letterSpacing = (t.geometry.letterSpacing ?? x) * (1 - l) + F * l;
|
|
5698
5698
|
break;
|
|
5699
5699
|
}
|
|
@@ -5716,12 +5716,12 @@ class ci {
|
|
|
5716
5716
|
const s = o.split(".");
|
|
5717
5717
|
let n = t;
|
|
5718
5718
|
for (let r = 0; r < s.length - 1; r++) {
|
|
5719
|
-
const
|
|
5720
|
-
if (n[
|
|
5721
|
-
const
|
|
5722
|
-
n[
|
|
5719
|
+
const h = s[r];
|
|
5720
|
+
if (n[h] === void 0 || n[h] === null) {
|
|
5721
|
+
const f = i, l = s.slice(0, r + 1).reduce((p, c) => p == null ? void 0 : p[c], f);
|
|
5722
|
+
n[h] = l !== void 0 ? { ...l } : {};
|
|
5723
5723
|
}
|
|
5724
|
-
n = n[
|
|
5724
|
+
n = n[h];
|
|
5725
5725
|
}
|
|
5726
5726
|
const a = s[s.length - 1];
|
|
5727
5727
|
n != null && (n[a] = e);
|
|
@@ -5769,9 +5769,9 @@ class ci {
|
|
|
5769
5769
|
return o;
|
|
5770
5770
|
}
|
|
5771
5771
|
renderFittedImage(t, i, o, e, s, n, a = "cover") {
|
|
5772
|
-
const r = i.naturalWidth,
|
|
5772
|
+
const r = i.naturalWidth, h = i.naturalHeight, f = r / h, l = s / n;
|
|
5773
5773
|
let p = s, c = n, d = o, u = e;
|
|
5774
|
-
a === "cover" ?
|
|
5774
|
+
a === "cover" ? f > l ? (p = n * f, d = o - (p - s) / 2) : (c = s / f, u = e - (c - n) / 2) : a === "contain" && (f > l ? (c = s / f, u = e + (n - c) / 2) : (p = n * f, d = o + (s - p) / 2)), t.drawImage(i, d, u, p, c);
|
|
5775
5775
|
}
|
|
5776
5776
|
}
|
|
5777
5777
|
const yi = Ss(({
|
|
@@ -5784,8 +5784,8 @@ const yi = Ss(({
|
|
|
5784
5784
|
onReady: n,
|
|
5785
5785
|
onTrigger: a,
|
|
5786
5786
|
onInputUpdate: r,
|
|
5787
|
-
onComponentChange:
|
|
5788
|
-
onToggle:
|
|
5787
|
+
onComponentChange: h,
|
|
5788
|
+
onToggle: f,
|
|
5789
5789
|
onInputChange: l,
|
|
5790
5790
|
onInputFocus: p,
|
|
5791
5791
|
onInputBlur: c,
|
|
@@ -5812,30 +5812,30 @@ const yi = Ss(({
|
|
|
5812
5812
|
}), []), ve(() => {
|
|
5813
5813
|
E.current.setLayout(e, s);
|
|
5814
5814
|
}, [e, s]), ve(() => {
|
|
5815
|
-
const
|
|
5816
|
-
a &&
|
|
5817
|
-
}, [a, r,
|
|
5815
|
+
const R = E.current;
|
|
5816
|
+
a && R.setTriggerCallback(a), r && R.setInputUpdateCallback((O, D) => r({ [O]: D })), h && R.setComponentChangeCallback((O) => h(O)), f && R.setToggleCallback(f), l && R.setInputChangeCallback(l), p && R.setInputFocusCallback(p), c && R.setInputBlurCallback(c), d && R.setOnLogCallback((O) => d(O, "info")), u && R.setLogicUpdateCallback(u), v && R.setButtonClickCallback(v), b && R.setGraphPointClickCallback((O) => b(O.objectId, O)), L && R.setNavigationCallback(L);
|
|
5817
|
+
}, [a, r, h, f, l, p, c, d, u, v, b, L]), ve(() => {
|
|
5818
5818
|
(async () => {
|
|
5819
|
-
let
|
|
5819
|
+
let O = g;
|
|
5820
5820
|
if (t && !g)
|
|
5821
5821
|
try {
|
|
5822
|
-
t.startsWith("{") ?
|
|
5822
|
+
t.startsWith("{") ? O = JSON.parse(t) : O = await (await fetch(t)).json();
|
|
5823
5823
|
} catch (D) {
|
|
5824
5824
|
console.error("[ExodeUI] Failed to load src:", D);
|
|
5825
5825
|
}
|
|
5826
|
-
if (
|
|
5827
|
-
const D = E.current, q =
|
|
5828
|
-
(z.current !== q || Y.current !== y || G.current !==
|
|
5826
|
+
if (O) {
|
|
5827
|
+
const D = E.current, q = O.id || O.name || "default";
|
|
5828
|
+
(z.current !== q || Y.current !== y || G.current !== O) && (D.load(O), z.current = q, Y.current = y, G.current = O, N(O), W.current = 0, D.advance(0)), n && n(D);
|
|
5829
5829
|
}
|
|
5830
5830
|
})();
|
|
5831
5831
|
}, [g, t, y]), ve(() => {
|
|
5832
|
-
const
|
|
5832
|
+
const R = (O) => {
|
|
5833
5833
|
if (!E.current || !J.current) return;
|
|
5834
5834
|
const D = E.current, q = _.current;
|
|
5835
5835
|
if (!q) return;
|
|
5836
5836
|
const ot = q.getContext("2d");
|
|
5837
5837
|
if (!ot) return;
|
|
5838
|
-
const yt =
|
|
5838
|
+
const yt = O / 1e3;
|
|
5839
5839
|
W.current === 0 && (W.current = yt);
|
|
5840
5840
|
let bt = yt - W.current;
|
|
5841
5841
|
bt > 0.1 && (bt = 0.1), W.current = yt;
|
|
@@ -5846,55 +5846,55 @@ const yi = Ss(({
|
|
|
5846
5846
|
} catch (Xt) {
|
|
5847
5847
|
console.error("[ExodeUICanvas] Error in animation loop:", Xt), d && d(`[Error] Animation loop crashed: ${Xt}`, "error");
|
|
5848
5848
|
}
|
|
5849
|
-
A.current = requestAnimationFrame(
|
|
5849
|
+
A.current = requestAnimationFrame(R);
|
|
5850
5850
|
};
|
|
5851
|
-
return A.current = requestAnimationFrame(
|
|
5851
|
+
return A.current = requestAnimationFrame(R), () => {
|
|
5852
5852
|
A.current && cancelAnimationFrame(A.current);
|
|
5853
5853
|
};
|
|
5854
5854
|
}, [o, m]), ve(() => {
|
|
5855
|
-
const
|
|
5856
|
-
S !== void 0 &&
|
|
5855
|
+
const R = E.current;
|
|
5856
|
+
S !== void 0 && R.updateInput("scrollY", S), C !== void 0 && R.updateInput("scrollX", C), w !== void 0 && R.updateInput("mouseX", w), M !== void 0 && R.updateInput("mouseY", M), I !== void 0 && R.updateInput("isMouseDown", I), k && Object.entries(k).forEach(([O, D]) => R.updateInput(O, D));
|
|
5857
5857
|
}, [S, C, w, M, I, k]);
|
|
5858
|
-
const x = (
|
|
5858
|
+
const x = (R, O) => {
|
|
5859
5859
|
if (!T || !_.current) return;
|
|
5860
|
-
|
|
5861
|
-
const D = _.current, q = D.getBoundingClientRect(), ot =
|
|
5862
|
-
(
|
|
5860
|
+
R.stopPropagation(), "nativeEvent" in R && R.nativeEvent && typeof R.nativeEvent.stopImmediatePropagation == "function" ? R.nativeEvent.stopImmediatePropagation() : typeof R.stopImmediatePropagation == "function" && R.stopImmediatePropagation();
|
|
5861
|
+
const D = _.current, q = D.getBoundingClientRect(), ot = R.clientX - q.left, yt = R.clientY - q.top, bt = window.devicePixelRatio || 1;
|
|
5862
|
+
(O === "click" || O === "down" || O === "up") && d && d(`[Canvas] Pointer ${O} at rect(${Math.round(ot)},${Math.round(yt)}) mapped to buffer(${Math.round(ot * bt)},${Math.round(yt * bt)})`, "info"), E.current.handlePointerInput(O, ot * bt, yt * bt, D.width, D.height);
|
|
5863
5863
|
};
|
|
5864
5864
|
ve(() => {
|
|
5865
5865
|
if (!T) return;
|
|
5866
|
-
const
|
|
5866
|
+
const R = (D) => {
|
|
5867
5867
|
var q, ot, yt;
|
|
5868
5868
|
((q = document.activeElement) == null ? void 0 : q.tagName) === "INPUT" || ((ot = document.activeElement) == null ? void 0 : ot.tagName) === "TEXTAREA" || (yt = E.current) == null || yt.handleKeyDown(D);
|
|
5869
|
-
},
|
|
5869
|
+
}, O = (D) => {
|
|
5870
5870
|
var q, ot, yt;
|
|
5871
5871
|
((q = document.activeElement) == null ? void 0 : q.tagName) === "INPUT" || ((ot = document.activeElement) == null ? void 0 : ot.tagName) === "TEXTAREA" || (yt = E.current) == null || yt.handleKeyUp(D);
|
|
5872
5872
|
};
|
|
5873
|
-
return window.addEventListener("keydown",
|
|
5874
|
-
window.removeEventListener("keydown",
|
|
5873
|
+
return window.addEventListener("keydown", R), window.addEventListener("keyup", O), () => {
|
|
5874
|
+
window.removeEventListener("keydown", R), window.removeEventListener("keyup", O);
|
|
5875
5875
|
};
|
|
5876
5876
|
}, [T]);
|
|
5877
5877
|
const [F, j] = Qe([]);
|
|
5878
5878
|
ve(() => {
|
|
5879
5879
|
if (g && g.objects) {
|
|
5880
|
-
const
|
|
5880
|
+
const R = g.objects.filter((O) => {
|
|
5881
5881
|
var D, q;
|
|
5882
|
-
return
|
|
5882
|
+
return O.type === "Joystick" && ((D = O.inputBinding) == null ? void 0 : D.type) === "keyboard" && ((q = O.inputBinding.keyboardConfig) == null ? void 0 : q.showVirtualKeyboard);
|
|
5883
5883
|
});
|
|
5884
|
-
j(
|
|
5884
|
+
j(R);
|
|
5885
5885
|
}
|
|
5886
5886
|
}, [g]);
|
|
5887
5887
|
const [, X] = Qe(0);
|
|
5888
5888
|
ve(() => {
|
|
5889
5889
|
if (F.length === 0) return;
|
|
5890
|
-
let
|
|
5891
|
-
const
|
|
5892
|
-
X((D) => D + 1),
|
|
5890
|
+
let R;
|
|
5891
|
+
const O = () => {
|
|
5892
|
+
X((D) => D + 1), R = requestAnimationFrame(O);
|
|
5893
5893
|
};
|
|
5894
|
-
return
|
|
5894
|
+
return R = requestAnimationFrame(O), () => cancelAnimationFrame(R);
|
|
5895
5895
|
}, [F.length]);
|
|
5896
|
-
const tt = () => F.map((
|
|
5897
|
-
const
|
|
5896
|
+
const tt = () => F.map((R) => {
|
|
5897
|
+
const O = R.inputBinding.keyboardConfig, D = (gt) => {
|
|
5898
5898
|
var It;
|
|
5899
5899
|
const Et = { key: gt, code: gt, preventDefault: () => {
|
|
5900
5900
|
} };
|
|
@@ -5936,90 +5936,90 @@ const yi = Ss(({
|
|
|
5936
5936
|
/* @__PURE__ */ ge(
|
|
5937
5937
|
"div",
|
|
5938
5938
|
{
|
|
5939
|
-
style: bt(yt(
|
|
5940
|
-
onMouseDown: () => D(
|
|
5941
|
-
onMouseUp: () => q(
|
|
5942
|
-
onMouseLeave: () => q(
|
|
5939
|
+
style: bt(yt(O.upKey)),
|
|
5940
|
+
onMouseDown: () => D(O.upKey),
|
|
5941
|
+
onMouseUp: () => q(O.upKey),
|
|
5942
|
+
onMouseLeave: () => q(O.upKey),
|
|
5943
5943
|
onTouchStart: (gt) => {
|
|
5944
|
-
gt.preventDefault(), D(
|
|
5944
|
+
gt.preventDefault(), D(O.upKey);
|
|
5945
5945
|
},
|
|
5946
5946
|
onTouchEnd: (gt) => {
|
|
5947
|
-
gt.preventDefault(), q(
|
|
5947
|
+
gt.preventDefault(), q(O.upKey);
|
|
5948
5948
|
},
|
|
5949
|
-
children:
|
|
5949
|
+
children: O.upKey.toUpperCase()
|
|
5950
5950
|
}
|
|
5951
5951
|
),
|
|
5952
5952
|
/* @__PURE__ */ Je("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
5953
5953
|
/* @__PURE__ */ ge(
|
|
5954
5954
|
"div",
|
|
5955
5955
|
{
|
|
5956
|
-
style: bt(yt(
|
|
5957
|
-
onMouseDown: () => D(
|
|
5958
|
-
onMouseUp: () => q(
|
|
5959
|
-
onMouseLeave: () => q(
|
|
5956
|
+
style: bt(yt(O.leftKey)),
|
|
5957
|
+
onMouseDown: () => D(O.leftKey),
|
|
5958
|
+
onMouseUp: () => q(O.leftKey),
|
|
5959
|
+
onMouseLeave: () => q(O.leftKey),
|
|
5960
5960
|
onTouchStart: (gt) => {
|
|
5961
|
-
gt.preventDefault(), D(
|
|
5961
|
+
gt.preventDefault(), D(O.leftKey);
|
|
5962
5962
|
},
|
|
5963
5963
|
onTouchEnd: (gt) => {
|
|
5964
|
-
gt.preventDefault(), q(
|
|
5964
|
+
gt.preventDefault(), q(O.leftKey);
|
|
5965
5965
|
},
|
|
5966
|
-
children:
|
|
5966
|
+
children: O.leftKey.toUpperCase()
|
|
5967
5967
|
}
|
|
5968
5968
|
),
|
|
5969
5969
|
/* @__PURE__ */ ge(
|
|
5970
5970
|
"div",
|
|
5971
5971
|
{
|
|
5972
|
-
style: bt(yt(
|
|
5973
|
-
onMouseDown: () => D(
|
|
5974
|
-
onMouseUp: () => q(
|
|
5975
|
-
onMouseLeave: () => q(
|
|
5972
|
+
style: bt(yt(O.downKey)),
|
|
5973
|
+
onMouseDown: () => D(O.downKey),
|
|
5974
|
+
onMouseUp: () => q(O.downKey),
|
|
5975
|
+
onMouseLeave: () => q(O.downKey),
|
|
5976
5976
|
onTouchStart: (gt) => {
|
|
5977
|
-
gt.preventDefault(), D(
|
|
5977
|
+
gt.preventDefault(), D(O.downKey);
|
|
5978
5978
|
},
|
|
5979
5979
|
onTouchEnd: (gt) => {
|
|
5980
|
-
gt.preventDefault(), q(
|
|
5980
|
+
gt.preventDefault(), q(O.downKey);
|
|
5981
5981
|
},
|
|
5982
|
-
children:
|
|
5982
|
+
children: O.downKey.toUpperCase()
|
|
5983
5983
|
}
|
|
5984
5984
|
),
|
|
5985
5985
|
/* @__PURE__ */ ge(
|
|
5986
5986
|
"div",
|
|
5987
5987
|
{
|
|
5988
|
-
style: bt(yt(
|
|
5989
|
-
onMouseDown: () => D(
|
|
5990
|
-
onMouseUp: () => q(
|
|
5991
|
-
onMouseLeave: () => q(
|
|
5988
|
+
style: bt(yt(O.rightKey)),
|
|
5989
|
+
onMouseDown: () => D(O.rightKey),
|
|
5990
|
+
onMouseUp: () => q(O.rightKey),
|
|
5991
|
+
onMouseLeave: () => q(O.rightKey),
|
|
5992
5992
|
onTouchStart: (gt) => {
|
|
5993
|
-
gt.preventDefault(), D(
|
|
5993
|
+
gt.preventDefault(), D(O.rightKey);
|
|
5994
5994
|
},
|
|
5995
5995
|
onTouchEnd: (gt) => {
|
|
5996
|
-
gt.preventDefault(), q(
|
|
5996
|
+
gt.preventDefault(), q(O.rightKey);
|
|
5997
5997
|
},
|
|
5998
|
-
children:
|
|
5998
|
+
children: O.rightKey.toUpperCase()
|
|
5999
5999
|
}
|
|
6000
6000
|
)
|
|
6001
6001
|
] })
|
|
6002
|
-
] },
|
|
6002
|
+
] }, R.id);
|
|
6003
6003
|
});
|
|
6004
6004
|
return /* @__PURE__ */ Je("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
6005
6005
|
/* @__PURE__ */ ge(
|
|
6006
6006
|
"canvas",
|
|
6007
6007
|
{
|
|
6008
6008
|
ref: _,
|
|
6009
|
-
onPointerDown: (
|
|
6010
|
-
var
|
|
6011
|
-
x(
|
|
6009
|
+
onPointerDown: (R) => {
|
|
6010
|
+
var O;
|
|
6011
|
+
x(R, "down"), (O = _.current) == null || O.focus();
|
|
6012
6012
|
},
|
|
6013
|
-
onPointerMove: (
|
|
6014
|
-
onPointerUp: (
|
|
6015
|
-
onPointerCancel: (
|
|
6016
|
-
onClick: (
|
|
6017
|
-
onWheel: (
|
|
6018
|
-
E.current.handleWheel(
|
|
6013
|
+
onPointerMove: (R) => x(R, "move"),
|
|
6014
|
+
onPointerUp: (R) => x(R, "up"),
|
|
6015
|
+
onPointerCancel: (R) => x(R, "up"),
|
|
6016
|
+
onClick: (R) => x(R, "click"),
|
|
6017
|
+
onWheel: (R) => {
|
|
6018
|
+
E.current.handleWheel(R.deltaX, R.deltaY);
|
|
6019
6019
|
},
|
|
6020
|
-
onKeyDown: (
|
|
6021
|
-
onKeyUp: (
|
|
6022
|
-
onContextMenu: (
|
|
6020
|
+
onKeyDown: (R) => E.current.handleKeyDown(R.nativeEvent),
|
|
6021
|
+
onKeyUp: (R) => E.current.handleKeyUp(R.nativeEvent),
|
|
6022
|
+
onContextMenu: (R) => R.preventDefault(),
|
|
6023
6023
|
tabIndex: 0,
|
|
6024
6024
|
style: {
|
|
6025
6025
|
...i,
|
|
@@ -6050,9 +6050,9 @@ function bi() {
|
|
|
6050
6050
|
g == null || g.setInputStringArray(l, p);
|
|
6051
6051
|
}, [g]), r = Me((l, p) => {
|
|
6052
6052
|
g == null || g.updateObjectOptions(l, p);
|
|
6053
|
-
}, [g]),
|
|
6053
|
+
}, [g]), h = Me((l, p, c) => {
|
|
6054
6054
|
g == null || g.updateConstraint(l, p, c);
|
|
6055
|
-
}, [g]),
|
|
6055
|
+
}, [g]), f = Me((l, p) => {
|
|
6056
6056
|
g == null || g.updateGraphData(l, p);
|
|
6057
6057
|
}, [g]);
|
|
6058
6058
|
return {
|
|
@@ -6065,8 +6065,8 @@ function bi() {
|
|
|
6065
6065
|
setInputText: s,
|
|
6066
6066
|
setInputNumberArray: n,
|
|
6067
6067
|
setInputStringArray: a,
|
|
6068
|
-
updateConstraint:
|
|
6069
|
-
updateGraphData:
|
|
6068
|
+
updateConstraint: h,
|
|
6069
|
+
updateGraphData: f,
|
|
6070
6070
|
updateObjectOptions: r
|
|
6071
6071
|
};
|
|
6072
6072
|
}
|
|
@@ -6089,24 +6089,24 @@ const vi = ({ artboard: g, config: t }) => {
|
|
|
6089
6089
|
l.length > 0 && (r = l[0].geometry.text);
|
|
6090
6090
|
}
|
|
6091
6091
|
r && (e("name", "description", r), e("property", "og:description", r)), i.keywords && i.keywords.length > 0 && e("name", "keywords", i.keywords.join(", "));
|
|
6092
|
-
const
|
|
6093
|
-
|
|
6092
|
+
const h = i.ogImage || g.backgroundImage;
|
|
6093
|
+
h && e("property", "og:image", h), a && e("property", "og:title", a), e("property", "og:type", "website");
|
|
6094
6094
|
}, [i, g, o]);
|
|
6095
|
-
const e = (a, r,
|
|
6096
|
-
let
|
|
6097
|
-
|
|
6095
|
+
const e = (a, r, h) => {
|
|
6096
|
+
let f = document.querySelector(`meta[${a}="${r}"]`);
|
|
6097
|
+
f || (f = document.createElement("meta"), f.setAttribute(a, r), document.head.appendChild(f)), f.setAttribute("content", h);
|
|
6098
6098
|
}, s = () => {
|
|
6099
6099
|
const a = [];
|
|
6100
|
-
return a.push(/* @__PURE__ */ ge("h1", { children: i.title || g.name }, "artboard-title")), g.objects.forEach((
|
|
6100
|
+
return a.push(/* @__PURE__ */ ge("h1", { children: i.title || g.name }, "artboard-title")), g.objects.forEach((h, f) => {
|
|
6101
6101
|
var l, p;
|
|
6102
|
-
if (!(
|
|
6103
|
-
if (((l =
|
|
6104
|
-
const c =
|
|
6105
|
-
c && (
|
|
6106
|
-
} else if (((p =
|
|
6107
|
-
const c =
|
|
6108
|
-
a.push(/* @__PURE__ */ ge("img", { src: c, alt: d },
|
|
6109
|
-
} else
|
|
6102
|
+
if (!(h.visible === !1 || h.isVisible === !1))
|
|
6103
|
+
if (((l = h.geometry) == null ? void 0 : l.type) === "Text") {
|
|
6104
|
+
const c = h.geometry.text;
|
|
6105
|
+
c && (h.geometry.fontSize > 24 ? a.push(/* @__PURE__ */ ge("h2", { children: c }, h.id || f)) : a.push(/* @__PURE__ */ ge("p", { children: c }, h.id || f)));
|
|
6106
|
+
} else if (((p = h.geometry) == null ? void 0 : p.type) === "Image") {
|
|
6107
|
+
const c = h.geometry.src, d = h.altText || h.name || "Illustration";
|
|
6108
|
+
a.push(/* @__PURE__ */ ge("img", { src: c, alt: d }, h.id || f));
|
|
6109
|
+
} else h.type === "Button" && a.push(/* @__PURE__ */ ge("button", { children: h.name || "Button" }, h.id || f));
|
|
6110
6110
|
}), a;
|
|
6111
6111
|
}, n = i.jsonLd || {
|
|
6112
6112
|
"@context": "https://schema.org",
|
|
@@ -6139,9 +6139,9 @@ const vi = ({ artboard: g, config: t }) => {
|
|
|
6139
6139
|
]
|
|
6140
6140
|
}
|
|
6141
6141
|
);
|
|
6142
|
-
},
|
|
6143
|
-
version:
|
|
6144
|
-
}, Si =
|
|
6142
|
+
}, hi = "6.3.38", fi = {
|
|
6143
|
+
version: hi
|
|
6144
|
+
}, Si = fi.version;
|
|
6145
6145
|
export {
|
|
6146
6146
|
Zt as BehaviorSensor,
|
|
6147
6147
|
U as BehaviorType,
|