react-two.js 0.2.4 → 0.8.22-r.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -3
- package/dist/ArcSegment.d.ts +3 -2
- package/dist/Circle.d.ts +3 -2
- package/dist/Context.d.ts +8 -8
- package/dist/Ellipse.d.ts +3 -2
- package/dist/Events.d.ts +97 -0
- package/dist/Group.d.ts +2 -1
- package/dist/Image.d.ts +4 -2
- package/dist/ImageSequence.d.ts +4 -3
- package/dist/Line.d.ts +3 -2
- package/dist/Path.d.ts +3 -3
- package/dist/Points.d.ts +3 -2
- package/dist/Polygon.d.ts +3 -2
- package/dist/Properties.d.ts +1 -0
- package/dist/Provider.d.ts +3 -1
- package/dist/Rectangle.d.ts +3 -2
- package/dist/RoundedRectangle.d.ts +3 -2
- package/dist/SVG.d.ts +22 -0
- package/dist/Sprite.d.ts +4 -3
- package/dist/Star.d.ts +3 -2
- package/dist/Text.d.ts +4 -3
- package/dist/Texture.d.ts +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/react-two-main.es.js +891 -416
- package/package.json +2 -2
|
@@ -1,448 +1,923 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as k, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import b, { createContext as z, useContext as J, useRef as F, useEffect as v, useState as K, useCallback as W, useMemo as m, useImperativeHandle as S } from "react";
|
|
3
|
+
import E from "two.js";
|
|
4
|
+
const N = z({
|
|
5
|
+
two: null,
|
|
6
|
+
parent: null,
|
|
7
|
+
width: 0,
|
|
8
|
+
height: 0,
|
|
9
|
+
registerEventShape: () => {
|
|
10
|
+
},
|
|
11
|
+
unregisterEventShape: () => {
|
|
12
|
+
}
|
|
13
|
+
}), H = () => J(N), te = (t, f = []) => {
|
|
14
|
+
const { two: r } = H(), u = F(t);
|
|
15
|
+
v(() => {
|
|
16
|
+
u.current = t;
|
|
17
|
+
}, [t, ...f]), v(() => {
|
|
18
|
+
if (!r)
|
|
10
19
|
return;
|
|
11
|
-
let
|
|
12
|
-
return
|
|
13
|
-
function
|
|
14
|
-
|
|
20
|
+
let n = 0;
|
|
21
|
+
return r.bind("update", d), () => r.unbind("update", d);
|
|
22
|
+
function d(l, e) {
|
|
23
|
+
n += e / 1e3, u.current?.(n, e);
|
|
15
24
|
}
|
|
16
|
-
}, [
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
}, [r, ...f]);
|
|
26
|
+
}, R = [
|
|
27
|
+
"onClick",
|
|
28
|
+
"onContextMenu",
|
|
29
|
+
"onDoubleClick",
|
|
30
|
+
"onWheel",
|
|
31
|
+
"onPointerDown",
|
|
32
|
+
"onPointerUp",
|
|
33
|
+
"onPointerOver",
|
|
34
|
+
"onPointerOut",
|
|
35
|
+
"onPointerEnter",
|
|
36
|
+
"onPointerLeave",
|
|
37
|
+
"onPointerMove",
|
|
38
|
+
"onPointerCancel"
|
|
39
|
+
];
|
|
40
|
+
function B(t, f, r) {
|
|
41
|
+
const u = f.getBoundingClientRect(), n = t.clientX - u.left - r.width / 2, d = t.clientY - u.top - r.height / 2;
|
|
42
|
+
return { x: n, y: d };
|
|
43
|
+
}
|
|
44
|
+
function D(t, f) {
|
|
45
|
+
const r = f.getBoundingClientRect(), u = t.clientX - r.left, n = t.clientY - r.top;
|
|
46
|
+
return { x: u, y: n };
|
|
47
|
+
}
|
|
48
|
+
function $(t, f, r, u) {
|
|
49
|
+
let n = !1;
|
|
50
|
+
return {
|
|
51
|
+
nativeEvent: t,
|
|
52
|
+
target: f,
|
|
53
|
+
currentTarget: r,
|
|
54
|
+
point: u,
|
|
55
|
+
stopPropagation: () => {
|
|
56
|
+
n = !0;
|
|
57
|
+
},
|
|
58
|
+
get stopped() {
|
|
59
|
+
return n;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function Q(t, f, r) {
|
|
64
|
+
return "visible" in t && !t.visible ? !1 : typeof t.contains == "function" ? t.contains(f, r) : !1;
|
|
65
|
+
}
|
|
66
|
+
function x(t, f, r) {
|
|
67
|
+
const u = [];
|
|
68
|
+
for (const [n] of t)
|
|
69
|
+
Q(n, f, r) && u.push(n);
|
|
70
|
+
return u;
|
|
71
|
+
}
|
|
72
|
+
function X(t, f) {
|
|
73
|
+
const r = [t], u = f.get(t);
|
|
74
|
+
if (u?.parent) {
|
|
75
|
+
let n = u.parent;
|
|
76
|
+
for (; n; )
|
|
77
|
+
r.push(n), n = f.get(n)?.parent;
|
|
78
|
+
}
|
|
79
|
+
return r;
|
|
80
|
+
}
|
|
81
|
+
function A(t) {
|
|
82
|
+
process.env.NODE_ENV !== "production" && b.Children.forEach(t, (f) => {
|
|
83
|
+
if (!b.isValidElement(f))
|
|
84
|
+
return;
|
|
85
|
+
const r = f.type;
|
|
86
|
+
if (typeof r == "string") {
|
|
87
|
+
console.warn(
|
|
88
|
+
`[react-two.js] <${r}> is not compatible with Canvas.
|
|
89
|
+
Only react-two.js components (Circle, Rectangle, Group, etc.) can be used inside <Canvas>.
|
|
90
|
+
Place DOM elements outside of the Canvas component.
|
|
91
|
+
See: https://github.com/jonobr1/react-two.js#usage`
|
|
92
|
+
);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (r === b.Fragment) {
|
|
96
|
+
A(
|
|
97
|
+
f.props.children
|
|
98
|
+
);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
typeof r == "function" && f.props.children && A(
|
|
102
|
+
f.props.children
|
|
103
|
+
);
|
|
23
104
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
105
|
+
}
|
|
106
|
+
const re = (t) => {
|
|
107
|
+
const { two: f, parent: r } = H(), u = F(null), n = F(/* @__PURE__ */ new Map()), d = F(/* @__PURE__ */ new Set()), l = F(null), [e, o] = K({
|
|
108
|
+
two: f,
|
|
109
|
+
parent: r,
|
|
110
|
+
width: 0,
|
|
111
|
+
height: 0,
|
|
112
|
+
registerEventShape: () => {
|
|
113
|
+
},
|
|
114
|
+
unregisterEventShape: () => {
|
|
115
|
+
}
|
|
116
|
+
}), s = W(
|
|
117
|
+
(a, c, h) => {
|
|
118
|
+
n.current.set(a, { shape: a, handlers: c, parent: h });
|
|
119
|
+
},
|
|
120
|
+
[]
|
|
121
|
+
), i = W((a) => {
|
|
122
|
+
n.current.delete(a), d.current.delete(a), l.current === a && (l.current = null);
|
|
123
|
+
}, []);
|
|
124
|
+
return v(() => {
|
|
125
|
+
if (!f) {
|
|
126
|
+
const c = { ...t };
|
|
127
|
+
delete c.children;
|
|
128
|
+
const h = new E(c).appendTo(u.current);
|
|
129
|
+
return o((p) => ({
|
|
130
|
+
...p,
|
|
131
|
+
two: h,
|
|
132
|
+
parent: h.scene,
|
|
133
|
+
width: h.width,
|
|
134
|
+
height: h.height,
|
|
135
|
+
registerEventShape: s,
|
|
136
|
+
unregisterEventShape: i
|
|
137
|
+
})), () => {
|
|
138
|
+
h.renderer.domElement.parentElement?.removeChild(
|
|
139
|
+
h.renderer.domElement
|
|
140
|
+
), h.pause(), h.unbind(), h.release();
|
|
141
|
+
const p = E.Instances.indexOf(h);
|
|
142
|
+
p >= 0 && E.Instances.splice(p, 1), h.clear();
|
|
32
143
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
144
|
+
}
|
|
145
|
+
}, []), v(() => {
|
|
146
|
+
if (!f) {
|
|
147
|
+
const c = {};
|
|
148
|
+
let h = !1;
|
|
149
|
+
typeof t.width == "number" && (c.width = t.width, e.two && (e.two.width = t.width), h = !0), typeof t.height == "number" && (c.height = t.height, e.two && (e.two.height = t.height), h = !0), h && o((p) => ({ ...p, ...c }));
|
|
150
|
+
}
|
|
151
|
+
}, [f, e.two, t.width, t.height]), v(() => {
|
|
152
|
+
if (!f && e.two) {
|
|
153
|
+
let c = function() {
|
|
154
|
+
const T = h.width !== p, V = h.height !== P;
|
|
155
|
+
T && (p = h.width), V && (P = h.height), (T || V) && o((C) => ({ ...C, width: p, height: P }));
|
|
156
|
+
};
|
|
157
|
+
const h = e.two;
|
|
158
|
+
let p = h.width, P = h.height;
|
|
159
|
+
return (t.fullscreen || t.fitted) && h.bind("update", c), () => {
|
|
160
|
+
h.unbind("update", c);
|
|
43
161
|
};
|
|
44
162
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
163
|
+
}, [f, e.two, t.fullscreen, t.fitted]), v(() => {
|
|
164
|
+
process.env.NODE_ENV !== "production" && A(t.children);
|
|
165
|
+
}, [t.children]), v(() => {
|
|
166
|
+
if (!e.two) return;
|
|
167
|
+
const a = e.two.renderer.domElement, c = (g, w, y) => {
|
|
168
|
+
if (g.length === 0) return;
|
|
169
|
+
const M = g[0], I = B(y, a, e.two), G = X(M, n.current);
|
|
170
|
+
for (const U of G) {
|
|
171
|
+
const q = n.current.get(U)?.handlers[w];
|
|
172
|
+
if (q) {
|
|
173
|
+
const _ = $(
|
|
174
|
+
y,
|
|
175
|
+
M,
|
|
176
|
+
U,
|
|
177
|
+
I
|
|
178
|
+
);
|
|
179
|
+
if (q(_), _.stopped)
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
57
182
|
}
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
183
|
+
}, h = (g) => {
|
|
184
|
+
const w = D(g, a), y = x(
|
|
185
|
+
n.current,
|
|
186
|
+
w.x,
|
|
187
|
+
w.y
|
|
188
|
+
);
|
|
189
|
+
y.length > 0 && c(y, "onClick", g);
|
|
190
|
+
}, p = (g) => {
|
|
191
|
+
const w = D(g, a), y = x(
|
|
192
|
+
n.current,
|
|
193
|
+
w.x,
|
|
194
|
+
w.y
|
|
195
|
+
);
|
|
196
|
+
y.length > 0 && c(y, "onContextMenu", g);
|
|
197
|
+
}, P = (g) => {
|
|
198
|
+
const w = D(g, a), y = x(
|
|
199
|
+
n.current,
|
|
200
|
+
w.x,
|
|
201
|
+
w.y
|
|
202
|
+
);
|
|
203
|
+
y.length > 0 && c(y, "onDoubleClick", g);
|
|
204
|
+
}, T = (g) => {
|
|
205
|
+
const w = D(g, a), y = x(
|
|
206
|
+
n.current,
|
|
207
|
+
w.x,
|
|
208
|
+
w.y
|
|
209
|
+
);
|
|
210
|
+
y.length > 0 && c(y, "onWheel", g);
|
|
211
|
+
}, V = (g) => {
|
|
212
|
+
const w = D(g, a), y = x(
|
|
213
|
+
n.current,
|
|
214
|
+
w.x,
|
|
215
|
+
w.y
|
|
216
|
+
);
|
|
217
|
+
y.length > 0 && (c(y, "onPointerDown", g), g.target instanceof Element && g.target.hasPointerCapture?.(g.pointerId) && (l.current = y[0]));
|
|
218
|
+
}, C = (g) => {
|
|
219
|
+
if (l.current) {
|
|
220
|
+
const M = n.current.get(l.current);
|
|
221
|
+
if (M?.handlers.onPointerUp) {
|
|
222
|
+
const I = B(g, a, e.two), G = $(
|
|
223
|
+
g,
|
|
224
|
+
l.current,
|
|
225
|
+
l.current,
|
|
226
|
+
I
|
|
227
|
+
);
|
|
228
|
+
M.handlers.onPointerUp(G);
|
|
229
|
+
}
|
|
230
|
+
l.current = null;
|
|
231
|
+
return;
|
|
72
232
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
233
|
+
const w = D(g, a), y = x(
|
|
234
|
+
n.current,
|
|
235
|
+
w.x,
|
|
236
|
+
w.y
|
|
237
|
+
);
|
|
238
|
+
y.length > 0 ? c(y, "onPointerUp", g) : t.onPointerMissed && t.onPointerMissed(g);
|
|
239
|
+
}, O = (g) => {
|
|
240
|
+
const w = D(g, a), y = x(
|
|
241
|
+
n.current,
|
|
242
|
+
w.x,
|
|
243
|
+
w.y
|
|
244
|
+
), M = new Set(y);
|
|
245
|
+
y.length > 0 && c(y, "onPointerMove", g);
|
|
246
|
+
const I = d.current;
|
|
247
|
+
for (const G of M)
|
|
248
|
+
I.has(G) || (c([G], "onPointerEnter", g), c([G], "onPointerOver", g));
|
|
249
|
+
for (const G of I)
|
|
250
|
+
M.has(G) || (c([G], "onPointerLeave", g), c([G], "onPointerOut", g));
|
|
251
|
+
d.current = M;
|
|
252
|
+
}, L = (g) => {
|
|
253
|
+
const w = D(g, a), y = x(
|
|
254
|
+
n.current,
|
|
255
|
+
w.x,
|
|
256
|
+
w.y
|
|
257
|
+
);
|
|
258
|
+
y.length > 0 && c(y, "onPointerCancel", g), l.current = null;
|
|
259
|
+
};
|
|
260
|
+
return a.addEventListener("click", h), a.addEventListener("contextmenu", p), a.addEventListener("dblclick", P), a.addEventListener("wheel", T), a.addEventListener("pointerdown", V), a.addEventListener("pointerup", C), a.addEventListener("pointermove", O), a.addEventListener("pointercancel", L), () => {
|
|
261
|
+
a.removeEventListener("click", h), a.removeEventListener("contextmenu", p), a.removeEventListener("dblclick", P), a.removeEventListener("wheel", T), a.removeEventListener("pointerdown", V), a.removeEventListener("pointerup", C), a.removeEventListener("pointermove", O), a.removeEventListener("pointercancel", L);
|
|
262
|
+
};
|
|
263
|
+
}, [
|
|
264
|
+
e.two,
|
|
265
|
+
t.onPointerMissed,
|
|
266
|
+
s,
|
|
267
|
+
i
|
|
268
|
+
]), /* @__PURE__ */ k(N.Provider, { value: e, children: /* @__PURE__ */ k("div", { ref: u, children: t.children }) });
|
|
269
|
+
}, oe = b.forwardRef(
|
|
270
|
+
({ x: t, y: f, ...r }, u) => {
|
|
271
|
+
const {
|
|
272
|
+
two: n,
|
|
273
|
+
parent: d,
|
|
274
|
+
width: l,
|
|
275
|
+
height: e,
|
|
276
|
+
registerEventShape: o,
|
|
277
|
+
unregisterEventShape: s
|
|
278
|
+
} = H(), i = m(() => new E.Group(), []), { eventHandlers: a, shapeProps: c } = m(() => {
|
|
279
|
+
const h = {}, p = {};
|
|
280
|
+
for (const P in r)
|
|
281
|
+
R.includes(P) ? h[P] = r[
|
|
282
|
+
P
|
|
283
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
284
|
+
] : p[P] = r[P];
|
|
285
|
+
return { eventHandlers: h, shapeProps: p };
|
|
286
|
+
}, [r]);
|
|
287
|
+
return v(() => {
|
|
288
|
+
if (d)
|
|
289
|
+
return d.add(i), () => {
|
|
290
|
+
d.remove(i);
|
|
291
|
+
};
|
|
292
|
+
}, [d, i]), v(() => {
|
|
293
|
+
typeof t == "number" && (i.translation.x = t), typeof f == "number" && (i.translation.y = f);
|
|
294
|
+
const h = { ...c };
|
|
295
|
+
delete h.children;
|
|
296
|
+
for (const p in h)
|
|
297
|
+
p in i && (i[p] = h[p]);
|
|
298
|
+
}, [i, t, f, c]), v(() => {
|
|
299
|
+
if (Object.keys(a).length > 0)
|
|
300
|
+
return o(i, a, d ?? void 0), () => {
|
|
301
|
+
s(i);
|
|
302
|
+
};
|
|
303
|
+
}, [
|
|
304
|
+
i,
|
|
305
|
+
o,
|
|
306
|
+
s,
|
|
307
|
+
d,
|
|
308
|
+
a
|
|
309
|
+
]), S(u, () => i, [i]), /* @__PURE__ */ k(
|
|
310
|
+
N.Provider,
|
|
311
|
+
{
|
|
312
|
+
value: {
|
|
313
|
+
two: n,
|
|
314
|
+
parent: i,
|
|
315
|
+
width: l,
|
|
316
|
+
height: e,
|
|
317
|
+
registerEventShape: o,
|
|
318
|
+
unregisterEventShape: s
|
|
319
|
+
},
|
|
320
|
+
children: r.children
|
|
94
321
|
}
|
|
95
|
-
|
|
322
|
+
);
|
|
96
323
|
}
|
|
97
|
-
),
|
|
98
|
-
({ x:
|
|
99
|
-
const {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
324
|
+
), ie = b.forwardRef(
|
|
325
|
+
({ x: t, y: f, src: r, content: u, onLoad: n, onError: d, ...l }, e) => {
|
|
326
|
+
const {
|
|
327
|
+
two: o,
|
|
328
|
+
parent: s,
|
|
329
|
+
width: i,
|
|
330
|
+
height: a,
|
|
331
|
+
registerEventShape: c,
|
|
332
|
+
unregisterEventShape: h
|
|
333
|
+
} = H(), p = m(() => new E.Group(), []), P = F(null), { eventHandlers: T, shapeProps: V } = m(() => {
|
|
334
|
+
const C = {}, O = {};
|
|
335
|
+
for (const L in l)
|
|
336
|
+
R.includes(L) ? C[L] = l[
|
|
337
|
+
L
|
|
338
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
339
|
+
] : O[L] = l[L];
|
|
340
|
+
return { eventHandlers: C, shapeProps: O };
|
|
341
|
+
}, [l]);
|
|
342
|
+
return v(() => {
|
|
343
|
+
P.current = p;
|
|
344
|
+
}, [p]), v(() => {
|
|
345
|
+
if (s && p)
|
|
346
|
+
return s.add(p), () => {
|
|
347
|
+
s.remove(p);
|
|
348
|
+
};
|
|
349
|
+
}, [p, s]), v(() => {
|
|
350
|
+
!r && !u && console.warn(
|
|
351
|
+
'[react-two.js] SVG component requires either "src" or "content" prop'
|
|
352
|
+
), r && u && console.warn(
|
|
353
|
+
'[react-two.js] SVG component has both "src" and "content" props. Using "src" and ignoring "content"'
|
|
354
|
+
);
|
|
355
|
+
}, [r, u]), v(() => {
|
|
356
|
+
if (!o) return;
|
|
357
|
+
const C = r || u;
|
|
358
|
+
if (!C) return;
|
|
359
|
+
let O = !0;
|
|
360
|
+
try {
|
|
361
|
+
o.load(
|
|
362
|
+
C,
|
|
363
|
+
(L, g) => {
|
|
364
|
+
if (O && (P.current?.add(L.children), n))
|
|
365
|
+
try {
|
|
366
|
+
requestAnimationFrame(() => n(P.current, g));
|
|
367
|
+
} catch (w) {
|
|
368
|
+
console.error(
|
|
369
|
+
"[react-two.js] Error in SVG onLoad callback:",
|
|
370
|
+
w
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
} catch (L) {
|
|
376
|
+
if (!O) return;
|
|
377
|
+
const g = L instanceof Error ? L : new Error("Failed to load SVG");
|
|
378
|
+
if (d)
|
|
379
|
+
try {
|
|
380
|
+
d(g);
|
|
381
|
+
} catch (w) {
|
|
382
|
+
console.error(
|
|
383
|
+
"[react-two.js] Error in SVG onError callback:",
|
|
384
|
+
w
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
else
|
|
388
|
+
console.error("[react-two.js] SVG loading error:", g);
|
|
116
389
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
), z = w.forwardRef(
|
|
120
|
-
({ x: r, y: o, ...i }, s) => {
|
|
121
|
-
const { two: c, parent: a } = h(), [n, t] = b(null);
|
|
122
|
-
return l(() => {
|
|
123
|
-
const e = new m.Text();
|
|
124
|
-
return t(e), () => {
|
|
125
|
-
t(null);
|
|
390
|
+
return () => {
|
|
391
|
+
O = !1, P.current?.remove(P.current.children);
|
|
126
392
|
};
|
|
127
|
-
}, [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
393
|
+
}, [o, r, u, n, d]), v(() => {
|
|
394
|
+
typeof t == "number" && (p.translation.x = t), typeof f == "number" && (p.translation.y = f);
|
|
395
|
+
const C = { ...V };
|
|
396
|
+
delete C.children;
|
|
397
|
+
for (const O in C)
|
|
398
|
+
O in p && (p[O] = C[O]);
|
|
399
|
+
}, [p, t, f, V]), v(() => {
|
|
400
|
+
if (Object.keys(T).length > 0)
|
|
401
|
+
return c(p, T, s ?? void 0), () => {
|
|
402
|
+
h(p);
|
|
403
|
+
};
|
|
404
|
+
}, [p, c, h, s, T]), S(e, () => p, [p]), /* @__PURE__ */ k(
|
|
405
|
+
N.Provider,
|
|
406
|
+
{
|
|
407
|
+
value: {
|
|
408
|
+
two: o,
|
|
409
|
+
parent: p,
|
|
410
|
+
width: i,
|
|
411
|
+
height: a,
|
|
412
|
+
registerEventShape: c,
|
|
413
|
+
unregisterEventShape: h
|
|
414
|
+
},
|
|
415
|
+
children: l.children
|
|
138
416
|
}
|
|
139
|
-
|
|
417
|
+
);
|
|
140
418
|
}
|
|
141
|
-
),
|
|
142
|
-
({
|
|
143
|
-
const {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
419
|
+
), se = b.forwardRef(
|
|
420
|
+
({ manual: t, x: f, y: r, ...u }, n) => {
|
|
421
|
+
const { parent: d, registerEventShape: l, unregisterEventShape: e } = H(), o = m(() => new E.Path(), []), { eventHandlers: s, shapeProps: i } = m(() => {
|
|
422
|
+
const a = {}, c = {};
|
|
423
|
+
for (const h in u)
|
|
424
|
+
R.includes(h) ? a[h] = u[
|
|
425
|
+
h
|
|
426
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
427
|
+
] : c[h] = u[h];
|
|
428
|
+
return { eventHandlers: a, shapeProps: c };
|
|
429
|
+
}, [u]);
|
|
430
|
+
return v(() => {
|
|
431
|
+
if (d)
|
|
432
|
+
return d.add(o), () => {
|
|
433
|
+
d.remove(o);
|
|
434
|
+
};
|
|
435
|
+
}, [d, o]), v(() => {
|
|
436
|
+
if (Object.keys(s).length > 0)
|
|
437
|
+
return l(o, s, d ?? void 0), () => {
|
|
438
|
+
e(o);
|
|
439
|
+
};
|
|
440
|
+
}, [o, l, e, d, s]), v(() => {
|
|
441
|
+
typeof f == "number" && (o.translation.x = f), typeof r == "number" && (o.translation.y = r), typeof t < "u" && (o.automatic = !t);
|
|
442
|
+
for (const a in i)
|
|
443
|
+
a in o && (o[a] = i[a]);
|
|
444
|
+
}, [i, o, f, r, t]), S(n, () => o, [o]), /* @__PURE__ */ k(j, {});
|
|
162
445
|
}
|
|
163
|
-
),
|
|
164
|
-
({ x:
|
|
165
|
-
const {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
446
|
+
), ae = b.forwardRef(
|
|
447
|
+
({ x: t, y: f, ...r }, u) => {
|
|
448
|
+
const { parent: n, registerEventShape: d, unregisterEventShape: l } = H(), e = m(() => new E.Points(), []), { eventHandlers: o, shapeProps: s } = m(() => {
|
|
449
|
+
const i = {}, a = {};
|
|
450
|
+
for (const c in r)
|
|
451
|
+
R.includes(c) ? i[c] = r[
|
|
452
|
+
c
|
|
453
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
454
|
+
] : a[c] = r[c];
|
|
455
|
+
return { eventHandlers: i, shapeProps: a };
|
|
456
|
+
}, [r]);
|
|
457
|
+
return v(() => {
|
|
458
|
+
if (n)
|
|
459
|
+
return n.add(e), () => {
|
|
460
|
+
n.remove(e);
|
|
461
|
+
};
|
|
462
|
+
}, [n, e]), v(() => {
|
|
463
|
+
typeof t == "number" && (e.translation.x = t), typeof f == "number" && (e.translation.y = f);
|
|
464
|
+
for (const i in s)
|
|
465
|
+
i in e && (e[i] = s[i]);
|
|
466
|
+
}, [s, e, t, f]), v(() => {
|
|
467
|
+
if (Object.keys(o).length > 0)
|
|
468
|
+
return d(e, o, n ?? void 0), () => {
|
|
469
|
+
l(e);
|
|
182
470
|
};
|
|
183
|
-
}, [
|
|
471
|
+
}, [
|
|
472
|
+
e,
|
|
473
|
+
d,
|
|
474
|
+
l,
|
|
475
|
+
n,
|
|
476
|
+
o
|
|
477
|
+
]), S(u, () => e, [e]), /* @__PURE__ */ k(j, {});
|
|
184
478
|
}
|
|
185
|
-
),
|
|
186
|
-
({ x:
|
|
187
|
-
const {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}, [
|
|
479
|
+
), ce = b.forwardRef(
|
|
480
|
+
({ x: t, y: f, ...r }, u) => {
|
|
481
|
+
const { parent: n, registerEventShape: d, unregisterEventShape: l } = H(), e = m(() => new E.Text(), []), { eventHandlers: o, shapeProps: s } = m(() => {
|
|
482
|
+
const i = {}, a = {};
|
|
483
|
+
for (const c in r)
|
|
484
|
+
R.includes(c) ? i[c] = r[
|
|
485
|
+
c
|
|
486
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
487
|
+
] : a[c] = r[c];
|
|
488
|
+
return { eventHandlers: i, shapeProps: a };
|
|
489
|
+
}, [r]);
|
|
490
|
+
return v(() => {
|
|
491
|
+
if (n)
|
|
492
|
+
return n.add(e), () => {
|
|
493
|
+
n.remove(e);
|
|
494
|
+
};
|
|
495
|
+
}, [n, e]), v(() => {
|
|
496
|
+
typeof t == "number" && (e.translation.x = t), typeof f == "number" && (e.translation.y = f);
|
|
497
|
+
for (const i in s)
|
|
498
|
+
i in e && (e[i] = s[i]);
|
|
499
|
+
}, [s, e, t, f]), v(() => {
|
|
500
|
+
if (Object.keys(o).length > 0)
|
|
501
|
+
return d(e, o, n ?? void 0), () => {
|
|
502
|
+
l(e);
|
|
503
|
+
};
|
|
504
|
+
}, [e, d, l, n, o]), S(u, () => e, [e]), /* @__PURE__ */ k(j, {});
|
|
206
505
|
}
|
|
207
|
-
),
|
|
208
|
-
({
|
|
209
|
-
const {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}, [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
506
|
+
), fe = b.forwardRef(
|
|
507
|
+
({ x: t, y: f, resolution: r, ...u }, n) => {
|
|
508
|
+
const { parent: d, registerEventShape: l, unregisterEventShape: e } = H(), o = m(
|
|
509
|
+
() => new E.ArcSegment(0, 0, 0, 0, 0, 0, r),
|
|
510
|
+
[r]
|
|
511
|
+
), { eventHandlers: s, shapeProps: i } = m(() => {
|
|
512
|
+
const a = {}, c = {};
|
|
513
|
+
for (const h in u)
|
|
514
|
+
R.includes(h) ? a[h] = u[
|
|
515
|
+
h
|
|
516
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
517
|
+
] : c[h] = u[h];
|
|
518
|
+
return { eventHandlers: a, shapeProps: c };
|
|
519
|
+
}, [u]);
|
|
520
|
+
return v(() => {
|
|
521
|
+
if (d)
|
|
522
|
+
return d.add(o), () => {
|
|
523
|
+
d.remove(o);
|
|
524
|
+
};
|
|
525
|
+
}, [d, o]), v(() => {
|
|
526
|
+
typeof t == "number" && (o.translation.x = t), typeof f == "number" && (o.translation.y = f);
|
|
527
|
+
for (const a in i)
|
|
528
|
+
a in o && (o[a] = i[a]);
|
|
529
|
+
}, [i, o, t, f]), v(() => {
|
|
530
|
+
if (Object.keys(s).length > 0)
|
|
531
|
+
return l(o, s, d ?? void 0), () => {
|
|
532
|
+
e(o);
|
|
533
|
+
};
|
|
534
|
+
}, [
|
|
535
|
+
o,
|
|
536
|
+
l,
|
|
537
|
+
e,
|
|
538
|
+
d,
|
|
539
|
+
s
|
|
540
|
+
]), S(n, () => o, [o]), /* @__PURE__ */ k(j, {});
|
|
228
541
|
}
|
|
229
|
-
),
|
|
230
|
-
({
|
|
231
|
-
const {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}, [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
542
|
+
), le = b.forwardRef(
|
|
543
|
+
({ x: t, y: f, resolution: r, ...u }, n) => {
|
|
544
|
+
const { parent: d, registerEventShape: l, unregisterEventShape: e } = H(), o = m(
|
|
545
|
+
() => new E.Circle(0, 0, 0, r),
|
|
546
|
+
[r]
|
|
547
|
+
), { eventHandlers: s, shapeProps: i } = m(() => {
|
|
548
|
+
const a = {}, c = {};
|
|
549
|
+
for (const h in u)
|
|
550
|
+
R.includes(h) ? a[h] = u[
|
|
551
|
+
h
|
|
552
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
553
|
+
] : c[h] = u[h];
|
|
554
|
+
return { eventHandlers: a, shapeProps: c };
|
|
555
|
+
}, [u]);
|
|
556
|
+
return v(() => {
|
|
557
|
+
typeof t == "number" && (o.translation.x = t), typeof f == "number" && (o.translation.y = f);
|
|
558
|
+
for (const a in i)
|
|
559
|
+
a in o && (o[a] = i[a]);
|
|
560
|
+
}, [o, i, t, f]), v(() => {
|
|
561
|
+
if (d)
|
|
562
|
+
return d.add(o), () => {
|
|
563
|
+
d.remove(o);
|
|
564
|
+
};
|
|
565
|
+
}, [d, o]), v(() => {
|
|
566
|
+
if (Object.keys(s).length > 0)
|
|
567
|
+
return l(o, s, d ?? void 0), () => {
|
|
568
|
+
e(o);
|
|
569
|
+
};
|
|
570
|
+
}, [
|
|
571
|
+
o,
|
|
572
|
+
l,
|
|
573
|
+
e,
|
|
574
|
+
d,
|
|
575
|
+
s
|
|
576
|
+
]), S(n, () => o, [o]), /* @__PURE__ */ k(j, {});
|
|
250
577
|
}
|
|
251
|
-
),
|
|
252
|
-
({
|
|
253
|
-
const {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
578
|
+
), ue = b.forwardRef(
|
|
579
|
+
({ x: t, y: f, resolution: r, ...u }, n) => {
|
|
580
|
+
const { parent: d, registerEventShape: l, unregisterEventShape: e } = H(), o = m(
|
|
581
|
+
() => new E.Ellipse(0, 0, 0, 0, r),
|
|
582
|
+
[r]
|
|
583
|
+
), { eventHandlers: s, shapeProps: i } = m(() => {
|
|
584
|
+
const a = {}, c = {};
|
|
585
|
+
for (const h in u)
|
|
586
|
+
R.includes(h) ? a[h] = u[
|
|
587
|
+
h
|
|
588
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
589
|
+
] : c[h] = u[h];
|
|
590
|
+
return { eventHandlers: a, shapeProps: c };
|
|
591
|
+
}, [u]);
|
|
592
|
+
return v(() => {
|
|
593
|
+
if (d)
|
|
594
|
+
return d.add(o), () => {
|
|
595
|
+
d.remove(o);
|
|
596
|
+
};
|
|
597
|
+
}, [d, o]), v(() => {
|
|
598
|
+
typeof t == "number" && (o.translation.x = t), typeof f == "number" && (o.translation.y = f);
|
|
599
|
+
for (const a in i)
|
|
600
|
+
a in o && (o[a] = i[a]);
|
|
601
|
+
}, [o, t, f, i]), v(() => {
|
|
602
|
+
if (Object.keys(s).length > 0)
|
|
603
|
+
return l(o, s, d ?? void 0), () => {
|
|
604
|
+
e(o);
|
|
605
|
+
};
|
|
606
|
+
}, [
|
|
607
|
+
o,
|
|
608
|
+
l,
|
|
609
|
+
e,
|
|
610
|
+
d,
|
|
611
|
+
s
|
|
612
|
+
]), S(n, () => o, [o]), /* @__PURE__ */ k(j, {});
|
|
273
613
|
}
|
|
274
|
-
),
|
|
275
|
-
({
|
|
276
|
-
const {
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}, [i,
|
|
614
|
+
), de = b.forwardRef(
|
|
615
|
+
({ mode: t, src: f, texture: r, x: u, y: n, ...d }, l) => {
|
|
616
|
+
const { parent: e, registerEventShape: o, unregisterEventShape: s } = H(), i = m(() => new E.Image(f), [f]), { eventHandlers: a, shapeProps: c } = m(() => {
|
|
617
|
+
const h = {}, p = {};
|
|
618
|
+
for (const P in d)
|
|
619
|
+
R.includes(P) ? h[P] = d[
|
|
620
|
+
P
|
|
621
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
622
|
+
] : p[P] = d[P];
|
|
623
|
+
return { eventHandlers: h, shapeProps: p };
|
|
624
|
+
}, [d]);
|
|
625
|
+
return v(() => {
|
|
626
|
+
if (e)
|
|
627
|
+
return e.add(i), () => {
|
|
628
|
+
e.remove(i);
|
|
629
|
+
};
|
|
630
|
+
}, [e, i]), v(() => {
|
|
631
|
+
typeof t < "u" && (i.mode = t), typeof r < "u" && (i.texture = r), typeof u == "number" && (i.translation.x = u), typeof n == "number" && (i.translation.y = n);
|
|
632
|
+
for (const h in c)
|
|
633
|
+
h in i && (i[h] = c[h]);
|
|
634
|
+
}, [i, c, t, r, u, n]), v(() => {
|
|
635
|
+
if (Object.keys(a).length > 0)
|
|
636
|
+
return o(i, a, e ?? void 0), () => {
|
|
637
|
+
s(i);
|
|
638
|
+
};
|
|
639
|
+
}, [
|
|
640
|
+
i,
|
|
641
|
+
o,
|
|
642
|
+
s,
|
|
643
|
+
e,
|
|
644
|
+
a
|
|
645
|
+
]), S(l, () => i, [i]), /* @__PURE__ */ k(j, {});
|
|
295
646
|
}
|
|
296
|
-
),
|
|
297
|
-
({ x:
|
|
298
|
-
const {
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}, [
|
|
647
|
+
), he = b.forwardRef(
|
|
648
|
+
({ src: t, x: f, y: r, autoPlay: u, ...n }, d) => {
|
|
649
|
+
const { parent: l, registerEventShape: e, unregisterEventShape: o } = H(), s = m(() => new E.ImageSequence(t), [t]), { eventHandlers: i, shapeProps: a } = m(() => {
|
|
650
|
+
const c = {}, h = {};
|
|
651
|
+
for (const p in n)
|
|
652
|
+
R.includes(p) ? c[p] = n[
|
|
653
|
+
p
|
|
654
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
655
|
+
] : h[p] = n[p];
|
|
656
|
+
return { eventHandlers: c, shapeProps: h };
|
|
657
|
+
}, [n]);
|
|
658
|
+
return v(() => {
|
|
659
|
+
if (l)
|
|
660
|
+
return l.add(s), () => {
|
|
661
|
+
l.remove(s);
|
|
662
|
+
};
|
|
663
|
+
}, [l, s]), v(() => {
|
|
664
|
+
u ? s.play() : s.pause(), typeof f == "number" && (s.translation.x = f), typeof r == "number" && (s.translation.y = r);
|
|
665
|
+
for (const c in a)
|
|
666
|
+
c in s && (s[c] = a[c]);
|
|
667
|
+
}, [a, s, f, r, u]), v(() => {
|
|
668
|
+
if (Object.keys(i).length > 0)
|
|
669
|
+
return e(s, i, l ?? void 0), () => {
|
|
670
|
+
o(s);
|
|
671
|
+
};
|
|
672
|
+
}, [
|
|
673
|
+
s,
|
|
674
|
+
e,
|
|
675
|
+
o,
|
|
676
|
+
l,
|
|
677
|
+
i
|
|
678
|
+
]), S(d, () => s, [s]), /* @__PURE__ */ k(j, {});
|
|
317
679
|
}
|
|
318
|
-
),
|
|
319
|
-
({
|
|
320
|
-
const {
|
|
321
|
-
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}, [
|
|
680
|
+
), ve = b.forwardRef(
|
|
681
|
+
({ x1: t, y1: f, x2: r, y2: u, ...n }, d) => {
|
|
682
|
+
const { parent: l, registerEventShape: e, unregisterEventShape: o } = H(), s = m(() => new E.Line(), []), { eventHandlers: i, shapeProps: a } = m(() => {
|
|
683
|
+
const c = {}, h = {};
|
|
684
|
+
for (const p in n)
|
|
685
|
+
R.includes(p) ? c[p] = n[
|
|
686
|
+
p
|
|
687
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
688
|
+
] : h[p] = n[p];
|
|
689
|
+
return { eventHandlers: c, shapeProps: h };
|
|
690
|
+
}, [n]);
|
|
691
|
+
return v(() => {
|
|
692
|
+
if (l)
|
|
693
|
+
return l.add(s), () => {
|
|
694
|
+
l.remove(s);
|
|
695
|
+
};
|
|
696
|
+
}, [l, s]), v(() => {
|
|
697
|
+
typeof t == "number" && (s.left.x = t), typeof f == "number" && (s.left.y = f), typeof r == "number" && (s.right.x = r), typeof u == "number" && (s.right.y = u);
|
|
698
|
+
for (const c in a)
|
|
699
|
+
c in s && (s[c] = a[c]);
|
|
700
|
+
}, [a, s, t, f, r, u]), v(() => {
|
|
701
|
+
if (Object.keys(i).length > 0)
|
|
702
|
+
return e(s, i, l ?? void 0), () => {
|
|
703
|
+
o(s);
|
|
704
|
+
};
|
|
705
|
+
}, [s, e, o, l, i]), S(d, () => s, [s]), /* @__PURE__ */ k(j, {});
|
|
339
706
|
}
|
|
340
|
-
),
|
|
341
|
-
({
|
|
342
|
-
const {
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}, [
|
|
707
|
+
), pe = b.forwardRef(
|
|
708
|
+
({ x: t, y: f, ...r }, u) => {
|
|
709
|
+
const { parent: n, registerEventShape: d, unregisterEventShape: l } = H(), e = m(() => new E.Polygon(), []), { eventHandlers: o, shapeProps: s } = m(() => {
|
|
710
|
+
const i = {}, a = {};
|
|
711
|
+
for (const c in r)
|
|
712
|
+
R.includes(c) ? i[c] = r[
|
|
713
|
+
c
|
|
714
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
715
|
+
] : a[c] = r[c];
|
|
716
|
+
return { eventHandlers: i, shapeProps: a };
|
|
717
|
+
}, [r]);
|
|
718
|
+
return v(() => {
|
|
719
|
+
if (n)
|
|
720
|
+
return n.add(e), () => {
|
|
721
|
+
n.remove(e);
|
|
722
|
+
};
|
|
723
|
+
}, [n, e]), v(() => {
|
|
724
|
+
typeof t == "number" && (e.translation.x = t), typeof f == "number" && (e.translation.y = f);
|
|
725
|
+
for (const i in s)
|
|
726
|
+
i in e && (e[i] = s[i]);
|
|
727
|
+
}, [s, e, t, f]), v(() => {
|
|
728
|
+
if (Object.keys(o).length > 0)
|
|
729
|
+
return d(e, o, n ?? void 0), () => {
|
|
730
|
+
l(e);
|
|
731
|
+
};
|
|
732
|
+
}, [
|
|
733
|
+
e,
|
|
734
|
+
d,
|
|
735
|
+
l,
|
|
736
|
+
n,
|
|
737
|
+
o
|
|
738
|
+
]), S(u, () => e, [e]), /* @__PURE__ */ k(j, {});
|
|
361
739
|
}
|
|
362
|
-
),
|
|
363
|
-
({ x:
|
|
364
|
-
const {
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}, [
|
|
740
|
+
), ge = b.forwardRef(
|
|
741
|
+
({ x: t, y: f, ...r }, u) => {
|
|
742
|
+
const { parent: n, registerEventShape: d, unregisterEventShape: l } = H(), e = m(() => new E.Rectangle(), []), { eventHandlers: o, shapeProps: s } = m(() => {
|
|
743
|
+
const i = {}, a = {};
|
|
744
|
+
for (const c in r)
|
|
745
|
+
R.includes(c) ? i[c] = r[
|
|
746
|
+
c
|
|
747
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
748
|
+
] : a[c] = r[c];
|
|
749
|
+
return { eventHandlers: i, shapeProps: a };
|
|
750
|
+
}, [r]);
|
|
751
|
+
return v(() => {
|
|
752
|
+
if (n)
|
|
753
|
+
return n.add(e), () => {
|
|
754
|
+
n.remove(e);
|
|
755
|
+
};
|
|
756
|
+
}, [n, e]), v(() => {
|
|
757
|
+
typeof t == "number" && (e.translation.x = t), typeof f == "number" && (e.translation.y = f);
|
|
758
|
+
for (const i in s)
|
|
759
|
+
i in e && (e[i] = s[i]);
|
|
760
|
+
}, [s, e, t, f]), v(() => {
|
|
761
|
+
if (Object.keys(o).length > 0)
|
|
762
|
+
return d(e, o, n ?? void 0), () => {
|
|
763
|
+
l(e);
|
|
764
|
+
};
|
|
765
|
+
}, [
|
|
766
|
+
e,
|
|
767
|
+
d,
|
|
768
|
+
l,
|
|
769
|
+
n,
|
|
770
|
+
o
|
|
771
|
+
]), S(u, () => e, [e]), /* @__PURE__ */ k(j, {});
|
|
383
772
|
}
|
|
384
|
-
),
|
|
385
|
-
({
|
|
386
|
-
const n =
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
}, [
|
|
773
|
+
), me = b.forwardRef(
|
|
774
|
+
({ x: t, y: f, ...r }, u) => {
|
|
775
|
+
const { parent: n, registerEventShape: d, unregisterEventShape: l } = H(), e = m(() => new E.RoundedRectangle(), []), { eventHandlers: o, shapeProps: s } = m(() => {
|
|
776
|
+
const i = {}, a = {};
|
|
777
|
+
for (const c in r)
|
|
778
|
+
R.includes(c) ? i[c] = r[
|
|
779
|
+
c
|
|
780
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
781
|
+
] : a[c] = r[c];
|
|
782
|
+
return { eventHandlers: i, shapeProps: a };
|
|
783
|
+
}, [r]);
|
|
784
|
+
return v(() => {
|
|
785
|
+
if (n)
|
|
786
|
+
return n.add(e), () => {
|
|
787
|
+
n.remove(e);
|
|
788
|
+
};
|
|
789
|
+
}, [n, e]), v(() => {
|
|
790
|
+
typeof t == "number" && (e.translation.x = t), typeof f == "number" && (e.translation.y = f);
|
|
791
|
+
for (const i in s)
|
|
792
|
+
i in e && (e[i] = s[i]);
|
|
793
|
+
}, [s, e, t, f]), v(() => {
|
|
794
|
+
if (Object.keys(o).length > 0)
|
|
795
|
+
return d(
|
|
796
|
+
e,
|
|
797
|
+
o,
|
|
798
|
+
n ?? void 0
|
|
799
|
+
), () => {
|
|
800
|
+
l(e);
|
|
801
|
+
};
|
|
802
|
+
}, [
|
|
803
|
+
e,
|
|
804
|
+
d,
|
|
805
|
+
l,
|
|
806
|
+
n,
|
|
807
|
+
o
|
|
808
|
+
]), S(u, () => e, [
|
|
809
|
+
e
|
|
810
|
+
]), /* @__PURE__ */ k(j, {});
|
|
395
811
|
}
|
|
396
|
-
),
|
|
397
|
-
({
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
}, [
|
|
812
|
+
), we = b.forwardRef(
|
|
813
|
+
({ src: t, x: f, y: r, autoPlay: u, ...n }, d) => {
|
|
814
|
+
const { parent: l, registerEventShape: e, unregisterEventShape: o } = H(), s = m(() => new E.Sprite(t), [t]), { eventHandlers: i, shapeProps: a } = m(() => {
|
|
815
|
+
const c = {}, h = {};
|
|
816
|
+
for (const p in n)
|
|
817
|
+
R.includes(p) ? c[p] = n[
|
|
818
|
+
p
|
|
819
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
820
|
+
] : h[p] = n[p];
|
|
821
|
+
return { eventHandlers: c, shapeProps: h };
|
|
822
|
+
}, [n]);
|
|
823
|
+
return v(() => {
|
|
824
|
+
if (l)
|
|
825
|
+
return l.add(s), () => {
|
|
826
|
+
l.remove(s);
|
|
827
|
+
};
|
|
828
|
+
}, [l, s]), v(() => {
|
|
829
|
+
typeof f == "number" && (s.translation.x = f), typeof r == "number" && (s.translation.y = r), u ? s.play() : s.pause();
|
|
830
|
+
for (const c in a)
|
|
831
|
+
c in s && (s[c] = a[c]);
|
|
832
|
+
}, [a, s, f, r, u]), v(() => {
|
|
833
|
+
if (Object.keys(i).length > 0)
|
|
834
|
+
return e(s, i, l ?? void 0), () => {
|
|
835
|
+
o(s);
|
|
836
|
+
};
|
|
837
|
+
}, [
|
|
838
|
+
s,
|
|
839
|
+
e,
|
|
840
|
+
o,
|
|
841
|
+
l,
|
|
842
|
+
i
|
|
843
|
+
]), S(d, () => s, [s]), /* @__PURE__ */ k(j, {});
|
|
407
844
|
}
|
|
408
|
-
),
|
|
409
|
-
({
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
845
|
+
), ye = b.forwardRef(
|
|
846
|
+
({ x: t, y: f, ...r }, u) => {
|
|
847
|
+
const { parent: n, registerEventShape: d, unregisterEventShape: l } = H(), e = m(() => new E.Star(), []), { eventHandlers: o, shapeProps: s } = m(() => {
|
|
848
|
+
const i = {}, a = {};
|
|
849
|
+
for (const c in r)
|
|
850
|
+
R.includes(c) ? i[c] = r[
|
|
851
|
+
c
|
|
852
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
853
|
+
] : a[c] = r[c];
|
|
854
|
+
return { eventHandlers: i, shapeProps: a };
|
|
855
|
+
}, [r]);
|
|
856
|
+
return v(() => {
|
|
857
|
+
if (n)
|
|
858
|
+
return n.add(e), () => {
|
|
859
|
+
n.remove(e);
|
|
860
|
+
};
|
|
861
|
+
}, [n, e]), v(() => {
|
|
862
|
+
typeof t == "number" && (e.translation.x = t), typeof f == "number" && (e.translation.y = f);
|
|
863
|
+
for (const i in s)
|
|
864
|
+
i in e && (e[i] = s[i]);
|
|
865
|
+
}, [s, e, t, f]), v(() => {
|
|
866
|
+
if (Object.keys(o).length > 0)
|
|
867
|
+
return d(e, o, n ?? void 0), () => {
|
|
868
|
+
l(e);
|
|
869
|
+
};
|
|
870
|
+
}, [e, d, l, n, o]), S(u, () => e, [e]), /* @__PURE__ */ k(j, {});
|
|
871
|
+
}
|
|
872
|
+
), Pe = b.forwardRef(
|
|
873
|
+
({ x1: t, y1: f, x2: r, y2: u, ...n }, d) => {
|
|
874
|
+
const l = m(() => new E.LinearGradient(), []);
|
|
875
|
+
return v(() => {
|
|
876
|
+
typeof t == "number" && (l.left.x = t), typeof f == "number" && (l.left.y = f), typeof r == "number" && (l.right.x = r), typeof u == "number" && (l.right.y = u);
|
|
877
|
+
for (const e in n)
|
|
878
|
+
e in l && (l[e] = n[e]);
|
|
879
|
+
}, [l, t, f, r, u, n]), S(d, () => l, [l]), null;
|
|
880
|
+
}
|
|
881
|
+
), be = b.forwardRef(
|
|
882
|
+
({ x: t, y: f, focalX: r, focalY: u, ...n }, d) => {
|
|
883
|
+
const l = m(() => new E.RadialGradient(), []);
|
|
884
|
+
return v(() => {
|
|
885
|
+
typeof t == "number" && (l.center.x = t), typeof f == "number" && (l.center.y = f), typeof r == "number" && (l.focal.x = r), typeof u == "number" && (l.focal.y = u);
|
|
886
|
+
for (const e in n)
|
|
887
|
+
e in l && (l[e] = n[e]);
|
|
888
|
+
}, [n, l, t, f, r, u]), S(d, () => l, [l]), null;
|
|
889
|
+
}
|
|
890
|
+
), Ee = b.forwardRef(
|
|
891
|
+
({ src: t, ...f }, r) => {
|
|
892
|
+
const u = m(() => new E.Texture(t), [t]);
|
|
893
|
+
return v(() => {
|
|
894
|
+
for (const n in f)
|
|
895
|
+
n in u && (u[n] = f[n]);
|
|
896
|
+
}, [f, u]), S(r, () => u, [u]), null;
|
|
423
897
|
}
|
|
424
898
|
);
|
|
425
899
|
export {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
900
|
+
fe as ArcSegment,
|
|
901
|
+
re as Canvas,
|
|
902
|
+
le as Circle,
|
|
903
|
+
N as Context,
|
|
904
|
+
ue as Ellipse,
|
|
905
|
+
oe as Group,
|
|
906
|
+
de as Image,
|
|
907
|
+
he as ImageSequence,
|
|
908
|
+
ve as Line,
|
|
909
|
+
Pe as LinearGradient,
|
|
910
|
+
se as Path,
|
|
911
|
+
ae as Points,
|
|
912
|
+
pe as Polygon,
|
|
913
|
+
be as RadialGradient,
|
|
914
|
+
ge as Rectangle,
|
|
915
|
+
me as RoundedRectangle,
|
|
916
|
+
ie as SVG,
|
|
917
|
+
we as Sprite,
|
|
918
|
+
ye as Star,
|
|
919
|
+
ce as Text,
|
|
920
|
+
Ee as Texture,
|
|
921
|
+
te as useFrame,
|
|
922
|
+
H as useTwo
|
|
448
923
|
};
|