exodeui 2.6.30 → 2.6.32
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/engine.d.ts +2 -0
- package/dist/index.js +4 -4
- package/dist/index.mjs +723 -708
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
var MC = Object.defineProperty;
|
|
2
2
|
var JC = (D, A, I) => A in D ? MC(D, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : D[A] = I;
|
|
3
|
-
var
|
|
3
|
+
var AA = (D, A, I) => JC(D, typeof A != "symbol" ? A + "" : A, I);
|
|
4
4
|
import { jsx as UC } from "react/jsx-runtime";
|
|
5
5
|
import { forwardRef as RC, useRef as wI, useImperativeHandle as tC, useEffect as eA, useState as cC, useCallback as nA } from "react";
|
|
6
6
|
var YC = /* @__PURE__ */ ((D) => (D.Equal = "Equal", D.NotEqual = "NotEqual", D.GreaterThan = "GreaterThan", D.LessThan = "LessThan", D.GreaterEqual = "GreaterEqual", D.LessEqual = "LessEqual", D.IsTrue = "IsTrue", D.IsFalse = "IsFalse", D))(YC || {}), VA = /* @__PURE__ */ ((D) => (D.AND = "AND", D.OR = "OR", D.NOT = "NOT", D.XOR = "XOR", D))(VA || {});
|
|
7
7
|
let E;
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return
|
|
8
|
+
const z = new Array(128).fill(void 0);
|
|
9
|
+
function v(D) {
|
|
10
|
+
return z[D];
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
let II =
|
|
14
|
-
function
|
|
15
|
-
II ===
|
|
12
|
+
z.push(void 0, null, !0, !1);
|
|
13
|
+
let II = z.length;
|
|
14
|
+
function CA(D) {
|
|
15
|
+
II === z.length && z.push(z.length + 1);
|
|
16
16
|
const A = II;
|
|
17
|
-
return II =
|
|
17
|
+
return II = z[A], z[A] = D, A;
|
|
18
18
|
}
|
|
19
19
|
function hI(D, A) {
|
|
20
20
|
try {
|
|
21
21
|
return D.apply(this, A);
|
|
22
22
|
} catch (I) {
|
|
23
|
-
E.__wbindgen_export_0(
|
|
23
|
+
E.__wbindgen_export_0(CA(I));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const Wg = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
|
|
@@ -31,7 +31,7 @@ let zA = null;
|
|
|
31
31
|
function OI(D, A) {
|
|
32
32
|
return D >>>= 0, Wg.decode((zA !== null && zA.byteLength !== 0 || (zA = new Uint8Array(E.memory.buffer)), zA).subarray(D, D + A));
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function q(D) {
|
|
35
35
|
return D == null;
|
|
36
36
|
}
|
|
37
37
|
let ZA = null;
|
|
@@ -39,18 +39,18 @@ function SA() {
|
|
|
39
39
|
return (ZA === null || ZA.buffer.detached === !0 || ZA.buffer.detached === void 0 && ZA.buffer !== E.memory.buffer) && (ZA = new DataView(E.memory.buffer)), ZA;
|
|
40
40
|
}
|
|
41
41
|
function sI(D) {
|
|
42
|
-
const A =
|
|
42
|
+
const A = v(D);
|
|
43
43
|
return function(I) {
|
|
44
|
-
I < 132 || (
|
|
44
|
+
I < 132 || (z[I] = II, II = I);
|
|
45
45
|
}(D), A;
|
|
46
46
|
}
|
|
47
47
|
function K(D, A) {
|
|
48
48
|
if (!(D instanceof A)) throw new Error(`expected instance of ${A.name}`);
|
|
49
49
|
}
|
|
50
|
-
let
|
|
50
|
+
let BA = 128;
|
|
51
51
|
function DA(D) {
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
52
|
+
if (BA == 1) throw new Error("out of js stack");
|
|
53
|
+
return z[--BA] = D, BA;
|
|
54
54
|
}
|
|
55
55
|
let _A = null;
|
|
56
56
|
function eC(D, A) {
|
|
@@ -100,84 +100,84 @@ class bA {
|
|
|
100
100
|
castRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
101
101
|
try {
|
|
102
102
|
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
|
|
103
|
-
const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o,
|
|
103
|
+
const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, q(h) ? 4294967297 : h >>> 0, !q(s), q(s) ? 0 : s, !q(G), q(G) ? 0 : G, DA(w));
|
|
104
104
|
return a === 0 ? void 0 : gg.__wrap(a);
|
|
105
105
|
} finally {
|
|
106
|
-
|
|
106
|
+
z[BA++] = void 0;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
110
110
|
try {
|
|
111
111
|
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
|
|
112
|
-
const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o,
|
|
112
|
+
const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, q(h) ? 4294967297 : h >>> 0, !q(s), q(s) ? 0 : s, !q(G), q(G) ? 0 : G, DA(w));
|
|
113
113
|
return a === 0 ? void 0 : JI.__wrap(a);
|
|
114
114
|
} finally {
|
|
115
|
-
|
|
115
|
+
z[BA++] = void 0;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w, a) {
|
|
119
119
|
try {
|
|
120
|
-
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, DA(o), h,
|
|
120
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, DA(o), h, q(s) ? 4294967297 : s >>> 0, !q(G), q(G) ? 0 : G, !q(w), q(w) ? 0 : w, DA(a));
|
|
121
121
|
} finally {
|
|
122
|
-
|
|
122
|
+
z[BA++] = void 0, z[BA++] = void 0;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
126
126
|
try {
|
|
127
127
|
const N = E.__wbindgen_add_to_stack_pointer(-16);
|
|
128
|
-
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q,
|
|
128
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, _), K(B, d), E.rawbroadphase_intersectionWithShape(N, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, q(o) ? 4294967297 : o >>> 0, !q(h), q(h) ? 0 : h, !q(s), q(s) ? 0 : s, DA(G));
|
|
129
129
|
var w = SA().getInt32(N + 0, !0), a = SA().getFloat64(N + 8, !0);
|
|
130
130
|
return w === 0 ? void 0 : a;
|
|
131
131
|
} finally {
|
|
132
|
-
E.__wbindgen_add_to_stack_pointer(16),
|
|
132
|
+
E.__wbindgen_add_to_stack_pointer(16), z[BA++] = void 0;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
projectPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
136
136
|
try {
|
|
137
137
|
K(A, GA), K(I, EA), K(C, wA), K(g, M);
|
|
138
|
-
const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B,
|
|
138
|
+
const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, q(i) ? 4294967297 : i >>> 0, !q(o), q(o) ? 0 : o, !q(h), q(h) ? 0 : h, DA(s));
|
|
139
139
|
return G === 0 ? void 0 : GI.__wrap(G);
|
|
140
140
|
} finally {
|
|
141
|
-
|
|
141
|
+
z[BA++] = void 0;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
|
|
145
145
|
try {
|
|
146
146
|
K(A, GA), K(I, EA), K(C, wA), K(g, M);
|
|
147
|
-
const s = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q,
|
|
147
|
+
const s = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, q(B) ? 4294967297 : B >>> 0, !q(i), q(i) ? 0 : i, !q(o), q(o) ? 0 : o, DA(h));
|
|
148
148
|
return s === 0 ? void 0 : GI.__wrap(s);
|
|
149
149
|
} finally {
|
|
150
|
-
|
|
150
|
+
z[BA++] = void 0;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
154
154
|
try {
|
|
155
|
-
K(A, GA), K(I, EA), K(C, wA), K(g, M), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, DA(Q), B,
|
|
155
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, DA(Q), B, q(i) ? 4294967297 : i >>> 0, !q(o), q(o) ? 0 : o, !q(h), q(h) ? 0 : h, DA(s));
|
|
156
156
|
} finally {
|
|
157
|
-
|
|
157
|
+
z[BA++] = void 0, z[BA++] = void 0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
|
|
161
161
|
try {
|
|
162
|
-
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q,
|
|
163
|
-
const k = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s, G,
|
|
162
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, _), K(B, M), K(i, d);
|
|
163
|
+
const k = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s, G, q(w) ? 4294967297 : w >>> 0, !q(a), q(a) ? 0 : a, !q(N), q(N) ? 0 : N, DA(S));
|
|
164
164
|
return k === 0 ? void 0 : FI.__wrap(k);
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
z[BA++] = void 0;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
170
170
|
try {
|
|
171
|
-
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q,
|
|
171
|
+
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, _), K(B, d), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, DA(i), o, q(h) ? 4294967297 : h >>> 0, !q(s), q(s) ? 0 : s, !q(G), q(G) ? 0 : G, DA(w));
|
|
172
172
|
} finally {
|
|
173
|
-
|
|
173
|
+
z[BA++] = void 0, z[BA++] = void 0;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
|
|
177
177
|
try {
|
|
178
178
|
K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, DA(B));
|
|
179
179
|
} finally {
|
|
180
|
-
|
|
180
|
+
z[BA++] = void 0;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -268,7 +268,7 @@ class wA {
|
|
|
268
268
|
}
|
|
269
269
|
coRotation(A) {
|
|
270
270
|
const I = E.rawcolliderset_coRotation(this.__wbg_ptr, A);
|
|
271
|
-
return
|
|
271
|
+
return _.__wrap(I);
|
|
272
272
|
}
|
|
273
273
|
coTranslationWrtParent(A) {
|
|
274
274
|
const I = E.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, A);
|
|
@@ -276,7 +276,7 @@ class wA {
|
|
|
276
276
|
}
|
|
277
277
|
coRotationWrtParent(A) {
|
|
278
278
|
const I = E.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
|
|
279
|
-
return I === 0 ? void 0 :
|
|
279
|
+
return I === 0 ? void 0 : _.__wrap(I);
|
|
280
280
|
}
|
|
281
281
|
coSetTranslation(A, I, C) {
|
|
282
282
|
E.rawcolliderset_coSetTranslation(this.__wbg_ptr, A, I, C);
|
|
@@ -454,7 +454,7 @@ class wA {
|
|
|
454
454
|
return K(I, M), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
|
|
455
455
|
}
|
|
456
456
|
coCastShape(A, I, C, g, Q, B, i, o, h) {
|
|
457
|
-
K(I, M), K(C,
|
|
457
|
+
K(I, M), K(C, d), K(g, M), K(Q, _), K(B, M);
|
|
458
458
|
const s = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, o, h);
|
|
459
459
|
return s === 0 ? void 0 : RI.__wrap(s);
|
|
460
460
|
}
|
|
@@ -464,10 +464,10 @@ class wA {
|
|
|
464
464
|
return o === 0 ? void 0 : FI.__wrap(o);
|
|
465
465
|
}
|
|
466
466
|
coIntersectsShape(A, I, C, g) {
|
|
467
|
-
return K(I,
|
|
467
|
+
return K(I, d), K(C, M), K(g, _), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
|
|
468
468
|
}
|
|
469
469
|
coContactShape(A, I, C, g, Q) {
|
|
470
|
-
K(I,
|
|
470
|
+
K(I, d), K(C, M), K(g, _);
|
|
471
471
|
const B = E.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q);
|
|
472
472
|
return B === 0 ? void 0 : gI.__wrap(B);
|
|
473
473
|
}
|
|
@@ -528,7 +528,7 @@ class wA {
|
|
|
528
528
|
E.rawcolliderset_coSetActiveCollisionTypes(this.__wbg_ptr, A, I);
|
|
529
529
|
}
|
|
530
530
|
coSetShape(A, I) {
|
|
531
|
-
K(I,
|
|
531
|
+
K(I, d), E.rawcolliderset_coSetShape(this.__wbg_ptr, A, I.__wbg_ptr);
|
|
532
532
|
}
|
|
533
533
|
coSetContactForceEventThreshold(A, I) {
|
|
534
534
|
E.rawcolliderset_coSetContactForceEventThreshold(this.__wbg_ptr, A, I);
|
|
@@ -552,12 +552,12 @@ class wA {
|
|
|
552
552
|
contains(A) {
|
|
553
553
|
return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
|
|
554
554
|
}
|
|
555
|
-
createCollider(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k,
|
|
555
|
+
createCollider(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, F, U, c, Y, J, R, e, t) {
|
|
556
556
|
try {
|
|
557
|
-
const
|
|
558
|
-
K(I,
|
|
559
|
-
var
|
|
560
|
-
return
|
|
557
|
+
const T = E.__wbindgen_add_to_stack_pointer(-16);
|
|
558
|
+
K(I, d), K(C, M), K(g, _), K(i, M), K(t, EA), E.rawcolliderset_createCollider(T, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, i.__wbg_ptr, o, h, s, G, w, a, N, S, k, F, U, c, Y, J, R, e, t.__wbg_ptr);
|
|
559
|
+
var L = SA().getInt32(T + 0, !0), r = SA().getFloat64(T + 8, !0);
|
|
560
|
+
return L === 0 ? void 0 : r;
|
|
561
561
|
} finally {
|
|
562
562
|
E.__wbindgen_add_to_stack_pointer(16);
|
|
563
563
|
}
|
|
@@ -572,7 +572,7 @@ class wA {
|
|
|
572
572
|
try {
|
|
573
573
|
E.rawcolliderset_forEachColliderHandle(this.__wbg_ptr, DA(A));
|
|
574
574
|
} finally {
|
|
575
|
-
|
|
575
|
+
z[BA++] = void 0;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
}
|
|
@@ -793,7 +793,7 @@ class rC {
|
|
|
793
793
|
try {
|
|
794
794
|
K(A, EA), K(I, wA), K(C, lA), K(g, HA), K(Q, GA), E.rawdebugrenderpipeline_render(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, DA(i));
|
|
795
795
|
} finally {
|
|
796
|
-
|
|
796
|
+
z[BA++] = void 0;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
}
|
|
@@ -871,14 +871,14 @@ class Xg {
|
|
|
871
871
|
try {
|
|
872
872
|
E.raweventqueue_drainCollisionEvents(this.__wbg_ptr, DA(A));
|
|
873
873
|
} finally {
|
|
874
|
-
|
|
874
|
+
z[BA++] = void 0;
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
drainContactForceEvents(A) {
|
|
878
878
|
try {
|
|
879
879
|
E.raweventqueue_drainContactForceEvents(this.__wbg_ptr, DA(A));
|
|
880
880
|
} finally {
|
|
881
|
-
|
|
881
|
+
z[BA++] = void 0;
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
884
|
clear() {
|
|
@@ -918,7 +918,7 @@ class MA {
|
|
|
918
918
|
return i === 0 ? void 0 : MA.__wrap(i);
|
|
919
919
|
}
|
|
920
920
|
static fixed(A, I, C, g) {
|
|
921
|
-
K(A, M), K(I,
|
|
921
|
+
K(A, M), K(I, _), K(C, M), K(g, _);
|
|
922
922
|
const Q = E.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr);
|
|
923
923
|
return MA.__wrap(Q);
|
|
924
924
|
}
|
|
@@ -956,11 +956,11 @@ class lA {
|
|
|
956
956
|
}
|
|
957
957
|
jointFrameX1(A) {
|
|
958
958
|
const I = E.rawimpulsejointset_jointFrameX1(this.__wbg_ptr, A);
|
|
959
|
-
return
|
|
959
|
+
return _.__wrap(I);
|
|
960
960
|
}
|
|
961
961
|
jointFrameX2(A) {
|
|
962
962
|
const I = E.rawimpulsejointset_jointFrameX2(this.__wbg_ptr, A);
|
|
963
|
-
return
|
|
963
|
+
return _.__wrap(I);
|
|
964
964
|
}
|
|
965
965
|
jointAnchor1(A) {
|
|
966
966
|
const I = E.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
|
|
@@ -1026,14 +1026,14 @@ class lA {
|
|
|
1026
1026
|
try {
|
|
1027
1027
|
E.rawimpulsejointset_forEachJointHandle(this.__wbg_ptr, DA(A));
|
|
1028
1028
|
} finally {
|
|
1029
|
-
|
|
1029
|
+
z[BA++] = void 0;
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
1032
|
forEachJointAttachedToRigidBody(A, I) {
|
|
1033
1033
|
try {
|
|
1034
1034
|
E.rawimpulsejointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, DA(I));
|
|
1035
1035
|
} finally {
|
|
1036
|
-
|
|
1036
|
+
z[BA++] = void 0;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
@@ -1138,7 +1138,7 @@ class qA {
|
|
|
1138
1138
|
try {
|
|
1139
1139
|
E.rawislandmanager_forEachActiveRigidBodyHandle(this.__wbg_ptr, DA(A));
|
|
1140
1140
|
} finally {
|
|
1141
|
-
|
|
1141
|
+
z[BA++] = void 0;
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
@@ -1231,9 +1231,9 @@ class LC {
|
|
|
1231
1231
|
}
|
|
1232
1232
|
computeColliderMovement(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
1233
1233
|
try {
|
|
1234
|
-
K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i, M), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i.__wbg_ptr, o,
|
|
1234
|
+
K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i, M), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i.__wbg_ptr, o, q(h) ? 4294967297 : Math.fround(h), s, q(G) ? 4294967297 : G >>> 0, DA(w));
|
|
1235
1235
|
} finally {
|
|
1236
|
-
|
|
1236
|
+
z[BA++] = void 0;
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
computedMovement() {
|
|
@@ -1272,11 +1272,11 @@ class HA {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
jointFrameX1(A) {
|
|
1274
1274
|
const I = E.rawmultibodyjointset_jointFrameX1(this.__wbg_ptr, A);
|
|
1275
|
-
return
|
|
1275
|
+
return _.__wrap(I);
|
|
1276
1276
|
}
|
|
1277
1277
|
jointFrameX2(A) {
|
|
1278
1278
|
const I = E.rawmultibodyjointset_jointFrameX2(this.__wbg_ptr, A);
|
|
1279
|
-
return
|
|
1279
|
+
return _.__wrap(I);
|
|
1280
1280
|
}
|
|
1281
1281
|
jointAnchor1(A) {
|
|
1282
1282
|
const I = E.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
|
|
@@ -1318,14 +1318,14 @@ class HA {
|
|
|
1318
1318
|
try {
|
|
1319
1319
|
E.rawmultibodyjointset_forEachJointHandle(this.__wbg_ptr, DA(A));
|
|
1320
1320
|
} finally {
|
|
1321
|
-
|
|
1321
|
+
z[BA++] = void 0;
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
1324
|
forEachJointAttachedToRigidBody(A, I) {
|
|
1325
1325
|
try {
|
|
1326
1326
|
E.rawmultibodyjointset_forEachJointAttachedToRigidBody(this.__wbg_ptr, A, DA(I));
|
|
1327
1327
|
} finally {
|
|
1328
|
-
|
|
1328
|
+
z[BA++] = void 0;
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
@@ -1351,14 +1351,14 @@ class GA {
|
|
|
1351
1351
|
return this.__wbg_ptr = A >>> 0, fI.register(this, this.__wbg_ptr, this), this;
|
|
1352
1352
|
}
|
|
1353
1353
|
contact_pairs_with(A, I) {
|
|
1354
|
-
E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A,
|
|
1354
|
+
E.rawnarrowphase_contact_pairs_with(this.__wbg_ptr, A, CA(I));
|
|
1355
1355
|
}
|
|
1356
1356
|
contact_pair(A, I) {
|
|
1357
1357
|
const C = E.rawnarrowphase_contact_pair(this.__wbg_ptr, A, I);
|
|
1358
1358
|
return C === 0 ? void 0 : Ag.__wrap(C);
|
|
1359
1359
|
}
|
|
1360
1360
|
intersection_pairs_with(A, I) {
|
|
1361
|
-
E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A,
|
|
1361
|
+
E.rawnarrowphase_intersection_pairs_with(this.__wbg_ptr, A, CA(I));
|
|
1362
1362
|
}
|
|
1363
1363
|
intersection_pair(A, I) {
|
|
1364
1364
|
return E.rawnarrowphase_intersection_pair(this.__wbg_ptr, A, I) !== 0;
|
|
@@ -1438,7 +1438,7 @@ class nC {
|
|
|
1438
1438
|
K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr);
|
|
1439
1439
|
}
|
|
1440
1440
|
stepWithEvents(A, I, C, g, Q, B, i, o, h, s, G, w, a, N) {
|
|
1441
|
-
K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), K(G, Xg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr, G.__wbg_ptr,
|
|
1441
|
+
K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), K(G, Xg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr, G.__wbg_ptr, CA(w), CA(a), CA(N));
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
const Lg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
@@ -1661,7 +1661,7 @@ class EA {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
rbRotation(A) {
|
|
1663
1663
|
const I = E.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
|
|
1664
|
-
return
|
|
1664
|
+
return _.__wrap(I);
|
|
1665
1665
|
}
|
|
1666
1666
|
rbSleep(A) {
|
|
1667
1667
|
E.rawrigidbodyset_rbSleep(this.__wbg_ptr, A);
|
|
@@ -1678,7 +1678,7 @@ class EA {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
rbNextRotation(A) {
|
|
1680
1680
|
const I = E.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
|
|
1681
|
-
return
|
|
1681
|
+
return _.__wrap(I);
|
|
1682
1682
|
}
|
|
1683
1683
|
rbSetTranslation(A, I, C, g) {
|
|
1684
1684
|
E.rawrigidbodyset_rbSetTranslation(this.__wbg_ptr, A, I, C, g);
|
|
@@ -1871,8 +1871,8 @@ class EA {
|
|
|
1871
1871
|
const A = E.rawrigidbodyset_new();
|
|
1872
1872
|
return this.__wbg_ptr = A >>> 0, bI.register(this, this.__wbg_ptr, this), this;
|
|
1873
1873
|
}
|
|
1874
|
-
createRigidBody(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k,
|
|
1875
|
-
return K(I, M), K(C,
|
|
1874
|
+
createRigidBody(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, F, U, c, Y, J, R) {
|
|
1875
|
+
return K(I, M), K(C, _), K(i, M), K(o, M), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, i.__wbg_ptr, o.__wbg_ptr, h, s, G, w, a, N, S, k, F, U, c, Y, J, R);
|
|
1876
1876
|
}
|
|
1877
1877
|
remove(A, I, C, g, Q) {
|
|
1878
1878
|
K(I, qA), K(C, wA), K(g, lA), K(Q, HA), E.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr);
|
|
@@ -1887,7 +1887,7 @@ class EA {
|
|
|
1887
1887
|
try {
|
|
1888
1888
|
E.rawrigidbodyset_forEachRigidBodyHandle(this.__wbg_ptr, DA(A));
|
|
1889
1889
|
} finally {
|
|
1890
|
-
|
|
1890
|
+
z[BA++] = void 0;
|
|
1891
1891
|
}
|
|
1892
1892
|
}
|
|
1893
1893
|
propagateModifiedBodyPositionsToColliders(A) {
|
|
@@ -1897,10 +1897,10 @@ class EA {
|
|
|
1897
1897
|
const dg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1898
1898
|
}, unregister: () => {
|
|
1899
1899
|
} } : new FinalizationRegistry((D) => E.__wbg_rawrotation_free(D >>> 0, 1));
|
|
1900
|
-
class
|
|
1900
|
+
class _ {
|
|
1901
1901
|
static __wrap(A) {
|
|
1902
1902
|
A >>>= 0;
|
|
1903
|
-
const I = Object.create(
|
|
1903
|
+
const I = Object.create(_.prototype);
|
|
1904
1904
|
return I.__wbg_ptr = A, dg.register(I, I.__wbg_ptr, I), I;
|
|
1905
1905
|
}
|
|
1906
1906
|
__destroy_into_raw() {
|
|
@@ -1913,11 +1913,11 @@ class u {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
static identity() {
|
|
1915
1915
|
const A = E.rawrotation_identity();
|
|
1916
|
-
return
|
|
1916
|
+
return _.__wrap(A);
|
|
1917
1917
|
}
|
|
1918
1918
|
static fromAngle(A) {
|
|
1919
1919
|
const I = E.rawrotation_fromAngle(A);
|
|
1920
|
-
return
|
|
1920
|
+
return _.__wrap(I);
|
|
1921
1921
|
}
|
|
1922
1922
|
get im() {
|
|
1923
1923
|
return E.rawkinematiccharactercontroller_offset(this.__wbg_ptr);
|
|
@@ -1949,17 +1949,17 @@ class qC {
|
|
|
1949
1949
|
return K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), sI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr));
|
|
1950
1950
|
}
|
|
1951
1951
|
deserializeAll(A) {
|
|
1952
|
-
const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr,
|
|
1952
|
+
const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, CA(A));
|
|
1953
1953
|
return I === 0 ? void 0 : Ig.__wrap(I);
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
1956
|
const bg = typeof FinalizationRegistry > "u" ? { register: () => {
|
|
1957
1957
|
}, unregister: () => {
|
|
1958
1958
|
} } : new FinalizationRegistry((D) => E.__wbg_rawshape_free(D >>> 0, 1));
|
|
1959
|
-
class
|
|
1959
|
+
class d {
|
|
1960
1960
|
static __wrap(A) {
|
|
1961
1961
|
A >>>= 0;
|
|
1962
|
-
const I = Object.create(
|
|
1962
|
+
const I = Object.create(d.prototype);
|
|
1963
1963
|
return I.__wbg_ptr = A, bg.register(I, I.__wbg_ptr, I), I;
|
|
1964
1964
|
}
|
|
1965
1965
|
__destroy_into_raw() {
|
|
@@ -1972,109 +1972,109 @@ class H {
|
|
|
1972
1972
|
}
|
|
1973
1973
|
static cuboid(A, I) {
|
|
1974
1974
|
const C = E.rawshape_cuboid(A, I);
|
|
1975
|
-
return
|
|
1975
|
+
return d.__wrap(C);
|
|
1976
1976
|
}
|
|
1977
1977
|
static roundCuboid(A, I, C) {
|
|
1978
1978
|
const g = E.rawshape_roundCuboid(A, I, C);
|
|
1979
|
-
return
|
|
1979
|
+
return d.__wrap(g);
|
|
1980
1980
|
}
|
|
1981
1981
|
static ball(A) {
|
|
1982
1982
|
const I = E.rawshape_ball(A);
|
|
1983
|
-
return
|
|
1983
|
+
return d.__wrap(I);
|
|
1984
1984
|
}
|
|
1985
1985
|
static halfspace(A) {
|
|
1986
1986
|
K(A, M);
|
|
1987
1987
|
const I = E.rawshape_halfspace(A.__wbg_ptr);
|
|
1988
|
-
return
|
|
1988
|
+
return d.__wrap(I);
|
|
1989
1989
|
}
|
|
1990
1990
|
static capsule(A, I) {
|
|
1991
1991
|
const C = E.rawshape_capsule(A, I);
|
|
1992
|
-
return
|
|
1992
|
+
return d.__wrap(C);
|
|
1993
1993
|
}
|
|
1994
1994
|
static voxels(A, I) {
|
|
1995
1995
|
K(A, M);
|
|
1996
1996
|
const C = LI(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxels(A.__wbg_ptr, C, g);
|
|
1997
|
-
return
|
|
1997
|
+
return d.__wrap(Q);
|
|
1998
1998
|
}
|
|
1999
1999
|
static voxelsFromPoints(A, I) {
|
|
2000
2000
|
K(A, M);
|
|
2001
2001
|
const C = dA(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxelsFromPoints(A.__wbg_ptr, C, g);
|
|
2002
|
-
return
|
|
2002
|
+
return d.__wrap(Q);
|
|
2003
2003
|
}
|
|
2004
2004
|
static polyline(A, I) {
|
|
2005
2005
|
const C = dA(A, E.__wbindgen_export_2), g = UA, Q = LI(I, E.__wbindgen_export_2), B = UA, i = E.rawshape_polyline(C, g, Q, B);
|
|
2006
|
-
return
|
|
2006
|
+
return d.__wrap(i);
|
|
2007
2007
|
}
|
|
2008
2008
|
static trimesh(A, I, C) {
|
|
2009
2009
|
const g = dA(A, E.__wbindgen_export_2), Q = UA, B = LI(I, E.__wbindgen_export_2), i = UA, o = E.rawshape_trimesh(g, Q, B, i, C);
|
|
2010
|
-
return o === 0 ? void 0 :
|
|
2010
|
+
return o === 0 ? void 0 : d.__wrap(o);
|
|
2011
2011
|
}
|
|
2012
2012
|
static heightfield(A, I) {
|
|
2013
2013
|
const C = dA(A, E.__wbindgen_export_2), g = UA;
|
|
2014
2014
|
K(I, M);
|
|
2015
2015
|
const Q = E.rawshape_heightfield(C, g, I.__wbg_ptr);
|
|
2016
|
-
return
|
|
2016
|
+
return d.__wrap(Q);
|
|
2017
2017
|
}
|
|
2018
2018
|
static segment(A, I) {
|
|
2019
2019
|
K(A, M), K(I, M);
|
|
2020
2020
|
const C = E.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
|
|
2021
|
-
return
|
|
2021
|
+
return d.__wrap(C);
|
|
2022
2022
|
}
|
|
2023
2023
|
static triangle(A, I, C) {
|
|
2024
2024
|
K(A, M), K(I, M), K(C, M);
|
|
2025
2025
|
const g = E.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr);
|
|
2026
|
-
return
|
|
2026
|
+
return d.__wrap(g);
|
|
2027
2027
|
}
|
|
2028
2028
|
static roundTriangle(A, I, C, g) {
|
|
2029
2029
|
K(A, M), K(I, M), K(C, M);
|
|
2030
2030
|
const Q = E.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
2031
|
-
return
|
|
2031
|
+
return d.__wrap(Q);
|
|
2032
2032
|
}
|
|
2033
2033
|
static convexHull(A) {
|
|
2034
2034
|
const I = dA(A, E.__wbindgen_export_2), C = UA, g = E.rawshape_convexHull(I, C);
|
|
2035
|
-
return g === 0 ? void 0 :
|
|
2035
|
+
return g === 0 ? void 0 : d.__wrap(g);
|
|
2036
2036
|
}
|
|
2037
2037
|
static roundConvexHull(A, I) {
|
|
2038
2038
|
const C = dA(A, E.__wbindgen_export_2), g = UA, Q = E.rawshape_roundConvexHull(C, g, I);
|
|
2039
|
-
return Q === 0 ? void 0 :
|
|
2039
|
+
return Q === 0 ? void 0 : d.__wrap(Q);
|
|
2040
2040
|
}
|
|
2041
2041
|
static convexPolyline(A) {
|
|
2042
2042
|
const I = dA(A, E.__wbindgen_export_2), C = UA, g = E.rawshape_convexPolyline(I, C);
|
|
2043
|
-
return g === 0 ? void 0 :
|
|
2043
|
+
return g === 0 ? void 0 : d.__wrap(g);
|
|
2044
2044
|
}
|
|
2045
2045
|
static roundConvexPolyline(A, I) {
|
|
2046
2046
|
const C = dA(A, E.__wbindgen_export_2), g = UA, Q = E.rawshape_roundConvexPolyline(C, g, I);
|
|
2047
|
-
return Q === 0 ? void 0 :
|
|
2047
|
+
return Q === 0 ? void 0 : d.__wrap(Q);
|
|
2048
2048
|
}
|
|
2049
2049
|
castShape(A, I, C, g, Q, B, i, o, h, s) {
|
|
2050
|
-
K(A, M), K(I,
|
|
2050
|
+
K(A, M), K(I, _), K(C, M), K(g, d), K(Q, M), K(B, _), K(i, M);
|
|
2051
2051
|
const G = E.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s);
|
|
2052
2052
|
return G === 0 ? void 0 : RI.__wrap(G);
|
|
2053
2053
|
}
|
|
2054
2054
|
intersectsShape(A, I, C, g, Q) {
|
|
2055
|
-
return K(A, M), K(I,
|
|
2055
|
+
return K(A, M), K(I, _), K(C, d), K(g, M), K(Q, _), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
|
|
2056
2056
|
}
|
|
2057
2057
|
contactShape(A, I, C, g, Q, B) {
|
|
2058
|
-
K(A, M), K(I,
|
|
2058
|
+
K(A, M), K(I, _), K(C, d), K(g, M), K(Q, _);
|
|
2059
2059
|
const i = E.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B);
|
|
2060
2060
|
return i === 0 ? void 0 : gI.__wrap(i);
|
|
2061
2061
|
}
|
|
2062
2062
|
containsPoint(A, I, C) {
|
|
2063
|
-
return K(A, M), K(I,
|
|
2063
|
+
return K(A, M), K(I, _), K(C, M), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
|
|
2064
2064
|
}
|
|
2065
2065
|
projectPoint(A, I, C, g) {
|
|
2066
|
-
K(A, M), K(I,
|
|
2066
|
+
K(A, M), K(I, _), K(C, M);
|
|
2067
2067
|
const Q = E.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
|
|
2068
2068
|
return MI.__wrap(Q);
|
|
2069
2069
|
}
|
|
2070
2070
|
intersectsRay(A, I, C, g, Q) {
|
|
2071
|
-
return K(A, M), K(I,
|
|
2071
|
+
return K(A, M), K(I, _), K(C, M), K(g, M), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
|
|
2072
2072
|
}
|
|
2073
2073
|
castRay(A, I, C, g, Q, B) {
|
|
2074
|
-
return K(A, M), K(I,
|
|
2074
|
+
return K(A, M), K(I, _), K(C, M), K(g, M), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
|
|
2075
2075
|
}
|
|
2076
2076
|
castRayAndGetNormal(A, I, C, g, Q, B) {
|
|
2077
|
-
K(A, M), K(I,
|
|
2077
|
+
K(A, M), K(I, _), K(C, M), K(g, M);
|
|
2078
2078
|
const i = E.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
|
|
2079
2079
|
return i === 0 ? void 0 : UI.__wrap(i);
|
|
2080
2080
|
}
|
|
@@ -2205,79 +2205,79 @@ async function vg(D) {
|
|
|
2205
2205
|
const A = function() {
|
|
2206
2206
|
const g = { wbg: {} };
|
|
2207
2207
|
return g.wbg.__wbg_bind_c8359b1cba058168 = function(Q, B, i, o) {
|
|
2208
|
-
return
|
|
2208
|
+
return CA(v(Q).bind(v(B), v(i), v(o)));
|
|
2209
2209
|
}, g.wbg.__wbg_buffer_609cc3eee51ed158 = function(Q) {
|
|
2210
|
-
return
|
|
2210
|
+
return CA(v(Q).buffer);
|
|
2211
2211
|
}, g.wbg.__wbg_call_672a4d21634d4a24 = function() {
|
|
2212
2212
|
return hI(function(Q, B) {
|
|
2213
|
-
return
|
|
2213
|
+
return CA(v(Q).call(v(B)));
|
|
2214
2214
|
}, arguments);
|
|
2215
2215
|
}, g.wbg.__wbg_call_7cccdd69e0791ae2 = function() {
|
|
2216
2216
|
return hI(function(Q, B, i) {
|
|
2217
|
-
return
|
|
2217
|
+
return CA(v(Q).call(v(B), v(i)));
|
|
2218
2218
|
}, arguments);
|
|
2219
2219
|
}, g.wbg.__wbg_call_833bed5770ea2041 = function() {
|
|
2220
2220
|
return hI(function(Q, B, i, o) {
|
|
2221
|
-
return
|
|
2221
|
+
return CA(v(Q).call(v(B), v(i), v(o)));
|
|
2222
2222
|
}, arguments);
|
|
2223
2223
|
}, g.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
|
|
2224
2224
|
return hI(function(Q, B, i, o, h) {
|
|
2225
|
-
return
|
|
2225
|
+
return CA(v(Q).call(v(B), v(i), v(o), v(h)));
|
|
2226
2226
|
}, arguments);
|
|
2227
2227
|
}, g.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
|
|
2228
|
-
return
|
|
2228
|
+
return v(Q).length;
|
|
2229
2229
|
}, g.wbg.__wbg_length_a446193dc22c12f8 = function(Q) {
|
|
2230
|
-
return
|
|
2230
|
+
return v(Q).length;
|
|
2231
2231
|
}, g.wbg.__wbg_new_a12002a7f91c75be = function(Q) {
|
|
2232
|
-
return
|
|
2232
|
+
return CA(new Uint8Array(v(Q)));
|
|
2233
2233
|
}, g.wbg.__wbg_newnoargs_105ed471475aaf50 = function(Q, B) {
|
|
2234
|
-
return
|
|
2234
|
+
return CA(new Function(OI(Q, B)));
|
|
2235
2235
|
}, g.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(Q, B, i) {
|
|
2236
|
-
return
|
|
2236
|
+
return CA(new Uint8Array(v(Q), B >>> 0, i >>> 0));
|
|
2237
2237
|
}, g.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(Q, B, i) {
|
|
2238
|
-
return
|
|
2238
|
+
return CA(new Float32Array(v(Q), B >>> 0, i >>> 0));
|
|
2239
2239
|
}, g.wbg.__wbg_newwithlength_5a5efe313cfd59f1 = function(Q) {
|
|
2240
|
-
return
|
|
2240
|
+
return CA(new Float32Array(Q >>> 0));
|
|
2241
2241
|
}, g.wbg.__wbg_now_2c95c9de01293173 = function(Q) {
|
|
2242
|
-
return
|
|
2242
|
+
return v(Q).now();
|
|
2243
2243
|
}, g.wbg.__wbg_performance_7a3ffd0b17f663ad = function(Q) {
|
|
2244
|
-
return
|
|
2244
|
+
return CA(v(Q).performance);
|
|
2245
2245
|
}, g.wbg.__wbg_rawcontactforceevent_new = function(Q) {
|
|
2246
|
-
return
|
|
2246
|
+
return CA(_I.__wrap(Q));
|
|
2247
2247
|
}, g.wbg.__wbg_rawraycolliderintersection_new = function(Q) {
|
|
2248
|
-
return
|
|
2248
|
+
return CA(JI.__wrap(Q));
|
|
2249
2249
|
}, g.wbg.__wbg_set_10bad9bee0e9c58b = function(Q, B, i) {
|
|
2250
|
-
|
|
2250
|
+
v(Q).set(v(B), i >>> 0);
|
|
2251
2251
|
}, g.wbg.__wbg_set_65595bdd868b3009 = function(Q, B, i) {
|
|
2252
|
-
|
|
2252
|
+
v(Q).set(v(B), i >>> 0);
|
|
2253
2253
|
}, g.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
2254
2254
|
const Q = typeof global > "u" ? null : global;
|
|
2255
|
-
return
|
|
2255
|
+
return q(Q) ? 0 : CA(Q);
|
|
2256
2256
|
}, g.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
2257
2257
|
const Q = typeof globalThis > "u" ? null : globalThis;
|
|
2258
|
-
return
|
|
2258
|
+
return q(Q) ? 0 : CA(Q);
|
|
2259
2259
|
}, g.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
2260
2260
|
const Q = typeof self > "u" ? null : self;
|
|
2261
|
-
return
|
|
2261
|
+
return q(Q) ? 0 : CA(Q);
|
|
2262
2262
|
}, g.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
2263
2263
|
const Q = typeof window > "u" ? null : window;
|
|
2264
|
-
return
|
|
2264
|
+
return q(Q) ? 0 : CA(Q);
|
|
2265
2265
|
}, g.wbg.__wbindgen_boolean_get = function(Q) {
|
|
2266
|
-
const B =
|
|
2266
|
+
const B = v(Q);
|
|
2267
2267
|
return typeof B == "boolean" ? B ? 1 : 0 : 2;
|
|
2268
2268
|
}, g.wbg.__wbindgen_is_function = function(Q) {
|
|
2269
|
-
return typeof
|
|
2269
|
+
return typeof v(Q) == "function";
|
|
2270
2270
|
}, g.wbg.__wbindgen_is_undefined = function(Q) {
|
|
2271
|
-
return
|
|
2271
|
+
return v(Q) === void 0;
|
|
2272
2272
|
}, g.wbg.__wbindgen_memory = function() {
|
|
2273
|
-
return
|
|
2273
|
+
return CA(E.memory);
|
|
2274
2274
|
}, g.wbg.__wbindgen_number_get = function(Q, B) {
|
|
2275
|
-
const i =
|
|
2276
|
-
SA().setFloat64(Q + 8,
|
|
2275
|
+
const i = v(B), o = typeof i == "number" ? i : void 0;
|
|
2276
|
+
SA().setFloat64(Q + 8, q(o) ? 0 : o, !0), SA().setInt32(Q + 0, !q(o), !0);
|
|
2277
2277
|
}, g.wbg.__wbindgen_number_new = function(Q) {
|
|
2278
|
-
return
|
|
2278
|
+
return CA(Q);
|
|
2279
2279
|
}, g.wbg.__wbindgen_object_clone_ref = function(Q) {
|
|
2280
|
-
return
|
|
2280
|
+
return CA(v(Q));
|
|
2281
2281
|
}, g.wbg.__wbindgen_object_drop_ref = function(Q) {
|
|
2282
2282
|
sI(Q);
|
|
2283
2283
|
}, g.wbg.__wbindgen_throw = function(Q, B) {
|
|
@@ -2310,16 +2310,16 @@ class ug {
|
|
|
2310
2310
|
this.x = A, this.y = I;
|
|
2311
2311
|
}
|
|
2312
2312
|
}
|
|
2313
|
-
class
|
|
2313
|
+
class y {
|
|
2314
2314
|
static new(A, I) {
|
|
2315
2315
|
return new ug(A, I);
|
|
2316
2316
|
}
|
|
2317
2317
|
static zeros() {
|
|
2318
|
-
return
|
|
2318
|
+
return y.new(0, 0);
|
|
2319
2319
|
}
|
|
2320
2320
|
static fromRaw(A) {
|
|
2321
2321
|
if (!A) return null;
|
|
2322
|
-
let I =
|
|
2322
|
+
let I = y.new(A.x, A.y);
|
|
2323
2323
|
return A.free(), I;
|
|
2324
2324
|
}
|
|
2325
2325
|
static intoRaw(A) {
|
|
@@ -2329,7 +2329,7 @@ class F {
|
|
|
2329
2329
|
A.x = I.x, A.y = I.y;
|
|
2330
2330
|
}
|
|
2331
2331
|
}
|
|
2332
|
-
class
|
|
2332
|
+
class QA {
|
|
2333
2333
|
static identity() {
|
|
2334
2334
|
return 0;
|
|
2335
2335
|
}
|
|
@@ -2339,7 +2339,7 @@ class AA {
|
|
|
2339
2339
|
return A.free(), I;
|
|
2340
2340
|
}
|
|
2341
2341
|
static intoRaw(A) {
|
|
2342
|
-
return
|
|
2342
|
+
return _.fromAngle(A);
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
2345
|
var YA, RA, jI, mI, CI, vA, kA, xI, XI, aI, KI, vI, uI, SI, WA;
|
|
@@ -2391,25 +2391,25 @@ class PI {
|
|
|
2391
2391
|
}
|
|
2392
2392
|
translation() {
|
|
2393
2393
|
let A = this.rawSet.rbTranslation(this.handle);
|
|
2394
|
-
return
|
|
2394
|
+
return y.fromRaw(A);
|
|
2395
2395
|
}
|
|
2396
2396
|
rotation() {
|
|
2397
2397
|
let A = this.rawSet.rbRotation(this.handle);
|
|
2398
|
-
return
|
|
2398
|
+
return QA.fromRaw(A);
|
|
2399
2399
|
}
|
|
2400
2400
|
nextTranslation() {
|
|
2401
2401
|
let A = this.rawSet.rbNextTranslation(this.handle);
|
|
2402
|
-
return
|
|
2402
|
+
return y.fromRaw(A);
|
|
2403
2403
|
}
|
|
2404
2404
|
nextRotation() {
|
|
2405
2405
|
let A = this.rawSet.rbNextRotation(this.handle);
|
|
2406
|
-
return
|
|
2406
|
+
return QA.fromRaw(A);
|
|
2407
2407
|
}
|
|
2408
2408
|
setTranslation(A, I) {
|
|
2409
2409
|
this.rawSet.rbSetTranslation(this.handle, A.x, A.y, I);
|
|
2410
2410
|
}
|
|
2411
2411
|
setLinvel(A, I) {
|
|
2412
|
-
let C =
|
|
2412
|
+
let C = y.intoRaw(A);
|
|
2413
2413
|
this.rawSet.rbSetLinvel(this.handle, C, I), C.free();
|
|
2414
2414
|
}
|
|
2415
2415
|
gravityScale() {
|
|
@@ -2431,11 +2431,11 @@ class PI {
|
|
|
2431
2431
|
this.rawSet.rbSetNextKinematicRotation(this.handle, A);
|
|
2432
2432
|
}
|
|
2433
2433
|
linvel() {
|
|
2434
|
-
return
|
|
2434
|
+
return y.fromRaw(this.rawSet.rbLinvel(this.handle));
|
|
2435
2435
|
}
|
|
2436
2436
|
velocityAtPoint(A) {
|
|
2437
|
-
const I =
|
|
2438
|
-
let C =
|
|
2437
|
+
const I = y.intoRaw(A);
|
|
2438
|
+
let C = y.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
|
|
2439
2439
|
return I.free(), C;
|
|
2440
2440
|
}
|
|
2441
2441
|
angvel() {
|
|
@@ -2445,16 +2445,16 @@ class PI {
|
|
|
2445
2445
|
return this.rawSet.rbMass(this.handle);
|
|
2446
2446
|
}
|
|
2447
2447
|
effectiveInvMass() {
|
|
2448
|
-
return
|
|
2448
|
+
return y.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
|
|
2449
2449
|
}
|
|
2450
2450
|
invMass() {
|
|
2451
2451
|
return this.rawSet.rbInvMass(this.handle);
|
|
2452
2452
|
}
|
|
2453
2453
|
localCom() {
|
|
2454
|
-
return
|
|
2454
|
+
return y.fromRaw(this.rawSet.rbLocalCom(this.handle));
|
|
2455
2455
|
}
|
|
2456
2456
|
worldCom() {
|
|
2457
|
-
return
|
|
2457
|
+
return y.fromRaw(this.rawSet.rbWorldCom(this.handle));
|
|
2458
2458
|
}
|
|
2459
2459
|
invPrincipalInertia() {
|
|
2460
2460
|
return this.rawSet.rbInvPrincipalInertia(this.handle);
|
|
@@ -2526,7 +2526,7 @@ class PI {
|
|
|
2526
2526
|
this.rawSet.rbSetAdditionalMass(this.handle, A, I);
|
|
2527
2527
|
}
|
|
2528
2528
|
setAdditionalMassProperties(A, I, C, g) {
|
|
2529
|
-
let Q =
|
|
2529
|
+
let Q = y.intoRaw(I);
|
|
2530
2530
|
this.rawSet.rbSetAdditionalMassProperties(this.handle, A, Q, C, g), Q.free();
|
|
2531
2531
|
}
|
|
2532
2532
|
setAngularDamping(A) {
|
|
@@ -2539,11 +2539,11 @@ class PI {
|
|
|
2539
2539
|
this.rawSet.rbResetTorques(this.handle, A);
|
|
2540
2540
|
}
|
|
2541
2541
|
addForce(A, I) {
|
|
2542
|
-
const C =
|
|
2542
|
+
const C = y.intoRaw(A);
|
|
2543
2543
|
this.rawSet.rbAddForce(this.handle, C, I), C.free();
|
|
2544
2544
|
}
|
|
2545
2545
|
applyImpulse(A, I) {
|
|
2546
|
-
const C =
|
|
2546
|
+
const C = y.intoRaw(A);
|
|
2547
2547
|
this.rawSet.rbApplyImpulse(this.handle, C, I), C.free();
|
|
2548
2548
|
}
|
|
2549
2549
|
addTorque(A, I) {
|
|
@@ -2553,15 +2553,15 @@ class PI {
|
|
|
2553
2553
|
this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
|
|
2554
2554
|
}
|
|
2555
2555
|
addForceAtPoint(A, I, C) {
|
|
2556
|
-
const g =
|
|
2556
|
+
const g = y.intoRaw(A), Q = y.intoRaw(I);
|
|
2557
2557
|
this.rawSet.rbAddForceAtPoint(this.handle, g, Q, C), g.free(), Q.free();
|
|
2558
2558
|
}
|
|
2559
2559
|
applyImpulseAtPoint(A, I, C) {
|
|
2560
|
-
const g =
|
|
2560
|
+
const g = y.intoRaw(A), Q = y.intoRaw(I);
|
|
2561
2561
|
this.rawSet.rbApplyImpulseAtPoint(this.handle, g, Q, C), g.free(), Q.free();
|
|
2562
2562
|
}
|
|
2563
2563
|
userForce() {
|
|
2564
|
-
return
|
|
2564
|
+
return y.fromRaw(this.rawSet.rbUserForce(this.handle));
|
|
2565
2565
|
}
|
|
2566
2566
|
userTorque() {
|
|
2567
2567
|
return this.rawSet.rbUserTorque(this.handle);
|
|
@@ -2569,7 +2569,7 @@ class PI {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
class rA {
|
|
2571
2571
|
constructor(A) {
|
|
2572
|
-
this.enabled = !0, this.status = A, this.translation =
|
|
2572
|
+
this.enabled = !0, this.status = A, this.translation = y.zeros(), this.rotation = QA.identity(), this.gravityScale = 1, this.linvel = y.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = y.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
|
|
2573
2573
|
}
|
|
2574
2574
|
static dynamic() {
|
|
2575
2575
|
return new rA(YA.Dynamic);
|
|
@@ -2625,7 +2625,7 @@ class rA {
|
|
|
2625
2625
|
return this.angvel = A, this;
|
|
2626
2626
|
}
|
|
2627
2627
|
setAdditionalMassProperties(A, I, C) {
|
|
2628
|
-
return this.mass = A,
|
|
2628
|
+
return this.mass = A, y.copy(this.centerOfMass, I), this.principalAngularInertia = C, this.massOnly = !1, this;
|
|
2629
2629
|
}
|
|
2630
2630
|
enabledTranslations(A, I) {
|
|
2631
2631
|
return this.translationsEnabledX = A, this.translationsEnabledY = I, this;
|
|
@@ -2707,7 +2707,7 @@ class Pg {
|
|
|
2707
2707
|
this.map.forEach((I) => I.finalizeDeserialization(A));
|
|
2708
2708
|
}
|
|
2709
2709
|
createRigidBody(A, I) {
|
|
2710
|
-
let C =
|
|
2710
|
+
let C = y.intoRaw(I.translation), g = QA.intoRaw(I.rotation), Q = y.intoRaw(I.linvel), B = y.intoRaw(I.centerOfMass), i = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
|
|
2711
2711
|
C.free(), g.free(), Q.free(), B.free();
|
|
2712
2712
|
const o = new PI(this.raw, A, i);
|
|
2713
2713
|
return o.userData = I.userData, this.map.set(i, o), o;
|
|
@@ -2842,17 +2842,17 @@ class pA {
|
|
|
2842
2842
|
return this.rawSet.jointType(this.handle);
|
|
2843
2843
|
}
|
|
2844
2844
|
anchor1() {
|
|
2845
|
-
return
|
|
2845
|
+
return y.fromRaw(this.rawSet.jointAnchor1(this.handle));
|
|
2846
2846
|
}
|
|
2847
2847
|
anchor2() {
|
|
2848
|
-
return
|
|
2848
|
+
return y.fromRaw(this.rawSet.jointAnchor2(this.handle));
|
|
2849
2849
|
}
|
|
2850
2850
|
setAnchor1(A) {
|
|
2851
|
-
const I =
|
|
2851
|
+
const I = y.intoRaw(A);
|
|
2852
2852
|
this.rawSet.jointSetAnchor1(this.handle, I), I.free();
|
|
2853
2853
|
}
|
|
2854
2854
|
setAnchor2(A) {
|
|
2855
|
-
const I =
|
|
2855
|
+
const I = y.intoRaw(A);
|
|
2856
2856
|
this.rawSet.jointSetAnchor2(this.handle, I), I.free();
|
|
2857
2857
|
}
|
|
2858
2858
|
setContactsEnabled(A) {
|
|
@@ -2928,10 +2928,10 @@ class OA {
|
|
|
2928
2928
|
return g.anchor1 = A, g.anchor2 = I, g.axis = C, g.jointType = RA.Prismatic, g;
|
|
2929
2929
|
}
|
|
2930
2930
|
intoRaw() {
|
|
2931
|
-
let A, I, C =
|
|
2931
|
+
let A, I, C = y.intoRaw(this.anchor1), g = y.intoRaw(this.anchor2), Q = !1, B = 0, i = 0;
|
|
2932
2932
|
switch (this.jointType) {
|
|
2933
2933
|
case RA.Fixed:
|
|
2934
|
-
let o =
|
|
2934
|
+
let o = QA.intoRaw(this.frame1), h = QA.intoRaw(this.frame2);
|
|
2935
2935
|
I = MA.fixed(C, o, g, h), o.free(), h.free();
|
|
2936
2936
|
break;
|
|
2937
2937
|
case RA.Spring:
|
|
@@ -2941,7 +2941,7 @@ class OA {
|
|
|
2941
2941
|
I = MA.rope(this.length, C, g);
|
|
2942
2942
|
break;
|
|
2943
2943
|
case RA.Prismatic:
|
|
2944
|
-
A =
|
|
2944
|
+
A = y.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], i = this.limits[1]), I = MA.prismatic(C, g, A, Q, B, i), A.free();
|
|
2945
2945
|
break;
|
|
2946
2946
|
case RA.Revolute:
|
|
2947
2947
|
I = MA.revolute(C, g);
|
|
@@ -3111,7 +3111,7 @@ class EI {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
static fromRaw(A) {
|
|
3113
3113
|
if (!A) return null;
|
|
3114
|
-
const I = new EI(A.time_of_impact(),
|
|
3114
|
+
const I = new EI(A.time_of_impact(), y.fromRaw(A.normal()), A.featureType(), A.featureId());
|
|
3115
3115
|
return A.free(), I;
|
|
3116
3116
|
}
|
|
3117
3117
|
}
|
|
@@ -3121,7 +3121,7 @@ class QI {
|
|
|
3121
3121
|
}
|
|
3122
3122
|
static fromRaw(A, I) {
|
|
3123
3123
|
if (!I) return null;
|
|
3124
|
-
const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3124
|
+
const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(), y.fromRaw(I.normal()), I.featureType(), I.featureId());
|
|
3125
3125
|
return I.free(), C;
|
|
3126
3126
|
}
|
|
3127
3127
|
}
|
|
@@ -3141,7 +3141,7 @@ class iI {
|
|
|
3141
3141
|
}
|
|
3142
3142
|
static fromRaw(A) {
|
|
3143
3143
|
if (!A) return null;
|
|
3144
|
-
const I = new iI(
|
|
3144
|
+
const I = new iI(y.fromRaw(A.point()), A.isInside());
|
|
3145
3145
|
return A.free(), I;
|
|
3146
3146
|
}
|
|
3147
3147
|
}
|
|
@@ -3151,7 +3151,7 @@ class BI {
|
|
|
3151
3151
|
}
|
|
3152
3152
|
static fromRaw(A, I) {
|
|
3153
3153
|
if (!I) return null;
|
|
3154
|
-
const C = new BI(A.get(I.colliderHandle()),
|
|
3154
|
+
const C = new BI(A.get(I.colliderHandle()), y.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
|
|
3155
3155
|
return I.free(), C;
|
|
3156
3156
|
}
|
|
3157
3157
|
}
|
|
@@ -3161,7 +3161,7 @@ class PA {
|
|
|
3161
3161
|
}
|
|
3162
3162
|
static fromRaw(A, I) {
|
|
3163
3163
|
if (!I) return null;
|
|
3164
|
-
const C = new PA(I.time_of_impact(),
|
|
3164
|
+
const C = new PA(I.time_of_impact(), y.fromRaw(I.witness1()), y.fromRaw(I.witness2()), y.fromRaw(I.normal1()), y.fromRaw(I.normal2()));
|
|
3165
3165
|
return I.free(), C;
|
|
3166
3166
|
}
|
|
3167
3167
|
}
|
|
@@ -3171,7 +3171,7 @@ class DI extends PA {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
static fromRaw(A, I) {
|
|
3173
3173
|
if (!I) return null;
|
|
3174
|
-
const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(),
|
|
3174
|
+
const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(), y.fromRaw(I.witness1()), y.fromRaw(I.witness2()), y.fromRaw(I.normal1()), y.fromRaw(I.normal2()));
|
|
3175
3175
|
return I.free(), C;
|
|
3176
3176
|
}
|
|
3177
3177
|
}
|
|
@@ -3183,43 +3183,43 @@ class oC {
|
|
|
3183
3183
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3184
3184
|
}
|
|
3185
3185
|
castRay(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
3186
|
-
let w =
|
|
3186
|
+
let w = y.intoRaw(g.origin), a = y.intoRaw(g.dir), N = cI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
|
|
3187
3187
|
return w.free(), a.free(), N;
|
|
3188
3188
|
}
|
|
3189
3189
|
castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
3190
|
-
let w =
|
|
3190
|
+
let w = y.intoRaw(g.origin), a = y.intoRaw(g.dir), N = QI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
|
|
3191
3191
|
return w.free(), a.free(), N;
|
|
3192
3192
|
}
|
|
3193
3193
|
intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
3194
|
-
let a =
|
|
3194
|
+
let a = y.intoRaw(g.origin), N = y.intoRaw(g.dir);
|
|
3195
3195
|
this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, N, Q, B, (S) => i(QI.fromRaw(C, S)), o, h, s, G, w), a.free(), N.free();
|
|
3196
3196
|
}
|
|
3197
3197
|
intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
|
|
3198
|
-
let w =
|
|
3198
|
+
let w = y.intoRaw(g), a = QA.intoRaw(Q), N = B.intoRaw(), S = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, w, a, N, i, o, h, s, G);
|
|
3199
3199
|
return w.free(), a.free(), N.free(), S;
|
|
3200
3200
|
}
|
|
3201
3201
|
projectPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
3202
|
-
let G =
|
|
3202
|
+
let G = y.intoRaw(g), w = BI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s));
|
|
3203
3203
|
return G.free(), w;
|
|
3204
3204
|
}
|
|
3205
3205
|
projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
|
|
3206
|
-
let s =
|
|
3206
|
+
let s = y.intoRaw(g), G = BI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, s, Q, B, i, o, h));
|
|
3207
3207
|
return s.free(), G;
|
|
3208
3208
|
}
|
|
3209
3209
|
intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
|
|
3210
|
-
let G =
|
|
3210
|
+
let G = y.intoRaw(g);
|
|
3211
3211
|
this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s), G.free();
|
|
3212
3212
|
}
|
|
3213
3213
|
castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
|
|
3214
|
-
let k =
|
|
3215
|
-
return k.free(),
|
|
3214
|
+
let k = y.intoRaw(g), F = QA.intoRaw(Q), U = y.intoRaw(B), c = i.intoRaw(), Y = DI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, k, F, U, c, o, h, s, G, w, a, N, S));
|
|
3215
|
+
return k.free(), F.free(), U.free(), c.free(), Y;
|
|
3216
3216
|
}
|
|
3217
3217
|
intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
3218
|
-
let a =
|
|
3218
|
+
let a = y.intoRaw(g), N = QA.intoRaw(Q), S = B.intoRaw();
|
|
3219
3219
|
this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, N, S, i, o, h, s, G, w), a.free(), N.free(), S.free();
|
|
3220
3220
|
}
|
|
3221
3221
|
collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
|
|
3222
|
-
let i =
|
|
3222
|
+
let i = y.intoRaw(g), o = y.intoRaw(Q);
|
|
3223
3223
|
this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, i, o, B), i.free(), o.free();
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
@@ -3257,13 +3257,13 @@ class hC {
|
|
|
3257
3257
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3258
3258
|
}
|
|
3259
3259
|
normal() {
|
|
3260
|
-
return
|
|
3260
|
+
return y.fromRaw(this.raw.normal());
|
|
3261
3261
|
}
|
|
3262
3262
|
localNormal1() {
|
|
3263
|
-
return
|
|
3263
|
+
return y.fromRaw(this.raw.local_n1());
|
|
3264
3264
|
}
|
|
3265
3265
|
localNormal2() {
|
|
3266
|
-
return
|
|
3266
|
+
return y.fromRaw(this.raw.local_n2());
|
|
3267
3267
|
}
|
|
3268
3268
|
subshape1() {
|
|
3269
3269
|
return this.raw.subshape1();
|
|
@@ -3275,10 +3275,10 @@ class hC {
|
|
|
3275
3275
|
return this.raw.num_contacts();
|
|
3276
3276
|
}
|
|
3277
3277
|
localContactPoint1(A) {
|
|
3278
|
-
return
|
|
3278
|
+
return y.fromRaw(this.raw.contact_local_p1(A));
|
|
3279
3279
|
}
|
|
3280
3280
|
localContactPoint2(A) {
|
|
3281
|
-
return
|
|
3281
|
+
return y.fromRaw(this.raw.contact_local_p2(A));
|
|
3282
3282
|
}
|
|
3283
3283
|
contactDist(A) {
|
|
3284
3284
|
return this.raw.contact_dist(A);
|
|
@@ -3299,7 +3299,7 @@ class hC {
|
|
|
3299
3299
|
return this.raw.num_solver_contacts();
|
|
3300
3300
|
}
|
|
3301
3301
|
solverContactPoint(A) {
|
|
3302
|
-
return
|
|
3302
|
+
return y.fromRaw(this.raw.solver_contact_point(A));
|
|
3303
3303
|
}
|
|
3304
3304
|
solverContactDist(A) {
|
|
3305
3305
|
return this.raw.solver_contact_dist(A);
|
|
@@ -3311,7 +3311,7 @@ class hC {
|
|
|
3311
3311
|
return this.raw.solver_contact_restitution(A);
|
|
3312
3312
|
}
|
|
3313
3313
|
solverContactTangentVelocity(A) {
|
|
3314
|
-
return
|
|
3314
|
+
return y.fromRaw(this.raw.solver_contact_tangent_velocity(A));
|
|
3315
3315
|
}
|
|
3316
3316
|
}
|
|
3317
3317
|
class uA {
|
|
@@ -3320,7 +3320,7 @@ class uA {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
static fromRaw(A) {
|
|
3322
3322
|
if (!A) return null;
|
|
3323
|
-
const I = new uA(A.distance(),
|
|
3323
|
+
const I = new uA(A.distance(), y.fromRaw(A.point1()), y.fromRaw(A.point2()), y.fromRaw(A.normal1()), y.fromRaw(A.normal2()));
|
|
3324
3324
|
return A.free(), I;
|
|
3325
3325
|
}
|
|
3326
3326
|
}
|
|
@@ -3338,15 +3338,15 @@ class yA {
|
|
|
3338
3338
|
case FA.Capsule:
|
|
3339
3339
|
return o = A.coHalfHeight(I), h = A.coRadius(I), new og(o, h);
|
|
3340
3340
|
case FA.Segment:
|
|
3341
|
-
return B = A.coVertices(I), new wg(
|
|
3341
|
+
return B = A.coVertices(I), new wg(y.new(B[0], B[1]), y.new(B[2], B[3]));
|
|
3342
3342
|
case FA.Polyline:
|
|
3343
3343
|
return B = A.coVertices(I), i = A.coIndices(I), new Gg(B, i);
|
|
3344
3344
|
case FA.Triangle:
|
|
3345
|
-
return B = A.coVertices(I), new hg(
|
|
3345
|
+
return B = A.coVertices(I), new hg(y.new(B[0], B[1]), y.new(B[2], B[3]), y.new(B[4], B[5]));
|
|
3346
3346
|
case FA.RoundTriangle:
|
|
3347
|
-
return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(
|
|
3347
|
+
return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(y.new(B[0], B[1]), y.new(B[2], B[3]), y.new(B[4], B[5]), Q);
|
|
3348
3348
|
case FA.HalfSpace:
|
|
3349
|
-
return s =
|
|
3349
|
+
return s = y.fromRaw(A.coHalfspaceNormal(I)), new Eg(s);
|
|
3350
3350
|
case FA.Voxels:
|
|
3351
3351
|
const G = A.coVoxelData(I), w = A.coVoxelSize(I);
|
|
3352
3352
|
return new ag(G, w);
|
|
@@ -3366,35 +3366,35 @@ class yA {
|
|
|
3366
3366
|
}
|
|
3367
3367
|
}
|
|
3368
3368
|
castShape(A, I, C, g, Q, B, i, o, h, s) {
|
|
3369
|
-
let G =
|
|
3370
|
-
return G.free(), w.free(), a.free(), N.free(), S.free(), k.free(),
|
|
3369
|
+
let G = y.intoRaw(A), w = QA.intoRaw(I), a = y.intoRaw(C), N = y.intoRaw(Q), S = QA.intoRaw(B), k = y.intoRaw(i), F = this.intoRaw(), U = g.intoRaw(), c = PA.fromRaw(null, F.castShape(G, w, a, U, N, S, k, o, h, s));
|
|
3370
|
+
return G.free(), w.free(), a.free(), N.free(), S.free(), k.free(), F.free(), U.free(), c;
|
|
3371
3371
|
}
|
|
3372
3372
|
intersectsShape(A, I, C, g, Q) {
|
|
3373
|
-
let B =
|
|
3373
|
+
let B = y.intoRaw(A), i = QA.intoRaw(I), o = y.intoRaw(g), h = QA.intoRaw(Q), s = this.intoRaw(), G = C.intoRaw(), w = s.intersectsShape(B, i, G, o, h);
|
|
3374
3374
|
return B.free(), i.free(), o.free(), h.free(), s.free(), G.free(), w;
|
|
3375
3375
|
}
|
|
3376
3376
|
contactShape(A, I, C, g, Q, B) {
|
|
3377
|
-
let i =
|
|
3377
|
+
let i = y.intoRaw(A), o = QA.intoRaw(I), h = y.intoRaw(g), s = QA.intoRaw(Q), G = this.intoRaw(), w = C.intoRaw(), a = uA.fromRaw(G.contactShape(i, o, w, h, s, B));
|
|
3378
3378
|
return i.free(), o.free(), h.free(), s.free(), G.free(), w.free(), a;
|
|
3379
3379
|
}
|
|
3380
3380
|
containsPoint(A, I, C) {
|
|
3381
|
-
let g =
|
|
3381
|
+
let g = y.intoRaw(A), Q = QA.intoRaw(I), B = y.intoRaw(C), i = this.intoRaw(), o = i.containsPoint(g, Q, B);
|
|
3382
3382
|
return g.free(), Q.free(), B.free(), i.free(), o;
|
|
3383
3383
|
}
|
|
3384
3384
|
projectPoint(A, I, C, g) {
|
|
3385
|
-
let Q =
|
|
3385
|
+
let Q = y.intoRaw(A), B = QA.intoRaw(I), i = y.intoRaw(C), o = this.intoRaw(), h = iI.fromRaw(o.projectPoint(Q, B, i, g));
|
|
3386
3386
|
return Q.free(), B.free(), i.free(), o.free(), h;
|
|
3387
3387
|
}
|
|
3388
3388
|
intersectsRay(A, I, C, g) {
|
|
3389
|
-
let Q =
|
|
3389
|
+
let Q = y.intoRaw(I), B = QA.intoRaw(C), i = y.intoRaw(A.origin), o = y.intoRaw(A.dir), h = this.intoRaw(), s = h.intersectsRay(Q, B, i, o, g);
|
|
3390
3390
|
return Q.free(), B.free(), i.free(), o.free(), h.free(), s;
|
|
3391
3391
|
}
|
|
3392
3392
|
castRay(A, I, C, g, Q) {
|
|
3393
|
-
let B =
|
|
3393
|
+
let B = y.intoRaw(I), i = QA.intoRaw(C), o = y.intoRaw(A.origin), h = y.intoRaw(A.dir), s = this.intoRaw(), G = s.castRay(B, i, o, h, g, Q);
|
|
3394
3394
|
return B.free(), i.free(), o.free(), h.free(), s.free(), G;
|
|
3395
3395
|
}
|
|
3396
3396
|
castRayAndGetNormal(A, I, C, g, Q) {
|
|
3397
|
-
let B =
|
|
3397
|
+
let B = y.intoRaw(I), i = QA.intoRaw(C), o = y.intoRaw(A.origin), h = y.intoRaw(A.dir), s = this.intoRaw(), G = EI.fromRaw(s.castRayAndGetNormal(B, i, o, h, g, Q));
|
|
3398
3398
|
return B.free(), i.free(), o.free(), h.free(), s.free(), G;
|
|
3399
3399
|
}
|
|
3400
3400
|
}
|
|
@@ -3408,7 +3408,7 @@ class Bg extends yA {
|
|
|
3408
3408
|
super(), this.type = kA.Ball, this.radius = A;
|
|
3409
3409
|
}
|
|
3410
3410
|
intoRaw() {
|
|
3411
|
-
return
|
|
3411
|
+
return d.ball(this.radius);
|
|
3412
3412
|
}
|
|
3413
3413
|
}
|
|
3414
3414
|
class Eg extends yA {
|
|
@@ -3416,24 +3416,24 @@ class Eg extends yA {
|
|
|
3416
3416
|
super(), this.type = kA.HalfSpace, this.normal = A;
|
|
3417
3417
|
}
|
|
3418
3418
|
intoRaw() {
|
|
3419
|
-
let A =
|
|
3419
|
+
let A = y.intoRaw(this.normal), I = d.halfspace(A);
|
|
3420
3420
|
return A.free(), I;
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
3423
3423
|
class ig extends yA {
|
|
3424
3424
|
constructor(A, I) {
|
|
3425
|
-
super(), this.type = kA.Cuboid, this.halfExtents =
|
|
3425
|
+
super(), this.type = kA.Cuboid, this.halfExtents = y.new(A, I);
|
|
3426
3426
|
}
|
|
3427
3427
|
intoRaw() {
|
|
3428
|
-
return
|
|
3428
|
+
return d.cuboid(this.halfExtents.x, this.halfExtents.y);
|
|
3429
3429
|
}
|
|
3430
3430
|
}
|
|
3431
3431
|
class Dg extends yA {
|
|
3432
3432
|
constructor(A, I, C) {
|
|
3433
|
-
super(), this.type = kA.RoundCuboid, this.halfExtents =
|
|
3433
|
+
super(), this.type = kA.RoundCuboid, this.halfExtents = y.new(A, I), this.borderRadius = C;
|
|
3434
3434
|
}
|
|
3435
3435
|
intoRaw() {
|
|
3436
|
-
return
|
|
3436
|
+
return d.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
|
|
3437
3437
|
}
|
|
3438
3438
|
}
|
|
3439
3439
|
class og extends yA {
|
|
@@ -3441,7 +3441,7 @@ class og extends yA {
|
|
|
3441
3441
|
super(), this.type = kA.Capsule, this.halfHeight = A, this.radius = I;
|
|
3442
3442
|
}
|
|
3443
3443
|
intoRaw() {
|
|
3444
|
-
return
|
|
3444
|
+
return d.capsule(this.halfHeight, this.radius);
|
|
3445
3445
|
}
|
|
3446
3446
|
}
|
|
3447
3447
|
class wg extends yA {
|
|
@@ -3449,7 +3449,7 @@ class wg extends yA {
|
|
|
3449
3449
|
super(), this.type = kA.Segment, this.a = A, this.b = I;
|
|
3450
3450
|
}
|
|
3451
3451
|
intoRaw() {
|
|
3452
|
-
let A =
|
|
3452
|
+
let A = y.intoRaw(this.a), I = y.intoRaw(this.b), C = d.segment(A, I);
|
|
3453
3453
|
return A.free(), I.free(), C;
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
@@ -3458,7 +3458,7 @@ class hg extends yA {
|
|
|
3458
3458
|
super(), this.type = kA.Triangle, this.a = A, this.b = I, this.c = C;
|
|
3459
3459
|
}
|
|
3460
3460
|
intoRaw() {
|
|
3461
|
-
let A =
|
|
3461
|
+
let A = y.intoRaw(this.a), I = y.intoRaw(this.b), C = y.intoRaw(this.c), g = d.triangle(A, I, C);
|
|
3462
3462
|
return A.free(), I.free(), C.free(), g;
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
@@ -3467,7 +3467,7 @@ class sg extends yA {
|
|
|
3467
3467
|
super(), this.type = kA.RoundTriangle, this.a = A, this.b = I, this.c = C, this.borderRadius = g;
|
|
3468
3468
|
}
|
|
3469
3469
|
intoRaw() {
|
|
3470
|
-
let A =
|
|
3470
|
+
let A = y.intoRaw(this.a), I = y.intoRaw(this.b), C = y.intoRaw(this.c), g = d.roundTriangle(A, I, C, this.borderRadius);
|
|
3471
3471
|
return A.free(), I.free(), C.free(), g;
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
@@ -3476,7 +3476,7 @@ class Gg extends yA {
|
|
|
3476
3476
|
super(), this.type = kA.Polyline, this.vertices = A, this.indices = I ?? new Uint32Array(0);
|
|
3477
3477
|
}
|
|
3478
3478
|
intoRaw() {
|
|
3479
|
-
return
|
|
3479
|
+
return d.polyline(this.vertices, this.indices);
|
|
3480
3480
|
}
|
|
3481
3481
|
}
|
|
3482
3482
|
class ag extends yA {
|
|
@@ -3484,8 +3484,8 @@ class ag extends yA {
|
|
|
3484
3484
|
super(), this.type = kA.Voxels, this.data = A, this.voxelSize = I;
|
|
3485
3485
|
}
|
|
3486
3486
|
intoRaw() {
|
|
3487
|
-
let A, I =
|
|
3488
|
-
return A = this.data instanceof Int32Array ?
|
|
3487
|
+
let A, I = y.intoRaw(this.voxelSize);
|
|
3488
|
+
return A = this.data instanceof Int32Array ? d.voxels(I, this.data) : d.voxelsFromPoints(I, this.data), I.free(), A;
|
|
3489
3489
|
}
|
|
3490
3490
|
}
|
|
3491
3491
|
class Kg extends yA {
|
|
@@ -3493,7 +3493,7 @@ class Kg extends yA {
|
|
|
3493
3493
|
super(), this.type = kA.TriMesh, this.vertices = A, this.indices = I, this.flags = C;
|
|
3494
3494
|
}
|
|
3495
3495
|
intoRaw() {
|
|
3496
|
-
return
|
|
3496
|
+
return d.trimesh(this.vertices, this.indices, this.flags);
|
|
3497
3497
|
}
|
|
3498
3498
|
}
|
|
3499
3499
|
class NI extends yA {
|
|
@@ -3501,7 +3501,7 @@ class NI extends yA {
|
|
|
3501
3501
|
super(), this.type = kA.ConvexPolygon, this.vertices = A, this.skipConvexHullComputation = !!I;
|
|
3502
3502
|
}
|
|
3503
3503
|
intoRaw() {
|
|
3504
|
-
return this.skipConvexHullComputation ?
|
|
3504
|
+
return this.skipConvexHullComputation ? d.convexPolyline(this.vertices) : d.convexHull(this.vertices);
|
|
3505
3505
|
}
|
|
3506
3506
|
}
|
|
3507
3507
|
class kI extends yA {
|
|
@@ -3509,7 +3509,7 @@ class kI extends yA {
|
|
|
3509
3509
|
super(), this.type = kA.RoundConvexPolygon, this.vertices = A, this.borderRadius = I, this.skipConvexHullComputation = !!C;
|
|
3510
3510
|
}
|
|
3511
3511
|
intoRaw() {
|
|
3512
|
-
return this.skipConvexHullComputation ?
|
|
3512
|
+
return this.skipConvexHullComputation ? d.roundConvexPolyline(this.vertices, this.borderRadius) : d.roundConvexHull(this.vertices, this.borderRadius);
|
|
3513
3513
|
}
|
|
3514
3514
|
}
|
|
3515
3515
|
class Sg extends yA {
|
|
@@ -3517,7 +3517,7 @@ class Sg extends yA {
|
|
|
3517
3517
|
super(), this.type = kA.HeightField, this.heights = A, this.scale = I;
|
|
3518
3518
|
}
|
|
3519
3519
|
intoRaw() {
|
|
3520
|
-
let A =
|
|
3520
|
+
let A = y.intoRaw(this.scale), I = d.heightfield(this.heights, A);
|
|
3521
3521
|
return A.free(), I;
|
|
3522
3522
|
}
|
|
3523
3523
|
}
|
|
@@ -3529,7 +3529,7 @@ class sC {
|
|
|
3529
3529
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3530
3530
|
}
|
|
3531
3531
|
step(A, I, C, g, Q, B, i, o, h, s, G, w) {
|
|
3532
|
-
let a =
|
|
3532
|
+
let a = y.intoRaw(A);
|
|
3533
3533
|
G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw, G.raw, w, w ? w.filterContactPair : null, w ? w.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw), a.free();
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
@@ -3541,7 +3541,7 @@ class VI {
|
|
|
3541
3541
|
this.raw && this.raw.free(), this.raw = void 0;
|
|
3542
3542
|
}
|
|
3543
3543
|
serializeAll(A, I, C, g, Q, B, i, o, h) {
|
|
3544
|
-
let s =
|
|
3544
|
+
let s = y.intoRaw(A);
|
|
3545
3545
|
const G = this.raw.serializeAll(s, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw);
|
|
3546
3546
|
return s.free(), G;
|
|
3547
3547
|
}
|
|
@@ -3578,7 +3578,7 @@ class SC {
|
|
|
3578
3578
|
return this.raw.up();
|
|
3579
3579
|
}
|
|
3580
3580
|
setUp(A) {
|
|
3581
|
-
let I =
|
|
3581
|
+
let I = y.intoRaw(A);
|
|
3582
3582
|
return this.raw.setUp(I);
|
|
3583
3583
|
}
|
|
3584
3584
|
applyImpulsesToDynamicBodies() {
|
|
@@ -3654,11 +3654,11 @@ class SC {
|
|
|
3654
3654
|
return this.raw.snapToGroundEnabled();
|
|
3655
3655
|
}
|
|
3656
3656
|
computeColliderMovement(A, I, C, g, Q) {
|
|
3657
|
-
let B =
|
|
3657
|
+
let B = y.intoRaw(I);
|
|
3658
3658
|
this.raw.computeColliderMovement(this.params.dt, this.broadPhase.raw, this.narrowPhase.raw, this.bodies.raw, this.colliders.raw, A.handle, B, this._applyImpulsesToDynamicBodies, this._characterMass, C, g, this.colliders.castClosure(Q)), B.free();
|
|
3659
3659
|
}
|
|
3660
3660
|
computedMovement() {
|
|
3661
|
-
return
|
|
3661
|
+
return y.fromRaw(this.raw.computedMovement());
|
|
3662
3662
|
}
|
|
3663
3663
|
computedGrounded() {
|
|
3664
3664
|
return this.raw.computedGrounded();
|
|
@@ -3669,7 +3669,7 @@ class SC {
|
|
|
3669
3669
|
computedCollision(A, I) {
|
|
3670
3670
|
if (this.raw.computedCollision(A, this.rawCharacterCollision)) {
|
|
3671
3671
|
let C = this.rawCharacterCollision;
|
|
3672
|
-
return (I = I ?? new KC()).translationDeltaApplied =
|
|
3672
|
+
return (I = I ?? new KC()).translationDeltaApplied = y.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = y.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = y.fromRaw(C.worldWitness1()), I.witness2 = y.fromRaw(C.worldWitness2()), I.normal1 = y.fromRaw(C.worldNormal1()), I.normal2 = y.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
|
|
3673
3673
|
}
|
|
3674
3674
|
return null;
|
|
3675
3675
|
}
|
|
@@ -3700,15 +3700,15 @@ class NC {
|
|
|
3700
3700
|
this.raw.reset_integrals();
|
|
3701
3701
|
}
|
|
3702
3702
|
applyLinearCorrection(A, I, C) {
|
|
3703
|
-
let g =
|
|
3703
|
+
let g = y.intoRaw(I), Q = y.intoRaw(C);
|
|
3704
3704
|
this.raw.apply_linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q), g.free(), Q.free();
|
|
3705
3705
|
}
|
|
3706
3706
|
applyAngularCorrection(A, I, C) {
|
|
3707
3707
|
this.raw.apply_angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
|
|
3708
3708
|
}
|
|
3709
3709
|
linearCorrection(A, I, C) {
|
|
3710
|
-
let g =
|
|
3711
|
-
return g.free(), Q.free(),
|
|
3710
|
+
let g = y.intoRaw(I), Q = y.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
|
|
3711
|
+
return g.free(), Q.free(), y.fromRaw(B);
|
|
3712
3712
|
}
|
|
3713
3713
|
angularCorrection(A, I, C) {
|
|
3714
3714
|
return this.raw.angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
|
|
@@ -3722,7 +3722,7 @@ class YI {
|
|
|
3722
3722
|
this.integrationParameters.free(), this.islands.free(), this.broadPhase.free(), this.narrowPhase.free(), this.bodies.free(), this.colliders.free(), this.impulseJoints.free(), this.multibodyJoints.free(), this.ccdSolver.free(), this.physicsPipeline.free(), this.serializationPipeline.free(), this.debugRenderPipeline.free(), this.characterControllers.forEach((A) => A.free()), this.pidControllers.forEach((A) => A.free()), this.integrationParameters = void 0, this.islands = void 0, this.broadPhase = void 0, this.narrowPhase = void 0, this.bodies = void 0, this.colliders = void 0, this.ccdSolver = void 0, this.impulseJoints = void 0, this.multibodyJoints = void 0, this.physicsPipeline = void 0, this.serializationPipeline = void 0, this.debugRenderPipeline = void 0, this.characterControllers = void 0, this.pidControllers = void 0;
|
|
3723
3723
|
}
|
|
3724
3724
|
static fromRaw(A) {
|
|
3725
|
-
return A ? new YI(
|
|
3725
|
+
return A ? new YI(y.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
|
|
3726
3726
|
}
|
|
3727
3727
|
takeSnapshot() {
|
|
3728
3728
|
return this.serializationPipeline.serializeAll(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints);
|
|
@@ -3941,13 +3941,13 @@ class kC {
|
|
|
3941
3941
|
return this.raw.collider2();
|
|
3942
3942
|
}
|
|
3943
3943
|
totalForce() {
|
|
3944
|
-
return
|
|
3944
|
+
return y.fromRaw(this.raw.total_force());
|
|
3945
3945
|
}
|
|
3946
3946
|
totalForceMagnitude() {
|
|
3947
3947
|
return this.raw.total_force_magnitude();
|
|
3948
3948
|
}
|
|
3949
3949
|
maxForceDirection() {
|
|
3950
|
-
return
|
|
3950
|
+
return y.fromRaw(this.raw.max_force_direction());
|
|
3951
3951
|
}
|
|
3952
3952
|
maxForceMagnitude() {
|
|
3953
3953
|
return this.raw.max_force_magnitude();
|
|
@@ -4002,16 +4002,16 @@ class zI {
|
|
|
4002
4002
|
return this.colliderSet.raw.contains(this.handle);
|
|
4003
4003
|
}
|
|
4004
4004
|
translation() {
|
|
4005
|
-
return
|
|
4005
|
+
return y.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
|
|
4006
4006
|
}
|
|
4007
4007
|
translationWrtParent() {
|
|
4008
|
-
return
|
|
4008
|
+
return y.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
|
|
4009
4009
|
}
|
|
4010
4010
|
rotation() {
|
|
4011
|
-
return
|
|
4011
|
+
return QA.fromRaw(this.colliderSet.raw.coRotation(this.handle));
|
|
4012
4012
|
}
|
|
4013
4013
|
rotationWrtParent() {
|
|
4014
|
-
return
|
|
4014
|
+
return QA.fromRaw(this.colliderSet.raw.coRotationWrtParent(this.handle));
|
|
4015
4015
|
}
|
|
4016
4016
|
isSensor() {
|
|
4017
4017
|
return this.colliderSet.raw.coIsSensor(this.handle);
|
|
@@ -4090,7 +4090,7 @@ class zI {
|
|
|
4090
4090
|
this.colliderSet.raw.coSetMass(this.handle, A);
|
|
4091
4091
|
}
|
|
4092
4092
|
setMassProperties(A, I, C) {
|
|
4093
|
-
let g =
|
|
4093
|
+
let g = y.intoRaw(I);
|
|
4094
4094
|
this.colliderSet.raw.coSetMassProperties(this.handle, A, g, C), g.free();
|
|
4095
4095
|
}
|
|
4096
4096
|
setTranslation(A) {
|
|
@@ -4109,10 +4109,10 @@ class zI {
|
|
|
4109
4109
|
return this.colliderSet.raw.coShapeType(this.handle);
|
|
4110
4110
|
}
|
|
4111
4111
|
halfExtents() {
|
|
4112
|
-
return
|
|
4112
|
+
return y.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
|
|
4113
4113
|
}
|
|
4114
4114
|
setHalfExtents(A) {
|
|
4115
|
-
const I =
|
|
4115
|
+
const I = y.intoRaw(A);
|
|
4116
4116
|
this.colliderSet.raw.coSetHalfExtents(this.handle, I);
|
|
4117
4117
|
}
|
|
4118
4118
|
radius() {
|
|
@@ -4153,7 +4153,7 @@ class zI {
|
|
|
4153
4153
|
}
|
|
4154
4154
|
heightfieldScale() {
|
|
4155
4155
|
let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
|
|
4156
|
-
return
|
|
4156
|
+
return y.fromRaw(A);
|
|
4157
4157
|
}
|
|
4158
4158
|
parent() {
|
|
4159
4159
|
return this._parent;
|
|
@@ -4180,42 +4180,42 @@ class zI {
|
|
|
4180
4180
|
return this.colliderSet.raw.coSolverGroups(this.handle);
|
|
4181
4181
|
}
|
|
4182
4182
|
containsPoint(A) {
|
|
4183
|
-
let I =
|
|
4183
|
+
let I = y.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
|
|
4184
4184
|
return I.free(), C;
|
|
4185
4185
|
}
|
|
4186
4186
|
projectPoint(A, I) {
|
|
4187
|
-
let C =
|
|
4187
|
+
let C = y.intoRaw(A), g = iI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
|
|
4188
4188
|
return C.free(), g;
|
|
4189
4189
|
}
|
|
4190
4190
|
intersectsRay(A, I) {
|
|
4191
|
-
let C =
|
|
4191
|
+
let C = y.intoRaw(A.origin), g = y.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
|
|
4192
4192
|
return C.free(), g.free(), Q;
|
|
4193
4193
|
}
|
|
4194
4194
|
castShape(A, I, C, g, Q, B, i, o) {
|
|
4195
|
-
let h =
|
|
4195
|
+
let h = y.intoRaw(A), s = y.intoRaw(C), G = QA.intoRaw(g), w = y.intoRaw(Q), a = I.intoRaw(), N = PA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, h, a, s, G, w, B, i, o));
|
|
4196
4196
|
return h.free(), s.free(), G.free(), w.free(), a.free(), N;
|
|
4197
4197
|
}
|
|
4198
4198
|
castCollider(A, I, C, g, Q, B) {
|
|
4199
|
-
let i =
|
|
4199
|
+
let i = y.intoRaw(A), o = y.intoRaw(C), h = DI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, i, I.handle, o, g, Q, B));
|
|
4200
4200
|
return i.free(), o.free(), h;
|
|
4201
4201
|
}
|
|
4202
4202
|
intersectsShape(A, I, C) {
|
|
4203
|
-
let g =
|
|
4203
|
+
let g = y.intoRaw(I), Q = QA.intoRaw(C), B = A.intoRaw(), i = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
|
|
4204
4204
|
return g.free(), Q.free(), B.free(), i;
|
|
4205
4205
|
}
|
|
4206
4206
|
contactShape(A, I, C, g) {
|
|
4207
|
-
let Q =
|
|
4207
|
+
let Q = y.intoRaw(I), B = QA.intoRaw(C), i = A.intoRaw(), o = uA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, i, Q, B, g));
|
|
4208
4208
|
return Q.free(), B.free(), i.free(), o;
|
|
4209
4209
|
}
|
|
4210
4210
|
contactCollider(A, I) {
|
|
4211
4211
|
return uA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
|
|
4212
4212
|
}
|
|
4213
4213
|
castRay(A, I, C) {
|
|
4214
|
-
let g =
|
|
4214
|
+
let g = y.intoRaw(A.origin), Q = y.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
|
|
4215
4215
|
return g.free(), Q.free(), B;
|
|
4216
4216
|
}
|
|
4217
4217
|
castRayAndGetNormal(A, I, C) {
|
|
4218
|
-
let g =
|
|
4218
|
+
let g = y.intoRaw(A.origin), Q = y.intoRaw(A.dir), B = EI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
|
|
4219
4219
|
return g.free(), Q.free(), B;
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
@@ -4224,7 +4224,7 @@ class zI {
|
|
|
4224
4224
|
})(WA || (WA = {}));
|
|
4225
4225
|
class KA {
|
|
4226
4226
|
constructor(A) {
|
|
4227
|
-
this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation =
|
|
4227
|
+
this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = QA.identity(), this.translation = y.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = CI.Average, this.restitutionCombineRule = CI.Average, this.activeCollisionTypes = SI.DEFAULT, this.activeEvents = aI.NONE, this.activeHooks = KI.NONE, this.mass = 0, this.centerOfMass = y.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
|
|
4228
4228
|
}
|
|
4229
4229
|
static ball(A) {
|
|
4230
4230
|
const I = new Bg(A);
|
|
@@ -4313,7 +4313,7 @@ class KA {
|
|
|
4313
4313
|
return this.massPropsMode = WA.Mass, this.mass = A, this;
|
|
4314
4314
|
}
|
|
4315
4315
|
setMassProperties(A, I, C) {
|
|
4316
|
-
return this.massPropsMode = WA.MassProps, this.mass = A,
|
|
4316
|
+
return this.massPropsMode = WA.MassProps, this.mass = A, y.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
|
|
4317
4317
|
}
|
|
4318
4318
|
setRestitution(A) {
|
|
4319
4319
|
return this.restitution = A, this;
|
|
@@ -4364,7 +4364,7 @@ class yC {
|
|
|
4364
4364
|
createCollider(A, I, C) {
|
|
4365
4365
|
let g = C != null && C != null;
|
|
4366
4366
|
if (g && isNaN(C)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
|
|
4367
|
-
let Q = I.shape.intoRaw(), B =
|
|
4367
|
+
let Q = I.shape.intoRaw(), B = y.intoRaw(I.translation), i = QA.intoRaw(I.rotation), o = y.intoRaw(I.centerOfMass), h = this.raw.createCollider(I.enabled, Q, B, i, I.massPropsMode, I.mass, o, I.principalAngularInertia, I.density, I.friction, I.restitution, I.frictionCombineRule, I.restitutionCombineRule, I.isSensor, I.collisionGroups, I.solverGroups, I.activeCollisionTypes, I.activeHooks, I.activeEvents, I.contactForceEventThreshold, I.contactSkin, g, g ? C : 0, A.raw);
|
|
4368
4368
|
Q.free(), B.free(), i.free(), o.free();
|
|
4369
4369
|
let s = g ? A.get(C) : null, G = new zI(this, h, s, I.shape);
|
|
4370
4370
|
return this.map.set(h, G), G;
|
|
@@ -4462,7 +4462,7 @@ function jC(D) {
|
|
|
4462
4462
|
A = D, E.reserve_memory(A);
|
|
4463
4463
|
}
|
|
4464
4464
|
tA[45] = 62, tA[95] = 63;
|
|
4465
|
-
var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps:
|
|
4465
|
+
var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps: y, RotationOps: QA, get RigidBodyType() {
|
|
4466
4466
|
return YA;
|
|
4467
4467
|
}, RigidBody: PI, RigidBodyDesc: rA, RigidBodySet: Pg, IntegrationParameters: Vg, get JointType() {
|
|
4468
4468
|
return RA;
|
|
@@ -4495,10 +4495,10 @@ var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector
|
|
|
4495
4495
|
}, PidController: NC });
|
|
4496
4496
|
class mC {
|
|
4497
4497
|
constructor() {
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4498
|
+
AA(this, "world", null);
|
|
4499
|
+
AA(this, "bodies", /* @__PURE__ */ new Map());
|
|
4500
|
+
AA(this, "colliders", /* @__PURE__ */ new Map());
|
|
4501
|
+
AA(this, "initialized", !1);
|
|
4502
4502
|
}
|
|
4503
4503
|
async init(A) {
|
|
4504
4504
|
this.initialized || (await JA.init(), this.world = new JA.World(new JA.Vector2(A.x, A.y)), this.initialized = !0);
|
|
@@ -4598,42 +4598,44 @@ class mC {
|
|
|
4598
4598
|
}
|
|
4599
4599
|
class xC {
|
|
4600
4600
|
constructor() {
|
|
4601
|
-
|
|
4602
|
-
|
|
4601
|
+
AA(this, "artboard", null);
|
|
4602
|
+
AA(this, "objectStates", /* @__PURE__ */ new Map());
|
|
4603
4603
|
// Physics State
|
|
4604
|
-
|
|
4604
|
+
AA(this, "physicsEngine", null);
|
|
4605
4605
|
// State Machine State
|
|
4606
|
-
|
|
4607
|
-
|
|
4606
|
+
AA(this, "activeStateMachine", null);
|
|
4607
|
+
AA(this, "inputs", /* @__PURE__ */ new Map());
|
|
4608
4608
|
// id -> value
|
|
4609
|
-
|
|
4609
|
+
AA(this, "inputNameMap", /* @__PURE__ */ new Map());
|
|
4610
4610
|
// name -> id[] mapping
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4611
|
+
AA(this, "layerStates", /* @__PURE__ */ new Map());
|
|
4612
|
+
AA(this, "imageCache", /* @__PURE__ */ new Map());
|
|
4613
|
+
AA(this, "fontCache", /* @__PURE__ */ new Set());
|
|
4614
|
+
AA(this, "shadowBuffer", null);
|
|
4615
|
+
AA(this, "layout", { fit: "Contain", alignment: "Center" });
|
|
4616
|
+
AA(this, "onTrigger");
|
|
4617
|
+
AA(this, "onInputUpdate");
|
|
4618
|
+
AA(this, "onComponentChange");
|
|
4617
4619
|
// Specific Component Listeners
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4620
|
+
AA(this, "onToggle");
|
|
4621
|
+
AA(this, "onInputChange");
|
|
4622
|
+
AA(this, "onInputFocus");
|
|
4623
|
+
AA(this, "onInputBlur");
|
|
4622
4624
|
// Track triggers that were just fired in the current frame
|
|
4623
|
-
|
|
4625
|
+
AA(this, "justFiredTriggers", /* @__PURE__ */ new Set());
|
|
4624
4626
|
// Track currently hovered object for Enter/Leave events
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4627
|
+
AA(this, "lastHoveredObjectId", null);
|
|
4628
|
+
AA(this, "_lastPointerPos", null);
|
|
4629
|
+
AA(this, "_prevPointerPos", null);
|
|
4628
4630
|
// Interaction State
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4631
|
+
AA(this, "focusedId", null);
|
|
4632
|
+
AA(this, "draggingSliderId", null);
|
|
4633
|
+
AA(this, "activeDropdownId", null);
|
|
4634
|
+
AA(this, "draggingListViewId", null);
|
|
4633
4635
|
// Physics/Animation State
|
|
4634
|
-
|
|
4636
|
+
AA(this, "objectVelocities", /* @__PURE__ */ new Map());
|
|
4635
4637
|
// Trigger Management
|
|
4636
|
-
|
|
4638
|
+
AA(this, "activeTriggers", /* @__PURE__ */ new Map());
|
|
4637
4639
|
}
|
|
4638
4640
|
setTriggerCallback(A) {
|
|
4639
4641
|
this.onTrigger = A;
|
|
@@ -5053,8 +5055,8 @@ class xC {
|
|
|
5053
5055
|
if (w) {
|
|
5054
5056
|
const a = g.useSpring, N = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 };
|
|
5055
5057
|
if (a) {
|
|
5056
|
-
const { x: S, y: k, vx:
|
|
5057
|
-
g.copyX && (C.x = S), g.copyY && (C.y = k), this.objectVelocities.set(I.id, { vx:
|
|
5058
|
+
const { x: S, y: k, vx: F, vy: U } = this.computeSpring(C.x, C.y, N.vx, N.vy, w.x, w.y, g, A);
|
|
5059
|
+
g.copyX && (C.x = S), g.copyY && (C.y = k), this.objectVelocities.set(I.id, { vx: F, vy: U });
|
|
5058
5060
|
} else
|
|
5059
5061
|
g.copyX && (C.x = C.x + (w.x - C.x) * Q), g.copyY && (C.y = C.y + (w.y - C.y) * Q);
|
|
5060
5062
|
(B = g.limitX) != null && B.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (i = g.limitY) != null && i.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
|
|
@@ -5062,8 +5064,8 @@ class xC {
|
|
|
5062
5064
|
} else if (g.type === "FollowPointer") {
|
|
5063
5065
|
const w = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? C.x, a = ((h = this._lastPointerPos) == null ? void 0 : h.y) ?? C.y;
|
|
5064
5066
|
if (g.useSpring) {
|
|
5065
|
-
const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: k, y, vx: U, vy: c } = this.computeSpring(C.x, C.y, S.vx, S.vy, w, a, g, A);
|
|
5066
|
-
C.x = k, C.y =
|
|
5067
|
+
const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: k, y: F, vx: U, vy: c } = this.computeSpring(C.x, C.y, S.vx, S.vy, w, a, g, A);
|
|
5068
|
+
C.x = k, C.y = F, this.objectVelocities.set(I.id, { vx: U, vy: c });
|
|
5067
5069
|
} else
|
|
5068
5070
|
C.x = C.x + (w - C.x) * Q, C.y = C.y + (a - C.y) * Q;
|
|
5069
5071
|
(s = g.limitX) != null && s.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (G = g.limitY) != null && G.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
|
|
@@ -5071,33 +5073,33 @@ class xC {
|
|
|
5071
5073
|
const w = this.objectStates.get(g.targetId);
|
|
5072
5074
|
if (w) {
|
|
5073
5075
|
const a = C.x - w.x, N = C.y - w.y, S = Math.sqrt(a * a + N * N), k = g.distance || 0;
|
|
5074
|
-
let
|
|
5076
|
+
let F = S;
|
|
5075
5077
|
switch (g.mode) {
|
|
5076
5078
|
case "exact":
|
|
5077
|
-
|
|
5079
|
+
F = k;
|
|
5078
5080
|
break;
|
|
5079
5081
|
case "minimum":
|
|
5080
|
-
|
|
5082
|
+
F = Math.max(k, S);
|
|
5081
5083
|
break;
|
|
5082
5084
|
case "maximum":
|
|
5083
|
-
|
|
5085
|
+
F = Math.min(k, S);
|
|
5084
5086
|
break;
|
|
5085
5087
|
case "clamped":
|
|
5086
|
-
|
|
5088
|
+
F = Math.max(0, Math.min(k, S));
|
|
5087
5089
|
break;
|
|
5088
5090
|
}
|
|
5089
5091
|
if (S > 0) {
|
|
5090
|
-
const U =
|
|
5092
|
+
const U = F / S;
|
|
5091
5093
|
C.x = w.x + a * U, C.y = w.y + N * U;
|
|
5092
|
-
} else S === 0 &&
|
|
5094
|
+
} else S === 0 && F > 0 && (C.x = w.x + F);
|
|
5093
5095
|
}
|
|
5094
5096
|
}
|
|
5095
5097
|
});
|
|
5096
5098
|
});
|
|
5097
5099
|
}
|
|
5098
5100
|
computeSpring(A, I, C, g, Q, B, i, o) {
|
|
5099
|
-
const h = i.stiffness ?? 100, s = i.damping ?? 10, G = i.mass ?? 1, w = -h * (A - Q), a = -h * (I - B), N = -s * C, S = -s * g, k = (w + N) / G,
|
|
5100
|
-
return { x:
|
|
5101
|
+
const h = i.stiffness ?? 100, s = i.damping ?? 10, G = i.mass ?? 1, w = -h * (A - Q), a = -h * (I - B), N = -s * C, S = -s * g, k = (w + N) / G, F = (a + S) / G, U = C + k * o, c = g + F * o, Y = A + U * o, J = I + c * o;
|
|
5102
|
+
return { x: Y, y: J, vx: U, vy: c };
|
|
5101
5103
|
}
|
|
5102
5104
|
handlePointerInput(A, I, C, g, Q) {
|
|
5103
5105
|
if (!this.artboard) return;
|
|
@@ -5122,7 +5124,7 @@ class xC {
|
|
|
5122
5124
|
const S = /* @__PURE__ */ new Set([N]);
|
|
5123
5125
|
a === "move" && S.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), N === "onClick" && S.add("click"), N === "onPointerDown" && S.add("pointerDown"), N === "onPointerUp" && S.add("pointerUp");
|
|
5124
5126
|
const k = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider"];
|
|
5125
|
-
return !!(w.type === "Component" && k.includes(w.variant) || k.includes((c = w.type) == null ? void 0 : c.toLowerCase()) || (w.interactions || []).some((
|
|
5127
|
+
return !!(w.type === "Component" && k.includes(w.variant) || k.includes((c = w.type) == null ? void 0 : c.toLowerCase()) || (w.interactions || []).some((Y) => S.has(Y.event)) || (w.triggers || []).some((Y) => S.has(Y.eventType)));
|
|
5126
5128
|
};
|
|
5127
5129
|
let B = null;
|
|
5128
5130
|
for (let w = this.artboard.objects.length - 1; w >= 0; w--) {
|
|
@@ -5151,17 +5153,17 @@ class xC {
|
|
|
5151
5153
|
if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null), this.activeDropdownId && A === "down") {
|
|
5152
5154
|
const w = this.artboard.objects.find((a) => a.id === this.activeDropdownId);
|
|
5153
5155
|
if (w && (w.type === "Dropdown" || w.variant === "dropdown")) {
|
|
5154
|
-
const a = this.objectStates.get(w.id), N = (a == null ? void 0 : a.options) || w.options || {}, S = w.geometry || {}, k = S.width ?? w.width ?? 200,
|
|
5155
|
-
if (
|
|
5156
|
-
const
|
|
5157
|
-
if (
|
|
5158
|
-
const
|
|
5159
|
-
N.selectedOption =
|
|
5156
|
+
const a = this.objectStates.get(w.id), N = (a == null ? void 0 : a.options) || w.options || {}, S = w.geometry || {}, k = S.width ?? w.width ?? 200, F = S.height ?? w.height ?? 40, U = N.optionsList || [], c = N.itemHeight || 32, Y = N.listPadding ?? 4, J = U.length * c + Y * 2, R = this.getWorldTransform(w.id), e = k * Math.abs(R.scaleX), t = F * Math.abs(R.scaleY), L = R.y + t / 2 + 4, r = Math.abs(I - R.x) <= e / 2, T = C >= L && C <= L + J * Math.abs(R.scaleY);
|
|
5157
|
+
if (r && T) {
|
|
5158
|
+
const W = Math.abs(R.scaleY), V = C - (L + Y * W), n = Math.floor(V / (c * W));
|
|
5159
|
+
if (n >= 0 && n < U.length) {
|
|
5160
|
+
const IA = U[n];
|
|
5161
|
+
N.selectedOption = IA, N.isOpen = !1, this.activeDropdownId = null, w.inputId && this.setInternalInput(w.inputId, IA), this.onComponentChange && this.onComponentChange({
|
|
5160
5162
|
objectId: w.id,
|
|
5161
5163
|
componentName: w.name,
|
|
5162
5164
|
variant: "dropdown",
|
|
5163
5165
|
property: "selectedOption",
|
|
5164
|
-
value:
|
|
5166
|
+
value: IA
|
|
5165
5167
|
});
|
|
5166
5168
|
}
|
|
5167
5169
|
return;
|
|
@@ -5200,12 +5202,12 @@ class xC {
|
|
|
5200
5202
|
}), this.onToggle && this.onToggle(w.name, k.checked);
|
|
5201
5203
|
}
|
|
5202
5204
|
if (w.type === "Component" && w.variant === "dropdown" && A === "down") {
|
|
5203
|
-
const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {},
|
|
5204
|
-
if (
|
|
5205
|
+
const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {}, F = !k.isOpen;
|
|
5206
|
+
if (F && this.activeDropdownId && this.activeDropdownId !== w.id) {
|
|
5205
5207
|
const U = this.artboard.objects.find((c) => c.id === this.activeDropdownId);
|
|
5206
5208
|
U && U.options && (U.options.isOpen = !1);
|
|
5207
5209
|
}
|
|
5208
|
-
k.isOpen =
|
|
5210
|
+
k.isOpen = F, this.activeDropdownId = F ? w.id : null;
|
|
5209
5211
|
}
|
|
5210
5212
|
if (g.type === "Component" && g.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
|
|
5211
5213
|
objectId: g.id,
|
|
@@ -5219,10 +5221,10 @@ class xC {
|
|
|
5219
5221
|
if (S !== null) {
|
|
5220
5222
|
const k = g.options || {};
|
|
5221
5223
|
k.activeItemIndex = S;
|
|
5222
|
-
const
|
|
5223
|
-
|
|
5224
|
+
const F = this.objectStates.get(g.id);
|
|
5225
|
+
F && F.options && (F.options.activeItemIndex = S);
|
|
5224
5226
|
const U = (k.items || [])[S], c = typeof U == "string" ? U : U.label || U.value || S;
|
|
5225
|
-
|
|
5227
|
+
F && F.options && (F.options.selectedValue = c), g.inputId && this.setInternalInput(g.inputId, c), this.onComponentChange && (this.onComponentChange({
|
|
5226
5228
|
objectId: g.id,
|
|
5227
5229
|
componentName: g.name,
|
|
5228
5230
|
variant: "listview",
|
|
@@ -5238,18 +5240,18 @@ class xC {
|
|
|
5238
5240
|
}
|
|
5239
5241
|
}
|
|
5240
5242
|
if (g.type === "Component" && g.variant === "slider" && A === "down" && (this.draggingSliderId = g.id, this.updateSliderValueFromPointer(g, I, C)), A === "click") {
|
|
5241
|
-
const S = (o = this.artboard) == null ? void 0 : o.objects.find((
|
|
5243
|
+
const S = (o = this.artboard) == null ? void 0 : o.objects.find((F) => F.id === g.id), k = this.focusedId;
|
|
5242
5244
|
if ((S == null ? void 0 : S.type) === "Component" && S.variant === "inputbox") {
|
|
5243
5245
|
if (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`), k !== this.focusedId) {
|
|
5244
5246
|
if (k) {
|
|
5245
|
-
const
|
|
5246
|
-
|
|
5247
|
+
const F = (h = this.artboard) == null ? void 0 : h.objects.find((U) => U.id === k);
|
|
5248
|
+
F && this.onInputBlur && this.onInputBlur(F.name);
|
|
5247
5249
|
}
|
|
5248
5250
|
this.onInputFocus && this.onInputFocus(S.name);
|
|
5249
5251
|
}
|
|
5250
5252
|
} else if (this.focusedId = null, k) {
|
|
5251
|
-
const
|
|
5252
|
-
|
|
5253
|
+
const F = (s = this.artboard) == null ? void 0 : s.objects.find((U) => U.id === k);
|
|
5254
|
+
F && this.onInputBlur && this.onInputBlur(F.name);
|
|
5253
5255
|
}
|
|
5254
5256
|
}
|
|
5255
5257
|
} else if (A === "click") {
|
|
@@ -5339,21 +5341,21 @@ class xC {
|
|
|
5339
5341
|
};
|
|
5340
5342
|
}
|
|
5341
5343
|
hitTest(A, I, C) {
|
|
5342
|
-
var c,
|
|
5344
|
+
var c, Y;
|
|
5343
5345
|
if (!this.objectStates.get(A.id)) return !1;
|
|
5344
|
-
const Q = ((c = A.geometry) == null ? void 0 : c.width) ?? A.width ?? 100, B = ((
|
|
5345
|
-
return Math.abs(a) <=
|
|
5346
|
+
const Q = ((c = A.geometry) == null ? void 0 : c.width) ?? A.width ?? 100, B = ((Y = A.geometry) == null ? void 0 : Y.height) ?? A.height ?? 100, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = o * w + h * G, S = i.scaleX, k = i.scaleY, F = Q * Math.abs(S), U = B * Math.abs(k);
|
|
5347
|
+
return Math.abs(a) <= F / 2 && Math.abs(N) <= U / 2;
|
|
5346
5348
|
}
|
|
5347
5349
|
updateSliderValueFromPointer(A, I, C) {
|
|
5348
5350
|
var e;
|
|
5349
5351
|
const g = this.objectStates.get(A.id);
|
|
5350
5352
|
if (!g) return;
|
|
5351
5353
|
const Q = A.options || {}, B = ((e = A.geometry) == null ? void 0 : e.width) ?? A.width ?? 200, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = Q.thumbWidth ?? 16, S = B - N;
|
|
5352
|
-
let
|
|
5353
|
-
|
|
5354
|
-
const U = Q.min ?? 0, c = Q.max ?? 100,
|
|
5355
|
-
let J = U +
|
|
5356
|
-
|
|
5354
|
+
let F = (a + S / 2) / S;
|
|
5355
|
+
F = Math.max(0, Math.min(1, F));
|
|
5356
|
+
const U = Q.min ?? 0, c = Q.max ?? 100, Y = Q.step || 1;
|
|
5357
|
+
let J = U + F * (c - U);
|
|
5358
|
+
Y > 0 && (J = Math.round(J / Y) * Y), J = Math.max(U, Math.min(c, J));
|
|
5357
5359
|
const R = g.options || {};
|
|
5358
5360
|
R.value !== J && (g.options = { ...R, value: J }, A.inputId && this.setInternalInput(A.inputId, J), this.onComponentChange && this.onComponentChange({
|
|
5359
5361
|
objectId: A.id,
|
|
@@ -5423,19 +5425,19 @@ class xC {
|
|
|
5423
5425
|
var N, S;
|
|
5424
5426
|
const g = ((S = (N = this.artboard) == null ? void 0 : N.tokens) == null ? void 0 : S.colors) || {}, Q = g[A] || A, B = g[I] || I, i = (k) => {
|
|
5425
5427
|
if (!k) return { r: 0, g: 0, b: 0 };
|
|
5426
|
-
const
|
|
5427
|
-
return
|
|
5428
|
-
r: parseInt(
|
|
5429
|
-
g: parseInt(
|
|
5430
|
-
b: parseInt(
|
|
5428
|
+
const F = k.startsWith("#") ? k.replace("#", "") : "000000";
|
|
5429
|
+
return F.length === 3 ? {
|
|
5430
|
+
r: parseInt(F[0] + F[0], 16),
|
|
5431
|
+
g: parseInt(F[1] + F[1], 16),
|
|
5432
|
+
b: parseInt(F[2] + F[2], 16)
|
|
5431
5433
|
} : {
|
|
5432
|
-
r: parseInt(
|
|
5433
|
-
g: parseInt(
|
|
5434
|
-
b: parseInt(
|
|
5434
|
+
r: parseInt(F.substring(0, 2), 16),
|
|
5435
|
+
g: parseInt(F.substring(2, 4), 16),
|
|
5436
|
+
b: parseInt(F.substring(4, 6), 16)
|
|
5435
5437
|
};
|
|
5436
5438
|
}, o = i(Q), h = i(B), s = Math.round(o.r + (h.r - o.r) * C), G = Math.round(o.g + (h.g - o.g) * C), w = Math.round(o.b + (h.b - o.b) * C), a = (k) => {
|
|
5437
|
-
const
|
|
5438
|
-
return
|
|
5439
|
+
const F = Math.max(0, Math.min(255, k)).toString(16);
|
|
5440
|
+
return F.length === 1 ? "0" + F : F;
|
|
5439
5441
|
};
|
|
5440
5442
|
return `#${a(s)}${a(G)}${a(w)}`;
|
|
5441
5443
|
}
|
|
@@ -5542,20 +5544,20 @@ class xC {
|
|
|
5542
5544
|
return /^\d+$/.test(I) ? I : I.includes("thin") ? "100" : I.includes("extra light") || I.includes("extralight") ? "200" : I.includes("light") ? "300" : I.includes("medium") ? "500" : I.includes("semibold") || I.includes("semi bold") ? "600" : I.includes("bold") ? "700" : I.includes("extra bold") || I.includes("extrabold") ? "800" : I.includes("black") || I.includes("heavy") ? "900" : "400";
|
|
5543
5545
|
}
|
|
5544
5546
|
renderObject(A, I, C) {
|
|
5545
|
-
var U, c,
|
|
5547
|
+
var U, c, Y;
|
|
5546
5548
|
const g = this.objectStates.get(I.id);
|
|
5547
5549
|
if (!g) {
|
|
5548
5550
|
console.warn("No state for object:", I.id);
|
|
5549
5551
|
return;
|
|
5550
5552
|
}
|
|
5551
|
-
A.roundRect || (A.roundRect = (J, R, e,
|
|
5553
|
+
A.roundRect || (A.roundRect = (J, R, e, t, L) => (this.drawRoundRect(A, J, R, e, t, L), A));
|
|
5552
5554
|
const Q = g.geometry ? { ...I.geometry, ...g.geometry } : I.geometry, B = g.style ? { ...I.style, ...g.style } : I.style;
|
|
5553
5555
|
let i = (Q == null ? void 0 : Q.width) || ((U = I.geometry) == null ? void 0 : U.width) || I.width || 0, o = (Q == null ? void 0 : Q.height) || ((c = I.geometry) == null ? void 0 : c.height) || I.height || 0;
|
|
5554
5556
|
if ((i === 0 || o === 0) && (Q != null && Q.points) && Array.isArray(Q.points) && Q.points.length > 0) {
|
|
5555
|
-
let J = 1 / 0, R = -1 / 0, e = 1 / 0,
|
|
5556
|
-
Q.points.forEach((
|
|
5557
|
-
J = Math.min(J,
|
|
5558
|
-
}), i === 0 && (i = R - J), o === 0 && (o =
|
|
5557
|
+
let J = 1 / 0, R = -1 / 0, e = 1 / 0, t = -1 / 0;
|
|
5558
|
+
Q.points.forEach((L) => {
|
|
5559
|
+
J = Math.min(J, L.x), R = Math.max(R, L.x), e = Math.min(e, L.y), t = Math.max(t, L.y);
|
|
5560
|
+
}), i === 0 && (i = R - J), o === 0 && (o = t - e);
|
|
5559
5561
|
}
|
|
5560
5562
|
const h = (J) => {
|
|
5561
5563
|
if (J)
|
|
@@ -5604,88 +5606,88 @@ class xC {
|
|
|
5604
5606
|
if (A.translate(w, a), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
|
|
5605
5607
|
let J = Q.text || "";
|
|
5606
5608
|
if (Q.textInputId) {
|
|
5607
|
-
const
|
|
5608
|
-
|
|
5609
|
+
const f = this.inputs.get(Q.textInputId);
|
|
5610
|
+
f !== void 0 && (J = String(f), g.geometry && g.geometry.type === "Text" && (g.geometry.text = J));
|
|
5609
5611
|
}
|
|
5610
5612
|
let R = J || "";
|
|
5611
|
-
Q.segments && Array.isArray(Q.segments) && (R = Q.segments.map((
|
|
5613
|
+
Q.segments && Array.isArray(Q.segments) && (R = Q.segments.map((f) => f && f.text ? f.text : "").join(""));
|
|
5612
5614
|
const e = Q.textCase || "none";
|
|
5613
|
-
e === "uppercase" ? R = R.toUpperCase() : e === "lowercase" ? R = R.toLowerCase() : e === "capitalize" && (R = R.replace(/\b\w/g, (
|
|
5614
|
-
let
|
|
5615
|
-
|
|
5616
|
-
const
|
|
5617
|
-
A.font = `${
|
|
5618
|
-
const
|
|
5619
|
-
let
|
|
5620
|
-
|
|
5621
|
-
const
|
|
5622
|
-
A.textAlign =
|
|
5623
|
-
let
|
|
5624
|
-
|
|
5625
|
-
const
|
|
5626
|
-
if (
|
|
5615
|
+
e === "uppercase" ? R = R.toUpperCase() : e === "lowercase" ? R = R.toLowerCase() : e === "capitalize" && (R = R.replace(/\b\w/g, (f) => f.toUpperCase()));
|
|
5616
|
+
let t = ((Y = Q.fontWeight) == null ? void 0 : Y.toString()) || "400", L = "normal";
|
|
5617
|
+
t.toLowerCase().includes("italic") && (L = "italic", t = t.replace(/italic/gi, "").trim() || "400");
|
|
5618
|
+
const r = this.mapFontWeight(t), T = Math.max(1, Q.fontSize || 16);
|
|
5619
|
+
A.font = `${L} ${r} ${T}px "${Q.fontFamily || "Inter"}", sans-serif`;
|
|
5620
|
+
const W = Q.textVerticalAlign || "top";
|
|
5621
|
+
let V = -o / 2;
|
|
5622
|
+
W === "middle" || W === "center" ? (A.textBaseline = "middle", V = 0) : W === "bottom" ? (A.textBaseline = "bottom", V = o / 2) : (A.textBaseline = "top", V = -o / 2);
|
|
5623
|
+
const n = Q.textAlign || "left";
|
|
5624
|
+
A.textAlign = n;
|
|
5625
|
+
let IA = -i / 2;
|
|
5626
|
+
n === "center" && (IA = 0), n === "right" && (IA = i / 2);
|
|
5627
|
+
const O = Q.letterSpacing || 0, u = Q.paragraphSpacing || 0, l = (Q.lineHeight || 1.16) * T, $ = Q.width || i || 200, j = (f) => {
|
|
5628
|
+
if (O === 0) return A.measureText(f).width;
|
|
5627
5629
|
let iA = 0;
|
|
5628
|
-
for (let
|
|
5629
|
-
iA += A.measureText(
|
|
5630
|
-
return iA -
|
|
5631
|
-
},
|
|
5630
|
+
for (let b = 0; b < f.length; b++)
|
|
5631
|
+
iA += A.measureText(f[b]).width + O;
|
|
5632
|
+
return iA - O;
|
|
5633
|
+
}, H = [], m = String(R || "").split(`
|
|
5632
5634
|
`);
|
|
5633
|
-
|
|
5634
|
-
const
|
|
5635
|
-
let
|
|
5636
|
-
for (let
|
|
5637
|
-
let
|
|
5638
|
-
const aA =
|
|
5639
|
-
if (
|
|
5640
|
-
|
|
5635
|
+
m.forEach((f, iA) => {
|
|
5636
|
+
const b = String(f || "").split(" ");
|
|
5637
|
+
let p = "";
|
|
5638
|
+
for (let X = 0; X < b.length; X++) {
|
|
5639
|
+
let P = b[X];
|
|
5640
|
+
const aA = p + P + " ";
|
|
5641
|
+
if (j(aA.trim()) <= $)
|
|
5642
|
+
p = aA;
|
|
5641
5643
|
else {
|
|
5642
|
-
if (
|
|
5644
|
+
if (p !== "") {
|
|
5643
5645
|
let sA = -1;
|
|
5644
|
-
for (let oA = 0; oA <
|
|
5645
|
-
const NA =
|
|
5646
|
-
if (
|
|
5646
|
+
for (let oA = 0; oA < P.length; oA++) {
|
|
5647
|
+
const NA = p + P.substring(0, oA + 1);
|
|
5648
|
+
if (j(NA) <= $)
|
|
5647
5649
|
sA = oA;
|
|
5648
5650
|
else
|
|
5649
5651
|
break;
|
|
5650
5652
|
}
|
|
5651
5653
|
if (sA !== -1) {
|
|
5652
|
-
const oA =
|
|
5653
|
-
|
|
5654
|
+
const oA = P.substring(0, sA + 1), NA = P.substring(sA + 1);
|
|
5655
|
+
H.push({ text: p + oA, isParaEnd: !1 }), p = "", b[X] = NA, X--;
|
|
5654
5656
|
continue;
|
|
5655
5657
|
} else {
|
|
5656
|
-
|
|
5658
|
+
H.push({ text: p.trim(), isParaEnd: !1 }), p = "", X--;
|
|
5657
5659
|
continue;
|
|
5658
5660
|
}
|
|
5659
5661
|
}
|
|
5660
5662
|
let hA = "";
|
|
5661
|
-
for (let sA = 0; sA <
|
|
5662
|
-
const oA = hA +
|
|
5663
|
-
|
|
5663
|
+
for (let sA = 0; sA < P.length; sA++) {
|
|
5664
|
+
const oA = hA + P[sA];
|
|
5665
|
+
j(oA) > $ && hA !== "" ? (H.push({ text: hA, isParaEnd: !1 }), hA = P[sA]) : hA = oA;
|
|
5664
5666
|
}
|
|
5665
|
-
|
|
5667
|
+
p = hA + " ";
|
|
5666
5668
|
}
|
|
5667
5669
|
}
|
|
5668
|
-
|
|
5670
|
+
H.push({ text: p.trim(), isParaEnd: iA < m.length - 1 });
|
|
5669
5671
|
});
|
|
5670
|
-
let
|
|
5671
|
-
if (
|
|
5672
|
-
const
|
|
5673
|
-
|
|
5672
|
+
let Z = V, x = H.length * l;
|
|
5673
|
+
if (u > 0) {
|
|
5674
|
+
const f = H.filter((iA, b) => iA.isParaEnd && b < H.length - 1).length;
|
|
5675
|
+
x += f * u;
|
|
5674
5676
|
}
|
|
5675
|
-
|
|
5676
|
-
const
|
|
5677
|
-
var
|
|
5678
|
-
if (
|
|
5679
|
-
|
|
5677
|
+
W === "middle" || W === "center" ? Z -= x / 2 - T / 2 : W === "bottom" && (Z -= x - T);
|
|
5678
|
+
const gA = (f, iA, b, p, X) => {
|
|
5679
|
+
var P, aA;
|
|
5680
|
+
if (O === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
|
|
5681
|
+
p ? A.strokeText(f, iA, b) : A.fillText(f, iA, b);
|
|
5680
5682
|
else {
|
|
5681
|
-
const hA =
|
|
5683
|
+
const hA = j(f);
|
|
5682
5684
|
let sA = iA;
|
|
5683
|
-
|
|
5685
|
+
n === "center" ? sA -= hA / 2 : n === "right" && (sA -= hA);
|
|
5684
5686
|
let oA = sA;
|
|
5685
|
-
for (let NA = 0; NA <
|
|
5686
|
-
const xA =
|
|
5687
|
+
for (let NA = 0; NA < f.length; NA++) {
|
|
5688
|
+
const xA = f[NA];
|
|
5687
5689
|
if (Q.enableSegments === !0 && Q.segments && Q.segments.length > 0) {
|
|
5688
|
-
const eI =
|
|
5690
|
+
const eI = X + NA;
|
|
5689
5691
|
let oI = 0;
|
|
5690
5692
|
const cA = Q.segments.find((TA) => {
|
|
5691
5693
|
if (!TA || typeof TA.text != "string") return !1;
|
|
@@ -5694,36 +5696,36 @@ class xC {
|
|
|
5694
5696
|
});
|
|
5695
5697
|
if (cA) {
|
|
5696
5698
|
if (cA.fill) {
|
|
5697
|
-
const TA = ((aA = (
|
|
5698
|
-
|
|
5699
|
+
const TA = ((aA = (P = g == null ? void 0 : g.style) == null ? void 0 : P.fill) == null ? void 0 : aA.color) || null;
|
|
5700
|
+
p ? A.strokeStyle = cA.fill.color || A.strokeStyle : A.fillStyle = TA || cA.fill.color || A.fillStyle;
|
|
5699
5701
|
}
|
|
5700
5702
|
if (cA.fontSize || cA.fontFamily || cA.fontWeight) {
|
|
5701
|
-
const TA = cA.fontWeight ? this.mapFontWeight(cA.fontWeight.toString()) :
|
|
5702
|
-
A.font = `${
|
|
5703
|
+
const TA = cA.fontWeight ? this.mapFontWeight(cA.fontWeight.toString()) : r, rI = cA.fontSize || T, FC = cA.fontFamily || Q.fontFamily || "Inter";
|
|
5704
|
+
A.font = `${L} ${TA} ${rI}px "${FC}", sans-serif`;
|
|
5703
5705
|
}
|
|
5704
5706
|
}
|
|
5705
5707
|
}
|
|
5706
|
-
|
|
5708
|
+
p ? A.strokeText(xA, oA, b) : A.fillText(xA, oA, b), Q.enableSegments === !0 && Q.segments && Q.segments.length > 0 && (A.font = `${L} ${r} ${T}px "${Q.fontFamily || "Inter"}", sans-serif`), oA += A.measureText(xA).width + O;
|
|
5707
5709
|
}
|
|
5708
5710
|
}
|
|
5709
5711
|
};
|
|
5710
5712
|
if (B.fill) {
|
|
5711
|
-
const
|
|
5712
|
-
A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha =
|
|
5713
|
-
let
|
|
5714
|
-
|
|
5715
|
-
const
|
|
5716
|
-
|
|
5717
|
-
}), A.globalAlpha =
|
|
5713
|
+
const f = A.globalAlpha, iA = this.createCanvasFill(A, B.fill, i, o);
|
|
5714
|
+
A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha = f * this.normalizeOpacity(B.fill.opacity ?? 100);
|
|
5715
|
+
let b = 0, p = Z;
|
|
5716
|
+
H.forEach((X) => {
|
|
5717
|
+
const P = R.indexOf(X.text, b);
|
|
5718
|
+
P !== -1 && (gA(X.text, IA, p, !1, P), b = P + X.text.length, p += l + (X.isParaEnd ? u : 0));
|
|
5719
|
+
}), A.globalAlpha = f;
|
|
5718
5720
|
}
|
|
5719
5721
|
if (B.stroke && B.stroke.width > 0) {
|
|
5720
|
-
const
|
|
5721
|
-
A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha =
|
|
5722
|
-
let iA = 0,
|
|
5723
|
-
|
|
5724
|
-
const
|
|
5725
|
-
|
|
5726
|
-
}), A.globalAlpha =
|
|
5722
|
+
const f = A.globalAlpha;
|
|
5723
|
+
A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = f * this.normalizeOpacity(B.stroke.opacity ?? 100);
|
|
5724
|
+
let iA = 0, b = Z;
|
|
5725
|
+
H.forEach((p) => {
|
|
5726
|
+
const X = R.indexOf(p.text, iA);
|
|
5727
|
+
X !== -1 && (gA(p.text, IA, b, !0, X), iA = X + p.text.length, b += l + (p.isParaEnd ? u : 0));
|
|
5728
|
+
}), A.globalAlpha = f;
|
|
5727
5729
|
}
|
|
5728
5730
|
} else if (Q.type === "Image") {
|
|
5729
5731
|
const J = Q.src;
|
|
@@ -5738,54 +5740,64 @@ class xC {
|
|
|
5738
5740
|
const J = Q.svgContent;
|
|
5739
5741
|
if (J) {
|
|
5740
5742
|
const R = B.palette || [], e = I.id + "_" + R.join("_");
|
|
5741
|
-
let
|
|
5742
|
-
if (!
|
|
5743
|
-
|
|
5744
|
-
let
|
|
5745
|
-
Q.colors && Q.colors.length > 0 && R.length > 0 && Q.colors.forEach((
|
|
5746
|
-
if (R[
|
|
5747
|
-
const
|
|
5748
|
-
|
|
5743
|
+
let t = this.imageCache.get(e);
|
|
5744
|
+
if (!t) {
|
|
5745
|
+
t = new Image();
|
|
5746
|
+
let L = J;
|
|
5747
|
+
Q.colors && Q.colors.length > 0 && R.length > 0 && Q.colors.forEach((W, V) => {
|
|
5748
|
+
if (R[V]) {
|
|
5749
|
+
const n = W.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), IA = new RegExp(n, "gi");
|
|
5750
|
+
L = L.replace(IA, R[V]);
|
|
5749
5751
|
}
|
|
5750
5752
|
});
|
|
5751
|
-
const
|
|
5752
|
-
|
|
5753
|
+
const r = new Blob([L], { type: "image/svg+xml" }), T = URL.createObjectURL(r);
|
|
5754
|
+
t.onload = () => {
|
|
5753
5755
|
this.artboard && this.reset();
|
|
5754
|
-
},
|
|
5756
|
+
}, t.src = T, this.imageCache.set(e, t);
|
|
5755
5757
|
}
|
|
5756
|
-
|
|
5758
|
+
t.complete && t.naturalWidth > 0 && (s !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, s), A.clip(), A.drawImage(t, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(t, -i / 2, -o / 2, i, o));
|
|
5757
5759
|
}
|
|
5758
5760
|
} else if (G.type === "LineGraph")
|
|
5759
5761
|
this.renderLineGraph(A, G, i, o);
|
|
5760
5762
|
else if (I.type === "Shape") {
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5763
|
+
this.applyPath(A, G, i, o, s);
|
|
5764
|
+
const J = B.shadow;
|
|
5765
|
+
if (J && J.isEnabled !== !1) {
|
|
5766
|
+
const R = J.color || "#000000", e = this.normalizeOpacity(J.opacity ?? 100), t = J.spread || 0, r = (J.blur || 0) + t * 1.5, T = Math.max(r * 3, Math.abs(J.offsetX || 0) + r, Math.abs(J.offsetY || 0) + r), W = Math.ceil(i + T * 2), V = Math.ceil(o + T * 2);
|
|
5767
|
+
this.shadowBuffer || (this.shadowBuffer = document.createElement("canvas")), (this.shadowBuffer.width < W || this.shadowBuffer.height < V) && (this.shadowBuffer.width = Math.max(this.shadowBuffer.width, W), this.shadowBuffer.height = Math.max(this.shadowBuffer.height, V));
|
|
5768
|
+
const n = this.shadowBuffer.getContext("2d", { willReadFrequently: !0 });
|
|
5769
|
+
n.clearRect(0, 0, W, V), n.save(), n.translate(W / 2, V / 2);
|
|
5770
|
+
let IA = R;
|
|
5771
|
+
if (R.startsWith("#")) {
|
|
5772
|
+
const O = R.replace("#", ""), u = parseInt(O.substring(0, 2), 16), l = parseInt(O.substring(2, 4), 16), $ = parseInt(O.substring(4, 6), 16);
|
|
5773
|
+
IA = `rgba(${u}, ${l}, ${$}, ${e})`;
|
|
5774
|
+
} else R.startsWith("rgba") && (IA = R.replace(/[\d.]+\)$/g, `${e})`));
|
|
5775
|
+
n.shadowColor = IA, n.shadowBlur = r, n.shadowOffsetX = J.offsetX || 0, n.shadowOffsetY = J.offsetY || 0, n.fillStyle = "#000000", n.beginPath(), this._tracePath(n, G, i, o, s), n.fill(), n.shadowColor = "transparent", n.shadowBlur = 0, n.globalCompositeOperation = "destination-out", n.beginPath(), this._tracePath(n, G, i, o, s), n.fill(), n.restore(), A.drawImage(this.shadowBuffer, 0, 0, W, V, -W / 2, -V / 2, W, V);
|
|
5769
5776
|
}
|
|
5770
|
-
if (B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
|
|
5771
|
-
const
|
|
5772
|
-
|
|
5777
|
+
if (A.save(), B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
|
|
5778
|
+
const R = A.globalAlpha, e = this.createCanvasFill(A, B.fill, i, o);
|
|
5779
|
+
e ? A.fillStyle = e : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = R * this.normalizeOpacity(B.fill.opacity ?? 100), this.applyPath(A, G, i, o, s), A.fill(), A.globalAlpha = R;
|
|
5773
5780
|
}
|
|
5774
|
-
A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B, G, i, o);
|
|
5781
|
+
A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B, G, i, o, s);
|
|
5775
5782
|
} else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
|
|
5776
5783
|
const J = g.width ?? Q.width ?? I.width ?? i, R = g.height ?? Q.height ?? I.height ?? o, e = s;
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5784
|
+
A.save();
|
|
5785
|
+
const t = B.shadow;
|
|
5786
|
+
if (t && t.isEnabled !== !1) {
|
|
5787
|
+
const r = t.color || "#000000", T = this.normalizeOpacity(t.opacity ?? 100), W = t.spread || 0, n = (t.blur || 0) + W * 1.5, IA = Math.max(n * 3, Math.abs(t.offsetX || 0) + n, Math.abs(t.offsetY || 0) + n), O = Math.ceil(J + IA * 2), u = Math.ceil(R + IA * 2);
|
|
5788
|
+
this.shadowBuffer || (this.shadowBuffer = document.createElement("canvas")), (this.shadowBuffer.width < O || this.shadowBuffer.height < u) && (this.shadowBuffer.width = Math.max(this.shadowBuffer.width, O), this.shadowBuffer.height = Math.max(this.shadowBuffer.height, u));
|
|
5789
|
+
const l = this.shadowBuffer.getContext("2d", { willReadFrequently: !0 });
|
|
5790
|
+
l.clearRect(0, 0, O, u), l.save(), l.translate(O / 2, u / 2);
|
|
5791
|
+
let $ = r;
|
|
5780
5792
|
if (r.startsWith("#")) {
|
|
5781
|
-
const
|
|
5782
|
-
|
|
5783
|
-
}
|
|
5784
|
-
|
|
5793
|
+
const j = r.replace("#", ""), H = parseInt(j.substring(0, 2), 16), m = parseInt(j.substring(2, 4), 16), Z = parseInt(j.substring(4, 6), 16);
|
|
5794
|
+
$ = `rgba(${H}, ${m}, ${Z}, ${T})`;
|
|
5795
|
+
} else r.startsWith("rgba") && ($ = r.replace(/[\d.]+\)$/g, `${T})`));
|
|
5796
|
+
l.shadowColor = $, l.shadowBlur = n, l.shadowOffsetX = t.offsetX || 0, l.shadowOffsetY = t.offsetY || 0, l.fillStyle = "#000000", l.beginPath(), this.drawRoundRect(l, -J / 2, -R / 2, J, R, e), l.fill(), l.shadowColor = "transparent", l.shadowBlur = 0, l.globalCompositeOperation = "destination-out", l.beginPath(), this.drawRoundRect(l, -J / 2, -R / 2, J, R, e), l.fill(), l.restore(), A.drawImage(this.shadowBuffer, 0, 0, O, u, -O / 2, -u / 2, O, u);
|
|
5785
5797
|
}
|
|
5786
5798
|
if (A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), B.fill && B.fill.type !== "None") {
|
|
5787
|
-
const r = A.globalAlpha,
|
|
5788
|
-
A.fillStyle =
|
|
5799
|
+
const r = A.globalAlpha, T = this.createCanvasFill(A, B.fill, J, R);
|
|
5800
|
+
A.fillStyle = T || B.fill.color || "transparent", A.globalAlpha = r * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = r;
|
|
5789
5801
|
}
|
|
5790
5802
|
if (A.restore(), B.stroke && B.stroke.width > 0 && B.stroke.isEnabled !== !1) {
|
|
5791
5803
|
const r = { type: "Rectangle" };
|
|
@@ -5793,47 +5805,48 @@ class xC {
|
|
|
5793
5805
|
}
|
|
5794
5806
|
(I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), A.clip());
|
|
5795
5807
|
} else I.type === "Component" && I.variant === "inputbox" ? this.renderInputBox(A, I) : I.type === "Component" && I.variant === "button" ? this.renderButton(A, I) : I.type === "Component" && I.variant === "toggle_button" ? this.renderToggleButton(A, I) : I.type === "Toggle" || I.type === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Slider" || I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Dropdown" || I.type === "Component" && I.variant === "dropdown" ? this.renderDropdown(A, I) : (I.type === "ListView" || I.type === "Component" && I.variant === "listview") && this.renderListView(A, I);
|
|
5796
|
-
const
|
|
5808
|
+
const F = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
|
|
5797
5809
|
if (I.children && I.children.length > 0) {
|
|
5798
5810
|
let J = 0;
|
|
5799
5811
|
for (I.children.forEach((R) => {
|
|
5800
5812
|
const e = C.get(R);
|
|
5801
5813
|
if (!e) return;
|
|
5802
|
-
const
|
|
5803
|
-
if (
|
|
5804
|
-
const
|
|
5814
|
+
const t = this.objectStates.get(R), L = (t == null ? void 0 : t.geometry) || e.geometry;
|
|
5815
|
+
if (L && L.isMask && (t == null ? void 0 : t.visible) !== !1) {
|
|
5816
|
+
const r = L.width || 0, T = L.height || 0;
|
|
5805
5817
|
this.applyObjectTransform(A, R);
|
|
5806
|
-
const
|
|
5807
|
-
this.applyPath(A,
|
|
5818
|
+
const W = (t == null ? void 0 : t.corner_radius) ?? (L == null ? void 0 : L.corner_radius) ?? 0;
|
|
5819
|
+
this.applyPath(A, L, r, T, W), A.clip(), J++;
|
|
5808
5820
|
} else
|
|
5809
5821
|
this.renderObject(A, e, C);
|
|
5810
5822
|
}); J > 0; )
|
|
5811
5823
|
A.restore(), J--;
|
|
5812
5824
|
}
|
|
5813
|
-
|
|
5825
|
+
F && A.restore(), A.restore();
|
|
5814
5826
|
}
|
|
5815
5827
|
applyStrokeAlignment(A, I, C, g, Q, B) {
|
|
5816
5828
|
if (!I.stroke || I.stroke.width <= 0 || I.stroke.isEnabled === !1) return;
|
|
5817
|
-
const i =
|
|
5818
|
-
if (A.save(),
|
|
5819
|
-
const k = this.createCanvasFill(A,
|
|
5820
|
-
k ? A.strokeStyle = k : A.strokeStyle =
|
|
5829
|
+
const i = I.stroke, o = i.width, h = (i.alignment || "center").toLowerCase();
|
|
5830
|
+
if (A.save(), i.fill) {
|
|
5831
|
+
const k = this.createCanvasFill(A, i.fill, g, Q);
|
|
5832
|
+
k ? A.strokeStyle = k : A.strokeStyle = i.color || "#000000";
|
|
5821
5833
|
} else
|
|
5822
|
-
A.strokeStyle =
|
|
5823
|
-
|
|
5824
|
-
|
|
5834
|
+
A.strokeStyle = i.color || "#000000";
|
|
5835
|
+
const s = A.globalAlpha;
|
|
5836
|
+
A.globalAlpha = s * this.normalizeOpacity(i.opacity ?? 100), A.lineWidth = o, A.lineCap = i.lineCap || "round", A.lineJoin = i.lineJoin || "round", i.miterLimit !== void 0 && (A.miterLimit = i.miterLimit);
|
|
5837
|
+
const G = i.trimStart ?? 0, w = i.trimEnd ?? 1, a = i.trimOffset ?? 0, N = i.dashOffset ?? 0, S = i.dashArray || [];
|
|
5825
5838
|
if (G !== 0 || w !== 1 || a !== 0) {
|
|
5826
5839
|
const k = this.getPerimeter(C, g, Q);
|
|
5827
5840
|
if (k > 0) {
|
|
5828
|
-
const
|
|
5829
|
-
if (
|
|
5830
|
-
const c = k * (U -
|
|
5831
|
-
A.setLineDash([c,
|
|
5841
|
+
const F = Math.max(0, Math.min(1, G)), U = Math.max(0, Math.min(1, w));
|
|
5842
|
+
if (F < U) {
|
|
5843
|
+
const c = k * (U - F), Y = k - c, J = -(k * (F + a % 1 + N % 1));
|
|
5844
|
+
A.setLineDash([c, Y]), A.lineDashOffset = J;
|
|
5832
5845
|
} else
|
|
5833
5846
|
A.setLineDash([0, k]);
|
|
5834
5847
|
}
|
|
5835
5848
|
} else S.length > 0 && (A.setLineDash(S), A.lineDashOffset = N);
|
|
5836
|
-
h === "inside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.clip(), A.stroke()) : h === "outside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.stroke(), A.save(), A.globalCompositeOperation = "destination-out", this.applyPath(A, C, g, Q, B), A.fill(), A.restore()) : (A.lineWidth = o, this.applyPath(A, C, g, Q, B), A.stroke()), A.restore()
|
|
5849
|
+
h === "inside" ? (A.lineWidth = o * 2, A.save(), this.applyPath(A, C, g, Q, B), A.clip(), A.stroke(), A.restore()) : h === "outside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.stroke(), A.save(), A.globalCompositeOperation = "destination-out", this.applyPath(A, C, g, Q, B), A.fill(), A.restore()) : (A.lineWidth = o, this.applyPath(A, C, g, Q, B), A.stroke()), A.restore();
|
|
5837
5850
|
}
|
|
5838
5851
|
getPerimeter(A, I, C) {
|
|
5839
5852
|
switch (A.type) {
|
|
@@ -5908,8 +5921,8 @@ class xC {
|
|
|
5908
5921
|
if (a === 0)
|
|
5909
5922
|
A.moveTo(w.x - s, w.y - G);
|
|
5910
5923
|
else {
|
|
5911
|
-
const N = I.points[a - 1], S = (N.out_x ?? N.x) - s, k = (N.out_y ?? N.y) - G,
|
|
5912
|
-
A.bezierCurveTo(S, k,
|
|
5924
|
+
const N = I.points[a - 1], S = (N.out_x ?? N.x) - s, k = (N.out_y ?? N.y) - G, F = (w.in_x ?? w.x) - s, U = (w.in_y ?? w.y) - G;
|
|
5925
|
+
A.bezierCurveTo(S, k, F, U, w.x - s, w.y - G);
|
|
5913
5926
|
}
|
|
5914
5927
|
}), I.is_closed && A.closePath();
|
|
5915
5928
|
} else if (I.points && Array.isArray(I.points)) {
|
|
@@ -5935,121 +5948,121 @@ class xC {
|
|
|
5935
5948
|
}
|
|
5936
5949
|
}
|
|
5937
5950
|
renderInputBox(A, I) {
|
|
5938
|
-
var
|
|
5939
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((
|
|
5940
|
-
let c = g.backgroundColor || "rgba(31, 41, 55, 1)",
|
|
5941
|
-
const
|
|
5942
|
-
if (
|
|
5951
|
+
var f, iA;
|
|
5952
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((f = I.geometry) == null ? void 0 : f.width) || 250, B = ((iA = I.geometry) == null ? void 0 : iA.height) || 45, i = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id, h = g.previewState || "default", s = h !== "default" ? h : i ? "focused" : o ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, w = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, S = g.multiline === !0, k = g.corner_radius ?? 8, F = g.corners || { tl: k, tr: k, bl: k, br: k }, U = [F.tl, F.tr, F.br, F.bl];
|
|
5953
|
+
let c = g.backgroundColor || "rgba(31, 41, 55, 1)", Y = g.borderColor || "rgba(55, 65, 81, 1)", J = g.borderWidth ?? 1.5, R = g.color || "#ffffff", e = g.placeholderColor || "rgba(156, 163, 175, 1)", t = g.fontSize || 14;
|
|
5954
|
+
const L = `${s}Style`, r = g[L];
|
|
5955
|
+
if (r ? (r.backgroundColor !== void 0 && (c = r.backgroundColor), r.borderColor !== void 0 && (Y = r.borderColor), r.borderWidth !== void 0 && (J = r.borderWidth), r.color !== void 0 && (R = r.color), r.placeholderColor !== void 0 && (e = r.placeholderColor), r.fontSize !== void 0 && (t = r.fontSize)) : s === "focused" ? (Y = g.focusBorderColor || "rgba(59, 130, 246, 1)", J = Math.max(J, 2)) : s === "hovered" || s === "hover" ? (Y = g.hoverBorderColor || Y, c = g.hoverBackgroundColor || c) : s === "disabled" ? (c = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", Y = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : s === "error" && (Y = "rgba(239, 68, 68, 1)", J = Math.max(J, 2)), A.beginPath(), this.drawRoundRect(A, -Q / 2, -B / 2, Q, B, U), A.fillStyle = c, A.fill(), J > 0 && (A.strokeStyle = Y, A.lineWidth = J, A.stroke(), s === "focused" || s === "focus")) {
|
|
5943
5956
|
A.save(), A.beginPath();
|
|
5944
|
-
const
|
|
5945
|
-
this.drawRoundRect(A, -Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4,
|
|
5957
|
+
const b = U.map((p) => p + 2);
|
|
5958
|
+
this.drawRoundRect(A, -Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, b), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore();
|
|
5946
5959
|
}
|
|
5947
|
-
const
|
|
5948
|
-
if (!
|
|
5949
|
-
const
|
|
5960
|
+
const T = (b, p) => {
|
|
5961
|
+
if (!b.visible || !b.svgPath) return;
|
|
5962
|
+
const X = b.size || 14, P = b.offset ?? 16, aA = b.color || "#ffffff", hA = p ? -(Q / 2) + P : Q / 2 - P, sA = b.svgPath;
|
|
5950
5963
|
if (A.save(), A.translate(hA, 0), !sA.startsWith("<svg")) {
|
|
5951
|
-
const oA = new Path2D(sA), NA =
|
|
5964
|
+
const oA = new Path2D(sA), NA = X / 24;
|
|
5952
5965
|
A.scale(NA, NA), A.translate(-12, -12), A.fillStyle = aA, A.fill(oA);
|
|
5953
5966
|
}
|
|
5954
5967
|
A.restore();
|
|
5955
5968
|
};
|
|
5956
|
-
|
|
5957
|
-
const
|
|
5958
|
-
A.font = `${
|
|
5959
|
-
const
|
|
5960
|
-
if (A.save(), A.beginPath(), A.rect(
|
|
5961
|
-
const
|
|
5969
|
+
T(a, !0), T(N, !1);
|
|
5970
|
+
const W = g.text || "", V = g.placeholder || "Enter text...", n = !W, IA = W || V, O = n ? e : R, u = t, l = g.fontFamily || "Inter", $ = g.fontWeight || 400;
|
|
5971
|
+
A.font = `${$} ${u}px "${l}", sans-serif`, A.fillStyle = O, A.textAlign = "left", A.textBaseline = S ? "top" : "middle";
|
|
5972
|
+
const j = g.inputPadding ?? 16, H = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : j, m = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : j, Z = -(Q / 2) + H, x = Q - H - m, gA = g.inputType === "password" ? "•".repeat(IA.length) : IA;
|
|
5973
|
+
if (A.save(), A.beginPath(), A.rect(Z - 2, -B / 2 + 4, x + 4, B - 8), A.clip(), S) {
|
|
5974
|
+
const b = gA.split(`
|
|
5962
5975
|
`);
|
|
5963
|
-
let
|
|
5964
|
-
const
|
|
5965
|
-
let
|
|
5966
|
-
|
|
5976
|
+
let p = -B / 2 + j;
|
|
5977
|
+
const X = u * 1.2;
|
|
5978
|
+
let P = 0;
|
|
5979
|
+
b.forEach((aA, hA) => {
|
|
5967
5980
|
const sA = aA.split(" ");
|
|
5968
5981
|
let oA = "";
|
|
5969
5982
|
for (let NA = 0; NA < sA.length; NA++) {
|
|
5970
5983
|
const xA = oA + sA[NA] + " ";
|
|
5971
|
-
A.measureText(xA).width >
|
|
5984
|
+
A.measureText(xA).width > x && NA > 0 ? (A.fillText(oA, Z, p), oA = sA[NA] + " ", p += X) : oA = xA;
|
|
5972
5985
|
}
|
|
5973
|
-
A.fillText(oA,
|
|
5974
|
-
}), i && !
|
|
5986
|
+
A.fillText(oA, Z, p), P = A.measureText(oA).width, hA < b.length - 1 && (p += X, P = 0);
|
|
5987
|
+
}), i && !n && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(Z + P, p, 1.5, u);
|
|
5975
5988
|
} else {
|
|
5976
|
-
const
|
|
5977
|
-
let
|
|
5978
|
-
if (
|
|
5979
|
-
const aA =
|
|
5980
|
-
A.fillRect(aA, -(
|
|
5989
|
+
const p = A.measureText(gA).width;
|
|
5990
|
+
let X = 0;
|
|
5991
|
+
if (p > x && (X = p - x), A.fillText(gA, Z - X, 0), i && !n && Math.floor(performance.now() / 500) % 2 === 0) {
|
|
5992
|
+
const aA = Z + p - X;
|
|
5993
|
+
A.fillRect(aA, -(u / 2), 1.5, u);
|
|
5981
5994
|
}
|
|
5982
5995
|
}
|
|
5983
5996
|
if (A.restore(), G.visible !== !1) {
|
|
5984
|
-
const
|
|
5985
|
-
A.font = `600 ${
|
|
5986
|
-
const aA = -(Q / 2), hA = -(B / 2) -
|
|
5987
|
-
A.fillText(
|
|
5997
|
+
const b = G.text || "Label", p = G.fontSize || 12, X = G.color || "rgba(156, 163, 175, 1)", P = G.offset ?? 8;
|
|
5998
|
+
A.font = `600 ${p}px "${l}", sans-serif`, A.fillStyle = X, A.textAlign = "left", A.textBaseline = "bottom";
|
|
5999
|
+
const aA = -(Q / 2), hA = -(B / 2) - P;
|
|
6000
|
+
A.fillText(b, aA, hA);
|
|
5988
6001
|
}
|
|
5989
6002
|
if (w.visible === !0) {
|
|
5990
|
-
const
|
|
5991
|
-
A.font = `400 ${
|
|
5992
|
-
const aA = -(Q / 2), hA = B / 2 +
|
|
5993
|
-
A.fillText(
|
|
6003
|
+
const b = w.text || "Helper text", p = w.fontSize || 11, X = s === "error" ? "rgba(239, 68, 68, 1)" : w.color || "rgba(156, 163, 175, 1)", P = w.offset ?? 6;
|
|
6004
|
+
A.font = `400 ${p}px "${l}", sans-serif`, A.fillStyle = X, A.textAlign = "left", A.textBaseline = "top";
|
|
6005
|
+
const aA = -(Q / 2), hA = B / 2 + P;
|
|
6006
|
+
A.fillText(b, aA, hA);
|
|
5994
6007
|
}
|
|
5995
6008
|
}
|
|
5996
6009
|
renderSlider(A, I) {
|
|
5997
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0, s = (Q.max ?? 100) - o, G = s === 0 ? 0 : (i - o) / s, w = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, N = Q.trackShape ?? "Rectangle", S = Q.trackPath || "", k = Q.activeColor || "#3b82f6",
|
|
5998
|
-
if ((
|
|
6010
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0, s = (Q.max ?? 100) - o, G = s === 0 ? 0 : (i - o) / s, w = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, N = Q.trackShape ?? "Rectangle", S = Q.trackPath || "", k = Q.activeColor || "#3b82f6", F = Q.inactiveColor || "#374151", U = Q.thumbShape || "Ellipse", c = Q.thumbWidth ?? 16, Y = Q.thumbHeight ?? 16, J = Q.thumbRoundedness ?? 0, R = Q.thumbColor || "#ffffff", e = Q.thumbPath || "", t = Q.thumbIcon || "", L = Q.showValueTooltip ?? !1, r = Q.tooltipBgColor || "#333333", T = Q.tooltipColor || "#ffffff", W = Q.tooltipOffsetX ?? 0, V = Q.tooltipOffsetY ?? -25, n = (H, m, Z, x, gA, f, iA) => {
|
|
6011
|
+
if ((H === "Custom" || H === "Icon") && iA)
|
|
5999
6012
|
try {
|
|
6000
|
-
const
|
|
6001
|
-
if (A.save(), A.translate(
|
|
6002
|
-
const
|
|
6003
|
-
A.scale(
|
|
6013
|
+
const b = new Path2D(iA);
|
|
6014
|
+
if (A.save(), A.translate(m, Z), H === "Icon") {
|
|
6015
|
+
const p = Math.min(x, gA) / 24;
|
|
6016
|
+
A.scale(p, p), A.translate(-12, -12);
|
|
6004
6017
|
}
|
|
6005
|
-
A.fill(
|
|
6018
|
+
A.fill(b), A.restore();
|
|
6006
6019
|
return;
|
|
6007
|
-
} catch (
|
|
6008
|
-
console.error("Error drawing slider shape in engine:",
|
|
6020
|
+
} catch (b) {
|
|
6021
|
+
console.error("Error drawing slider shape in engine:", b);
|
|
6009
6022
|
}
|
|
6010
|
-
if (A.beginPath(),
|
|
6011
|
-
A.ellipse(
|
|
6012
|
-
else if (
|
|
6013
|
-
this.drawRoundRect(A,
|
|
6014
|
-
else if (
|
|
6015
|
-
A.moveTo(
|
|
6016
|
-
else if (
|
|
6017
|
-
A.moveTo(
|
|
6018
|
-
else if (
|
|
6019
|
-
const
|
|
6020
|
-
for (let
|
|
6021
|
-
const aA =
|
|
6022
|
-
A.lineTo(
|
|
6023
|
+
if (A.beginPath(), H === "Ellipse")
|
|
6024
|
+
A.ellipse(m, Z, x / 2, gA / 2, 0, 0, Math.PI * 2);
|
|
6025
|
+
else if (H === "Rectangle")
|
|
6026
|
+
this.drawRoundRect(A, m - x / 2, Z - gA / 2, x, gA, f);
|
|
6027
|
+
else if (H === "Triangle")
|
|
6028
|
+
A.moveTo(m, Z - gA / 2), A.lineTo(m + x / 2, Z + gA / 2), A.lineTo(m - x / 2, Z + gA / 2), A.closePath();
|
|
6029
|
+
else if (H === "Diamond")
|
|
6030
|
+
A.moveTo(m, Z - gA / 2), A.lineTo(m + x / 2, Z), A.lineTo(m, Z + gA / 2), A.lineTo(m - x / 2, Z), A.closePath();
|
|
6031
|
+
else if (H === "Star") {
|
|
6032
|
+
const p = Math.min(x, gA) / 2, X = p / 2;
|
|
6033
|
+
for (let P = 0; P < 5 * 2; P++) {
|
|
6034
|
+
const aA = P % 2 === 0 ? p : X, hA = P * Math.PI / 5 - Math.PI / 2;
|
|
6035
|
+
A.lineTo(m + aA * Math.cos(hA), Z + aA * Math.sin(hA));
|
|
6023
6036
|
}
|
|
6024
6037
|
A.closePath();
|
|
6025
|
-
} else
|
|
6038
|
+
} else H === "Line" && (A.moveTo(m - x / 2, Z), A.lineTo(m + x / 2, Z));
|
|
6026
6039
|
A.fill();
|
|
6027
6040
|
};
|
|
6028
|
-
A.fillStyle =
|
|
6029
|
-
const
|
|
6030
|
-
if (
|
|
6031
|
-
A.save(), A.translate(
|
|
6032
|
-
const
|
|
6041
|
+
A.fillStyle = F, N === "Line" ? (A.strokeStyle = F, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : n(N, 0, 0, B, w, a, S);
|
|
6042
|
+
const IA = B - c, O = -B / 2 + c / 2 + G * IA, u = O - -B / 2;
|
|
6043
|
+
if (u > 0 && (A.fillStyle = k, N === "Line" ? (A.strokeStyle = k, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(O, 0), A.stroke()) : N === "Rectangle" && (A.beginPath(), this.drawRoundRect(A, -B / 2, -w / 2, u, w, a), A.fill())), A.save(), A.translate(O, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = R, n(U, 0, 0, c, Y, J, U === "Icon" ? t : e), A.restore(), L) {
|
|
6044
|
+
A.save(), A.translate(O + W, V);
|
|
6045
|
+
const H = Math.round(i).toString();
|
|
6033
6046
|
A.font = "10px Inter, sans-serif";
|
|
6034
|
-
const
|
|
6035
|
-
A.beginPath(), this.drawRoundRect(A, -
|
|
6047
|
+
const m = A.measureText(H), Z = 6, x = 4, gA = m.width + Z * 2, f = 14 + x;
|
|
6048
|
+
A.beginPath(), this.drawRoundRect(A, -gA / 2, -f / 2, gA, f, 4), A.fillStyle = r, A.fill(), A.fillStyle = T, A.textAlign = "center", A.textBaseline = "middle", A.fillText(H, 0, 0), A.restore();
|
|
6036
6049
|
}
|
|
6037
|
-
const
|
|
6038
|
-
if (
|
|
6039
|
-
const
|
|
6040
|
-
A.font = `600 ${
|
|
6041
|
-
const
|
|
6042
|
-
A.fillText(
|
|
6050
|
+
const l = Q.label || {}, $ = Q.helperText || {}, j = Q.fontFamily || "Inter";
|
|
6051
|
+
if (l.visible !== !1) {
|
|
6052
|
+
const H = l.text || "Label", m = l.fontSize || 12, Z = l.color || "rgba(156, 163, 175, 1)", x = l.offset ?? 8;
|
|
6053
|
+
A.font = `600 ${m}px "${j}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "bottom";
|
|
6054
|
+
const gA = -(B / 2), f = -(w / 2) - x;
|
|
6055
|
+
A.fillText(H, gA, f);
|
|
6043
6056
|
}
|
|
6044
|
-
if (
|
|
6045
|
-
const
|
|
6046
|
-
A.font = `400 ${
|
|
6047
|
-
const
|
|
6048
|
-
A.fillText(
|
|
6057
|
+
if ($.visible === !0) {
|
|
6058
|
+
const H = $.text || "Helper text", m = $.fontSize || 11, Z = $.color || "rgba(156, 163, 175, 1)", x = $.offset ?? 6;
|
|
6059
|
+
A.font = `400 ${m}px "${j}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "top";
|
|
6060
|
+
const gA = -(B / 2), f = w / 2 + x;
|
|
6061
|
+
A.fillText(H, gA, f);
|
|
6049
6062
|
}
|
|
6050
6063
|
}
|
|
6051
6064
|
renderDropdown(A, I) {
|
|
6052
|
-
var
|
|
6065
|
+
var V;
|
|
6053
6066
|
const C = this.objectStates.get(I.id);
|
|
6054
6067
|
if (!C) return;
|
|
6055
6068
|
const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, i = -Q / 2, o = -B / 2, h = g.corner_radius ?? 6, s = g.disabled || g.previewState === "disabled", G = this.lastHoveredObjectId === I.id || g.previewState === "hover", w = (g.isOpen || g.previewState === "active") && !s;
|
|
@@ -6057,70 +6070,70 @@ class xC {
|
|
|
6057
6070
|
s ? (a = g.disabledBackgroundColor || "#f3f4f6", N = g.disabledBorderColor || "#e5e7eb", S = g.disabledColor || "#9ca3af") : w ? (a = g.activeBackgroundColor || a, N = g.activeBorderColor || N, S = g.activeColor || S) : G && (a = g.hoverBackgroundColor || a, N = g.hoverBorderColor || N, S = g.hoverColor || S), a || (a = "#ffffff"), N || (N = "#e5e7eb");
|
|
6058
6071
|
const k = A.globalAlpha;
|
|
6059
6072
|
A.globalAlpha = k * (g.opacity ?? 1), this.drawRoundRect(A, i, o, Q, B, h), A.fillStyle = this.createCanvasFill(A, typeof a == "string" ? { type: "Solid", color: a } : a, Q, B) || "#ffffff", A.fill();
|
|
6060
|
-
const
|
|
6061
|
-
|
|
6062
|
-
const U = 12, c = g.chevronType || "chevron",
|
|
6073
|
+
const F = g.borderWidth ?? 1;
|
|
6074
|
+
F > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof N == "string" ? { type: "Solid", color: N } : N, Q, B) || "#e5e7eb", A.lineWidth = F, A.stroke());
|
|
6075
|
+
const U = 12, c = g.chevronType || "chevron", Y = g.chevronSize || 16, J = (w ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
|
|
6063
6076
|
if (c !== "none") {
|
|
6064
|
-
const
|
|
6065
|
-
A.save(), A.translate(
|
|
6066
|
-
const
|
|
6067
|
-
if (A.rotate(
|
|
6068
|
-
A.beginPath(), A.moveTo(-
|
|
6077
|
+
const n = i + Q - U - Y / 2;
|
|
6078
|
+
A.save(), A.translate(n, 0);
|
|
6079
|
+
const IA = w ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
|
|
6080
|
+
if (A.rotate(IA * Math.PI / 180), A.strokeStyle = J, A.fillStyle = J, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", c === "chevron")
|
|
6081
|
+
A.beginPath(), A.moveTo(-Y / 2, -Y * 0.2), A.lineTo(0, Y * 0.2), A.lineTo(Y / 2, -Y * 0.2), A.stroke();
|
|
6069
6082
|
else if (c === "custom" || c === "path") {
|
|
6070
|
-
const
|
|
6071
|
-
if (
|
|
6072
|
-
const
|
|
6083
|
+
const O = w && g.openIconPath || g.closedIconPath;
|
|
6084
|
+
if (O) {
|
|
6085
|
+
const u = new Path2D(O);
|
|
6073
6086
|
A.save();
|
|
6074
|
-
const
|
|
6075
|
-
A.scale(
|
|
6087
|
+
const l = Y / 24;
|
|
6088
|
+
A.scale(l, l), A.translate(-12, -12), A.fill(u), A.restore();
|
|
6076
6089
|
}
|
|
6077
6090
|
}
|
|
6078
6091
|
A.restore();
|
|
6079
6092
|
}
|
|
6080
|
-
const R = g.selectedOption || g.placeholder || "Select...", e = g.fontSize || 14,
|
|
6081
|
-
A.font = `${
|
|
6082
|
-
const
|
|
6083
|
-
A.fillStyle = this.createCanvasFill(A, typeof
|
|
6084
|
-
const
|
|
6085
|
-
if (A.save(), A.beginPath(), A.rect(i + U, o,
|
|
6086
|
-
const
|
|
6093
|
+
const R = g.selectedOption || g.placeholder || "Select...", e = g.fontSize || 14, t = g.fontWeight || 400, L = g.fontFamily || "Inter, sans-serif";
|
|
6094
|
+
A.font = `${t} ${e}px ${L}`;
|
|
6095
|
+
const r = s ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : S;
|
|
6096
|
+
A.fillStyle = this.createCanvasFill(A, typeof r == "string" ? { type: "Solid", color: r } : r, Q, B) || "#333333", A.textAlign = "left", A.textBaseline = "middle";
|
|
6097
|
+
const T = c === "none" ? 0 : Y + 8, W = Q - U * 2 - T;
|
|
6098
|
+
if (A.save(), A.beginPath(), A.rect(i + U, o, W, B), A.clip(), A.fillText(R, i + U, 0), A.restore(), w && !s) {
|
|
6099
|
+
const n = o + B + 4, IA = g.optionsList || [], O = g.itemHeight || 32, u = g.listPadding ?? 4, l = IA.length * O + u * 2, $ = g.listCornerRadius ?? h;
|
|
6087
6100
|
A.save();
|
|
6088
|
-
const
|
|
6089
|
-
A.shadowColor = typeof
|
|
6090
|
-
const
|
|
6091
|
-
|
|
6092
|
-
const
|
|
6093
|
-
A.font = `${
|
|
6094
|
-
const
|
|
6095
|
-
if (
|
|
6096
|
-
A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q,
|
|
6101
|
+
const j = g.listShadow || {};
|
|
6102
|
+
A.shadowColor = typeof j.color == "string" ? j.color : ((V = j.color) == null ? void 0 : V.color) || "rgba(0,0,0,0.15)", A.shadowBlur = j.blur ?? 12, A.shadowOffsetY = j.offsetY ?? 6, A.beginPath(), this.drawRoundRect(A, i, n, Q, l, $), A.fillStyle = this.createCanvasFill(A, typeof g.listBackgroundColor == "string" ? { type: "Solid", color: g.listBackgroundColor } : g.listBackgroundColor || { type: "Solid", color: "#ffffff" }, Q, l) || "#ffffff", A.fill();
|
|
6103
|
+
const H = g.listBorderWidth ?? 1;
|
|
6104
|
+
H > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: N }, Q, l) || "#e5e7eb", A.lineWidth = H, A.stroke()), A.restore();
|
|
6105
|
+
const m = g.itemFontSize || e, Z = g.itemFontFamily || L;
|
|
6106
|
+
A.font = `${t} ${m}px ${Z}`, IA.forEach((x, gA) => {
|
|
6107
|
+
const f = n + u + gA * O;
|
|
6108
|
+
if (x === g.selectedOption)
|
|
6109
|
+
A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, O) || "#f3f4f6", A.fillRect(i + H, f, Q - H * 2, O), A.fillStyle = g.itemSelectedColor || g.activeColor || S || "#374151";
|
|
6097
6110
|
else if (A.fillStyle = g.listTextColor || S || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
|
|
6098
|
-
const
|
|
6099
|
-
|
|
6111
|
+
const b = this._lastPointerPos.y - (n + u), p = Math.floor(b / O);
|
|
6112
|
+
gA === p && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, O) || "#f9fafb", A.fillRect(i + H, f, Q - H * 2, O), A.fillStyle = g.itemHoverColor || S);
|
|
6100
6113
|
}
|
|
6101
|
-
A.fillText(
|
|
6114
|
+
A.fillText(x, i + U, f + O / 2);
|
|
6102
6115
|
});
|
|
6103
6116
|
}
|
|
6104
6117
|
A.globalAlpha = k;
|
|
6105
6118
|
}
|
|
6106
6119
|
renderButton(A, I) {
|
|
6107
|
-
var c,
|
|
6108
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((c = I.geometry) == null ? void 0 : c.width) || 120, B = ((
|
|
6120
|
+
var c, Y, J, R;
|
|
6121
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((c = I.geometry) == null ? void 0 : c.width) || 120, B = ((Y = I.geometry) == null ? void 0 : Y.height) || 40, i = -Q / 2, o = -B / 2, h = this.lastHoveredObjectId === I.id, s = g.corner_radius ?? 8, G = g.bgShape || "Rectangle", w = h ? ((J = g.hoverStyle) == null ? void 0 : J.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, N = h ? ((R = g.hoverStyle) == null ? void 0 : R.textColor) || a.color || "#ffffff" : a.color || "#ffffff", S = g.icon || { enabled: !1 };
|
|
6109
6122
|
A.save(), A.beginPath(), G === "Rectangle" ? this.drawRoundRect(A, i, o, Q, B, s) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : G === "Pill" && this.drawRoundRect(A, i, o, Q, B, B / 2), A.fillStyle = w, A.fill();
|
|
6110
|
-
const k = a.fontSize || 14,
|
|
6111
|
-
A.font = `${a.fontWeight || 400} ${k}px "${
|
|
6123
|
+
const k = a.fontSize || 14, F = a.fontFamily || "Inter";
|
|
6124
|
+
A.font = `${a.fontWeight || 400} ${k}px "${F}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
|
|
6112
6125
|
let U = 0;
|
|
6113
6126
|
if (S.enabled && S.svgPath) {
|
|
6114
|
-
const e = S.size || 16,
|
|
6115
|
-
A.save(), A.translate(
|
|
6116
|
-
const
|
|
6117
|
-
A.scale(
|
|
6127
|
+
const e = S.size || 16, t = S.gap || 8, L = S.position === "left" ? -(A.measureText(a.text || "").width / 2 + e / 2 + t / 2) : A.measureText(a.text || "").width / 2 + e / 2 + t / 2;
|
|
6128
|
+
A.save(), A.translate(L, 0);
|
|
6129
|
+
const r = new Path2D(S.svgPath), T = e / 24;
|
|
6130
|
+
A.scale(T, T), A.translate(-12, -12), A.fillStyle = S.color || N, A.fill(r), A.restore(), U = S.position === "left" ? e / 2 + t / 2 : -(e / 2 + t / 2);
|
|
6118
6131
|
}
|
|
6119
6132
|
A.fillText(a.text || "Button", U, 0), A.restore();
|
|
6120
6133
|
}
|
|
6121
6134
|
renderToggleButton(A, I) {
|
|
6122
|
-
var k,
|
|
6123
|
-
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((k = I.geometry) == null ? void 0 : k.width) || 120, i = ((
|
|
6135
|
+
var k, F;
|
|
6136
|
+
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((k = I.geometry) == null ? void 0 : k.width) || 120, i = ((F = I.geometry) == null ? void 0 : F.height) || 40, o = -B / 2, h = -i / 2, s = g.corner_radius ?? 8, G = g.label || {}, w = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
|
|
6124
6137
|
A.save(), A.beginPath(), this.drawRoundRect(A, o, h, B, i, s), A.fillStyle = w, A.fill();
|
|
6125
6138
|
const N = G.fontSize || 14, S = G.fontFamily || "Inter";
|
|
6126
6139
|
A.font = `${G.fontWeight || 600} ${N}px "${S}", sans-serif`, A.fillStyle = a, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
|
|
@@ -6129,13 +6142,13 @@ class xC {
|
|
|
6129
6142
|
var U, c;
|
|
6130
6143
|
const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((U = I.geometry) == null ? void 0 : U.width) || 52, B = ((c = I.geometry) == null ? void 0 : c.height) || 30, i = -Q / 2, o = -B / 2, h = g.checked ?? !1, s = g.corner_radius ?? B / 2;
|
|
6131
6144
|
A.beginPath(), this.drawRoundRect(A, i, o, Q, B, s), A.fillStyle = h ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
|
|
6132
|
-
const G = 3, w = B - G * 2, a = w / 2, N = i + G, S = i + Q - G - w, k = h ? S : N,
|
|
6133
|
-
if (A.beginPath(), A.arc(k + a,
|
|
6134
|
-
const
|
|
6135
|
-
A.font = `${R} ${J}px "${e}", sans-serif`, A.fillStyle =
|
|
6136
|
-
const
|
|
6137
|
-
let
|
|
6138
|
-
|
|
6145
|
+
const G = 3, w = B - G * 2, a = w / 2, N = i + G, S = i + Q - G - w, k = h ? S : N, F = o + G;
|
|
6146
|
+
if (A.beginPath(), A.arc(k + a, F + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
|
|
6147
|
+
const Y = g.label, J = Y.fontSize || 14, R = Y.fontWeight || 400, e = Y.fontFamily || "Inter";
|
|
6148
|
+
A.font = `${R} ${J}px "${e}", sans-serif`, A.fillStyle = Y.color || "#f3f4f6", A.textBaseline = "middle";
|
|
6149
|
+
const t = Y.gap || 10;
|
|
6150
|
+
let L = 0, r = 0;
|
|
6151
|
+
Y.position === "left" ? (A.textAlign = "right", L = i - t, r = 0) : Y.position === "right" ? (A.textAlign = "left", L = i + Q + t, r = 0) : Y.position === "top" ? (A.textAlign = "center", L = 0, r = o - t, A.textBaseline = "bottom") : Y.position === "bottom" ? (A.textAlign = "center", L = 0, r = o + B + t, A.textBaseline = "top") : (A.textAlign = "left", L = i + Q + t, r = 0), A.fillText(Y.text, L, r);
|
|
6139
6152
|
}
|
|
6140
6153
|
}
|
|
6141
6154
|
renderLineGraph(A, I, C, g) {
|
|
@@ -6162,16 +6175,16 @@ class xC {
|
|
|
6162
6175
|
if (Q.forEach((S) => {
|
|
6163
6176
|
let k = S.data;
|
|
6164
6177
|
if (S.isVarEnabled && S.inputId) {
|
|
6165
|
-
let
|
|
6166
|
-
if (
|
|
6178
|
+
let F = this.inputs.get(S.inputId);
|
|
6179
|
+
if (F === void 0) {
|
|
6167
6180
|
const U = this.inputNameMap.get(S.inputId);
|
|
6168
|
-
U && U.length > 0 && (
|
|
6181
|
+
U && U.length > 0 && (F = this.inputs.get(U[0]));
|
|
6169
6182
|
}
|
|
6170
|
-
|
|
6183
|
+
F && Array.isArray(F) && (k = F);
|
|
6171
6184
|
}
|
|
6172
6185
|
if (k && k.length > 0) {
|
|
6173
|
-
const
|
|
6174
|
-
|
|
6186
|
+
const F = k.filter((U) => typeof U == "number" && !isNaN(U));
|
|
6187
|
+
F.length > 0 && (B = Math.min(B, ...F), i = Math.max(i, ...F), o = Math.max(o, k.length));
|
|
6175
6188
|
}
|
|
6176
6189
|
S._resolvedData = k;
|
|
6177
6190
|
}), o < 2) return;
|
|
@@ -6198,40 +6211,40 @@ class xC {
|
|
|
6198
6211
|
if (S.showArea) {
|
|
6199
6212
|
if (A.beginPath(), A.moveTo(w(0), g / 2), A.lineTo(w(0), G(k[0])), S.smoothing && k.length > 2)
|
|
6200
6213
|
for (let U = 0; U < k.length - 1; U++) {
|
|
6201
|
-
const c = k[U === 0 ? U : U - 1],
|
|
6214
|
+
const c = k[U === 0 ? U : U - 1], Y = k[U], J = k[U + 1], R = k[U + 1 === k.length - 1 ? U + 1 : U + 2];
|
|
6202
6215
|
for (let e = 1; e <= N; e++) {
|
|
6203
|
-
const
|
|
6204
|
-
A.lineTo(w(U +
|
|
6216
|
+
const t = e / N, L = this._catmullRom(c, Y, J, R, t);
|
|
6217
|
+
A.lineTo(w(U + t), G(L));
|
|
6205
6218
|
}
|
|
6206
6219
|
}
|
|
6207
6220
|
else
|
|
6208
6221
|
for (let U = 1; U < k.length; U++)
|
|
6209
6222
|
A.lineTo(w(U), G(k[U]));
|
|
6210
6223
|
A.lineTo(w(k.length - 1), g / 2), A.closePath();
|
|
6211
|
-
const
|
|
6212
|
-
A.globalAlpha =
|
|
6224
|
+
const F = A.globalAlpha;
|
|
6225
|
+
A.globalAlpha = F * (I.areaOpacity ?? 0.3), A.fillStyle = S.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = F;
|
|
6213
6226
|
}
|
|
6214
6227
|
if (A.beginPath(), A.strokeStyle = S.lineColor || "#3b82f6", A.lineWidth = S.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(w(0), G(k[0])), S.smoothing && k.length > 2)
|
|
6215
|
-
for (let
|
|
6216
|
-
const U = k[
|
|
6228
|
+
for (let F = 0; F < k.length - 1; F++) {
|
|
6229
|
+
const U = k[F === 0 ? F : F - 1], c = k[F], Y = k[F + 1], J = k[F + 1 === k.length - 1 ? F + 1 : F + 2];
|
|
6217
6230
|
for (let R = 1; R <= N; R++) {
|
|
6218
|
-
const e = R / N,
|
|
6219
|
-
A.lineTo(w(
|
|
6231
|
+
const e = R / N, t = this._catmullRom(U, c, Y, J, e);
|
|
6232
|
+
A.lineTo(w(F + e), G(t));
|
|
6220
6233
|
}
|
|
6221
6234
|
}
|
|
6222
6235
|
else
|
|
6223
|
-
for (let
|
|
6224
|
-
A.lineTo(w(
|
|
6225
|
-
A.stroke(), S.showPoints && k.forEach((
|
|
6226
|
-
const c = w(U),
|
|
6227
|
-
A.beginPath(), A.arc(c,
|
|
6236
|
+
for (let F = 1; F < k.length; F++)
|
|
6237
|
+
A.lineTo(w(F), G(k[F]));
|
|
6238
|
+
A.stroke(), S.showPoints && k.forEach((F, U) => {
|
|
6239
|
+
const c = w(U), Y = G(F);
|
|
6240
|
+
A.beginPath(), A.arc(c, Y, (S.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = S.pointFill || "#ffffff", A.fill(), A.strokeStyle = S.pointStrokeColor || S.lineColor || "#3b82f6", A.lineWidth = S.pointStrokeWidth || 1, A.stroke();
|
|
6228
6241
|
});
|
|
6229
6242
|
}
|
|
6230
6243
|
}), I.showLegend && Q.length > 0) {
|
|
6231
6244
|
const S = C / 2 - 10;
|
|
6232
6245
|
let k = -g / 2 + 15;
|
|
6233
|
-
const
|
|
6234
|
-
A.font = `${
|
|
6246
|
+
const F = I.legendFontSize || 10, U = F + 5;
|
|
6247
|
+
A.font = `${F}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((c) => {
|
|
6235
6248
|
const J = c.label || "Series", R = A.measureText(J).width;
|
|
6236
6249
|
A.beginPath(), A.rect(S - R - 8 - 5, k - (8 / 2 + 2), 8, 8), A.fillStyle = c.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(J, S, k), k += U;
|
|
6237
6250
|
});
|
|
@@ -6252,11 +6265,11 @@ class xC {
|
|
|
6252
6265
|
return I.color;
|
|
6253
6266
|
if ((I.type === "LinearGradient" || I.type === "RadialGradient" || I.type === "AngularGradient" || I.type === "DiamondGradient") && I.stops) {
|
|
6254
6267
|
const B = (i, o = 100) => {
|
|
6255
|
-
var
|
|
6256
|
-
const s = (((
|
|
6257
|
-
if (
|
|
6258
|
-
const
|
|
6259
|
-
return `rgba(${
|
|
6268
|
+
var U, c;
|
|
6269
|
+
const s = (((c = (U = this.artboard) == null ? void 0 : U.tokens) == null ? void 0 : c.colors) || {})[i] || i, G = this.normalizeOpacity(I.opacity ?? 100), a = this.normalizeOpacity(o) * G;
|
|
6270
|
+
if (a >= 1 && s.startsWith("#")) return s;
|
|
6271
|
+
const N = s.startsWith("#") ? s.replace("#", "") : "ffffff", S = parseInt(N.substring(0, 2), 16), k = parseInt(N.substring(2, 4), 16), F = parseInt(N.substring(4, 6), 16);
|
|
6272
|
+
return `rgba(${S}, ${k}, ${F}, ${a})`;
|
|
6260
6273
|
};
|
|
6261
6274
|
if (I.type === "LinearGradient") {
|
|
6262
6275
|
const i = (a, N, S) => Array.isArray(a) ? a[N] ?? (N === 0 ? 0 : 1) : a && typeof a == "object" ? a[S] ?? (N === 0 ? 0 : 1) : N === 0 ? 0 : 1, o = i(I.start, 0, "x") * C - C / 2, h = i(I.start, 1, "y") * g - g / 2, s = i(I.end, 0, "x") * C - C / 2, G = i(I.end, 1, "y") * g - g / 2, w = A.createLinearGradient(o, h, s, G);
|
|
@@ -6264,8 +6277,8 @@ class xC {
|
|
|
6264
6277
|
const N = a.offset !== void 0 ? a.offset : a.pos !== void 0 ? a.pos : a.position !== void 0 ? a.position : 0, S = B(a.color || "#000000", a.opacity ?? 100);
|
|
6265
6278
|
w.addColorStop(Math.max(0, Math.min(1, N)), S);
|
|
6266
6279
|
}), I.gradientTransform && w.setTransform) {
|
|
6267
|
-
const [a, N, S, k,
|
|
6268
|
-
w.setTransform({ a, b: N, c: S, d: k, e:
|
|
6280
|
+
const [a, N, S, k, F, U] = I.gradientTransform;
|
|
6281
|
+
w.setTransform({ a, b: N, c: S, d: k, e: F, f: U });
|
|
6269
6282
|
}
|
|
6270
6283
|
return w;
|
|
6271
6284
|
} else if (I.type === "RadialGradient") {
|
|
@@ -6274,8 +6287,8 @@ class xC {
|
|
|
6274
6287
|
const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
|
|
6275
6288
|
G.addColorStop(Math.max(0, Math.min(1, a)), N);
|
|
6276
6289
|
}), I.gradientTransform && G.setTransform) {
|
|
6277
|
-
const [w, a, N, S, k,
|
|
6278
|
-
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f:
|
|
6290
|
+
const [w, a, N, S, k, F] = I.gradientTransform;
|
|
6291
|
+
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: F });
|
|
6279
6292
|
}
|
|
6280
6293
|
return G;
|
|
6281
6294
|
} else if (I.type === "AngularGradient") {
|
|
@@ -6285,21 +6298,23 @@ class xC {
|
|
|
6285
6298
|
const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
|
|
6286
6299
|
G.addColorStop(Math.max(0, Math.min(1, a)), N);
|
|
6287
6300
|
}), I.gradientTransform && G.setTransform) {
|
|
6288
|
-
const [w, a, N, S, k,
|
|
6289
|
-
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f:
|
|
6301
|
+
const [w, a, N, S, k, F] = I.gradientTransform;
|
|
6302
|
+
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: F });
|
|
6290
6303
|
}
|
|
6291
6304
|
return G;
|
|
6292
6305
|
}
|
|
6293
6306
|
} else if (I.type === "DiamondGradient") {
|
|
6294
|
-
const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g)
|
|
6307
|
+
const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g);
|
|
6308
|
+
A.save(), A.translate(o, h), A.rotate(Math.PI / 4);
|
|
6309
|
+
const G = A.createRadialGradient(0, 0, 0, 0, 0, s);
|
|
6295
6310
|
if (I.stops.forEach((w) => {
|
|
6296
6311
|
const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
|
|
6297
6312
|
G.addColorStop(Math.max(0, Math.min(1, a)), N);
|
|
6298
6313
|
}), I.gradientTransform && G.setTransform) {
|
|
6299
|
-
const [w, a, N, S, k,
|
|
6300
|
-
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f:
|
|
6314
|
+
const [w, a, N, S, k, F] = I.gradientTransform;
|
|
6315
|
+
G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: F });
|
|
6301
6316
|
}
|
|
6302
|
-
return G;
|
|
6317
|
+
return A.scale(1 / Math.SQRT2, 1 / Math.SQRT2), A.fillStyle = G, A.restore(), G;
|
|
6303
6318
|
}
|
|
6304
6319
|
}
|
|
6305
6320
|
if (I.type === "Pattern" && I.url) {
|
|
@@ -6337,58 +6352,58 @@ class xC {
|
|
|
6337
6352
|
A.moveTo(I + o, C), A.lineTo(I + g - h, C), A.arcTo(I + g, C, I + g, C + h, h), A.lineTo(I + g, C + Q - s), A.arcTo(I + g, C + Q, I + g - s, C + Q, s), A.lineTo(I + G, C + Q), A.arcTo(I, C + Q, I, C + Q - G, G), A.lineTo(I, C + o), A.arcTo(I, C, I + o, C, o), A.closePath();
|
|
6338
6353
|
}
|
|
6339
6354
|
renderListView(A, I) {
|
|
6340
|
-
var
|
|
6341
|
-
const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((
|
|
6342
|
-
if (A.save(), A.globalAlpha *=
|
|
6343
|
-
const
|
|
6344
|
-
A.fillStyle =
|
|
6345
|
-
const
|
|
6346
|
-
|
|
6355
|
+
var n, IA, O, u;
|
|
6356
|
+
const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((n = I.geometry) == null ? void 0 : n.width) || 200, B = C.height !== void 0 ? C.height : ((IA = I.geometry) == null ? void 0 : IA.height) || 300, i = -Q / 2, o = -B / 2, h = C.corner_radius !== void 0 ? C.corner_radius : g.corner_radius ?? 0, s = g.orientation || "vertical", G = g.items || [], w = g.itemGap ?? 10, a = g.itemHeight ?? 50, N = g.itemWidth ?? 200, S = g.scrollOffset ?? 0, k = g.padding ?? 0, F = g.glassEffect !== !1, U = g.accentColor || "#3b82f6", c = g.itemTextColor || "#333333", Y = g.itemBackgroundColor || "#ffffff", J = g.hoveredIndex ?? null, R = g.activeItemIndex ?? null, e = g.glowIntensity ?? 0, t = g.glowColor || "#3b82f6", L = typeof t == "string" ? t : t.color || ((u = (O = t.stops) == null ? void 0 : O[0]) == null ? void 0 : u.color) || "#3b82f6", r = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
|
|
6357
|
+
if (A.save(), A.globalAlpha *= r, e > 0 && (A.shadowColor = L, A.shadowBlur = e * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), F) {
|
|
6358
|
+
const l = g.listBackgroundColor || "rgba(31, 41, 55, 0.4)", $ = this.createCanvasFill(A, l, Q, B);
|
|
6359
|
+
A.fillStyle = $ || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, i, o, Q, B, h), A.fill();
|
|
6360
|
+
const j = A.createLinearGradient(i, o, i + Q, o + B);
|
|
6361
|
+
j.addColorStop(0, "rgba(255, 255, 255, 0.15)"), j.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), j.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = j, this.drawListViewRect(A, i, o, Q, B, h), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, i, o, Q, B, h), A.stroke();
|
|
6347
6362
|
} else {
|
|
6348
|
-
const
|
|
6349
|
-
|
|
6350
|
-
const
|
|
6351
|
-
|
|
6363
|
+
const l = g.listBackgroundColor || "transparent", $ = this.createCanvasFill(A, l, Q, B);
|
|
6364
|
+
$ && (A.fillStyle = $, this.drawListViewRect(A, i, o, Q, B, h), A.fill());
|
|
6365
|
+
const j = g.borderWidth ?? 0;
|
|
6366
|
+
j > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = j, this.drawListViewRect(A, i, o, Q, B, h), A.stroke());
|
|
6352
6367
|
}
|
|
6353
6368
|
A.shadowBlur = 0, A.save(), this.drawListViewRect(A, i, o, Q, B, h), A.clip();
|
|
6354
|
-
const
|
|
6355
|
-
let
|
|
6356
|
-
if (A.textBaseline = "middle", G.forEach((
|
|
6357
|
-
const
|
|
6358
|
-
if (
|
|
6359
|
-
const
|
|
6360
|
-
A.fillStyle =
|
|
6361
|
-
const
|
|
6362
|
-
A.globalAlpha =
|
|
6363
|
-
} else if (
|
|
6364
|
-
A.fillStyle =
|
|
6365
|
-
else if (
|
|
6366
|
-
const
|
|
6367
|
-
A.fillStyle =
|
|
6369
|
+
const T = typeof k == "number" ? k : s === "vertical" ? k[0] : k[3];
|
|
6370
|
+
let W = (s === "vertical" ? o : i) + S + T;
|
|
6371
|
+
if (A.textBaseline = "middle", G.forEach((l, $) => {
|
|
6372
|
+
const j = s === "vertical" ? Q : N, H = s === "vertical" ? a : B, m = s === "vertical" ? i : W, Z = s === "vertical" ? W : o, x = J === $, gA = R === $;
|
|
6373
|
+
if (gA) {
|
|
6374
|
+
const X = this.createCanvasFill(A, U, j, H);
|
|
6375
|
+
A.fillStyle = X || U;
|
|
6376
|
+
const P = A.globalAlpha;
|
|
6377
|
+
A.globalAlpha = P * 0.8, A.fillRect(m, Z, j, H), A.globalAlpha = P;
|
|
6378
|
+
} else if (x)
|
|
6379
|
+
A.fillStyle = F ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(m, Z, j, H);
|
|
6380
|
+
else if (Y !== "transparent") {
|
|
6381
|
+
const X = this.createCanvasFill(A, Y, j, H);
|
|
6382
|
+
A.fillStyle = X || Y, A.fillRect(m, Z, j, H);
|
|
6368
6383
|
}
|
|
6369
|
-
if (
|
|
6370
|
-
const
|
|
6371
|
-
A.fillStyle =
|
|
6384
|
+
if (gA || x) {
|
|
6385
|
+
const X = this.createCanvasFill(A, U, s === "vertical" ? 3 : j, s === "vertical" ? H : 3);
|
|
6386
|
+
A.fillStyle = X || U, s === "vertical" ? A.fillRect(m, Z, 3, H) : A.fillRect(m, Z + H - 3, j, 3);
|
|
6372
6387
|
}
|
|
6373
|
-
const
|
|
6374
|
-
A.fillStyle =
|
|
6375
|
-
const iA = typeof
|
|
6376
|
-
s === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(iA,
|
|
6388
|
+
const f = gA ? "#ffffff" : F ? "rgba(255, 255, 255, 0.9)" : c;
|
|
6389
|
+
A.fillStyle = f, A.font = gA || x ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
|
|
6390
|
+
const iA = typeof l == "string" ? l : (l == null ? void 0 : l.label) || `Item ${$ + 1}`, b = m + (s === "vertical" ? 16 : j / 2), p = Z + H / 2;
|
|
6391
|
+
s === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(iA, b, p), W += (s === "vertical" ? a : N) + w;
|
|
6377
6392
|
}), A.restore(), g.showScrollbar !== !1) {
|
|
6378
|
-
const
|
|
6379
|
-
if (
|
|
6380
|
-
const
|
|
6381
|
-
A.fillStyle =
|
|
6393
|
+
const l = (G.length || 0) * (s === "vertical" ? a : N) + ((G.length || 0) - 1) * w, $ = s === "vertical" ? B : Q;
|
|
6394
|
+
if (l > $) {
|
|
6395
|
+
const j = $ / l, H = $ * j, m = -S / l * $, Z = g.scrollbarColor || "rgba(255,255,255,0.3)", x = g.scrollbarWidth || 4;
|
|
6396
|
+
A.fillStyle = Z, s === "vertical" ? A.fillRect(i + Q - x - 2, o + m, x, H) : A.fillRect(i + m, o + B - x - 2, H, x);
|
|
6382
6397
|
}
|
|
6383
6398
|
}
|
|
6384
6399
|
A.restore();
|
|
6385
6400
|
}
|
|
6386
6401
|
updateListViewScrollFromPointer(A) {
|
|
6387
|
-
var k,
|
|
6402
|
+
var k, F;
|
|
6388
6403
|
if (!this._lastPointerPos || !this._prevPointerPos) return;
|
|
6389
6404
|
const I = A.options || {}, C = I.orientation || "vertical", g = this._lastPointerPos.x - this._prevPointerPos.x, Q = this._lastPointerPos.y - this._prevPointerPos.y;
|
|
6390
6405
|
C === "vertical" ? I.scrollOffset = (I.scrollOffset || 0) + Q : I.scrollOffset = (I.scrollOffset || 0) + g;
|
|
6391
|
-
const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10, h = I.itemHeight ?? 50, s = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((k = A.geometry) == null ? void 0 : k.width) || 200, w = B.height !== void 0 ? B.height : ((
|
|
6406
|
+
const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10, h = I.itemHeight ?? 50, s = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((k = A.geometry) == null ? void 0 : k.width) || 200, w = B.height !== void 0 ? B.height : ((F = A.geometry) == null ? void 0 : F.height) || 300, a = (i.length || 0) * (C === "vertical" ? h : s) + ((i.length || 0) - 1) * o, S = Math.max(0, a - (C === "vertical" ? w : G) + (I.padding * 2 || 0));
|
|
6392
6407
|
I.scrollOffset > 0 && (I.scrollOffset = 0), I.scrollOffset < -S && (I.scrollOffset = -S);
|
|
6393
6408
|
}
|
|
6394
6409
|
updateListViewHoverFromPointer(A, I, C) {
|
|
@@ -6396,16 +6411,16 @@ class xC {
|
|
|
6396
6411
|
Q.hoveredIndex !== g && (Q.hoveredIndex = g);
|
|
6397
6412
|
}
|
|
6398
6413
|
getListViewItemIndexAtPointer(A, I, C) {
|
|
6399
|
-
var
|
|
6414
|
+
var T, W;
|
|
6400
6415
|
const g = A.options || {}, Q = this.objectStates.get(A.id) || {}, B = g.items || [];
|
|
6401
6416
|
if (B.length === 0) return null;
|
|
6402
|
-
const i = Q.width !== void 0 ? Q.width : ((
|
|
6403
|
-
let
|
|
6404
|
-
for (let
|
|
6405
|
-
const
|
|
6406
|
-
if (J >=
|
|
6407
|
-
return
|
|
6408
|
-
|
|
6417
|
+
const i = Q.width !== void 0 ? Q.width : ((T = A.geometry) == null ? void 0 : T.width) || 200, o = Q.height !== void 0 ? Q.height : ((W = A.geometry) == null ? void 0 : W.height) || 300, h = g.orientation || "vertical", s = g.itemGap ?? 10, G = g.itemHeight ?? 50, w = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, N = g.padding ?? 0, S = this.getWorldTransform(A.id), k = I - S.x, F = C - S.y, U = -S.rotation * (Math.PI / 180), c = Math.cos(U), Y = Math.sin(U), J = k * c - F * Y, R = k * Y + F * c, e = -i / 2, t = -o / 2, L = typeof N == "number" ? N : h === "vertical" ? N[0] : N[3];
|
|
6418
|
+
let r = (h === "vertical" ? t : e) + a + L;
|
|
6419
|
+
for (let V = 0; V < B.length; V++) {
|
|
6420
|
+
const n = h === "vertical" ? i : w, IA = h === "vertical" ? G : o, O = h === "vertical" ? e : r, u = h === "vertical" ? r : t;
|
|
6421
|
+
if (J >= O && J <= O + n && R >= u && R <= u + IA)
|
|
6422
|
+
return V;
|
|
6423
|
+
r += (h === "vertical" ? G : w) + s;
|
|
6409
6424
|
}
|
|
6410
6425
|
return null;
|
|
6411
6426
|
}
|
|
@@ -6431,55 +6446,55 @@ const PC = RC(
|
|
|
6431
6446
|
onInputFocus: a,
|
|
6432
6447
|
onInputBlur: N
|
|
6433
6448
|
}, S) => {
|
|
6434
|
-
const k = wI(null),
|
|
6449
|
+
const k = wI(null), F = wI(new xC()), U = wI(), c = wI(0);
|
|
6435
6450
|
tC(S, () => k.current), eA(() => {
|
|
6436
|
-
console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"),
|
|
6451
|
+
console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), F.current.setLayout(Q, B);
|
|
6437
6452
|
}, [Q, B]), eA(() => {
|
|
6438
|
-
o &&
|
|
6453
|
+
o && F.current.setTriggerCallback(o);
|
|
6439
6454
|
}, [o]), eA(() => {
|
|
6440
|
-
h &&
|
|
6455
|
+
h && F.current.setInputUpdateCallback(h);
|
|
6441
6456
|
}, [h]), eA(() => {
|
|
6442
|
-
s &&
|
|
6457
|
+
s && F.current.setComponentChangeCallback(s);
|
|
6443
6458
|
}, [s]), eA(() => {
|
|
6444
|
-
G &&
|
|
6459
|
+
G && F.current.setToggleCallback(G);
|
|
6445
6460
|
}, [G]), eA(() => {
|
|
6446
|
-
w &&
|
|
6461
|
+
w && F.current.setInputChangeCallback(w);
|
|
6447
6462
|
}, [w]), eA(() => {
|
|
6448
|
-
a &&
|
|
6463
|
+
a && F.current.setInputFocusCallback(a);
|
|
6449
6464
|
}, [a]), eA(() => {
|
|
6450
|
-
N &&
|
|
6465
|
+
N && F.current.setInputBlurCallback(N);
|
|
6451
6466
|
}, [N]), eA(() => {
|
|
6452
6467
|
(async () => {
|
|
6453
|
-
const R =
|
|
6468
|
+
const R = F.current;
|
|
6454
6469
|
let e = D;
|
|
6455
6470
|
if (!e && A)
|
|
6456
6471
|
try {
|
|
6457
6472
|
e = await (await fetch(A)).json();
|
|
6458
|
-
} catch (
|
|
6459
|
-
console.error("Failed to load ExodeUI animation:",
|
|
6473
|
+
} catch (t) {
|
|
6474
|
+
console.error("Failed to load ExodeUI animation:", t);
|
|
6460
6475
|
return;
|
|
6461
6476
|
}
|
|
6462
6477
|
e && (R.load(e), i && i(R));
|
|
6463
6478
|
})();
|
|
6464
6479
|
}, [D, A]), eA(() => {
|
|
6465
|
-
const J =
|
|
6480
|
+
const J = F.current, R = k.current;
|
|
6466
6481
|
if (!R) return;
|
|
6467
6482
|
const e = R.getContext("2d");
|
|
6468
6483
|
if (!e) return;
|
|
6469
|
-
const
|
|
6470
|
-
c.current || (c.current =
|
|
6471
|
-
const
|
|
6472
|
-
c.current =
|
|
6473
|
-
const
|
|
6474
|
-
(R.width !==
|
|
6484
|
+
const t = (L) => {
|
|
6485
|
+
c.current || (c.current = L);
|
|
6486
|
+
const r = (L - c.current) / 1e3;
|
|
6487
|
+
c.current = L, g && J.advance(r);
|
|
6488
|
+
const T = window.devicePixelRatio || 1, W = R.getBoundingClientRect(), V = Math.floor(W.width * T), n = Math.floor(W.height * T);
|
|
6489
|
+
(R.width !== V || R.height !== n) && (R.width = V, R.height = n), J.render(e, V, n), U.current = requestAnimationFrame(t);
|
|
6475
6490
|
};
|
|
6476
|
-
return U.current = requestAnimationFrame(
|
|
6491
|
+
return U.current = requestAnimationFrame(t), () => {
|
|
6477
6492
|
U.current && cancelAnimationFrame(U.current);
|
|
6478
6493
|
};
|
|
6479
6494
|
}, [g]);
|
|
6480
|
-
const
|
|
6481
|
-
const e = J.currentTarget.getBoundingClientRect(),
|
|
6482
|
-
|
|
6495
|
+
const Y = (J, R) => {
|
|
6496
|
+
const e = J.currentTarget.getBoundingClientRect(), t = J.clientX - e.left, L = J.clientY - e.top, r = e.width, T = e.height;
|
|
6497
|
+
F.current.handlePointerInput(R, t, L, r, T);
|
|
6483
6498
|
};
|
|
6484
6499
|
return /* @__PURE__ */ UC(
|
|
6485
6500
|
"canvas",
|
|
@@ -6490,14 +6505,14 @@ const PC = RC(
|
|
|
6490
6505
|
tabIndex: 0,
|
|
6491
6506
|
onPointerDown: (J) => {
|
|
6492
6507
|
var R;
|
|
6493
|
-
|
|
6508
|
+
Y(J, "down"), (R = k.current) == null || R.focus();
|
|
6494
6509
|
},
|
|
6495
|
-
onPointerUp: (J) =>
|
|
6496
|
-
onPointerMove: (J) =>
|
|
6497
|
-
onPointerLeave: (J) =>
|
|
6498
|
-
onClick: (J) =>
|
|
6510
|
+
onPointerUp: (J) => Y(J, "up"),
|
|
6511
|
+
onPointerMove: (J) => Y(J, "move"),
|
|
6512
|
+
onPointerLeave: (J) => Y(J, "blur"),
|
|
6513
|
+
onClick: (J) => Y(J, "click"),
|
|
6499
6514
|
onKeyDown: (J) => {
|
|
6500
|
-
J.key === "Backspace" || J.key === "Enter" || J.key,
|
|
6515
|
+
J.key === "Backspace" || J.key === "Enter" || J.key, F.current.handleKeyDown(J.nativeEvent);
|
|
6501
6516
|
}
|
|
6502
6517
|
}
|
|
6503
6518
|
);
|