@weasel-js/core 1.7.3 → 1.8.0

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/animation/colorHelpers.js +58 -58
  3. package/dist/animation/colorHelpers.js.map +1 -1
  4. package/dist/animation/engine/axes.js +36 -0
  5. package/dist/animation/engine/axes.js.map +1 -0
  6. package/dist/animation/engine/codec.js +170 -0
  7. package/dist/animation/engine/codec.js.map +1 -0
  8. package/dist/animation/engine/integrator.js +12 -0
  9. package/dist/animation/engine/integrator.js.map +1 -0
  10. package/dist/animation/useAnimator.js +199 -157
  11. package/dist/animation/useAnimator.js.map +1 -1
  12. package/dist/{builtins-C-gRyVRx.d.ts → builtins-BW32dOXy.d.ts} +74 -8
  13. package/dist/canvas/SceneCanvas/defaultNodeProperties.js +12 -12
  14. package/dist/canvas/SceneCanvas/defaultNodeProperties.js.map +1 -1
  15. package/dist/canvas/pickWalk.js +2 -2
  16. package/dist/canvas/pickWalk.js.map +1 -1
  17. package/dist/canvas/sceneSlotWiring.js +1 -1
  18. package/dist/canvas/sceneSlotWiring.js.map +1 -1
  19. package/dist/canvas/sceneViewRender.js +1 -1
  20. package/dist/canvas/sceneViewRender.js.map +1 -1
  21. package/dist/core/scene/effectivePose.js +1 -1
  22. package/dist/core/scene/effectivePose.js.map +1 -1
  23. package/dist/core/scene/poseOverrides.js +42 -22
  24. package/dist/core/scene/poseOverrides.js.map +1 -1
  25. package/dist/core/scene/types.js.map +1 -1
  26. package/dist/index.d.ts +28 -18
  27. package/dist/renderer/WeaselRenderer.js +4 -1
  28. package/dist/renderer/WeaselRenderer.js.map +1 -1
  29. package/dist/renderer/batchClip.js +46 -0
  30. package/dist/renderer/batchClip.js.map +1 -0
  31. package/dist/renderer/draw.js +367 -294
  32. package/dist/renderer/draw.js.map +1 -1
  33. package/dist/renderer/drawBatch.js +75 -45
  34. package/dist/renderer/drawBatch.js.map +1 -1
  35. package/dist/renderer.d.ts +1 -1
  36. package/dist/tools/builtin/text/useTextTool.js +8 -8
  37. package/dist/tools/builtin/text/useTextTool.js.map +1 -1
  38. package/dist/tools/prefs.js.map +1 -1
  39. package/dist/version.js +1 -1
  40. package/package.json +16 -15
@@ -1,51 +1,54 @@
1
1
  import { useVisibleRaf as e } from "../scheduling/useVisibleRaf.js";
2
2
  import { createLoop as t, createTweenLoop as n } from "./loop.js";
3
- import { createStagger as r } from "./stagger.js";
4
- import { createTimeline as i } from "./timeline/createTimeline.js";
5
- import { ColorOverrideRegistry as a } from "./colorRegistry.js";
6
- import { AnimatorEventHub as o } from "./observe.js";
7
- import { SPRING_PRESETS as s, easeOut as c, resolveEasing as l } from "@weasel-js/geom";
8
- import { useCallback as u, useEffect as d, useInsertionEffect as f, useMemo as p, useRef as m } from "react";
9
- import { useLatest as h } from "@weasel-js/react";
3
+ import { stepSpring as r } from "./engine/integrator.js";
4
+ import { createCodec as i } from "./engine/codec.js";
5
+ import { axesOf as a } from "./engine/axes.js";
6
+ import { createStagger as o } from "./stagger.js";
7
+ import { createTimeline as s } from "./timeline/createTimeline.js";
8
+ import { ColorOverrideRegistry as c } from "./colorRegistry.js";
9
+ import { AnimatorEventHub as l } from "./observe.js";
10
+ import { SPRING_PRESETS as u, easeOut as d, resolveEasing as f } from "@weasel-js/geom";
11
+ import { useCallback as p, useEffect as m, useInsertionEffect as h, useMemo as g, useRef as _ } from "react";
12
+ import { useLatest as v } from "@weasel-js/react";
10
13
  //#region src/animation/useAnimator.ts
11
- var g = (e, t, n) => e + (t - e) * n;
12
- function _(e) {
13
- let t = e.preset ? s[e.preset] : null;
14
+ function y(e) {
15
+ let t = e.preset ? u[e.preset] : null;
14
16
  return {
15
17
  stiffness: e.stiffness ?? t?.stiffness ?? 170,
16
18
  damping: e.damping ?? t?.damping ?? 26,
17
19
  mass: e.mass ?? t?.mass ?? 1
18
20
  };
19
21
  }
20
- function v(s = {}) {
21
- let v = h(s), y = m(/* @__PURE__ */ new Map()), b = m(1), x = m(0), S = m(1), C = m(!1), w = m(new a()), T = m(/* @__PURE__ */ new Set()), E = m(null), D = e(u((e) => {
22
- E.current?.(e);
22
+ function b(u = {}) {
23
+ let b = v(u), x = _(/* @__PURE__ */ new Map()), S = _(1), C = _(0), w = _(null), T = _(1), E = _(!1), D = _(new c()), O = _(/* @__PURE__ */ new Set()), k = _(null), A = e(p((e) => {
24
+ k.current?.(e);
23
25
  }, []), {
24
- requestFrame: s.requestFrame,
25
- cancelFrame: s.cancelFrame,
26
+ requestFrame: u.requestFrame,
27
+ cancelFrame: u.cancelFrame,
26
28
  onResume: () => {
27
- for (let e of y.current.values()) e.lastRealNow = null;
29
+ for (let e of x.current.values()) e.lastRealNow = null;
30
+ w.current = null;
28
31
  }
29
- }), O = h(D), k = m(!0), A = m(!1), j = () => !k.current && (A.current || (A.current = !0, (typeof process > "u" || process.env.NODE_ENV !== "production") && console.error("weasel useAnimator: animation tick fired after the host component unmounted. This usually means cleanup logic was bypassed — check for refactors that removed the unmount effect or replaced cancelAll with a custom path.")), !0), { api: M, tickAll: N } = p(() => {
30
- let e = () => (v.current.now ?? (typeof performance < "u" ? performance.now.bind(performance) : Date.now))(), a = {
31
- setTimer: (e, t) => (v.current.setTimer ?? ((e, t) => setTimeout(e, t)))(e, t),
32
- clearTimer: (e) => (v.current.clearTimer ?? ((e) => clearTimeout(e)))(e),
32
+ }), j = v(A), M = _(!0), N = _(!1), P = () => !M.current && (N.current || (N.current = !0, (typeof process > "u" || process.env.NODE_ENV !== "production") && console.error("weasel useAnimator: animation tick fired after the host component unmounted. This usually means cleanup logic was bypassed — check for refactors that removed the unmount effect or replaced cancelAll with a custom path.")), !0), { api: F, tickAll: I } = g(() => {
33
+ let e = () => (b.current.now ?? (typeof performance < "u" ? performance.now.bind(performance) : Date.now))(), c = {
34
+ setTimer: (e, t) => (b.current.setTimer ?? ((e, t) => setTimeout(e, t)))(e, t),
35
+ clearTimer: (e) => (b.current.clearTimer ?? ((e) => clearTimeout(e)))(e),
33
36
  now: e
34
- }, s = /* @__PURE__ */ new Map(), u = (e) => {
35
- let t = s.get(e);
37
+ }, u = /* @__PURE__ */ new Map(), p = (e) => {
38
+ let t = u.get(e);
36
39
  if (t) {
37
- s.delete(e);
40
+ u.delete(e);
38
41
  for (let e of t) e();
39
42
  }
40
- }, d = (e, t) => {
41
- let n = s.get(e) ?? [];
42
- return n.push(t), s.set(e, n), () => {
43
- let n = s.get(e);
43
+ }, m = (e, t) => {
44
+ let n = u.get(e) ?? [];
45
+ return n.push(t), u.set(e, n), () => {
46
+ let n = u.get(e);
44
47
  if (!n) return;
45
48
  let r = n.indexOf(t);
46
- r >= 0 && n.splice(r, 1), n.length === 0 && s.delete(e);
49
+ r >= 0 && n.splice(r, 1), n.length === 0 && u.delete(e);
47
50
  };
48
- }, f = new o(), p = (e) => {
51
+ }, h = new l(), g = i(), _ = (e) => {
49
52
  if (!e.info) {
50
53
  let t = {
51
54
  id: e.id,
@@ -54,73 +57,76 @@ function v(s = {}) {
54
57
  e.cancelKey != null && (t.key = e.cancelKey), e.label != null && (t.label = e.label), e.info = t;
55
58
  }
56
59
  return e.info;
57
- }, m = (e) => {
58
- let t = y.current.get(e);
59
- t && !t.ended && (t.ended = !0, f.watched && f.emit({
60
+ }, v = (e) => {
61
+ let t = x.current.get(e);
62
+ t && !t.ended && (t.ended = !0, h.watched && h.emit({
60
63
  type: "end",
61
- animation: p(t)
64
+ animation: _(t)
62
65
  }));
63
- }, h = (e, t) => {
64
- let n = y.current.get(e);
65
- n && (n.onCancel?.(), y.current.delete(e), u(e), f.watched && !n.ended && f.emit(t ? {
66
+ }, k = (e, t) => {
67
+ let n = x.current.get(e);
68
+ n && (n.onCancel?.(), g.stop(e), x.current.delete(e), p(e), h.watched && !n.ended && h.emit(t ? {
66
69
  type: "interrupt",
67
- animation: p(n),
68
- by: p(t)
70
+ animation: _(n),
71
+ by: _(t)
69
72
  } : {
70
73
  type: "cancel",
71
- animation: p(n)
74
+ animation: _(n)
72
75
  }));
73
- }, E = (e) => {
74
- let t = [];
75
- for (let n of y.current.values()) {
76
+ }, A = (e) => {
77
+ let t = [], n = w.current == null ? 0 : Math.max(0, e - w.current);
78
+ w.current = e, g.frame(n * (E.current ? 0 : T.current));
79
+ for (let n of x.current.values()) {
76
80
  let r = n.lastRealNow == null ? 0 : Math.max(0, e - n.lastRealNow);
77
81
  n.lastRealNow = e;
78
- let i = C.current ? 0 : S.current * (n.paused ? 0 : n.timeScale);
79
- n.virtualNow += r * i, x.current += 1;
82
+ let i = E.current ? 0 : T.current * (n.paused ? 0 : n.timeScale);
83
+ n.virtualNow += r * i, C.current += 1;
80
84
  try {
81
85
  n.tick(n.virtualNow, i) && t.push(n);
82
86
  } finally {
83
- --x.current;
87
+ --C.current;
84
88
  }
85
89
  }
86
- for (let e of t) y.current.get(e.id) === e && (m(e.id), y.current.delete(e.id), u(e.id));
87
- for (let e of T.current) try {
90
+ for (let e of t) x.current.get(e.id) === e && (v(e.id), x.current.delete(e.id), p(e.id));
91
+ for (let e of O.current) try {
88
92
  e();
89
93
  } catch (e) {
90
94
  console.error("useAnimator: onTick subscriber threw", e);
91
95
  }
92
- y.current.size > 0 && O.current.request();
93
- }, D = () => {
94
- y.current.size !== 0 && O.current.request();
95
- }, k = (e, t) => {
96
+ x.current.size > 0 ? j.current.request() : w.current = null;
97
+ }, M = () => {
98
+ x.current.size !== 0 && j.current.request();
99
+ }, N = (e, t) => {
96
100
  let n = [];
97
- for (let t of y.current.values()) t.cancelKey === e && n.push(t.id);
98
- for (let e of n) h(e, t);
99
- }, A = (t) => {
101
+ for (let t of x.current.values()) t.cancelKey === e && n.push(t.id);
102
+ for (let e of n) k(e, t);
103
+ }, F = (e) => {
104
+ g.has(e.id) && g.rate(e.id, e.paused ? 0 : e.timeScale);
105
+ }, I = (t) => {
100
106
  let n = t;
101
- return t.cancelKey != null && !t.keepExisting && k(t.cancelKey, n), n.paused = !1, n.timeScale = 1, n.virtualNow = 0, n.lastRealNow = e(), y.current.set(n.id, n), f.watched && f.emit({
107
+ return t.cancelKey != null && !t.keepExisting && N(t.cancelKey, n), n.paused = !1, n.timeScale = 1, n.virtualNow = 0, n.lastRealNow = e(), x.current.set(n.id, n), h.watched && h.emit({
102
108
  type: "start",
103
- animation: p(n)
104
- }), D(), {
109
+ animation: _(n)
110
+ }), M(), {
105
111
  id: n.id,
106
- cancel: () => h(n.id),
112
+ cancel: () => k(n.id),
107
113
  pause: () => {
108
- let e = y.current.get(n.id);
109
- e && (e.paused = !0);
114
+ let e = x.current.get(n.id);
115
+ e && (e.paused = !0, F(e));
110
116
  },
111
117
  resume: () => {
112
- let e = y.current.get(n.id);
113
- e && (e.paused = !1);
118
+ let e = x.current.get(n.id);
119
+ e && (e.paused = !1, F(e));
114
120
  },
115
121
  setTimeScale: (e) => {
116
- let t = y.current.get(n.id);
117
- t && (t.timeScale = e);
122
+ let t = x.current.get(n.id);
123
+ t && (t.timeScale = e, F(t));
118
124
  },
119
- timeScale: () => y.current.get(n.id)?.timeScale ?? 1,
120
- isPaused: () => y.current.get(n.id)?.paused ?? !1
125
+ timeScale: () => x.current.get(n.id)?.timeScale ?? 1,
126
+ isPaused: () => x.current.get(n.id)?.paused ?? !1
121
127
  };
122
- }, M = ({ kind: e, cancelKey: t, label: n }) => {
123
- let r = b.current++, i, a = A({
128
+ }, L = ({ kind: e, cancelKey: t, label: n }) => {
129
+ let r = S.current++, i, a = I({
124
130
  id: r,
125
131
  kind: e,
126
132
  cancelKey: t,
@@ -140,61 +146,97 @@ function v(s = {}) {
140
146
  i = e;
141
147
  },
142
148
  finish: () => {
143
- y.current.has(r) && (m(r), y.current.delete(r), u(r));
149
+ x.current.has(r) && (v(r), x.current.delete(r), p(r));
144
150
  },
145
151
  cancelKey: t
146
152
  };
147
- }, N = (e) => {
148
- let t = b.current++, n = l(e.easing ?? c), r = e.interpolator ? e.interpolator(e.from, e.to) : null, i = r ? null : e.interpolate ?? ((e, t, n) => {
149
- if (typeof e == "number" && typeof t == "number") return g(e, t, n);
150
- throw Error("tween: interpolate or interpolator is required for non-numeric T");
151
- }), a = !1;
152
- return A({
153
- id: t,
153
+ }, R = (t) => {
154
+ let n = t.interpolate || t.interpolator ? null : a(t.from), r = n && a(t.to), i = n && r && r.shape === n.shape ? n : null;
155
+ if (!i && !t.interpolate && !t.interpolator) throw Error("tween: interpolate or interpolator is required for non-numeric T");
156
+ let o = S.current++, s = f(t.easing ?? d), c = t.interpolator ? t.interpolator(t.from, t.to) : null, l = !1;
157
+ w.current ??= e();
158
+ let u = g.tween({
159
+ id: o,
160
+ ms: Math.max(t.ms, 1),
161
+ ease: s,
162
+ from: i ? i.to(t.from) : [0],
163
+ to: i ? i.to(t.to) : [1]
164
+ });
165
+ return I({
166
+ id: o,
154
167
  kind: "tween",
155
- cancelKey: e.cancelKey,
156
- label: e.label,
157
- progress: (t) => e.ms <= 0 ? 1 : Math.min(1, t / e.ms),
158
- tick(o) {
159
- if (j()) return !0;
160
- let s = o - 0, c = e.ms <= 0 ? 1 : Math.min(1, Math.max(0, s / e.ms)), l = n(c), u = r ? r(l) : i(e.from, e.to, l);
161
- return e.onTick(u), c >= 1 && !a && (a = !0, y.current.has(t) && (m(t), e.onDone?.()), !0);
168
+ cancelKey: t.cancelKey,
169
+ label: t.label,
170
+ progress: (e) => t.ms <= 0 ? 1 : Math.min(1, e / t.ms),
171
+ tick(e) {
172
+ if (P()) return g.stop(o), !0;
173
+ let n = t.ms <= 0 ? 1 : Math.min(1, e / t.ms), r;
174
+ if (i) r = n >= 1 ? t.to : i.from(u.cols, u.at);
175
+ else {
176
+ let e = n >= 1 ? s(1) : u.cols[u.at];
177
+ r = c ? c(e) : t.interpolate(t.from, t.to, e);
178
+ }
179
+ return t.onTick(r), n >= 1 && !l && (l = !0, g.stop(o), x.current.has(o) && (v(o), t.onDone?.()), !0);
162
180
  }
163
181
  });
164
- }, P = (e, t = "physics") => {
165
- let n = b.current++;
166
- if (typeof e.from != "number" && (!e.add || !e.subtract || !e.scale || !e.magnitude)) throw Error("physics: add/subtract/scale/magnitude are required for non-numeric T");
167
- let r = e.add ?? ((e, t) => e + t), i = e.subtract ?? ((e, t) => e - t), a = e.scale ?? ((e, t) => e * t), o = e.magnitude ?? ((e) => Math.abs(e)), { stiffness: s, damping: c, mass: l } = _(e), u = e.restThreshold ?? .01, d = e.to ?? null, f = e.from, p = e.velocity ?? a(e.from, 0), h = null;
168
- return {
169
- ...A({
170
- id: n,
171
- kind: t,
172
- cancelKey: e.cancelKey,
173
- label: e.label,
174
- tick(t) {
175
- if (j()) return !0;
176
- if (h == null) return h = t, d == null && o(p) < u ? (m(n), e.onDone?.(), !0) : (e.onTick(f), !1);
177
- let g = Math.min(.064, (t - h) / 1e3);
178
- h = t;
179
- let _ = i(f, d ?? f), v = a(_, d == null ? 0 : -s), y = a(p, -c), b = a(r(v, y), 1 / l);
180
- p = r(p, a(b, g)), f = r(f, a(p, g)), e.onTick(f);
181
- let x = o(p) < u, S = d == null || o(i(f, d)) < u;
182
- return x && S ? (d != null && e.onTick(d), m(n), e.onDone?.(), !0) : !1;
182
+ }, z = (t, n = "physics") => {
183
+ let i = S.current++;
184
+ if (typeof t.from != "number" && (!t.add || !t.subtract || !t.scale || !t.magnitude)) throw Error("physics: add/subtract/scale/magnitude are required for non-numeric T");
185
+ let o = t.add ?? ((e, t) => e + t), s = t.subtract ?? ((e, t) => e - t), c = t.scale ?? ((e, t) => e * t), l = t.magnitude ?? ((e) => Math.abs(e)), { stiffness: u, damping: d, mass: f } = y(t), p = t.restThreshold ?? .01, m = t.to ?? null, h = t.from, _ = t.velocity ?? c(t.from, 0), b = null, x = d > 0 && f > 0 && (u > 0 || n === "decay") ? a(t.from) : null, C = (e) => e == null || a(e)?.shape === x.shape, T = x && C(t.to) && C(t.velocity) ? x : null, E = null;
186
+ T && (w.current ??= e(), E = g.spring({
187
+ id: i,
188
+ axes: T.count,
189
+ from: T.to(t.from),
190
+ to: t.to == null ? null : T.to(t.to),
191
+ velocity: t.velocity == null ? Array(T.count).fill(0) : T.to(t.velocity),
192
+ stiffness: u,
193
+ damping: d,
194
+ mass: f
195
+ }));
196
+ let D = I({
197
+ id: i,
198
+ kind: n,
199
+ cancelKey: t.cancelKey,
200
+ label: t.label,
201
+ tick(e) {
202
+ if (P()) return g.stop(i), !0;
203
+ if (b == null) {
204
+ if (b = e, m == null && l(_) < p) return g.stop(i), v(i), t.onDone?.(), !0;
205
+ if (!T) return t.onTick(h), !1;
206
+ }
207
+ if (T) {
208
+ let e = E.motion();
209
+ h = T.from(e.value), _ = T.from(e.velocity);
210
+ } else {
211
+ let t = Math.min(.064, (e - b) / 1e3), n = r({
212
+ add: o,
213
+ subtract: s,
214
+ scale: c
215
+ }, h, _, m, u, d, f, t);
216
+ h = n.value, _ = n.velocity;
183
217
  }
184
- }),
218
+ b = e, t.onTick(h);
219
+ let n = l(_) < p, a = m == null || l(s(h, m)) < p;
220
+ return n && a ? (m != null && t.onTick(m), g.stop(i), v(i), t.onDone?.(), !0) : !1;
221
+ }
222
+ }), O = (e, t) => {
223
+ if (!C(e)) throw Error(`physics: ${t} is not the same shape as \`from\``);
224
+ };
225
+ return {
226
+ ...D,
185
227
  setTarget: (e) => {
186
- d = e;
228
+ T && e != null && O(e, "setTarget"), m = e, T && g.has(i) && g.retarget(i, e == null ? null : T.to(e));
187
229
  },
188
230
  setVelocity: (e) => {
189
- p = e;
231
+ T && O(e, "setVelocity"), _ = e, T && g.has(i) && g.push(i, T.to(e));
190
232
  }
191
233
  };
192
- }, F = {
193
- tween: N,
194
- spring: (e) => P(e, "spring"),
234
+ }, B = {
235
+ tween: R,
236
+ spring: (e) => z(e, "spring"),
195
237
  decay: (e) => {
196
238
  let t = e.friction ?? .95, n = -Math.log(t);
197
- return P({
239
+ return z({
198
240
  from: e.from,
199
241
  to: null,
200
242
  velocity: e.velocity,
@@ -212,61 +254,61 @@ function v(s = {}) {
212
254
  label: e.label
213
255
  }, "decay");
214
256
  },
215
- physics: P,
216
- cancel: (e) => h(e.id),
217
- cancelKey: (e) => k(e),
257
+ physics: z,
258
+ cancel: (e) => k(e.id),
259
+ cancelKey: (e) => N(e),
218
260
  cancelAll: () => {
219
261
  let e = [];
220
- for (let t of y.current.values()) t.onCancel?.(), e.push(t);
221
- y.current.clear();
222
- for (let t of e) u(t.id);
223
- if (f.watched) for (let t of e) f.emit({
262
+ for (let t of x.current.values()) t.onCancel?.(), g.stop(t.id), e.push(t);
263
+ x.current.clear(), w.current = null;
264
+ for (let t of e) p(t.id);
265
+ if (h.watched) for (let t of e) h.emit({
224
266
  type: "cancel",
225
- animation: p(t)
267
+ animation: _(t)
226
268
  });
227
- O.current.cancel();
269
+ j.current.cancel();
228
270
  },
229
271
  isActive: (e) => {
230
- if (e == null) return y.current.size > 0;
231
- for (let t of y.current.values()) if (t.cancelKey === e) return !0;
272
+ if (e == null) return x.current.size > 0;
273
+ for (let t of x.current.values()) if (t.cancelKey === e) return !0;
232
274
  return !1;
233
275
  },
234
- isTicking: () => x.current > 0,
276
+ isTicking: () => C.current > 0,
235
277
  pause: () => {
236
- C.current = !0;
278
+ E.current = !0;
237
279
  },
238
280
  resume: () => {
239
- C.current = !1;
281
+ E.current = !1;
240
282
  },
241
- isPaused: () => C.current,
283
+ isPaused: () => E.current,
242
284
  setTimeScale: (e) => {
243
- S.current = e;
285
+ T.current = e;
244
286
  },
245
- timeScale: () => S.current,
287
+ timeScale: () => T.current,
246
288
  pauseKey: (e) => {
247
- for (let t of y.current.values()) t.cancelKey === e && (t.paused = !0);
289
+ for (let t of x.current.values()) t.cancelKey === e && (t.paused = !0, F(t));
248
290
  },
249
291
  resumeKey: (e) => {
250
- for (let t of y.current.values()) t.cancelKey === e && (t.paused = !1);
292
+ for (let t of x.current.values()) t.cancelKey === e && (t.paused = !1, F(t));
251
293
  },
252
294
  setTimeScaleByKey: (e, t) => {
253
- for (let n of y.current.values()) n.cancelKey === e && (n.timeScale = t);
295
+ for (let n of x.current.values()) n.cancelKey === e && (n.timeScale = t, F(n));
254
296
  },
255
- loop: (e, n) => t(M, e, n),
256
- tweenLoop: (e) => n(F, M, e),
257
- stagger: ((e, t, n, i) => r(F, a, M, d, e, t, n, i)),
297
+ loop: (e, n) => t(L, e, n),
298
+ tweenLoop: (e) => n(B, L, e),
299
+ stagger: ((e, t, n, r) => o(B, c, L, m, e, t, n, r)),
258
300
  timeline: (e) => {
259
- let t = b.current++, n = () => {
260
- let e = y.current.get(t);
261
- return e && p(e);
301
+ let t = S.current++, n = () => {
302
+ let e = x.current.get(t);
303
+ return e && _(e);
262
304
  };
263
- return i(A, t, e, {
305
+ return s(I, t, e, {
264
306
  get watched() {
265
- return f.watched;
307
+ return h.watched;
266
308
  },
267
309
  fire: (e, t, r, i) => {
268
310
  let a = n();
269
- a && f.emit({
311
+ a && h.emit({
270
312
  type: "fire",
271
313
  animation: a,
272
314
  track: e,
@@ -277,7 +319,7 @@ function v(s = {}) {
277
319
  },
278
320
  lap: (e) => {
279
321
  let t = n();
280
- t && f.emit({
322
+ t && h.emit({
281
323
  type: "lap",
282
324
  animation: t,
283
325
  lap: e
@@ -285,20 +327,20 @@ function v(s = {}) {
285
327
  }
286
328
  });
287
329
  },
288
- colorOverrides: w.current,
289
- onTick: (e) => (T.current.add(e), () => {
290
- T.current.delete(e);
330
+ colorOverrides: D.current,
331
+ onTick: (e) => (O.current.add(e), () => {
332
+ O.current.delete(e);
291
333
  }),
292
334
  keepAlive: () => {
293
- let e = M({ kind: "keepAlive" });
335
+ let e = L({ kind: "keepAlive" });
294
336
  return () => e.cancel();
295
337
  },
296
- watch: (e) => f.add(e),
338
+ watch: (e) => h.add(e),
297
339
  live: () => {
298
340
  let e = [];
299
- for (let t of y.current.values()) {
341
+ for (let t of x.current.values()) {
300
342
  let n = {
301
- ...p(t),
343
+ ..._(t),
302
344
  paused: t.paused,
303
345
  timeScale: t.timeScale,
304
346
  elapsed: t.virtualNow,
@@ -310,20 +352,20 @@ function v(s = {}) {
310
352
  }
311
353
  };
312
354
  return {
313
- api: F,
314
- tickAll: E
355
+ api: B,
356
+ tickAll: A
315
357
  };
316
- }, [O, v]);
317
- return f(() => {
318
- E.current = N;
319
- }, [N]), d(() => {
320
- let e = w.current;
321
- return k.current = !0, () => {
322
- k.current = !1, M.cancelAll(), e.clearAll();
358
+ }, [j, b]);
359
+ return h(() => {
360
+ k.current = I;
361
+ }, [I]), m(() => {
362
+ let e = D.current;
363
+ return M.current = !0, () => {
364
+ M.current = !1, F.cancelAll(), e.clearAll();
323
365
  };
324
- }, [M]), M;
366
+ }, [F]), F;
325
367
  }
326
368
  //#endregion
327
- export { v as useAnimator };
369
+ export { b as useAnimator };
328
370
 
329
371
  //# sourceMappingURL=useAnimator.js.map