@juleshry/vue-animejs 1.0.1 → 1.1.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 +16 -303
- package/dist/directives/v-animate.d.ts +12 -0
- package/dist/directives/v-animate.d.ts.map +1 -0
- package/dist/directives/v-draggable.d.ts +12 -0
- package/dist/directives/v-draggable.d.ts.map +1 -0
- package/dist/directives/v-svg-drawable.d.ts +13 -0
- package/dist/directives/v-svg-drawable.d.ts.map +1 -0
- package/dist/directives/v-text-split.d.ts +16 -0
- package/dist/directives/v-text-split.d.ts.map +1 -0
- package/dist/directives/v-waapi.d.ts +12 -0
- package/dist/directives/v-waapi.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +93 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
<img src="./docs/src/public/icon-animated.svg" alt="vue-animejs" width="120" />
|
|
3
3
|
|
|
4
4
|
<h1 align="center">vue-animejs</h1>
|
|
5
|
-
<p align="center">Vue 3 composables for <a href="https://animejs.com/">Anime.js</a> v4 — reactive animations that integrate naturally with Vue's reactivity system and component lifecycle.</p>
|
|
6
|
-
<p align="center"
|
|
7
|
-
|
|
5
|
+
<p align="center">Vue 3 composables and directives for <a href="https://animejs.com/">Anime.js</a> v4 — reactive animations that integrate naturally with Vue's reactivity system and component lifecycle.</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://www.npmjs.com/package/@juleshry/vue-animejs"><img src="https://img.shields.io/npm/v/%40juleshry%2Fvue-animejs?label=npm&color=a1b858" alt="npm version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@juleshry/vue-animejs"><img src="https://img.shields.io/npm/dm/%40juleshry%2Fvue-animejs?color=50a36f" alt="npm downloads" /></a>
|
|
9
|
+
<a href="https://vue-animejs.juleshry.dev"><img src="https://img.shields.io/badge/docs%20%26%20demos-vue--animejs-4fc08d" alt="docs & demos" /></a>
|
|
10
|
+
<a href="https://github.com/juleshry/vue-animejs"><img src="https://img.shields.io/github/stars/juleshry/vue-animejs?style=flat&color=yellow" alt="GitHub stars" /></a>
|
|
11
|
+
</p>
|
|
12
|
+
<p align="center"><a href="https://app.netlify.com/projects/vue-animejs/deploys"><img src="https://api.netlify.com/api/v1/badges/8017f5b4-47b7-45e4-a5d6-269d638a71ab/deploy-status" alt="Netlify Status" /></a></p>
|
|
13
|
+
<p align="center"><a href="https://ko-fi.com/C7O720SP29"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="ko-fi" /></a></p>
|
|
8
14
|
</div>
|
|
9
15
|
|
|
10
16
|
## 🚀 Overview
|
|
@@ -63,7 +69,7 @@ useAnimate(el, { translateX: 250, duration: 800 })
|
|
|
63
69
|
- Anime.js 4+
|
|
64
70
|
- @vueuse/core 14+
|
|
65
71
|
|
|
66
|
-
## 🦄 Composables
|
|
72
|
+
## 🦄 Composables & Directives
|
|
67
73
|
|
|
68
74
|
| Composable | Description |
|
|
69
75
|
|------------------|---------------------------------------------------|
|
|
@@ -80,306 +86,15 @@ useAnimate(el, { translateX: 250, duration: 800 })
|
|
|
80
86
|
| `useSvgDrawable` | Animate SVG stroke drawing with the `draw` property |
|
|
81
87
|
| `useText` | Split text into animatable lines, words, and chars |
|
|
82
88
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
### `useAnimate`
|
|
86
|
-
|
|
87
|
-
```vue
|
|
88
|
-
<script setup lang="ts">
|
|
89
|
-
import { useTemplateRef } from 'vue'
|
|
90
|
-
import { useAnimate } from '@juleshry/vue-animejs'
|
|
91
|
-
|
|
92
|
-
const el = useTemplateRef<HTMLElement>('el')
|
|
93
|
-
|
|
94
|
-
const { play, pause } = useAnimate(el, {
|
|
95
|
-
translateX: 250,
|
|
96
|
-
duration: 800,
|
|
97
|
-
easing: 'easeInOutQuad',
|
|
98
|
-
})
|
|
99
|
-
</script>
|
|
100
|
-
|
|
101
|
-
<template>
|
|
102
|
-
<div ref="el" />
|
|
103
|
-
<button @click="play">Play</button>
|
|
104
|
-
<button @click="pause">Pause</button>
|
|
105
|
-
</template>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### `useTimer`
|
|
109
|
-
|
|
110
|
-
```vue
|
|
111
|
-
<script setup lang="ts">
|
|
112
|
-
import { useTimer } from '@juleshry/vue-animejs'
|
|
113
|
-
|
|
114
|
-
const { play, pause } = useTimer({
|
|
115
|
-
duration: 3000,
|
|
116
|
-
onUpdate: (self) => console.log(self.currentTime),
|
|
117
|
-
})
|
|
118
|
-
</script>
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### `useTimeline`
|
|
122
|
-
|
|
123
|
-
```vue
|
|
124
|
-
<script setup lang="ts">
|
|
125
|
-
import { useTemplateRef } from 'vue'
|
|
126
|
-
import { useTimeline } from '@juleshry/vue-animejs'
|
|
127
|
-
|
|
128
|
-
const box = useTemplateRef<HTMLElement>('box')
|
|
129
|
-
|
|
130
|
-
const { add, play } = useTimeline({ loop: true })
|
|
131
|
-
|
|
132
|
-
add(box, { translateX: 100 })
|
|
133
|
-
add(box, { translateY: 50 }, '+=200')
|
|
134
|
-
play()
|
|
135
|
-
</script>
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### `useRawAnimate`
|
|
139
|
-
|
|
140
|
-
```vue
|
|
141
|
-
<script setup lang="ts">
|
|
142
|
-
import { useTemplateRef } from 'vue'
|
|
143
|
-
import { useRawAnimate } from '@juleshry/vue-animejs'
|
|
144
|
-
|
|
145
|
-
const el = useTemplateRef<HTMLElement>('el')
|
|
146
|
-
|
|
147
|
-
// Returns the raw Anime.js JSAnimation instance directly
|
|
148
|
-
const animation = useRawAnimate(el, { translateX: 250, duration: 800 })
|
|
149
|
-
</script>
|
|
150
|
-
|
|
151
|
-
<template>
|
|
152
|
-
<div ref="el" />
|
|
153
|
-
</template>
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### `useAnimatable`
|
|
157
|
-
|
|
158
|
-
```vue
|
|
159
|
-
<script setup lang="ts">
|
|
160
|
-
import { useTemplateRef } from 'vue'
|
|
161
|
-
import { useAnimatable } from '@juleshry/vue-animejs'
|
|
162
|
-
|
|
163
|
-
const el = useTemplateRef<HTMLElement>('el')
|
|
164
|
-
|
|
165
|
-
const { animatable } = useAnimatable(el, {
|
|
166
|
-
x: 0,
|
|
167
|
-
opacity: 1,
|
|
168
|
-
})
|
|
169
|
-
</script>
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### `useWaapi`
|
|
173
|
-
|
|
174
|
-
```vue
|
|
175
|
-
<script setup lang="ts">
|
|
176
|
-
import { useTemplateRef } from 'vue'
|
|
177
|
-
import { useWaapi } from '@juleshry/vue-animejs'
|
|
178
|
-
|
|
179
|
-
const el = useTemplateRef<HTMLElement>('el')
|
|
180
|
-
|
|
181
|
-
const { play, pause } = useWaapi(el, {
|
|
182
|
-
translateX: 250,
|
|
183
|
-
duration: 800,
|
|
184
|
-
easing: 'easeInOutQuad',
|
|
185
|
-
})
|
|
186
|
-
</script>
|
|
187
|
-
|
|
188
|
-
<template>
|
|
189
|
-
<div ref="el" />
|
|
190
|
-
<button @click="play">Play</button>
|
|
191
|
-
<button @click="pause">Pause</button>
|
|
192
|
-
</template>
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### `useSvg`
|
|
196
|
-
|
|
197
|
-
> **Note:** `morphTo` requires a live DOM element. Add each target as a hidden `<path>`, pass the ref directly to `morphTo`, and wrap in a `computed` — `useTimeline.add()` accepts `MaybeRef<AnimationParams>` and resolves the computed after mount, when the target elements are available.
|
|
198
|
-
|
|
199
|
-
```vue
|
|
200
|
-
<script setup lang="ts">
|
|
201
|
-
import { computed, useTemplateRef } from 'vue'
|
|
202
|
-
import { useSvg, useTimeline } from '@juleshry/vue-animejs'
|
|
203
|
-
|
|
204
|
-
const shape = useTemplateRef<SVGPathElement>('shape')
|
|
205
|
-
const t_circle = useTemplateRef<SVGPathElement>('t-circle')
|
|
206
|
-
const t_diamond = useTemplateRef<SVGPathElement>('t-diamond')
|
|
207
|
-
|
|
208
|
-
const { morphTo } = useSvg()
|
|
209
|
-
|
|
210
|
-
const { add } = useTimeline({
|
|
211
|
-
loop: true,
|
|
212
|
-
defaults: { duration: 1200, easing: 'easeInOutCubic' },
|
|
213
|
-
loopDelay: 500,
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
add(shape, computed(() => ({ d: morphTo(t_circle) })))
|
|
217
|
-
.add(shape, computed(() => ({ d: morphTo(t_diamond) })), '+=500')
|
|
218
|
-
</script>
|
|
219
|
-
|
|
220
|
-
<template>
|
|
221
|
-
<svg viewBox="0 0 100 100">
|
|
222
|
-
<path ref="shape" d="M 50 15 C 78 8, 95 28, 90 52 C 85 76, 68 90, 50 88 C 32 90, 15 76, 10 52 C 5 28, 22 8, 50 15 Z" />
|
|
223
|
-
<path ref="t-circle" d="M 50 10 C 72 10, 90 28, 90 50 C 90 72, 72 90, 50 90 C 28 90, 10 72, 10 50 C 10 28, 28 10, 50 10 Z" visibility="hidden" />
|
|
224
|
-
<path ref="t-diamond" d="M 50 5 C 54 32, 68 32, 95 50 C 68 68, 54 68, 50 95 C 46 68, 32 68, 5 50 C 32 32, 46 32, 50 5 Z" visibility="hidden" />
|
|
225
|
-
</svg>
|
|
226
|
-
</template>
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### `useSvgDrawable`
|
|
230
|
-
|
|
231
|
-
```vue
|
|
232
|
-
<script setup lang="ts">
|
|
233
|
-
import { useTemplateRef } from 'vue'
|
|
234
|
-
import { useAnimate, useSvgDrawable } from '@juleshry/vue-animejs'
|
|
235
|
-
|
|
236
|
-
const circle_el = useTemplateRef<SVGCircleElement>('circle')
|
|
237
|
-
|
|
238
|
-
const { drawable } = useSvgDrawable(circle_el)
|
|
239
|
-
|
|
240
|
-
// draw values are normalised: 0 = hidden, 1 = fully drawn
|
|
241
|
-
useAnimate(drawable, {
|
|
242
|
-
draw: ['0 0', '0.5 1', '0 1'],
|
|
243
|
-
duration: 1200,
|
|
244
|
-
easing: 'easeInOutQuad',
|
|
245
|
-
})
|
|
246
|
-
</script>
|
|
247
|
-
|
|
248
|
-
<template>
|
|
249
|
-
<svg viewBox="0 0 100 100">
|
|
250
|
-
<circle ref="circle" cx="50" cy="50" r="40" fill="none" stroke="currentColor" stroke-width="4" />
|
|
251
|
-
</svg>
|
|
252
|
-
</template>
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### `useDraggable`
|
|
256
|
-
|
|
257
|
-
```vue
|
|
258
|
-
<script setup lang="ts">
|
|
259
|
-
import { useTemplateRef } from 'vue'
|
|
260
|
-
import { useDraggable } from '@juleshry/vue-animejs'
|
|
89
|
+
**Directives** — declarative alternatives for element-bound animations:
|
|
261
90
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
onGrab: () => console.log('grabbed'),
|
|
266
|
-
onDrag: () => console.log('dragging'),
|
|
267
|
-
onRelease: () => console.log('released'),
|
|
268
|
-
})
|
|
269
|
-
</script>
|
|
270
|
-
|
|
271
|
-
<template>
|
|
272
|
-
<div ref="el" />
|
|
273
|
-
<button @click="disable">Disable</button>
|
|
274
|
-
<button @click="enable">Enable</button>
|
|
275
|
-
</template>
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
### `useLayout`
|
|
279
|
-
|
|
280
|
-
> **Note:** Vue's DOM updates are asynchronous. Use `await nextTick()` between the state change and `animate()` so Anime.js reads the updated positions.
|
|
281
|
-
|
|
282
|
-
```vue
|
|
283
|
-
<script setup lang="ts">
|
|
284
|
-
import { nextTick, ref, useTemplateRef } from 'vue'
|
|
285
|
-
import { useLayout } from '@juleshry/vue-animejs'
|
|
286
|
-
|
|
287
|
-
const list = useTemplateRef<HTMLElement>('list')
|
|
288
|
-
const { record, animate } = useLayout(list, {})
|
|
289
|
-
|
|
290
|
-
const items = ref([1, 2, 3, 4, 5])
|
|
291
|
-
|
|
292
|
-
async function shuffle() {
|
|
293
|
-
record()
|
|
294
|
-
items.value = [...items.value].sort(() => Math.random() - 0.5)
|
|
295
|
-
await nextTick()
|
|
296
|
-
animate({ duration: 600 })
|
|
297
|
-
}
|
|
298
|
-
</script>
|
|
299
|
-
|
|
300
|
-
<template>
|
|
301
|
-
<ul ref="list">
|
|
302
|
-
<li v-for="item in items" :key="item">{{ item }}</li>
|
|
303
|
-
</ul>
|
|
304
|
-
<button @click="shuffle">Shuffle</button>
|
|
305
|
-
</template>
|
|
306
|
-
```
|
|
91
|
+
| Directive | Description |
|
|
92
|
+
|--------------|--------------------------------------------------|
|
|
93
|
+
| `v-animate` | Animate an element declaratively via template attribute |
|
|
307
94
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
```vue
|
|
311
|
-
<script setup lang="ts">
|
|
312
|
-
import { useTemplateRef } from 'vue'
|
|
313
|
-
import { useLayout } from '@juleshry/vue-animejs'
|
|
314
|
-
|
|
315
|
-
const container = useTemplateRef<HTMLElement>('container')
|
|
316
|
-
const { update } = useLayout(container, {})
|
|
317
|
-
|
|
318
|
-
function toggleLayout() {
|
|
319
|
-
update(() => {
|
|
320
|
-
container.value!.classList.toggle('grid')
|
|
321
|
-
}, { duration: 600 })
|
|
322
|
-
}
|
|
323
|
-
</script>
|
|
324
|
-
|
|
325
|
-
<template>
|
|
326
|
-
<div ref="container" class="grid">
|
|
327
|
-
<div v-for="i in 6" :key="i" class="item" />
|
|
328
|
-
</div>
|
|
329
|
-
<button @click="toggleLayout">Toggle layout</button>
|
|
330
|
-
</template>
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
### `useScope`
|
|
334
|
-
|
|
335
|
-
```vue
|
|
336
|
-
<script setup lang="ts">
|
|
337
|
-
import { useTemplateRef } from 'vue'
|
|
338
|
-
import { useAnimate, useScope } from '@juleshry/vue-animejs'
|
|
339
|
-
|
|
340
|
-
const el = useTemplateRef<HTMLElement>('el')
|
|
341
|
-
|
|
342
|
-
const { add, revert } = useScope({ mediaQuery: '(prefers-reduced-motion: no-preference)' })
|
|
343
|
-
|
|
344
|
-
// Animations added via add() are automatically reverted when the scope reverts
|
|
345
|
-
// or when the component unmounts
|
|
346
|
-
add(scope => {
|
|
347
|
-
useAnimate(el, { translateX: 250, duration: 800 })
|
|
348
|
-
})
|
|
349
|
-
</script>
|
|
350
|
-
|
|
351
|
-
<template>
|
|
352
|
-
<div ref="el" />
|
|
353
|
-
<button @click="revert">Revert</button>
|
|
354
|
-
</template>
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
### `useText`
|
|
358
|
-
|
|
359
|
-
> **Note:** `words`, `chars`, and `lines` are `ComputedRef<HTMLElement[]>` — they populate after mount and can be passed directly to `useAnimate`.
|
|
360
|
-
|
|
361
|
-
```vue
|
|
362
|
-
<script setup lang="ts">
|
|
363
|
-
import { useTemplateRef } from 'vue'
|
|
364
|
-
import { useAnimate, useText } from '@juleshry/vue-animejs'
|
|
365
|
-
import { stagger } from 'animejs'
|
|
366
|
-
|
|
367
|
-
const el = useTemplateRef<HTMLElement>('el')
|
|
368
|
-
|
|
369
|
-
const { words, chars } = useText(el, { words: true, chars: true })
|
|
370
|
-
|
|
371
|
-
// words and chars are ComputedRef<HTMLElement[]> — pass them directly as targets
|
|
372
|
-
useAnimate(words, {
|
|
373
|
-
y: ['100%', '0%'],
|
|
374
|
-
duration: 600,
|
|
375
|
-
delay: stagger(50),
|
|
376
|
-
})
|
|
377
|
-
</script>
|
|
95
|
+
## 🚀 Usage
|
|
378
96
|
|
|
379
|
-
|
|
380
|
-
<p ref="el">Hello, world!</p>
|
|
381
|
-
</template>
|
|
382
|
-
```
|
|
97
|
+
For full API docs and live demos, see **[the doc here](https://vue-animejs.juleshry.dev)**.
|
|
383
98
|
|
|
384
99
|
## 👨🚀 Contributors
|
|
385
100
|
|
|
@@ -399,9 +114,7 @@ See the [Contributing Guide](./CONTRIBUTING.md).
|
|
|
399
114
|
## 🗺️ TODO
|
|
400
115
|
|
|
401
116
|
- [ ] Allow reactive refs inside option objects
|
|
402
|
-
- [ ] Finish doc website
|
|
403
117
|
- [ ] Add components
|
|
404
|
-
- [ ] Add directives
|
|
405
118
|
|
|
406
119
|
## 📄 License
|
|
407
120
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AnimationParams } from "animejs";
|
|
2
|
+
import type { Directive } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* Declarative animation directive. Applies an Anime.js animation to the element on mount,
|
|
5
|
+
* re-creates it when the binding value changes, and reverts it on unmount.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <div v-animate="{ translateX: 250, duration: 800 }" />
|
|
9
|
+
* <div v-animate="reactiveOptions" />
|
|
10
|
+
*/
|
|
11
|
+
export declare const vAnimate: Directive<HTMLElement, AnimationParams>;
|
|
12
|
+
//# sourceMappingURL=v-animate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v-animate.d.ts","sourceRoot":"","sources":["../../src/directives/v-animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,eAAe,EAAoB,MAAM,SAAS,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAIpC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,WAAW,EAAE,eAAe,CAkB5D,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DraggableParams } from "animejs";
|
|
2
|
+
import type { Directive } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* Declarative draggable directive. Makes the element draggable on mount,
|
|
5
|
+
* re-creates it when the binding value changes, and reverts it on unmount.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <div v-draggable />
|
|
9
|
+
* <div v-draggable="{ snap: [0, 100] }" />
|
|
10
|
+
*/
|
|
11
|
+
export declare const vDraggable: Directive<HTMLElement, DraggableParams | undefined>;
|
|
12
|
+
//# sourceMappingURL=v-draggable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v-draggable.d.ts","sourceRoot":"","sources":["../../src/directives/v-draggable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAIpC;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,WAAW,EAAE,eAAe,GAAG,SAAS,CAa1E,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AnimationParams } from "animejs";
|
|
2
|
+
import type { Directive } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* Declarative SVG drawable directive. Wraps the SVG geometry element in an Anime.js drawable
|
|
5
|
+
* Proxy and animates the `draw` property on mount. Re-creates it when the binding value changes
|
|
6
|
+
* and reverts on unmount.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <path v-svg-drawable="{ draw: '0 1', duration: 1200 }" />
|
|
10
|
+
* <path v-svg-drawable="{ draw: ['0 0', '0.5 1', '0 1'], ease: 'inOutQuad', loop: true }" />
|
|
11
|
+
*/
|
|
12
|
+
export declare const vSvgDrawable: Directive<SVGGeometryElement, AnimationParams | undefined>;
|
|
13
|
+
//# sourceMappingURL=v-svg-drawable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v-svg-drawable.d.ts","sourceRoot":"","sources":["../../src/directives/v-svg-drawable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,eAAe,EAA8C,MAAM,SAAS,CAAA;AACxG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAepC;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,CAAC,kBAAkB,EAAE,eAAe,GAAG,SAAS,CAiBnF,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AnimationParams, type TextSplitterParams } from "animejs";
|
|
2
|
+
import type { Directive } from "vue";
|
|
3
|
+
export interface VTextSplitValue extends TextSplitterParams {
|
|
4
|
+
animation?: AnimationParams;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Declarative text-split directive. Splits the element's text into chars, words, or lines on
|
|
8
|
+
* mount, and optionally animates the resulting spans. Re-creates on binding change, reverts on unmount.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <p v-text-split="{ words: true, animation: { translateY: [20, 0], opacity: [0, 1], delay: stagger(60) } }">Hello</p>
|
|
12
|
+
* <p v-text-split="{ chars: true, animation: { opacity: [0, 1], delay: stagger(30) } }">Hello</p>
|
|
13
|
+
* <p v-text-split="{ lines: true, animation: { translateX: [-20, 0], delay: stagger(100) } }">Hello</p>
|
|
14
|
+
*/
|
|
15
|
+
export declare const vTextSplit: Directive<HTMLElement, VTextSplitValue | undefined>;
|
|
16
|
+
//# sourceMappingURL=v-text-split.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v-text-split.d.ts","sourceRoot":"","sources":["../../src/directives/v-text-split.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EAGpB,KAAK,kBAAkB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAoCD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,WAAW,EAAE,eAAe,GAAG,SAAS,CAe1E,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type WAAPIAnimationParams } from "animejs";
|
|
2
|
+
import type { Directive } from "vue";
|
|
3
|
+
/**
|
|
4
|
+
* Declarative WAAPI animation directive. Applies an Anime.js WAAPI animation to the element on
|
|
5
|
+
* mount, re-creates it when the binding value changes, and reverts it on unmount.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <div v-waapi="{ translateX: 250, duration: 800 }" />
|
|
9
|
+
* <div v-waapi="reactiveOptions" />
|
|
10
|
+
*/
|
|
11
|
+
export declare const vWaapi: Directive<HTMLElement, WAAPIAnimationParams>;
|
|
12
|
+
//# sourceMappingURL=v-waapi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v-waapi.d.ts","sourceRoot":"","sources":["../../src/directives/v-waapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,oBAAoB,EAAuB,MAAM,SAAS,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AASpC;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,WAAW,EAAE,oBAAoB,CAiC/D,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`vue`),t=require(`animejs`),n=require(`@vueuse/core`);function r(e){return(0,n.unrefElement)(e)}function i(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,t])=>{c(e,t)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{s(),g()});function c(e,n){if(_(),!e){console.warn(`Target element is null or undefined`),o.value=void 0;return}o.value=(0,t.animate)(e,n)}function l(){return o.value?.play()}function u(){return o.value?.reverse()}function d(){return o.value?.pause()}function f(){return o.value?.restart()}function p(){return o.value?.alternate()}function m(){return o.value?.resume()}function h(){return o.value?.complete()}function g(){return o.value?.cancel()}function _(){return o.value?.revert()}function v(e){return o.value?.reset(e)}function y(e,t,n){return o.value?.seek(e,t,n)}function b(e){return o.value?.stretch(e)}function x(){return o.value?.refresh()}return{animation:(0,e.readonly)(o),play:l,reverse:u,pause:d,restart:f,alternate:p,resume:m,complete:h,cancel:g,revert:_,reset:v,seek:y,stretch:b,refresh:x}}function a(n,i={}){let a=r(n);return a||console.warn(`Target is undefined`),(0,t.animate)(a,(0,e.unref)(i))}function o(r={}){let i=(0,e.shallowRef)((0,t.createTimer)((0,e.unref)(r))),{stop:a}=(0,e.watch)(()=>(0,e.unref)(r),e=>{m(),i.value=(0,t.createTimer)(e)},{deep:1});(0,n.tryOnUnmounted)(()=>{a(),m()});function o(){return i.value.play()}function s(){return i.value.reverse()}function c(){return i.value.pause()}function l(){return i.value.restart()}function u(){return i.value.alternate()}function d(){return i.value.resume()}function f(){return i.value.complete()}function p(e){return i.value.reset(e)}function m(){return i.value.cancel()}function h(){return i.value.revert()}function g(e,t,n){return i.value.seek(e,t,n)}function _(e){return i.value.stretch(e)}return{timer:(0,e.readonly)(i),play:o,reverse:s,pause:c,restart:l,alternate:u,resume:d,complete:f,reset:p,cancel:m,revert:h,seek:g,stretch:_}}function s(i={}){let a=!1,o=[],s=(0,e.shallowRef)((0,t.createTimeline)((0,e.unref)(i)));function c(){for(let t of o)t.type===`add`?s.value.add(r(t.targets),(0,e.toValue)(t.params),t.position):s.value.set(r(t.targets),(0,e.toValue)(t.params),t.position)}let{stop:l}=(0,e.watch)(()=>(0,e.unref)(i),e=>{E(),s.value=(0,t.createTimeline)(e),c()},{flush:`post`,deep:1});(0,n.tryOnMounted)(()=>{a=!0,c()}),(0,n.tryOnUnmounted)(()=>{l(),T()});function u(t,n,i){return o.push({type:`add`,targets:t,params:n,position:i}),a?{...s.value.add(r(t),(0,e.toValue)(n),i),add:u,set:d,remove:f}:{...s.value,add:u,set:d,remove:f}}function d(t,n,i){return o.push({type:`set`,targets:t,params:n,position:i}),a?{...s.value.set(r(t),(0,e.toValue)(n),i),add:u,set:d,remove:f}:{...s.value,add:u,set:d,remove:f}}function f(e,t){return a?{...s.value.remove(r(e),t),add:u,set:d,remove:f}:(console.warn(`Cannot remove from timeline before mount`),{...s.value,add:u,set:d,remove:f})}function p(e,t){return s.value.sync(e,t)}function m(e,t){return s.value.label(e,t)}function h(e,t){return s.value.call(e,t)}function g(e){return s.value.init(e)}function _(){return s.value.play()}function v(){return s.value.reverse()}function y(){return s.value.pause()}function b(){return s.value.restart()}function x(){return s.value.alternate()}function S(){return s.value.resume()}function C(){return s.value.complete()}function w(e){return s.value.reset(e)}function T(){return s.value.cancel()}function E(){return s.value.revert()}function D(e,t,n){return s.value.seek(e,t,n)}function O(e){return s.value.stretch(e)}function k(){return s.value.refresh()}return{timeline:(0,e.readonly)(s),add:u,set:d,sync:p,label:m,remove:f,call:h,init:g,play:_,reverse:v,pause:y,restart:b,alternate:x,resume:S,complete:C,reset:w,cancel:T,revert:E,seek:D,stretch:O,refresh:k}}function c(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)((0,e.computed)(()=>({el:r(i),opt:(0,e.unref)(a)})),({el:e,opt:n})=>{if(c(),!e){console.warn(`Targets element is null or undefined`),o.value=void 0;return}o.value=(0,t.createAnimatable)(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{s(),c()});function c(){return o.value?.revert()}return{animatable:(0,e.readonly)(o),revert:c}}function l(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{if(g(),!e){console.warn(`Targets element is null or undefined`),o.value=void 0;return}o.value=(0,t.createDraggable)(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{g(),s()});function c(){return o.value?.disable()}function l(){return o.value?.enable()}function u(e,t){return o.value?.setX(e,t)}function d(e,t){return o.value?.setY(e,t)}function f(e,t,n){return o.value?.animateInView(e,t,n)}function p(e,t,n){return o.value?.scrollInView(e,t,n)}function m(){return o.value?.stop()}function h(){return o.value?.reset()}function g(){return o.value?.revert()}function _(){return o.value?.refresh()}return{draggable:(0,e.readonly)(o),disable:c,enable:l,setX:u,setY:d,animateInView:f,scrollInView:p,stop:m,reset:h,revert:g,refresh:_}}function u(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{if(d(),!e){console.warn(`Target element is null or undefined`),o.value=void 0;return}o.value=(0,t.createLayout)(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{d(),s()});function c(){return o.value?.record()}function l(e){return o.value?.animate(e)}function u(e,t){return o.value?.update(e,t)}function d(){return o.value?.revert()}return{layout:(0,e.readonly)(o),record:c,animate:l,update:u,revert:d}}function d(){function n(n,r){let i=(0,e.unref)(n);return i?t.svg.morphTo((0,e.unref)(i),(0,e.unref)(r)):()=>``}function r(n,r){let i=(0,e.unref)(n)??``;return t.svg.createMotionPath(i,(0,e.unref)(r))}return{morphTo:n,createMotionPath:r}}function f(i,a=0,o=0){let s=(0,e.shallowRef)(),{stop:c}=(0,e.watch)(()=>r(i),n=>{if(s.value=void 0,!n){console.warn(`[useSvgDrawable] Target element is null or undefined`);return}s.value=t.svg.createDrawable(n,(0,e.unref)(a),(0,e.unref)(o))[0]},{flush:`post`,immediate:!(0,e.isRef)(i)});return(0,n.tryOnUnmounted)(()=>{c(),s.value=void 0}),{drawable:(0,e.readonly)(s)}}function p(i,a){let o=(0,e.shallowRef)(),s=(0,e.computed)(()=>o.value?.lines??[]),c=(0,e.computed)(()=>o.value?.words??[]),l=(0,e.computed)(()=>o.value?.chars??[]),{stop:u}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{d(),o.value=void 0,e&&(o.value=(0,t.splitText)(e,n))},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{u(),o.value=void 0,d()});function d(){o.value?.revert()}function f(){o.value?.refresh()}return{splitter:(0,e.readonly)(o),lines:s,words:c,chars:l,revert:d,refresh:f}}function m(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{o.value=t.waapi.animate(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{s()});function c(){return o.value?.resume()}function l(){return o.value?.pause()}function u(){return o.value?.alternate()}function d(){return o.value?.play()}function f(){return o.value?.reverse()}function p(t,n){return o.value?.seek((0,e.unref)(t),(0,e.unref)(n))}function m(){return o.value?.restart()}function g(){return o.value?.commitStyles()}function _(){return o.value?.complete()}function v(){return o.value?.cancel()}function y(){return o.value?.revert()}return{animation:(0,e.readonly)(o),resume:c,pause:l,alternate:u,play:d,reverse:f,seek:p,restart:m,commitStyles:g,complete:_,cancel:v,revert:y,convertEase:h}}function h(n,r=100){return t.waapi.convertEase((0,e.unref)(n),(0,e.unref)(r))}function g(r){let i=(0,e.shallowRef)(void 0),a=[],o=[],s=[],c=!1,l;(0,n.tryOnMounted)(()=>{c=!0,i.value=(0,t.createScope)((0,e.unref)(r));for(let e of a)i.value.add(e);for(let[e,t]of o)i.value.add(e,t);for(let e of s)i.value.addOnce(e);a.length=0,o.length=0,s.length=0,(0,e.isRef)(r)&&(l=(0,e.watch)(r,e=>{i.value?.revert(),i.value=(0,t.createScope)(e)},{flush:`post`}))}),(0,n.tryOnUnmounted)(()=>{i.value?.revert(),l?.()});function u(e){return c?i.value?.add(e):void a.push(e)}function d(e,t){return c?i.value?.add(e,t):void o.push([e,t])}function f(e){return c?i.value?.addOnce(e):void s.push(e)}function p(e){return i.value?.keepTime(e)}function m(){return i.value?.revert()}function h(){return i.value?.refresh()}return{scope:(0,e.shallowReadonly)(i),add:u,registerMethod:d,addOnce:f,keepTime:p,revert:m,refresh:h}}exports.useAnimatable=c,exports.useAnimate=i,exports.useDraggable=l,exports.useLayout=u,exports.useRawAnimate=a,exports.useScope=g,exports.useSvg=d,exports.useSvgDrawable=f,exports.useText=p,exports.useTimeline=s,exports.useTimer=o,exports.useWaapi=m;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`vue`),t=require(`animejs`),n=require(`@vueuse/core`);function r(e){return(0,n.unrefElement)(e)}function i(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,t])=>{c(e,t)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{s(),g()});function c(e,n){if(_(),!e){console.warn(`Target element is null or undefined`),o.value=void 0;return}o.value=(0,t.animate)(e,n)}function l(){return o.value?.play()}function u(){return o.value?.reverse()}function d(){return o.value?.pause()}function f(){return o.value?.restart()}function p(){return o.value?.alternate()}function m(){return o.value?.resume()}function h(){return o.value?.complete()}function g(){return o.value?.cancel()}function _(){return o.value?.revert()}function v(e){return o.value?.reset(e)}function y(e,t,n){return o.value?.seek(e,t,n)}function b(e){return o.value?.stretch(e)}function x(){return o.value?.refresh()}return{animation:(0,e.readonly)(o),play:l,reverse:u,pause:d,restart:f,alternate:p,resume:m,complete:h,cancel:g,revert:_,reset:v,seek:y,stretch:b,refresh:x}}function a(n,i={}){let a=r(n);return a||console.warn(`Target is undefined`),(0,t.animate)(a,(0,e.unref)(i))}function o(r={}){let i=(0,e.shallowRef)((0,t.createTimer)((0,e.unref)(r))),{stop:a}=(0,e.watch)(()=>(0,e.unref)(r),e=>{m(),i.value=(0,t.createTimer)(e)},{deep:1});(0,n.tryOnUnmounted)(()=>{a(),m()});function o(){return i.value.play()}function s(){return i.value.reverse()}function c(){return i.value.pause()}function l(){return i.value.restart()}function u(){return i.value.alternate()}function d(){return i.value.resume()}function f(){return i.value.complete()}function p(e){return i.value.reset(e)}function m(){return i.value.cancel()}function h(){return i.value.revert()}function g(e,t,n){return i.value.seek(e,t,n)}function _(e){return i.value.stretch(e)}return{timer:(0,e.readonly)(i),play:o,reverse:s,pause:c,restart:l,alternate:u,resume:d,complete:f,reset:p,cancel:m,revert:h,seek:g,stretch:_}}function s(i={}){let a=!1,o=[],s=(0,e.shallowRef)((0,t.createTimeline)((0,e.unref)(i)));function c(){for(let t of o)t.type===`add`?s.value.add(r(t.targets),(0,e.toValue)(t.params),t.position):s.value.set(r(t.targets),(0,e.toValue)(t.params),t.position)}let{stop:l}=(0,e.watch)(()=>(0,e.unref)(i),e=>{E(),s.value=(0,t.createTimeline)(e),c()},{flush:`post`,deep:1});(0,n.tryOnMounted)(()=>{a=!0,c()}),(0,n.tryOnUnmounted)(()=>{l(),T()});function u(t,n,i){return o.push({type:`add`,targets:t,params:n,position:i}),a?{...s.value.add(r(t),(0,e.toValue)(n),i),add:u,set:d,remove:f}:{...s.value,add:u,set:d,remove:f}}function d(t,n,i){return o.push({type:`set`,targets:t,params:n,position:i}),a?{...s.value.set(r(t),(0,e.toValue)(n),i),add:u,set:d,remove:f}:{...s.value,add:u,set:d,remove:f}}function f(e,t){return a?{...s.value.remove(r(e),t),add:u,set:d,remove:f}:(console.warn(`Cannot remove from timeline before mount`),{...s.value,add:u,set:d,remove:f})}function p(e,t){return s.value.sync(e,t)}function m(e,t){return s.value.label(e,t)}function h(e,t){return s.value.call(e,t)}function g(e){return s.value.init(e)}function _(){return s.value.play()}function v(){return s.value.reverse()}function y(){return s.value.pause()}function b(){return s.value.restart()}function x(){return s.value.alternate()}function S(){return s.value.resume()}function C(){return s.value.complete()}function w(e){return s.value.reset(e)}function T(){return s.value.cancel()}function E(){return s.value.revert()}function D(e,t,n){return s.value.seek(e,t,n)}function O(e){return s.value.stretch(e)}function k(){return s.value.refresh()}return{timeline:(0,e.readonly)(s),add:u,set:d,sync:p,label:m,remove:f,call:h,init:g,play:_,reverse:v,pause:y,restart:b,alternate:x,resume:S,complete:C,reset:w,cancel:T,revert:E,seek:D,stretch:O,refresh:k}}function c(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)((0,e.computed)(()=>({el:r(i),opt:(0,e.unref)(a)})),({el:e,opt:n})=>{if(c(),!e){console.warn(`Targets element is null or undefined`),o.value=void 0;return}o.value=(0,t.createAnimatable)(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{s(),c()});function c(){return o.value?.revert()}return{animatable:(0,e.readonly)(o),revert:c}}function l(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{if(g(),!e){console.warn(`Targets element is null or undefined`),o.value=void 0;return}o.value=(0,t.createDraggable)(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{g(),s()});function c(){return o.value?.disable()}function l(){return o.value?.enable()}function u(e,t){return o.value?.setX(e,t)}function d(e,t){return o.value?.setY(e,t)}function f(e,t,n){return o.value?.animateInView(e,t,n)}function p(e,t,n){return o.value?.scrollInView(e,t,n)}function m(){return o.value?.stop()}function h(){return o.value?.reset()}function g(){return o.value?.revert()}function _(){return o.value?.refresh()}return{draggable:(0,e.readonly)(o),disable:c,enable:l,setX:u,setY:d,animateInView:f,scrollInView:p,stop:m,reset:h,revert:g,refresh:_}}function u(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{if(d(),!e){console.warn(`Target element is null or undefined`),o.value=void 0;return}o.value=(0,t.createLayout)(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{d(),s()});function c(){return o.value?.record()}function l(e){return o.value?.animate(e)}function u(e,t){return o.value?.update(e,t)}function d(){return o.value?.revert()}return{layout:(0,e.readonly)(o),record:c,animate:l,update:u,revert:d}}function d(){function n(n,r){let i=(0,e.unref)(n);return i?t.svg.morphTo((0,e.unref)(i),(0,e.unref)(r)):()=>``}function r(n,r){let i=(0,e.unref)(n)??``;return t.svg.createMotionPath(i,(0,e.unref)(r))}return{morphTo:n,createMotionPath:r}}function f(i,a=0,o=0){let s=(0,e.shallowRef)(),{stop:c}=(0,e.watch)(()=>r(i),n=>{if(s.value=void 0,!n){console.warn(`[useSvgDrawable] Target element is null or undefined`);return}s.value=t.svg.createDrawable(n,(0,e.unref)(a),(0,e.unref)(o))[0]},{flush:`post`,immediate:!(0,e.isRef)(i)});return(0,n.tryOnUnmounted)(()=>{c(),s.value=void 0}),{drawable:(0,e.readonly)(s)}}function p(i,a){let o=(0,e.shallowRef)(),s=(0,e.computed)(()=>o.value?.lines??[]),c=(0,e.computed)(()=>o.value?.words??[]),l=(0,e.computed)(()=>o.value?.chars??[]),{stop:u}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{d(),o.value=void 0,e&&(o.value=(0,t.splitText)(e,n))},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{u(),o.value=void 0,d()});function d(){o.value?.revert()}function f(){o.value?.refresh()}return{splitter:(0,e.readonly)(o),lines:s,words:c,chars:l,revert:d,refresh:f}}function m(i,a={}){let o=(0,e.shallowRef)(),{stop:s}=(0,e.watch)([()=>r(i),()=>(0,e.unref)(a)],([e,n])=>{o.value=t.waapi.animate(e,n)},{flush:`post`,immediate:!(0,e.isRef)(i)});(0,n.tryOnUnmounted)(()=>{s()});function c(){return o.value?.resume()}function l(){return o.value?.pause()}function u(){return o.value?.alternate()}function d(){return o.value?.play()}function f(){return o.value?.reverse()}function p(t,n){return o.value?.seek((0,e.unref)(t),(0,e.unref)(n))}function m(){return o.value?.restart()}function g(){return o.value?.commitStyles()}function _(){return o.value?.complete()}function v(){return o.value?.cancel()}function y(){return o.value?.revert()}return{animation:(0,e.readonly)(o),resume:c,pause:l,alternate:u,play:d,reverse:f,seek:p,restart:m,commitStyles:g,complete:_,cancel:v,revert:y,convertEase:h}}function h(n,r=100){return t.waapi.convertEase((0,e.unref)(n),(0,e.unref)(r))}function g(r){let i=(0,e.shallowRef)(void 0),a=[],o=[],s=[],c=!1,l;(0,n.tryOnMounted)(()=>{c=!0,i.value=(0,t.createScope)((0,e.unref)(r));for(let e of a)i.value.add(e);for(let[e,t]of o)i.value.add(e,t);for(let e of s)i.value.addOnce(e);a.length=0,o.length=0,s.length=0,(0,e.isRef)(r)&&(l=(0,e.watch)(r,e=>{i.value?.revert(),i.value=(0,t.createScope)(e)},{flush:`post`}))}),(0,n.tryOnUnmounted)(()=>{i.value?.revert(),l?.()});function u(e){return c?i.value?.add(e):void a.push(e)}function d(e,t){return c?i.value?.add(e,t):void o.push([e,t])}function f(e){return c?i.value?.addOnce(e):void s.push(e)}function p(e){return i.value?.keepTime(e)}function m(){return i.value?.revert()}function h(){return i.value?.refresh()}return{scope:(0,e.shallowReadonly)(i),add:u,registerMethod:d,addOnce:f,keepTime:p,revert:m,refresh:h}}var _=new WeakMap,v={mounted(e,n){n.value&&_.set(e,(0,t.animate)(e,n.value))},updated(e,n){if(n.value===n.oldValue)return;let r=_.get(e);r?.cancel(),r?.revert(),n.value&&_.set(e,(0,t.animate)(e,n.value))},unmounted(e){let t=_.get(e);t?.cancel(),t?.revert(),_.delete(e)}},y=new WeakMap,b={mounted(e,n){y.set(e,(0,t.createDraggable)(e,n.value??{}))},updated(e,n){n.value!==n.oldValue&&(y.get(e)?.revert(),y.set(e,(0,t.createDraggable)(e,n.value??{})))},unmounted(e){y.get(e)?.revert(),y.delete(e)}},x=new WeakMap;function S(e,n){let r=t.svg.createDrawable(e)[0];return{drawable:r,animation:n?(0,t.animate)(r,n):void 0}}var C={mounted(e,t){x.set(e,S(e,t.value))},updated(e,t){if(t.value===t.oldValue)return;let n=x.get(e);n?.animation?.cancel(),n?.animation?.revert(),x.set(e,S(e,t.value))},unmounted(e){let t=x.get(e);t?.animation?.cancel(),t?.animation?.revert(),x.delete(e)}},w=new WeakMap,T={mounted(e,n){n.value&&w.set(e,{animation:t.waapi.animate(e,n.value),originalStyle:e.style.cssText})},updated(e,n){if(n.value===n.oldValue)return;let r=w.get(e);r&&(r.animation.cancel(),e.style.cssText=r.originalStyle,w.delete(e)),n.value&&w.set(e,{animation:t.waapi.animate(e,n.value),originalStyle:e.style.cssText})},unmounted(e){let t=w.get(e);t&&(t.animation.cancel(),e.style.cssText=t.originalStyle,w.delete(e))}},E=new WeakMap;function D(e,n){let{animation:r,...i}=n??{},a=(0,t.splitText)(e,i),o={splitter:a,animation:void 0};return r&&(i.lines?(document.fonts?.ready??Promise.resolve()).then(()=>{E.get(e)===o&&(o.animation=(0,t.animate)(a.lines,r))}):o.animation=(0,t.animate)(i.chars?a.chars:a.words,r)),o}function O(e){e.animation?.cancel(),e.splitter.revert()}var k={mounted(e,t){E.set(e,D(e,t.value))},updated(e,t){if(t.value===t.oldValue)return;let n=E.get(e);n&&O(n),E.set(e,D(e,t.value))},unmounted(e){let t=E.get(e);t&&O(t),E.delete(e)}};exports.useAnimatable=c,exports.useAnimate=i,exports.useDraggable=l,exports.useLayout=u,exports.useRawAnimate=a,exports.useScope=g,exports.useSvg=d,exports.useSvgDrawable=f,exports.useText=p,exports.useTimeline=s,exports.useTimer=o,exports.useWaapi=m,exports.vAnimate=v,exports.vDraggable=b,exports.vSvgDrawable=C,exports.vTextSplit=k,exports.vWaapi=T;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/utils/resolve-target.ts","../src/composables/use-animate.ts","../src/composables/use-raw-animate.ts","../src/composables/use-timer.ts","../src/composables/use-timeline.ts","../src/composables/use-animatable.ts","../src/composables/use-draggable.ts","../src/composables/use-layout.ts","../src/composables/use-svg.ts","../src/composables/use-svg-drawable.ts","../src/composables/use-text.ts","../src/composables/use-waapi.ts","../src/composables/use-scope.ts"],"sourcesContent":["import { type Ref, type ComponentPublicInstance, type MaybeRef } from \"vue\"\nimport { unrefElement, type MaybeComputedElementRef } from \"@vueuse/core\"\nimport { type TargetsParam } from \"animejs\"\n\n/**\n * Any valid animation target: any Anime.js `TargetsParam` (optionally wrapped in a `Ref`),\n * or a Vue component template ref (`Ref<ComponentPublicInstance>`), whose `.$el` is resolved\n * automatically via `unrefElement`.\n */\nexport type AnimationTargets = MaybeRef<TargetsParam> | Ref<ComponentPublicInstance>\n\n/**\n * Resolves an `AnimationTargets` value to a plain `TargetsParam` suitable for Anime.js.\n * Unwraps `Ref<HTMLElement | SVGElement>` template refs and `Ref<ComponentPublicInstance>`\n * component refs (extracting `.$el`); non-ref values pass through unchanged.\n *\n * @param targets - A raw Anime.js target, a Vue template ref, or a Vue component ref.\n */\nexport function resolveTarget(targets: AnimationTargets): TargetsParam {\n return unrefElement(targets as MaybeComputedElementRef) as TargetsParam\n}","import { type DeepReadonly, type MaybeRef, type ShallowRef, shallowRef, unref, watch, readonly, isRef } from \"vue\"\nimport { type JSAnimation, animate, type TargetsParam, type AnimationParams } from \"animejs\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimateReturn {\n /** The underlying Anime.js animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<JSAnimation | undefined>>\n /** Starts or resumes the animation. */\n play: () => JSAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => JSAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => JSAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => JSAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => JSAnimation | undefined\n /** Resumes from a paused state. */\n resume: () => JSAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => JSAnimation | undefined\n /** Stops the animation and removes it from the Anime.js engine. */\n cancel: () => JSAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => JSAnimation | undefined\n /** Resets the animation to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => JSAnimation | undefined\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => JSAnimation | undefined\n /** Rescales the animation to a new total duration. */\n stretch: (newDuration: number) => JSAnimation | undefined\n /** Re-reads the current values of animated properties from the DOM. */\n refresh: () => JSAnimation | undefined\n}\n\n/**\n * Wraps Anime.js `animate()` into a Vue composable. Reactively re-creates the animation when the target or options change, and cancels it automatically on unmount.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimate(_target: AnimationTargets, _options: MaybeRef<AnimationParams> = {}): UseAnimateReturn {\n const animation = shallowRef<JSAnimation>()\n\n const { stop } = watch(\n [() => resolveTarget(_target), () => unref(_options)],\n ([el, opt]) => {\n createAnimation(el, opt)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function createAnimation(el: TargetsParam, opt: AnimationParams) {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n animation.value = undefined\n return\n }\n\n animation.value = animate(el, opt)\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function resume() {\n return animation.value?.resume()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n function reset(softReset?: boolean) {\n return animation.value?.reset(softReset)\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return animation.value?.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return animation.value?.stretch(newDuration)\n }\n\n function refresh() {\n return animation.value?.refresh()\n }\n\n return {\n animation: readonly(animation),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n cancel,\n revert,\n reset,\n seek,\n stretch,\n refresh,\n }\n}","import { animate, type AnimationParams, type JSAnimation } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\n/** The Anime.js `JSAnimation` instance returned by `useRawAnimate`. */\nexport type UseRawAnimateReturn = JSAnimation\n\n/**\n * Thin wrapper around Anime.js `animate()`. Resolves the target (unwrapping refs and Vue component\n * refs via `.$el`) and immediately starts the animation.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a Vue component ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useRawAnimate(\n _target: AnimationTargets,\n _options: MaybeRef<AnimationParams> = {}\n): UseRawAnimateReturn {\n const target = resolveTarget(_target)\n\n if (!target) {\n console.warn(\"Target is undefined\")\n }\n\n return animate(target, unref(_options))\n}","import { createTimer, type Timer, type TimerParams } from \"animejs\"\nimport { type MaybeRef, type ShallowRef, shallowRef, unref, watch, type DeepReadonly, readonly } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\n\nexport interface UseTimerReturn {\n /** The underlying Anime.js timer instance. */\n timer: DeepReadonly<ShallowRef<Timer>>\n /** Starts or resumes the timer. */\n play: () => Timer\n /** Reverses the timer's playback direction. */\n reverse: () => Timer\n /** Pauses the timer at the current position. */\n pause: () => Timer\n /** Restarts the timer from the beginning. */\n restart: () => Timer\n /** Toggles between forward and reverse direction. */\n alternate: () => Timer\n /** Resumes from a paused state. */\n resume: () => Timer\n /** Jumps immediately to the end of the timer duration. */\n complete: () => Timer\n /** Resets the timer to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timer\n /** Stops the timer and removes it from the Anime.js engine. */\n cancel: () => Timer\n /** Cancels the timer and restores any associated state to its original values. */\n revert: () => Timer\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timer\n /** Rescales the timer to a new total duration. */\n stretch: (newDuration: number) => Timer\n}\n\n/**\n * Wraps Anime.js `createTimer()` into a Vue composable. Reactively re-creates the timer when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timer parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimer(options: MaybeRef<TimerParams> = {}): UseTimerReturn {\n const timer = shallowRef<Timer>(createTimer(unref(options)))\n\n const { stop } = watch(\n () => unref(options),\n options => {\n cancel()\n timer.value = createTimer(options)\n },\n { deep: 1 }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function play() {\n return timer.value.play()\n }\n\n function reverse() {\n return timer.value.reverse()\n }\n\n function pause() {\n return timer.value.pause()\n }\n\n function restart() {\n return timer.value.restart()\n }\n\n function alternate() {\n return timer.value.alternate()\n }\n\n function resume() {\n return timer.value.resume()\n }\n\n function complete() {\n return timer.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timer.value.reset(softReset)\n }\n\n function cancel() {\n return timer.value.cancel()\n }\n\n function revert() {\n return timer.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timer.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timer.value.stretch(newDuration)\n }\n\n return {\n timer: readonly(timer),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n }\n}","import {\n type MaybeRef,\n type MaybeRefOrGetter,\n type ShallowRef,\n shallowRef,\n toValue,\n unref,\n watch,\n type DeepReadonly,\n readonly,\n} from \"vue\"\nimport {\n type AnimationParams,\n type Callback,\n createTimeline,\n type StaggerFunction,\n type Tickable,\n type Timeline,\n type TimelineParams,\n type TimelinePosition,\n type Timer,\n} from \"animejs\"\nimport { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\ntype QueueEntry =\n | {\n type: \"add\"\n targets: AnimationTargets\n params: MaybeRefOrGetter<AnimationParams>\n position?: TimelinePosition | StaggerFunction<number | string>\n }\n | { type: \"set\"; targets: AnimationTargets; params: MaybeRefOrGetter<AnimationParams>; position?: TimelinePosition }\n\nexport type TimelineChain = Timeline & {\n /** Adds an animation to the timeline and returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it, then returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline and returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n}\n\nexport interface UseTimelineReturn {\n /** The underlying Anime.js timeline instance. */\n timeline: DeepReadonly<ShallowRef<Timeline>>\n /** Adds an animation to the timeline. Accepts a template ref or any valid Anime.js target. Returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it. Returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline. Returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n /** Synchronises another tickable (animation, timer) into the timeline at the given position. */\n sync: (synced?: Tickable, position?: TimelinePosition) => Timeline\n /** Adds a named label at a position so it can be referenced by `.add()` or `.seek()`. */\n label: (labelName: string, position?: TimelinePosition) => Timeline\n /** Inserts a callback function at a specific point in the timeline. */\n call: (callback: Callback<Timer>, position?: TimelinePosition) => Timeline\n /** Renders the timeline once without playing it. */\n init: (internalRender?: boolean) => Timeline\n /** Starts or resumes the timeline. */\n play: () => Timeline\n /** Reverses playback direction. */\n reverse: () => Timeline\n /** Pauses the timeline at the current position. */\n pause: () => Timeline\n /** Restarts the timeline from the beginning. */\n restart: () => Timeline\n /** Toggles between forward and reverse direction. */\n alternate: () => Timeline\n /** Resumes from a paused state. */\n resume: () => Timeline\n /** Jumps immediately to the end of the timeline. */\n complete: () => Timeline\n /** Resets the timeline to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timeline\n /** Stops the timeline and removes it from the Anime.js engine. */\n cancel: () => Timeline\n /** Cancels the timeline and restores all animated properties to their original values. */\n revert: () => Timeline\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timeline\n /** Rescales the timeline to a new total duration. */\n stretch: (newDuration: number) => Timeline\n /** Re-reads the current values of all animated properties from the DOM. */\n refresh: () => Timeline\n}\n\n/**\n * Wraps Anime.js `createTimeline()` into a Vue composable. Reactively re-creates the timeline when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timeline parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimeline(options: MaybeRef<TimelineParams> = {}): UseTimelineReturn {\n let is_mounted = false\n\n const queue: QueueEntry[] = []\n\n const timeline = shallowRef<Timeline>(createTimeline(unref(options)))\n\n function replayQueue() {\n for (const entry of queue) {\n if (entry.type === \"add\") {\n timeline.value.add(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n } else {\n timeline.value.set(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n }\n }\n }\n\n const { stop } = watch(\n () => unref(options),\n _options => {\n revert()\n timeline.value = createTimeline(_options)\n replayQueue()\n },\n { flush: \"post\", deep: 1 }\n )\n\n tryOnMounted(() => {\n is_mounted = true\n replayQueue()\n })\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function add(\n targets: AnimationTargets,\n _params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) {\n queue.push({ type: \"add\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.add(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function set(targets: AnimationTargets, _params: MaybeRefOrGetter<AnimationParams>, position?: TimelinePosition) {\n queue.push({ type: \"set\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.set(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function remove(targets: AnimationTargets, propertyName?: string) {\n if (!is_mounted) {\n console.warn(\"Cannot remove from timeline before mount\")\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n return { ...timeline.value.remove(resolveTarget(targets), propertyName), add, set, remove } as TimelineChain\n }\n\n function sync(synced?: Tickable, position?: TimelinePosition) {\n return timeline.value.sync(synced, position)\n }\n\n function label(labelName: string, position?: TimelinePosition) {\n return timeline.value.label(labelName, position)\n }\n\n function call(callback: Callback<Timer>, position?: TimelinePosition) {\n return timeline.value.call(callback, position)\n }\n\n function init(internalRender?: boolean) {\n return timeline.value.init(internalRender)\n }\n\n function play() {\n return timeline.value.play()\n }\n\n function reverse() {\n return timeline.value.reverse()\n }\n\n function pause() {\n return timeline.value.pause()\n }\n\n function restart() {\n return timeline.value.restart()\n }\n\n function alternate() {\n return timeline.value.alternate()\n }\n\n function resume() {\n return timeline.value.resume()\n }\n\n function complete() {\n return timeline.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timeline.value.reset(softReset)\n }\n\n function cancel() {\n return timeline.value.cancel()\n }\n\n function revert() {\n return timeline.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timeline.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timeline.value.stretch(newDuration)\n }\n\n function refresh() {\n return timeline.value.refresh()\n }\n\n return {\n timeline: readonly(timeline),\n add,\n set,\n sync,\n label,\n remove,\n call,\n init,\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n refresh,\n }\n}","import { type AnimatableObject, type AnimatableParams, createAnimatable, type TargetsParam } from \"animejs\"\nimport {\n computed,\n type DeepReadonly,\n isRef,\n type MaybeRef,\n readonly,\n type ShallowRef,\n shallowRef,\n unref,\n watch,\n} from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimatableReturn {\n /** The underlying Anime.js animatable instance. `undefined` until the target is available. */\n animatable: DeepReadonly<ShallowRef<AnimatableObject | undefined>>\n /** Cancels the animatable and restores all animated properties to their original values. */\n revert: () => AnimatableObject | undefined\n}\n\n/**\n * Wraps Anime.js `createAnimatable()` into a Vue composable. Reactively re-creates the animatable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make animatable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js animatable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimatable(\n targets: AnimationTargets,\n options: MaybeRef<AnimatableParams> = {}\n): UseAnimatableReturn {\n const animatable = shallowRef<AnimatableObject>()\n\n const watch_target = computed<{ el: TargetsParam; opt: AnimatableParams }>(() => ({\n el: resolveTarget(targets),\n opt: unref(options),\n }))\n\n const { stop } = watch(\n watch_target,\n ({ el, opt }) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n animatable.value = undefined\n return\n }\n\n animatable.value = createAnimatable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n revert()\n })\n\n function revert() {\n return animatable.value?.revert()\n }\n\n return { animatable: readonly(animatable), revert }\n}","import { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type Draggable, type DraggableParams, createDraggable, type EasingParam } from \"animejs\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseDraggableReturn {\n /** The underlying Anime.js draggable instance. `undefined` until the target is available. */\n draggable: DeepReadonly<ShallowRef<Draggable | undefined>>\n /** Disables drag interactions without destroying the instance. */\n disable: () => void\n /** Re-enables drag interactions after `disable()`. */\n enable: () => void\n /** Moves the draggable to the given x position. Pass `true` to suppress the update callback. */\n setX: (x: number, muteUpdateCallback?: boolean) => void\n /** Moves the draggable to the given y position. Pass `true` to suppress the update callback. */\n setY: (y: number, muteUpdateCallback?: boolean) => void\n /** Animates the draggable into the visible viewport. */\n animateInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Scrolls the draggable into the visible viewport. */\n scrollInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Stops any in-progress snap or momentum animation. */\n stop: () => void\n /** Resets the draggable position to its initial state. */\n reset: () => void\n /** Cancels the draggable and restores the element to its original state. */\n revert: () => void\n /** Re-reads the element's size and container bounds. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createDraggable()` into a Vue composable. Reactively re-creates the draggable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make draggable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js draggable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useDraggable(targets: AnimationTargets, options: MaybeRef<DraggableParams> = {}): UseDraggableReturn {\n const draggable = shallowRef<Draggable>()\n\n const { stop: stopWatch } = watch(\n [() => resolveTarget(targets), () => unref(options)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n draggable.value = undefined\n return\n }\n\n draggable.value = createDraggable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stopWatch()\n })\n\n function disable() {\n return draggable.value?.disable()\n }\n\n function enable() {\n return draggable.value?.enable()\n }\n\n function setX(x: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setX(x, muteUpdateCallback)\n }\n\n function setY(y: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setY(y, muteUpdateCallback)\n }\n\n function animateInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.animateInView(duration, gap, ease)\n }\n\n function scrollInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.scrollInView(duration, gap, ease)\n }\n\n function stop() {\n return draggable.value?.stop()\n }\n\n function reset() {\n return draggable.value?.reset()\n }\n\n function revert() {\n return draggable.value?.revert()\n }\n\n function refresh() {\n return draggable.value?.refresh()\n }\n\n return {\n draggable: readonly(draggable),\n disable,\n enable,\n setX,\n setY,\n animateInView,\n scrollInView,\n stop,\n reset,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type AutoLayout,\n type AutoLayoutParams,\n createLayout,\n type DOMTargetSelector,\n type LayoutAnimationParams,\n type Timeline,\n} from \"animejs\"\nimport { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseLayoutReturn {\n /** The underlying Anime.js `AutoLayout` instance. `undefined` until the root element is available. */\n layout: DeepReadonly<ShallowRef<AutoLayout | undefined>>\n /** Snapshots the current positions of all tracked children so the next layout change can be animated. */\n record: () => void\n /** Animates all children from their recorded positions to their new positions. */\n animate: (params?: LayoutAnimationParams) => Timeline | undefined\n /** Records, applies the callback (which triggers a layout change), then animates the transition. */\n update: (callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) => void\n /** Cancels the layout watcher and restores all elements to their original state. */\n revert: () => void\n}\n\n/**\n * Wraps Anime.js `createLayout()` into a Vue composable. Reactively re-creates the layout observer when the root element or params change, and reverts it automatically on unmount.\n *\n * @param root - The container element whose children will be tracked. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param params - Anime.js auto-layout parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useLayout(\n root: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n params: MaybeRef<AutoLayoutParams> = {}\n): UseLayoutReturn {\n const layout = shallowRef<AutoLayout | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(root as AnimationTargets), () => unref(params)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n layout.value = undefined\n return\n }\n\n layout.value = createLayout(el as DOMTargetSelector, opt)\n },\n { flush: \"post\", immediate: !isRef(root) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stop()\n })\n\n function record() {\n return layout.value?.record()\n }\n\n function animate(params?: LayoutAnimationParams) {\n return layout.value?.animate(params)\n }\n\n function update(callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) {\n return layout.value?.update(callback, params)\n }\n\n function revert() {\n return layout.value?.revert()\n }\n\n return { layout: readonly(layout), record, animate, update, revert }\n}","import { svg, type FunctionValue, type TargetsParam } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\n\nexport interface UseSvgReturn {\n /** Returns a `FunctionValue` that morphs the current path to the given `path`. Pass the result as the `d` property in `useAnimate` options. */\n morphTo: (path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) => FunctionValue\n /** Creates a motion-path object from an SVG `<path>`. Spread the result into `useAnimate` options to animate `translateX`, `translateY`, and `rotate` along the path. */\n createMotionPath: (\n path: MaybeRef<TargetsParam | null>,\n offset?: MaybeRef<number>\n ) => ReturnType<typeof svg.createMotionPath>\n}\n\n/**\n * Exposes Anime.js SVG utilities (`svg.morphTo`, `svg.createMotionPath`) as a Vue composable, automatically unwrapping reactive refs passed to each helper.\n *\n * For drawable stroke animations, use `useSvgDrawable` instead.\n */\nexport function useSvg(): UseSvgReturn {\n function morphTo(_path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) {\n const path = unref(_path)\n\n if (!path) return () => \"\"\n\n return svg.morphTo(unref(path), unref(precision))\n }\n\n function createMotionPath(path: MaybeRef<TargetsParam | null>, offset?: MaybeRef<number>) {\n const resolved = unref(path) ?? \"\"\n return svg.createMotionPath(resolved, unref(offset))\n }\n\n return {\n morphTo,\n createMotionPath,\n }\n}","import { svg, type DrawableSVGGeometry, type DOMTargetSelector } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { isRef, type MaybeRef, readonly, type DeepReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseSvgDrawableReturn {\n /**\n * The Anime.js drawable Proxy for the target element. `undefined` until the element is available.\n * Pass this ref — not the original template ref — as the `useAnimate` target to animate the `draw` property.\n */\n drawable: DeepReadonly<ShallowRef<DrawableSVGGeometry | undefined>>\n}\n\n/**\n * Wraps an SVG geometry element in Anime.js's drawable Proxy. The proxy intercepts `setAttribute('draw', …)` calls and translates normalised `draw` values (`0`–`1`) into the correct `stroke-dasharray` / `stroke-dashoffset` updates. Pass the returned `drawable` ref as the target to `useAnimate`.\n *\n * @param target - The SVG element to make drawable. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param start - Initial draw start position (`0`–`1`). Defaults to `0`.\n * @param end - Initial draw end position (`0`–`1`). Defaults to `0` (fully hidden).\n */\nexport function useSvgDrawable(\n target: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n start: MaybeRef<number> = 0,\n end: MaybeRef<number> = 0\n): UseSvgDrawableReturn {\n const drawable = shallowRef<DrawableSVGGeometry | undefined>()\n\n const { stop } = watch(\n () => resolveTarget(target as AnimationTargets),\n el => {\n drawable.value = undefined\n if (!el) {\n console.warn(\"[useSvgDrawable] Target element is null or undefined\")\n return\n }\n drawable.value = svg.createDrawable(el as DOMTargetSelector, unref(start), unref(end))[0]\n },\n { flush: \"post\", immediate: !isRef(target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n drawable.value = undefined\n })\n\n return { drawable: readonly(drawable) }\n}","import { splitText, type TextSplitter, type TextSplitterParams } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n computed,\n isRef,\n readonly,\n shallowRef,\n unref,\n watch,\n type ComputedRef,\n type DeepReadonly,\n type MaybeRef,\n type ShallowRef,\n} from \"vue\"\n\nexport interface UseTextReturn {\n /** The underlying Anime.js `TextSplitter` instance. `undefined` until the target is available. */\n splitter: DeepReadonly<ShallowRef<TextSplitter | undefined>>\n /** Reactive array of `<span>` elements representing each line after splitting. */\n lines: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each word after splitting. */\n words: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each character after splitting. */\n chars: ComputedRef<HTMLElement[]>\n /** Removes all split `<span>` wrappers and restores the original text content. */\n revert: () => void\n /** Re-splits the text, updating `lines`, `words`, and `chars` to reflect any DOM or size changes. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `splitText()` into a Vue composable. Reactively re-splits the text when the target or params change, and reverts the DOM automatically on unmount.\n *\n * @param _target - The element(s) whose text content should be split. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _params - Anime.js text-splitter parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useText(\n _target: MaybeRef<HTMLElement | NodeList | string | HTMLElement[]> | MaybeComputedElementRef,\n _params?: MaybeRef<TextSplitterParams>\n): UseTextReturn {\n const splitter = shallowRef<TextSplitter | undefined>()\n\n const lines = computed<HTMLElement[]>(() => splitter.value?.lines ?? [])\n const words = computed<HTMLElement[]>(() => splitter.value?.words ?? [])\n const chars = computed<HTMLElement[]>(() => splitter.value?.chars ?? [])\n\n const { stop } = watch(\n [() => resolveTarget(_target as AnimationTargets), () => unref(_params)],\n ([el, params]) => {\n revert()\n splitter.value = undefined\n\n if (!el) return\n\n splitter.value = splitText(el as HTMLElement | NodeList | string | HTMLElement[], params)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n splitter.value = undefined\n revert()\n })\n\n function revert() {\n splitter.value?.revert()\n }\n\n function refresh() {\n splitter.value?.refresh()\n }\n\n return {\n splitter: readonly(splitter),\n lines,\n words,\n chars,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type WAAPIAnimationParams,\n type DOMTargetsParam,\n waapi,\n type WAAPIAnimation,\n type EasingFunction,\n} from \"animejs\"\nimport { DeepReadonly, isRef, type MaybeRef, readonly, ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseWaapiReturn {\n /** The underlying Anime.js WAAPI animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<WAAPIAnimation | undefined>>\n /** Resumes from a paused state. */\n resume: () => WAAPIAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => WAAPIAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => WAAPIAnimation | undefined\n /** Starts or resumes the animation. */\n play: () => WAAPIAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => WAAPIAnimation | undefined\n /** Seeks to a specific time (in ms). Accepts a reactive ref for the time value. */\n seek: (time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) => WAAPIAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => WAAPIAnimation | undefined\n /** Commits the current animated styles to the element's inline style, then cancels the animation. */\n commitStyles: () => WAAPIAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => WAAPIAnimation | undefined\n /** Stops the animation and removes it from the WAAPI engine. */\n cancel: () => WAAPIAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => WAAPIAnimation | undefined\n /** Converts an Anime.js easing function to a CSS `cubic-bezier()` string usable by WAAPI. */\n convertEase: (fn: MaybeRef<EasingFunction>, samples?: MaybeRef<number>) => string\n}\n\n/**\n * Wraps Anime.js `waapi.animate()` into a Vue composable. Reactively re-creates the WAAPI animation when the target or options change, and stops it automatically on unmount.\n *\n * @param targets - The DOM element(s) to animate via WAAPI. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js WAAPI animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useWaapi(\n targets: MaybeRef<DOMTargetsParam> | MaybeComputedElementRef,\n options: MaybeRef<WAAPIAnimationParams> = {}\n): UseWaapiReturn {\n const animation = shallowRef<WAAPIAnimation | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(targets as AnimationTargets), () => unref(options)],\n ([el, opt]) => {\n animation.value = waapi.animate(el as DOMTargetsParam, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n })\n\n function resume() {\n return animation.value?.resume()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function seek(time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) {\n return animation.value?.seek(unref(time), unref(muteCallbacks))\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function commitStyles() {\n return animation.value?.commitStyles()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n return {\n animation: readonly(animation),\n resume,\n pause,\n alternate,\n play,\n reverse,\n seek,\n restart,\n commitStyles,\n complete,\n cancel,\n revert,\n\n convertEase,\n }\n}\n\nfunction convertEase(fn: MaybeRef<EasingFunction>, samples: MaybeRef<number> = 100) {\n return waapi.convertEase(unref(fn), unref(samples))\n}","import { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { createScope, type Scope, type ScopeMethod, type ScopeParams, type Tickable } from \"animejs\"\nimport { isRef, type MaybeRef, shallowReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseScopeReturn {\n /** The underlying Anime.js `Scope` instance. */\n scope: Readonly<ShallowRef<Scope | undefined>>\n /** Registers an anonymous method on the scope. Queued automatically if called before mount. */\n add: (method: ScopeMethod) => void\n /** Registers a named method on the scope so it can be called via `scope.methods[name]()`. Queued automatically if called before mount. */\n registerMethod: (methodName: string, method: ScopeMethod) => void\n /** Registers a method that runs exactly once on the scope. Queued automatically if called before mount. */\n addOnce: (method: ScopeMethod) => void\n /** Keeps the time of another tickable (animation, timer) in sync with this scope. */\n keepTime: (method: (scope: Scope) => Tickable) => void\n /** Cancels the scope and reverts all animations and tickables it owns. */\n revert: () => void\n /** Re-reads default values and media-query breakpoints for the scope. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createScope()` into a Vue composable. Reactively re-creates the scope when params change, replays all registered methods, and reverts it automatically on unmount.\n *\n * Methods added before mount are queued and replayed once the component is mounted.\n *\n * @param params - Anime.js scope parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useScope(params: MaybeRef<ScopeParams>): UseScopeReturn {\n const scope = shallowRef<Scope | undefined>(undefined)\n\n const pending_adds: ScopeMethod[] = []\n const pending_named: [string, ScopeMethod][] = []\n const pending_once: ScopeMethod[] = []\n\n let is_mounted = false\n let stopWatcher: (() => void) | undefined\n\n tryOnMounted(() => {\n is_mounted = true\n scope.value = createScope(unref(params))\n\n for (const method of pending_adds) scope.value.add(method)\n for (const [name, method] of pending_named) scope.value.add(name, method)\n for (const method of pending_once) scope.value.addOnce(method)\n\n pending_adds.length = 0\n pending_named.length = 0\n pending_once.length = 0\n\n if (isRef(params)) {\n stopWatcher = watch(\n params,\n new_params => {\n scope.value?.revert()\n scope.value = createScope(new_params)\n },\n { flush: \"post\" }\n )\n }\n })\n\n tryOnUnmounted(() => {\n scope.value?.revert()\n stopWatcher?.()\n })\n\n function add(method: ScopeMethod) {\n if (!is_mounted) return void pending_adds.push(method)\n return scope.value?.add(method)\n }\n\n function registerMethod(methodName: string, method: ScopeMethod) {\n if (!is_mounted) return void pending_named.push([methodName, method])\n return scope.value?.add(methodName, method)\n }\n\n function addOnce(method: ScopeMethod) {\n if (!is_mounted) return void pending_once.push(method)\n return scope.value?.addOnce(method)\n }\n\n function keepTime(method: (scope: Scope) => Tickable) {\n return scope.value?.keepTime(method)\n }\n\n function revert() {\n return scope.value?.revert()\n }\n\n function refresh() {\n return scope.value?.refresh()\n }\n\n return {\n scope: shallowReadonly(scope),\n add,\n registerMethod,\n addOnce,\n keepTime,\n revert,\n refresh,\n }\n}"],"mappings":"uIAkBA,SAAgB,EAAc,EAAyC,CACrE,OAAA,EAAA,EAAA,cAAoB,EAAmC,CCuBzD,SAAgB,EAAW,EAA2B,EAAsC,EAAE,CAAoB,CAChH,IAAM,GAAA,EAAA,EAAA,aAAqC,CAErC,CAAE,SAAA,EAAA,EAAA,OACN,KAAO,EAAc,EAAQ,MAAA,EAAA,EAAA,OAAc,EAAS,CAAC,EACpD,CAAC,EAAI,KAAS,CACb,EAAgB,EAAI,EAAI,EAE1B,CAAE,MAAO,OAAQ,UAAW,EAAA,EAAA,EAAA,OAAO,EAAQ,CAAE,CAC9C,EAED,EAAA,EAAA,oBAAqB,CACnB,GAAM,CACN,GAAQ,EACR,CAEF,SAAS,EAAgB,EAAkB,EAAsB,CAG/D,GAFA,GAAQ,CAEJ,CAAC,EAAI,CACP,QAAQ,KAAK,sCAAsC,CACnD,EAAU,MAAQ,IAAA,GAClB,OAGF,EAAU,OAAA,EAAA,EAAA,SAAgB,EAAI,EAAI,CAGpC,SAAS,GAAO,CACd,OAAO,EAAU,OA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,EAAqB,CAEhC,OADK,EACE,EAAM,OAAO,IAAI,EAAO,CADP,KAAK,EAAa,KAAK,EAAO,CAIxD,SAAS,EAAe,EAAoB,EAAqB,CAE/D,OADK,EACE,EAAM,OAAO,IAAI,EAAY,EAAO,CADnB,KAAK,EAAc,KAAK,CAAC,EAAY,EAAO,CAAC,CAIvE,SAAS,EAAQ,EAAqB,CAEpC,OADK,EACE,EAAM,OAAO,QAAQ,EAAO,CADX,KAAK,EAAa,KAAK,EAAO,CAIxD,SAAS,EAAS,EAAoC,CACpD,OAAO,EAAM,OAAO,SAAS,EAAO,CAGtC,SAAS,GAAS,CAChB,OAAO,EAAM,OAAO,QAAQ,CAG9B,SAAS,GAAU,CACjB,OAAO,EAAM,OAAO,SAAS,CAG/B,MAAO,CACL,OAAA,EAAA,EAAA,iBAAuB,EAAM,CAC7B,MACA,iBACA,UACA,WACA,SACA,UACD"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/utils/resolve-target.ts","../src/composables/use-animate.ts","../src/composables/use-raw-animate.ts","../src/composables/use-timer.ts","../src/composables/use-timeline.ts","../src/composables/use-animatable.ts","../src/composables/use-draggable.ts","../src/composables/use-layout.ts","../src/composables/use-svg.ts","../src/composables/use-svg-drawable.ts","../src/composables/use-text.ts","../src/composables/use-waapi.ts","../src/composables/use-scope.ts","../src/directives/v-animate.ts","../src/directives/v-draggable.ts","../src/directives/v-svg-drawable.ts","../src/directives/v-waapi.ts","../src/directives/v-text-split.ts"],"sourcesContent":["import { type Ref, type ComponentPublicInstance, type MaybeRef } from \"vue\"\nimport { unrefElement, type MaybeComputedElementRef } from \"@vueuse/core\"\nimport { type TargetsParam } from \"animejs\"\n\n/**\n * Any valid animation target: any Anime.js `TargetsParam` (optionally wrapped in a `Ref`),\n * or a Vue component template ref (`Ref<ComponentPublicInstance>`), whose `.$el` is resolved\n * automatically via `unrefElement`.\n */\nexport type AnimationTargets = MaybeRef<TargetsParam> | Ref<ComponentPublicInstance>\n\n/**\n * Resolves an `AnimationTargets` value to a plain `TargetsParam` suitable for Anime.js.\n * Unwraps `Ref<HTMLElement | SVGElement>` template refs and `Ref<ComponentPublicInstance>`\n * component refs (extracting `.$el`); non-ref values pass through unchanged.\n *\n * @param targets - A raw Anime.js target, a Vue template ref, or a Vue component ref.\n */\nexport function resolveTarget(targets: AnimationTargets): TargetsParam {\n return unrefElement(targets as MaybeComputedElementRef) as TargetsParam\n}","import { type DeepReadonly, type MaybeRef, type ShallowRef, shallowRef, unref, watch, readonly, isRef } from \"vue\"\nimport { type JSAnimation, animate, type TargetsParam, type AnimationParams } from \"animejs\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimateReturn {\n /** The underlying Anime.js animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<JSAnimation | undefined>>\n /** Starts or resumes the animation. */\n play: () => JSAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => JSAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => JSAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => JSAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => JSAnimation | undefined\n /** Resumes from a paused state. */\n resume: () => JSAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => JSAnimation | undefined\n /** Stops the animation and removes it from the Anime.js engine. */\n cancel: () => JSAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => JSAnimation | undefined\n /** Resets the animation to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => JSAnimation | undefined\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => JSAnimation | undefined\n /** Rescales the animation to a new total duration. */\n stretch: (newDuration: number) => JSAnimation | undefined\n /** Re-reads the current values of animated properties from the DOM. */\n refresh: () => JSAnimation | undefined\n}\n\n/**\n * Wraps Anime.js `animate()` into a Vue composable. Reactively re-creates the animation when the target or options change, and cancels it automatically on unmount.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimate(_target: AnimationTargets, _options: MaybeRef<AnimationParams> = {}): UseAnimateReturn {\n const animation = shallowRef<JSAnimation>()\n\n const { stop } = watch(\n [() => resolveTarget(_target), () => unref(_options)],\n ([el, opt]) => {\n createAnimation(el, opt)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function createAnimation(el: TargetsParam, opt: AnimationParams) {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n animation.value = undefined\n return\n }\n\n animation.value = animate(el, opt)\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function resume() {\n return animation.value?.resume()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n function reset(softReset?: boolean) {\n return animation.value?.reset(softReset)\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return animation.value?.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return animation.value?.stretch(newDuration)\n }\n\n function refresh() {\n return animation.value?.refresh()\n }\n\n return {\n animation: readonly(animation),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n cancel,\n revert,\n reset,\n seek,\n stretch,\n refresh,\n }\n}","import { animate, type AnimationParams, type JSAnimation } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\n/** The Anime.js `JSAnimation` instance returned by `useRawAnimate`. */\nexport type UseRawAnimateReturn = JSAnimation\n\n/**\n * Thin wrapper around Anime.js `animate()`. Resolves the target (unwrapping refs and Vue component\n * refs via `.$el`) and immediately starts the animation.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a Vue component ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useRawAnimate(\n _target: AnimationTargets,\n _options: MaybeRef<AnimationParams> = {}\n): UseRawAnimateReturn {\n const target = resolveTarget(_target)\n\n if (!target) {\n console.warn(\"Target is undefined\")\n }\n\n return animate(target, unref(_options))\n}","import { createTimer, type Timer, type TimerParams } from \"animejs\"\nimport { type MaybeRef, type ShallowRef, shallowRef, unref, watch, type DeepReadonly, readonly } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\n\nexport interface UseTimerReturn {\n /** The underlying Anime.js timer instance. */\n timer: DeepReadonly<ShallowRef<Timer>>\n /** Starts or resumes the timer. */\n play: () => Timer\n /** Reverses the timer's playback direction. */\n reverse: () => Timer\n /** Pauses the timer at the current position. */\n pause: () => Timer\n /** Restarts the timer from the beginning. */\n restart: () => Timer\n /** Toggles between forward and reverse direction. */\n alternate: () => Timer\n /** Resumes from a paused state. */\n resume: () => Timer\n /** Jumps immediately to the end of the timer duration. */\n complete: () => Timer\n /** Resets the timer to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timer\n /** Stops the timer and removes it from the Anime.js engine. */\n cancel: () => Timer\n /** Cancels the timer and restores any associated state to its original values. */\n revert: () => Timer\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timer\n /** Rescales the timer to a new total duration. */\n stretch: (newDuration: number) => Timer\n}\n\n/**\n * Wraps Anime.js `createTimer()` into a Vue composable. Reactively re-creates the timer when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timer parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimer(options: MaybeRef<TimerParams> = {}): UseTimerReturn {\n const timer = shallowRef<Timer>(createTimer(unref(options)))\n\n const { stop } = watch(\n () => unref(options),\n options => {\n cancel()\n timer.value = createTimer(options)\n },\n { deep: 1 }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function play() {\n return timer.value.play()\n }\n\n function reverse() {\n return timer.value.reverse()\n }\n\n function pause() {\n return timer.value.pause()\n }\n\n function restart() {\n return timer.value.restart()\n }\n\n function alternate() {\n return timer.value.alternate()\n }\n\n function resume() {\n return timer.value.resume()\n }\n\n function complete() {\n return timer.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timer.value.reset(softReset)\n }\n\n function cancel() {\n return timer.value.cancel()\n }\n\n function revert() {\n return timer.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timer.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timer.value.stretch(newDuration)\n }\n\n return {\n timer: readonly(timer),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n }\n}","import {\n type MaybeRef,\n type MaybeRefOrGetter,\n type ShallowRef,\n shallowRef,\n toValue,\n unref,\n watch,\n type DeepReadonly,\n readonly,\n} from \"vue\"\nimport {\n type AnimationParams,\n type Callback,\n createTimeline,\n type StaggerFunction,\n type Tickable,\n type Timeline,\n type TimelineParams,\n type TimelinePosition,\n type Timer,\n} from \"animejs\"\nimport { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\ntype QueueEntry =\n | {\n type: \"add\"\n targets: AnimationTargets\n params: MaybeRefOrGetter<AnimationParams>\n position?: TimelinePosition | StaggerFunction<number | string>\n }\n | { type: \"set\"; targets: AnimationTargets; params: MaybeRefOrGetter<AnimationParams>; position?: TimelinePosition }\n\nexport type TimelineChain = Timeline & {\n /** Adds an animation to the timeline and returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it, then returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline and returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n}\n\nexport interface UseTimelineReturn {\n /** The underlying Anime.js timeline instance. */\n timeline: DeepReadonly<ShallowRef<Timeline>>\n /** Adds an animation to the timeline. Accepts a template ref or any valid Anime.js target. Returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it. Returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline. Returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n /** Synchronises another tickable (animation, timer) into the timeline at the given position. */\n sync: (synced?: Tickable, position?: TimelinePosition) => Timeline\n /** Adds a named label at a position so it can be referenced by `.add()` or `.seek()`. */\n label: (labelName: string, position?: TimelinePosition) => Timeline\n /** Inserts a callback function at a specific point in the timeline. */\n call: (callback: Callback<Timer>, position?: TimelinePosition) => Timeline\n /** Renders the timeline once without playing it. */\n init: (internalRender?: boolean) => Timeline\n /** Starts or resumes the timeline. */\n play: () => Timeline\n /** Reverses playback direction. */\n reverse: () => Timeline\n /** Pauses the timeline at the current position. */\n pause: () => Timeline\n /** Restarts the timeline from the beginning. */\n restart: () => Timeline\n /** Toggles between forward and reverse direction. */\n alternate: () => Timeline\n /** Resumes from a paused state. */\n resume: () => Timeline\n /** Jumps immediately to the end of the timeline. */\n complete: () => Timeline\n /** Resets the timeline to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timeline\n /** Stops the timeline and removes it from the Anime.js engine. */\n cancel: () => Timeline\n /** Cancels the timeline and restores all animated properties to their original values. */\n revert: () => Timeline\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timeline\n /** Rescales the timeline to a new total duration. */\n stretch: (newDuration: number) => Timeline\n /** Re-reads the current values of all animated properties from the DOM. */\n refresh: () => Timeline\n}\n\n/**\n * Wraps Anime.js `createTimeline()` into a Vue composable. Reactively re-creates the timeline when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timeline parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimeline(options: MaybeRef<TimelineParams> = {}): UseTimelineReturn {\n let is_mounted = false\n\n const queue: QueueEntry[] = []\n\n const timeline = shallowRef<Timeline>(createTimeline(unref(options)))\n\n function replayQueue() {\n for (const entry of queue) {\n if (entry.type === \"add\") {\n timeline.value.add(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n } else {\n timeline.value.set(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n }\n }\n }\n\n const { stop } = watch(\n () => unref(options),\n _options => {\n revert()\n timeline.value = createTimeline(_options)\n replayQueue()\n },\n { flush: \"post\", deep: 1 }\n )\n\n tryOnMounted(() => {\n is_mounted = true\n replayQueue()\n })\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function add(\n targets: AnimationTargets,\n _params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) {\n queue.push({ type: \"add\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.add(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function set(targets: AnimationTargets, _params: MaybeRefOrGetter<AnimationParams>, position?: TimelinePosition) {\n queue.push({ type: \"set\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.set(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function remove(targets: AnimationTargets, propertyName?: string) {\n if (!is_mounted) {\n console.warn(\"Cannot remove from timeline before mount\")\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n return { ...timeline.value.remove(resolveTarget(targets), propertyName), add, set, remove } as TimelineChain\n }\n\n function sync(synced?: Tickable, position?: TimelinePosition) {\n return timeline.value.sync(synced, position)\n }\n\n function label(labelName: string, position?: TimelinePosition) {\n return timeline.value.label(labelName, position)\n }\n\n function call(callback: Callback<Timer>, position?: TimelinePosition) {\n return timeline.value.call(callback, position)\n }\n\n function init(internalRender?: boolean) {\n return timeline.value.init(internalRender)\n }\n\n function play() {\n return timeline.value.play()\n }\n\n function reverse() {\n return timeline.value.reverse()\n }\n\n function pause() {\n return timeline.value.pause()\n }\n\n function restart() {\n return timeline.value.restart()\n }\n\n function alternate() {\n return timeline.value.alternate()\n }\n\n function resume() {\n return timeline.value.resume()\n }\n\n function complete() {\n return timeline.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timeline.value.reset(softReset)\n }\n\n function cancel() {\n return timeline.value.cancel()\n }\n\n function revert() {\n return timeline.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timeline.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timeline.value.stretch(newDuration)\n }\n\n function refresh() {\n return timeline.value.refresh()\n }\n\n return {\n timeline: readonly(timeline),\n add,\n set,\n sync,\n label,\n remove,\n call,\n init,\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n refresh,\n }\n}","import { type AnimatableObject, type AnimatableParams, createAnimatable, type TargetsParam } from \"animejs\"\nimport {\n computed,\n type DeepReadonly,\n isRef,\n type MaybeRef,\n readonly,\n type ShallowRef,\n shallowRef,\n unref,\n watch,\n} from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimatableReturn {\n /** The underlying Anime.js animatable instance. `undefined` until the target is available. */\n animatable: DeepReadonly<ShallowRef<AnimatableObject | undefined>>\n /** Cancels the animatable and restores all animated properties to their original values. */\n revert: () => AnimatableObject | undefined\n}\n\n/**\n * Wraps Anime.js `createAnimatable()` into a Vue composable. Reactively re-creates the animatable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make animatable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js animatable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimatable(\n targets: AnimationTargets,\n options: MaybeRef<AnimatableParams> = {}\n): UseAnimatableReturn {\n const animatable = shallowRef<AnimatableObject>()\n\n const watch_target = computed<{ el: TargetsParam; opt: AnimatableParams }>(() => ({\n el: resolveTarget(targets),\n opt: unref(options),\n }))\n\n const { stop } = watch(\n watch_target,\n ({ el, opt }) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n animatable.value = undefined\n return\n }\n\n animatable.value = createAnimatable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n revert()\n })\n\n function revert() {\n return animatable.value?.revert()\n }\n\n return { animatable: readonly(animatable), revert }\n}","import { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type Draggable, type DraggableParams, createDraggable, type EasingParam } from \"animejs\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseDraggableReturn {\n /** The underlying Anime.js draggable instance. `undefined` until the target is available. */\n draggable: DeepReadonly<ShallowRef<Draggable | undefined>>\n /** Disables drag interactions without destroying the instance. */\n disable: () => void\n /** Re-enables drag interactions after `disable()`. */\n enable: () => void\n /** Moves the draggable to the given x position. Pass `true` to suppress the update callback. */\n setX: (x: number, muteUpdateCallback?: boolean) => void\n /** Moves the draggable to the given y position. Pass `true` to suppress the update callback. */\n setY: (y: number, muteUpdateCallback?: boolean) => void\n /** Animates the draggable into the visible viewport. */\n animateInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Scrolls the draggable into the visible viewport. */\n scrollInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Stops any in-progress snap or momentum animation. */\n stop: () => void\n /** Resets the draggable position to its initial state. */\n reset: () => void\n /** Cancels the draggable and restores the element to its original state. */\n revert: () => void\n /** Re-reads the element's size and container bounds. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createDraggable()` into a Vue composable. Reactively re-creates the draggable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make draggable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js draggable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useDraggable(targets: AnimationTargets, options: MaybeRef<DraggableParams> = {}): UseDraggableReturn {\n const draggable = shallowRef<Draggable>()\n\n const { stop: stopWatch } = watch(\n [() => resolveTarget(targets), () => unref(options)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n draggable.value = undefined\n return\n }\n\n draggable.value = createDraggable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stopWatch()\n })\n\n function disable() {\n return draggable.value?.disable()\n }\n\n function enable() {\n return draggable.value?.enable()\n }\n\n function setX(x: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setX(x, muteUpdateCallback)\n }\n\n function setY(y: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setY(y, muteUpdateCallback)\n }\n\n function animateInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.animateInView(duration, gap, ease)\n }\n\n function scrollInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.scrollInView(duration, gap, ease)\n }\n\n function stop() {\n return draggable.value?.stop()\n }\n\n function reset() {\n return draggable.value?.reset()\n }\n\n function revert() {\n return draggable.value?.revert()\n }\n\n function refresh() {\n return draggable.value?.refresh()\n }\n\n return {\n draggable: readonly(draggable),\n disable,\n enable,\n setX,\n setY,\n animateInView,\n scrollInView,\n stop,\n reset,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type AutoLayout,\n type AutoLayoutParams,\n createLayout,\n type DOMTargetSelector,\n type LayoutAnimationParams,\n type Timeline,\n} from \"animejs\"\nimport { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseLayoutReturn {\n /** The underlying Anime.js `AutoLayout` instance. `undefined` until the root element is available. */\n layout: DeepReadonly<ShallowRef<AutoLayout | undefined>>\n /** Snapshots the current positions of all tracked children so the next layout change can be animated. */\n record: () => void\n /** Animates all children from their recorded positions to their new positions. */\n animate: (params?: LayoutAnimationParams) => Timeline | undefined\n /** Records, applies the callback (which triggers a layout change), then animates the transition. */\n update: (callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) => void\n /** Cancels the layout watcher and restores all elements to their original state. */\n revert: () => void\n}\n\n/**\n * Wraps Anime.js `createLayout()` into a Vue composable. Reactively re-creates the layout observer when the root element or params change, and reverts it automatically on unmount.\n *\n * @param root - The container element whose children will be tracked. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param params - Anime.js auto-layout parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useLayout(\n root: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n params: MaybeRef<AutoLayoutParams> = {}\n): UseLayoutReturn {\n const layout = shallowRef<AutoLayout | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(root as AnimationTargets), () => unref(params)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n layout.value = undefined\n return\n }\n\n layout.value = createLayout(el as DOMTargetSelector, opt)\n },\n { flush: \"post\", immediate: !isRef(root) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stop()\n })\n\n function record() {\n return layout.value?.record()\n }\n\n function animate(params?: LayoutAnimationParams) {\n return layout.value?.animate(params)\n }\n\n function update(callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) {\n return layout.value?.update(callback, params)\n }\n\n function revert() {\n return layout.value?.revert()\n }\n\n return { layout: readonly(layout), record, animate, update, revert }\n}","import { svg, type FunctionValue, type TargetsParam } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\n\nexport interface UseSvgReturn {\n /** Returns a `FunctionValue` that morphs the current path to the given `path`. Pass the result as the `d` property in `useAnimate` options. */\n morphTo: (path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) => FunctionValue\n /** Creates a motion-path object from an SVG `<path>`. Spread the result into `useAnimate` options to animate `translateX`, `translateY`, and `rotate` along the path. */\n createMotionPath: (\n path: MaybeRef<TargetsParam | null>,\n offset?: MaybeRef<number>\n ) => ReturnType<typeof svg.createMotionPath>\n}\n\n/**\n * Exposes Anime.js SVG utilities (`svg.morphTo`, `svg.createMotionPath`) as a Vue composable, automatically unwrapping reactive refs passed to each helper.\n *\n * For drawable stroke animations, use `useSvgDrawable` instead.\n */\nexport function useSvg(): UseSvgReturn {\n function morphTo(_path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) {\n const path = unref(_path)\n\n if (!path) return () => \"\"\n\n return svg.morphTo(unref(path), unref(precision))\n }\n\n function createMotionPath(path: MaybeRef<TargetsParam | null>, offset?: MaybeRef<number>) {\n const resolved = unref(path) ?? \"\"\n return svg.createMotionPath(resolved, unref(offset))\n }\n\n return {\n morphTo,\n createMotionPath,\n }\n}","import { svg, type DrawableSVGGeometry, type DOMTargetSelector } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { isRef, type MaybeRef, readonly, type DeepReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseSvgDrawableReturn {\n /**\n * The Anime.js drawable Proxy for the target element. `undefined` until the element is available.\n * Pass this ref — not the original template ref — as the `useAnimate` target to animate the `draw` property.\n */\n drawable: DeepReadonly<ShallowRef<DrawableSVGGeometry | undefined>>\n}\n\n/**\n * Wraps an SVG geometry element in Anime.js's drawable Proxy. The proxy intercepts `setAttribute('draw', …)` calls and translates normalised `draw` values (`0`–`1`) into the correct `stroke-dasharray` / `stroke-dashoffset` updates. Pass the returned `drawable` ref as the target to `useAnimate`.\n *\n * @param target - The SVG element to make drawable. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param start - Initial draw start position (`0`–`1`). Defaults to `0`.\n * @param end - Initial draw end position (`0`–`1`). Defaults to `0` (fully hidden).\n */\nexport function useSvgDrawable(\n target: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n start: MaybeRef<number> = 0,\n end: MaybeRef<number> = 0\n): UseSvgDrawableReturn {\n const drawable = shallowRef<DrawableSVGGeometry | undefined>()\n\n const { stop } = watch(\n () => resolveTarget(target as AnimationTargets),\n el => {\n drawable.value = undefined\n if (!el) {\n console.warn(\"[useSvgDrawable] Target element is null or undefined\")\n return\n }\n drawable.value = svg.createDrawable(el as DOMTargetSelector, unref(start), unref(end))[0]\n },\n { flush: \"post\", immediate: !isRef(target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n drawable.value = undefined\n })\n\n return { drawable: readonly(drawable) }\n}","import { splitText, type TextSplitter, type TextSplitterParams } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n computed,\n isRef,\n readonly,\n shallowRef,\n unref,\n watch,\n type ComputedRef,\n type DeepReadonly,\n type MaybeRef,\n type ShallowRef,\n} from \"vue\"\n\nexport interface UseTextReturn {\n /** The underlying Anime.js `TextSplitter` instance. `undefined` until the target is available. */\n splitter: DeepReadonly<ShallowRef<TextSplitter | undefined>>\n /** Reactive array of `<span>` elements representing each line after splitting. */\n lines: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each word after splitting. */\n words: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each character after splitting. */\n chars: ComputedRef<HTMLElement[]>\n /** Removes all split `<span>` wrappers and restores the original text content. */\n revert: () => void\n /** Re-splits the text, updating `lines`, `words`, and `chars` to reflect any DOM or size changes. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `splitText()` into a Vue composable. Reactively re-splits the text when the target or params change, and reverts the DOM automatically on unmount.\n *\n * @param _target - The element(s) whose text content should be split. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _params - Anime.js text-splitter parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useText(\n _target: MaybeRef<HTMLElement | NodeList | string | HTMLElement[]> | MaybeComputedElementRef,\n _params?: MaybeRef<TextSplitterParams>\n): UseTextReturn {\n const splitter = shallowRef<TextSplitter | undefined>()\n\n const lines = computed<HTMLElement[]>(() => splitter.value?.lines ?? [])\n const words = computed<HTMLElement[]>(() => splitter.value?.words ?? [])\n const chars = computed<HTMLElement[]>(() => splitter.value?.chars ?? [])\n\n const { stop } = watch(\n [() => resolveTarget(_target as AnimationTargets), () => unref(_params)],\n ([el, params]) => {\n revert()\n splitter.value = undefined\n\n if (!el) return\n\n splitter.value = splitText(el as HTMLElement | NodeList | string | HTMLElement[], params)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n splitter.value = undefined\n revert()\n })\n\n function revert() {\n splitter.value?.revert()\n }\n\n function refresh() {\n splitter.value?.refresh()\n }\n\n return {\n splitter: readonly(splitter),\n lines,\n words,\n chars,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type WAAPIAnimationParams,\n type DOMTargetsParam,\n waapi,\n type WAAPIAnimation,\n type EasingFunction,\n} from \"animejs\"\nimport { DeepReadonly, isRef, type MaybeRef, readonly, ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseWaapiReturn {\n /** The underlying Anime.js WAAPI animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<WAAPIAnimation | undefined>>\n /** Resumes from a paused state. */\n resume: () => WAAPIAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => WAAPIAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => WAAPIAnimation | undefined\n /** Starts or resumes the animation. */\n play: () => WAAPIAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => WAAPIAnimation | undefined\n /** Seeks to a specific time (in ms). Accepts a reactive ref for the time value. */\n seek: (time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) => WAAPIAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => WAAPIAnimation | undefined\n /** Commits the current animated styles to the element's inline style, then cancels the animation. */\n commitStyles: () => WAAPIAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => WAAPIAnimation | undefined\n /** Stops the animation and removes it from the WAAPI engine. */\n cancel: () => WAAPIAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => WAAPIAnimation | undefined\n /** Converts an Anime.js easing function to a CSS `cubic-bezier()` string usable by WAAPI. */\n convertEase: (fn: MaybeRef<EasingFunction>, samples?: MaybeRef<number>) => string\n}\n\n/**\n * Wraps Anime.js `waapi.animate()` into a Vue composable. Reactively re-creates the WAAPI animation when the target or options change, and stops it automatically on unmount.\n *\n * @param targets - The DOM element(s) to animate via WAAPI. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js WAAPI animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useWaapi(\n targets: MaybeRef<DOMTargetsParam> | MaybeComputedElementRef,\n options: MaybeRef<WAAPIAnimationParams> = {}\n): UseWaapiReturn {\n const animation = shallowRef<WAAPIAnimation | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(targets as AnimationTargets), () => unref(options)],\n ([el, opt]) => {\n animation.value = waapi.animate(el as DOMTargetsParam, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n })\n\n function resume() {\n return animation.value?.resume()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function seek(time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) {\n return animation.value?.seek(unref(time), unref(muteCallbacks))\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function commitStyles() {\n return animation.value?.commitStyles()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n return {\n animation: readonly(animation),\n resume,\n pause,\n alternate,\n play,\n reverse,\n seek,\n restart,\n commitStyles,\n complete,\n cancel,\n revert,\n\n convertEase,\n }\n}\n\nfunction convertEase(fn: MaybeRef<EasingFunction>, samples: MaybeRef<number> = 100) {\n return waapi.convertEase(unref(fn), unref(samples))\n}","import { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { createScope, type Scope, type ScopeMethod, type ScopeParams, type Tickable } from \"animejs\"\nimport { isRef, type MaybeRef, shallowReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseScopeReturn {\n /** The underlying Anime.js `Scope` instance. */\n scope: Readonly<ShallowRef<Scope | undefined>>\n /** Registers an anonymous method on the scope. Queued automatically if called before mount. */\n add: (method: ScopeMethod) => void\n /** Registers a named method on the scope so it can be called via `scope.methods[name]()`. Queued automatically if called before mount. */\n registerMethod: (methodName: string, method: ScopeMethod) => void\n /** Registers a method that runs exactly once on the scope. Queued automatically if called before mount. */\n addOnce: (method: ScopeMethod) => void\n /** Keeps the time of another tickable (animation, timer) in sync with this scope. */\n keepTime: (method: (scope: Scope) => Tickable) => void\n /** Cancels the scope and reverts all animations and tickables it owns. */\n revert: () => void\n /** Re-reads default values and media-query breakpoints for the scope. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createScope()` into a Vue composable. Reactively re-creates the scope when params change, replays all registered methods, and reverts it automatically on unmount.\n *\n * Methods added before mount are queued and replayed once the component is mounted.\n *\n * @param params - Anime.js scope parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useScope(params: MaybeRef<ScopeParams>): UseScopeReturn {\n const scope = shallowRef<Scope | undefined>(undefined)\n\n const pending_adds: ScopeMethod[] = []\n const pending_named: [string, ScopeMethod][] = []\n const pending_once: ScopeMethod[] = []\n\n let is_mounted = false\n let stopWatcher: (() => void) | undefined\n\n tryOnMounted(() => {\n is_mounted = true\n scope.value = createScope(unref(params))\n\n for (const method of pending_adds) scope.value.add(method)\n for (const [name, method] of pending_named) scope.value.add(name, method)\n for (const method of pending_once) scope.value.addOnce(method)\n\n pending_adds.length = 0\n pending_named.length = 0\n pending_once.length = 0\n\n if (isRef(params)) {\n stopWatcher = watch(\n params,\n new_params => {\n scope.value?.revert()\n scope.value = createScope(new_params)\n },\n { flush: \"post\" }\n )\n }\n })\n\n tryOnUnmounted(() => {\n scope.value?.revert()\n stopWatcher?.()\n })\n\n function add(method: ScopeMethod) {\n if (!is_mounted) return void pending_adds.push(method)\n return scope.value?.add(method)\n }\n\n function registerMethod(methodName: string, method: ScopeMethod) {\n if (!is_mounted) return void pending_named.push([methodName, method])\n return scope.value?.add(methodName, method)\n }\n\n function addOnce(method: ScopeMethod) {\n if (!is_mounted) return void pending_once.push(method)\n return scope.value?.addOnce(method)\n }\n\n function keepTime(method: (scope: Scope) => Tickable) {\n return scope.value?.keepTime(method)\n }\n\n function revert() {\n return scope.value?.revert()\n }\n\n function refresh() {\n return scope.value?.refresh()\n }\n\n return {\n scope: shallowReadonly(scope),\n add,\n registerMethod,\n addOnce,\n keepTime,\n revert,\n refresh,\n }\n}","import { animate, type AnimationParams, type JSAnimation } from \"animejs\"\nimport type { Directive } from \"vue\"\n\nconst instances = new WeakMap<HTMLElement, JSAnimation>()\n\n/**\n * Declarative animation directive. Applies an Anime.js animation to the element on mount,\n * re-creates it when the binding value changes, and reverts it on unmount.\n *\n * @example\n * <div v-animate=\"{ translateX: 250, duration: 800 }\" />\n * <div v-animate=\"reactiveOptions\" />\n */\nexport const vAnimate: Directive<HTMLElement, AnimationParams> = {\n mounted(el, binding) {\n if (binding.value) instances.set(el, animate(el, binding.value))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const prev = instances.get(el)\n prev?.cancel()\n prev?.revert()\n\n if (binding.value) instances.set(el, animate(el, binding.value))\n },\n unmounted(el) {\n const animation = instances.get(el)\n animation?.cancel()\n animation?.revert()\n instances.delete(el)\n },\n}","import { createDraggable, type Draggable, type DraggableParams } from \"animejs\"\nimport type { Directive } from \"vue\"\n\nconst instances = new WeakMap<HTMLElement, Draggable>()\n\n/**\n * Declarative draggable directive. Makes the element draggable on mount,\n * re-creates it when the binding value changes, and reverts it on unmount.\n *\n * @example\n * <div v-draggable />\n * <div v-draggable=\"{ snap: [0, 100] }\" />\n */\nexport const vDraggable: Directive<HTMLElement, DraggableParams | undefined> = {\n mounted(el, binding) {\n instances.set(el, createDraggable(el, binding.value ?? {}))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n instances.get(el)?.revert()\n instances.set(el, createDraggable(el, binding.value ?? {}))\n },\n unmounted(el) {\n instances.get(el)?.revert()\n instances.delete(el)\n },\n}","import { animate, svg, type AnimationParams, type DrawableSVGGeometry, type JSAnimation } from \"animejs\"\nimport type { Directive } from \"vue\"\n\ninterface Entry {\n drawable: DrawableSVGGeometry\n animation: JSAnimation | undefined\n}\n\nconst instances = new WeakMap<SVGGeometryElement, Entry>()\n\nfunction create(el: SVGGeometryElement, params: AnimationParams | undefined): Entry {\n const drawable = svg.createDrawable(el)[0]\n const animation = params ? animate(drawable, params) : undefined\n return { drawable, animation }\n}\n\n/**\n * Declarative SVG drawable directive. Wraps the SVG geometry element in an Anime.js drawable\n * Proxy and animates the `draw` property on mount. Re-creates it when the binding value changes\n * and reverts on unmount.\n *\n * @example\n * <path v-svg-drawable=\"{ draw: '0 1', duration: 1200 }\" />\n * <path v-svg-drawable=\"{ draw: ['0 0', '0.5 1', '0 1'], ease: 'inOutQuad', loop: true }\" />\n */\nexport const vSvgDrawable: Directive<SVGGeometryElement, AnimationParams | undefined> = {\n mounted(el, binding) {\n instances.set(el, create(el, binding.value))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const entry = instances.get(el)\n entry?.animation?.cancel()\n entry?.animation?.revert()\n instances.set(el, create(el, binding.value))\n },\n unmounted(el) {\n const entry = instances.get(el)\n entry?.animation?.cancel()\n entry?.animation?.revert()\n instances.delete(el)\n },\n}","import { waapi, type WAAPIAnimationParams, type WAAPIAnimation } from \"animejs\"\nimport type { Directive } from \"vue\"\n\ninterface Entry {\n animation: WAAPIAnimation\n originalStyle: string\n}\n\nconst instances = new WeakMap<HTMLElement, Entry>()\n\n/**\n * Declarative WAAPI animation directive. Applies an Anime.js WAAPI animation to the element on\n * mount, re-creates it when the binding value changes, and reverts it on unmount.\n *\n * @example\n * <div v-waapi=\"{ translateX: 250, duration: 800 }\" />\n * <div v-waapi=\"reactiveOptions\" />\n */\nexport const vWaapi: Directive<HTMLElement, WAAPIAnimationParams> = {\n mounted(el, binding) {\n if (binding.value) {\n instances.set(el, {\n animation: waapi.animate(el, binding.value),\n originalStyle: el.style.cssText,\n })\n }\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const entry = instances.get(el)\n if (entry) {\n entry.animation.cancel()\n el.style.cssText = entry.originalStyle\n instances.delete(el)\n }\n\n if (binding.value) {\n instances.set(el, {\n animation: waapi.animate(el, binding.value),\n originalStyle: el.style.cssText,\n })\n }\n },\n unmounted(el) {\n const entry = instances.get(el)\n if (entry) {\n entry.animation.cancel()\n el.style.cssText = entry.originalStyle\n instances.delete(el)\n }\n },\n}","import {\n animate,\n splitText,\n type AnimationParams,\n type JSAnimation,\n type TextSplitter,\n type TextSplitterParams,\n} from \"animejs\"\nimport type { Directive } from \"vue\"\n\nexport interface VTextSplitValue extends TextSplitterParams {\n animation?: AnimationParams\n}\n\ninterface Entry {\n splitter: TextSplitter\n animation: JSAnimation | undefined\n}\n\nconst instances = new WeakMap<HTMLElement, Entry>()\n\nfunction create(el: HTMLElement, value: VTextSplitValue | undefined): Entry {\n const { animation: anim_params, ...splitter_params } = value ?? {}\n const splitter = splitText(el, splitter_params)\n const entry: Entry = { splitter, animation: undefined }\n\n if (anim_params) {\n if (splitter_params.lines) {\n // Line detection waits for document.fonts.ready — defer animation until splitter.lines is populated.\n ;(document.fonts?.ready ?? Promise.resolve()).then(() => {\n if (instances.get(el) === entry) {\n entry.animation = animate(splitter.lines, anim_params)\n }\n })\n } else {\n const targets = splitter_params.chars ? splitter.chars : splitter.words\n entry.animation = animate(targets, anim_params)\n }\n }\n\n return entry\n}\n\nfunction destroy(entry: Entry) {\n entry.animation?.cancel()\n entry.splitter.revert()\n}\n\n/**\n * Declarative text-split directive. Splits the element's text into chars, words, or lines on\n * mount, and optionally animates the resulting spans. Re-creates on binding change, reverts on unmount.\n *\n * @example\n * <p v-text-split=\"{ words: true, animation: { translateY: [20, 0], opacity: [0, 1], delay: stagger(60) } }\">Hello</p>\n * <p v-text-split=\"{ chars: true, animation: { opacity: [0, 1], delay: stagger(30) } }\">Hello</p>\n * <p v-text-split=\"{ lines: true, animation: { translateX: [-20, 0], delay: stagger(100) } }\">Hello</p>\n */\nexport const vTextSplit: Directive<HTMLElement, VTextSplitValue | undefined> = {\n mounted(el, binding) {\n instances.set(el, create(el, binding.value))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const entry = instances.get(el)\n if (entry) destroy(entry)\n instances.set(el, create(el, binding.value))\n },\n unmounted(el) {\n const entry = instances.get(el)\n if (entry) destroy(entry)\n instances.delete(el)\n },\n}"],"mappings":"uIAkBA,SAAgB,EAAc,EAAyC,CACrE,OAAA,EAAA,EAAA,cAAoB,EAAmC,CCuBzD,SAAgB,EAAW,EAA2B,EAAsC,EAAE,CAAoB,CAChH,IAAM,GAAA,EAAA,EAAA,aAAqC,CAErC,CAAE,SAAA,EAAA,EAAA,OACN,KAAO,EAAc,EAAQ,MAAA,EAAA,EAAA,OAAc,EAAS,CAAC,EACpD,CAAC,EAAI,KAAS,CACb,EAAgB,EAAI,EAAI,EAE1B,CAAE,MAAO,OAAQ,UAAW,EAAA,EAAA,EAAA,OAAO,EAAQ,CAAE,CAC9C,EAED,EAAA,EAAA,oBAAqB,CACnB,GAAM,CACN,GAAQ,EACR,CAEF,SAAS,EAAgB,EAAkB,EAAsB,CAG/D,GAFA,GAAQ,CAEJ,CAAC,EAAI,CACP,QAAQ,KAAK,sCAAsC,CACnD,EAAU,MAAQ,IAAA,GAClB,OAGF,EAAU,OAAA,EAAA,EAAA,SAAgB,EAAI,EAAI,CAGpC,SAAS,GAAO,CACd,OAAO,EAAU,OAAO,MAAM,CAGhC,SAAS,GAAU,CACjB,OAAO,EAAU,OAAO,SAAS,CAGnC,SAAS,GAAQ,CACf,OAAO,EAAU,OAAO,OAAO,CAGjC,SAAS,GAAU,CACjB,OAAO,EAAU,OAAO,SAAS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ACF,EAAM,UAAU,QAAQ,CACxB,EAAG,MAAM,QAAU,EAAM,cACzB,EAAU,OAAO,EAAG,IC7BpB,EAAY,IAAI,QAEtB,SAAS,EAAO,EAAiB,EAA2C,CAC1E,GAAM,CAAE,UAAW,EAAa,GAAG,GAAoB,GAAS,EAAE,CAC5D,GAAA,EAAA,EAAA,WAAqB,EAAI,EAAgB,CACzC,EAAe,CAAE,WAAU,UAAW,IAAA,GAAW,CAgBvD,OAdI,IACE,EAAgB,OAEhB,SAAS,OAAO,OAAS,QAAQ,SAAS,EAAE,SAAW,CACnD,EAAU,IAAI,EAAG,GAAK,IACxB,EAAM,WAAA,EAAA,EAAA,SAAoB,EAAS,MAAO,EAAY,GAExD,CAGF,EAAM,WAAA,EAAA,EAAA,SADU,EAAgB,MAAQ,EAAS,MAAQ,EAAS,MAC/B,EAAY,EAI5C,EAGT,SAAS,EAAQ,EAAc,CAC7B,EAAM,WAAW,QAAQ,CACzB,EAAM,SAAS,QAAQ,CAYzB,IAAa,EAAkE,CAC7E,QAAQ,EAAI,EAAS,CACnB,EAAU,IAAI,EAAI,EAAO,EAAI,EAAQ,MAAM,CAAC,EAE9C,QAAQ,EAAI,EAAS,CACnB,GAAI,EAAQ,QAAU,EAAQ,SAAU,OACxC,IAAM,EAAQ,EAAU,IAAI,EAAG,CAC3B,GAAO,EAAQ,EAAM,CACzB,EAAU,IAAI,EAAI,EAAO,EAAI,EAAQ,MAAM,CAAC,EAE9C,UAAU,EAAI,CACZ,IAAM,EAAQ,EAAU,IAAI,EAAG,CAC3B,GAAO,EAAQ,EAAM,CACzB,EAAU,OAAO,EAAG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,9 @@ export { useSvgDrawable, type UseSvgDrawableReturn } from "./composables/use-svg
|
|
|
10
10
|
export { useText, type UseTextReturn } from "./composables/use-text.ts";
|
|
11
11
|
export { useWaapi, type UseWaapiReturn } from "./composables/use-waapi.ts";
|
|
12
12
|
export { useScope, type UseScopeReturn } from "./composables/use-scope.ts";
|
|
13
|
+
export { vAnimate } from "./directives/v-animate.ts";
|
|
14
|
+
export { vDraggable } from "./directives/v-draggable.ts";
|
|
15
|
+
export { vSvgDrawable } from "./directives/v-svg-drawable.ts";
|
|
16
|
+
export { vWaapi } from "./directives/v-waapi.ts";
|
|
17
|
+
export { vTextSplit, type VTextSplitValue } from "./directives/v-text-split.ts";
|
|
13
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC1F,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACvG,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACtF,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,E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,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -580,6 +580,98 @@ function P(e) {
|
|
|
580
580
|
};
|
|
581
581
|
}
|
|
582
582
|
//#endregion
|
|
583
|
-
|
|
583
|
+
//#region src/directives/v-animate.ts
|
|
584
|
+
var F = /* @__PURE__ */ new WeakMap(), I = {
|
|
585
|
+
mounted(e, t) {
|
|
586
|
+
t.value && F.set(e, c(e, t.value));
|
|
587
|
+
},
|
|
588
|
+
updated(e, t) {
|
|
589
|
+
if (t.value === t.oldValue) return;
|
|
590
|
+
let n = F.get(e);
|
|
591
|
+
n?.cancel(), n?.revert(), t.value && F.set(e, c(e, t.value));
|
|
592
|
+
},
|
|
593
|
+
unmounted(e) {
|
|
594
|
+
let t = F.get(e);
|
|
595
|
+
t?.cancel(), t?.revert(), F.delete(e);
|
|
596
|
+
}
|
|
597
|
+
}, L = /* @__PURE__ */ new WeakMap(), R = {
|
|
598
|
+
mounted(e, t) {
|
|
599
|
+
L.set(e, u(e, t.value ?? {}));
|
|
600
|
+
},
|
|
601
|
+
updated(e, t) {
|
|
602
|
+
t.value !== t.oldValue && (L.get(e)?.revert(), L.set(e, u(e, t.value ?? {})));
|
|
603
|
+
},
|
|
604
|
+
unmounted(e) {
|
|
605
|
+
L.get(e)?.revert(), L.delete(e);
|
|
606
|
+
}
|
|
607
|
+
}, z = /* @__PURE__ */ new WeakMap();
|
|
608
|
+
function B(e, t) {
|
|
609
|
+
let n = g.createDrawable(e)[0];
|
|
610
|
+
return {
|
|
611
|
+
drawable: n,
|
|
612
|
+
animation: t ? c(n, t) : void 0
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
var V = {
|
|
616
|
+
mounted(e, t) {
|
|
617
|
+
z.set(e, B(e, t.value));
|
|
618
|
+
},
|
|
619
|
+
updated(e, t) {
|
|
620
|
+
if (t.value === t.oldValue) return;
|
|
621
|
+
let n = z.get(e);
|
|
622
|
+
n?.animation?.cancel(), n?.animation?.revert(), z.set(e, B(e, t.value));
|
|
623
|
+
},
|
|
624
|
+
unmounted(e) {
|
|
625
|
+
let t = z.get(e);
|
|
626
|
+
t?.animation?.cancel(), t?.animation?.revert(), z.delete(e);
|
|
627
|
+
}
|
|
628
|
+
}, H = /* @__PURE__ */ new WeakMap(), U = {
|
|
629
|
+
mounted(e, t) {
|
|
630
|
+
t.value && H.set(e, {
|
|
631
|
+
animation: _.animate(e, t.value),
|
|
632
|
+
originalStyle: e.style.cssText
|
|
633
|
+
});
|
|
634
|
+
},
|
|
635
|
+
updated(e, t) {
|
|
636
|
+
if (t.value === t.oldValue) return;
|
|
637
|
+
let n = H.get(e);
|
|
638
|
+
n && (n.animation.cancel(), e.style.cssText = n.originalStyle, H.delete(e)), t.value && H.set(e, {
|
|
639
|
+
animation: _.animate(e, t.value),
|
|
640
|
+
originalStyle: e.style.cssText
|
|
641
|
+
});
|
|
642
|
+
},
|
|
643
|
+
unmounted(e) {
|
|
644
|
+
let t = H.get(e);
|
|
645
|
+
t && (t.animation.cancel(), e.style.cssText = t.originalStyle, H.delete(e));
|
|
646
|
+
}
|
|
647
|
+
}, W = /* @__PURE__ */ new WeakMap();
|
|
648
|
+
function G(e, t) {
|
|
649
|
+
let { animation: n, ...r } = t ?? {}, i = h(e, r), a = {
|
|
650
|
+
splitter: i,
|
|
651
|
+
animation: void 0
|
|
652
|
+
};
|
|
653
|
+
return n && (r.lines ? (document.fonts?.ready ?? Promise.resolve()).then(() => {
|
|
654
|
+
W.get(e) === a && (a.animation = c(i.lines, n));
|
|
655
|
+
}) : a.animation = c(r.chars ? i.chars : i.words, n)), a;
|
|
656
|
+
}
|
|
657
|
+
function K(e) {
|
|
658
|
+
e.animation?.cancel(), e.splitter.revert();
|
|
659
|
+
}
|
|
660
|
+
var q = {
|
|
661
|
+
mounted(e, t) {
|
|
662
|
+
W.set(e, G(e, t.value));
|
|
663
|
+
},
|
|
664
|
+
updated(e, t) {
|
|
665
|
+
if (t.value === t.oldValue) return;
|
|
666
|
+
let n = W.get(e);
|
|
667
|
+
n && K(n), W.set(e, G(e, t.value));
|
|
668
|
+
},
|
|
669
|
+
unmounted(e) {
|
|
670
|
+
let t = W.get(e);
|
|
671
|
+
t && K(t), W.delete(e);
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
//#endregion
|
|
675
|
+
export { E as useAnimatable, S as useAnimate, D as useDraggable, O as useLayout, C as useRawAnimate, P as useScope, k as useSvg, A as useSvgDrawable, j as useText, T as useTimeline, w as useTimer, M as useWaapi, I as vAnimate, R as vDraggable, V as vSvgDrawable, q as vTextSplit, U as vWaapi };
|
|
584
676
|
|
|
585
677
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/utils/resolve-target.ts","../src/composables/use-animate.ts","../src/composables/use-raw-animate.ts","../src/composables/use-timer.ts","../src/composables/use-timeline.ts","../src/composables/use-animatable.ts","../src/composables/use-draggable.ts","../src/composables/use-layout.ts","../src/composables/use-svg.ts","../src/composables/use-svg-drawable.ts","../src/composables/use-text.ts","../src/composables/use-waapi.ts","../src/composables/use-scope.ts"],"sourcesContent":["import { type Ref, type ComponentPublicInstance, type MaybeRef } from \"vue\"\nimport { unrefElement, type MaybeComputedElementRef } from \"@vueuse/core\"\nimport { type TargetsParam } from \"animejs\"\n\n/**\n * Any valid animation target: any Anime.js `TargetsParam` (optionally wrapped in a `Ref`),\n * or a Vue component template ref (`Ref<ComponentPublicInstance>`), whose `.$el` is resolved\n * automatically via `unrefElement`.\n */\nexport type AnimationTargets = MaybeRef<TargetsParam> | Ref<ComponentPublicInstance>\n\n/**\n * Resolves an `AnimationTargets` value to a plain `TargetsParam` suitable for Anime.js.\n * Unwraps `Ref<HTMLElement | SVGElement>` template refs and `Ref<ComponentPublicInstance>`\n * component refs (extracting `.$el`); non-ref values pass through unchanged.\n *\n * @param targets - A raw Anime.js target, a Vue template ref, or a Vue component ref.\n */\nexport function resolveTarget(targets: AnimationTargets): TargetsParam {\n return unrefElement(targets as MaybeComputedElementRef) as TargetsParam\n}","import { type DeepReadonly, type MaybeRef, type ShallowRef, shallowRef, unref, watch, readonly, isRef } from \"vue\"\nimport { type JSAnimation, animate, type TargetsParam, type AnimationParams } from \"animejs\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimateReturn {\n /** The underlying Anime.js animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<JSAnimation | undefined>>\n /** Starts or resumes the animation. */\n play: () => JSAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => JSAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => JSAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => JSAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => JSAnimation | undefined\n /** Resumes from a paused state. */\n resume: () => JSAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => JSAnimation | undefined\n /** Stops the animation and removes it from the Anime.js engine. */\n cancel: () => JSAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => JSAnimation | undefined\n /** Resets the animation to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => JSAnimation | undefined\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => JSAnimation | undefined\n /** Rescales the animation to a new total duration. */\n stretch: (newDuration: number) => JSAnimation | undefined\n /** Re-reads the current values of animated properties from the DOM. */\n refresh: () => JSAnimation | undefined\n}\n\n/**\n * Wraps Anime.js `animate()` into a Vue composable. Reactively re-creates the animation when the target or options change, and cancels it automatically on unmount.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimate(_target: AnimationTargets, _options: MaybeRef<AnimationParams> = {}): UseAnimateReturn {\n const animation = shallowRef<JSAnimation>()\n\n const { stop } = watch(\n [() => resolveTarget(_target), () => unref(_options)],\n ([el, opt]) => {\n createAnimation(el, opt)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function createAnimation(el: TargetsParam, opt: AnimationParams) {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n animation.value = undefined\n return\n }\n\n animation.value = animate(el, opt)\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function resume() {\n return animation.value?.resume()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n function reset(softReset?: boolean) {\n return animation.value?.reset(softReset)\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return animation.value?.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return animation.value?.stretch(newDuration)\n }\n\n function refresh() {\n return animation.value?.refresh()\n }\n\n return {\n animation: readonly(animation),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n cancel,\n revert,\n reset,\n seek,\n stretch,\n refresh,\n }\n}","import { animate, type AnimationParams, type JSAnimation } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\n/** The Anime.js `JSAnimation` instance returned by `useRawAnimate`. */\nexport type UseRawAnimateReturn = JSAnimation\n\n/**\n * Thin wrapper around Anime.js `animate()`. Resolves the target (unwrapping refs and Vue component\n * refs via `.$el`) and immediately starts the animation.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a Vue component ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useRawAnimate(\n _target: AnimationTargets,\n _options: MaybeRef<AnimationParams> = {}\n): UseRawAnimateReturn {\n const target = resolveTarget(_target)\n\n if (!target) {\n console.warn(\"Target is undefined\")\n }\n\n return animate(target, unref(_options))\n}","import { createTimer, type Timer, type TimerParams } from \"animejs\"\nimport { type MaybeRef, type ShallowRef, shallowRef, unref, watch, type DeepReadonly, readonly } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\n\nexport interface UseTimerReturn {\n /** The underlying Anime.js timer instance. */\n timer: DeepReadonly<ShallowRef<Timer>>\n /** Starts or resumes the timer. */\n play: () => Timer\n /** Reverses the timer's playback direction. */\n reverse: () => Timer\n /** Pauses the timer at the current position. */\n pause: () => Timer\n /** Restarts the timer from the beginning. */\n restart: () => Timer\n /** Toggles between forward and reverse direction. */\n alternate: () => Timer\n /** Resumes from a paused state. */\n resume: () => Timer\n /** Jumps immediately to the end of the timer duration. */\n complete: () => Timer\n /** Resets the timer to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timer\n /** Stops the timer and removes it from the Anime.js engine. */\n cancel: () => Timer\n /** Cancels the timer and restores any associated state to its original values. */\n revert: () => Timer\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timer\n /** Rescales the timer to a new total duration. */\n stretch: (newDuration: number) => Timer\n}\n\n/**\n * Wraps Anime.js `createTimer()` into a Vue composable. Reactively re-creates the timer when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timer parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimer(options: MaybeRef<TimerParams> = {}): UseTimerReturn {\n const timer = shallowRef<Timer>(createTimer(unref(options)))\n\n const { stop } = watch(\n () => unref(options),\n options => {\n cancel()\n timer.value = createTimer(options)\n },\n { deep: 1 }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function play() {\n return timer.value.play()\n }\n\n function reverse() {\n return timer.value.reverse()\n }\n\n function pause() {\n return timer.value.pause()\n }\n\n function restart() {\n return timer.value.restart()\n }\n\n function alternate() {\n return timer.value.alternate()\n }\n\n function resume() {\n return timer.value.resume()\n }\n\n function complete() {\n return timer.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timer.value.reset(softReset)\n }\n\n function cancel() {\n return timer.value.cancel()\n }\n\n function revert() {\n return timer.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timer.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timer.value.stretch(newDuration)\n }\n\n return {\n timer: readonly(timer),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n }\n}","import {\n type MaybeRef,\n type MaybeRefOrGetter,\n type ShallowRef,\n shallowRef,\n toValue,\n unref,\n watch,\n type DeepReadonly,\n readonly,\n} from \"vue\"\nimport {\n type AnimationParams,\n type Callback,\n createTimeline,\n type StaggerFunction,\n type Tickable,\n type Timeline,\n type TimelineParams,\n type TimelinePosition,\n type Timer,\n} from \"animejs\"\nimport { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\ntype QueueEntry =\n | {\n type: \"add\"\n targets: AnimationTargets\n params: MaybeRefOrGetter<AnimationParams>\n position?: TimelinePosition | StaggerFunction<number | string>\n }\n | { type: \"set\"; targets: AnimationTargets; params: MaybeRefOrGetter<AnimationParams>; position?: TimelinePosition }\n\nexport type TimelineChain = Timeline & {\n /** Adds an animation to the timeline and returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it, then returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline and returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n}\n\nexport interface UseTimelineReturn {\n /** The underlying Anime.js timeline instance. */\n timeline: DeepReadonly<ShallowRef<Timeline>>\n /** Adds an animation to the timeline. Accepts a template ref or any valid Anime.js target. Returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it. Returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline. Returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n /** Synchronises another tickable (animation, timer) into the timeline at the given position. */\n sync: (synced?: Tickable, position?: TimelinePosition) => Timeline\n /** Adds a named label at a position so it can be referenced by `.add()` or `.seek()`. */\n label: (labelName: string, position?: TimelinePosition) => Timeline\n /** Inserts a callback function at a specific point in the timeline. */\n call: (callback: Callback<Timer>, position?: TimelinePosition) => Timeline\n /** Renders the timeline once without playing it. */\n init: (internalRender?: boolean) => Timeline\n /** Starts or resumes the timeline. */\n play: () => Timeline\n /** Reverses playback direction. */\n reverse: () => Timeline\n /** Pauses the timeline at the current position. */\n pause: () => Timeline\n /** Restarts the timeline from the beginning. */\n restart: () => Timeline\n /** Toggles between forward and reverse direction. */\n alternate: () => Timeline\n /** Resumes from a paused state. */\n resume: () => Timeline\n /** Jumps immediately to the end of the timeline. */\n complete: () => Timeline\n /** Resets the timeline to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timeline\n /** Stops the timeline and removes it from the Anime.js engine. */\n cancel: () => Timeline\n /** Cancels the timeline and restores all animated properties to their original values. */\n revert: () => Timeline\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timeline\n /** Rescales the timeline to a new total duration. */\n stretch: (newDuration: number) => Timeline\n /** Re-reads the current values of all animated properties from the DOM. */\n refresh: () => Timeline\n}\n\n/**\n * Wraps Anime.js `createTimeline()` into a Vue composable. Reactively re-creates the timeline when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timeline parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimeline(options: MaybeRef<TimelineParams> = {}): UseTimelineReturn {\n let is_mounted = false\n\n const queue: QueueEntry[] = []\n\n const timeline = shallowRef<Timeline>(createTimeline(unref(options)))\n\n function replayQueue() {\n for (const entry of queue) {\n if (entry.type === \"add\") {\n timeline.value.add(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n } else {\n timeline.value.set(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n }\n }\n }\n\n const { stop } = watch(\n () => unref(options),\n _options => {\n revert()\n timeline.value = createTimeline(_options)\n replayQueue()\n },\n { flush: \"post\", deep: 1 }\n )\n\n tryOnMounted(() => {\n is_mounted = true\n replayQueue()\n })\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function add(\n targets: AnimationTargets,\n _params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) {\n queue.push({ type: \"add\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.add(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function set(targets: AnimationTargets, _params: MaybeRefOrGetter<AnimationParams>, position?: TimelinePosition) {\n queue.push({ type: \"set\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.set(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function remove(targets: AnimationTargets, propertyName?: string) {\n if (!is_mounted) {\n console.warn(\"Cannot remove from timeline before mount\")\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n return { ...timeline.value.remove(resolveTarget(targets), propertyName), add, set, remove } as TimelineChain\n }\n\n function sync(synced?: Tickable, position?: TimelinePosition) {\n return timeline.value.sync(synced, position)\n }\n\n function label(labelName: string, position?: TimelinePosition) {\n return timeline.value.label(labelName, position)\n }\n\n function call(callback: Callback<Timer>, position?: TimelinePosition) {\n return timeline.value.call(callback, position)\n }\n\n function init(internalRender?: boolean) {\n return timeline.value.init(internalRender)\n }\n\n function play() {\n return timeline.value.play()\n }\n\n function reverse() {\n return timeline.value.reverse()\n }\n\n function pause() {\n return timeline.value.pause()\n }\n\n function restart() {\n return timeline.value.restart()\n }\n\n function alternate() {\n return timeline.value.alternate()\n }\n\n function resume() {\n return timeline.value.resume()\n }\n\n function complete() {\n return timeline.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timeline.value.reset(softReset)\n }\n\n function cancel() {\n return timeline.value.cancel()\n }\n\n function revert() {\n return timeline.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timeline.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timeline.value.stretch(newDuration)\n }\n\n function refresh() {\n return timeline.value.refresh()\n }\n\n return {\n timeline: readonly(timeline),\n add,\n set,\n sync,\n label,\n remove,\n call,\n init,\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n refresh,\n }\n}","import { type AnimatableObject, type AnimatableParams, createAnimatable, type TargetsParam } from \"animejs\"\nimport {\n computed,\n type DeepReadonly,\n isRef,\n type MaybeRef,\n readonly,\n type ShallowRef,\n shallowRef,\n unref,\n watch,\n} from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimatableReturn {\n /** The underlying Anime.js animatable instance. `undefined` until the target is available. */\n animatable: DeepReadonly<ShallowRef<AnimatableObject | undefined>>\n /** Cancels the animatable and restores all animated properties to their original values. */\n revert: () => AnimatableObject | undefined\n}\n\n/**\n * Wraps Anime.js `createAnimatable()` into a Vue composable. Reactively re-creates the animatable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make animatable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js animatable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimatable(\n targets: AnimationTargets,\n options: MaybeRef<AnimatableParams> = {}\n): UseAnimatableReturn {\n const animatable = shallowRef<AnimatableObject>()\n\n const watch_target = computed<{ el: TargetsParam; opt: AnimatableParams }>(() => ({\n el: resolveTarget(targets),\n opt: unref(options),\n }))\n\n const { stop } = watch(\n watch_target,\n ({ el, opt }) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n animatable.value = undefined\n return\n }\n\n animatable.value = createAnimatable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n revert()\n })\n\n function revert() {\n return animatable.value?.revert()\n }\n\n return { animatable: readonly(animatable), revert }\n}","import { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type Draggable, type DraggableParams, createDraggable, type EasingParam } from \"animejs\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseDraggableReturn {\n /** The underlying Anime.js draggable instance. `undefined` until the target is available. */\n draggable: DeepReadonly<ShallowRef<Draggable | undefined>>\n /** Disables drag interactions without destroying the instance. */\n disable: () => void\n /** Re-enables drag interactions after `disable()`. */\n enable: () => void\n /** Moves the draggable to the given x position. Pass `true` to suppress the update callback. */\n setX: (x: number, muteUpdateCallback?: boolean) => void\n /** Moves the draggable to the given y position. Pass `true` to suppress the update callback. */\n setY: (y: number, muteUpdateCallback?: boolean) => void\n /** Animates the draggable into the visible viewport. */\n animateInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Scrolls the draggable into the visible viewport. */\n scrollInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Stops any in-progress snap or momentum animation. */\n stop: () => void\n /** Resets the draggable position to its initial state. */\n reset: () => void\n /** Cancels the draggable and restores the element to its original state. */\n revert: () => void\n /** Re-reads the element's size and container bounds. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createDraggable()` into a Vue composable. Reactively re-creates the draggable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make draggable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js draggable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useDraggable(targets: AnimationTargets, options: MaybeRef<DraggableParams> = {}): UseDraggableReturn {\n const draggable = shallowRef<Draggable>()\n\n const { stop: stopWatch } = watch(\n [() => resolveTarget(targets), () => unref(options)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n draggable.value = undefined\n return\n }\n\n draggable.value = createDraggable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stopWatch()\n })\n\n function disable() {\n return draggable.value?.disable()\n }\n\n function enable() {\n return draggable.value?.enable()\n }\n\n function setX(x: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setX(x, muteUpdateCallback)\n }\n\n function setY(y: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setY(y, muteUpdateCallback)\n }\n\n function animateInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.animateInView(duration, gap, ease)\n }\n\n function scrollInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.scrollInView(duration, gap, ease)\n }\n\n function stop() {\n return draggable.value?.stop()\n }\n\n function reset() {\n return draggable.value?.reset()\n }\n\n function revert() {\n return draggable.value?.revert()\n }\n\n function refresh() {\n return draggable.value?.refresh()\n }\n\n return {\n draggable: readonly(draggable),\n disable,\n enable,\n setX,\n setY,\n animateInView,\n scrollInView,\n stop,\n reset,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type AutoLayout,\n type AutoLayoutParams,\n createLayout,\n type DOMTargetSelector,\n type LayoutAnimationParams,\n type Timeline,\n} from \"animejs\"\nimport { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseLayoutReturn {\n /** The underlying Anime.js `AutoLayout` instance. `undefined` until the root element is available. */\n layout: DeepReadonly<ShallowRef<AutoLayout | undefined>>\n /** Snapshots the current positions of all tracked children so the next layout change can be animated. */\n record: () => void\n /** Animates all children from their recorded positions to their new positions. */\n animate: (params?: LayoutAnimationParams) => Timeline | undefined\n /** Records, applies the callback (which triggers a layout change), then animates the transition. */\n update: (callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) => void\n /** Cancels the layout watcher and restores all elements to their original state. */\n revert: () => void\n}\n\n/**\n * Wraps Anime.js `createLayout()` into a Vue composable. Reactively re-creates the layout observer when the root element or params change, and reverts it automatically on unmount.\n *\n * @param root - The container element whose children will be tracked. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param params - Anime.js auto-layout parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useLayout(\n root: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n params: MaybeRef<AutoLayoutParams> = {}\n): UseLayoutReturn {\n const layout = shallowRef<AutoLayout | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(root as AnimationTargets), () => unref(params)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n layout.value = undefined\n return\n }\n\n layout.value = createLayout(el as DOMTargetSelector, opt)\n },\n { flush: \"post\", immediate: !isRef(root) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stop()\n })\n\n function record() {\n return layout.value?.record()\n }\n\n function animate(params?: LayoutAnimationParams) {\n return layout.value?.animate(params)\n }\n\n function update(callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) {\n return layout.value?.update(callback, params)\n }\n\n function revert() {\n return layout.value?.revert()\n }\n\n return { layout: readonly(layout), record, animate, update, revert }\n}","import { svg, type FunctionValue, type TargetsParam } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\n\nexport interface UseSvgReturn {\n /** Returns a `FunctionValue` that morphs the current path to the given `path`. Pass the result as the `d` property in `useAnimate` options. */\n morphTo: (path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) => FunctionValue\n /** Creates a motion-path object from an SVG `<path>`. Spread the result into `useAnimate` options to animate `translateX`, `translateY`, and `rotate` along the path. */\n createMotionPath: (\n path: MaybeRef<TargetsParam | null>,\n offset?: MaybeRef<number>\n ) => ReturnType<typeof svg.createMotionPath>\n}\n\n/**\n * Exposes Anime.js SVG utilities (`svg.morphTo`, `svg.createMotionPath`) as a Vue composable, automatically unwrapping reactive refs passed to each helper.\n *\n * For drawable stroke animations, use `useSvgDrawable` instead.\n */\nexport function useSvg(): UseSvgReturn {\n function morphTo(_path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) {\n const path = unref(_path)\n\n if (!path) return () => \"\"\n\n return svg.morphTo(unref(path), unref(precision))\n }\n\n function createMotionPath(path: MaybeRef<TargetsParam | null>, offset?: MaybeRef<number>) {\n const resolved = unref(path) ?? \"\"\n return svg.createMotionPath(resolved, unref(offset))\n }\n\n return {\n morphTo,\n createMotionPath,\n }\n}","import { svg, type DrawableSVGGeometry, type DOMTargetSelector } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { isRef, type MaybeRef, readonly, type DeepReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseSvgDrawableReturn {\n /**\n * The Anime.js drawable Proxy for the target element. `undefined` until the element is available.\n * Pass this ref — not the original template ref — as the `useAnimate` target to animate the `draw` property.\n */\n drawable: DeepReadonly<ShallowRef<DrawableSVGGeometry | undefined>>\n}\n\n/**\n * Wraps an SVG geometry element in Anime.js's drawable Proxy. The proxy intercepts `setAttribute('draw', …)` calls and translates normalised `draw` values (`0`–`1`) into the correct `stroke-dasharray` / `stroke-dashoffset` updates. Pass the returned `drawable` ref as the target to `useAnimate`.\n *\n * @param target - The SVG element to make drawable. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param start - Initial draw start position (`0`–`1`). Defaults to `0`.\n * @param end - Initial draw end position (`0`–`1`). Defaults to `0` (fully hidden).\n */\nexport function useSvgDrawable(\n target: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n start: MaybeRef<number> = 0,\n end: MaybeRef<number> = 0\n): UseSvgDrawableReturn {\n const drawable = shallowRef<DrawableSVGGeometry | undefined>()\n\n const { stop } = watch(\n () => resolveTarget(target as AnimationTargets),\n el => {\n drawable.value = undefined\n if (!el) {\n console.warn(\"[useSvgDrawable] Target element is null or undefined\")\n return\n }\n drawable.value = svg.createDrawable(el as DOMTargetSelector, unref(start), unref(end))[0]\n },\n { flush: \"post\", immediate: !isRef(target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n drawable.value = undefined\n })\n\n return { drawable: readonly(drawable) }\n}","import { splitText, type TextSplitter, type TextSplitterParams } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n computed,\n isRef,\n readonly,\n shallowRef,\n unref,\n watch,\n type ComputedRef,\n type DeepReadonly,\n type MaybeRef,\n type ShallowRef,\n} from \"vue\"\n\nexport interface UseTextReturn {\n /** The underlying Anime.js `TextSplitter` instance. `undefined` until the target is available. */\n splitter: DeepReadonly<ShallowRef<TextSplitter | undefined>>\n /** Reactive array of `<span>` elements representing each line after splitting. */\n lines: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each word after splitting. */\n words: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each character after splitting. */\n chars: ComputedRef<HTMLElement[]>\n /** Removes all split `<span>` wrappers and restores the original text content. */\n revert: () => void\n /** Re-splits the text, updating `lines`, `words`, and `chars` to reflect any DOM or size changes. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `splitText()` into a Vue composable. Reactively re-splits the text when the target or params change, and reverts the DOM automatically on unmount.\n *\n * @param _target - The element(s) whose text content should be split. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _params - Anime.js text-splitter parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useText(\n _target: MaybeRef<HTMLElement | NodeList | string | HTMLElement[]> | MaybeComputedElementRef,\n _params?: MaybeRef<TextSplitterParams>\n): UseTextReturn {\n const splitter = shallowRef<TextSplitter | undefined>()\n\n const lines = computed<HTMLElement[]>(() => splitter.value?.lines ?? [])\n const words = computed<HTMLElement[]>(() => splitter.value?.words ?? [])\n const chars = computed<HTMLElement[]>(() => splitter.value?.chars ?? [])\n\n const { stop } = watch(\n [() => resolveTarget(_target as AnimationTargets), () => unref(_params)],\n ([el, params]) => {\n revert()\n splitter.value = undefined\n\n if (!el) return\n\n splitter.value = splitText(el as HTMLElement | NodeList | string | HTMLElement[], params)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n splitter.value = undefined\n revert()\n })\n\n function revert() {\n splitter.value?.revert()\n }\n\n function refresh() {\n splitter.value?.refresh()\n }\n\n return {\n splitter: readonly(splitter),\n lines,\n words,\n chars,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type WAAPIAnimationParams,\n type DOMTargetsParam,\n waapi,\n type WAAPIAnimation,\n type EasingFunction,\n} from \"animejs\"\nimport { DeepReadonly, isRef, type MaybeRef, readonly, ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseWaapiReturn {\n /** The underlying Anime.js WAAPI animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<WAAPIAnimation | undefined>>\n /** Resumes from a paused state. */\n resume: () => WAAPIAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => WAAPIAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => WAAPIAnimation | undefined\n /** Starts or resumes the animation. */\n play: () => WAAPIAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => WAAPIAnimation | undefined\n /** Seeks to a specific time (in ms). Accepts a reactive ref for the time value. */\n seek: (time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) => WAAPIAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => WAAPIAnimation | undefined\n /** Commits the current animated styles to the element's inline style, then cancels the animation. */\n commitStyles: () => WAAPIAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => WAAPIAnimation | undefined\n /** Stops the animation and removes it from the WAAPI engine. */\n cancel: () => WAAPIAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => WAAPIAnimation | undefined\n /** Converts an Anime.js easing function to a CSS `cubic-bezier()` string usable by WAAPI. */\n convertEase: (fn: MaybeRef<EasingFunction>, samples?: MaybeRef<number>) => string\n}\n\n/**\n * Wraps Anime.js `waapi.animate()` into a Vue composable. Reactively re-creates the WAAPI animation when the target or options change, and stops it automatically on unmount.\n *\n * @param targets - The DOM element(s) to animate via WAAPI. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js WAAPI animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useWaapi(\n targets: MaybeRef<DOMTargetsParam> | MaybeComputedElementRef,\n options: MaybeRef<WAAPIAnimationParams> = {}\n): UseWaapiReturn {\n const animation = shallowRef<WAAPIAnimation | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(targets as AnimationTargets), () => unref(options)],\n ([el, opt]) => {\n animation.value = waapi.animate(el as DOMTargetsParam, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n })\n\n function resume() {\n return animation.value?.resume()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function seek(time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) {\n return animation.value?.seek(unref(time), unref(muteCallbacks))\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function commitStyles() {\n return animation.value?.commitStyles()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n return {\n animation: readonly(animation),\n resume,\n pause,\n alternate,\n play,\n reverse,\n seek,\n restart,\n commitStyles,\n complete,\n cancel,\n revert,\n\n convertEase,\n }\n}\n\nfunction convertEase(fn: MaybeRef<EasingFunction>, samples: MaybeRef<number> = 100) {\n return waapi.convertEase(unref(fn), unref(samples))\n}","import { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { createScope, type Scope, type ScopeMethod, type ScopeParams, type Tickable } from \"animejs\"\nimport { isRef, type MaybeRef, shallowReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseScopeReturn {\n /** The underlying Anime.js `Scope` instance. */\n scope: Readonly<ShallowRef<Scope | undefined>>\n /** Registers an anonymous method on the scope. Queued automatically if called before mount. */\n add: (method: ScopeMethod) => void\n /** Registers a named method on the scope so it can be called via `scope.methods[name]()`. Queued automatically if called before mount. */\n registerMethod: (methodName: string, method: ScopeMethod) => void\n /** Registers a method that runs exactly once on the scope. Queued automatically if called before mount. */\n addOnce: (method: ScopeMethod) => void\n /** Keeps the time of another tickable (animation, timer) in sync with this scope. */\n keepTime: (method: (scope: Scope) => Tickable) => void\n /** Cancels the scope and reverts all animations and tickables it owns. */\n revert: () => void\n /** Re-reads default values and media-query breakpoints for the scope. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createScope()` into a Vue composable. Reactively re-creates the scope when params change, replays all registered methods, and reverts it automatically on unmount.\n *\n * Methods added before mount are queued and replayed once the component is mounted.\n *\n * @param params - Anime.js scope parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useScope(params: MaybeRef<ScopeParams>): UseScopeReturn {\n const scope = shallowRef<Scope | undefined>(undefined)\n\n const pending_adds: ScopeMethod[] = []\n const pending_named: [string, ScopeMethod][] = []\n const pending_once: ScopeMethod[] = []\n\n let is_mounted = false\n let stopWatcher: (() => void) | undefined\n\n tryOnMounted(() => {\n is_mounted = true\n scope.value = createScope(unref(params))\n\n for (const method of pending_adds) scope.value.add(method)\n for (const [name, method] of pending_named) scope.value.add(name, method)\n for (const method of pending_once) scope.value.addOnce(method)\n\n pending_adds.length = 0\n pending_named.length = 0\n pending_once.length = 0\n\n if (isRef(params)) {\n stopWatcher = watch(\n params,\n new_params => {\n scope.value?.revert()\n scope.value = createScope(new_params)\n },\n { flush: \"post\" }\n )\n }\n })\n\n tryOnUnmounted(() => {\n scope.value?.revert()\n stopWatcher?.()\n })\n\n function add(method: ScopeMethod) {\n if (!is_mounted) return void pending_adds.push(method)\n return scope.value?.add(method)\n }\n\n function registerMethod(methodName: string, method: ScopeMethod) {\n if (!is_mounted) return void pending_named.push([methodName, method])\n return scope.value?.add(methodName, method)\n }\n\n function addOnce(method: ScopeMethod) {\n if (!is_mounted) return void pending_once.push(method)\n return scope.value?.addOnce(method)\n }\n\n function keepTime(method: (scope: Scope) => Tickable) {\n return scope.value?.keepTime(method)\n }\n\n function revert() {\n return scope.value?.revert()\n }\n\n function refresh() {\n return scope.value?.refresh()\n }\n\n return {\n scope: shallowReadonly(scope),\n add,\n registerMethod,\n addOnce,\n keepTime,\n revert,\n refresh,\n }\n}"],"mappings":";;;;AAkBA,SAAgB,EAAc,GAAyC;AACrE,QAAO,EAAa,EAAmC;;;;ACuBzD,SAAgB,EAAW,GAA2B,IAAsC,EAAE,EAAoB;CAChH,IAAM,IAAY,GAAyB,EAErC,EAAE,YAAS,EACf,OAAO,EAAc,EAAQ,QAAQ,EAAM,EAAS,CAAC,GACpD,CAAC,GAAI,OAAS;AACb,IAAgB,GAAI,EAAI;IAE1B;EAAE,OAAO;EAAQ,WAAW,CAAC,EAAM,EAAQ;EAAE,CAC9C;AAED,SAAqB;AAEnB,EADA,GAAM,EACN,GAAQ;GACR;CAEF,SAAS,EAAgB,GAAkB,GAAsB;AAG/D,MAFA,GAAQ,EAEJ,CAAC,GAAI;AAEP,GADA,QAAQ,KAAK,sCAAsC,EACnD,EAAU,QAAQ,KAAA;AAClB;;AAGF,IAAU,QAAQ,EAAQ,GAAI,EAAI;;CAGpC,SAAS,IAAO;AACd,SAAO,EAAU,OAAO,MAAM;;CAGhC,SAAS,IAAU;AACjB,SAAO,EAAU,OAAO,SAAS;;CAGnC,SAAS,IAAQ;AACf,SAAO,EAAU,OAAO,OAAO;;CAGjC,SAAS,IAAU;AACjB,SAAO,EAAU,OAAO,SAAS;;CAGnC,SAAS,IAAY;AACnB,SAAO,EAAU,OAAO,WAAW;;CAGrC,SAAS,IAAS;AAChB,SAAO,EAAU,OAAO,QAAQ;;CAGlC,SAAS,IAAW;AAClB,SAAO,EAAU,OAAO,UAAU;;CAGpC,SAAS,IAAS;AAChB,SAAO,EAAU,OAAO,QAAQ;;CAGlC,SAAS,IAAS;AAChB,SAAO,EAAU,OAAO,QAAQ;;CAGlC,SAAS,EAAM,GA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AM,OAAO,IAAI,EAAO,GADP,KAAK,EAAa,KAAK,EAAO;;CAIxD,SAAS,EAAe,GAAoB,GAAqB;AAE/D,SADK,IACE,EAAM,OAAO,IAAI,GAAY,EAAO,GADnB,KAAK,EAAc,KAAK,CAAC,GAAY,EAAO,CAAC;;CAIvE,SAAS,EAAQ,GAAqB;AAEpC,SADK,IACE,EAAM,OAAO,QAAQ,EAAO,GADX,KAAK,EAAa,KAAK,EAAO;;CAIxD,SAAS,EAAS,GAAoC;AACpD,SAAO,EAAM,OAAO,SAAS,EAAO;;CAGtC,SAAS,IAAS;AAChB,SAAO,EAAM,OAAO,QAAQ;;CAG9B,SAAS,IAAU;AACjB,SAAO,EAAM,OAAO,SAAS;;AAG/B,QAAO;EACL,OAAO,EAAgB,EAAM;EAC7B;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/utils/resolve-target.ts","../src/composables/use-animate.ts","../src/composables/use-raw-animate.ts","../src/composables/use-timer.ts","../src/composables/use-timeline.ts","../src/composables/use-animatable.ts","../src/composables/use-draggable.ts","../src/composables/use-layout.ts","../src/composables/use-svg.ts","../src/composables/use-svg-drawable.ts","../src/composables/use-text.ts","../src/composables/use-waapi.ts","../src/composables/use-scope.ts","../src/directives/v-animate.ts","../src/directives/v-draggable.ts","../src/directives/v-svg-drawable.ts","../src/directives/v-waapi.ts","../src/directives/v-text-split.ts"],"sourcesContent":["import { type Ref, type ComponentPublicInstance, type MaybeRef } from \"vue\"\nimport { unrefElement, type MaybeComputedElementRef } from \"@vueuse/core\"\nimport { type TargetsParam } from \"animejs\"\n\n/**\n * Any valid animation target: any Anime.js `TargetsParam` (optionally wrapped in a `Ref`),\n * or a Vue component template ref (`Ref<ComponentPublicInstance>`), whose `.$el` is resolved\n * automatically via `unrefElement`.\n */\nexport type AnimationTargets = MaybeRef<TargetsParam> | Ref<ComponentPublicInstance>\n\n/**\n * Resolves an `AnimationTargets` value to a plain `TargetsParam` suitable for Anime.js.\n * Unwraps `Ref<HTMLElement | SVGElement>` template refs and `Ref<ComponentPublicInstance>`\n * component refs (extracting `.$el`); non-ref values pass through unchanged.\n *\n * @param targets - A raw Anime.js target, a Vue template ref, or a Vue component ref.\n */\nexport function resolveTarget(targets: AnimationTargets): TargetsParam {\n return unrefElement(targets as MaybeComputedElementRef) as TargetsParam\n}","import { type DeepReadonly, type MaybeRef, type ShallowRef, shallowRef, unref, watch, readonly, isRef } from \"vue\"\nimport { type JSAnimation, animate, type TargetsParam, type AnimationParams } from \"animejs\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimateReturn {\n /** The underlying Anime.js animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<JSAnimation | undefined>>\n /** Starts or resumes the animation. */\n play: () => JSAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => JSAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => JSAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => JSAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => JSAnimation | undefined\n /** Resumes from a paused state. */\n resume: () => JSAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => JSAnimation | undefined\n /** Stops the animation and removes it from the Anime.js engine. */\n cancel: () => JSAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => JSAnimation | undefined\n /** Resets the animation to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => JSAnimation | undefined\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => JSAnimation | undefined\n /** Rescales the animation to a new total duration. */\n stretch: (newDuration: number) => JSAnimation | undefined\n /** Re-reads the current values of animated properties from the DOM. */\n refresh: () => JSAnimation | undefined\n}\n\n/**\n * Wraps Anime.js `animate()` into a Vue composable. Reactively re-creates the animation when the target or options change, and cancels it automatically on unmount.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimate(_target: AnimationTargets, _options: MaybeRef<AnimationParams> = {}): UseAnimateReturn {\n const animation = shallowRef<JSAnimation>()\n\n const { stop } = watch(\n [() => resolveTarget(_target), () => unref(_options)],\n ([el, opt]) => {\n createAnimation(el, opt)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function createAnimation(el: TargetsParam, opt: AnimationParams) {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n animation.value = undefined\n return\n }\n\n animation.value = animate(el, opt)\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function resume() {\n return animation.value?.resume()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n function reset(softReset?: boolean) {\n return animation.value?.reset(softReset)\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return animation.value?.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return animation.value?.stretch(newDuration)\n }\n\n function refresh() {\n return animation.value?.refresh()\n }\n\n return {\n animation: readonly(animation),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n cancel,\n revert,\n reset,\n seek,\n stretch,\n refresh,\n }\n}","import { animate, type AnimationParams, type JSAnimation } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\n/** The Anime.js `JSAnimation` instance returned by `useRawAnimate`. */\nexport type UseRawAnimateReturn = JSAnimation\n\n/**\n * Thin wrapper around Anime.js `animate()`. Resolves the target (unwrapping refs and Vue component\n * refs via `.$el`) and immediately starts the animation.\n *\n * @param _target - The element(s) to animate. Accepts a template ref, a Vue component ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _options - Anime.js animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useRawAnimate(\n _target: AnimationTargets,\n _options: MaybeRef<AnimationParams> = {}\n): UseRawAnimateReturn {\n const target = resolveTarget(_target)\n\n if (!target) {\n console.warn(\"Target is undefined\")\n }\n\n return animate(target, unref(_options))\n}","import { createTimer, type Timer, type TimerParams } from \"animejs\"\nimport { type MaybeRef, type ShallowRef, shallowRef, unref, watch, type DeepReadonly, readonly } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\n\nexport interface UseTimerReturn {\n /** The underlying Anime.js timer instance. */\n timer: DeepReadonly<ShallowRef<Timer>>\n /** Starts or resumes the timer. */\n play: () => Timer\n /** Reverses the timer's playback direction. */\n reverse: () => Timer\n /** Pauses the timer at the current position. */\n pause: () => Timer\n /** Restarts the timer from the beginning. */\n restart: () => Timer\n /** Toggles between forward and reverse direction. */\n alternate: () => Timer\n /** Resumes from a paused state. */\n resume: () => Timer\n /** Jumps immediately to the end of the timer duration. */\n complete: () => Timer\n /** Resets the timer to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timer\n /** Stops the timer and removes it from the Anime.js engine. */\n cancel: () => Timer\n /** Cancels the timer and restores any associated state to its original values. */\n revert: () => Timer\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timer\n /** Rescales the timer to a new total duration. */\n stretch: (newDuration: number) => Timer\n}\n\n/**\n * Wraps Anime.js `createTimer()` into a Vue composable. Reactively re-creates the timer when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timer parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimer(options: MaybeRef<TimerParams> = {}): UseTimerReturn {\n const timer = shallowRef<Timer>(createTimer(unref(options)))\n\n const { stop } = watch(\n () => unref(options),\n options => {\n cancel()\n timer.value = createTimer(options)\n },\n { deep: 1 }\n )\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function play() {\n return timer.value.play()\n }\n\n function reverse() {\n return timer.value.reverse()\n }\n\n function pause() {\n return timer.value.pause()\n }\n\n function restart() {\n return timer.value.restart()\n }\n\n function alternate() {\n return timer.value.alternate()\n }\n\n function resume() {\n return timer.value.resume()\n }\n\n function complete() {\n return timer.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timer.value.reset(softReset)\n }\n\n function cancel() {\n return timer.value.cancel()\n }\n\n function revert() {\n return timer.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timer.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timer.value.stretch(newDuration)\n }\n\n return {\n timer: readonly(timer),\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n }\n}","import {\n type MaybeRef,\n type MaybeRefOrGetter,\n type ShallowRef,\n shallowRef,\n toValue,\n unref,\n watch,\n type DeepReadonly,\n readonly,\n} from \"vue\"\nimport {\n type AnimationParams,\n type Callback,\n createTimeline,\n type StaggerFunction,\n type Tickable,\n type Timeline,\n type TimelineParams,\n type TimelinePosition,\n type Timer,\n} from \"animejs\"\nimport { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\ntype QueueEntry =\n | {\n type: \"add\"\n targets: AnimationTargets\n params: MaybeRefOrGetter<AnimationParams>\n position?: TimelinePosition | StaggerFunction<number | string>\n }\n | { type: \"set\"; targets: AnimationTargets; params: MaybeRefOrGetter<AnimationParams>; position?: TimelinePosition }\n\nexport type TimelineChain = Timeline & {\n /** Adds an animation to the timeline and returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it, then returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline and returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n}\n\nexport interface UseTimelineReturn {\n /** The underlying Anime.js timeline instance. */\n timeline: DeepReadonly<ShallowRef<Timeline>>\n /** Adds an animation to the timeline. Accepts a template ref or any valid Anime.js target. Returns a chainable object. */\n add: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) => TimelineChain\n /** Sets a property to a value at a point in the timeline without animating it. Returns a chainable object. */\n set: (\n targets: AnimationTargets,\n params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition\n ) => TimelineChain\n /** Removes an animation target (or a specific property) from the timeline. Returns a chainable object. */\n remove: (targets: AnimationTargets, propertyName?: string) => TimelineChain\n /** Synchronises another tickable (animation, timer) into the timeline at the given position. */\n sync: (synced?: Tickable, position?: TimelinePosition) => Timeline\n /** Adds a named label at a position so it can be referenced by `.add()` or `.seek()`. */\n label: (labelName: string, position?: TimelinePosition) => Timeline\n /** Inserts a callback function at a specific point in the timeline. */\n call: (callback: Callback<Timer>, position?: TimelinePosition) => Timeline\n /** Renders the timeline once without playing it. */\n init: (internalRender?: boolean) => Timeline\n /** Starts or resumes the timeline. */\n play: () => Timeline\n /** Reverses playback direction. */\n reverse: () => Timeline\n /** Pauses the timeline at the current position. */\n pause: () => Timeline\n /** Restarts the timeline from the beginning. */\n restart: () => Timeline\n /** Toggles between forward and reverse direction. */\n alternate: () => Timeline\n /** Resumes from a paused state. */\n resume: () => Timeline\n /** Jumps immediately to the end of the timeline. */\n complete: () => Timeline\n /** Resets the timeline to its initial state. Pass `true` for a soft reset that preserves the current cycle. */\n reset: (softReset?: boolean) => Timeline\n /** Stops the timeline and removes it from the Anime.js engine. */\n cancel: () => Timeline\n /** Cancels the timeline and restores all animated properties to their original values. */\n revert: () => Timeline\n /** Seeks to a specific time (in ms). */\n seek: (time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) => Timeline\n /** Rescales the timeline to a new total duration. */\n stretch: (newDuration: number) => Timeline\n /** Re-reads the current values of all animated properties from the DOM. */\n refresh: () => Timeline\n}\n\n/**\n * Wraps Anime.js `createTimeline()` into a Vue composable. Reactively re-creates the timeline when options change, and cancels it automatically on unmount.\n *\n * @param options - Anime.js timeline parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useTimeline(options: MaybeRef<TimelineParams> = {}): UseTimelineReturn {\n let is_mounted = false\n\n const queue: QueueEntry[] = []\n\n const timeline = shallowRef<Timeline>(createTimeline(unref(options)))\n\n function replayQueue() {\n for (const entry of queue) {\n if (entry.type === \"add\") {\n timeline.value.add(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n } else {\n timeline.value.set(resolveTarget(entry.targets), toValue(entry.params), entry.position)\n }\n }\n }\n\n const { stop } = watch(\n () => unref(options),\n _options => {\n revert()\n timeline.value = createTimeline(_options)\n replayQueue()\n },\n { flush: \"post\", deep: 1 }\n )\n\n tryOnMounted(() => {\n is_mounted = true\n replayQueue()\n })\n\n tryOnUnmounted(() => {\n stop()\n cancel()\n })\n\n function add(\n targets: AnimationTargets,\n _params: MaybeRefOrGetter<AnimationParams>,\n position?: TimelinePosition | StaggerFunction<number | string>\n ) {\n queue.push({ type: \"add\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.add(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function set(targets: AnimationTargets, _params: MaybeRefOrGetter<AnimationParams>, position?: TimelinePosition) {\n queue.push({ type: \"set\", targets, params: _params, position })\n\n if (is_mounted) {\n return {\n ...timeline.value.set(resolveTarget(targets), toValue(_params), position),\n add,\n set,\n remove,\n } as TimelineChain\n }\n\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n function remove(targets: AnimationTargets, propertyName?: string) {\n if (!is_mounted) {\n console.warn(\"Cannot remove from timeline before mount\")\n return { ...timeline.value, add, set, remove } as TimelineChain\n }\n\n return { ...timeline.value.remove(resolveTarget(targets), propertyName), add, set, remove } as TimelineChain\n }\n\n function sync(synced?: Tickable, position?: TimelinePosition) {\n return timeline.value.sync(synced, position)\n }\n\n function label(labelName: string, position?: TimelinePosition) {\n return timeline.value.label(labelName, position)\n }\n\n function call(callback: Callback<Timer>, position?: TimelinePosition) {\n return timeline.value.call(callback, position)\n }\n\n function init(internalRender?: boolean) {\n return timeline.value.init(internalRender)\n }\n\n function play() {\n return timeline.value.play()\n }\n\n function reverse() {\n return timeline.value.reverse()\n }\n\n function pause() {\n return timeline.value.pause()\n }\n\n function restart() {\n return timeline.value.restart()\n }\n\n function alternate() {\n return timeline.value.alternate()\n }\n\n function resume() {\n return timeline.value.resume()\n }\n\n function complete() {\n return timeline.value.complete()\n }\n\n function reset(softReset?: boolean) {\n return timeline.value.reset(softReset)\n }\n\n function cancel() {\n return timeline.value.cancel()\n }\n\n function revert() {\n return timeline.value.revert()\n }\n\n function seek(time: number, muteCallbacks?: boolean | number, internalRender?: boolean | number) {\n return timeline.value.seek(time, muteCallbacks, internalRender)\n }\n\n function stretch(newDuration: number) {\n return timeline.value.stretch(newDuration)\n }\n\n function refresh() {\n return timeline.value.refresh()\n }\n\n return {\n timeline: readonly(timeline),\n add,\n set,\n sync,\n label,\n remove,\n call,\n init,\n play,\n reverse,\n pause,\n restart,\n alternate,\n resume,\n complete,\n reset,\n cancel,\n revert,\n seek,\n stretch,\n refresh,\n }\n}","import { type AnimatableObject, type AnimatableParams, createAnimatable, type TargetsParam } from \"animejs\"\nimport {\n computed,\n type DeepReadonly,\n isRef,\n type MaybeRef,\n readonly,\n type ShallowRef,\n shallowRef,\n unref,\n watch,\n} from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseAnimatableReturn {\n /** The underlying Anime.js animatable instance. `undefined` until the target is available. */\n animatable: DeepReadonly<ShallowRef<AnimatableObject | undefined>>\n /** Cancels the animatable and restores all animated properties to their original values. */\n revert: () => AnimatableObject | undefined\n}\n\n/**\n * Wraps Anime.js `createAnimatable()` into a Vue composable. Reactively re-creates the animatable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make animatable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js animatable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useAnimatable(\n targets: AnimationTargets,\n options: MaybeRef<AnimatableParams> = {}\n): UseAnimatableReturn {\n const animatable = shallowRef<AnimatableObject>()\n\n const watch_target = computed<{ el: TargetsParam; opt: AnimatableParams }>(() => ({\n el: resolveTarget(targets),\n opt: unref(options),\n }))\n\n const { stop } = watch(\n watch_target,\n ({ el, opt }) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n animatable.value = undefined\n return\n }\n\n animatable.value = createAnimatable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n revert()\n })\n\n function revert() {\n return animatable.value?.revert()\n }\n\n return { animatable: readonly(animatable), revert }\n}","import { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { tryOnUnmounted } from \"@vueuse/core\"\nimport { type Draggable, type DraggableParams, createDraggable, type EasingParam } from \"animejs\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseDraggableReturn {\n /** The underlying Anime.js draggable instance. `undefined` until the target is available. */\n draggable: DeepReadonly<ShallowRef<Draggable | undefined>>\n /** Disables drag interactions without destroying the instance. */\n disable: () => void\n /** Re-enables drag interactions after `disable()`. */\n enable: () => void\n /** Moves the draggable to the given x position. Pass `true` to suppress the update callback. */\n setX: (x: number, muteUpdateCallback?: boolean) => void\n /** Moves the draggable to the given y position. Pass `true` to suppress the update callback. */\n setY: (y: number, muteUpdateCallback?: boolean) => void\n /** Animates the draggable into the visible viewport. */\n animateInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Scrolls the draggable into the visible viewport. */\n scrollInView: (duration?: number, gap?: number, ease?: EasingParam) => void\n /** Stops any in-progress snap or momentum animation. */\n stop: () => void\n /** Resets the draggable position to its initial state. */\n reset: () => void\n /** Cancels the draggable and restores the element to its original state. */\n revert: () => void\n /** Re-reads the element's size and container bounds. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createDraggable()` into a Vue composable. Reactively re-creates the draggable when the target or options change, and reverts it automatically on unmount.\n *\n * @param targets - The element(s) to make draggable. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js draggable parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useDraggable(targets: AnimationTargets, options: MaybeRef<DraggableParams> = {}): UseDraggableReturn {\n const draggable = shallowRef<Draggable>()\n\n const { stop: stopWatch } = watch(\n [() => resolveTarget(targets), () => unref(options)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Targets element is null or undefined\")\n draggable.value = undefined\n return\n }\n\n draggable.value = createDraggable(el, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stopWatch()\n })\n\n function disable() {\n return draggable.value?.disable()\n }\n\n function enable() {\n return draggable.value?.enable()\n }\n\n function setX(x: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setX(x, muteUpdateCallback)\n }\n\n function setY(y: number, muteUpdateCallback?: boolean) {\n return draggable.value?.setY(y, muteUpdateCallback)\n }\n\n function animateInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.animateInView(duration, gap, ease)\n }\n\n function scrollInView(duration?: number, gap?: number, ease?: EasingParam) {\n return draggable.value?.scrollInView(duration, gap, ease)\n }\n\n function stop() {\n return draggable.value?.stop()\n }\n\n function reset() {\n return draggable.value?.reset()\n }\n\n function revert() {\n return draggable.value?.revert()\n }\n\n function refresh() {\n return draggable.value?.refresh()\n }\n\n return {\n draggable: readonly(draggable),\n disable,\n enable,\n setX,\n setY,\n animateInView,\n scrollInView,\n stop,\n reset,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type AutoLayout,\n type AutoLayoutParams,\n createLayout,\n type DOMTargetSelector,\n type LayoutAnimationParams,\n type Timeline,\n} from \"animejs\"\nimport { type DeepReadonly, isRef, type MaybeRef, readonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseLayoutReturn {\n /** The underlying Anime.js `AutoLayout` instance. `undefined` until the root element is available. */\n layout: DeepReadonly<ShallowRef<AutoLayout | undefined>>\n /** Snapshots the current positions of all tracked children so the next layout change can be animated. */\n record: () => void\n /** Animates all children from their recorded positions to their new positions. */\n animate: (params?: LayoutAnimationParams) => Timeline | undefined\n /** Records, applies the callback (which triggers a layout change), then animates the transition. */\n update: (callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) => void\n /** Cancels the layout watcher and restores all elements to their original state. */\n revert: () => void\n}\n\n/**\n * Wraps Anime.js `createLayout()` into a Vue composable. Reactively re-creates the layout observer when the root element or params change, and reverts it automatically on unmount.\n *\n * @param root - The container element whose children will be tracked. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param params - Anime.js auto-layout parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useLayout(\n root: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n params: MaybeRef<AutoLayoutParams> = {}\n): UseLayoutReturn {\n const layout = shallowRef<AutoLayout | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(root as AnimationTargets), () => unref(params)],\n ([el, opt]) => {\n revert()\n\n if (!el) {\n console.warn(\"Target element is null or undefined\")\n layout.value = undefined\n return\n }\n\n layout.value = createLayout(el as DOMTargetSelector, opt)\n },\n { flush: \"post\", immediate: !isRef(root) }\n )\n\n tryOnUnmounted(() => {\n revert()\n stop()\n })\n\n function record() {\n return layout.value?.record()\n }\n\n function animate(params?: LayoutAnimationParams) {\n return layout.value?.animate(params)\n }\n\n function update(callback: (layout: AutoLayout) => void, params?: LayoutAnimationParams) {\n return layout.value?.update(callback, params)\n }\n\n function revert() {\n return layout.value?.revert()\n }\n\n return { layout: readonly(layout), record, animate, update, revert }\n}","import { svg, type FunctionValue, type TargetsParam } from \"animejs\"\nimport { type MaybeRef, unref } from \"vue\"\n\nexport interface UseSvgReturn {\n /** Returns a `FunctionValue` that morphs the current path to the given `path`. Pass the result as the `d` property in `useAnimate` options. */\n morphTo: (path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) => FunctionValue\n /** Creates a motion-path object from an SVG `<path>`. Spread the result into `useAnimate` options to animate `translateX`, `translateY`, and `rotate` along the path. */\n createMotionPath: (\n path: MaybeRef<TargetsParam | null>,\n offset?: MaybeRef<number>\n ) => ReturnType<typeof svg.createMotionPath>\n}\n\n/**\n * Exposes Anime.js SVG utilities (`svg.morphTo`, `svg.createMotionPath`) as a Vue composable, automatically unwrapping reactive refs passed to each helper.\n *\n * For drawable stroke animations, use `useSvgDrawable` instead.\n */\nexport function useSvg(): UseSvgReturn {\n function morphTo(_path: MaybeRef<TargetsParam>, precision?: MaybeRef<number>) {\n const path = unref(_path)\n\n if (!path) return () => \"\"\n\n return svg.morphTo(unref(path), unref(precision))\n }\n\n function createMotionPath(path: MaybeRef<TargetsParam | null>, offset?: MaybeRef<number>) {\n const resolved = unref(path) ?? \"\"\n return svg.createMotionPath(resolved, unref(offset))\n }\n\n return {\n morphTo,\n createMotionPath,\n }\n}","import { svg, type DrawableSVGGeometry, type DOMTargetSelector } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { isRef, type MaybeRef, readonly, type DeepReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\n\nexport interface UseSvgDrawableReturn {\n /**\n * The Anime.js drawable Proxy for the target element. `undefined` until the element is available.\n * Pass this ref — not the original template ref — as the `useAnimate` target to animate the `draw` property.\n */\n drawable: DeepReadonly<ShallowRef<DrawableSVGGeometry | undefined>>\n}\n\n/**\n * Wraps an SVG geometry element in Anime.js's drawable Proxy. The proxy intercepts `setAttribute('draw', …)` calls and translates normalised `draw` values (`0`–`1`) into the correct `stroke-dasharray` / `stroke-dashoffset` updates. Pass the returned `drawable` ref as the target to `useAnimate`.\n *\n * @param target - The SVG element to make drawable. Accepts a template ref, a CSS selector, or a reactive ref to either.\n * @param start - Initial draw start position (`0`–`1`). Defaults to `0`.\n * @param end - Initial draw end position (`0`–`1`). Defaults to `0` (fully hidden).\n */\nexport function useSvgDrawable(\n target: MaybeRef<DOMTargetSelector> | MaybeComputedElementRef,\n start: MaybeRef<number> = 0,\n end: MaybeRef<number> = 0\n): UseSvgDrawableReturn {\n const drawable = shallowRef<DrawableSVGGeometry | undefined>()\n\n const { stop } = watch(\n () => resolveTarget(target as AnimationTargets),\n el => {\n drawable.value = undefined\n if (!el) {\n console.warn(\"[useSvgDrawable] Target element is null or undefined\")\n return\n }\n drawable.value = svg.createDrawable(el as DOMTargetSelector, unref(start), unref(end))[0]\n },\n { flush: \"post\", immediate: !isRef(target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n drawable.value = undefined\n })\n\n return { drawable: readonly(drawable) }\n}","import { splitText, type TextSplitter, type TextSplitterParams } from \"animejs\"\nimport { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n computed,\n isRef,\n readonly,\n shallowRef,\n unref,\n watch,\n type ComputedRef,\n type DeepReadonly,\n type MaybeRef,\n type ShallowRef,\n} from \"vue\"\n\nexport interface UseTextReturn {\n /** The underlying Anime.js `TextSplitter` instance. `undefined` until the target is available. */\n splitter: DeepReadonly<ShallowRef<TextSplitter | undefined>>\n /** Reactive array of `<span>` elements representing each line after splitting. */\n lines: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each word after splitting. */\n words: ComputedRef<HTMLElement[]>\n /** Reactive array of `<span>` elements representing each character after splitting. */\n chars: ComputedRef<HTMLElement[]>\n /** Removes all split `<span>` wrappers and restores the original text content. */\n revert: () => void\n /** Re-splits the text, updating `lines`, `words`, and `chars` to reflect any DOM or size changes. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `splitText()` into a Vue composable. Reactively re-splits the text when the target or params change, and reverts the DOM automatically on unmount.\n *\n * @param _target - The element(s) whose text content should be split. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param _params - Anime.js text-splitter parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useText(\n _target: MaybeRef<HTMLElement | NodeList | string | HTMLElement[]> | MaybeComputedElementRef,\n _params?: MaybeRef<TextSplitterParams>\n): UseTextReturn {\n const splitter = shallowRef<TextSplitter | undefined>()\n\n const lines = computed<HTMLElement[]>(() => splitter.value?.lines ?? [])\n const words = computed<HTMLElement[]>(() => splitter.value?.words ?? [])\n const chars = computed<HTMLElement[]>(() => splitter.value?.chars ?? [])\n\n const { stop } = watch(\n [() => resolveTarget(_target as AnimationTargets), () => unref(_params)],\n ([el, params]) => {\n revert()\n splitter.value = undefined\n\n if (!el) return\n\n splitter.value = splitText(el as HTMLElement | NodeList | string | HTMLElement[], params)\n },\n { flush: \"post\", immediate: !isRef(_target) }\n )\n\n tryOnUnmounted(() => {\n stop()\n splitter.value = undefined\n revert()\n })\n\n function revert() {\n splitter.value?.revert()\n }\n\n function refresh() {\n splitter.value?.refresh()\n }\n\n return {\n splitter: readonly(splitter),\n lines,\n words,\n chars,\n revert,\n refresh,\n }\n}","import { type MaybeComputedElementRef, tryOnUnmounted } from \"@vueuse/core\"\nimport { type AnimationTargets, resolveTarget } from \"@src/utils/resolve-target.ts\"\nimport {\n type WAAPIAnimationParams,\n type DOMTargetsParam,\n waapi,\n type WAAPIAnimation,\n type EasingFunction,\n} from \"animejs\"\nimport { DeepReadonly, isRef, type MaybeRef, readonly, ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseWaapiReturn {\n /** The underlying Anime.js WAAPI animation instance. `undefined` until the target is available. */\n animation: DeepReadonly<ShallowRef<WAAPIAnimation | undefined>>\n /** Resumes from a paused state. */\n resume: () => WAAPIAnimation | undefined\n /** Pauses the animation at the current position. */\n pause: () => WAAPIAnimation | undefined\n /** Toggles between forward and reverse direction. */\n alternate: () => WAAPIAnimation | undefined\n /** Starts or resumes the animation. */\n play: () => WAAPIAnimation | undefined\n /** Reverses playback direction. */\n reverse: () => WAAPIAnimation | undefined\n /** Seeks to a specific time (in ms). Accepts a reactive ref for the time value. */\n seek: (time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) => WAAPIAnimation | undefined\n /** Restarts the animation from the beginning. */\n restart: () => WAAPIAnimation | undefined\n /** Commits the current animated styles to the element's inline style, then cancels the animation. */\n commitStyles: () => WAAPIAnimation | undefined\n /** Jumps immediately to the end of the animation. */\n complete: () => WAAPIAnimation | undefined\n /** Stops the animation and removes it from the WAAPI engine. */\n cancel: () => WAAPIAnimation | undefined\n /** Cancels the animation and restores all animated properties to their original values. */\n revert: () => WAAPIAnimation | undefined\n /** Converts an Anime.js easing function to a CSS `cubic-bezier()` string usable by WAAPI. */\n convertEase: (fn: MaybeRef<EasingFunction>, samples?: MaybeRef<number>) => string\n}\n\n/**\n * Wraps Anime.js `waapi.animate()` into a Vue composable. Reactively re-creates the WAAPI animation when the target or options change, and stops it automatically on unmount.\n *\n * @param targets - The DOM element(s) to animate via WAAPI. Accepts a template ref, a CSS selector, a DOM element, or a reactive ref to any of these.\n * @param options - Anime.js WAAPI animation parameters. Accepts a plain object or a reactive ref / computed. Defaults to `{}`.\n */\nexport function useWaapi(\n targets: MaybeRef<DOMTargetsParam> | MaybeComputedElementRef,\n options: MaybeRef<WAAPIAnimationParams> = {}\n): UseWaapiReturn {\n const animation = shallowRef<WAAPIAnimation | undefined>()\n\n const { stop } = watch(\n [() => resolveTarget(targets as AnimationTargets), () => unref(options)],\n ([el, opt]) => {\n animation.value = waapi.animate(el as DOMTargetsParam, opt)\n },\n { flush: \"post\", immediate: !isRef(targets) }\n )\n\n tryOnUnmounted(() => {\n stop()\n })\n\n function resume() {\n return animation.value?.resume()\n }\n\n function pause() {\n return animation.value?.pause()\n }\n\n function alternate() {\n return animation.value?.alternate()\n }\n\n function play() {\n return animation.value?.play()\n }\n\n function reverse() {\n return animation.value?.reverse()\n }\n\n function seek(time: MaybeRef<number>, muteCallbacks?: MaybeRef<boolean>) {\n return animation.value?.seek(unref(time), unref(muteCallbacks))\n }\n\n function restart() {\n return animation.value?.restart()\n }\n\n function commitStyles() {\n return animation.value?.commitStyles()\n }\n\n function complete() {\n return animation.value?.complete()\n }\n\n function cancel() {\n return animation.value?.cancel()\n }\n\n function revert() {\n return animation.value?.revert()\n }\n\n return {\n animation: readonly(animation),\n resume,\n pause,\n alternate,\n play,\n reverse,\n seek,\n restart,\n commitStyles,\n complete,\n cancel,\n revert,\n\n convertEase,\n }\n}\n\nfunction convertEase(fn: MaybeRef<EasingFunction>, samples: MaybeRef<number> = 100) {\n return waapi.convertEase(unref(fn), unref(samples))\n}","import { tryOnMounted, tryOnUnmounted } from \"@vueuse/core\"\nimport { createScope, type Scope, type ScopeMethod, type ScopeParams, type Tickable } from \"animejs\"\nimport { isRef, type MaybeRef, shallowReadonly, type ShallowRef, shallowRef, unref, watch } from \"vue\"\n\nexport interface UseScopeReturn {\n /** The underlying Anime.js `Scope` instance. */\n scope: Readonly<ShallowRef<Scope | undefined>>\n /** Registers an anonymous method on the scope. Queued automatically if called before mount. */\n add: (method: ScopeMethod) => void\n /** Registers a named method on the scope so it can be called via `scope.methods[name]()`. Queued automatically if called before mount. */\n registerMethod: (methodName: string, method: ScopeMethod) => void\n /** Registers a method that runs exactly once on the scope. Queued automatically if called before mount. */\n addOnce: (method: ScopeMethod) => void\n /** Keeps the time of another tickable (animation, timer) in sync with this scope. */\n keepTime: (method: (scope: Scope) => Tickable) => void\n /** Cancels the scope and reverts all animations and tickables it owns. */\n revert: () => void\n /** Re-reads default values and media-query breakpoints for the scope. */\n refresh: () => void\n}\n\n/**\n * Wraps Anime.js `createScope()` into a Vue composable. Reactively re-creates the scope when params change, replays all registered methods, and reverts it automatically on unmount.\n *\n * Methods added before mount are queued and replayed once the component is mounted.\n *\n * @param params - Anime.js scope parameters. Accepts a plain object or a reactive ref / computed.\n */\nexport function useScope(params: MaybeRef<ScopeParams>): UseScopeReturn {\n const scope = shallowRef<Scope | undefined>(undefined)\n\n const pending_adds: ScopeMethod[] = []\n const pending_named: [string, ScopeMethod][] = []\n const pending_once: ScopeMethod[] = []\n\n let is_mounted = false\n let stopWatcher: (() => void) | undefined\n\n tryOnMounted(() => {\n is_mounted = true\n scope.value = createScope(unref(params))\n\n for (const method of pending_adds) scope.value.add(method)\n for (const [name, method] of pending_named) scope.value.add(name, method)\n for (const method of pending_once) scope.value.addOnce(method)\n\n pending_adds.length = 0\n pending_named.length = 0\n pending_once.length = 0\n\n if (isRef(params)) {\n stopWatcher = watch(\n params,\n new_params => {\n scope.value?.revert()\n scope.value = createScope(new_params)\n },\n { flush: \"post\" }\n )\n }\n })\n\n tryOnUnmounted(() => {\n scope.value?.revert()\n stopWatcher?.()\n })\n\n function add(method: ScopeMethod) {\n if (!is_mounted) return void pending_adds.push(method)\n return scope.value?.add(method)\n }\n\n function registerMethod(methodName: string, method: ScopeMethod) {\n if (!is_mounted) return void pending_named.push([methodName, method])\n return scope.value?.add(methodName, method)\n }\n\n function addOnce(method: ScopeMethod) {\n if (!is_mounted) return void pending_once.push(method)\n return scope.value?.addOnce(method)\n }\n\n function keepTime(method: (scope: Scope) => Tickable) {\n return scope.value?.keepTime(method)\n }\n\n function revert() {\n return scope.value?.revert()\n }\n\n function refresh() {\n return scope.value?.refresh()\n }\n\n return {\n scope: shallowReadonly(scope),\n add,\n registerMethod,\n addOnce,\n keepTime,\n revert,\n refresh,\n }\n}","import { animate, type AnimationParams, type JSAnimation } from \"animejs\"\nimport type { Directive } from \"vue\"\n\nconst instances = new WeakMap<HTMLElement, JSAnimation>()\n\n/**\n * Declarative animation directive. Applies an Anime.js animation to the element on mount,\n * re-creates it when the binding value changes, and reverts it on unmount.\n *\n * @example\n * <div v-animate=\"{ translateX: 250, duration: 800 }\" />\n * <div v-animate=\"reactiveOptions\" />\n */\nexport const vAnimate: Directive<HTMLElement, AnimationParams> = {\n mounted(el, binding) {\n if (binding.value) instances.set(el, animate(el, binding.value))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const prev = instances.get(el)\n prev?.cancel()\n prev?.revert()\n\n if (binding.value) instances.set(el, animate(el, binding.value))\n },\n unmounted(el) {\n const animation = instances.get(el)\n animation?.cancel()\n animation?.revert()\n instances.delete(el)\n },\n}","import { createDraggable, type Draggable, type DraggableParams } from \"animejs\"\nimport type { Directive } from \"vue\"\n\nconst instances = new WeakMap<HTMLElement, Draggable>()\n\n/**\n * Declarative draggable directive. Makes the element draggable on mount,\n * re-creates it when the binding value changes, and reverts it on unmount.\n *\n * @example\n * <div v-draggable />\n * <div v-draggable=\"{ snap: [0, 100] }\" />\n */\nexport const vDraggable: Directive<HTMLElement, DraggableParams | undefined> = {\n mounted(el, binding) {\n instances.set(el, createDraggable(el, binding.value ?? {}))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n instances.get(el)?.revert()\n instances.set(el, createDraggable(el, binding.value ?? {}))\n },\n unmounted(el) {\n instances.get(el)?.revert()\n instances.delete(el)\n },\n}","import { animate, svg, type AnimationParams, type DrawableSVGGeometry, type JSAnimation } from \"animejs\"\nimport type { Directive } from \"vue\"\n\ninterface Entry {\n drawable: DrawableSVGGeometry\n animation: JSAnimation | undefined\n}\n\nconst instances = new WeakMap<SVGGeometryElement, Entry>()\n\nfunction create(el: SVGGeometryElement, params: AnimationParams | undefined): Entry {\n const drawable = svg.createDrawable(el)[0]\n const animation = params ? animate(drawable, params) : undefined\n return { drawable, animation }\n}\n\n/**\n * Declarative SVG drawable directive. Wraps the SVG geometry element in an Anime.js drawable\n * Proxy and animates the `draw` property on mount. Re-creates it when the binding value changes\n * and reverts on unmount.\n *\n * @example\n * <path v-svg-drawable=\"{ draw: '0 1', duration: 1200 }\" />\n * <path v-svg-drawable=\"{ draw: ['0 0', '0.5 1', '0 1'], ease: 'inOutQuad', loop: true }\" />\n */\nexport const vSvgDrawable: Directive<SVGGeometryElement, AnimationParams | undefined> = {\n mounted(el, binding) {\n instances.set(el, create(el, binding.value))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const entry = instances.get(el)\n entry?.animation?.cancel()\n entry?.animation?.revert()\n instances.set(el, create(el, binding.value))\n },\n unmounted(el) {\n const entry = instances.get(el)\n entry?.animation?.cancel()\n entry?.animation?.revert()\n instances.delete(el)\n },\n}","import { waapi, type WAAPIAnimationParams, type WAAPIAnimation } from \"animejs\"\nimport type { Directive } from \"vue\"\n\ninterface Entry {\n animation: WAAPIAnimation\n originalStyle: string\n}\n\nconst instances = new WeakMap<HTMLElement, Entry>()\n\n/**\n * Declarative WAAPI animation directive. Applies an Anime.js WAAPI animation to the element on\n * mount, re-creates it when the binding value changes, and reverts it on unmount.\n *\n * @example\n * <div v-waapi=\"{ translateX: 250, duration: 800 }\" />\n * <div v-waapi=\"reactiveOptions\" />\n */\nexport const vWaapi: Directive<HTMLElement, WAAPIAnimationParams> = {\n mounted(el, binding) {\n if (binding.value) {\n instances.set(el, {\n animation: waapi.animate(el, binding.value),\n originalStyle: el.style.cssText,\n })\n }\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const entry = instances.get(el)\n if (entry) {\n entry.animation.cancel()\n el.style.cssText = entry.originalStyle\n instances.delete(el)\n }\n\n if (binding.value) {\n instances.set(el, {\n animation: waapi.animate(el, binding.value),\n originalStyle: el.style.cssText,\n })\n }\n },\n unmounted(el) {\n const entry = instances.get(el)\n if (entry) {\n entry.animation.cancel()\n el.style.cssText = entry.originalStyle\n instances.delete(el)\n }\n },\n}","import {\n animate,\n splitText,\n type AnimationParams,\n type JSAnimation,\n type TextSplitter,\n type TextSplitterParams,\n} from \"animejs\"\nimport type { Directive } from \"vue\"\n\nexport interface VTextSplitValue extends TextSplitterParams {\n animation?: AnimationParams\n}\n\ninterface Entry {\n splitter: TextSplitter\n animation: JSAnimation | undefined\n}\n\nconst instances = new WeakMap<HTMLElement, Entry>()\n\nfunction create(el: HTMLElement, value: VTextSplitValue | undefined): Entry {\n const { animation: anim_params, ...splitter_params } = value ?? {}\n const splitter = splitText(el, splitter_params)\n const entry: Entry = { splitter, animation: undefined }\n\n if (anim_params) {\n if (splitter_params.lines) {\n // Line detection waits for document.fonts.ready — defer animation until splitter.lines is populated.\n ;(document.fonts?.ready ?? Promise.resolve()).then(() => {\n if (instances.get(el) === entry) {\n entry.animation = animate(splitter.lines, anim_params)\n }\n })\n } else {\n const targets = splitter_params.chars ? splitter.chars : splitter.words\n entry.animation = animate(targets, anim_params)\n }\n }\n\n return entry\n}\n\nfunction destroy(entry: Entry) {\n entry.animation?.cancel()\n entry.splitter.revert()\n}\n\n/**\n * Declarative text-split directive. Splits the element's text into chars, words, or lines on\n * mount, and optionally animates the resulting spans. Re-creates on binding change, reverts on unmount.\n *\n * @example\n * <p v-text-split=\"{ words: true, animation: { translateY: [20, 0], opacity: [0, 1], delay: stagger(60) } }\">Hello</p>\n * <p v-text-split=\"{ chars: true, animation: { opacity: [0, 1], delay: stagger(30) } }\">Hello</p>\n * <p v-text-split=\"{ lines: true, animation: { translateX: [-20, 0], delay: stagger(100) } }\">Hello</p>\n */\nexport const vTextSplit: Directive<HTMLElement, VTextSplitValue | undefined> = {\n mounted(el, binding) {\n instances.set(el, create(el, binding.value))\n },\n updated(el, binding) {\n if (binding.value === binding.oldValue) return\n const entry = instances.get(el)\n if (entry) destroy(entry)\n instances.set(el, create(el, binding.value))\n },\n unmounted(el) {\n const entry = instances.get(el)\n if (entry) destroy(entry)\n instances.delete(el)\n },\n}"],"mappings":";;;;AAkBA,SAAgB,EAAc,GAAyC;AACrE,QAAO,EAAa,EAAmC;;;;ACuBzD,SAAgB,EAAW,GAA2B,IAAsC,EAAE,EAAoB;CAChH,IAAM,IAAY,GAAyB,EAErC,EAAE,YAAS,EACf,OAAO,EAAc,EAAQ,QAAQ,EAAM,EAAS,CAAC,GACpD,CAAC,GAAI,OAAS;AACb,IAAgB,GAAI,EAAI;IAE1B;EAAE,OAAO;EAAQ,WAAW,CAAC,EAAM,EAAQ;EAAE,CAC9C;AAED,SAAqB;AAEnB,EADA,GAAM,EACN,GAAQ;GACR;CAEF,SAAS,EAAgB,GAAkB,GAAsB;AAG/D,MAFA,GAAQ,EAEJ,CAAC,GAAI;AAEP,GADA,QAAQ,KAAK,sCAAsC,EACnD,EAAU,QAAQ,KAAA;AAClB;;AAGF,IAAU,QAAQ,EAAQ,GAAI,EAAI;;CAGpC,SAAS,IAAO;AACd,SAAO,EAAU,OAAO,MAAM;;CAGhC,SAAS,IAAU;AACjB,SAAO,EAAU,OAAO,SAAS;;CAGnC,SAAS,IAAQ;AACf,SAAO,EAAU,OAAO,OAAO;;CAGjC,SAAS,IAAU;AACjB,SAAO,EAAU,OAAO,SAAS;;CAGnC,SAAS,IAAY;AACnB,SAAO,EAAU,OAAO,WAAW;;CAGrC,SAAS,IAAS;AAChB,SAAO,EAAU,OAAO,Q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C,UAAU,GAAI;EACZ,IAAM,IAAQ,EAAU,IAAI,EAAG;AAE/B,EADI,KAAO,EAAQ,EAAM,EACzB,EAAU,OAAO,EAAG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juleshry/vue-animejs",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Vue 3 composables for Anime.js v4 — reactive animations that integrate naturally with Vue's reactivity system and component lifecycle.",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Vue 3 composables and directives for Anime.js v4 — reactive animations that integrate naturally with Vue's reactivity system and component lifecycle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animation",
|
|
7
7
|
"animejs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@vitest/coverage-v8": "^4.1.4",
|
|
51
51
|
"@vue/test-utils": "^2.4.6",
|
|
52
52
|
"@vueuse/core": ">=14",
|
|
53
|
-
"animejs": "
|
|
53
|
+
"animejs": "4.4.1",
|
|
54
54
|
"bun-types": "^1.3.14",
|
|
55
55
|
"happy-dom": "^20.9.0",
|
|
56
56
|
"oxfmt": "^0.47.0",
|