@juleshry/vue-animejs 1.2.1 → 1.3.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 +1 -0
- package/dist/composables/use-scroll.d.ts +33 -0
- package/dist/composables/use-scroll.d.ts.map +1 -0
- package/dist/composables/use-timeline.d.ts.map +1 -1
- package/dist/composables/use-timer.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +282 -237
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { computed as e, isRef as t, markRaw as n, shallowReadonly as r, shallowRef as i, toValue as a, unref as o, watch as s } from "vue";
|
|
2
|
-
import { animate as c, createAnimatable as l, createDraggable as u, createLayout as d, createScope as f, createTimeline as p, createTimer as m,
|
|
3
|
-
import { isClient as
|
|
2
|
+
import { animate as c, createAnimatable as l, createDraggable as u, createLayout as d, createScope as f, createTimeline as p, createTimer as m, onScroll as h, splitText as g, svg as _, waapi as v } from "animejs";
|
|
3
|
+
import { isClient as y, tryOnMounted as b, tryOnUnmounted as x, unrefElement as S } from "@vueuse/core";
|
|
4
4
|
//#region src/utils/resolve-target.ts
|
|
5
|
-
function
|
|
5
|
+
function C(e) {
|
|
6
6
|
if (Array.isArray(e)) {
|
|
7
|
-
let t = e.map((e) =>
|
|
7
|
+
let t = e.map((e) => S(e)).filter((e) => e != null);
|
|
8
8
|
return t.length > 0 ? t : void 0;
|
|
9
9
|
}
|
|
10
|
-
return
|
|
10
|
+
return S(e);
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/composables/use-animate.ts
|
|
14
|
-
function
|
|
15
|
-
let l = i(), { stop: u } = s([() =>
|
|
14
|
+
function w(e, a = {}) {
|
|
15
|
+
let l = i(), { stop: u } = s([() => C(e), () => o(a)], ([e, t]) => {
|
|
16
16
|
d(e, t);
|
|
17
17
|
}, {
|
|
18
18
|
flush: "post",
|
|
19
|
-
immediate: !t(e) &&
|
|
19
|
+
immediate: !t(e) && y
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
u(),
|
|
21
|
+
x(() => {
|
|
22
|
+
u(), b();
|
|
23
23
|
});
|
|
24
24
|
function d(e, t) {
|
|
25
|
-
if (
|
|
25
|
+
if (S(), !e) {
|
|
26
26
|
console.warn("Target element is null or undefined"), l.value = void 0;
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
@@ -46,13 +46,13 @@ function C(e, a = {}) {
|
|
|
46
46
|
function _() {
|
|
47
47
|
return l.value?.resume();
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function v() {
|
|
50
50
|
return l.value?.complete();
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function b() {
|
|
53
53
|
return l.value?.cancel();
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function S() {
|
|
56
56
|
return l.value?.revert();
|
|
57
57
|
}
|
|
58
58
|
function w(e) {
|
|
@@ -75,9 +75,9 @@ function C(e, a = {}) {
|
|
|
75
75
|
restart: h,
|
|
76
76
|
alternate: g,
|
|
77
77
|
resume: _,
|
|
78
|
-
complete:
|
|
79
|
-
cancel:
|
|
80
|
-
revert:
|
|
78
|
+
complete: v,
|
|
79
|
+
cancel: b,
|
|
80
|
+
revert: S,
|
|
81
81
|
reset: w,
|
|
82
82
|
seek: T,
|
|
83
83
|
stretch: E,
|
|
@@ -86,226 +86,232 @@ function C(e, a = {}) {
|
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/composables/use-raw-animate.ts
|
|
89
|
-
function
|
|
90
|
-
let n =
|
|
89
|
+
function T(e, t = {}) {
|
|
90
|
+
let n = C(e);
|
|
91
91
|
return n || console.warn("Target is undefined"), c(n, o(t));
|
|
92
92
|
}
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/composables/use-timer.ts
|
|
95
|
-
function
|
|
96
|
-
let t = i();
|
|
97
|
-
|
|
98
|
-
t.value = n(m(
|
|
95
|
+
function E(e = {}) {
|
|
96
|
+
let t = i(), a;
|
|
97
|
+
function c(e) {
|
|
98
|
+
e !== a && (a = e, S(), t.value = n(m(e)));
|
|
99
|
+
}
|
|
100
|
+
b(() => {
|
|
101
|
+
c(o(e));
|
|
99
102
|
});
|
|
100
|
-
let { stop:
|
|
101
|
-
|
|
103
|
+
let { stop: l } = s(() => o(e), (e) => {
|
|
104
|
+
y && c(e);
|
|
102
105
|
}, { deep: 1 });
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
x(() => {
|
|
107
|
+
l(), S();
|
|
105
108
|
});
|
|
106
|
-
function
|
|
109
|
+
function u() {
|
|
107
110
|
return t.value?.play();
|
|
108
111
|
}
|
|
109
|
-
function
|
|
112
|
+
function d() {
|
|
110
113
|
return t.value?.reverse();
|
|
111
114
|
}
|
|
112
|
-
function
|
|
115
|
+
function f() {
|
|
113
116
|
return t.value?.pause();
|
|
114
117
|
}
|
|
115
|
-
function
|
|
118
|
+
function p() {
|
|
116
119
|
return t.value?.restart();
|
|
117
120
|
}
|
|
118
|
-
function
|
|
121
|
+
function h() {
|
|
119
122
|
return t.value?.alternate();
|
|
120
123
|
}
|
|
121
|
-
function
|
|
124
|
+
function g() {
|
|
122
125
|
return t.value?.resume();
|
|
123
126
|
}
|
|
124
|
-
function
|
|
127
|
+
function _() {
|
|
125
128
|
return t.value?.complete();
|
|
126
129
|
}
|
|
127
|
-
function
|
|
130
|
+
function v(e) {
|
|
128
131
|
return t.value?.reset(e);
|
|
129
132
|
}
|
|
130
|
-
function
|
|
133
|
+
function S() {
|
|
131
134
|
return t.value?.cancel();
|
|
132
135
|
}
|
|
133
|
-
function
|
|
136
|
+
function C() {
|
|
134
137
|
return t.value?.revert();
|
|
135
138
|
}
|
|
136
|
-
function
|
|
139
|
+
function w(e, n, r) {
|
|
137
140
|
return t.value?.seek(e, n, r);
|
|
138
141
|
}
|
|
139
|
-
function
|
|
142
|
+
function T(e) {
|
|
140
143
|
return t.value?.stretch(e);
|
|
141
144
|
}
|
|
142
145
|
return {
|
|
143
146
|
timer: r(t),
|
|
144
|
-
play:
|
|
145
|
-
reverse:
|
|
146
|
-
pause:
|
|
147
|
-
restart:
|
|
148
|
-
alternate:
|
|
149
|
-
resume:
|
|
150
|
-
complete:
|
|
151
|
-
reset:
|
|
152
|
-
cancel:
|
|
153
|
-
revert:
|
|
154
|
-
seek:
|
|
155
|
-
stretch:
|
|
147
|
+
play: u,
|
|
148
|
+
reverse: d,
|
|
149
|
+
pause: f,
|
|
150
|
+
restart: p,
|
|
151
|
+
alternate: h,
|
|
152
|
+
resume: g,
|
|
153
|
+
complete: _,
|
|
154
|
+
reset: v,
|
|
155
|
+
cancel: S,
|
|
156
|
+
revert: C,
|
|
157
|
+
seek: w,
|
|
158
|
+
stretch: T
|
|
156
159
|
};
|
|
157
160
|
}
|
|
158
161
|
//#endregion
|
|
159
162
|
//#region src/composables/use-timeline.ts
|
|
160
|
-
function
|
|
161
|
-
let t = !1, c = [],
|
|
162
|
-
function
|
|
163
|
-
for (let e of
|
|
163
|
+
function D(e = {}) {
|
|
164
|
+
let t = !1, c, l = [], u = i();
|
|
165
|
+
function d() {
|
|
166
|
+
for (let e of l) e.type === "add" ? u.value?.add(C(e.targets), a(e.params), e.position) : e.type === "set" ? u.value?.set(C(e.targets), a(e.params), e.position) : u.value?.call(e.callback, e.position);
|
|
167
|
+
}
|
|
168
|
+
function f(e) {
|
|
169
|
+
e !== c && (c = e, F(), u.value = n(p(e)), d());
|
|
164
170
|
}
|
|
165
|
-
let { stop:
|
|
166
|
-
|
|
171
|
+
let { stop: m } = s(() => o(e), (e) => {
|
|
172
|
+
y && f(e);
|
|
167
173
|
}, {
|
|
168
174
|
flush: "post",
|
|
169
175
|
deep: 1
|
|
170
176
|
});
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}),
|
|
174
|
-
|
|
177
|
+
b(() => {
|
|
178
|
+
f(o(e)), t = !0;
|
|
179
|
+
}), x(() => {
|
|
180
|
+
m(), P();
|
|
175
181
|
});
|
|
176
|
-
function
|
|
177
|
-
return
|
|
182
|
+
function h(e, n, r) {
|
|
183
|
+
return l.push({
|
|
178
184
|
type: "add",
|
|
179
185
|
targets: e,
|
|
180
186
|
params: n,
|
|
181
187
|
position: r
|
|
182
188
|
}), t ? {
|
|
183
|
-
...
|
|
184
|
-
add:
|
|
185
|
-
set:
|
|
186
|
-
remove:
|
|
189
|
+
...u.value?.add(C(e), a(n), r),
|
|
190
|
+
add: h,
|
|
191
|
+
set: g,
|
|
192
|
+
remove: _
|
|
187
193
|
} : {
|
|
188
|
-
...
|
|
189
|
-
add:
|
|
190
|
-
set:
|
|
191
|
-
remove:
|
|
194
|
+
...u.value,
|
|
195
|
+
add: h,
|
|
196
|
+
set: g,
|
|
197
|
+
remove: _
|
|
192
198
|
};
|
|
193
199
|
}
|
|
194
|
-
function
|
|
195
|
-
return
|
|
200
|
+
function g(e, n, r) {
|
|
201
|
+
return l.push({
|
|
196
202
|
type: "set",
|
|
197
203
|
targets: e,
|
|
198
204
|
params: n,
|
|
199
205
|
position: r
|
|
200
206
|
}), t ? {
|
|
201
|
-
...
|
|
202
|
-
add:
|
|
203
|
-
set:
|
|
204
|
-
remove:
|
|
207
|
+
...u.value?.set(C(e), a(n), r),
|
|
208
|
+
add: h,
|
|
209
|
+
set: g,
|
|
210
|
+
remove: _
|
|
205
211
|
} : {
|
|
206
|
-
...
|
|
207
|
-
add:
|
|
208
|
-
set:
|
|
209
|
-
remove:
|
|
212
|
+
...u.value,
|
|
213
|
+
add: h,
|
|
214
|
+
set: g,
|
|
215
|
+
remove: _
|
|
210
216
|
};
|
|
211
217
|
}
|
|
212
|
-
function
|
|
218
|
+
function _(e, n) {
|
|
213
219
|
return t ? {
|
|
214
|
-
...
|
|
215
|
-
add:
|
|
216
|
-
set:
|
|
217
|
-
remove:
|
|
220
|
+
...u.value?.remove(C(e), n),
|
|
221
|
+
add: h,
|
|
222
|
+
set: g,
|
|
223
|
+
remove: _
|
|
218
224
|
} : (console.warn("Cannot remove from timeline before mount"), {
|
|
219
|
-
...
|
|
220
|
-
add:
|
|
221
|
-
set:
|
|
222
|
-
remove:
|
|
225
|
+
...u.value,
|
|
226
|
+
add: h,
|
|
227
|
+
set: g,
|
|
228
|
+
remove: _
|
|
223
229
|
});
|
|
224
230
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
231
|
+
function v(e, t) {
|
|
232
|
+
return u.value?.sync(e, t);
|
|
227
233
|
}
|
|
228
|
-
function
|
|
229
|
-
return
|
|
234
|
+
function S(e, t) {
|
|
235
|
+
return u.value?.label(e, t);
|
|
230
236
|
}
|
|
231
|
-
function
|
|
232
|
-
return
|
|
237
|
+
function w(e, t) {
|
|
238
|
+
return l.push({
|
|
233
239
|
type: "call",
|
|
234
240
|
callback: e,
|
|
235
241
|
position: t
|
|
236
|
-
}),
|
|
242
|
+
}), u.value?.call(e, t);
|
|
237
243
|
}
|
|
238
|
-
function
|
|
239
|
-
return
|
|
240
|
-
}
|
|
241
|
-
function w() {
|
|
242
|
-
return l.value?.play();
|
|
243
|
-
}
|
|
244
|
-
function T() {
|
|
245
|
-
return l.value?.reverse();
|
|
244
|
+
function T(e) {
|
|
245
|
+
return u.value?.init(e);
|
|
246
246
|
}
|
|
247
247
|
function E() {
|
|
248
|
-
return
|
|
248
|
+
return u.value?.play();
|
|
249
249
|
}
|
|
250
250
|
function D() {
|
|
251
|
-
return
|
|
251
|
+
return u.value?.reverse();
|
|
252
252
|
}
|
|
253
253
|
function O() {
|
|
254
|
-
return
|
|
254
|
+
return u.value?.pause();
|
|
255
255
|
}
|
|
256
256
|
function k() {
|
|
257
|
-
return
|
|
257
|
+
return u.value?.restart();
|
|
258
258
|
}
|
|
259
259
|
function A() {
|
|
260
|
-
return
|
|
260
|
+
return u.value?.alternate();
|
|
261
261
|
}
|
|
262
|
-
function j(
|
|
263
|
-
return
|
|
262
|
+
function j() {
|
|
263
|
+
return u.value?.resume();
|
|
264
264
|
}
|
|
265
265
|
function M() {
|
|
266
|
-
return
|
|
266
|
+
return u.value?.complete();
|
|
267
267
|
}
|
|
268
|
-
function N() {
|
|
269
|
-
return
|
|
268
|
+
function N(e) {
|
|
269
|
+
return u.value?.reset(e);
|
|
270
270
|
}
|
|
271
|
-
function P(
|
|
272
|
-
return
|
|
271
|
+
function P() {
|
|
272
|
+
return u.value?.cancel();
|
|
273
273
|
}
|
|
274
|
-
function F(
|
|
275
|
-
return
|
|
274
|
+
function F() {
|
|
275
|
+
return u.value?.revert();
|
|
276
276
|
}
|
|
277
|
-
function I() {
|
|
278
|
-
return
|
|
277
|
+
function I(e, t, n) {
|
|
278
|
+
return u.value?.seek(e, t, n);
|
|
279
|
+
}
|
|
280
|
+
function L(e) {
|
|
281
|
+
return u.value?.stretch(e);
|
|
282
|
+
}
|
|
283
|
+
function R() {
|
|
284
|
+
return u.value?.refresh();
|
|
279
285
|
}
|
|
280
286
|
return {
|
|
281
|
-
timeline: r(
|
|
282
|
-
add:
|
|
283
|
-
set:
|
|
284
|
-
sync:
|
|
285
|
-
label:
|
|
286
|
-
remove:
|
|
287
|
-
call:
|
|
288
|
-
init:
|
|
289
|
-
play:
|
|
290
|
-
reverse:
|
|
291
|
-
pause:
|
|
292
|
-
restart:
|
|
293
|
-
alternate:
|
|
294
|
-
resume:
|
|
295
|
-
complete:
|
|
296
|
-
reset:
|
|
297
|
-
cancel:
|
|
298
|
-
revert:
|
|
299
|
-
seek:
|
|
300
|
-
stretch:
|
|
301
|
-
refresh:
|
|
287
|
+
timeline: r(u),
|
|
288
|
+
add: h,
|
|
289
|
+
set: g,
|
|
290
|
+
sync: v,
|
|
291
|
+
label: S,
|
|
292
|
+
remove: _,
|
|
293
|
+
call: w,
|
|
294
|
+
init: T,
|
|
295
|
+
play: E,
|
|
296
|
+
reverse: D,
|
|
297
|
+
pause: O,
|
|
298
|
+
restart: k,
|
|
299
|
+
alternate: A,
|
|
300
|
+
resume: j,
|
|
301
|
+
complete: M,
|
|
302
|
+
reset: N,
|
|
303
|
+
cancel: P,
|
|
304
|
+
revert: F,
|
|
305
|
+
seek: I,
|
|
306
|
+
stretch: L,
|
|
307
|
+
refresh: R
|
|
302
308
|
};
|
|
303
309
|
}
|
|
304
310
|
//#endregion
|
|
305
311
|
//#region src/composables/use-animatable.ts
|
|
306
|
-
function
|
|
312
|
+
function O(a, c = {}) {
|
|
307
313
|
let u = i(), d = e(() => ({
|
|
308
|
-
el:
|
|
314
|
+
el: C(a),
|
|
309
315
|
opt: o(c)
|
|
310
316
|
})), { stop: f } = s(d, ({ el: e, opt: t }) => {
|
|
311
317
|
if (p(), !e) {
|
|
@@ -315,9 +321,9 @@ function D(a, c = {}) {
|
|
|
315
321
|
u.value = n(l(e, t));
|
|
316
322
|
}, {
|
|
317
323
|
flush: "post",
|
|
318
|
-
immediate: !t(a) &&
|
|
324
|
+
immediate: !t(a) && y
|
|
319
325
|
});
|
|
320
|
-
|
|
326
|
+
x(() => {
|
|
321
327
|
f(), p();
|
|
322
328
|
});
|
|
323
329
|
function p() {
|
|
@@ -330,25 +336,25 @@ function D(a, c = {}) {
|
|
|
330
336
|
}
|
|
331
337
|
//#endregion
|
|
332
338
|
//#region src/composables/use-raw-animatable.ts
|
|
333
|
-
function
|
|
334
|
-
let n =
|
|
339
|
+
function k(e, t = {}) {
|
|
340
|
+
let n = C(e);
|
|
335
341
|
return n || console.warn("Targets element is null or undefined"), l(n, o(t));
|
|
336
342
|
}
|
|
337
343
|
//#endregion
|
|
338
344
|
//#region src/composables/use-draggable.ts
|
|
339
|
-
function
|
|
340
|
-
let c = i(), { stop: l } = s([() =>
|
|
341
|
-
if (
|
|
345
|
+
function A(e, a = {}) {
|
|
346
|
+
let c = i(), { stop: l } = s([() => C(e), () => o(a)], ([e, t]) => {
|
|
347
|
+
if (b(), !e) {
|
|
342
348
|
console.warn("Targets element is null or undefined"), c.value = void 0;
|
|
343
349
|
return;
|
|
344
350
|
}
|
|
345
351
|
c.value = n(u(e, t));
|
|
346
352
|
}, {
|
|
347
353
|
flush: "post",
|
|
348
|
-
immediate: !t(e) &&
|
|
354
|
+
immediate: !t(e) && y
|
|
349
355
|
});
|
|
350
|
-
|
|
351
|
-
|
|
356
|
+
x(() => {
|
|
357
|
+
b(), l();
|
|
352
358
|
});
|
|
353
359
|
function d() {
|
|
354
360
|
return c.value?.disable();
|
|
@@ -371,13 +377,13 @@ function k(e, a = {}) {
|
|
|
371
377
|
function _() {
|
|
372
378
|
return c.value?.stop();
|
|
373
379
|
}
|
|
374
|
-
function
|
|
380
|
+
function v() {
|
|
375
381
|
return c.value?.reset();
|
|
376
382
|
}
|
|
377
|
-
function
|
|
383
|
+
function b() {
|
|
378
384
|
return c.value?.revert();
|
|
379
385
|
}
|
|
380
|
-
function
|
|
386
|
+
function S() {
|
|
381
387
|
return c.value?.refresh();
|
|
382
388
|
}
|
|
383
389
|
return {
|
|
@@ -389,15 +395,15 @@ function k(e, a = {}) {
|
|
|
389
395
|
animateInView: h,
|
|
390
396
|
scrollInView: g,
|
|
391
397
|
stop: _,
|
|
392
|
-
reset:
|
|
393
|
-
revert:
|
|
394
|
-
refresh:
|
|
398
|
+
reset: v,
|
|
399
|
+
revert: b,
|
|
400
|
+
refresh: S
|
|
395
401
|
};
|
|
396
402
|
}
|
|
397
403
|
//#endregion
|
|
398
404
|
//#region src/composables/use-layout.ts
|
|
399
|
-
function
|
|
400
|
-
let c = i(), { stop: l } = s([() =>
|
|
405
|
+
function j(e, a = {}) {
|
|
406
|
+
let c = i(), { stop: l } = s([() => C(e), () => o(a)], ([e, t]) => {
|
|
401
407
|
if (m(), !e) {
|
|
402
408
|
console.warn("Target element is null or undefined"), c.value = void 0;
|
|
403
409
|
return;
|
|
@@ -405,9 +411,9 @@ function A(e, a = {}) {
|
|
|
405
411
|
c.value = n(d(e, t));
|
|
406
412
|
}, {
|
|
407
413
|
flush: "post",
|
|
408
|
-
immediate: !t(e) &&
|
|
414
|
+
immediate: !t(e) && y
|
|
409
415
|
});
|
|
410
|
-
|
|
416
|
+
x(() => {
|
|
411
417
|
m(), l();
|
|
412
418
|
});
|
|
413
419
|
function u() {
|
|
@@ -431,17 +437,56 @@ function A(e, a = {}) {
|
|
|
431
437
|
};
|
|
432
438
|
}
|
|
433
439
|
//#endregion
|
|
440
|
+
//#region src/composables/use-scroll.ts
|
|
441
|
+
function M(t, r, i = {}) {
|
|
442
|
+
let a, s = e(() => {
|
|
443
|
+
if (a?.revert(), a = void 0, !y) return;
|
|
444
|
+
let e = C(t), s = C(r);
|
|
445
|
+
if (e && s) return a = n(h({
|
|
446
|
+
...o(i),
|
|
447
|
+
container: e,
|
|
448
|
+
target: s
|
|
449
|
+
})), a;
|
|
450
|
+
}), c = e(() => s.value ?? !1), l = e(() => ({ autoplay: c.value }));
|
|
451
|
+
x(() => a?.revert());
|
|
452
|
+
function u() {
|
|
453
|
+
return s.value?.refresh();
|
|
454
|
+
}
|
|
455
|
+
function d() {
|
|
456
|
+
return s.value?.revert();
|
|
457
|
+
}
|
|
458
|
+
function f() {
|
|
459
|
+
s.value?.debug();
|
|
460
|
+
}
|
|
461
|
+
function p() {
|
|
462
|
+
return s.value?.removeDebug();
|
|
463
|
+
}
|
|
464
|
+
function m(e) {
|
|
465
|
+
return s.value?.link(e);
|
|
466
|
+
}
|
|
467
|
+
return {
|
|
468
|
+
observer: s,
|
|
469
|
+
autoplay: c,
|
|
470
|
+
autoplayComputed: l,
|
|
471
|
+
refresh: u,
|
|
472
|
+
revert: d,
|
|
473
|
+
debug: f,
|
|
474
|
+
removeDebug: p,
|
|
475
|
+
link: m
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
//#endregion
|
|
434
479
|
//#region src/composables/use-svg.ts
|
|
435
|
-
function
|
|
480
|
+
function N() {
|
|
436
481
|
function e(e, t) {
|
|
437
482
|
return (n, r, i, a) => {
|
|
438
483
|
let s = o(e);
|
|
439
|
-
return s ?
|
|
484
|
+
return s ? _.morphTo(s, o(t))(n, r, i, a) : "";
|
|
440
485
|
};
|
|
441
486
|
}
|
|
442
487
|
function t(e, t) {
|
|
443
488
|
let n = o(e) ?? "";
|
|
444
|
-
return
|
|
489
|
+
return _.createMotionPath(n, o(t));
|
|
445
490
|
}
|
|
446
491
|
return {
|
|
447
492
|
morphTo: e,
|
|
@@ -450,37 +495,37 @@ function j() {
|
|
|
450
495
|
}
|
|
451
496
|
//#endregion
|
|
452
497
|
//#region src/composables/use-svg-drawable.ts
|
|
453
|
-
function
|
|
454
|
-
let l = i(), { stop: u } = s(() =>
|
|
498
|
+
function P(e, a = 0, c = 0) {
|
|
499
|
+
let l = i(), { stop: u } = s(() => C(e), (e) => {
|
|
455
500
|
if (l.value = void 0, !e) {
|
|
456
501
|
console.warn("[useSvgDrawable] Target element is null or undefined");
|
|
457
502
|
return;
|
|
458
503
|
}
|
|
459
|
-
l.value = n(
|
|
504
|
+
l.value = n(_.createDrawable(e, o(a), o(c))[0]);
|
|
460
505
|
}, {
|
|
461
506
|
flush: "post",
|
|
462
|
-
immediate: !t(e) &&
|
|
507
|
+
immediate: !t(e) && y
|
|
463
508
|
});
|
|
464
|
-
return
|
|
509
|
+
return x(() => {
|
|
465
510
|
u(), l.value = void 0;
|
|
466
511
|
}), { drawable: r(l) };
|
|
467
512
|
}
|
|
468
513
|
//#endregion
|
|
469
514
|
//#region src/composables/use-text.ts
|
|
470
|
-
function
|
|
471
|
-
let l = i(), u = e(() => l.value?.lines ?? []), d = e(() => l.value?.words ?? []), f = e(() => l.value?.chars ?? []), { stop: p } = s([() =>
|
|
472
|
-
m(), l.value = void 0, e && (l.value = n(
|
|
515
|
+
function F(a, c) {
|
|
516
|
+
let l = i(), u = e(() => l.value?.lines ?? []), d = e(() => l.value?.words ?? []), f = e(() => l.value?.chars ?? []), { stop: p } = s([() => C(a), () => o(c)], ([e, t]) => {
|
|
517
|
+
m(), l.value = void 0, e && (l.value = n(g(e, t)));
|
|
473
518
|
}, {
|
|
474
519
|
flush: "post",
|
|
475
|
-
immediate: !t(a) &&
|
|
520
|
+
immediate: !t(a) && y
|
|
476
521
|
});
|
|
477
|
-
|
|
522
|
+
x(() => {
|
|
478
523
|
p(), l.value = void 0, m();
|
|
479
524
|
});
|
|
480
525
|
function m() {
|
|
481
526
|
l.value?.revert();
|
|
482
527
|
}
|
|
483
|
-
function
|
|
528
|
+
function h() {
|
|
484
529
|
l.value?.refresh();
|
|
485
530
|
}
|
|
486
531
|
return {
|
|
@@ -489,19 +534,19 @@ function N(a, c) {
|
|
|
489
534
|
words: d,
|
|
490
535
|
chars: f,
|
|
491
536
|
revert: m,
|
|
492
|
-
refresh:
|
|
537
|
+
refresh: h
|
|
493
538
|
};
|
|
494
539
|
}
|
|
495
540
|
//#endregion
|
|
496
541
|
//#region src/composables/use-waapi.ts
|
|
497
|
-
function
|
|
498
|
-
let c = i(), { stop: l } = s([() =>
|
|
499
|
-
c.value = n(
|
|
542
|
+
function I(e, a = {}) {
|
|
543
|
+
let c = i(), { stop: l } = s([() => C(e), () => o(a)], ([e, t]) => {
|
|
544
|
+
c.value = n(v.animate(e, t));
|
|
500
545
|
}, {
|
|
501
546
|
flush: "post",
|
|
502
|
-
immediate: !t(e) &&
|
|
547
|
+
immediate: !t(e) && y
|
|
503
548
|
});
|
|
504
|
-
|
|
549
|
+
x(() => {
|
|
505
550
|
l();
|
|
506
551
|
});
|
|
507
552
|
function u() {
|
|
@@ -525,13 +570,13 @@ function P(e, a = {}) {
|
|
|
525
570
|
function g() {
|
|
526
571
|
return c.value?.restart();
|
|
527
572
|
}
|
|
528
|
-
function
|
|
573
|
+
function _() {
|
|
529
574
|
return c.value?.commitStyles();
|
|
530
575
|
}
|
|
531
|
-
function
|
|
576
|
+
function b() {
|
|
532
577
|
return c.value?.complete();
|
|
533
578
|
}
|
|
534
|
-
function
|
|
579
|
+
function S() {
|
|
535
580
|
return c.value?.cancel();
|
|
536
581
|
}
|
|
537
582
|
function w() {
|
|
@@ -546,21 +591,21 @@ function P(e, a = {}) {
|
|
|
546
591
|
reverse: m,
|
|
547
592
|
seek: h,
|
|
548
593
|
restart: g,
|
|
549
|
-
commitStyles:
|
|
550
|
-
complete:
|
|
551
|
-
cancel:
|
|
594
|
+
commitStyles: _,
|
|
595
|
+
complete: b,
|
|
596
|
+
cancel: S,
|
|
552
597
|
revert: w,
|
|
553
|
-
convertEase:
|
|
598
|
+
convertEase: L
|
|
554
599
|
};
|
|
555
600
|
}
|
|
556
|
-
function
|
|
557
|
-
return
|
|
601
|
+
function L(e, t = 100) {
|
|
602
|
+
return v.convertEase(o(e), o(t));
|
|
558
603
|
}
|
|
559
604
|
//#endregion
|
|
560
605
|
//#region src/composables/use-scope.ts
|
|
561
|
-
function
|
|
606
|
+
function R(e) {
|
|
562
607
|
let a = i(void 0), c = [], l = [], u = [], d = !1, p;
|
|
563
|
-
|
|
608
|
+
b(() => {
|
|
564
609
|
d = !0, a.value = n(f(o(e)));
|
|
565
610
|
for (let e of c) a.value.add(e);
|
|
566
611
|
for (let [e, t] of l) a.value.add(e, t);
|
|
@@ -568,7 +613,7 @@ function I(e) {
|
|
|
568
613
|
c.length = 0, l.length = 0, u.length = 0, t(e) && (p = s(e, (e) => {
|
|
569
614
|
a.value?.revert(), a.value = n(f(e));
|
|
570
615
|
}, { flush: "post" }));
|
|
571
|
-
}),
|
|
616
|
+
}), x(() => {
|
|
572
617
|
a.value?.revert(), p?.();
|
|
573
618
|
});
|
|
574
619
|
function m(e) {
|
|
@@ -586,7 +631,7 @@ function I(e) {
|
|
|
586
631
|
function v() {
|
|
587
632
|
return a.value?.revert();
|
|
588
633
|
}
|
|
589
|
-
function
|
|
634
|
+
function y() {
|
|
590
635
|
return a.value?.refresh();
|
|
591
636
|
}
|
|
592
637
|
return {
|
|
@@ -596,83 +641,83 @@ function I(e) {
|
|
|
596
641
|
addOnce: g,
|
|
597
642
|
keepTime: _,
|
|
598
643
|
revert: v,
|
|
599
|
-
refresh:
|
|
644
|
+
refresh: y
|
|
600
645
|
};
|
|
601
646
|
}
|
|
602
647
|
//#endregion
|
|
603
648
|
//#region src/directives/v-animate.ts
|
|
604
|
-
var
|
|
649
|
+
var z = /* @__PURE__ */ new WeakMap(), B = {
|
|
605
650
|
mounted(e, t) {
|
|
606
|
-
t.value &&
|
|
651
|
+
t.value && z.set(e, c(e, t.value));
|
|
607
652
|
},
|
|
608
653
|
updated(e, t) {
|
|
609
654
|
if (t.value === t.oldValue) return;
|
|
610
|
-
let n =
|
|
611
|
-
n?.cancel(), n?.revert(), t.value &&
|
|
655
|
+
let n = z.get(e);
|
|
656
|
+
n?.cancel(), n?.revert(), t.value && z.set(e, c(e, t.value));
|
|
612
657
|
},
|
|
613
658
|
unmounted(e) {
|
|
614
|
-
let t =
|
|
615
|
-
t?.cancel(), t?.revert(),
|
|
659
|
+
let t = z.get(e);
|
|
660
|
+
t?.cancel(), t?.revert(), z.delete(e);
|
|
616
661
|
}
|
|
617
|
-
},
|
|
662
|
+
}, V = /* @__PURE__ */ new WeakMap(), H = {
|
|
618
663
|
mounted(e, t) {
|
|
619
|
-
|
|
664
|
+
V.set(e, u(e, t.value ?? {}));
|
|
620
665
|
},
|
|
621
666
|
updated(e, t) {
|
|
622
|
-
t.value !== t.oldValue && (
|
|
667
|
+
t.value !== t.oldValue && (V.get(e)?.revert(), V.set(e, u(e, t.value ?? {})));
|
|
623
668
|
},
|
|
624
669
|
unmounted(e) {
|
|
625
|
-
|
|
670
|
+
V.get(e)?.revert(), V.delete(e);
|
|
626
671
|
}
|
|
627
|
-
},
|
|
628
|
-
function
|
|
629
|
-
let n =
|
|
672
|
+
}, U = /* @__PURE__ */ new WeakMap();
|
|
673
|
+
function W(e, t) {
|
|
674
|
+
let n = _.createDrawable(e)[0];
|
|
630
675
|
return {
|
|
631
676
|
drawable: n,
|
|
632
677
|
animation: t ? c(n, t) : void 0
|
|
633
678
|
};
|
|
634
679
|
}
|
|
635
|
-
var
|
|
680
|
+
var G = {
|
|
636
681
|
mounted(e, t) {
|
|
637
|
-
|
|
682
|
+
U.set(e, W(e, t.value));
|
|
638
683
|
},
|
|
639
684
|
updated(e, t) {
|
|
640
685
|
if (t.value === t.oldValue) return;
|
|
641
|
-
let n =
|
|
642
|
-
n?.animation?.cancel(), n?.animation?.revert(),
|
|
686
|
+
let n = U.get(e);
|
|
687
|
+
n?.animation?.cancel(), n?.animation?.revert(), U.set(e, W(e, t.value));
|
|
643
688
|
},
|
|
644
689
|
unmounted(e) {
|
|
645
|
-
let t =
|
|
646
|
-
t?.animation?.cancel(), t?.animation?.revert(),
|
|
690
|
+
let t = U.get(e);
|
|
691
|
+
t?.animation?.cancel(), t?.animation?.revert(), U.delete(e);
|
|
647
692
|
}
|
|
648
|
-
},
|
|
693
|
+
}, K = /* @__PURE__ */ new WeakMap(), q = {
|
|
649
694
|
mounted(e, t) {
|
|
650
|
-
t.value &&
|
|
651
|
-
animation:
|
|
695
|
+
t.value && K.set(e, {
|
|
696
|
+
animation: v.animate(e, t.value),
|
|
652
697
|
originalStyle: e.style.cssText
|
|
653
698
|
});
|
|
654
699
|
},
|
|
655
700
|
updated(e, t) {
|
|
656
701
|
if (t.value === t.oldValue) return;
|
|
657
|
-
let n =
|
|
658
|
-
n && (n.animation.cancel(), e.style.cssText = n.originalStyle,
|
|
659
|
-
animation:
|
|
702
|
+
let n = K.get(e);
|
|
703
|
+
n && (n.animation.cancel(), e.style.cssText = n.originalStyle, K.delete(e)), t.value && K.set(e, {
|
|
704
|
+
animation: v.animate(e, t.value),
|
|
660
705
|
originalStyle: e.style.cssText
|
|
661
706
|
});
|
|
662
707
|
},
|
|
663
708
|
unmounted(e) {
|
|
664
|
-
let t =
|
|
665
|
-
t && (t.animation.cancel(), e.style.cssText = t.originalStyle,
|
|
709
|
+
let t = K.get(e);
|
|
710
|
+
t && (t.animation.cancel(), e.style.cssText = t.originalStyle, K.delete(e));
|
|
666
711
|
}
|
|
667
|
-
},
|
|
668
|
-
function
|
|
669
|
-
let { animation: n, ...r } = t ?? {}, i =
|
|
712
|
+
}, J = /* @__PURE__ */ new WeakMap();
|
|
713
|
+
function Y(e, t) {
|
|
714
|
+
let { animation: n, ...r } = t ?? {}, i = g(e, r), a = {
|
|
670
715
|
splitter: i,
|
|
671
716
|
animation: void 0
|
|
672
717
|
};
|
|
673
718
|
if (n) {
|
|
674
719
|
if (r.lines) (document.fonts?.ready ?? Promise.resolve()).then(() => {
|
|
675
|
-
|
|
720
|
+
J.get(e) === a && (a.animation = c(i.lines, n));
|
|
676
721
|
});
|
|
677
722
|
else {
|
|
678
723
|
let e = r.chars ? i.chars : i.words;
|
|
@@ -681,24 +726,24 @@ function q(e, t) {
|
|
|
681
726
|
}
|
|
682
727
|
return a;
|
|
683
728
|
}
|
|
684
|
-
function
|
|
729
|
+
function X(e) {
|
|
685
730
|
e.animation?.cancel(), e.splitter.revert();
|
|
686
731
|
}
|
|
687
|
-
var
|
|
732
|
+
var Z = {
|
|
688
733
|
mounted(e, t) {
|
|
689
|
-
|
|
734
|
+
J.set(e, Y(e, t.value));
|
|
690
735
|
},
|
|
691
736
|
updated(e, t) {
|
|
692
737
|
if (t.value === t.oldValue) return;
|
|
693
|
-
let n =
|
|
694
|
-
n &&
|
|
738
|
+
let n = J.get(e);
|
|
739
|
+
n && X(n), J.set(e, Y(e, t.value));
|
|
695
740
|
},
|
|
696
741
|
unmounted(e) {
|
|
697
|
-
let t =
|
|
698
|
-
t &&
|
|
742
|
+
let t = J.get(e);
|
|
743
|
+
t && X(t), J.delete(e);
|
|
699
744
|
}
|
|
700
745
|
};
|
|
701
746
|
//#endregion
|
|
702
|
-
export {
|
|
747
|
+
export { O as useAnimatable, w as useAnimate, A as useDraggable, j as useLayout, k as useRawAnimatable, T as useRawAnimate, R as useScope, M as useScroll, N as useSvg, P as useSvgDrawable, F as useText, D as useTimeline, E as useTimer, I as useWaapi, B as vAnimate, H as vDraggable, G as vSvgDrawable, Z as vTextSplit, q as vWaapi };
|
|
703
748
|
|
|
704
749
|
//# sourceMappingURL=index.js.map
|