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