@nil-/xit 0.1.28 → 0.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/assets/bundler.js +264 -265
- package/assets/index.js +2726 -2845
- package/assets/svelte/animate.js +17 -15
- package/assets/svelte/index.js +1268 -1260
- package/assets/svelte/internal/client.js +939 -948
- package/assets/svelte/motion.js +184 -185
- package/assets/svelte/transition.js +29 -29
- package/components/layouts/Container.svelte +1 -2
- package/components/layouts/Scrollable.svelte +1 -1
- package/components/layouts/Split.svelte +6 -9
- package/components/utilities/DividerOverlay.svelte +7 -4
- package/components/utilities/draggable.js +1 -1
- package/package.json +24 -2
package/assets/svelte/motion.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var et = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var r = (e, t, s) => (
|
|
4
|
+
var X = (e, t, s) => t.has(e) || et("Cannot " + s);
|
|
5
|
+
var r = (e, t, s) => (X(e, t, "read from private field"), s ? s.call(e) : t.get(e)), a = (e, t, s) => t.has(e) ? et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), h = (e, t, s, n) => (X(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s), st = (e, t, s) => (X(e, t, "access private method"), s);
|
|
6
6
|
import "./internal/client.js";
|
|
7
|
-
import { o as
|
|
8
|
-
import { c as
|
|
7
|
+
import { o as dt, c as S, b as rt, a as g, f as ut, n as lt, g as _ } from "./index.js";
|
|
8
|
+
import { c as mt, w as nt } from "./store.js";
|
|
9
9
|
import { linear as it } from "./easing.js";
|
|
10
|
-
const
|
|
10
|
+
const pt = () => performance.now(), l = {
|
|
11
11
|
// don't access requestAnimationFrame eagerly outside method
|
|
12
12
|
// this allows basic testing of user code without JSDOM
|
|
13
13
|
// bunder will eval and remove ternary when the user's app is built
|
|
@@ -15,7 +15,7 @@ const mt = () => performance.now(), l = {
|
|
|
15
15
|
/** @param {any} _ */
|
|
16
16
|
(e) => requestAnimationFrame(e)
|
|
17
17
|
),
|
|
18
|
-
now: () =>
|
|
18
|
+
now: () => pt(),
|
|
19
19
|
tasks: /* @__PURE__ */ new Set()
|
|
20
20
|
};
|
|
21
21
|
function ot() {
|
|
@@ -24,7 +24,7 @@ function ot() {
|
|
|
24
24
|
t.c(e) || (l.tasks.delete(t), t.f());
|
|
25
25
|
}), l.tasks.size !== 0 && l.tick(ot);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function U(e) {
|
|
28
28
|
let t;
|
|
29
29
|
return l.tasks.size === 0 && l.tick(ot), {
|
|
30
30
|
promise: new Promise((s) => {
|
|
@@ -35,136 +35,136 @@ function N(e) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
var
|
|
39
|
-
class
|
|
38
|
+
var V, B;
|
|
39
|
+
class gt {
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @param {() => T} fn
|
|
43
43
|
* @param {(update: () => void) => void} onsubscribe
|
|
44
44
|
*/
|
|
45
45
|
constructor(t, s) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
h(this,
|
|
46
|
+
a(this, V);
|
|
47
|
+
a(this, B);
|
|
48
|
+
h(this, V, t), h(this, B, mt(s));
|
|
49
49
|
}
|
|
50
50
|
get current() {
|
|
51
|
-
return r(this,
|
|
51
|
+
return r(this, B).call(this), r(this, V).call(this);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
class
|
|
54
|
+
V = new WeakMap(), B = new WeakMap();
|
|
55
|
+
const bt = /\(.+\)/;
|
|
56
|
+
class yt extends gt {
|
|
57
57
|
/**
|
|
58
58
|
* @param {string} query A media query string
|
|
59
59
|
* @param {boolean} [fallback] Fallback value for the server
|
|
60
60
|
*/
|
|
61
61
|
constructor(t, s) {
|
|
62
|
-
let
|
|
63
|
-
const o = window.matchMedia(
|
|
62
|
+
let n = bt.test(t) ? t : `(${t})`;
|
|
63
|
+
const o = window.matchMedia(n);
|
|
64
64
|
super(
|
|
65
65
|
() => o.matches,
|
|
66
|
-
(
|
|
66
|
+
(i) => dt(o, "change", i)
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function J(e) {
|
|
71
71
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
if (typeof s == "number" ||
|
|
75
|
-
const o =
|
|
76
|
-
return Math.abs(m) < e.opts.precision && Math.abs(o) < e.opts.precision ?
|
|
73
|
+
function K(e, t, s, n) {
|
|
74
|
+
if (typeof s == "number" || J(s)) {
|
|
75
|
+
const o = n - s, i = (s - t) / (e.dt || 1 / 60), f = e.opts.stiffness * o, c = e.opts.damping * i, d = (f - c) * e.inv_mass, m = (i + d) * e.dt;
|
|
76
|
+
return Math.abs(m) < e.opts.precision && Math.abs(o) < e.opts.precision ? n : (e.settled = !1, J(s) ? new Date(s.getTime() + m) : s + m);
|
|
77
77
|
} else {
|
|
78
78
|
if (Array.isArray(s))
|
|
79
79
|
return s.map(
|
|
80
|
-
(o,
|
|
80
|
+
(o, i) => (
|
|
81
81
|
// @ts-ignore
|
|
82
|
-
|
|
82
|
+
K(e, t[i], s[i], n[i])
|
|
83
83
|
)
|
|
84
84
|
);
|
|
85
85
|
if (typeof s == "object") {
|
|
86
86
|
const o = {};
|
|
87
|
-
for (const
|
|
88
|
-
o[
|
|
87
|
+
for (const i in s)
|
|
88
|
+
o[i] = K(e, t[i], s[i], n[i]);
|
|
89
89
|
return o;
|
|
90
90
|
} else
|
|
91
91
|
throw new Error(`Cannot spring ${typeof s} values`);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
const s = nt(e), { stiffness:
|
|
96
|
-
let f,
|
|
94
|
+
function wt(e, t = {}) {
|
|
95
|
+
const s = nt(e), { stiffness: n = 0.15, damping: o = 0.8, precision: i = 0.01 } = t;
|
|
96
|
+
let f, c, d, m = (
|
|
97
97
|
/** @type {T} */
|
|
98
98
|
e
|
|
99
99
|
), b = (
|
|
100
100
|
/** @type {T | undefined} */
|
|
101
101
|
e
|
|
102
|
-
),
|
|
103
|
-
function
|
|
104
|
-
b =
|
|
105
|
-
const
|
|
106
|
-
return e == null || w.hard || E.stiffness >= 1 && E.damping >= 1 ? (y = !0, f = l.now(), m =
|
|
102
|
+
), u = 1, P = 0, y = !1;
|
|
103
|
+
function A(O, w = {}) {
|
|
104
|
+
b = O;
|
|
105
|
+
const ct = d = {};
|
|
106
|
+
return e == null || w.hard || E.stiffness >= 1 && E.damping >= 1 ? (y = !0, f = l.now(), m = O, s.set(e = b), Promise.resolve()) : (w.soft && (P = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), u = 0), c || (f = l.now(), y = !1, c = U((Q) => {
|
|
107
107
|
if (y)
|
|
108
|
-
return y = !1,
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
inv_mass:
|
|
108
|
+
return y = !1, c = null, !1;
|
|
109
|
+
u = Math.min(u + P, 1);
|
|
110
|
+
const at = Math.min(Q - f, 1e3 / 30), W = {
|
|
111
|
+
inv_mass: u,
|
|
112
112
|
opts: E,
|
|
113
113
|
settled: !0,
|
|
114
|
-
dt:
|
|
115
|
-
},
|
|
116
|
-
return f =
|
|
114
|
+
dt: at * 60 / 1e3
|
|
115
|
+
}, ht = K(W, m, e, b);
|
|
116
|
+
return f = Q, m = /** @type {T} */
|
|
117
117
|
e, s.set(e = /** @type {T} */
|
|
118
|
-
|
|
119
|
-
})), new Promise((
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
ht), W.settled && (c = null), !W.settled;
|
|
119
|
+
})), new Promise((Q) => {
|
|
120
|
+
c.promise.then(() => {
|
|
121
|
+
ct === d && Q();
|
|
122
122
|
});
|
|
123
123
|
}));
|
|
124
124
|
}
|
|
125
125
|
const E = {
|
|
126
|
-
set:
|
|
127
|
-
update: (
|
|
126
|
+
set: A,
|
|
127
|
+
update: (O, w) => A(O(
|
|
128
128
|
/** @type {T} */
|
|
129
129
|
b,
|
|
130
130
|
/** @type {T} */
|
|
131
131
|
e
|
|
132
132
|
), w),
|
|
133
133
|
subscribe: s.subscribe,
|
|
134
|
-
stiffness:
|
|
134
|
+
stiffness: n,
|
|
135
135
|
damping: o,
|
|
136
|
-
precision:
|
|
136
|
+
precision: i
|
|
137
137
|
};
|
|
138
138
|
return E;
|
|
139
139
|
}
|
|
140
|
-
var
|
|
141
|
-
const
|
|
140
|
+
var z, D, T, p, j, C, q, R, G, k, x, N, ft;
|
|
141
|
+
const v = class v {
|
|
142
142
|
/**
|
|
143
143
|
* @param {T} value
|
|
144
144
|
* @param {SpringOpts} [options]
|
|
145
145
|
*/
|
|
146
146
|
constructor(t, s = {}) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
a(this, N);
|
|
148
|
+
a(this, z, S(0.15));
|
|
149
|
+
a(this, D, S(0.8));
|
|
150
|
+
a(this, T, S(0.01));
|
|
151
|
+
a(this, p, S(
|
|
152
152
|
/** @type {T} */
|
|
153
153
|
void 0
|
|
154
154
|
));
|
|
155
|
-
|
|
155
|
+
a(this, j, S(
|
|
156
156
|
/** @type {T} */
|
|
157
157
|
void 0
|
|
158
158
|
));
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
a(this, C);
|
|
160
|
+
a(this, q, 0);
|
|
161
|
+
a(this, R, 1);
|
|
162
|
+
a(this, G, 0);
|
|
163
163
|
/** @type {import('../internal/client/types').Task | null} */
|
|
164
|
-
|
|
164
|
+
a(this, k, null);
|
|
165
165
|
/** @type {ReturnType<typeof deferred> | null} */
|
|
166
|
-
|
|
167
|
-
r(this, p).v = r(this,
|
|
166
|
+
a(this, x, null);
|
|
167
|
+
r(this, p).v = r(this, j).v = t, typeof s.stiffness == "number" && (r(this, z).v = I(s.stiffness, 0, 1)), typeof s.damping == "number" && (r(this, D).v = I(s.damping, 0, 1)), typeof s.precision == "number" && (r(this, T).v = s.precision);
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* Create a spring whose value is bound to the return value of `fn`. This must be called
|
|
@@ -184,10 +184,10 @@ const Z = class Z {
|
|
|
184
184
|
* @param {SpringOpts} [options]
|
|
185
185
|
*/
|
|
186
186
|
static of(t, s) {
|
|
187
|
-
const
|
|
187
|
+
const n = new v(t(), s);
|
|
188
188
|
return rt(() => {
|
|
189
|
-
|
|
190
|
-
}),
|
|
189
|
+
n.set(t());
|
|
190
|
+
}), n;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* Sets `spring.target` to `value` and returns a `Promise` that resolves if and when `spring.current` catches up to it.
|
|
@@ -201,177 +201,177 @@ const Z = class Z {
|
|
|
201
201
|
* @param {SpringUpdateOpts} [options]
|
|
202
202
|
*/
|
|
203
203
|
set(t, s) {
|
|
204
|
-
var o,
|
|
205
|
-
if ((o = r(this,
|
|
206
|
-
return (
|
|
207
|
-
s != null && s.preserveMomentum && (h(this,
|
|
208
|
-
var
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
}),
|
|
204
|
+
var o, i;
|
|
205
|
+
if ((o = r(this, x)) == null || o.reject(new Error("Aborted")), s != null && s.instant || r(this, p).v === void 0)
|
|
206
|
+
return (i = r(this, k)) == null || i.abort(), h(this, k, null), g(r(this, p), g(r(this, j), t)), h(this, C, t), Promise.resolve();
|
|
207
|
+
s != null && s.preserveMomentum && (h(this, R, 0), h(this, G, s.preserveMomentum));
|
|
208
|
+
var n = h(this, x, ut());
|
|
209
|
+
return n.promise.catch(lt), st(this, N, ft).call(this, t).then(() => {
|
|
210
|
+
n === r(this, x) && n.resolve(void 0);
|
|
211
|
+
}), n.promise;
|
|
212
212
|
}
|
|
213
213
|
get current() {
|
|
214
214
|
return _(r(this, p));
|
|
215
215
|
}
|
|
216
216
|
get damping() {
|
|
217
|
-
return _(r(this,
|
|
217
|
+
return _(r(this, D));
|
|
218
218
|
}
|
|
219
219
|
set damping(t) {
|
|
220
|
-
g(r(this,
|
|
220
|
+
g(r(this, D), I(t, 0, 1));
|
|
221
221
|
}
|
|
222
222
|
get precision() {
|
|
223
|
-
return _(r(this,
|
|
223
|
+
return _(r(this, T));
|
|
224
224
|
}
|
|
225
225
|
set precision(t) {
|
|
226
|
-
g(r(this,
|
|
226
|
+
g(r(this, T), t);
|
|
227
227
|
}
|
|
228
228
|
get stiffness() {
|
|
229
|
-
return _(r(this,
|
|
229
|
+
return _(r(this, z));
|
|
230
230
|
}
|
|
231
231
|
set stiffness(t) {
|
|
232
|
-
g(r(this,
|
|
232
|
+
g(r(this, z), I(t, 0, 1));
|
|
233
233
|
}
|
|
234
234
|
get target() {
|
|
235
|
-
return _(r(this,
|
|
235
|
+
return _(r(this, j));
|
|
236
236
|
}
|
|
237
237
|
set target(t) {
|
|
238
238
|
this.set(t);
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
|
|
241
|
+
z = new WeakMap(), D = new WeakMap(), T = new WeakMap(), p = new WeakMap(), j = new WeakMap(), C = new WeakMap(), q = new WeakMap(), R = new WeakMap(), G = new WeakMap(), k = new WeakMap(), x = new WeakMap(), N = new WeakSet(), /** @param {T} value */
|
|
242
242
|
ft = function(t) {
|
|
243
|
-
var
|
|
244
|
-
if (g(r(this,
|
|
245
|
-
h(this,
|
|
246
|
-
var s = 1e3 / (r(this,
|
|
247
|
-
r(this, k) ?? h(this, k,
|
|
248
|
-
h(this,
|
|
249
|
-
const
|
|
250
|
-
inv_mass: r(this,
|
|
243
|
+
var n;
|
|
244
|
+
if (g(r(this, j), t), (n = r(this, p)).v ?? (n.v = t), r(this, C) ?? h(this, C, r(this, p).v), !r(this, k)) {
|
|
245
|
+
h(this, q, l.now());
|
|
246
|
+
var s = 1e3 / (r(this, G) * 60);
|
|
247
|
+
r(this, k) ?? h(this, k, U((o) => {
|
|
248
|
+
h(this, R, Math.min(r(this, R) + s, 1));
|
|
249
|
+
const i = Math.min(o - r(this, q), 1e3 / 30), f = {
|
|
250
|
+
inv_mass: r(this, R),
|
|
251
251
|
opts: {
|
|
252
|
-
stiffness: r(this,
|
|
253
|
-
damping: r(this,
|
|
254
|
-
precision: r(this,
|
|
252
|
+
stiffness: r(this, z).v,
|
|
253
|
+
damping: r(this, D).v,
|
|
254
|
+
precision: r(this, T).v
|
|
255
255
|
},
|
|
256
256
|
settled: !0,
|
|
257
|
-
dt:
|
|
257
|
+
dt: i * 60 / 1e3
|
|
258
258
|
};
|
|
259
|
-
var
|
|
260
|
-
return h(this,
|
|
259
|
+
var c = K(f, r(this, C), r(this, p).v, r(this, j).v);
|
|
260
|
+
return h(this, C, r(this, p).v), h(this, q, o), g(r(this, p), c), f.settled && h(this, k, null), !f.settled;
|
|
261
261
|
}));
|
|
262
262
|
}
|
|
263
263
|
return r(this, k).promise;
|
|
264
264
|
};
|
|
265
|
-
let
|
|
266
|
-
function
|
|
265
|
+
let Y = v;
|
|
266
|
+
function I(e, t, s) {
|
|
267
267
|
return Math.max(t, Math.min(s, e));
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function L(e, t) {
|
|
270
270
|
if (e === t || e !== e) return () => e;
|
|
271
271
|
const s = typeof e;
|
|
272
272
|
if (s !== typeof t || Array.isArray(e) !== Array.isArray(t))
|
|
273
273
|
throw new Error("Cannot interpolate values of different type");
|
|
274
274
|
if (Array.isArray(e)) {
|
|
275
|
-
const
|
|
275
|
+
const n = (
|
|
276
276
|
/** @type {Array<any>} */
|
|
277
|
-
t.map((o,
|
|
277
|
+
t.map((o, i) => L(
|
|
278
278
|
/** @type {Array<any>} */
|
|
279
|
-
e[
|
|
279
|
+
e[i],
|
|
280
280
|
o
|
|
281
281
|
))
|
|
282
282
|
);
|
|
283
|
-
return (o) =>
|
|
283
|
+
return (o) => n.map((i) => i(o));
|
|
284
284
|
}
|
|
285
285
|
if (s === "object") {
|
|
286
286
|
if (!e || !t)
|
|
287
287
|
throw new Error("Object cannot be null");
|
|
288
|
-
if (
|
|
289
|
-
const
|
|
290
|
-
return (
|
|
288
|
+
if (J(e) && J(t)) {
|
|
289
|
+
const i = e.getTime(), c = t.getTime() - i;
|
|
290
|
+
return (d) => new Date(i + d * c);
|
|
291
291
|
}
|
|
292
|
-
const
|
|
293
|
-
return
|
|
294
|
-
o[
|
|
295
|
-
}), (
|
|
292
|
+
const n = Object.keys(t), o = {};
|
|
293
|
+
return n.forEach((i) => {
|
|
294
|
+
o[i] = L(e[i], t[i]);
|
|
295
|
+
}), (i) => {
|
|
296
296
|
const f = {};
|
|
297
|
-
return
|
|
298
|
-
f[
|
|
297
|
+
return n.forEach((c) => {
|
|
298
|
+
f[c] = o[c](i);
|
|
299
299
|
}), f;
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
302
|
if (s === "number") {
|
|
303
|
-
const
|
|
303
|
+
const n = (
|
|
304
304
|
/** @type {number} */
|
|
305
305
|
t - /** @type {number} */
|
|
306
306
|
e
|
|
307
307
|
);
|
|
308
|
-
return (o) => e + o *
|
|
308
|
+
return (o) => e + o * n;
|
|
309
309
|
}
|
|
310
|
-
|
|
310
|
+
return () => t;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function kt(e, t = {}) {
|
|
313
313
|
const s = nt(e);
|
|
314
|
-
let
|
|
315
|
-
function
|
|
314
|
+
let n, o = e;
|
|
315
|
+
function i(f, c) {
|
|
316
316
|
if (o = f, e == null)
|
|
317
317
|
return s.set(e = f), Promise.resolve();
|
|
318
|
-
let
|
|
318
|
+
let d = n, m = !1, {
|
|
319
319
|
delay: b = 0,
|
|
320
|
-
duration:
|
|
321
|
-
easing:
|
|
322
|
-
interpolate: y =
|
|
323
|
-
} = { ...t, ...
|
|
324
|
-
if (
|
|
325
|
-
return
|
|
326
|
-
const
|
|
320
|
+
duration: u = 400,
|
|
321
|
+
easing: P = it,
|
|
322
|
+
interpolate: y = L
|
|
323
|
+
} = { ...t, ...c };
|
|
324
|
+
if (u === 0)
|
|
325
|
+
return d && (d.abort(), d = null), s.set(e = o), Promise.resolve();
|
|
326
|
+
const A = l.now() + b;
|
|
327
327
|
let E;
|
|
328
|
-
return
|
|
329
|
-
if (
|
|
328
|
+
return n = U((O) => {
|
|
329
|
+
if (O < A) return !0;
|
|
330
330
|
m || (E = y(
|
|
331
331
|
/** @type {any} */
|
|
332
332
|
e,
|
|
333
333
|
f
|
|
334
|
-
), typeof
|
|
334
|
+
), typeof u == "function" && (u = u(
|
|
335
335
|
/** @type {any} */
|
|
336
336
|
e,
|
|
337
337
|
f
|
|
338
|
-
)), m = !0),
|
|
339
|
-
const w =
|
|
338
|
+
)), m = !0), d && (d.abort(), d = null);
|
|
339
|
+
const w = O - A;
|
|
340
340
|
return w > /** @type {number} */
|
|
341
|
-
|
|
342
|
-
}),
|
|
341
|
+
u ? (s.set(e = f), !1) : (s.set(e = E(P(w / u))), !0);
|
|
342
|
+
}), n.promise;
|
|
343
343
|
}
|
|
344
344
|
return {
|
|
345
|
-
set:
|
|
346
|
-
update: (f,
|
|
345
|
+
set: i,
|
|
346
|
+
update: (f, c) => i(f(
|
|
347
347
|
/** @type {any} */
|
|
348
348
|
o,
|
|
349
349
|
/** @type {any} */
|
|
350
350
|
e
|
|
351
|
-
),
|
|
351
|
+
), c),
|
|
352
352
|
subscribe: s.subscribe
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
-
var
|
|
355
|
+
var M, F, H, $;
|
|
356
356
|
const tt = class tt {
|
|
357
357
|
/**
|
|
358
358
|
* @param {T} value
|
|
359
359
|
* @param {TweenedOptions<T>} options
|
|
360
360
|
*/
|
|
361
361
|
constructor(t, s = {}) {
|
|
362
|
-
|
|
362
|
+
a(this, M, S(
|
|
363
363
|
/** @type {T} */
|
|
364
364
|
void 0
|
|
365
365
|
));
|
|
366
|
-
|
|
366
|
+
a(this, F, S(
|
|
367
367
|
/** @type {T} */
|
|
368
368
|
void 0
|
|
369
369
|
));
|
|
370
370
|
/** @type {TweenedOptions<T>} */
|
|
371
|
-
|
|
371
|
+
a(this, H);
|
|
372
372
|
/** @type {import('../internal/client/types').Task | null} */
|
|
373
|
-
|
|
374
|
-
r(this,
|
|
373
|
+
a(this, $, null);
|
|
374
|
+
r(this, M).v = r(this, F).v = t, h(this, H, s);
|
|
375
375
|
}
|
|
376
376
|
/**
|
|
377
377
|
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
|
@@ -391,10 +391,10 @@ const tt = class tt {
|
|
|
391
391
|
* @param {TweenedOptions<U>} [options]
|
|
392
392
|
*/
|
|
393
393
|
static of(t, s) {
|
|
394
|
-
const
|
|
394
|
+
const n = new tt(t(), s);
|
|
395
395
|
return rt(() => {
|
|
396
|
-
|
|
397
|
-
}),
|
|
396
|
+
n.set(t());
|
|
397
|
+
}), n;
|
|
398
398
|
}
|
|
399
399
|
/**
|
|
400
400
|
* Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it.
|
|
@@ -405,57 +405,56 @@ const tt = class tt {
|
|
|
405
405
|
* @returns
|
|
406
406
|
*/
|
|
407
407
|
set(t, s) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
408
|
+
var u;
|
|
409
|
+
g(r(this, F), t);
|
|
410
|
+
let {
|
|
411
|
+
delay: n = 0,
|
|
412
|
+
duration: o = 400,
|
|
413
|
+
easing: i = it,
|
|
414
|
+
interpolate: f = L
|
|
415
|
+
} = { ...r(this, H), ...s };
|
|
416
|
+
if (o === 0)
|
|
417
|
+
return (u = r(this, $)) == null || u.abort(), g(r(this, M), t), Promise.resolve();
|
|
418
|
+
const c = l.now() + n;
|
|
419
|
+
let d, m = !1, b = r(this, $);
|
|
420
|
+
return h(this, $, U((P) => {
|
|
421
|
+
if (P < c)
|
|
419
422
|
return !0;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
t
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
i,
|
|
427
|
-
t
|
|
428
|
-
)), o == null || o.abort());
|
|
429
|
-
const y = j - b;
|
|
423
|
+
if (!m) {
|
|
424
|
+
m = !0;
|
|
425
|
+
const A = r(this, M).v;
|
|
426
|
+
d = f(A, t), typeof o == "function" && (o = o(A, t)), b == null || b.abort();
|
|
427
|
+
}
|
|
428
|
+
const y = P - c;
|
|
430
429
|
return y > /** @type {number} */
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
})), r(this,
|
|
430
|
+
o ? (g(r(this, M), t), !1) : (g(r(this, M), d(i(y / /** @type {number} */
|
|
431
|
+
o))), !0);
|
|
432
|
+
})), r(this, $).promise;
|
|
434
433
|
}
|
|
435
434
|
get current() {
|
|
436
|
-
return _(r(this,
|
|
435
|
+
return _(r(this, M));
|
|
437
436
|
}
|
|
438
437
|
get target() {
|
|
439
|
-
return _(r(this,
|
|
438
|
+
return _(r(this, F));
|
|
440
439
|
}
|
|
441
440
|
set target(t) {
|
|
442
441
|
this.set(t);
|
|
443
442
|
}
|
|
444
443
|
};
|
|
445
|
-
|
|
446
|
-
let
|
|
447
|
-
const
|
|
444
|
+
M = new WeakMap(), F = new WeakMap(), H = new WeakMap(), $ = new WeakMap();
|
|
445
|
+
let Z = tt;
|
|
446
|
+
const Mt = /* @__PURE__ */ new yt(
|
|
448
447
|
"(prefers-reduced-motion: reduce)"
|
|
449
|
-
),
|
|
448
|
+
), St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
450
449
|
__proto__: null,
|
|
451
|
-
Spring:
|
|
452
|
-
Tween:
|
|
453
|
-
prefersReducedMotion:
|
|
454
|
-
spring:
|
|
455
|
-
tweened:
|
|
450
|
+
Spring: Y,
|
|
451
|
+
Tween: Z,
|
|
452
|
+
prefersReducedMotion: Mt,
|
|
453
|
+
spring: wt,
|
|
454
|
+
tweened: kt
|
|
456
455
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
457
456
|
export {
|
|
458
|
-
|
|
459
|
-
|
|
457
|
+
St as i,
|
|
458
|
+
U as l,
|
|
460
459
|
l as r
|
|
461
460
|
};
|