@mkbabb/keyframes.js 5.1.0 → 5.2.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.
- package/README.md +83 -3
- package/dist/backward-color-BtbRcnna.js +108 -0
- package/dist/compile-BHCTPerD.js +30 -0
- package/dist/{delegation-DWwr4IXr.js → delegation-BQYCrP2p.js} +5 -9
- package/dist/{draw-svg-GURj9nin.js → draw-svg-CK9Qrly8.js} +13 -25
- package/dist/easing-serialize-D4LZCB6i.js +21 -0
- package/dist/engine/index.d.ts +422 -156
- package/dist/engine/index.js +16 -17
- package/dist/engine-CPK_udUQ.js +1172 -0
- package/dist/engine-DlpimZtM.js +3 -0
- package/dist/entry-D82NKUhP.js +148 -0
- package/dist/format-BdIvdLzG.js +114 -0
- package/dist/{group-vJcsHKN9.js → group-HM7N4uOE.js} +153 -123
- package/dist/handle-D4xrf_ya.js +21 -0
- package/dist/{ingest-S5hUe20K.js → ingest-_g6tfk2e.js} +2 -2
- package/dist/keyframes.d.ts +702 -178
- package/dist/keyframes.js +295 -74
- package/dist/morph-svg-KUrH9KnK.js +79 -0
- package/dist/motion-path-wM5tPfrY.js +26 -0
- package/dist/presets-DeDJYL4G.js +275 -0
- package/dist/{scheduler-CUtVnuoU.js → scheduler-CfGIC3GX.js} +1 -1
- package/dist/{scroll-CxpYFO4u.js → scroll-BEyCx0b_.js} +165 -58
- package/dist/{sequence-C_DCiOIQ.js → sequence-s0bL7Uul.js} +118 -90
- package/dist/{validate-DDeGnvSt.js → validate-xFZ_Ld1k.js} +7 -7
- package/dist/view-transition-BPJQxUTC.js +305 -0
- package/package.json +113 -83
- package/dist/animation-BGyzfzBq.js +0 -947
- package/dist/compile-CcSUwM8R.js +0 -276
- package/dist/engine-DEVgCTUy.js +0 -156
- package/dist/engine-DrBtsKaf.js +0 -4
- package/dist/format-C-Gi9r7L.js +0 -123
- package/dist/grammar-BLucehC4.js +0 -23
- package/dist/morph-svg-BToeumw5.js +0 -89
- package/dist/motion-path-pQVbamWT.js +0 -35
- package/dist/presets-BG2Fczzq.js +0 -275
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { n as e } from "./presets-
|
|
2
|
-
import { d as t, l as n, s as r } from "./sequence-
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { ValueUnit as
|
|
1
|
+
import { n as e } from "./presets-DeDJYL4G.js";
|
|
2
|
+
import { d as t, l as n, s as r } from "./sequence-s0bL7Uul.js";
|
|
3
|
+
import { a as i, i as a, m as o, o as s, p as c, r as l } from "./engine-CPK_udUQ.js";
|
|
4
|
+
import { n as u } from "./scheduler-CfGIC3GX.js";
|
|
5
|
+
import { ValueUnit as d, lerp as f } from "@mkbabb/value.js";
|
|
6
6
|
//#region src/animation/group/entries.ts
|
|
7
|
-
var
|
|
8
|
-
let r =
|
|
7
|
+
var p = (e) => typeof e == "string" ? e : a(e), m = (e, t, n) => {
|
|
8
|
+
let r = p(t), i = e[r];
|
|
9
9
|
if (!i) throw Error(`AnimationGroup.${n}: no animation registered for key "${r}". Known keys: ${Object.keys(e).join(", ") || "(none)"}.`);
|
|
10
10
|
return i;
|
|
11
|
-
},
|
|
11
|
+
}, h = (e) => {
|
|
12
12
|
let t = /* @__PURE__ */ new Set();
|
|
13
13
|
for (let n of e) {
|
|
14
14
|
let e = n.layer.properties;
|
|
15
15
|
for (let r of n.animation.flatKeys) e && !e.has(r) || t.add(r);
|
|
16
16
|
}
|
|
17
17
|
return [...t];
|
|
18
|
-
},
|
|
18
|
+
}, g = (e) => {
|
|
19
19
|
let t = !0;
|
|
20
20
|
for (let n of e) n.animation.interpFrames(n.animation.t, !0), t &&= n.animation.done;
|
|
21
21
|
return t;
|
|
22
|
-
},
|
|
22
|
+
}, _ = (e) => {
|
|
23
23
|
for (let t of e) {
|
|
24
24
|
let e = t.animation;
|
|
25
25
|
e.started = !0, e.t = e.options.duration, e.interpFrames(e.t, !0);
|
|
26
26
|
}
|
|
27
|
-
}, _ = (e, t) => {
|
|
28
|
-
for (let n of e) n.animation.paused = t;
|
|
29
27
|
}, v = (e, t) => {
|
|
28
|
+
for (let n of e) n.animation.paused = t;
|
|
29
|
+
}, y = (e, t) => {
|
|
30
30
|
let n;
|
|
31
31
|
for (let r of e) {
|
|
32
32
|
let e = r.animation;
|
|
@@ -35,32 +35,32 @@ var f = (e) => typeof e == "string" ? e : s(e), p = (e, t, n) => {
|
|
|
35
35
|
typeof i != "number" && (n ??= []).push(i);
|
|
36
36
|
}
|
|
37
37
|
return n && Promise.all(n).then(() => void 0);
|
|
38
|
-
},
|
|
39
|
-
for (let r = 0; r < e.length; r += n) await
|
|
40
|
-
},
|
|
38
|
+
}, b = async (e, t, n) => {
|
|
39
|
+
for (let r = 0; r < e.length; r += n) await y(e.slice(r, r + n), t), r + n < e.length && await u();
|
|
40
|
+
}, x = (e, t, n) => {
|
|
41
41
|
let i = new r({
|
|
42
42
|
...n,
|
|
43
43
|
initial: e
|
|
44
44
|
});
|
|
45
45
|
return i.target = t, i;
|
|
46
|
-
},
|
|
46
|
+
}, S = (e, t) => {
|
|
47
47
|
let n = !1;
|
|
48
48
|
for (let r of e) {
|
|
49
49
|
let e = r.layer.weightSpring;
|
|
50
50
|
e !== void 0 && (t > 0 && e.tickDt(t), e.settled ? (r.layer.weight = e.value, delete r.layer.weightSpring) : n = !0);
|
|
51
51
|
}
|
|
52
52
|
return n;
|
|
53
|
-
},
|
|
53
|
+
}, C = (e) => e instanceof d && typeof e.value == "number", w = (e, t) => {
|
|
54
54
|
let { carriers: n, incomings: r } = t, i = n.length;
|
|
55
55
|
if (i !== 0) {
|
|
56
56
|
for (let t = 0; t < i; t++) e[t] = n[t].value;
|
|
57
57
|
if (t.weighted) {
|
|
58
58
|
let n = t.layer.weightSpring?.value ?? t.layer.weight;
|
|
59
|
-
for (let t = 0; t < i; t++) e[t] =
|
|
59
|
+
for (let t = 0; t < i; t++) e[t] = f(e[t], r[t].value, n);
|
|
60
60
|
} else for (let t = 0; t < i; t++) e[t] = e[t] + r[t].value;
|
|
61
61
|
for (let t = 0; t < i; t++) n[t].value = e[t];
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, T = (e, t) => {
|
|
64
64
|
let n = [], r = {}, i = 0;
|
|
65
65
|
for (let t of e) {
|
|
66
66
|
let { layer: e, values: a } = t;
|
|
@@ -74,7 +74,7 @@ var f = (e) => typeof e == "string" ? e : s(e), p = (e, t, n) => {
|
|
|
74
74
|
}
|
|
75
75
|
continue;
|
|
76
76
|
}
|
|
77
|
-
let c = [], l = [], u =
|
|
77
|
+
let c = [], l = [], u = /* @__PURE__ */ new Set();
|
|
78
78
|
for (let e in a) {
|
|
79
79
|
if (o && !o.has(e)) continue;
|
|
80
80
|
let t = a[e];
|
|
@@ -82,13 +82,13 @@ var f = (e) => typeof e == "string" ? e : s(e), p = (e, t, n) => {
|
|
|
82
82
|
let n = r[e];
|
|
83
83
|
if (Array.isArray(n) && Array.isArray(t)) {
|
|
84
84
|
let r = Math.min(n.length, t.length), i = !0;
|
|
85
|
-
for (let e = 0; e < r; e++) if (!
|
|
85
|
+
for (let e = 0; e < r; e++) if (!C(n[e]) || !C(t[e])) {
|
|
86
86
|
i = !1;
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
if (i) for (let e = 0; e < r; e++) c.push(n[e]), l.push(t[e]);
|
|
90
|
-
else u.
|
|
91
|
-
} else u.
|
|
90
|
+
else u.add(e);
|
|
91
|
+
} else u.add(e), r[e] = t;
|
|
92
92
|
}
|
|
93
93
|
c.length > i && (i = c.length), n.push({
|
|
94
94
|
layer: e,
|
|
@@ -106,112 +106,169 @@ var f = (e) => typeof e == "string" ? e : s(e), p = (e, t, n) => {
|
|
|
106
106
|
};
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/animation/group/compositor.ts
|
|
109
|
-
function
|
|
109
|
+
function E(e, t) {
|
|
110
110
|
let n = e._grouped;
|
|
111
|
-
e._groupedKeysDirty && (e._groupedKeys =
|
|
111
|
+
e._groupedKeysDirty && (e._groupedKeys = h(e.getEntries()), e._groupedKeysDirty = !1, e._soaPlans = null, e._plainProj = null);
|
|
112
112
|
let r = e._groupedKeys;
|
|
113
113
|
for (let e = 0; e < r.length; e++) n[r[e]] = void 0;
|
|
114
|
-
let
|
|
115
|
-
for (let t of
|
|
116
|
-
let { animation: r, layer: i, values:
|
|
117
|
-
if (
|
|
118
|
-
r.interpFrames(r.t, !1,
|
|
119
|
-
let
|
|
114
|
+
let a = e.getEntries(), o = e._soaPlans !== null, l = 0, u = !0;
|
|
115
|
+
for (let t of a) {
|
|
116
|
+
let { animation: r, layer: i, values: a } = t;
|
|
117
|
+
if (u &&= r.done, !i.enabled) continue;
|
|
118
|
+
r.interpFrames(r.t, !1, a);
|
|
119
|
+
let s = i.properties;
|
|
120
120
|
if (i.blendMode === "replace") {
|
|
121
|
-
for (let e in
|
|
122
|
-
if (
|
|
123
|
-
let t =
|
|
121
|
+
for (let e in a) {
|
|
122
|
+
if (s && !s.has(e)) continue;
|
|
123
|
+
let t = a[e];
|
|
124
124
|
t !== void 0 && (n[e] = t);
|
|
125
125
|
}
|
|
126
126
|
continue;
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
129
|
-
let t = e._soaPlans[
|
|
130
|
-
|
|
131
|
-
} else
|
|
128
|
+
if (o) {
|
|
129
|
+
let t = e._soaPlans[l++];
|
|
130
|
+
w(e._compositeBuf, t), t.boxedKeys.size > 0 && D(i, a, n, s, t.boxedKeys);
|
|
131
|
+
} else D(i, a, n, s);
|
|
132
132
|
}
|
|
133
|
-
if (!
|
|
134
|
-
let { plans: t, compositeBuf: n } =
|
|
133
|
+
if (!o) {
|
|
134
|
+
let { plans: t, compositeBuf: n } = T(a, e._compositeBuf);
|
|
135
135
|
e._soaPlans = t, e._compositeBuf = n;
|
|
136
136
|
}
|
|
137
|
-
e.done =
|
|
137
|
+
e.done = u;
|
|
138
138
|
for (let e = 0; e < r.length; e++) {
|
|
139
139
|
let t = r[e];
|
|
140
140
|
n[t] === void 0 && delete n[t];
|
|
141
141
|
}
|
|
142
|
-
if (e.transform ===
|
|
142
|
+
if (e.transform === c) for (let t of e.getEntries()) {
|
|
143
143
|
let n = t.animation.frames[0];
|
|
144
144
|
if (n != null && n.transform != null) {
|
|
145
|
-
e.transform = n.transform;
|
|
145
|
+
e.transform = n.transform, e.unflatten = t.animation.unflatten;
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
if (e.unflatten) {
|
|
150
|
+
let r = e._plainProj;
|
|
151
|
+
r === null ? (r = i(n), e._plainProj = r) : s(r), e.transform(r.root, t);
|
|
152
|
+
} else e.transform(n, t);
|
|
153
|
+
return n;
|
|
150
154
|
}
|
|
151
|
-
function
|
|
152
|
-
let a = i ? new Set(i) : void 0;
|
|
155
|
+
function D(e, t, n, r, i) {
|
|
153
156
|
if (e.blendMode === "add") {
|
|
154
157
|
for (let e in t) {
|
|
155
|
-
if (
|
|
156
|
-
let
|
|
157
|
-
if (
|
|
158
|
+
if (i && !i.has(e) || r && !r.has(e)) continue;
|
|
159
|
+
let a = t[e];
|
|
160
|
+
if (a === void 0) continue;
|
|
158
161
|
let o = n[e];
|
|
159
|
-
if (Array.isArray(o) && Array.isArray(
|
|
160
|
-
let e = Math.min(o.length,
|
|
161
|
-
for (let t = 0; t < e; t++)
|
|
162
|
-
} else n[e] =
|
|
162
|
+
if (Array.isArray(o) && Array.isArray(a)) {
|
|
163
|
+
let e = Math.min(o.length, a.length);
|
|
164
|
+
for (let t = 0; t < e; t++) C(o[t]) && C(a[t]) ? o[t].value += a[t].value : o[t] = a[t];
|
|
165
|
+
} else n[e] = a;
|
|
163
166
|
}
|
|
164
167
|
return;
|
|
165
168
|
}
|
|
166
|
-
let
|
|
169
|
+
let a = e.weightSpring?.value ?? e.weight;
|
|
167
170
|
for (let e in t) {
|
|
168
|
-
if (
|
|
169
|
-
let
|
|
170
|
-
if (
|
|
171
|
+
if (i && !i.has(e) || r && !r.has(e)) continue;
|
|
172
|
+
let o = t[e];
|
|
173
|
+
if (o === void 0) continue;
|
|
171
174
|
let s = n[e];
|
|
172
|
-
if (Array.isArray(s) && Array.isArray(
|
|
173
|
-
let e = Math.min(s.length,
|
|
174
|
-
for (let t = 0; t < e; t++)
|
|
175
|
-
} else n[e] =
|
|
175
|
+
if (Array.isArray(s) && Array.isArray(o)) {
|
|
176
|
+
let e = Math.min(s.length, o.length);
|
|
177
|
+
for (let t = 0; t < e; t++) C(s[t]) && C(o[t]) ? s[t].value = f(s[t].value, o[t].value, a) : s[t] = o[t];
|
|
178
|
+
} else n[e] = o;
|
|
176
179
|
}
|
|
177
180
|
}
|
|
178
181
|
//#endregion
|
|
179
182
|
//#region src/animation/group/layer-api.ts
|
|
180
|
-
function
|
|
181
|
-
let r =
|
|
183
|
+
function O(e, t, n) {
|
|
184
|
+
let r = m(e.animations, t, "setLayerConfig");
|
|
182
185
|
Object.assign(r.layer, n), e.invalidateEntries();
|
|
183
186
|
}
|
|
184
|
-
function
|
|
185
|
-
return e.animations[
|
|
187
|
+
function k(e, t) {
|
|
188
|
+
return e.animations[p(t)]?.layer;
|
|
186
189
|
}
|
|
187
|
-
function
|
|
188
|
-
let i =
|
|
190
|
+
function A(e, t, n) {
|
|
191
|
+
let i = m(e.animations, t, "transitionLayer").layer;
|
|
189
192
|
i.blendMode = "weighted";
|
|
190
193
|
let a = i.weightSpring;
|
|
191
|
-
a instanceof r ? a.target = n.weight : i.weightSpring =
|
|
194
|
+
a instanceof r ? a.target = n.weight : i.weightSpring = x(i.weight, n.weight, n.spring), e._hasLayerSprings = !0, e.invalidateEntries();
|
|
192
195
|
}
|
|
193
|
-
function
|
|
196
|
+
function j(e, t, n, r) {
|
|
194
197
|
let i = r?.spring;
|
|
195
|
-
|
|
198
|
+
A(e, t, {
|
|
196
199
|
weight: 0,
|
|
197
200
|
...i ? { spring: i } : {}
|
|
198
|
-
}),
|
|
201
|
+
}), A(e, n, {
|
|
199
202
|
weight: 1,
|
|
200
203
|
...i ? { spring: i } : {}
|
|
201
204
|
});
|
|
202
205
|
}
|
|
203
206
|
//#endregion
|
|
207
|
+
//#region src/animation/group/lifecycle.ts
|
|
208
|
+
function M(e) {
|
|
209
|
+
let t = e.resolvePromise;
|
|
210
|
+
e.resolvePromise = null, t?.();
|
|
211
|
+
}
|
|
212
|
+
async function N(e) {
|
|
213
|
+
if (e._playingPromise) return e._playingPromise;
|
|
214
|
+
let n = t(e.respectReducedMotion, () => P(e), () => new Promise((t) => {
|
|
215
|
+
e.resolvePromise = t, e.playback.loop(e._boundFrame);
|
|
216
|
+
}));
|
|
217
|
+
return e._playingPromise = n, n.finally(() => {
|
|
218
|
+
e._playingPromise = null;
|
|
219
|
+
}), n;
|
|
220
|
+
}
|
|
221
|
+
function P(e) {
|
|
222
|
+
e.started = !0;
|
|
223
|
+
let t = e.lastTickTime;
|
|
224
|
+
return _(e.getEntries()), e.singleTarget && E(e, t), e.settle(), Promise.resolve();
|
|
225
|
+
}
|
|
226
|
+
function F(e) {
|
|
227
|
+
if (!e.started || e.paused) return;
|
|
228
|
+
e.paused = !0;
|
|
229
|
+
let t = e.lastTickTime;
|
|
230
|
+
for (let n of e.getEntries()) {
|
|
231
|
+
let e = n.animation;
|
|
232
|
+
e.pause(), e.pausedTime === 0 && (e.pausedTime = t);
|
|
233
|
+
}
|
|
234
|
+
e.playback.stop(), e.render();
|
|
235
|
+
}
|
|
236
|
+
function I(e) {
|
|
237
|
+
!e.started || !e.paused || (e.paused = !1, v(e.getEntries(), !1), e.playback.loop(e._boundFrame));
|
|
238
|
+
}
|
|
239
|
+
function L(e) {
|
|
240
|
+
for (let t of e.getEntries()) t.animation.managed = !1, t.animation.settle();
|
|
241
|
+
e.started = !1, e.done = !1, e.paused = !1, e.lastTickTime = 0;
|
|
242
|
+
}
|
|
243
|
+
function R(e) {
|
|
244
|
+
for (let t of e.getEntries()) {
|
|
245
|
+
let e = t.animation;
|
|
246
|
+
e.started && e.frames.length > 0 && e.interpFrames(0, !0);
|
|
247
|
+
}
|
|
248
|
+
e.settle();
|
|
249
|
+
}
|
|
250
|
+
function z(e) {
|
|
251
|
+
e.playback.stop(), e.reset(), M(e);
|
|
252
|
+
}
|
|
253
|
+
function B(e) {
|
|
254
|
+
return !(!e.started || e.paused);
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
204
257
|
//#region src/animation/group/group.ts
|
|
205
|
-
var
|
|
258
|
+
var V = class e {
|
|
206
259
|
animations = {};
|
|
207
|
-
transform =
|
|
260
|
+
transform = c;
|
|
208
261
|
superKey;
|
|
209
262
|
paused = !1;
|
|
210
263
|
started = !1;
|
|
211
264
|
done = !1;
|
|
212
265
|
respectReducedMotion = !1;
|
|
213
266
|
static YIELD_BATCH = 32;
|
|
267
|
+
static of(t, ...n) {
|
|
268
|
+
return new e(t, ...n);
|
|
269
|
+
}
|
|
214
270
|
singleTarget = !0;
|
|
271
|
+
unflatten = !1;
|
|
215
272
|
lastTickTime = 0;
|
|
216
273
|
playback = new n();
|
|
217
274
|
resolvePromise = null;
|
|
@@ -223,6 +280,7 @@ var j = class e {
|
|
|
223
280
|
_groupedKeys = [];
|
|
224
281
|
_groupedKeysDirty = !0;
|
|
225
282
|
_soaPlans = null;
|
|
283
|
+
_plainProj = null;
|
|
226
284
|
_compositeBuf = null;
|
|
227
285
|
_hasLayerSprings = !1;
|
|
228
286
|
constructor(...e) {
|
|
@@ -230,13 +288,13 @@ var j = class e {
|
|
|
230
288
|
let t = [];
|
|
231
289
|
for (let n of e) {
|
|
232
290
|
let e, r;
|
|
233
|
-
n instanceof
|
|
234
|
-
let i =
|
|
291
|
+
n instanceof l ? e = n : (e = n.animation, r = n.layer), this.transform === c && e.frames[0] != null && (this.transform = e.frames[0].transform, this.unflatten = e.unflatten);
|
|
292
|
+
let i = a(e);
|
|
235
293
|
this.animations[i] = {
|
|
236
294
|
values: {},
|
|
237
295
|
animation: e,
|
|
238
296
|
layer: {
|
|
239
|
-
...
|
|
297
|
+
...o,
|
|
240
298
|
...r
|
|
241
299
|
}
|
|
242
300
|
}, e.managed = !0, t.push(e);
|
|
@@ -260,19 +318,19 @@ var j = class e {
|
|
|
260
318
|
return this.singleTarget = t.every((e) => e.animation.targets[0] === t[0]?.animation.targets[0]), this;
|
|
261
319
|
}
|
|
262
320
|
transformFramesGrouped(e) {
|
|
263
|
-
return
|
|
321
|
+
return E(this, e);
|
|
264
322
|
}
|
|
265
323
|
render(e = this.lastTickTime) {
|
|
266
|
-
this.singleTarget ? this.transformFramesGrouped(e) :
|
|
324
|
+
this.singleTarget ? this.transformFramesGrouped(e) : g(this.getEntries());
|
|
267
325
|
}
|
|
268
326
|
setChildTime(e, t) {
|
|
269
|
-
let n =
|
|
327
|
+
let n = m(this.animations, e, "setChildTime").animation;
|
|
270
328
|
return n.t = t, n.startTime !== void 0 && (n.pausedTime = n.startTime + t), this;
|
|
271
329
|
}
|
|
272
330
|
advanceTo(t) {
|
|
273
331
|
let n = this.lastTickTime === 0 ? 0 : t - this.lastTickTime;
|
|
274
332
|
this._hasLayerSprings && this.advanceLayerSprings(n), this.lastTickTime = t, this.started = !0;
|
|
275
|
-
let r = this.getEntries(), i = e.YIELD_BATCH, a = r.length <= i ?
|
|
333
|
+
let r = this.getEntries(), i = e.YIELD_BATCH, a = r.length <= i ? y(r, t) : b(r, t, i);
|
|
276
334
|
return a ? a.then(() => this) : this;
|
|
277
335
|
}
|
|
278
336
|
_frame(e) {
|
|
@@ -280,81 +338,53 @@ var j = class e {
|
|
|
280
338
|
return typeof t.then == "function" ? t.then(() => this._renderFrame(e)) : this._renderFrame(e);
|
|
281
339
|
}
|
|
282
340
|
_renderFrame(e) {
|
|
283
|
-
return this.paused ? !1 : (this.singleTarget ? this.transformFramesGrouped(e) : this.done =
|
|
284
|
-
}
|
|
285
|
-
_resolvePlay() {
|
|
286
|
-
let e = this.resolvePromise;
|
|
287
|
-
this.resolvePromise = null, e?.();
|
|
341
|
+
return this.paused ? !1 : (this.singleTarget ? this.transformFramesGrouped(e) : this.done = g(this.getEntries()), this.done ? (this.settle(), M(this), !1) : !0);
|
|
288
342
|
}
|
|
289
343
|
get finished() {
|
|
290
344
|
return this._playingPromise ?? Promise.resolve();
|
|
291
345
|
}
|
|
292
346
|
async play() {
|
|
293
|
-
|
|
294
|
-
let e = t(this.respectReducedMotion, () => this._playReducedMotion(), () => new Promise((e) => {
|
|
295
|
-
this.resolvePromise = e, this.playback.loop(this._boundFrame);
|
|
296
|
-
}));
|
|
297
|
-
return this._playingPromise = e, e.finally(() => {
|
|
298
|
-
this._playingPromise = null;
|
|
299
|
-
}), e;
|
|
300
|
-
}
|
|
301
|
-
_playReducedMotion() {
|
|
302
|
-
this.started = !0;
|
|
303
|
-
let e = this.lastTickTime;
|
|
304
|
-
return g(this.getEntries()), this.singleTarget && this.transformFramesGrouped(e), this.settle(), Promise.resolve();
|
|
347
|
+
return N(this);
|
|
305
348
|
}
|
|
306
349
|
pause() {
|
|
307
|
-
|
|
308
|
-
this.paused = !0;
|
|
309
|
-
let e = this.lastTickTime;
|
|
310
|
-
for (let t of this.getEntries()) {
|
|
311
|
-
let n = t.animation;
|
|
312
|
-
n.pause(), n.pausedTime === 0 && (n.pausedTime = e);
|
|
313
|
-
}
|
|
314
|
-
return this.playback.stop(), this.render(), this;
|
|
350
|
+
return F(this), this;
|
|
315
351
|
}
|
|
316
352
|
resume() {
|
|
317
|
-
return
|
|
353
|
+
return I(this), this;
|
|
318
354
|
}
|
|
319
355
|
toggle() {
|
|
320
356
|
return this.paused ? this.resume() : this.pause();
|
|
321
357
|
}
|
|
322
358
|
settle() {
|
|
323
|
-
|
|
324
|
-
return this.started = !1, this.done = !1, this.paused = !1, this.lastTickTime = 0, this;
|
|
359
|
+
return L(this), this;
|
|
325
360
|
}
|
|
326
361
|
reset() {
|
|
327
|
-
|
|
328
|
-
let t = e.animation;
|
|
329
|
-
t.started && t.frames.length > 0 && t.interpFrames(0, !0);
|
|
330
|
-
}
|
|
331
|
-
return this.settle();
|
|
362
|
+
return R(this), this;
|
|
332
363
|
}
|
|
333
364
|
stop() {
|
|
334
|
-
return
|
|
365
|
+
return z(this), this;
|
|
335
366
|
}
|
|
336
367
|
playing() {
|
|
337
|
-
return
|
|
368
|
+
return B(this);
|
|
338
369
|
}
|
|
339
370
|
setLayerConfig(e, t) {
|
|
340
|
-
return
|
|
371
|
+
return O(this, e, t), this;
|
|
341
372
|
}
|
|
342
373
|
setLayerEnabled(e, t) {
|
|
343
374
|
return this.setLayerConfig(e, { enabled: t });
|
|
344
375
|
}
|
|
345
376
|
getLayerConfig(e) {
|
|
346
|
-
return
|
|
377
|
+
return k(this, e);
|
|
347
378
|
}
|
|
348
379
|
transitionLayer(e, t) {
|
|
349
|
-
return
|
|
380
|
+
return A(this, e, t), this;
|
|
350
381
|
}
|
|
351
382
|
crossfade(e, t, n) {
|
|
352
|
-
return
|
|
383
|
+
return j(this, e, t, n), this;
|
|
353
384
|
}
|
|
354
385
|
advanceLayerSprings(e) {
|
|
355
|
-
this._hasLayerSprings =
|
|
386
|
+
this._hasLayerSprings = S(this.getEntries(), e);
|
|
356
387
|
}
|
|
357
|
-
},
|
|
358
|
-
i((e, ...t) => new j(e, ...t));
|
|
388
|
+
}, H = /* @__PURE__ */ e({ AnimationGroup: () => V });
|
|
359
389
|
//#endregion
|
|
360
|
-
export {
|
|
390
|
+
export { V as n, H as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/animation/svg/handle.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
animation;
|
|
4
|
+
constructor(e) {
|
|
5
|
+
this.animation = e;
|
|
6
|
+
}
|
|
7
|
+
play() {
|
|
8
|
+
return this.animation.play();
|
|
9
|
+
}
|
|
10
|
+
pause() {
|
|
11
|
+
return this.animation.pause(), this;
|
|
12
|
+
}
|
|
13
|
+
stop() {
|
|
14
|
+
return this.animation.stop(), this;
|
|
15
|
+
}
|
|
16
|
+
get finished() {
|
|
17
|
+
return this.animation.finished;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./presets-
|
|
2
|
-
import { t } from "./engine-
|
|
1
|
+
import { n as e } from "./presets-DeDJYL4G.js";
|
|
2
|
+
import { t } from "./engine-CPK_udUQ.js";
|
|
3
3
|
//#region src/animation/ingest/cssom.ts
|
|
4
4
|
var n = (e, t, n, r = {}) => {
|
|
5
5
|
e.push({
|