@wix/motion 2.1.8 → 2.1.10
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 +4 -0
- package/dist/cjs/motion.js +1 -1
- package/dist/cjs/motion.js.map +1 -1
- package/dist/es/motion.js +666 -512
- package/dist/es/motion.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/Sequence.d.ts +1 -0
- package/dist/types/Sequence.d.ts.map +1 -1
- package/dist/types/api/common.d.ts.map +1 -1
- package/dist/types/api/cssAnimations.d.ts +3 -3
- package/dist/types/api/cssAnimations.d.ts.map +1 -1
- package/dist/types/easings.d.ts +32 -0
- package/dist/types/easings.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +22 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/es/motion.js
CHANGED
|
@@ -1,134 +1,190 @@
|
|
|
1
|
-
class
|
|
1
|
+
class _ {
|
|
2
2
|
animations;
|
|
3
3
|
options;
|
|
4
4
|
ready;
|
|
5
5
|
isCSS;
|
|
6
6
|
longestAnimation;
|
|
7
|
-
constructor(
|
|
8
|
-
this.animations =
|
|
7
|
+
constructor(e, n) {
|
|
8
|
+
this.animations = e, this.options = n, this.ready = n?.measured || Promise.resolve(), this.isCSS = e[0] instanceof CSSAnimation, this.longestAnimation = this._getAnimationWithLongestEndTime();
|
|
9
9
|
}
|
|
10
10
|
_getAnimationWithLongestEndTime() {
|
|
11
|
-
return this.animations.reduce((
|
|
12
|
-
const
|
|
13
|
-
return
|
|
11
|
+
return this.animations.reduce((e, n) => {
|
|
12
|
+
const o = e.effect?.getComputedTiming().endTime ?? 0, i = n.effect?.getComputedTiming().endTime ?? 0;
|
|
13
|
+
return o > i ? e : n;
|
|
14
14
|
}, this.animations[0]);
|
|
15
15
|
}
|
|
16
16
|
getProgress() {
|
|
17
17
|
return this.longestAnimation?.effect?.getComputedTiming().progress || 0;
|
|
18
18
|
}
|
|
19
|
-
async play(
|
|
19
|
+
async play(e) {
|
|
20
20
|
await this.ready;
|
|
21
21
|
for (const n of this.animations)
|
|
22
22
|
n.play();
|
|
23
|
-
await Promise.all(this.animations.map((n) => n.ready)),
|
|
23
|
+
await Promise.all(this.animations.map((n) => n.ready)), e && e();
|
|
24
24
|
}
|
|
25
25
|
pause() {
|
|
26
|
-
for (const
|
|
27
|
-
|
|
26
|
+
for (const e of this.animations)
|
|
27
|
+
e.pause();
|
|
28
28
|
}
|
|
29
|
-
async reverse(
|
|
29
|
+
async reverse(e) {
|
|
30
30
|
await this.ready;
|
|
31
31
|
for (const n of this.animations)
|
|
32
32
|
n.reverse();
|
|
33
|
-
await Promise.all(this.animations.map((n) => n.ready)),
|
|
33
|
+
await Promise.all(this.animations.map((n) => n.ready)), e && e();
|
|
34
34
|
}
|
|
35
|
-
progress(
|
|
35
|
+
progress(e) {
|
|
36
36
|
for (const n of this.animations) {
|
|
37
|
-
const { delay:
|
|
38
|
-
n.currentTime = ((
|
|
37
|
+
const { delay: o, duration: i, iterations: s } = n.effect.getTiming(), a = (Number.isFinite(i) ? i : 0) * (Number.isFinite(s) ? s : 1);
|
|
38
|
+
n.currentTime = ((o || 0) + a) * e;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
cancel() {
|
|
42
|
-
for (const
|
|
43
|
-
|
|
42
|
+
for (const e of this.animations)
|
|
43
|
+
e.cancel();
|
|
44
44
|
}
|
|
45
|
-
setPlaybackRate(
|
|
45
|
+
setPlaybackRate(e) {
|
|
46
46
|
for (const n of this.animations)
|
|
47
|
-
n.playbackRate =
|
|
47
|
+
n.playbackRate = e;
|
|
48
48
|
}
|
|
49
|
-
async onFinish(
|
|
49
|
+
async onFinish(e) {
|
|
50
50
|
try {
|
|
51
|
-
await Promise.all(this.animations.map((
|
|
51
|
+
await Promise.all(this.animations.map((o) => o.finished));
|
|
52
52
|
const n = this.animations[0];
|
|
53
53
|
if (n && !this.isCSS) {
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
const o = n.effect?.target;
|
|
55
|
+
if (o) {
|
|
56
|
+
const i = this.options?.effectId || n.id, s = new CustomEvent("animationend", { detail: { effectId: i } });
|
|
57
|
+
o.dispatchEvent(s);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
e();
|
|
61
61
|
} catch (n) {
|
|
62
62
|
console.warn("animation was interrupted - aborting onFinish callback - ", n);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
async onAbort(
|
|
65
|
+
async onAbort(e) {
|
|
66
66
|
try {
|
|
67
67
|
await Promise.all(this.animations.map((n) => n.finished));
|
|
68
68
|
} catch (n) {
|
|
69
69
|
if (n.name === "AbortError") {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
|
|
70
|
+
const o = this.animations[0];
|
|
71
|
+
if (o && !this.isCSS) {
|
|
72
|
+
const i = o.effect?.target;
|
|
73
|
+
if (i) {
|
|
74
|
+
const s = new Event("animationcancel");
|
|
75
|
+
i.dispatchEvent(s);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
e();
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
get finished() {
|
|
83
|
-
return Promise.all(this.animations.map((
|
|
83
|
+
return Promise.all(this.animations.map((e) => e.finished));
|
|
84
84
|
}
|
|
85
85
|
get playState() {
|
|
86
|
-
return this.animations.some((
|
|
86
|
+
return this.animations.some((e) => e.playState === "running") ? "running" : this.animations[0]?.playState;
|
|
87
87
|
}
|
|
88
|
-
hasAnimationName(
|
|
89
|
-
return this.animations.some((n) => n.animationName ===
|
|
88
|
+
hasAnimationName(e) {
|
|
89
|
+
return this.animations.some((n) => n.animationName === e);
|
|
90
90
|
}
|
|
91
|
-
hasAnimationId(
|
|
92
|
-
return this.animations.some((n) => n.id ===
|
|
91
|
+
hasAnimationId(e) {
|
|
92
|
+
return this.animations.some((n) => n.id === e);
|
|
93
93
|
}
|
|
94
94
|
getTimingOptions() {
|
|
95
|
-
return this.animations.map((
|
|
96
|
-
const n =
|
|
95
|
+
return this.animations.map((e) => {
|
|
96
|
+
const n = e.effect?.getTiming(), o = n?.delay ?? 0, i = Number(n?.duration) || 0, s = n?.iterations ?? 1;
|
|
97
97
|
return {
|
|
98
|
-
delay:
|
|
99
|
-
duration:
|
|
100
|
-
iterations:
|
|
98
|
+
delay: o,
|
|
99
|
+
duration: i,
|
|
100
|
+
iterations: s
|
|
101
101
|
};
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
linear:
|
|
107
|
-
sineIn:
|
|
108
|
-
sineOut:
|
|
109
|
-
sineInOut:
|
|
110
|
-
quadIn:
|
|
111
|
-
quadOut:
|
|
112
|
-
quadInOut:
|
|
113
|
-
cubicIn:
|
|
114
|
-
cubicOut:
|
|
115
|
-
cubicInOut:
|
|
116
|
-
quartIn:
|
|
117
|
-
quartOut:
|
|
118
|
-
quartInOut:
|
|
119
|
-
quintIn:
|
|
120
|
-
quintOut:
|
|
121
|
-
quintInOut:
|
|
122
|
-
expoIn:
|
|
123
|
-
expoOut:
|
|
124
|
-
expoInOut:
|
|
125
|
-
circIn:
|
|
126
|
-
circOut:
|
|
127
|
-
circInOut:
|
|
128
|
-
backIn:
|
|
129
|
-
backOut:
|
|
130
|
-
backInOut:
|
|
131
|
-
},
|
|
105
|
+
const L = (t) => t, Y = (t) => 1 - Math.cos(t * Math.PI / 2), Z = (t) => Math.sin(t * Math.PI / 2), Q = (t) => -(Math.cos(Math.PI * t) - 1) / 2, tt = (t) => t ** 2, et = (t) => 1 - (1 - t) ** 2, nt = (t) => t < 0.5 ? 2 * t ** 2 : 1 - (-2 * t + 2) ** 2 / 2, it = (t) => t ** 3, st = (t) => 1 - (1 - t) ** 3, ot = (t) => t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2, rt = (t) => t ** 4, at = (t) => 1 - (1 - t) ** 4, ct = (t) => t < 0.5 ? 8 * t ** 4 : 1 - (-2 * t + 2) ** 4 / 2, ut = (t) => t ** 5, ft = (t) => 1 - (1 - t) ** 5, mt = (t) => t < 0.5 ? 16 * t ** 5 : 1 - (-2 * t + 2) ** 5 / 2, lt = (t) => t === 0 ? 0 : 2 ** (10 * t - 10), dt = (t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), ht = (t) => t === 0 ? 0 : t === 1 ? 1 : t < 0.5 ? 2 ** (20 * t - 10) / 2 : (2 - 2 ** (-20 * t + 10)) / 2, pt = (t) => 1 - Math.sqrt(1 - t ** 2), gt = (t) => Math.sqrt(1 - (t - 1) ** 2), $t = (t) => t < 0.5 ? (1 - Math.sqrt(1 - 4 * t ** 2)) / 2 : (Math.sqrt(-(2 * t - 3) * (2 * t - 1)) + 1) / 2, yt = (t) => 2.70158 * t ** 3 - 1.70158 * t ** 2, bt = (t) => 1 + 2.70158 * (t - 1) ** 3 + 1.70158 * (t - 1) ** 2, vt = (t, e = 1.70158 * 1.525) => t < 0.5 ? (2 * t) ** 2 * ((e + 1) * 2 * t - e) / 2 : ((2 * t - 2) ** 2 * ((e + 1) * (t * 2 - 2) + e) + 2) / 2, z = {
|
|
106
|
+
linear: L,
|
|
107
|
+
sineIn: Y,
|
|
108
|
+
sineOut: Z,
|
|
109
|
+
sineInOut: Q,
|
|
110
|
+
quadIn: tt,
|
|
111
|
+
quadOut: et,
|
|
112
|
+
quadInOut: nt,
|
|
113
|
+
cubicIn: it,
|
|
114
|
+
cubicOut: st,
|
|
115
|
+
cubicInOut: ot,
|
|
116
|
+
quartIn: rt,
|
|
117
|
+
quartOut: at,
|
|
118
|
+
quartInOut: ct,
|
|
119
|
+
quintIn: ut,
|
|
120
|
+
quintOut: ft,
|
|
121
|
+
quintInOut: mt,
|
|
122
|
+
expoIn: lt,
|
|
123
|
+
expoOut: dt,
|
|
124
|
+
expoInOut: ht,
|
|
125
|
+
circIn: pt,
|
|
126
|
+
circOut: gt,
|
|
127
|
+
circInOut: $t,
|
|
128
|
+
backIn: yt,
|
|
129
|
+
backOut: bt,
|
|
130
|
+
backInOut: vt
|
|
131
|
+
}, E = (t, e, n, o, i) => {
|
|
132
|
+
const s = 3 * e, a = 3 * (o - 2 * e), r = 1 - 3 * o + 3 * e, f = 3 * n, d = 3 * (i - 2 * n), c = 1 - 3 * i + 3 * n;
|
|
133
|
+
let u;
|
|
134
|
+
if (r === 0)
|
|
135
|
+
u = a === 0 ? `(${t} / ${s})` : `((sqrt(max(0, ${s * s} + ${4 * a} * ${t})) - ${s}) / ${2 * a})`;
|
|
136
|
+
else {
|
|
137
|
+
const m = a / (3 * r), p = 2 * Math.pow(a, 3) - 9 * s * a * r, l = 54 * Math.pow(r, 3), h = (3 * r * s - a * a) / (9 * r * r), $ = `((${p} - ${27 * r * r} * ${t}) / ${l})`;
|
|
138
|
+
if (h < 0) {
|
|
139
|
+
const g = 2 * Math.sqrt(-h);
|
|
140
|
+
let y = 0;
|
|
141
|
+
for (const v of [0, 1, 2])
|
|
142
|
+
[0, 0.25, 0.5, 0.75, 1].every((q) => {
|
|
143
|
+
const T = Math.min(
|
|
144
|
+
Math.max(2 * (p - 27 * r * r * q) / (l * h * g), -1),
|
|
145
|
+
1
|
|
146
|
+
), x = g * Math.cos((Math.acos(T) - v * 2 * Math.PI) / 3) - m;
|
|
147
|
+
return x >= -1e-6 && x <= 1.000001;
|
|
148
|
+
}) && (y = v);
|
|
149
|
+
const b = `(acos(clamp(-1, ${2 / (h * g)} * ${$}, 1)) - ${360 * y}deg) / 3`;
|
|
150
|
+
u = `(${g} * cos(${b}) - ${m})`;
|
|
151
|
+
} else {
|
|
152
|
+
const g = `sqrt(pow(${$}, 2) + ${Math.pow(h, 3)})`;
|
|
153
|
+
u = `(pow(${g} - ${$}, 1 / 3) - pow(${g} + ${$}, 1 / 3) - ${m})`;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return `(${c} * pow(${u}, 3) + ${d} * pow(${u}, 2) + ${f} * ${u})`;
|
|
157
|
+
}, M = {
|
|
158
|
+
linear: (t) => t,
|
|
159
|
+
ease: (t) => E(t, 0.25, 0.1, 0.25, 1),
|
|
160
|
+
easeIn: (t) => E(t, 0.42, 0, 1, 1),
|
|
161
|
+
easeOut: (t) => E(t, 0, 0, 0.58, 1),
|
|
162
|
+
easeInOut: (t) => E(t, 0.42, 0, 0.58, 1),
|
|
163
|
+
sineIn: (t) => `(1 - cos(${t} * 90deg))`,
|
|
164
|
+
sineOut: (t) => `(sin(${t} * 90deg))`,
|
|
165
|
+
sineInOut: (t) => `((1 - cos(${t} * 180deg)) / 2)`,
|
|
166
|
+
quadIn: (t) => `(${t} * ${t})`,
|
|
167
|
+
quadOut: (t) => `(1 - (1 - ${t}) * (1 - ${t}))`,
|
|
168
|
+
quadInOut: (t) => `(round(${t}) * (1 - (-2 * ${t} + 2) * (-2 * ${t} + 2) / 2) + (1 - round(${t})) * 2 * ${t} * ${t})`,
|
|
169
|
+
cubicIn: (t) => `pow(${t}, 3)`,
|
|
170
|
+
cubicOut: (t) => `(1 - pow(1 - ${t}, 3))`,
|
|
171
|
+
cubicInOut: (t) => `(round(${t}) * (1 - pow(-2 * ${t} + 2, 3) / 2) + (1 - round(${t})) * 4 * pow(${t}, 3))`,
|
|
172
|
+
quartIn: (t) => `pow(${t}, 4)`,
|
|
173
|
+
quartOut: (t) => `(1 - pow(1 - ${t}, 4))`,
|
|
174
|
+
quartInOut: (t) => `(round(${t}) * (1 - pow(-2 * ${t} + 2, 4) / 2) + (1 - round(${t})) * 8 * pow(${t}, 4))`,
|
|
175
|
+
quintIn: (t) => `pow(${t}, 5)`,
|
|
176
|
+
quintOut: (t) => `(1 - pow(1 - ${t}, 5))`,
|
|
177
|
+
quintInOut: (t) => `(round(${t}) * (1 - pow(-2 * ${t} + 2, 5) / 2) + (1 - round(${t})) * 16 * pow(${t}, 5))`,
|
|
178
|
+
expoIn: (t) => `(pow(2, 10 * ${t} - 10) - pow(2, -10) * (1 - ${t}))`,
|
|
179
|
+
expoOut: (t) => `(1 - pow(2, -10 * ${t}) + pow(2, -10) * ${t})`,
|
|
180
|
+
expoInOut: (t) => `((round(${t}) * (2 - pow(2, -20 * ${t} + 10)) + (1 - round(${t})) * pow(2, 20 * ${t} - 10)) / 2)`,
|
|
181
|
+
circIn: (t) => `(1 - sqrt(1 - ${t} * ${t}))`,
|
|
182
|
+
circOut: (t) => `sqrt(1 - (${t} - 1) * (${t} - 1))`,
|
|
183
|
+
circInOut: (t) => `((round(${t}) * (sqrt(max(0, (3 - 2 * ${t}) * (2 * ${t} - 1))) + 1) + (1 - round(${t})) * (1 - sqrt(max(0, 1 - 4 * ${t} * ${t})))) / 2)`,
|
|
184
|
+
backIn: (t) => `(2.70158 * pow(${t}, 3) - 1.70158 * ${t} * ${t})`,
|
|
185
|
+
backOut: (t) => `(1 + 2.70158 * pow(${t} - 1, 3) + 1.70158 * (${t} - 1) * (${t} - 1))`,
|
|
186
|
+
backInOut: (t) => `((round(${t}) * (2 + (2 * ${t} - 2) * (2 * ${t} - 2) * (2.5949095 + 3.5949095 * (2 * ${t} - 2))) + (1 - round(${t})) * 4 * ${t} * ${t} * (3.5949095 * 2 * ${t} - 2.5949095)) / 2)`
|
|
187
|
+
}, N = {
|
|
132
188
|
linear: "linear",
|
|
133
189
|
ease: "ease",
|
|
134
190
|
easeIn: "ease-in",
|
|
@@ -159,108 +215,179 @@ const G = (e) => e, V = (e) => 1 - Math.cos(e * Math.PI / 2), B = (e) => Math.si
|
|
|
159
215
|
backOut: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
160
216
|
backInOut: "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
|
161
217
|
};
|
|
162
|
-
function
|
|
163
|
-
return
|
|
218
|
+
function wt(t) {
|
|
219
|
+
return t === "percentage" ? "%" : t || "px";
|
|
220
|
+
}
|
|
221
|
+
const It = /^(webkit|moz|ms|o)(?=[A-Z])/, Et = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
222
|
+
float: "cssFloat",
|
|
223
|
+
"animation-timing-function": "easing",
|
|
224
|
+
"animation-composition": "composite"
|
|
225
|
+
});
|
|
226
|
+
function Yt(t) {
|
|
227
|
+
return t.startsWith("--") ? t : (It.test(t) ? `-${t}` : t).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`);
|
|
228
|
+
}
|
|
229
|
+
function Ot(t) {
|
|
230
|
+
return t.startsWith("--") || !t.includes("-") ? t : t.replace(/^-/, "").replace(/-([a-z])/g, (e, n) => n.toUpperCase());
|
|
164
231
|
}
|
|
165
|
-
function
|
|
166
|
-
return
|
|
232
|
+
function j(t) {
|
|
233
|
+
return Et[t] || Ot(t);
|
|
167
234
|
}
|
|
168
|
-
function
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
235
|
+
function _t(t) {
|
|
236
|
+
for (const e in t)
|
|
237
|
+
if (Object.hasOwn(t, e) && j(e) !== e)
|
|
238
|
+
return !0;
|
|
239
|
+
return !1;
|
|
240
|
+
}
|
|
241
|
+
function At(t) {
|
|
242
|
+
if (!Array.isArray(t))
|
|
243
|
+
return t;
|
|
244
|
+
let e;
|
|
245
|
+
return t.forEach((n, o) => {
|
|
246
|
+
if (!n || typeof n != "object" || !_t(n))
|
|
247
|
+
return;
|
|
248
|
+
e ??= t.slice();
|
|
249
|
+
const i = {};
|
|
250
|
+
for (const s in n)
|
|
251
|
+
Object.hasOwn(n, s) && (i[j(s)] = n[s]);
|
|
252
|
+
e[o] = i;
|
|
253
|
+
}), e || t;
|
|
254
|
+
}
|
|
255
|
+
function qt(t) {
|
|
256
|
+
return t ? N[t] || t : N.linear;
|
|
257
|
+
}
|
|
258
|
+
function Tt(t, e, n, o) {
|
|
259
|
+
const i = 3 * t, s = 3 * (n - t) - i, a = 1 - i - s, r = 3 * e, f = 3 * (o - e) - r, d = 1 - r - f, c = (l) => ((a * l + s) * l + i) * l, u = (l) => ((d * l + f) * l + r) * l, m = (l) => (3 * a * l + 2 * s) * l + i;
|
|
260
|
+
function p(l) {
|
|
261
|
+
let h = l;
|
|
172
262
|
for (let y = 0; y < 8; y++) {
|
|
173
|
-
const b =
|
|
174
|
-
if (Math.abs(b) < 1e-7) return
|
|
175
|
-
const
|
|
176
|
-
if (Math.abs(
|
|
177
|
-
|
|
263
|
+
const b = c(h) - l;
|
|
264
|
+
if (Math.abs(b) < 1e-7) return h;
|
|
265
|
+
const v = m(h);
|
|
266
|
+
if (Math.abs(v) < 1e-6) break;
|
|
267
|
+
h -= b / v;
|
|
178
268
|
}
|
|
179
|
-
let
|
|
180
|
-
for (
|
|
181
|
-
const y =
|
|
182
|
-
if (Math.abs(y -
|
|
183
|
-
|
|
269
|
+
let $ = 0, g = 1;
|
|
270
|
+
for (h = ($ + g) / 2; g - $ > 1e-7; ) {
|
|
271
|
+
const y = c(h);
|
|
272
|
+
if (Math.abs(y - l) < 1e-7) return h;
|
|
273
|
+
l > y ? $ = h : g = h, h = ($ + g) / 2;
|
|
184
274
|
}
|
|
185
|
-
return
|
|
275
|
+
return h;
|
|
186
276
|
}
|
|
187
|
-
return (
|
|
277
|
+
return (l) => l <= 0 ? 0 : l >= 1 ? 1 : u(p(l));
|
|
188
278
|
}
|
|
189
|
-
function
|
|
190
|
-
const
|
|
279
|
+
function W(t) {
|
|
280
|
+
const e = t.match(
|
|
191
281
|
/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/
|
|
192
282
|
);
|
|
193
|
-
if (!
|
|
194
|
-
const n = parseFloat(
|
|
195
|
-
if (![n, i, s
|
|
196
|
-
return
|
|
283
|
+
if (!e) return;
|
|
284
|
+
const n = parseFloat(e[1]), o = parseFloat(e[2]), i = parseFloat(e[3]), s = parseFloat(e[4]);
|
|
285
|
+
if (![n, o, i, s].some(isNaN))
|
|
286
|
+
return [n, o, i, s];
|
|
197
287
|
}
|
|
198
|
-
function
|
|
199
|
-
const
|
|
200
|
-
if (!
|
|
201
|
-
|
|
288
|
+
function St(t) {
|
|
289
|
+
const e = W(t);
|
|
290
|
+
if (!(!e || e.some(isNaN)))
|
|
291
|
+
return Tt(...e);
|
|
292
|
+
}
|
|
293
|
+
function kt(t) {
|
|
294
|
+
const e = W(t);
|
|
295
|
+
if (!(!e || e.some(isNaN)))
|
|
296
|
+
return (n) => E(n, ...e);
|
|
297
|
+
}
|
|
298
|
+
function H(t) {
|
|
299
|
+
const e = t.match(/^linear\((.+)\)$/);
|
|
300
|
+
if (!e) return;
|
|
301
|
+
const n = e[1].split(",").map((s) => s.trim()).filter(Boolean);
|
|
202
302
|
if (n.length === 0) return;
|
|
203
|
-
const
|
|
204
|
-
for (const
|
|
205
|
-
const a =
|
|
206
|
-
if (isNaN(
|
|
207
|
-
const
|
|
208
|
-
for (let
|
|
209
|
-
if (a[
|
|
210
|
-
const
|
|
211
|
-
if (isNaN(
|
|
212
|
-
|
|
303
|
+
const o = [];
|
|
304
|
+
for (const s of n) {
|
|
305
|
+
const a = s.split(/\s+/), r = parseFloat(a[0]);
|
|
306
|
+
if (isNaN(r)) return;
|
|
307
|
+
const f = [];
|
|
308
|
+
for (let d = 1; d < a.length; d++)
|
|
309
|
+
if (a[d].endsWith("%")) {
|
|
310
|
+
const c = parseFloat(a[d]) / 100;
|
|
311
|
+
if (isNaN(c)) return;
|
|
312
|
+
f.push(c);
|
|
213
313
|
}
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
let
|
|
219
|
-
for (;
|
|
220
|
-
if (i
|
|
221
|
-
const
|
|
222
|
-
let a =
|
|
223
|
-
for (; a <
|
|
224
|
-
const
|
|
225
|
-
for (let
|
|
226
|
-
|
|
227
|
-
|
|
314
|
+
f.length === 0 ? o.push({ output: r, pos: null }) : f.length === 1 ? o.push({ output: r, pos: f[0] }) : (o.push({ output: r, pos: f[0] }), o.push({ output: r, pos: f[1] }));
|
|
315
|
+
}
|
|
316
|
+
if (o.length === 0) return;
|
|
317
|
+
o[0].pos === null && (o[0].pos = 0), o[o.length - 1].pos === null && (o[o.length - 1].pos = 1);
|
|
318
|
+
let i = 0;
|
|
319
|
+
for (; i < o.length; )
|
|
320
|
+
if (o[i].pos === null) {
|
|
321
|
+
const s = i - 1;
|
|
322
|
+
let a = i;
|
|
323
|
+
for (; a < o.length && o[a].pos === null; ) a++;
|
|
324
|
+
const r = o[s].pos, f = o[a].pos, d = a - s;
|
|
325
|
+
for (let c = s + 1; c < a; c++)
|
|
326
|
+
o[c].pos = r + (f - r) * (c - s) / d;
|
|
327
|
+
i = a + 1;
|
|
228
328
|
} else
|
|
229
|
-
|
|
230
|
-
for (let
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return (c) => {
|
|
234
|
-
if (c <= r[0].pos) return r[0].output;
|
|
235
|
-
const a = r[r.length - 1];
|
|
236
|
-
if (c >= a.pos) return a.output;
|
|
237
|
-
let m = 0, l = r.length - 1;
|
|
238
|
-
for (; m < l - 1; ) {
|
|
239
|
-
const f = m + l >>> 1;
|
|
240
|
-
r[f].pos <= c ? m = f : l = f;
|
|
241
|
-
}
|
|
242
|
-
const o = r[m], u = r[l];
|
|
243
|
-
return u.pos === o.pos ? u.output : o.output + (u.output - o.output) * (c - o.pos) / (u.pos - o.pos);
|
|
244
|
-
};
|
|
329
|
+
i++;
|
|
330
|
+
for (let s = 1; s < o.length; s++)
|
|
331
|
+
o[s].pos < o[s - 1].pos && (o[s].pos = o[s - 1].pos);
|
|
332
|
+
return o;
|
|
245
333
|
}
|
|
246
|
-
function
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
334
|
+
function Pt(t) {
|
|
335
|
+
const e = H(t);
|
|
336
|
+
if (e)
|
|
337
|
+
return (n) => {
|
|
338
|
+
if (n <= e[0].pos) return e[0].output;
|
|
339
|
+
const o = e[e.length - 1];
|
|
340
|
+
if (n >= o.pos) return o.output;
|
|
341
|
+
let i = 0, s = e.length - 1;
|
|
342
|
+
for (; i < s - 1; ) {
|
|
343
|
+
const f = i + s >>> 1;
|
|
344
|
+
e[f].pos <= n ? i = f : s = f;
|
|
345
|
+
}
|
|
346
|
+
const a = e[i], r = e[s];
|
|
347
|
+
return r.pos === a.pos ? r.output : a.output + (r.output - a.output) * (n - a.pos) / (r.pos - a.pos);
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function Ct(t) {
|
|
351
|
+
const e = H(t);
|
|
352
|
+
if (e)
|
|
353
|
+
return (n) => {
|
|
354
|
+
const o = [`${e[0].output}`];
|
|
355
|
+
for (let i = 1; i < e.length; i++) {
|
|
356
|
+
const s = e[i].pos - e[i - 1].pos, a = e[i].output - e[i - 1].output;
|
|
357
|
+
if (s === 0 && e[i - 1].pos === 0)
|
|
358
|
+
o.push(`${a}`);
|
|
359
|
+
else {
|
|
360
|
+
const r = s === 0 ? `round(${n} / ${2 * e[i - 1].pos})` : `(${n} - ${e[i - 1].pos}) / ${s}`;
|
|
361
|
+
o.push(`clamp(0, ${r}, 1) * ${a}`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return `(${o.join(" + ")})`;
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
function B(t) {
|
|
368
|
+
if (!t) return;
|
|
369
|
+
const e = z[t];
|
|
370
|
+
return e || (St(t) ?? Pt(t) ?? z.linear);
|
|
250
371
|
}
|
|
251
|
-
|
|
372
|
+
function xt(t) {
|
|
373
|
+
if (!t) return;
|
|
374
|
+
const e = M[t];
|
|
375
|
+
return e || (kt(t) ?? Ct(t) ?? M.linear);
|
|
376
|
+
}
|
|
377
|
+
class zt extends _ {
|
|
252
378
|
animationGroups;
|
|
253
379
|
delay;
|
|
254
380
|
offset;
|
|
255
381
|
offsetEasing;
|
|
382
|
+
sequenceId;
|
|
256
383
|
timingOptions;
|
|
257
|
-
constructor(
|
|
258
|
-
const
|
|
259
|
-
super(
|
|
260
|
-
delay:
|
|
261
|
-
duration: Number.isFinite(
|
|
262
|
-
iterations: Number.isFinite(
|
|
263
|
-
}))), this.applyOffsets(), this.ready = Promise.all(
|
|
384
|
+
constructor(e, n = {}) {
|
|
385
|
+
const o = e.flatMap((i) => [...i.animations]);
|
|
386
|
+
super(o), this.animationGroups = e, this.delay = n.delay ?? 0, this.offset = n.offset ?? 0, this.sequenceId = n.sequenceId, this.offsetEasing = typeof n.offsetEasing == "function" ? n.offsetEasing : B(n.offsetEasing) ?? L, this.timingOptions = this.animationGroups.map((i) => i.getTimingOptions().map(({ delay: s, duration: a, iterations: r }) => ({
|
|
387
|
+
delay: s,
|
|
388
|
+
duration: Number.isFinite(a) ? a : 0,
|
|
389
|
+
iterations: Number.isFinite(r) ? r : 1
|
|
390
|
+
}))), this.applyOffsets(), this.ready = Promise.all(e.map((i) => i.ready)).then(() => {
|
|
264
391
|
});
|
|
265
392
|
}
|
|
266
393
|
/**
|
|
@@ -269,35 +396,39 @@ class Et extends O {
|
|
|
269
396
|
* where i is the group index and last is the index of the final group.
|
|
270
397
|
*/
|
|
271
398
|
calculateOffsets() {
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
const n =
|
|
399
|
+
const e = this.animationGroups.length;
|
|
400
|
+
if (e <= 1) return [0];
|
|
401
|
+
const n = e - 1;
|
|
275
402
|
return Array.from(
|
|
276
|
-
{ length:
|
|
277
|
-
(
|
|
403
|
+
{ length: e },
|
|
404
|
+
(o, i) => this.offsetEasing(i / n) * n * this.offset | 0
|
|
278
405
|
);
|
|
279
406
|
}
|
|
280
407
|
applyOffsets() {
|
|
281
408
|
if (this.animationGroups.length === 0 || this.animations.length === 0) return;
|
|
282
|
-
const
|
|
409
|
+
const e = this.calculateOffsets(), n = this.getSequenceActiveDuration(e), o = this.animationGroups.length - 1;
|
|
283
410
|
this.animationGroups.forEach((i, s) => {
|
|
284
|
-
i.animations.forEach((
|
|
285
|
-
const
|
|
286
|
-
if (!
|
|
287
|
-
const { delay:
|
|
288
|
-
|
|
411
|
+
i.animations.forEach((a, r) => {
|
|
412
|
+
const f = a.effect;
|
|
413
|
+
if (!f) return;
|
|
414
|
+
const { delay: d, duration: c, iterations: u } = this.timingOptions[s][r], m = d + e[s], p = n - (m + c * u);
|
|
415
|
+
if (i.isCSS && this.sequenceId) {
|
|
416
|
+
const { target: l } = f;
|
|
417
|
+
l instanceof HTMLElement && (l.style.setProperty(`--motion-${this.sequenceId}-index`, `${s}`), l.style.setProperty(`--motion-${this.sequenceId}-last`, `${o}`)), f.updateTiming({ endDelay: p });
|
|
418
|
+
} else
|
|
419
|
+
f.updateTiming({ delay: m + this.delay, endDelay: p });
|
|
289
420
|
});
|
|
290
421
|
});
|
|
291
422
|
}
|
|
292
|
-
getSequenceActiveDuration(
|
|
423
|
+
getSequenceActiveDuration(e) {
|
|
293
424
|
const n = [];
|
|
294
|
-
for (let
|
|
295
|
-
const
|
|
296
|
-
if (!
|
|
297
|
-
const { delay:
|
|
298
|
-
return Math.max(
|
|
425
|
+
for (let o = 0; o < this.timingOptions.length; o++) {
|
|
426
|
+
const i = this.timingOptions[o].reduce((s, a) => {
|
|
427
|
+
if (!a) return s;
|
|
428
|
+
const { delay: r, duration: f, iterations: d } = a;
|
|
429
|
+
return Math.max(s, r + f * d);
|
|
299
430
|
}, 0);
|
|
300
|
-
n.push(
|
|
431
|
+
n.push(e[o] + i);
|
|
301
432
|
}
|
|
302
433
|
return Math.max(...n);
|
|
303
434
|
}
|
|
@@ -306,16 +437,16 @@ class Et extends O {
|
|
|
306
437
|
* stagger offsets for all groups. Each entry specifies the target index
|
|
307
438
|
* in the animationGroups array where the group should be inserted.
|
|
308
439
|
*/
|
|
309
|
-
addGroups(
|
|
310
|
-
if (
|
|
311
|
-
const n = [...
|
|
312
|
-
for (const { index:
|
|
313
|
-
const
|
|
314
|
-
this.animationGroups.splice(
|
|
315
|
-
const
|
|
316
|
-
this.animations.splice(
|
|
440
|
+
addGroups(e) {
|
|
441
|
+
if (e.length === 0) return;
|
|
442
|
+
const n = [...e].sort((o, i) => i.index - o.index);
|
|
443
|
+
for (const { index: o, group: i } of n) {
|
|
444
|
+
const s = Math.min(o, this.animationGroups.length);
|
|
445
|
+
this.animationGroups.splice(s, 0, i), this.timingOptions.splice(s, 0, i.getTimingOptions());
|
|
446
|
+
const a = [...i.animations], r = this.animationGroups.slice(0, s).reduce((f, d) => f + d.animations.length, 0);
|
|
447
|
+
this.animations.splice(r, 0, ...a);
|
|
317
448
|
}
|
|
318
|
-
this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((
|
|
449
|
+
this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((o) => o.ready)).then(() => {
|
|
319
450
|
});
|
|
320
451
|
}
|
|
321
452
|
/**
|
|
@@ -323,49 +454,49 @@ class Et extends O {
|
|
|
323
454
|
* stagger offsets for remaining groups. Cancelled animations in removed
|
|
324
455
|
* groups are returned.
|
|
325
456
|
*/
|
|
326
|
-
removeGroups(
|
|
327
|
-
const n = [],
|
|
328
|
-
for (let
|
|
329
|
-
|
|
457
|
+
removeGroups(e) {
|
|
458
|
+
const n = [], o = [], i = [];
|
|
459
|
+
for (let s = 0; s < this.animationGroups.length; s++)
|
|
460
|
+
e(this.animationGroups[s]) ? n.push(this.animationGroups[s]) : (o.push(this.animationGroups[s]), i.push(this.timingOptions[s]));
|
|
330
461
|
if (n.length === 0) return n;
|
|
331
|
-
for (const
|
|
332
|
-
|
|
333
|
-
return this.animationGroups =
|
|
462
|
+
for (const s of n)
|
|
463
|
+
s.cancel();
|
|
464
|
+
return this.animationGroups = o, this.timingOptions = i, this.animations = o.flatMap((s) => [...s.animations]), this.applyOffsets(), this.ready = Promise.all(this.animationGroups.map((s) => s.ready)).then(() => {
|
|
334
465
|
}), n;
|
|
335
466
|
}
|
|
336
|
-
async onFinish(
|
|
467
|
+
async onFinish(e) {
|
|
337
468
|
try {
|
|
338
|
-
await Promise.all(this.animationGroups.map((n) => n.finished)),
|
|
469
|
+
await Promise.all(this.animationGroups.map((n) => n.finished)), e();
|
|
339
470
|
} catch (n) {
|
|
340
471
|
console.warn("animation was interrupted - aborting onFinish callback - ", n);
|
|
341
472
|
}
|
|
342
473
|
}
|
|
343
474
|
}
|
|
344
|
-
class
|
|
475
|
+
class Mt {
|
|
345
476
|
_animation;
|
|
346
477
|
customEffect;
|
|
347
478
|
progress;
|
|
348
479
|
_tickCbId;
|
|
349
480
|
_finishHandler;
|
|
350
|
-
constructor(
|
|
351
|
-
const
|
|
352
|
-
...
|
|
481
|
+
constructor(e, n, o, i) {
|
|
482
|
+
const s = new KeyframeEffect(n, [], {
|
|
483
|
+
...o,
|
|
353
484
|
composite: "add"
|
|
354
|
-
}), { timeline:
|
|
355
|
-
this._animation = new Animation(
|
|
356
|
-
this.effect.target?.getAnimations().find((
|
|
485
|
+
}), { timeline: a } = i;
|
|
486
|
+
this._animation = new Animation(s, a), this._tickCbId = null, this.progress = null, this.customEffect = (r) => e(s.target, r), this._finishHandler = (r) => {
|
|
487
|
+
this.effect.target?.getAnimations().find((f) => f === this._animation) || this.cancel();
|
|
357
488
|
}, this.addEventListener("finish", this._finishHandler), this.addEventListener("remove", this._finishHandler);
|
|
358
489
|
}
|
|
359
490
|
// private tick method for customEffect loop implementation
|
|
360
491
|
_tick() {
|
|
361
492
|
try {
|
|
362
|
-
const
|
|
363
|
-
|
|
493
|
+
const e = this.effect?.getComputedTiming().progress ?? null;
|
|
494
|
+
e !== this.progress && (this.customEffect?.(e), this.progress = e), this._tickCbId = requestAnimationFrame(() => {
|
|
364
495
|
this._tick();
|
|
365
496
|
});
|
|
366
|
-
} catch (
|
|
497
|
+
} catch (e) {
|
|
367
498
|
this._tickCbId = null, console.error(
|
|
368
|
-
`failed to run customEffect! effectId: ${this.id}, error: ${
|
|
499
|
+
`failed to run customEffect! effectId: ${this.id}, error: ${e instanceof Error ? e.message : e}`
|
|
369
500
|
);
|
|
370
501
|
}
|
|
371
502
|
}
|
|
@@ -373,39 +504,39 @@ class _t {
|
|
|
373
504
|
get currentTime() {
|
|
374
505
|
return this._animation.currentTime;
|
|
375
506
|
}
|
|
376
|
-
set currentTime(
|
|
377
|
-
this._animation.currentTime =
|
|
507
|
+
set currentTime(e) {
|
|
508
|
+
this._animation.currentTime = e;
|
|
378
509
|
}
|
|
379
510
|
get startTime() {
|
|
380
511
|
return this._animation.startTime;
|
|
381
512
|
}
|
|
382
|
-
set startTime(
|
|
383
|
-
this._animation.startTime =
|
|
513
|
+
set startTime(e) {
|
|
514
|
+
this._animation.startTime = e;
|
|
384
515
|
}
|
|
385
516
|
get playbackRate() {
|
|
386
517
|
return this._animation.playbackRate;
|
|
387
518
|
}
|
|
388
|
-
set playbackRate(
|
|
389
|
-
this._animation.playbackRate =
|
|
519
|
+
set playbackRate(e) {
|
|
520
|
+
this._animation.playbackRate = e;
|
|
390
521
|
}
|
|
391
522
|
// Animation basic properties
|
|
392
523
|
get id() {
|
|
393
524
|
return this._animation.id;
|
|
394
525
|
}
|
|
395
|
-
set id(
|
|
396
|
-
this._animation.id =
|
|
526
|
+
set id(e) {
|
|
527
|
+
this._animation.id = e;
|
|
397
528
|
}
|
|
398
529
|
get effect() {
|
|
399
530
|
return this._animation.effect;
|
|
400
531
|
}
|
|
401
|
-
set effect(
|
|
402
|
-
this._animation.effect =
|
|
532
|
+
set effect(e) {
|
|
533
|
+
this._animation.effect = e;
|
|
403
534
|
}
|
|
404
535
|
get timeline() {
|
|
405
536
|
return this._animation.timeline;
|
|
406
537
|
}
|
|
407
|
-
set timeline(
|
|
408
|
-
this._animation.timeline =
|
|
538
|
+
set timeline(e) {
|
|
539
|
+
this._animation.timeline = e;
|
|
409
540
|
}
|
|
410
541
|
// Animation readonly state properties
|
|
411
542
|
get finished() {
|
|
@@ -427,20 +558,20 @@ class _t {
|
|
|
427
558
|
get oncancel() {
|
|
428
559
|
return this._animation.oncancel;
|
|
429
560
|
}
|
|
430
|
-
set oncancel(
|
|
431
|
-
this._animation.oncancel =
|
|
561
|
+
set oncancel(e) {
|
|
562
|
+
this._animation.oncancel = e;
|
|
432
563
|
}
|
|
433
564
|
get onfinish() {
|
|
434
565
|
return this._animation.onfinish;
|
|
435
566
|
}
|
|
436
|
-
set onfinish(
|
|
437
|
-
this._animation.onfinish =
|
|
567
|
+
set onfinish(e) {
|
|
568
|
+
this._animation.onfinish = e;
|
|
438
569
|
}
|
|
439
570
|
get onremove() {
|
|
440
571
|
return this._animation.onremove;
|
|
441
572
|
}
|
|
442
|
-
set onremove(
|
|
443
|
-
this._animation.onremove =
|
|
573
|
+
set onremove(e) {
|
|
574
|
+
this._animation.onremove = e;
|
|
444
575
|
}
|
|
445
576
|
// CustomAnimation overridden methods
|
|
446
577
|
play() {
|
|
@@ -467,37 +598,37 @@ class _t {
|
|
|
467
598
|
reverse() {
|
|
468
599
|
this._animation.reverse();
|
|
469
600
|
}
|
|
470
|
-
updatePlaybackRate(
|
|
471
|
-
this._animation.updatePlaybackRate(
|
|
601
|
+
updatePlaybackRate(e) {
|
|
602
|
+
this._animation.updatePlaybackRate(e);
|
|
472
603
|
}
|
|
473
604
|
// Animation events API
|
|
474
|
-
addEventListener(
|
|
475
|
-
this._animation.addEventListener(
|
|
605
|
+
addEventListener(e, n, o) {
|
|
606
|
+
this._animation.addEventListener(e, n, o);
|
|
476
607
|
}
|
|
477
|
-
removeEventListener(
|
|
478
|
-
this._animation.removeEventListener(
|
|
608
|
+
removeEventListener(e, n, o) {
|
|
609
|
+
this._animation.removeEventListener(e, n, o);
|
|
479
610
|
}
|
|
480
|
-
dispatchEvent(
|
|
481
|
-
return this._animation.dispatchEvent(
|
|
611
|
+
dispatchEvent(e) {
|
|
612
|
+
return this._animation.dispatchEvent(e);
|
|
482
613
|
}
|
|
483
614
|
}
|
|
484
|
-
function
|
|
485
|
-
return
|
|
615
|
+
function Nt(t) {
|
|
616
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
486
617
|
}
|
|
487
|
-
var
|
|
488
|
-
function
|
|
489
|
-
return
|
|
490
|
-
(function(
|
|
618
|
+
var S = { exports: {} }, F = S.exports, D;
|
|
619
|
+
function Ft() {
|
|
620
|
+
return D || (D = 1, (function(t) {
|
|
621
|
+
(function(e) {
|
|
491
622
|
var n = function() {
|
|
492
|
-
},
|
|
493
|
-
return setTimeout(
|
|
623
|
+
}, o = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.msRequestAnimationFrame || function(c) {
|
|
624
|
+
return setTimeout(c, 16);
|
|
494
625
|
};
|
|
495
|
-
function
|
|
496
|
-
var
|
|
497
|
-
|
|
626
|
+
function i() {
|
|
627
|
+
var c = this;
|
|
628
|
+
c.reads = [], c.writes = [], c.raf = o.bind(e);
|
|
498
629
|
}
|
|
499
|
-
|
|
500
|
-
constructor:
|
|
630
|
+
i.prototype = {
|
|
631
|
+
constructor: i,
|
|
501
632
|
/**
|
|
502
633
|
* We run this inside a try catch
|
|
503
634
|
* so that if any jobs error, we
|
|
@@ -506,8 +637,8 @@ function It() {
|
|
|
506
637
|
*
|
|
507
638
|
* @param {Array} tasks
|
|
508
639
|
*/
|
|
509
|
-
runTasks: function(
|
|
510
|
-
for (var u; u =
|
|
640
|
+
runTasks: function(c) {
|
|
641
|
+
for (var u; u = c.shift(); ) u();
|
|
511
642
|
},
|
|
512
643
|
/**
|
|
513
644
|
* Adds a job to the read batch and
|
|
@@ -517,9 +648,9 @@ function It() {
|
|
|
517
648
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
518
649
|
* @public
|
|
519
650
|
*/
|
|
520
|
-
measure: function(
|
|
521
|
-
var
|
|
522
|
-
return this.reads.push(
|
|
651
|
+
measure: function(c, u) {
|
|
652
|
+
var m = u ? c.bind(u) : c;
|
|
653
|
+
return this.reads.push(m), s(this), m;
|
|
523
654
|
},
|
|
524
655
|
/**
|
|
525
656
|
* Adds a job to the
|
|
@@ -530,9 +661,9 @@ function It() {
|
|
|
530
661
|
* @param {Object} ctx the context to be bound to `fn` (optional).
|
|
531
662
|
* @public
|
|
532
663
|
*/
|
|
533
|
-
mutate: function(
|
|
534
|
-
var
|
|
535
|
-
return this.writes.push(
|
|
664
|
+
mutate: function(c, u) {
|
|
665
|
+
var m = u ? c.bind(u) : c;
|
|
666
|
+
return this.writes.push(m), s(this), m;
|
|
536
667
|
},
|
|
537
668
|
/**
|
|
538
669
|
* Clears a scheduled 'read' or 'write' task.
|
|
@@ -541,8 +672,8 @@ function It() {
|
|
|
541
672
|
* @return {Boolean} success
|
|
542
673
|
* @public
|
|
543
674
|
*/
|
|
544
|
-
clear: function(
|
|
545
|
-
return
|
|
675
|
+
clear: function(c) {
|
|
676
|
+
return r(this.reads, c) || r(this.writes, c);
|
|
546
677
|
},
|
|
547
678
|
/**
|
|
548
679
|
* Extend this FastDom with some
|
|
@@ -578,271 +709,287 @@ function It() {
|
|
|
578
709
|
* @param {Object} props properties to mixin
|
|
579
710
|
* @return {FastDom}
|
|
580
711
|
*/
|
|
581
|
-
extend: function(
|
|
582
|
-
if (typeof
|
|
712
|
+
extend: function(c) {
|
|
713
|
+
if (typeof c != "object") throw new Error("expected object");
|
|
583
714
|
var u = Object.create(this);
|
|
584
|
-
return
|
|
715
|
+
return f(u, c), u.fastdom = this, u.initialize && u.initialize(), u;
|
|
585
716
|
},
|
|
586
717
|
// override this with a function
|
|
587
718
|
// to prevent Errors in console
|
|
588
719
|
// when tasks throw
|
|
589
720
|
catch: null
|
|
590
721
|
};
|
|
591
|
-
function
|
|
592
|
-
|
|
722
|
+
function s(c) {
|
|
723
|
+
c.scheduled || (c.scheduled = !0, c.raf(a.bind(null, c)));
|
|
593
724
|
}
|
|
594
|
-
function c
|
|
595
|
-
var u =
|
|
725
|
+
function a(c) {
|
|
726
|
+
var u = c.writes, m = c.reads, p;
|
|
596
727
|
try {
|
|
597
|
-
n("flushing reads",
|
|
598
|
-
} catch (
|
|
599
|
-
p =
|
|
728
|
+
n("flushing reads", m.length), c.runTasks(m), n("flushing writes", u.length), c.runTasks(u);
|
|
729
|
+
} catch (l) {
|
|
730
|
+
p = l;
|
|
600
731
|
}
|
|
601
|
-
if (
|
|
602
|
-
if (n("task errored", p.message),
|
|
732
|
+
if (c.scheduled = !1, (m.length || u.length) && s(c), p)
|
|
733
|
+
if (n("task errored", p.message), c.catch) c.catch(p);
|
|
603
734
|
else throw p;
|
|
604
735
|
}
|
|
605
|
-
function
|
|
606
|
-
var
|
|
607
|
-
return !!~
|
|
736
|
+
function r(c, u) {
|
|
737
|
+
var m = c.indexOf(u);
|
|
738
|
+
return !!~m && !!c.splice(m, 1);
|
|
608
739
|
}
|
|
609
|
-
function
|
|
610
|
-
for (var
|
|
611
|
-
u.hasOwnProperty(
|
|
740
|
+
function f(c, u) {
|
|
741
|
+
for (var m in u)
|
|
742
|
+
u.hasOwnProperty(m) && (c[m] = u[m]);
|
|
612
743
|
}
|
|
613
|
-
var
|
|
614
|
-
|
|
744
|
+
var d = e.fastdom = e.fastdom || new i();
|
|
745
|
+
t.exports = d;
|
|
615
746
|
})(typeof window < "u" ? window : typeof F < "u" ? F : globalThis);
|
|
616
|
-
})(
|
|
747
|
+
})(S)), S.exports;
|
|
617
748
|
}
|
|
618
|
-
var
|
|
619
|
-
const
|
|
620
|
-
function
|
|
621
|
-
Object.assign(
|
|
749
|
+
var Dt = Ft();
|
|
750
|
+
const w = /* @__PURE__ */ Nt(Dt), P = {};
|
|
751
|
+
function Zt(t) {
|
|
752
|
+
Object.assign(P, t);
|
|
622
753
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
625
|
-
`${
|
|
754
|
+
function Gt(t) {
|
|
755
|
+
return t in P ? P[t] : (console.warn(
|
|
756
|
+
`${t} not found in registry. Please make sure to import and register the preset.`
|
|
626
757
|
), null);
|
|
627
758
|
}
|
|
628
|
-
function
|
|
629
|
-
return
|
|
759
|
+
function I(t, e) {
|
|
760
|
+
return t ? (e || document).getElementById(t) : null;
|
|
630
761
|
}
|
|
631
|
-
function
|
|
632
|
-
return
|
|
762
|
+
function Rt(t, e) {
|
|
763
|
+
return t?.matches(`[data-motion-part~="${e}"]`) ? t : t?.querySelector(`[data-motion-part~="${e}"]`);
|
|
633
764
|
}
|
|
634
|
-
function
|
|
635
|
-
const
|
|
636
|
-
return
|
|
765
|
+
function Lt(t) {
|
|
766
|
+
const e = t.alternate ? "alternate" : "";
|
|
767
|
+
return t.reversed ? `${e ? `${e}-` : ""}reverse` : e || "normal";
|
|
637
768
|
}
|
|
638
|
-
function k(
|
|
639
|
-
return `${
|
|
769
|
+
function k(t) {
|
|
770
|
+
return `${t.value}${wt(t.unit)}`;
|
|
640
771
|
}
|
|
641
|
-
function
|
|
642
|
-
return `${
|
|
772
|
+
function G(t, e, n) {
|
|
773
|
+
return `${t.name || "cover"} ${n && t.offset.unit !== "percentage" ? `calc(100% + ${k(t.offset)}${e ? ` + ${e}` : ""})` : e ? `calc(${k(t.offset)} + ${e})` : k(t.offset)}`;
|
|
643
774
|
}
|
|
644
|
-
function
|
|
775
|
+
function K(t) {
|
|
645
776
|
return {
|
|
646
|
-
start:
|
|
647
|
-
end:
|
|
777
|
+
start: G(t.startOffset, t.startOffsetAdd),
|
|
778
|
+
end: G(t.endOffset, t.endOffsetAdd, !0)
|
|
648
779
|
};
|
|
649
780
|
}
|
|
650
|
-
function
|
|
651
|
-
return (
|
|
781
|
+
function V(t) {
|
|
782
|
+
return (e) => w.measure(() => e(t));
|
|
652
783
|
}
|
|
653
|
-
function
|
|
654
|
-
return (
|
|
784
|
+
function X(t) {
|
|
785
|
+
return (e) => w.mutate(() => e(t));
|
|
655
786
|
}
|
|
656
|
-
function
|
|
657
|
-
if (
|
|
658
|
-
const
|
|
659
|
-
return typeof
|
|
660
|
-
} else if (
|
|
661
|
-
const
|
|
662
|
-
const { name:
|
|
663
|
-
return [{ ...
|
|
787
|
+
function O(t) {
|
|
788
|
+
if (t.namedEffect) {
|
|
789
|
+
const e = t.namedEffect.type;
|
|
790
|
+
return typeof e == "string" ? Gt(e) : null;
|
|
791
|
+
} else if (t.keyframeEffect) {
|
|
792
|
+
const e = (o) => {
|
|
793
|
+
const { name: i, keyframes: s } = o.keyframeEffect;
|
|
794
|
+
return [{ ...o, name: i, keyframes: s }];
|
|
664
795
|
};
|
|
665
|
-
return { web:
|
|
666
|
-
const { effectId:
|
|
667
|
-
return
|
|
796
|
+
return { web: e, style: e, getNames: (o) => {
|
|
797
|
+
const { effectId: i } = o, { name: s } = o.keyframeEffect, a = s || i;
|
|
798
|
+
return a ? [a] : [];
|
|
668
799
|
} };
|
|
669
|
-
} else if (
|
|
670
|
-
return (
|
|
800
|
+
} else if (t.customEffect)
|
|
801
|
+
return (e) => [{ ...e, keyframes: [] }];
|
|
671
802
|
return null;
|
|
672
803
|
}
|
|
673
|
-
function
|
|
674
|
-
return
|
|
675
|
-
const
|
|
676
|
-
fill:
|
|
677
|
-
easing:
|
|
678
|
-
iterations:
|
|
679
|
-
composite:
|
|
680
|
-
direction:
|
|
804
|
+
function J(t, e, n, o) {
|
|
805
|
+
return t.map((i, s) => {
|
|
806
|
+
const a = {
|
|
807
|
+
fill: i.fill,
|
|
808
|
+
easing: qt(i.easing),
|
|
809
|
+
iterations: i.iterations === 0 ? 1 / 0 : i.iterations || 1,
|
|
810
|
+
composite: i.composite,
|
|
811
|
+
direction: Lt(i)
|
|
681
812
|
};
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
813
|
+
C(e) ? (a.duration = i.duration, a.delay = i.delay || 0) : e?.trigger === "view-progress" && (o || window.ViewTimeline) ? a.duration = "auto" : (a.duration = 99.99, a.delay = 0.01);
|
|
814
|
+
const r = At(i.keyframes);
|
|
815
|
+
return {
|
|
816
|
+
effect: r === i.keyframes ? i : { ...i, keyframes: r },
|
|
817
|
+
options: a,
|
|
818
|
+
id: n && `${n}-${s + 1}`,
|
|
819
|
+
part: i.part
|
|
687
820
|
};
|
|
688
821
|
});
|
|
689
822
|
}
|
|
690
|
-
function
|
|
691
|
-
return !
|
|
823
|
+
function C(t) {
|
|
824
|
+
return !t || t.trigger !== "pointer-move" && t.trigger !== "view-progress";
|
|
692
825
|
}
|
|
693
|
-
function
|
|
694
|
-
if (
|
|
695
|
-
if (
|
|
696
|
-
if (
|
|
697
|
-
|
|
826
|
+
function R(t, e, n, o, i) {
|
|
827
|
+
if (t) {
|
|
828
|
+
if (C(o) && (e.duration = e.duration || 1, i?.reducedMotion))
|
|
829
|
+
if (e.iterations === 1 || e.iterations == null)
|
|
830
|
+
e = { ...e, duration: 1 };
|
|
698
831
|
else
|
|
699
832
|
return [];
|
|
700
|
-
let
|
|
701
|
-
return n instanceof HTMLElement && (
|
|
833
|
+
let s;
|
|
834
|
+
return n instanceof HTMLElement && (s = { measure: V(n), mutate: X(n) }), t.web ? t.web(e, s, i) : t(e, s, i);
|
|
702
835
|
}
|
|
703
836
|
return [];
|
|
704
837
|
}
|
|
705
|
-
function
|
|
706
|
-
const
|
|
707
|
-
if (n?.trigger === "pointer-move" && !
|
|
708
|
-
let
|
|
709
|
-
|
|
710
|
-
...
|
|
838
|
+
function U(t, e, n, o, i) {
|
|
839
|
+
const s = typeof t == "string" ? I(t, i) : t;
|
|
840
|
+
if (n?.trigger === "pointer-move" && !e.keyframeEffect) {
|
|
841
|
+
let m = e;
|
|
842
|
+
e.customEffect && (m = {
|
|
843
|
+
...e,
|
|
711
844
|
namedEffect: { id: "", type: "CustomMouse" }
|
|
712
845
|
});
|
|
713
|
-
const p =
|
|
714
|
-
|
|
715
|
-
),
|
|
846
|
+
const p = O(
|
|
847
|
+
m
|
|
848
|
+
), l = R(
|
|
716
849
|
p,
|
|
717
|
-
|
|
718
|
-
|
|
850
|
+
e,
|
|
851
|
+
s,
|
|
719
852
|
n,
|
|
720
|
-
|
|
853
|
+
o
|
|
721
854
|
);
|
|
722
|
-
return typeof
|
|
855
|
+
return typeof l != "function" ? null : l(s);
|
|
723
856
|
}
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
857
|
+
const a = O(e), r = R(
|
|
858
|
+
a,
|
|
859
|
+
e,
|
|
860
|
+
s,
|
|
728
861
|
n,
|
|
729
|
-
|
|
862
|
+
o
|
|
730
863
|
);
|
|
731
|
-
if (!
|
|
864
|
+
if (!r || r.length === 0)
|
|
732
865
|
return null;
|
|
733
|
-
const
|
|
734
|
-
let
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
subject: n.element ||
|
|
866
|
+
const f = J(r, n, e.effectId);
|
|
867
|
+
let d;
|
|
868
|
+
const c = n?.trigger === "view-progress";
|
|
869
|
+
c && window.ViewTimeline && (d = new ViewTimeline({
|
|
870
|
+
subject: n.element || I(n.componentId)
|
|
738
871
|
}));
|
|
739
|
-
const u =
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
"timing" in
|
|
872
|
+
const u = f.map(({ effect: m, options: p, id: l, part: h }) => {
|
|
873
|
+
const $ = h ? Rt(s, h) : s, g = new KeyframeEffect($ || null, [], p);
|
|
874
|
+
w.mutate(() => {
|
|
875
|
+
"timing" in m && g.updateTiming(m.timing), g.setKeyframes(m.keyframes);
|
|
743
876
|
});
|
|
744
|
-
const y =
|
|
745
|
-
|
|
746
|
-
|
|
877
|
+
const y = c && d ? { timeline: d } : {}, b = typeof m.customEffect == "function" ? new Mt(
|
|
878
|
+
m.customEffect,
|
|
879
|
+
$ || null,
|
|
747
880
|
p,
|
|
748
881
|
y
|
|
749
882
|
) : new Animation(g, y.timeline);
|
|
750
|
-
if (
|
|
751
|
-
if (
|
|
752
|
-
|
|
753
|
-
const { start:
|
|
754
|
-
b.rangeStart =
|
|
883
|
+
if (c)
|
|
884
|
+
if (d)
|
|
885
|
+
w.mutate(() => {
|
|
886
|
+
const { start: v, end: A } = K(m);
|
|
887
|
+
b.rangeStart = v, b.rangeEnd = A, b.play();
|
|
755
888
|
});
|
|
756
889
|
else {
|
|
757
|
-
const { startOffset:
|
|
758
|
-
|
|
759
|
-
const q =
|
|
890
|
+
const { startOffset: v, endOffset: A } = e;
|
|
891
|
+
w.mutate(() => {
|
|
892
|
+
const q = m.startOffset || v, T = m.endOffset || A;
|
|
760
893
|
Object.assign(b, {
|
|
761
894
|
start: {
|
|
762
895
|
name: q.name,
|
|
763
896
|
offset: q.offset?.value,
|
|
764
|
-
add:
|
|
897
|
+
add: m.startOffsetAdd
|
|
765
898
|
},
|
|
766
899
|
end: {
|
|
767
|
-
name:
|
|
768
|
-
offset:
|
|
769
|
-
add:
|
|
900
|
+
name: T.name,
|
|
901
|
+
offset: T.offset?.value,
|
|
902
|
+
add: m.endOffsetAdd
|
|
770
903
|
}
|
|
771
904
|
});
|
|
772
905
|
});
|
|
773
906
|
}
|
|
774
|
-
return
|
|
907
|
+
return l && (b.id = l), b;
|
|
775
908
|
});
|
|
776
|
-
return new
|
|
777
|
-
...
|
|
909
|
+
return new _(u, {
|
|
910
|
+
...e,
|
|
778
911
|
trigger: { ...n || {} },
|
|
779
912
|
// make sure the group is ready after all animation targets are measured and mutated
|
|
780
|
-
measured: new Promise((
|
|
913
|
+
measured: new Promise((m) => w.mutate(m))
|
|
781
914
|
});
|
|
782
915
|
}
|
|
783
|
-
function
|
|
784
|
-
return
|
|
916
|
+
function jt(t, e) {
|
|
917
|
+
return t ? `#${t}${e ? `[data-motion-part~="${e}"]` : ""}` : "";
|
|
785
918
|
}
|
|
786
|
-
function
|
|
787
|
-
const { duration:
|
|
788
|
-
|
|
919
|
+
function Wt(t, e, n) {
|
|
920
|
+
const { duration: o, delay: i, iterations: s = 1, fill: a, easing: r = "linear", direction: f } = t.options, d = t.effect.name, c = o === "auto", { sequenceId: u, delay: m, offset: p, offsetEasing: l = "linear" } = n || {};
|
|
921
|
+
let h = `${i ?? 0}ms`;
|
|
922
|
+
if (u && typeof l == "string") {
|
|
923
|
+
const $ = xt(l);
|
|
924
|
+
if ($) {
|
|
925
|
+
const g = (i ?? 0) + (m ?? 0);
|
|
926
|
+
if (p) {
|
|
927
|
+
const y = $(
|
|
928
|
+
`(var(--motion-${u}-index, 0) / var(--motion-${u}-last, 1))`
|
|
929
|
+
);
|
|
930
|
+
h = `calc(${`(${g} + ${y} * ${p} * var(--motion-${u}-last, 1))`} * 1ms)`;
|
|
931
|
+
} else
|
|
932
|
+
h = `${g}ms`;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return `${d} ${c ? "auto" : `${o}ms`}${c ? " " : ` ${h} `}${r}${a && a !== "none" ? ` ${a}` : ""} ${!s || s === 1 / 0 ? "infinite" : s}${f === "normal" ? "" : ` ${f}`} ${e ? "" : "paused"}`;
|
|
789
936
|
}
|
|
790
|
-
function
|
|
791
|
-
return
|
|
937
|
+
function Ht(t, e, n) {
|
|
938
|
+
return t?.style ? (C(n) && (e.duration = e.duration || 1), t.style(e)) : [];
|
|
792
939
|
}
|
|
793
|
-
function
|
|
794
|
-
const i =
|
|
795
|
-
return
|
|
796
|
-
const { start:
|
|
940
|
+
function Qt(t, e, n, o) {
|
|
941
|
+
const i = O(e), s = Ht(i, e), a = J(s, n, e.effectId, !0), r = n?.trigger === "view-progress";
|
|
942
|
+
return a.map((f, d) => {
|
|
943
|
+
const { start: c, end: u } = r ? K(f.effect) : {};
|
|
797
944
|
return {
|
|
798
|
-
target:
|
|
799
|
-
animation:
|
|
800
|
-
composition:
|
|
801
|
-
custom:
|
|
802
|
-
name:
|
|
803
|
-
keyframes:
|
|
804
|
-
id:
|
|
805
|
-
animationTimeline:
|
|
806
|
-
animationRange:
|
|
945
|
+
target: jt(t, f.part),
|
|
946
|
+
animation: Wt(f, r, o),
|
|
947
|
+
composition: f.options.composite,
|
|
948
|
+
custom: f.effect.custom,
|
|
949
|
+
name: f.effect.name,
|
|
950
|
+
keyframes: f.effect.keyframes,
|
|
951
|
+
id: f.id && `${f.id}-${d + 1}`,
|
|
952
|
+
animationTimeline: r ? `--${n?.id}` : "",
|
|
953
|
+
animationRange: c || u ? `${c} ${u}` : ""
|
|
807
954
|
};
|
|
808
955
|
});
|
|
809
956
|
}
|
|
810
|
-
function
|
|
811
|
-
const
|
|
812
|
-
if (
|
|
813
|
-
const
|
|
814
|
-
|
|
957
|
+
function Bt(t, e, n) {
|
|
958
|
+
const o = O(e), i = t instanceof HTMLElement ? t : I(t);
|
|
959
|
+
if (o && o.prepare && i) {
|
|
960
|
+
const s = { measure: V(i), mutate: X(i) };
|
|
961
|
+
o.prepare(e, s);
|
|
815
962
|
}
|
|
816
|
-
n &&
|
|
963
|
+
n && w.mutate(n);
|
|
817
964
|
}
|
|
818
|
-
function
|
|
819
|
-
const n =
|
|
965
|
+
function Kt(t, e) {
|
|
966
|
+
const n = O(e);
|
|
820
967
|
if (!n)
|
|
821
968
|
return null;
|
|
822
969
|
if (!n.style)
|
|
823
|
-
return
|
|
824
|
-
const
|
|
825
|
-
return
|
|
826
|
-
|
|
827
|
-
|
|
970
|
+
return e.effectId && t ? Vt(t, e.effectId) : null;
|
|
971
|
+
const o = n.getNames(e), s = (typeof t == "string" ? I(t) : t)?.getAnimations(), a = s?.map((f) => f.animationName) || [], r = [];
|
|
972
|
+
return o.forEach((f) => {
|
|
973
|
+
a.includes(f) && r.push(
|
|
974
|
+
s?.find((d) => d.animationName === f)
|
|
828
975
|
);
|
|
829
|
-
}),
|
|
976
|
+
}), r?.length ? new _(r) : null;
|
|
830
977
|
}
|
|
831
|
-
function
|
|
832
|
-
const
|
|
833
|
-
const
|
|
834
|
-
return
|
|
978
|
+
function Vt(t, e) {
|
|
979
|
+
const o = (typeof t == "string" ? I(t) : t)?.getAnimations().filter((i) => {
|
|
980
|
+
const s = i.id || i.animationName;
|
|
981
|
+
return s ? s.startsWith(e) : !0;
|
|
835
982
|
});
|
|
836
|
-
return
|
|
983
|
+
return o?.length ? new _(o) : null;
|
|
837
984
|
}
|
|
838
|
-
function
|
|
839
|
-
const { disabled:
|
|
840
|
-
if (!
|
|
985
|
+
function te(t, e, n, o = {}) {
|
|
986
|
+
const { disabled: i, allowActiveEvent: s, ...a } = o, r = U(t, e, n, a);
|
|
987
|
+
if (!r)
|
|
841
988
|
return null;
|
|
842
|
-
let
|
|
989
|
+
let f = {};
|
|
843
990
|
if (n.trigger === "view-progress" && !window.ViewTimeline) {
|
|
844
|
-
const
|
|
845
|
-
return
|
|
991
|
+
const d = n.element || I(n.componentId), { ready: c } = r;
|
|
992
|
+
return r.animations.map((u) => ({
|
|
846
993
|
/* we use getters for start and end in order to access the animation's start and end
|
|
847
994
|
only when initializing the scrub scene rather than immediately */
|
|
848
995
|
get start() {
|
|
@@ -851,137 +998,144 @@ function Dt(e, t, n, i = {}) {
|
|
|
851
998
|
get end() {
|
|
852
999
|
return u.end;
|
|
853
1000
|
},
|
|
854
|
-
viewSource:
|
|
855
|
-
ready:
|
|
1001
|
+
viewSource: d,
|
|
1002
|
+
ready: c,
|
|
856
1003
|
getProgress() {
|
|
857
|
-
return
|
|
1004
|
+
return r.getProgress();
|
|
858
1005
|
},
|
|
859
|
-
effect(
|
|
860
|
-
const { activeDuration:
|
|
861
|
-
u.currentTime = ((
|
|
1006
|
+
effect(m, p) {
|
|
1007
|
+
const { activeDuration: l } = u.effect.getComputedTiming(), { delay: h } = u.effect.getTiming();
|
|
1008
|
+
u.currentTime = ((h || 0) + (l || 0)) * p;
|
|
862
1009
|
},
|
|
863
|
-
disabled:
|
|
1010
|
+
disabled: i,
|
|
864
1011
|
destroy() {
|
|
865
1012
|
u.cancel();
|
|
866
1013
|
}
|
|
867
1014
|
}));
|
|
868
1015
|
} else if (n.trigger === "pointer-move") {
|
|
869
|
-
const
|
|
870
|
-
if (
|
|
871
|
-
const
|
|
872
|
-
return
|
|
1016
|
+
const d = e, { centeredToTarget: c, transitionDuration: u, transitionEasing: m } = d, p = n.axis;
|
|
1017
|
+
if (d.keyframeEffect) {
|
|
1018
|
+
const l = r;
|
|
1019
|
+
return l.animations?.length === 0 ? null : {
|
|
873
1020
|
target: void 0,
|
|
874
|
-
centeredToTarget:
|
|
875
|
-
ready:
|
|
1021
|
+
centeredToTarget: c,
|
|
1022
|
+
ready: l.ready,
|
|
876
1023
|
_currentProgress: 0,
|
|
877
1024
|
getProgress() {
|
|
878
1025
|
return this._currentProgress;
|
|
879
1026
|
},
|
|
880
|
-
effect(
|
|
1027
|
+
effect($, g) {
|
|
881
1028
|
const y = p === "x" ? g.x : g.y;
|
|
882
|
-
this._currentProgress = y,
|
|
1029
|
+
this._currentProgress = y, l.progress(y);
|
|
883
1030
|
},
|
|
884
|
-
disabled:
|
|
1031
|
+
disabled: i ?? !1,
|
|
885
1032
|
destroy() {
|
|
886
|
-
|
|
1033
|
+
l.cancel();
|
|
887
1034
|
}
|
|
888
1035
|
};
|
|
889
1036
|
}
|
|
890
|
-
|
|
891
|
-
centeredToTarget:
|
|
892
|
-
allowActiveEvent:
|
|
893
|
-
},
|
|
1037
|
+
f = {
|
|
1038
|
+
centeredToTarget: c,
|
|
1039
|
+
allowActiveEvent: s
|
|
1040
|
+
}, e.customEffect && u && (f.transitionDuration = u, f.transitionEasing = B(m)), f.target = r.target;
|
|
894
1041
|
}
|
|
895
1042
|
return {
|
|
896
|
-
...
|
|
1043
|
+
...f,
|
|
897
1044
|
getProgress() {
|
|
898
|
-
return
|
|
1045
|
+
return r.getProgress();
|
|
899
1046
|
},
|
|
900
|
-
effect(
|
|
901
|
-
|
|
1047
|
+
effect(d, c, u, m) {
|
|
1048
|
+
r.progress(
|
|
902
1049
|
u ? {
|
|
903
1050
|
// @ts-expect-error spread error on p
|
|
904
|
-
...
|
|
1051
|
+
...c,
|
|
905
1052
|
v: u,
|
|
906
|
-
active:
|
|
907
|
-
} :
|
|
1053
|
+
active: m
|
|
1054
|
+
} : c
|
|
908
1055
|
);
|
|
909
1056
|
},
|
|
910
|
-
disabled:
|
|
1057
|
+
disabled: i,
|
|
911
1058
|
destroy() {
|
|
912
|
-
|
|
1059
|
+
r.cancel();
|
|
913
1060
|
}
|
|
914
1061
|
};
|
|
915
1062
|
}
|
|
916
|
-
function
|
|
917
|
-
const
|
|
918
|
-
return
|
|
919
|
-
|
|
920
|
-
}),
|
|
1063
|
+
function Xt(t, e, n, o = !1) {
|
|
1064
|
+
const i = Kt(t, e);
|
|
1065
|
+
return i ? (i.ready = new Promise((s) => {
|
|
1066
|
+
Bt(t, e, s);
|
|
1067
|
+
}), i) : U(t, e, n, { reducedMotion: o });
|
|
921
1068
|
}
|
|
922
|
-
function
|
|
923
|
-
return
|
|
1069
|
+
function Jt(t) {
|
|
1070
|
+
return t === null ? [null] : typeof t == "string" ? Array.from(document.querySelectorAll(t)) : Array.isArray(t) ? t : [t];
|
|
924
1071
|
}
|
|
925
|
-
function
|
|
1072
|
+
function Ut(t, e) {
|
|
926
1073
|
const n = [];
|
|
927
|
-
for (const { target:
|
|
928
|
-
const
|
|
929
|
-
for (const
|
|
930
|
-
const
|
|
931
|
-
|
|
932
|
-
|
|
1074
|
+
for (const { target: o, options: i } of t) {
|
|
1075
|
+
const s = Jt(o);
|
|
1076
|
+
for (const a of s) {
|
|
1077
|
+
const r = Xt(
|
|
1078
|
+
a,
|
|
1079
|
+
i,
|
|
933
1080
|
void 0,
|
|
934
|
-
|
|
1081
|
+
e?.reducedMotion
|
|
935
1082
|
);
|
|
936
|
-
|
|
1083
|
+
r instanceof _ && n.push(r);
|
|
937
1084
|
}
|
|
938
1085
|
}
|
|
939
1086
|
return n;
|
|
940
1087
|
}
|
|
941
|
-
function
|
|
942
|
-
const
|
|
943
|
-
return new
|
|
1088
|
+
function ee(t, e, n) {
|
|
1089
|
+
const o = Ut(e, n);
|
|
1090
|
+
return new zt(o, t);
|
|
944
1091
|
}
|
|
945
1092
|
export {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
ot as
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1093
|
+
yt as backIn,
|
|
1094
|
+
vt as backInOut,
|
|
1095
|
+
bt as backOut,
|
|
1096
|
+
pt as circIn,
|
|
1097
|
+
$t as circInOut,
|
|
1098
|
+
gt as circOut,
|
|
1099
|
+
Ut as createAnimationGroups,
|
|
1100
|
+
N as cssEasings,
|
|
1101
|
+
E as cubicBezierCalc,
|
|
1102
|
+
Tt as cubicBezierEasing,
|
|
1103
|
+
it as cubicIn,
|
|
1104
|
+
ot as cubicInOut,
|
|
1105
|
+
st as cubicOut,
|
|
1106
|
+
lt as expoIn,
|
|
1107
|
+
ht as expoInOut,
|
|
1108
|
+
dt as expoOut,
|
|
1109
|
+
Xt as getAnimation,
|
|
1110
|
+
Qt as getCSSAnimation,
|
|
1111
|
+
wt as getCssUnits,
|
|
1112
|
+
qt as getEasing,
|
|
1113
|
+
Vt as getElementAnimation,
|
|
1114
|
+
Kt as getElementCSSAnimation,
|
|
1115
|
+
B as getJsEasing,
|
|
1116
|
+
xt as getJsEasingInCSS,
|
|
1117
|
+
te as getScrubScene,
|
|
1118
|
+
ee as getSequence,
|
|
1119
|
+
U as getWebAnimation,
|
|
1120
|
+
z as jsEasings,
|
|
1121
|
+
M as jsEasingsInCSS,
|
|
1122
|
+
L as linear,
|
|
1123
|
+
At as normalizeKeyframes,
|
|
1124
|
+
Bt as prepareAnimation,
|
|
1125
|
+
tt as quadIn,
|
|
1126
|
+
nt as quadInOut,
|
|
1127
|
+
et as quadOut,
|
|
1128
|
+
rt as quartIn,
|
|
1129
|
+
ct as quartInOut,
|
|
1130
|
+
at as quartOut,
|
|
1131
|
+
ut as quintIn,
|
|
1132
|
+
mt as quintInOut,
|
|
1133
|
+
ft as quintOut,
|
|
1134
|
+
Zt as registerEffects,
|
|
1135
|
+
Y as sineIn,
|
|
1136
|
+
Q as sineInOut,
|
|
1137
|
+
Z as sineOut,
|
|
1138
|
+
Yt as toCSSPropertyName,
|
|
1139
|
+
Ot as toWAAPIPropertyName
|
|
986
1140
|
};
|
|
987
1141
|
//# sourceMappingURL=motion.js.map
|