@infinityfx/lively 4.0.0-beta.1 → 4.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +3 -281
  2. package/dist/animatable.js +1 -1
  3. package/dist/animate.js +1 -1
  4. package/dist/core/action.js +1 -1
  5. package/dist/core/action.js.map +1 -1
  6. package/dist/core/cache.js +1 -1
  7. package/dist/core/cache.js.map +1 -1
  8. package/dist/core/clip.js +1 -1
  9. package/dist/core/clip.js.map +1 -1
  10. package/dist/core/timeline.js +1 -1
  11. package/dist/core/timeline.js.map +1 -1
  12. package/dist/core/track.js +1 -1
  13. package/dist/core/track.js.map +1 -1
  14. package/dist/core/utils.js +1 -1
  15. package/dist/core/utils.js.map +1 -1
  16. package/dist/hooks/use-path.js +1 -1
  17. package/dist/hooks/use-path.js.map +1 -1
  18. package/dist/hooks/use-viewport.js +1 -1
  19. package/dist/hooks/use-visible.js +1 -1
  20. package/dist/layout/layout-group.js +1 -1
  21. package/dist/layout/morph.js +1 -1
  22. package/dist/types/animatable.d.ts +1 -1
  23. package/dist/types/core/track.d.ts +3 -2
  24. package/dist/types/core/utils.d.ts +2 -0
  25. package/dist/types/hooks/use-path.d.ts +1 -1
  26. package/dist/types/hooks/use-viewport.d.ts +1 -1
  27. package/dist/types/hooks/use-visible.d.ts +1 -1
  28. package/dist/types/layout/layout-group.d.ts +2 -5
  29. package/dist/types/layout/morph.d.ts +8 -5
  30. package/package.json +14 -9
  31. package/dist/animations/fade.js +0 -2
  32. package/dist/animations/fade.js.map +0 -1
  33. package/dist/animations/move.js +0 -2
  34. package/dist/animations/move.js.map +0 -1
  35. package/dist/animations/pop.js +0 -2
  36. package/dist/animations/pop.js.map +0 -1
  37. package/dist/animations/scale.js +0 -2
  38. package/dist/animations/scale.js.map +0 -1
  39. package/dist/animations/wipe.js +0 -2
  40. package/dist/animations/wipe.js.map +0 -1
  41. package/dist/animations.js +0 -2
  42. package/dist/animations.js.map +0 -1
  43. package/dist/types/animations/fade.d.ts +0 -3
  44. package/dist/types/animations/move.d.ts +0 -3
  45. package/dist/types/animations/pop.d.ts +0 -3
  46. package/dist/types/animations/scale.d.ts +0 -3
  47. package/dist/types/animations/wipe.d.ts +0 -3
  48. package/dist/types/animations.d.ts +0 -7
package/README.md CHANGED
@@ -8,29 +8,10 @@
8
8
 
9
9
  Feature complete, lightweight react animation library. Lively lets u create complex animations without the hassle.
10
10
 
11
- ## Table of contents
12
- - [Get started](#get-started)
13
- - [Installation](#installation)
14
- - [Usage](#usage)
15
- - [Defining animations](#defining-animations)
16
- - [Components](#components)
17
- - [Animatable `<Animatable />`](#animatable-animatable)
18
- - [Animate `<Animate />`](#animate-animate)
19
- - [LayoutGroup `<LayoutGroup />`](#layoutgroup-layoutgroup)
20
- - [Morph `<Morph />`](#morph-morph)
21
- - [Hooks](#hooks)
22
- - [`useLink()`](#uselink)
23
- - [`useScroll()`](#usescroll)
24
- - [`usePath()`](#usepath)
25
- - [`useAudio()`](#useaudio)
26
- - [`useReducedMotion()`](#usereducedmotion)
27
- - [Animations](#animations)
28
- - [Bundled](#bundled)
29
- - [Creating clips](#creating-clips)
30
-
31
11
  # Get started
32
12
 
33
- ### Visit [infinityfx.dev/lively](https://infinityfx.dev/lively) for the complete and most up to date documentation for Lively.
13
+ ## Documentation
14
+ Visit [infinityfx.dev/lively](https://infinityfx.dev/lively) for the complete documentation.
34
15
 
35
16
  ## Installation
36
17
 
@@ -45,268 +26,9 @@ import { Animatable } from '@infinityfx/lively';
45
26
 
46
27
  ...
47
28
 
48
- <Animatable initial={{ opacity: 0 }} animate={{ opacity: 1 }} triggers={[{ on: 'mount' }]}>
29
+ <Animatable animate={{ opacity: [0, 1] }} triggers={[{ on: 'mount' }]}>
49
30
  <div class="my-class">
50
31
  Lorem ipsum enim amet consequat ut reprehenderit cupidatat et incididunt qui minim culpa. Dolor do laborum nulla pariatur tempor excepteur duis et ipsum.
51
32
  </div>
52
33
  </Animatable>
53
- ```
54
-
55
- ## Defining animations
56
-
57
- The `<Animatable>` component exposes the `animate` and `animations` properties which can be used to define animatable properties, as well as animation options. Animatable properties can accept single values, arrays, functions and [reactive links](#uselink) as arguments.
58
-
59
- ```jsx
60
- <Animatable
61
- animate={{
62
- opacity: 1,
63
- scale: ['0 0', '0.5 0', '1 1'],
64
- borderRadius: (progress) => progress * 10,
65
- duration: 2, // Animation will last 2 seconds
66
- immediate: true // Animation will override any currently playing animation
67
- }}
68
- animations={{
69
- myAnimation: {
70
- opacity: [0, 1, 0.5]
71
- }
72
- }}>
73
- ...
74
- </Animatable>
75
- ```
76
-
77
- # Components
78
-
79
- ## Animatable `<Animatable />`
80
-
81
- Base animation component that allows for fully customizable animations.
82
-
83
- ```jsx
84
- import { Animatable } from '@infinityfx/lively';
85
-
86
- ...
87
-
88
- <Animatable
89
- triggers={[{ on: 'mount' }]}
90
- initial={{ opacity: 0 }}
91
- animate={{ opacity: 1 }}>
92
- <div>...</div>
93
- </Animatable>
94
- ```
95
-
96
- ## Animate `<Animate />`
97
-
98
- Fully automated animations based on animation clips.
99
-
100
- ```jsx
101
- import { Animate } from '@infinityfx/lively';
102
- import { Scale, Fade } from '@infinityfx/lively/animations';
103
-
104
- ...
105
-
106
- <Animate animations={[Scale.unique({ duration: 2 }), Fade]} triggers={[{ on: 'mount' }]}>
107
- <div class="my-class">
108
- ...
109
- </div>
110
- </Animate>
111
- ```
112
-
113
- ## LayoutGroup `<LayoutGroup />`
114
-
115
- Allows for animating direct `<Animatable />` and `<Animate />` child components, when their layout changes or the our unmounted. This requires the respective child components to have a key specified.
116
-
117
- ```jsx
118
- import { Animatable } from '@infinityfx/lively';
119
- import { LayoutGroup } from '@infinityfx/lively/layout';
120
-
121
- ...
122
-
123
- <LayoutGroup>
124
- <Animatable key="mykey" unmount animate={{ opacity: 1 }} initial={{ opacity: 0 }}>
125
- <div class="my-class">
126
- Hello world!
127
- </div>
128
- </Animatable>
129
- </LayoutGroup>
130
- ```
131
-
132
- ## Morph `<Morph />`
133
-
134
- Morphs one element into another.
135
-
136
- ```jsx
137
- import { useState } from 'react';
138
- import { Morph } from '@infinityfx/lively/layout';
139
-
140
- ...
141
-
142
- const [state, setState] = useState(false);
143
-
144
- ...
145
-
146
- <Morph id="mymorph" shown={state}>
147
- <div onClick={() => setState(!state)}>
148
- ...
149
- </div>
150
- </Morph>
151
-
152
- <Morph id="mymorph" shown={!state} transition={{ duration: 0.5 }}>
153
- <div onClick={() => setState(!state)}>
154
- ...
155
- </div>
156
- </Morph>
157
- ```
158
-
159
- # Hooks
160
-
161
- Lively comes with a set of hooks that allow for the creation of complex reactive animations.
162
-
163
- ## `useLink()`
164
-
165
- The useLink hook can be used to create a reactive value, which can be linked to animation components to animate different properties based on the value.
166
-
167
- ```jsx
168
- import { useEffect } from 'react';
169
- import { useLink } from '@infinityfx/lively/hooks';
170
- import { Animatable } from '@infinityfx/lively';
171
-
172
- export default function Page() {
173
-
174
- const [link, setValue] = useLink(0 /* initial value */);
175
-
176
- useEffect(() => {
177
- setTimeout(() => setValue(1), 1000); // set the animation value to 1, 1 second after the component has mounted.
178
- }, []);
179
-
180
- return <Animatable animate={{
181
- opacity: link
182
- }}>...</Animatable>;
183
-
184
- }
185
- ```
186
-
187
- Additionally you can provide a link with a function to transform the value to a more usable format for certain animation properties.
188
-
189
- ```jsx
190
- const [link, setValue] = useLink(0 /* initial value */);
191
-
192
- ...
193
-
194
- <Animatable animate={{
195
- translate: link(input => {
196
- return `${input} ${input}`; // we return a string instead of a number for the translate property.
197
- })
198
- }}>...</Animatable>;
199
- ```
200
-
201
- ## `useScroll()`
202
-
203
- The `useScroll` hook returns a reactive link that corresponds to the current scroll position of the window.
204
-
205
- ```jsx
206
- const value = useScroll();
207
-
208
- ...
209
-
210
- // gradually fade in element when scrolling the window
211
- <Animatable animate={{
212
- opacity: value(val => val / document.body.scrollHeight)
213
- }}>...</Animatable>;
214
- ```
215
-
216
- ## `usePath()`
217
-
218
- The `usePath` hook can be used to animate an element along an SVG path.
219
-
220
- ```jsx
221
- const [link, ref] = usePath();
222
-
223
- ...
224
-
225
- <>
226
- <Animatable animate={{
227
- translate: link(([x, y]) => `${x} ${y}`)
228
- }}>...</Animatable>
229
-
230
- <svg>
231
- <path ref={ref} d="..." />
232
- </svg>
233
- </>;
234
- ```
235
-
236
- ## `useAudio()`
237
-
238
- The `useAudio` hook can be used to create animations that react to the frequency response of playing audio.
239
-
240
- ```jsx
241
- const [source, link] = useAudio({ bands: 8 });
242
-
243
- ...
244
-
245
- <>
246
- <Animatable animate={{
247
- scale: link((values, i) => `1 ${values[i]}`)
248
- }}>...</Animatable>
249
-
250
- <audio ref={source} src="myaudio.mp3">
251
- </>;
252
- ```
253
-
254
- ## `useReducedMotion()`
255
-
256
- The `useReducedMotion` hook checks whether a user prefers the use of reduced motion on a page.
257
-
258
- ```jsx
259
- const reduced = useReducedMotion();
260
-
261
- ...
262
-
263
- // If the user prefers reduced motion, then pause the animation.
264
- <Animatable animate={{ ... }} paused={reduced}>...</Animatable>;
265
- ```
266
-
267
- # Animations
268
-
269
- ## Bundled
270
-
271
- Lively exports a submodule called animations which contains various animation clips that can be used in tandem with the `<Animate />` and `<Animatable />` components. These animations can be used as is, or can be configured by calling `.unique()` on the respective animation.
272
-
273
- ```jsx
274
- import { Move, Scale } from '@infinityfx/lively/animations';
275
- import { Animate } from '@infinityfx/lively/auto';
276
- import { Animatable } from '@infinityfx/lively';
277
-
278
- ...
279
-
280
- const myClip = Move.unique({ duration: 2 }); // configure the animation
281
-
282
- ...
283
-
284
- <>
285
- <Animate animations={[myClip]}>...</Animate>
286
-
287
- <Animatable animations={{
288
- myAnimation: Scale,
289
- myOtherAnimation: Scale.unique({ delay: 1 })
290
- }}>...</Animatable>
291
- </>
292
- ```
293
-
294
- ## Creating clips
295
-
296
- If you whish to create your own animation clip to reuse later on, you can do so using `new Clip()`. This constructor takes 2 arguments, some animation properties and some optional initial values.
297
-
298
- ```js
299
- import { Clip } from '@infinityfx/lively/animations';
300
-
301
- const myCustomAnimation = new Clip(
302
- {
303
- opacity: 1, // value to animate to
304
- duration: 2 // Clip will have a duration of 2 seconds
305
- },
306
- {
307
- opacity: 0 // initial value
308
- }
309
- );
310
-
311
- export default myCustomAnimation;
312
34
  ```
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{__rest as e}from"tslib";import{jsx as n}from"react/jsx-runtime";import{createContext as r,useRef as t,use as i,useMemo as a,useCallback as o,useImperativeHandle as s,useEffect as u,Children as l,isValidElement as c,cloneElement as d}from"react";import m from"./core/clip.js";import f from"./core/timeline.js";import{merge as p,pick as h,combineRefs as v}from"./core/utils.js";import g from"./hooks/use-mount-effect.js";const y=r(null);function b(r){const b=t(null),j=t([]),x=i(y),w=r.inherit&&x?p({},r,h(x,["group","animations","triggers","animate","initial","stagger","staggerLimit","deform","disabled","paused"])):r,{id:O="",inherit:k,triggers:L=[],disabled:E,adaptive:z=!1,manual:A=!1,paused:C}=w,M=void 0!==r.order?r.order:(k&&(null==x?void 0:x.index)||0)+1,D=t([]),F=a((()=>{const e={animate:m.from(w.animate,w.initial)};for(const n in w.animations)e[n]=m.from(w.animations[n],w.initial);return e}),[]),T=t(new f(Object.assign(Object.assign({},w),{mountClips:L.reduce(((e,{name:n,on:r})=>("mount"===r&&e.push(F[n||"animate"]),e)),[])}))),V=o(((e,n={},t=1)=>{var i;const a=F[e];if(E||M>1&&t<2)return 0;p(n,{reverse:null==a?void 0:a.reverse});let o=0,s=n.delay||0,u=a?T.current.time(a):0;for(const r of j.current)(null===(i=r.current)||void 0===i?void 0:i.inherit)&&(o=Math.max(r.current.play(e,p({delay:s+u},n),t+1),o));const l=(n.reverse?o:s)*(M/t);return a&&T.current.add(a,p({delay:l},n)),r.onAnimationEnd&&setTimeout(r.onAnimationEnd.bind({},e),1e3*(u+l)),u+l}),[E,M]);function q(n,r={}){let t=0;for(let i of L){const{name:a,on:o}=i,s=e(i,["name","on"]);o===n&&(t=Math.max(V(a||"animate",p(s,r)),t))}return t}return s(v(b,r.ref),(()=>({play:V,trigger:q,timeline:T.current,children:j.current,inherit:k,adaptive:z,manual:A,id:O})),[L]),u((()=>T.current.pause(!(!C&&!E))),[C,E]),u((()=>{for(let n=0;n<L.length;n++){let r=L[n],{name:t,on:i}=r,a=e(r,["name","on"]);if("string"==typeof i)continue;const o="boolean"==typeof i?i:i.called,s=D.current[n];void 0!==s&&o&&o!==s&&V(t||"animate",a),D.current[n]=o}}),[L]),g((()=>(T.current.link(w.animate),window.addEventListener("resize",T.current.cache),null==x||x.add(b),document.fonts.ready.then((()=>{A||T.current.mounted||q("mount"),T.current.mounted=!0})),()=>{window.removeEventListener("resize",T.current.cache),T.current.unlink(),null==x||x.remove(b)})),[]),n(y,{value:Object.assign(Object.assign({},r.passthrough?x:Object.assign({index:M},w)),{add:e=>{r.passthrough&&(null==x||x.add(e)),j.current.includes(e)||j.current.push(e)},remove:e=>{r.passthrough&&(null==x||x.remove(e));const n=j.current.indexOf(e)||-1;n>=0&&j.current.splice(n,1)}}),children:l.map(r.children,(e=>!c(e)||e.type instanceof Function?e:d(e,{ref:v((e=>T.current.insert(e)),e.ref),pathLength:1,style:p({backfaceVisibility:"hidden",willChange:"transform"},e.props.style,F.animate.initial,{strokeDasharray:1}),"data-lively-offset-boundary":!(!["x","y"].some((e=>{var n;return null===(n=r.cachable)||void 0===n?void 0:n.includes(e)}))&&void 0!==r.cachable)||void 0})))})}b.isLively=!0;export{y as AnimatableContext,b as default};
2
+ import{__rest as e}from"tslib";import{jsx as n}from"react/jsx-runtime";import{createContext as r,useRef as t,use as i,useMemo as o,useCallback as a,useImperativeHandle as s,useEffect as u,Children as l,isValidElement as c,cloneElement as d}from"react";import m from"./core/clip.js";import f from"./core/timeline.js";import{merge as p,pick as h,combineRefs as v}from"./core/utils.js";import g from"./hooks/use-mount-effect.js";const y=r(null);function b(r){const b=t(null),j=t([]),x=i(y),w=r.inherit&&x?p({},r,h(x,["group","animations","triggers","animate","initial","stagger","staggerLimit","deform","disabled","paused"])):r,{id:O="",inherit:k,triggers:L=[],disabled:E,adaptive:z=!1,manual:A=!1,paused:C}=w,M=void 0!==r.order?r.order:(k&&(null==x?void 0:x.index)||0)+1,D=t([]),T=o((()=>{const e={animate:m.from(w.animate,w.initial)};for(const n in w.animations)e[n]=m.from(w.animations[n],w.initial);return e}),[]),V=t(new f(Object.assign(Object.assign({},w),{mountClips:L.reduce(((e,{name:n,on:r})=>("mount"===r&&e.push(T[n||"animate"]),e)),[])}))),q=a(((e,n={},t=1)=>{var i;const o=T[e];if(E||M>1&&t<2)return 0;p(n,{reverse:null==o?void 0:o.reverse});let a=0,s=n.delay||0,u=o?V.current.time(o):0;for(const r of j.current)(null===(i=r.current)||void 0===i?void 0:i.inherit)&&(a=Math.max(r.current.play(e,p({delay:s+u},n),t+1),a));const l=(n.reverse?a:s)*(M/t);return o&&V.current.add(o,p({delay:l},n)),r.onAnimationEnd&&setTimeout(r.onAnimationEnd.bind({},e),1e3*(u+l)),u+l}),[E,M]);function B(n,r={}){let t=0;for(let i of L){const{name:o,on:a}=i,s=e(i,["name","on"]);a===n&&(t=Math.max(q(o||"animate",p(s,r)),t))}return t}return s(v(b,r.ref),(()=>({play:q,trigger:B,timeline:V.current,children:j.current,inherit:k,adaptive:z,group:w.group,id:O})),[L]),u((()=>V.current.pause(!(!C&&!E))),[C,E]),u((()=>{for(let n=0;n<L.length;n++){let r=L[n],{name:t,on:i}=r,o=e(r,["name","on"]);if("string"==typeof i)continue;const a="boolean"==typeof i?i:i.called,s=D.current[n];void 0!==s&&a&&a!==s&&q(t||"animate",o),D.current[n]=a}}),[L]),g((()=>{const e=()=>V.current.cache();return V.current.link(w.animate),window.addEventListener("resize",e),null==x||x.add(b),document.fonts.ready.then((()=>{A||V.current.mounted||B("mount"),V.current.mounted=!0})),()=>{window.removeEventListener("resize",e),V.current.unlink(),null==x||x.remove(b)}}),[]),n(y,{value:Object.assign(Object.assign({},r.passthrough?x:Object.assign({index:M},w)),{add:e=>{r.passthrough&&(null==x||x.add(e)),j.current.includes(e)||j.current.push(e)},remove:e=>{r.passthrough&&(null==x||x.remove(e));const n=j.current.indexOf(e)||-1;n>=0&&j.current.splice(n,1)}}),children:l.map(r.children,(e=>c(e)?d(e,{ref:v((e=>V.current.insert(e)),e.props.ref),pathLength:1,style:p({backfaceVisibility:"hidden",willChange:"transform"},e.props.style,T.animate.initial,{strokeDasharray:1}),"data-lively-offset-boundary":!(!["x","y"].some((e=>{var n;return null===(n=r.cachable)||void 0===n?void 0:n.includes(e)}))&&void 0!==r.cachable)||void 0}):e))})}b.isLively=!0;export{y as AnimatableContext,b as default};
3
3
  //# sourceMappingURL=animatable.js.map
package/dist/animate.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{__rest as i}from"tslib";import{jsx as r,Fragment as t}from"react/jsx-runtime";import{Children as n,isValidElement as e,cloneElement as o}from"react";import m from"./animatable.js";import a from"./animations/move.js";import s from"./animations/pop.js";function l(l){var{children:p,animations:c=[a,s],levels:f=2}=l,h=i(l,["children","animations","levels"]);return r(t,{children:function i(t,a=f){let s,l=f-a;for(;!(s=c[l])&&l>=0;)l--;return a<1||n.count(t)<1?t:r(m,Object.assign({},h,{animate:s,inherit:a<f||h.inherit,children:n.map(t,(r=>e(r)?o(r,{},i(r.props.children,a-1)):r))}))}(p)})}l.isLively=!0;export{l as default};
2
+ import{__rest as i}from"tslib";import{jsx as r,Fragment as t}from"react/jsx-runtime";import{Children as e,isValidElement as n,cloneElement as a}from"react";import o from"./animatable.js";function l(l){var{children:m,animations:p=[{translate:["0px 16px","0px 0px"],opacity:[0,1],duration:.35}],levels:s=2}=l,c=i(l,["children","animations","levels"]);return r(t,{children:function i(t,l=s){let m,f=s-l;for(;!(m=p[f])&&f>=0;)f--;return l<1||e.count(t)<1?t:r(o,Object.assign({},c,{animate:m,inherit:l<s||c.inherit,children:e.map(t,(r=>n(r)?a(r,{},i(r.props.children,l-1)):r))}))}(m)})}l.isLively=!0;export{l as default};
3
3
  //# sourceMappingURL=animate.js.map
@@ -1,2 +1,2 @@
1
- class i{constructor(i,t,s,n={}){this.commit=!0,this.onfinish=null,this.composite=s.composite,s.composite="combine"===s.composite?"accumulate":"replace",this.animation=i.element.animate(t,s),this.dynamic=n,this.track=i,this.animation.onfinish=this.finish.bind(this)}finish(){var i;try{this.commit&&this.animation.commitStyles()}catch(i){}this.animation.cancel(),null===(i=this.onfinish)||void 0===i||i.call(this)}step(i){var t,s,n;const o=(null===(t=this.animation.effect)||void 0===t?void 0:t.getComputedTiming().progress)||0;for(const t in this.dynamic)this.track.apply(t,null===(n=(s=this.dynamic)[t])||void 0===n?void 0:n.call(s,o,i))}}export{i as default};
1
+ class i{constructor(i,t,s,n={}){this.commit=!0,this.onfinish=null,this.composite=s.composite,s.composite="combine"===s.composite?"accumulate":"replace",this.animation=i.element.animate(t,s),this.dynamic=n,this.track=i,this.animation.onfinish=this.finish.bind(this)}finish(){var i;try{this.commit&&this.animation.commitStyles()}catch(i){}this.animation.cancel(),null===(i=this.onfinish)||void 0===i||i.call(this)}step(i){var t,s;const n=(null===(t=this.animation.effect)||void 0===t?void 0:t.getComputedTiming().progress)||0;for(const t in this.dynamic)this.track.apply(t,null===(s=this.dynamic[t])||void 0===s?void 0:s.call(this.track,n,i))}}export{i as default};
2
2
  //# sourceMappingURL=action.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"action.js","sources":["../../src/core/action.ts"],"sourcesContent":[null],"names":["Action","constructor","track","keyframes","config","dynamic","this","commit","onfinish","composite","animation","element","animate","finish","bind","commitStyles","ex","cancel","_a","call","step","index","progress","effect","getComputedTiming","prop","apply","_b","_c"],"mappings":"AAGc,MAAOA,EASjB,WAAAC,CAAYC,EAAcC,EAAkDC,EAAqFC,EAA6B,CAAA,GAN9LC,KAAMC,QAAY,EAIlBD,KAAQE,SAAwB,KAG5BF,KAAKG,UAAYL,EAAOK,UACvBL,EAAeK,UAAiC,YAArBL,EAAOK,UAA0B,aAAe,UAC5EH,KAAKI,UAAYR,EAAMS,QAAQC,QAAQT,EAAWC,GAClDE,KAAKD,QAAUA,EACfC,KAAKJ,MAAQA,EAEbI,KAAKI,UAAUF,SAAWF,KAAKO,OAAOC,KAAKR,KAC9C,CAED,MAAAO,SACI,IACQP,KAAKC,QAAQD,KAAKI,UAAUK,cACnC,CAAC,MAAOC,GAAM,CACfV,KAAKI,UAAUO,SAEF,QAAbC,EAAAZ,KAAKE,gBAAQ,IAAAU,GAAAA,EAAAC,KAAAb,KAChB,CAED,IAAAc,CAAKC,aACD,MAAMC,WAAWJ,EAAAZ,KAAKI,UAAUa,6BAAQC,oBAAoBF,WAAY,EAExE,IAAK,MAAMG,KAAQnB,KAAKD,QACpBC,KAAKJ,MAAMwB,MAAMD,EAAmD,WAA7CE,EAAArB,KAAKD,SAAQoB,UAAgC,IAAAG,OAAA,EAAAA,EAAAT,KAAAQ,EAAGL,EAAUD,GAExF"}
1
+ {"version":3,"file":"action.js","sources":["../../src/core/action.ts"],"sourcesContent":[null],"names":["Action","constructor","track","keyframes","config","dynamic","this","commit","onfinish","composite","animation","element","animate","finish","bind","commitStyles","ex","cancel","_a","call","step","index","progress","effect","getComputedTiming","prop","apply","_b"],"mappings":"AAGc,MAAOA,EASjB,WAAAC,CAAYC,EAAcC,EAAkDC,EAAqFC,EAA6B,CAAA,GAN9LC,KAAMC,QAAY,EAIlBD,KAAQE,SAAwB,KAG5BF,KAAKG,UAAYL,EAAOK,UACvBL,EAAeK,UAAiC,YAArBL,EAAOK,UAA0B,aAAe,UAC5EH,KAAKI,UAAYR,EAAMS,QAAQC,QAAQT,EAAWC,GAClDE,KAAKD,QAAUA,EACfC,KAAKJ,MAAQA,EAEbI,KAAKI,UAAUF,SAAWF,KAAKO,OAAOC,KAAKR,KAC9C,CAED,MAAAO,SACI,IACQP,KAAKC,QAAQD,KAAKI,UAAUK,cACnC,CAAC,MAAOC,GAAM,CACfV,KAAKI,UAAUO,SAEF,QAAbC,EAAAZ,KAAKE,gBAAQ,IAAAU,GAAAA,EAAAC,KAAAb,KAChB,CAED,IAAAc,CAAKC,WACD,MAAMC,WAAWJ,EAAAZ,KAAKI,UAAUa,6BAAQC,oBAAoBF,WAAY,EAExE,IAAK,MAAMG,KAAQnB,KAAKD,QACpBC,KAAKJ,MAAMwB,MAAMD,EAAqD,QAA/CE,EAAArB,KAAKD,QAAQoB,UAAkC,IAAAE,OAAA,EAAAA,EAAAR,KAAKb,KAAKJ,MAAOoB,EAAUD,GAExG"}
@@ -1,2 +1,2 @@
1
- import e from"./clip.js";class t{constructor(e,t=["x","y","sx","sy","borderRadius","backgroundColor","color","rotate","opacity"]){this.element=e,this.include=t.map((e=>"strokeLength"===e?"strokeDashoffset":e)),this.computed=getComputedStyle(e),this.data=this.read()}read(){const e={};for(const t of this.include)e[t]=this.computed[t];if(this.element instanceof SVGElement)return e;e.sx=this.element.offsetWidth,e.sy=this.element.offsetHeight,e.x=e.sx/2,e.y=e.sy/2;let t=this.element;for(;t&&(e.x+=t.offsetLeft,e.y+=t.offsetTop,t=t.offsetParent,!(null==t?void 0:t.dataset.livelyOffsetBoundary)););return e}update(){this.data=this.read()}difference(t=this.data,{duration:s=.5,easing:o="ease",reverse:i=!1}){const a=this.read(),r=[[1,1],[1,1]],n=[["0px","0px"],["0px","0px"]],c={duration:s,easing:o,reverse:i,composite:"combine"},d=Object.assign(Object.assign({},c),{composite:"override"});for(const e of this.include)switch(e){case"x":case"y":n[0]["x"==e?0:1]=t[e]-a[e]+"px";break;case"sx":case"sy":r[0]["sx"==e?0:1]=0===a[e]?1:t[e]/a[e];break;default:d[e]=[t[e],a[e]]}return c.scale=r.map((e=>e.join(" "))),c.translate=n.map((e=>e.join(" "))),[new e(c),new e(d)]}}export{t as StyleCache};
1
+ import e from"./clip.js";class t{constructor(e,t=["x","y","sx","sy","borderRadius","backgroundColor","color","rotate"]){this.element=e,this.include=t.map((e=>"strokeLength"===e?"strokeDashoffset":e)),this.computed=getComputedStyle(e),this.data=this.read()}read(){const e={};for(const t of this.include)e[t]=this.computed[t];if(this.element instanceof SVGElement)return e;e.sx=this.element.offsetWidth,e.sy=this.element.offsetHeight,e.x=e.sx/2,e.y=e.sy/2;let t=this.element;for(;t&&(e.x+=t.offsetLeft,e.y+=t.offsetTop,t=t.offsetParent,!(null==t?void 0:t.dataset.livelyOffsetBoundary)););return e}update(){this.data=this.read()}difference(t=this.data,{duration:s=.5,easing:o="ease",reverse:i=!1}){const a=this.read(),r=[[1,1],[1,1]],n=[["0px","0px"],["0px","0px"]],c={duration:s,easing:o,reverse:i,composite:"combine"},d=Object.assign(Object.assign({},c),{composite:"override"});for(const e of this.include)switch(e){case"x":case"y":n[0]["x"==e?0:1]=t[e]-a[e]+"px";break;case"sx":case"sy":r[0]["sx"==e?0:1]=0===a[e]?1:t[e]/a[e];break;default:d[e]=[t[e],a[e]]}return c.scale=r.map((e=>e.join(" "))),c.translate=n.map((e=>e.join(" "))),[new e(c),new e(d)]}}export{t as StyleCache};
2
2
  //# sourceMappingURL=cache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache.js","sources":["../../src/core/cache.ts"],"sourcesContent":[null],"names":["StyleCache","constructor","element","include","this","map","key","computed","getComputedStyle","data","read","prop","SVGElement","sx","offsetWidth","sy","offsetHeight","x","y","parent","offsetLeft","offsetTop","offsetParent","dataset","livelyOffsetBoundary","update","difference","from","duration","easing","reverse","to","scale","translate","keyframes1","composite","keyframes2","Object","assign","val","join","Clip"],"mappings":"+BAeaA,EAOT,WAAAC,CAAYC,EAAmCC,EAAyB,CAAC,IAAK,IAAK,KAAM,KAAM,eAAgB,kBAAmB,QAAS,SAAU,YACjJC,KAAKF,QAAUA,EACfE,KAAKD,QAAUA,EAAQE,KAAIC,GAAe,iBAARA,EAAyB,mBAAqBA,IAChFF,KAAKG,SAAWC,iBAAiBN,GACjCE,KAAKK,KAAOL,KAAKM,MACpB,CAED,IAAAA,GACI,MAAMD,EAAO,CAAA,EAGb,IAAK,MAAME,KAAQP,KAAKD,Q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,EAAU5B,KAAIkC,GAAOA,EAAIC,KAAK,OAE9C,CAAC,IAAIC,EAAKP,GAAa,IAAIO,EAAKL,GAC1C"}
1
+ {"version":3,"file":"cache.js","sources":["../../src/core/cache.ts"],"sourcesContent":[null],"names":["StyleCache","constructor","element","include","this","map","key","computed","getComputedStyle","data","read","prop","SVGElement","sx","offsetWidth","sy","offsetHeight","x","y","parent","offsetLeft","offsetTop","offsetParent","dataset","livelyOffsetBoundary","update","difference","from","duration","easing","reverse","to","scale","translate","keyframes1","composite","keyframes2","Object","assign","val","join","Clip"],"mappings":"+BAeaA,EAOT,WAAAC,CAAYC,EAAmCC,EAAyB,CAAC,IAAK,IAAK,KAAM,KAAM,eAAgB,kBAAmB,QAAS,WACvIC,KAAKF,QAAUA,EACfE,KAAKD,QAAUA,EAAQE,KAAIC,GAAe,iBAARA,EAAyB,mBAAqBA,IAChFF,KAAKG,SAAWC,iBAAiBN,GACjCE,KAAKK,KAAOL,KAAKM,MACpB,CAED,IAAAA,GACI,MAAMD,EAAO,CAAA,EAGb,IAAK,MAAME,KAAQP,KAAKD,QAASM,EAAKE,GAAQP,KAAKG,SAASI,GAE5D,GAAIP,KAAKF,mBAAmBU,WAAY,OAAOH,EAC/CA,EAAKI,GAAKT,KAAKF,QAAQY,YACvBL,EAAKM,GAAKX,KAAKF,QAAQc,aACvBP,EAAKQ,EAAIR,EAAKI,GAAK,EACnBJ,EAAKS,EAAIT,EAAKM,GAAK,EAEnB,IAAII,EAA6Bf,KAAKF,QACtC,KAAOiB,IACHV,EAAKQ,GAAKE,EAAOC,WACjBX,EAAKS,GAAKC,EAAOE,UAEjBF,EAASA,EAAOG,eACZH,aAAM,EAANA,EAAQI,QAAQC,yBAGxB,OAAOf,CACV,CAED,MAAAgB,GACIrB,KAAKK,KAAOL,KAAKM,MACpB,CAED,UAAAgB,CAAWC,EAAkBvB,KAAKK,MAAMmB,SAAEA,EAAW,GAAGC,OAAEA,EAAS,OAAMC,QAAEA,GAAU,IACjF,MAAMC,EAAK3B,KAAKM,OAEVsB,EAAQ,CAAC,CAAC,EAAG,GAAI,CAAC,EAAG,IACvBC,EAAY,CAAC,CAAC,MAAO,OAAQ,CAAC,MAAO,QACnCC,EAA6B,CAAEN,WAAUC,SAAQC,UAASK,UAAW,WACvEC,EAAkCC,OAAAC,OAAAD,OAAAC,OAAA,GAAAJ,IAAYC,UAAW,aAE7D,IAAK,MAAM7B,KAAOF,KAAKD,QACnB,OAAQG,GACJ,IAAK,IACL,IAAK,IACD2B,EAAU,GAAU,KAAP3B,EAAa,EAAI,GAAKqB,EAAKrB,GAAOyB,EAAGzB,GAAO,KACzD,MACJ,IAAK,KACL,IAAK,KACD0B,EAAM,GAAU,MAAP1B,EAAc,EAAI,GAAiB,IAAZyB,EAAGzB,GAAa,EAAIqB,EAAKrB,GAAOyB,EAAGzB,GACnE,MACJ,QAAS8B,EAAW9B,GAAO,CAACqB,EAAKrB,GAAeyB,EAAGzB,IAO3D,OAHA4B,EAAWF,MAAQA,EAAM3B,KAAIkC,GAAOA,EAAIC,KAAK,OAC7CN,EAAWD,UAAYA,EAAU5B,KAAIkC,GAAOA,EAAIC,KAAK,OAE9C,CAAC,IAAIC,EAAKP,GAAa,IAAIO,EAAKL,GAC1C"}
package/dist/core/clip.js CHANGED
@@ -1,2 +1,2 @@
1
- import{__rest as t}from"tslib";import e from"./action.js";import{isLink as i}from"./link.js";import{normalizeAnimatableKeyframes as s,distributeAnimatableKeyframes as r,merge as n}from"./utils.js";class a{constructor(e,a){var{duration:o=1,delay:h=0,repeat:l=1,alternate:m=!1,easing:c="ease",reverse:y=!1,composite:p="none"}=e,d=t(e,["duration","delay","repeat","alternate","easing","reverse","composite"]);void 0===a&&(a={}),this.dynamic={};const f={};for(let t in d){let e=d[t],n=a[t];if(e instanceof Function){i(e)||(this.dynamic[t]=e);continue}const o=Array.isArray(e)?e:[e];o.length<2&&void 0!==n&&o.unshift(n),null===o[0]&&(void 0!==n?o[0]=n:o.splice(0,1)),s(o)&&r(t,o,f)}this.keyframes=Object.values(f),this.initial=n({},a,this.keyframes.length?this.keyframes[0]:{}),delete this.initial.offset,this.isEmpty=!this.keyframes.length&&!Object.keys(this.dynamic).length,this.duration=this.isEmpty?0:o,this.delay=h,this.repeat=l,this.alternate=m,this.easing=c,this.reverse=y,this.composite=p}static from(t,e){return t instanceof a?t:new a(t||{},e)}unique(t){const e=new a({});for(const i in this)this.hasOwnProperty(i)&&(e[i]=i in t?t[i]:this[i]);return e}play(t,{composite:i=this.composite,reverse:s=this.reverse,commit:r=!0,delay:n=0}){if(this.isEmpty)return;const a=new e(t,this.keyframes,{duration:1e3*this.duration,delay:1e3*(n+this.delay),iterations:this.repeat,direction:this.alternate?s?"alternate-reverse":"alternate":s?"reverse":"normal",fill:"both",easing:this.easing,composite:i},this.dynamic);a.commit=r,t.push(a)}}export{a as default};
1
+ import{__rest as t}from"tslib";import e from"./action.js";import{isLink as i}from"./link.js";import{normalizeAnimatableKeyframes as s,createDynamic as r,distributeAnimatableKeyframes as a,merge as n}from"./utils.js";class o{constructor(e,o){var{duration:h=1,delay:l=0,repeat:m=1,alternate:c=!1,easing:d="ease",reverse:y=!1,composite:p="none"}=e,f=t(e,["duration","delay","repeat","alternate","easing","reverse","composite"]);void 0===o&&(o={}),this.dynamic={};const u={};for(let t in f){let e=f[t],n=o[t];if(e instanceof Function){i(e)||(this.dynamic[t]=e);continue}const h=Array.isArray(e)?e:[e];h.length<2&&void 0!==n&&h.unshift(n),null===h[0]&&(void 0!==n?h[0]=n:h.splice(0,1)),s(h)&&("borderRadius"!==t?a(t,h,u):this.dynamic[t]=r(t,Object.values(a(t,h)),d))}this.keyframes=Object.values(u),this.initial=n({},o,this.keyframes.length?this.keyframes[0]:{}),delete this.initial.offset,this.isEmpty=!this.keyframes.length&&!Object.keys(this.dynamic).length,this.duration=this.isEmpty?0:h,this.delay=l,this.repeat=m,this.alternate=c,this.easing=d,this.reverse=y,this.composite=p}static from(t,e){return t instanceof o?t:new o(t||{},e)}unique(t){const e=new o({});for(const i in this)this.hasOwnProperty(i)&&(e[i]=i in t?t[i]:this[i]);return e}play(t,{composite:i=this.composite,reverse:s=this.reverse,commit:r=!0,delay:a=0}){if(this.isEmpty)return;const n=new e(t,this.keyframes,{duration:1e3*this.duration,delay:1e3*(a+this.delay),iterations:this.repeat,direction:this.alternate?s?"alternate-reverse":"alternate":s?"reverse":"normal",fill:"both",easing:this.easing,composite:i},this.dynamic);n.commit=r,t.push(n)}}export{o as default};
2
2
  //# sourceMappingURL=clip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clip.js","sources":["../../src/core/clip.ts"],"sourcesContent":[null],"names":["Clip","constructor","_a","initial","duration","delay","repeat","alternate","easing","reverse","composite","properties","__rest","this","dynamic","keyframes","prop","val","init","Function","isLink","arr","Array","isArray","length","undefined","unshift","splice","normalizeAnimatableKeyframes","distributeAnimatableKeyframes","Object","values","merge","offset","isEmpty","keys","from","data","unique","config","clip","key","hasOwnProperty","play","track","commit","action","Action","iterations","direction","fill","push"],"mappings":"qMAoCc,MAAOA,EAcjB,WAAAC,CAAYC,EAAiJC,GAAjJ,IAAAC,SAAEA,EAAW,EAACC,MAAEA,EAAQ,EAACC,OAAEA,EAAS,EAACC,UAAEA,GAAY,EAAKC,OAAEA,EAAS,OAAMC,QAAEA,GAAU,EAAKC,UAAEA,EAAY,QAAuCR,EAA5BS,EAAUC,EAAAV,EAA7H,+EAAiJ,IAAAC,IAAAA,EAAgC,CAAA,GAV7LU,KAAOC,QAAsB,GAWzB,MAAMC,EAEF,CAAA,EAEJ,IAAK,IAAIC,KAAQL,EAAY,CACzB,IAAIM,EAAMN,EAAWK,GAAwBE,EAAOf,EAAQa,GAE5D,GAAIC,aAAeE,SAAU,CACpBC,EAAOH,KAAMJ,KAAKC,QAAQE,GAAyBC,GACxD,QACH,CAED,MAAMI,EAAMC,MAAMC,QAAQN,GAAOA,EAAM,CAACA,GAEpCI,EAAIG,OAAS,QAAcC,IAATP,GAAoBG,EAAIK,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KAAM,OACN1C,OAAQK,KAAKL,OACbE,aACDG,KAAKC,SAERgC,EAAOD,OAASA,EAEhBD,EAAMO,KAAKL,EACd"}
1
+ {"version":3,"file":"clip.js","sources":["../../src/core/clip.ts"],"sourcesContent":[null],"names":["Clip","constructor","_a","initial","duration","delay","repeat","alternate","easing","reverse","composite","properties","__rest","this","dynamic","keyframes","prop","val","init","Function","isLink","arr","Array","isArray","length","undefined","unshift","splice","normalizeAnimatableKeyframes","distributeAnimatableKeyframes","createDynamic","Object","values","merge","offset","isEmpty","keys","from","data","unique","config","clip","key","hasOwnProperty","play","track","commit","action","Action","iterations","direction","fill","push"],"mappings":"wNAoCc,MAAOA,EAcjB,WAAAC,CAAYC,EAAiJC,GAAjJ,IAAAC,SAAEA,EAAW,EAACC,MAAEA,EAAQ,EAACC,OAAEA,EAAS,EAACC,UAAEA,GAAY,EAAKC,OAAEA,EAAS,OAAMC,QAAEA,GAAU,EAAKC,UAAEA,EAAY,QAAuCR,EAA5BS,EAAUC,EAAAV,EAA7H,+EAAiJ,IAAAC,IAAAA,EAAgC,CAAA,GAV7LU,KAAOC,QAAsB,GAWzB,MAAMC,EAEF,CAAA,EAEJ,IAAK,IAAIC,KAAQL,EAAY,CACzB,IAAIM,EAAMN,EAAWK,GAAwBE,EAAOf,EAAQa,GAE5D,GAAIC,aAAeE,SAAU,CACpBC,EAAOH,KAAMJ,KAAKC,QAAQE,GAAyBC,GACxD,QACH,CAED,MAAMI,EAAMC,MAAMC,QAAQN,GAAOA,EAAM,CAACA,GAEpCI,EAAIG,OAAS,QAAcC,IAATP,GAAoBG,EAAIK,QAAQR,GACvC,OAAXG,EAAI,UAAsBI,IAATP,EAAqBG,EAAI,GAAKH,EAAOG,EAAIM,OAAO,EAAG,IAEnEC,EAA6BP,KAErB,iBAATL,EAKJa,EAA8Bb,EAAMK,EAAYN,GAJ5CF,KAAKC,QAAQE,GAAQc,EAAcd,EAAMe,OAAOC,OAAOH,EAA8Bb,EAAMK,IAAcb,GA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s}from"./link.js";import i from"./track.js";import{IndexedMap as e,merge as a}from"./utils.js";class r{constructor({stagger:t=.1,staggerLimit:s=10,deform:i=!0,cachable:a,mountClips:r}){this.index=0,this.paused=!1,this.tracks=new e,this.frame=0,this.linked=[],this.mounted=!1,this.stagger=t,this.staggerLimit=s-1,this.deform=i,this.cachable=a,this.mountClips=r}step(){cancelAnimationFrame(this.frame),this.paused||this.tracks.stack.forEach(((t,s)=>t.step(s))),this.frame=requestAnimationFrame(this.step.bind(this))}time(t){return t.duration+t.delay+this.stagger*Math.max(Math.min(this.staggerLimit,this.tracks.size-1),0)}receiver(s,i,e){if(!this.paused)for(let r=0;r<this.tracks.size;r++){const c=this.tracks.stack[r],h=i(r);e.duration?(a(e,{composite:"override"}),new t(Object.assign(Object.assign({},e),{[s]:h})).play(c,{})):c.apply(s,h)}}link(i){if(this.step(),!(this.linked.length||!i||i instanceof t))for(let t in i){const e=i[t];if(s(e)){const s=this.receiver.bind(this,t,e);e.subscribe(s),this.linked.push((()=>e.unsubscribe(s))),s({})}}}unlink(){this.linked.forEach((t=>t())),this.linked=[]}transition(t,s={}){for(let i=0;i<this.tracks.size;i++)this.tracks.stack[i].transition(null==t?void 0:t.tracks.stack[i],s)}insert(t){if((t instanceof HTMLElement||t instanceof SVGElement)&&!this.tracks.has(t)){const s=new i(t,this.deform,this.cachable);this.tracks.set(t,s),this.mounted&&this.mountClips.forEach((t=>t.play(s,{})))}}add(t,{immediate:s=!1,composite:i,reverse:e,delay:a=0,commit:r}){let c,h=0;for(;c=this.tracks.stack[h];)c.element.isConnected?(s&&c.clear(),t.play(c,{delay:a+Math.min(h,this.staggerLimit)*(this.stagger<0?t.duration/this.tracks.size:1)*Math.abs(this.stagger),composite:i,reverse:e,commit:r}),h++):this.tracks.delete(c.element)}pause(t){for(const s of this.tracks.stack)s.pause(t);this.paused=t}cache(){for(const t of this.tracks.stack)t.cache.update()}}export{r as default};
1
+ import t from"./clip.js";import{isLink as s}from"./link.js";import i from"./track.js";import{IndexedMap as e,merge as a}from"./utils.js";class r{constructor({stagger:t=.1,staggerLimit:s=10,deform:i=!0,cachable:a,mountClips:r}){this.index=0,this.paused=!1,this.tracks=new e,this.frame=0,this.linked=[],this.mounted=!1,this.stagger=t,this.staggerLimit=s-1,this.deform=i,this.cachable=a,this.mountClips=r}step(){cancelAnimationFrame(this.frame),this.paused||this.tracks.stack.forEach(((t,s)=>t.step(s))),this.frame=requestAnimationFrame(this.step.bind(this))}time(t){return this.tracks.size?t.duration+t.delay+this.stagger*Math.max(Math.min(this.staggerLimit,this.tracks.size-1),0):0}receiver(s,i,e){if(!this.paused)for(let r=0;r<this.tracks.size;r++){const c=this.tracks.stack[r],h=i(r);e.duration?(a(e,{composite:"override"}),new t(Object.assign(Object.assign({},e),{[s]:h})).play(c,{})):(c.apply(s,h),c.correct())}}link(i){if(this.step(),!(this.linked.length||!i||i instanceof t))for(let t in i){const e=i[t];if(s(e)){const s=this.receiver.bind(this,t,e);e.subscribe(s),this.linked.push((()=>e.unsubscribe(s))),s({})}}}unlink(){this.linked.forEach((t=>t())),this.linked=[]}transition(t,s={}){for(let i=0;i<this.tracks.size;i++)this.tracks.stack[i].transition(null==t?void 0:t.tracks.stack[i],s)}insert(t){if((t instanceof HTMLElement||t instanceof SVGElement)&&!this.tracks.has(t)){const s=new i(t,this.deform,this.cachable);this.tracks.set(t,s),this.mounted&&this.mountClips.forEach((t=>t.play(s,{})))}}add(t,{immediate:s=!1,composite:i,reverse:e,delay:a=0,commit:r}){let c,h=0;for(;c=this.tracks.stack[h];)c.element.isConnected?(s&&c.clear(),t.play(c,{delay:a+Math.min(h,this.staggerLimit)*(this.stagger<0?t.duration/this.tracks.size:1)*Math.abs(this.stagger),composite:i,reverse:e,commit:r}),h++):this.tracks.delete(c.element)}pause(t){for(const s of this.tracks.stack)s.pause(t);this.paused=t}cache(){for(const t of this.tracks.stack)t.cache.update()}}export{r as default};
2
2
  //# sourceMappingURL=timeline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.js","sources":["../../src/core/timeline.ts"],"sourcesContent":[null],"names":["Timeline","constructor","stagger","staggerLimit","deform","cachable","mountClips","this","index","paused","tracks","IndexedMap","frame","linked","mounted","step","cancelAnimationFrame","stack","forEach","track","i","requestAnimationFrame","bind","time","clip","duration","delay","Math","max","min","size","receiver","prop","link","config","value","merge","composite","Clip","Object","assign","play","apply","length","isLink","subscribe","push","unsubscribe","unlink","transition","from","options","insert","element","HTMLElement","SVGElement","has","Track","set","add","immediate","reverse","commit","isConnected","clear","abs","delete","pause","cache","update"],"mappings":"yIAQc,MAAOA,EAcjB,WAAAC,EAAYC,QAAEA,EAAU,GAAGC,aAAEA,EAAe,GAAEC,OAAEA,GAAS,EAAIC,SAAEA,EAAQC,WAAEA,IAZzEC,KAAKC,MAAW,EAKhBD,KAAME,QAAY,EAClBF,KAAAG,OAAqC,IAAIC,EACzCJ,KAAKK,MAAW,EAChBL,KAAMM,OAAmB,GACzBN,KAAOO,SAAY,EAIfP,KAAKL,QAAUA,EACfK,KAAKJ,aAAeA,EAAe,EACnCI,KAAKH,OAASA,EACdG,KAAKF,SAAWA,EAChBE,KAAKD,WAAaA,CACrB,CAED,IAAAS,GACIC,qBAAqBT,KAAKK,OAErBL,KAAKE,QAAQF,KAAKG,OAAOO,MAAMC,SAAQ,CAACC,EAAOC,IAAMD,EAAMJ,KAAKK,KAErEb,KAAKK,MAAQS,sBAAsBd,KAAKQ,KAAKO,KAAKf,MACrD,CAED,IAAAgB,CAAKC,GACD,OAAOA,EAAKC,SAAWD,EAAKE,MAAQnB,KAAKL,QAAUyB,KAAKC,IAAID,KAAKE,IAAItB,KAAKJ,aAAcI,KAAKG,OAAOoB,KAAO,GAAI,EAClH,CAEO,QAAAC,CAASC,EAAcC,EAAiBC,GAC5C,IAAI3B,KAAKE,OAET,IAAK,IAAIW,EAAI,EAAGA,EAAIb,KAAKG,OAAOoB,KAAMV,IAAK,CACvC,MAAMD,EAAQZ,KAAKG,OAAOO,MAAMG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A,EAAQ,EAACoC,OAAEA,IAChE,IAAW3C,EAAPC,EAAI,EAER,KAAOD,EAAQZ,KAAKG,OAAOO,MAAMG,IACxBD,EAAMkC,QAAQU,aAKfH,GAAWzC,EAAM6C,QAErBxC,EAAKiB,KAAKtB,EAAO,CACbO,MAAOA,EAAQC,KAAKE,IAAIT,EAAGb,KAAKJ,eAAiBI,KAAKL,QAAU,EAAIsB,EAAKC,SAAWlB,KAAKG,OAAOoB,KAAO,GAAKH,KAAKsC,IAAI1D,KAAKL,SAC1HmC,YACAwB,UACAC,WAGJ1C,KAbIb,KAAKG,OAAOwD,OAAO/C,EAAMkC,QAepC,CAED,KAAAc,CAAMhC,GACF,IAAK,MAAMhB,KAASZ,KAAKG,OAAOO,MAAOE,EAAMgD,MAAMhC,GAEnD5B,KAAKE,OAAS0B,CACjB,CAED,KAAAiC,GACI,IAAK,MAAMjD,KAASZ,KAAKG,OAAOO,MAAOE,EAAMiD,MAAMC,QACtD"}
1
+ {"version":3,"file":"timeline.js","sources":["../../src/core/timeline.ts"],"sourcesContent":[null],"names":["Timeline","constructor","stagger","staggerLimit","deform","cachable","mountClips","this","index","paused","tracks","IndexedMap","frame","linked","mounted","step","cancelAnimationFrame","stack","forEach","track","i","requestAnimationFrame","bind","time","clip","size","duration","delay","Math","max","min","receiver","prop","link","config","value","merge","composite","Clip","Object","assign","play","apply","correct","length","isLink","subscribe","push","unsubscribe","unlink","transition","from","options","insert","element","HTMLElement","SVGElement","has","Track","set","add","immediate","reverse","commit","isConnected","clear","abs","delete","pause","cache","update"],"mappings":"yIAQc,MAAOA,EAcjB,WAAAC,EAAYC,QAAEA,EAAU,GAAGC,aAAEA,EAAe,GAAEC,OAAEA,GAAS,EAAIC,SAAEA,EAAQC,WAAEA,IAZzEC,KAAKC,MAAW,EAKhBD,KAAME,QAAY,EAClBF,KAAAG,OAAqC,IAAIC,EACzCJ,KAAKK,MAAW,EAChBL,KAAMM,OAAmB,GACzBN,KAAOO,SAAY,EAIfP,KA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E,EAAMkD,MAAMC,QACtD"}
@@ -1,2 +1,2 @@
1
- import{StyleCache as t}from"./cache.js";import{lengthToOffset as e}from"./utils.js";class s{constructor(e,s,i){this.playing=0,this.active=[],this.queue=[],this.scale=[1,1],this.paused=!1,this.element=e,this.deform=s,this.cache=new t(e,i)}push(t){t.onfinish=this.next.bind(this),this.playing&&"none"===t.composite?(this.queue.push(t),t.animation.pause()):(this.active.push(t),"none"===t.composite&&this.playing++,this.paused&&t.animation.pause())}next(){this.cache.update(),--this.playing>0||(this.active=this.queue.length?this.queue.splice(0,1):[],this.playing=this.active.length,this.pause(!1))}clear(t){this.active.forEach((e=>{e.onfinish=null;try{t?e.commit||"combine"===e.composite||e.animation.cancel():e.animation.finish()}catch(t){e.animation.cancel()}})),t||(this.active=[],this.queue=[],this.playing=0)}pause(t){for(const e of this.active)e.animation[t?"pause":"play"]();this.paused=t}step(t){for(const e of this.active)e.step(t);this.active.length&&this.correct()}transition(t,e){this.clear(!0);const s=this.cache.difference(null==t?void 0:t.cache.data,e);this.cache.update(),null==t||t.clear(),null==t||t.cache.update(),s.forEach((t=>t.play(this,{commit:!1})))}apply(t,s){const i="strokeLength"===t;this.element.style[i?"strokeDashoffset":t]=i?e(s):s,this.correct()}decomposeScale(){const[t,e]=this.cache.computed.scale.split(" ");let s=Math.max(parseFloat(t)||1,1e-4);/%$/.test(t)&&(s/=100);let i=e?Math.max(parseFloat(e),1e-4):s;return/%$/.test(e)&&(i/=100),[s,i]}computeBorderRadius(t=this.cache.computed.borderRadius){const e=t.split(/\s*\/\s*/);e.length<2&&(e[1]=e[0]);const s=this.scale;return this.scale=this.decomposeScale(),e.map(((t,e)=>t.split(" ").map((t=>{var i;return parseFloat(t)*s[e]/this.scale[e]+((null===(i=t.match(/[^\d\.]+$/))||void 0===i?void 0:i[0])||"px")})).join(" "))).join("/")}correct(){if(this.deform)return;this.element.style.borderRadius=this.computeBorderRadius();const[t,e]=this.decomposeScale();for(let s=0;s<this.element.children.length;s++){this.element.children[s].style.transform=`scale(${1/t}, ${1/e})`}}}export{s as default};
1
+ import{StyleCache as t}from"./cache.js";import{lengthToOffset as e}from"./utils.js";class s{constructor(e,s,i){this.playing=0,this.active=[],this.queue=[],this.paused=!1,this.scale=[1,1],this.correctedBorderRadius="",this.element=e,this.deform=s,this.cache=new t(e,i)}push(t){t.onfinish=this.next.bind(this),this.playing&&"none"===t.composite?(this.queue.push(t),t.animation.pause()):(this.active.push(t),"none"===t.composite&&this.playing++,this.paused&&t.animation.pause())}next(){this.cache.update(),--this.playing>0||(this.active=this.queue.length?this.queue.splice(0,1):[],this.playing=this.active.length,this.pause(!1))}clear(t){this.active.forEach((e=>{e.onfinish=null;try{t?e.commit||"combine"===e.composite||e.animation.cancel():e.animation.finish()}catch(t){e.animation.cancel()}})),t||(this.active=[],this.queue=[],this.playing=0)}pause(t){for(const e of this.active)e.animation[t?"pause":"play"]();this.paused=t}step(t){for(const e of this.active)e.step(t);this.active.length&&this.correct()}transition(t,e){this.clear(!0);const s=this.cache.difference(null==t?void 0:t.cache.data,e);this.cache.update(),null==t||t.clear(),null==t||t.cache.update(),s.forEach((t=>t.play(this,{commit:!1})))}apply(t,s){const i="strokeLength"===t;this.element.style[i?"strokeDashoffset":t]=i?e(s):s}decomposeScale(){const[t,e]=this.cache.computed.scale.split(" ");let s=Math.max(parseFloat(t)||1,1e-4);/%$/.test(t)&&(s/=100);let i=e?Math.max(parseFloat(e),1e-4):s;return/%$/.test(e)&&(i/=100),[s,i]}computeBorderRadius(){const t=this.cache.computed,e=t.borderRadius.split(/\s*\/\s*/);e.length<2&&(e[1]=e[0]);const s=t.borderRadius!==this.correctedBorderRadius?[1,1]:this.scale;this.scale=this.decomposeScale(),this.element.style.borderRadius=e.map(((t,e)=>t.split(" ").map((t=>{var i;return parseFloat(t)*s[e]/this.scale[e]+((null===(i=t.match(/[^\d\.]+$/))||void 0===i?void 0:i[0])||"px")})).join(" "))).join("/"),this.correctedBorderRadius=t.borderRadius}correct(){if(this.deform)return;this.computeBorderRadius();const[t,e]=this.decomposeScale();for(let s=0;s<this.element.children.length;s++){const i=this.element.children[s],a=i.offsetLeft,o=i.offsetTop,c=i.offsetWidth,h=i.offsetHeight,[n,r]=getComputedStyle(i).translate.split(" ").map(parseFloat);i.style.transform=`translate(${-n||0}px, ${-r||0}px) scale(${1/t}, ${1/e}) translate(${a*(1-t)+c/2*(1-t)+(n||0)}px, ${o*(1-e)+h/2*(1-e)+(r||0)}px)`}}}export{s as default};
2
2
  //# sourceMappingURL=track.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"track.js","sources":["../../src/core/track.ts"],"sourcesContent":[null],"names":["Track","constructor","element","deform","cachable","this","playing","active","queue","scale","paused","cache","StyleCache","push","action","onfinish","next","bind","composite","animation","pause","update","length","splice","clear","partial","forEach","commit","cancel","finish","ex","value","step","index","correct","transition","previous","options","clips","difference","data","clip","play","apply","prop","val","isStroke","style","lengthToOffset","decomposeScale","xString","yString","computed","split","x","Math","max","parseFloat","test","y","computeBorderRadius","borderRadius","arr","prev","map","axis","i","_a","match","join","children","transform"],"mappings":"oFAOc,MAAOA,EAWjB,WAAAC,CAAYC,EAAmCC,EAAiBC,GAPhEC,KAAOC,QAAW,EAClBD,KAAME,OAAa,GACnBF,KAAKG,MAAa,GAElBH,KAAAI,MAA0B,CAAC,EAAG,GAC9BJ,KAAMK,QAAY,EAGdL,KAAKH,QAAUA,EACfG,KAAKF,OAASA,EACdE,KAAKM,MAAQ,IAAIC,EAAWV,EAASE,EACxC,CAED,IAAAS,CAAKC,GACDA,EAAOC,SAAWV,KAAKW,KAAKC,KAAKZ,MAE7BA,KAAKC,SAAgC,SAArBQ,EAAOI,WACvBb,KAAKG,MAAMK,KAAKC,GAChBA,EAAOK,UAAUC,UAEjBf,KAAKE,OAAOM,KAAKC,GACQ,SAArBA,EAAOI,WAAsBb,KAAKC,UAClCD,KAAKK,QAAQI,EAAOK,UAAUC,QAEzC,CAED,IAAAJ,GACIX,KAAKM,MAAMU,WAEL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C,WAAWP,IAAY,EAAG,MACvC,KAAKQ,KAAKR,KAAUI,GAAK,KAE7B,IAAIK,EAAIR,EAAUI,KAAKC,IAAIC,WAAWN,GAAU,MAAUG,EAG1D,MAFI,KAAKI,KAAKP,KAAUQ,GAAK,KAEtB,CAACL,EAAGK,EACd,CAED,mBAAAC,CAAoBC,EAAexD,KAAKM,MAAMyC,SAASS,cACnD,MAAMC,EAAMD,EAAaR,MAAM,YAC3BS,EAAIxC,OAAS,IAAGwC,EAAI,GAAKA,EAAI,IAEjC,MAAMC,EAAO1D,KAAKI,MAGlB,OAFAJ,KAAKI,MAAQJ,KAAK4C,iBAEXa,EAAIE,KAAI,CAACC,EAAMC,IACXD,EAAKZ,MAAM,KAAKW,KAAInB,UACvB,OAAOY,WAAWZ,GAAOkB,EAAKG,GAAK7D,KAAKI,MAAMyD,KAA4B,QAAtBC,EAAAtB,EAAIuB,MAAM,oBAAY,IAAAD,OAAA,EAAAA,EAAG,KAAM,KAAK,IACzFE,KAAK,OACTA,KAAK,IACX,CAED,OAAAnC,GACI,GAAI7B,KAAKF,OAAQ,OAEjBE,KAAKH,QAAQ6C,MAAMc,aAAexD,KAAKuD,sBACvC,MAAON,EAAGK,GAAKtD,KAAK4C,iBAEpB,IAAK,IAAIiB,EAAI,EAAGA,EAAI7D,KAAKH,QAAQoE,SAAShD,OAAQ4C,IAAK,CACrC7D,KAAKH,QAAQoE,SAASJ,GAE9BnB,MAAMwB,UAAY,SAAS,EAAIjB,MAAM,EAAIK,IAGlD,CACJ"}
1
+ {"version":3,"file":"track.js","sources":["../../src/core/track.ts"],"sourcesContent":[null],"names":["Track","constructor","element","deform","cachable","this","playing","active","queue","paused","scale","correctedBorderRadius","cache","StyleCache","push","action","onfinish","next","bind","composite","animation","pause","update","length","splice","clear","partial","forEach","commit","cancel","finish","ex","value","step","index","correct","transition","previous","options","clips","difference","data","clip","play","apply","prop","val","isStroke","style","lengthToOffset","decomposeScale","xString","yString","computed","split","x","Math","max","parseFloat","test","y","computeBorderRadius","radii","borderRadius","previousScale","map","axis","i","radius","_a","match","join","children","child","l","offsetLeft","t","offsetTop","w","offsetWidth","h","offsetHeight","tx","ty","getComputedStyle","translate","transform"],"mappings":"oFAOc,MAAOA,EAYjB,WAAAC,CAAYC,EAAmCC,EAAiBC,GARhEC,KAAOC,QAAW,EAClBD,KAAME,OAAa,GACnBF,KAAKG,MAAa,GAElBH,KAAMI,QAAY,EAClBJ,KAAAK,MAA0B,CAAC,EAAG,GAC9BL,KAAqBM,sBAAW,GAG5BN,KAAKH,QAAUA,EACfG,KAAKF,OAASA,EACdE,KAAKO,MAAQ,IAAIC,EAAWX,EAASE,EACxC,CAED,IAAAU,CAAKC,GACDA,EAAOC,SAAWX,KAAKY,KAAKC,KAAKb,MAE7BA,KAAKC,SAAgC,SAArBS,EAAOI,WACvBd,KAAKG,MAAMM,KAAKC,GAChBA,EAAOK,UAAUC,UAEjBhB,KAAKE,OAAOO,KAAKC,GACQ,SAArBA,EAAOI,WAAsBd,KAAKC,UAClCD,KAAKI,QAAQM,EAAOK,UAAUC,QAEzC,CAED,IAAAJ,GACIZ,KAAKO,MAAMU,WAELjB,KAAKC,QAAU,IAErBD,KAAKE,OAASF,KAAKG,MAAMe,OAASlB,KAAKG,MAAMgB,OAAO,EAAG,GAAK,GAC5DnB,KAAKC,QAAUD,KAAKE,OAAOgB,OAC3BlB,KAAKgB,OAAM,GACd,CAED,KAAAI,CAAMC,GACFrB,KAAKE,OAAOoB,SAAQZ,IAChBA,EAAOC,SAAW,KAElB,IACSU,EAGIX,EAAOa,QAA+B,YAArBb,EAAOI,WACzBJ,EAAOK,UAAUS,SAHrBd,EAAOK,UAAUU,QAKxB,CAAC,MAAOC,GACLhB,EAAOK,UAAUS,QACpB,KAGAH,IACDrB,KAAKE,OAAS,GACdF,KAAKG,MAAQ,GACbH,KAAKC,QAAU,EAGtB,CAED,KAAAe,CAAMW,GACF,IAAK,MAAMjB,KAAUV,KAAKE,OAAQQ,EAAOK,UAA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,KAAIG,UACvB,OAAOV,WAAWU,GAAUJ,EAAcG,GAAK9D,KAAKK,MAAMyD,KAA+B,QAAzBE,EAAAD,EAAOE,MAAM,oBAAY,IAAAD,OAAA,EAAAA,EAAG,KAAM,KAAK,IACxGE,KAAK,OACTA,KAAK,KAERlE,KAAKM,sBAAwB0C,EAASU,YACzC,CAED,OAAA5B,GACI,GAAI9B,KAAKF,OAAQ,OAEjBE,KAAKwD,sBAEL,MAAON,EAAGK,GAAKvD,KAAK6C,iBAEpB,IAAK,IAAIiB,EAAI,EAAGA,EAAI9D,KAAKH,QAAQsE,SAASjD,OAAQ4C,IAAK,CACnD,MAAMM,EAAQpE,KAAKH,QAAQsE,SAASL,GAC9BO,EAAID,EAAME,WACZC,EAAIH,EAAMI,UACVC,EAAIL,EAAMM,YACVC,EAAIP,EAAMQ,cAEPC,EAAIC,GAAMC,iBAAiBX,GAAOY,UAAU/B,MAAM,KAAKW,IAAIP,YAElEe,EAAMzB,MAAMsC,UAAY,cAAcJ,GAAM,SAASC,GAAM,cAAc,EAAI5B,MAAM,EAAIK,gBAAgBc,GAAK,EAAInB,GAAKuB,EAAI,GAAK,EAAIvB,IAAM2B,GAAM,SAASN,GAAK,EAAIhB,GAAKoB,EAAI,GAAK,EAAIpB,IAAMuB,GAAM,OACjM,CACJ"}
@@ -1,2 +1,2 @@
1
- function t(...t){for(let e=1;e<t.length;e++)for(const n in t[e])n in t[0]&&void 0!==t[0][n]||(t[0][n]=t[e][n]);return t[0]}function e(t,e){const n={};for(const o of e)n[o]=t[o];return n}function n(...t){return e=>{t.forEach((t=>{t&&"current"in t&&(t.current=e),t instanceof Function&&t(e)}))}}const o=t=>1-parseFloat(t.toString());class s extends Map{constructor(){super(...arguments),this.stack=[]}set(t,e){return this.stack.push(e),super.set(t,e)}delete(t){const e=this.stack.indexOf(this.get(t));return e>=0&&this.stack.splice(e,1),super.delete(t)}}function r(t,e,n={}){const s=(e,s)=>{const r=1e4*e,f="strokeLength"===t;r in n||(n[r]={offset:e}),n[r][f?"strokeDashoffset":t]=f?o(s):s};for(let t=0;t<e.length;t++){let{offset:n,value:o,after:r}=e[t];void 0!==o&&(void 0!==r&&1===n&&(n-=1e-4),s(n,o)),void 0!==r&&(n=Math.min(n+1e-4,1),s(n,r))}return n}function f(t){let e,n=0;for(let o=0;o<t.length;o++){let s=t[o],r=t.length<2?1:Math.round(o/(t.length-1)*1e4)/1e4;0===o&&(e=s),s&&"object"==typeof s?"offset"in s||(s.offset=r):(s===e&&n++,t[o]={offset:r,value:null!==s?s:void 0})}return n<2||n!==t.length}export{s as IndexedMap,n as combineRefs,r as distributeAnimatableKeyframes,o as lengthToOffset,t as merge,f as normalizeAnimatableKeyframes,e as pick};
1
+ function t(...t){for(let e=1;e<t.length;e++)for(const n in t[e])n in t[0]&&void 0!==t[0][n]||(t[0][n]=t[e][n]);return t[0]}function e(t,e){const n={};for(const o of e)n[o]=t[o];return n}function n(...t){return e=>{t.forEach((t=>{t&&"current"in t&&(t.current=e),t instanceof Function&&t(e)}))}}const o=t=>1-parseFloat(t.toString());class r extends Map{constructor(){super(...arguments),this.stack=[]}set(t,e){return this.stack.push(e),super.set(t,e)}delete(t){const e=this.stack.indexOf(this.get(t));return e>=0&&this.stack.splice(e,1),super.delete(t)}}function s(t,e,n={}){const r=(e,r)=>{const s=1e4*e,i="strokeLength"===t;s in n||(n[s]={offset:e}),n[s][i?"strokeDashoffset":t]=i?o(r):r};for(let t=0;t<e.length;t++){let{offset:n,value:o,after:s}=e[t];void 0!==o&&(void 0!==s&&1===n&&(n-=1e-4),r(n,o)),void 0!==s&&(n=Math.min(n+1e-4,1),r(n,s))}return n}function i(t){let e,n=0;for(let o=0;o<t.length;o++){let r=t[o],s=t.length<2?1:Math.round(o/(t.length-1)*1e4)/1e4;0===o&&(e=r),r&&"object"==typeof r?"offset"in r||(r.offset=s):(r===e&&n++,t[o]={offset:s,value:null!==r?r:void 0})}return n<2||n!==t.length}function c(t,e,n){return function(o){const r=this.element.animate(e,{duration:1e3,fill:"forwards",easing:n});r.currentTime=1e3*o;const s=getComputedStyle(this.element)[t];return r.cancel(),s}}export{r as IndexedMap,n as combineRefs,c as createDynamic,s as distributeAnimatableKeyframes,o as lengthToOffset,t as merge,i as normalizeAnimatableKeyframes,e as pick};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../src/core/utils.ts"],"sourcesContent":[null],"names":["merge","objects","i","length","key","undefined","pick","map","keys","picked","combineRefs","refs","el","forEach","ref","current","Function","lengthToOffset","val","parseFloat","toString","IndexedMap","Map","constructor","this","stack","set","value","push","super","indexOf","get","splice","delete","distributeAnimatableKeyframes","prop","keyframes","offset","isStroke","after","Math","min","normalizeAnimatableKeyframes","match","equal","keyframe","round"],"mappings":"AAUgB,SAAAA,KAA8CC,GAC1D,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,OAAQD,IAChC,IAAK,MAAME,KAAOH,EAAQC,GAClBE,KAAOH,EAAQ,SAA0BI,IAApBJ,EAAQ,GAAGG,KAEpCH,EAAQ,GAAGG,GAAOH,EAAQC,GAAGE,IAIrC,OAAOH,EAAQ,EACnB,CAEgB,SAAAK,EAA2DC,EAAQC,GAC/E,MAAMC,EAAS,CAAA,EAEf,IAAK,MAAML,KAAOI,EAAMC,EAAOL,GAAOG,EAAIH,GAE1C,OAAOK,CACX,CAEgB,SAAAC,KAAeC,GAC3B,OAAQC,IACJD,EAAKE,SAAQC,IACLA,GAAO,YAAaA,IAAMA,EAA6BC,QAAUH,GACjEE,aAAeE,UAAUF,EAAIF,EAAG,GACtC,CAEV,CAEa,MAAAK,EAAkBC,GAAa,EAAIC,WAAWD,EAAIE,YAEzD,MAAOC,UAAyBC,IAAtC,WAAAC,uBAEIC,KAAKC,MAAQ,EAehB,CAbG,GAAAC,CAAItB,EAAQuB,GAGR,OAFAH,KAAKC,MAAMG,KAAKD,GAETE,MAAMH,IAAItB,EAAKuB,EACzB,CAED,OAAOvB,GAC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ts"],"sourcesContent":[null],"names":["merge","objects","i","length","key","undefined","pick","map","keys","picked","combineRefs","refs","el","forEach","ref","current","Function","lengthToOffset","val","parseFloat","toString","IndexedMap","Map","constructor","this","stack","set","value","push","super","indexOf","get","splice","delete","distributeAnimatableKeyframes","prop","keyframes","offset","isStroke","after","Math","min","normalizeAnimatableKeyframes","match","equal","keyframe","round","createDynamic","easing","t","animation","element","animate","duration","fill","currentTime","getComputedStyle","cancel"],"mappings":"AAWgB,SAAAA,KAA8CC,GAC1D,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAQE,OAAQD,IAChC,IAAK,MAAME,KAAOH,EAAQC,GAClBE,KAAOH,EAAQ,SAA0BI,IAApBJ,EAAQ,GAAGG,KAEpCH,EAAQ,GAAGG,GAAOH,EAAQC,GAAGE,IAIrC,OAAOH,EAAQ,EACnB,CAEgB,SAAAK,EAA2DC,EAAQC,GAC/E,MAAMC,EAAS,CAAA,EAEf,IAAK,MAAML,KAAOI,EAAMC,EAAOL,GAAOG,EAAIH,GAE1C,OAAOK,CACX,CAEgB,SAAAC,KAAeC,GAC3B,OAAQC,IACJD,EAAKE,SAAQC,IACLA,GAAO,YAAaA,IAAMA,EAA6BC,QAAUH,GACjEE,aAAeE,UAAUF,EAAIF,EAAG,GACtC,CAEV,CAEa,MAAAK,EAAkBC,GAAa,EAAIC,WAAWD,EAAIE,YAEzD,MAAOC,UAAyBC,IAAtC,WAAAC,uBAEIC,KAAKC,MAAQ,EAehB,CAbG,GAAAC,CAAItB,EAAQuB,GAGR,OAFAH,KAAKC,MAAMG,KAAKD,GAETE,MAAMH,IAAItB,EAAKuB,EACzB,CAED,OAAOvB,GACH,MAAMF,EAAIsB,KAAKC,MAAMK,QAAQN,KAAKO,IAAI3B,IAGtC,OAFIF,GAAK,GAAGsB,KAAKC,MAAMO,OAAO9B,EAAG,GAE1B2B,MAAMI,OAAO7B,EACvB,EAMC,SAAU8B,EAA8BC,EAAcC,EAAuC7B,EAAoC,CAAA,GACnI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SAEH9B,CACX,CACJ"}
@@ -1,2 +1,2 @@
1
- import{useRef as t,useCallback as r}from"react";function n(){const n=t(null);return[r((t=>(r,e)=>{if(!n.current)return t([0,0],e);const u=n.current.getTotalLength()*r,{x:o,y:c}=n.current.getPointAtLength(u);return t([o,c],e)}),[n]),n]}export{n as default};
1
+ import{useRef as t,useCallback as r}from"react";function n(){const n=t(null),e=r((t=>(r,e)=>{if(!n.current)return t([0,0],e);const u=n.current.getTotalLength()*r,{x:o,y:c}=n.current.getPointAtLength(u);return t([o,c],e)}),[n]);return[n,e]}export{n as default};
2
2
  //# sourceMappingURL=use-path.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-path.js","sources":["../../src/hooks/use-path.ts"],"sourcesContent":[null],"names":["usePath","ref","useRef","useCallback","transform","progress","index","current","len","getTotalLength","x","y","getPointAtLength"],"mappings":"gDAEc,SAAUA,IACpB,MAAMC,EAAMC,EAAU,MAatB,MAAO,CAXMC,GAAaC,GACf,CAACC,EAAkBC,KACtB,IAAKL,EAAIM,QAAS,OAAOH,EAAU,CAAC,EAAG,GAAIE,GAE3C,MAAME,EAAMP,EAAIM,QAAQE,iBAAmBJ,GACrCK,EAAEA,EAACC,EAAEA,GAAMV,EAAIM,QAAQK,iBAAiBJ,GAE9C,OAAOJ,EAAU,CAACM,EAAGC,GAAIL,EAAM,GAEpC,CAACL,IAEUA,EAClB"}
1
+ {"version":3,"file":"use-path.js","sources":["../../src/hooks/use-path.ts"],"sourcesContent":[null],"names":["usePath","ref","useRef","link","useCallback","transform","progress","index","current","len","getTotalLength","x","y","getPointAtLength"],"mappings":"gDAEc,SAAUA,IACpB,MAAMC,EAAMC,EAAU,MAEhBC,EAAOC,GAAaC,GACf,CAACC,EAAkBC,KACtB,IAAKN,EAAIO,QAAS,OAAOH,EAAU,CAAC,EAAG,GAAIE,GAE3C,MAAME,EAAMR,EAAIO,QAAQE,iBAAmBJ,GACrCK,EAAEA,EAACC,EAAEA,GAAMX,EAAIO,QAAQK,iBAAiBJ,GAE9C,OAAOJ,EAAU,CAACM,EAAGC,GAAIL,EAAM,GAEpC,CAACN,IAEJ,MAAO,CAACA,EAAKE,EACjB"}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{useRef as e}from"react";import n from"./use-link.js";import t from"./use-mount-effect.js";function r(r=.5){const i=e(null),o=n([-1,-1]);return t((()=>{function e(){if(!i.current)return;const{x:e,y:n,width:t,height:s}=i.current.getBoundingClientRect();o.set([(e+t*r)/(window.innerWidth+2*t*(r-.5)),(n+s*r)/(window.innerHeight+2*s*(r-.5))])}return e(),window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[r]),[o,i]}export{r as default};
2
+ import{useRef as e}from"react";import n from"./use-link.js";import t from"./use-mount-effect.js";function r(r=.5){const i=e(null),o=n([-1,-1]);return t((()=>{function e(){if(!i.current)return;const{x:e,y:n,width:t,height:s}=i.current.getBoundingClientRect();o.set([(e+t*r)/(window.innerWidth+2*t*(r-.5)),(n+s*r)/(window.innerHeight+2*s*(r-.5))])}return e(),window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[r]),[i,o]}export{r as default};
3
3
  //# sourceMappingURL=use-viewport.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{useRef as e,useEffect as r}from"react";import t from"./use-trigger.js";import s from"./use-viewport.js";function i({enter:i=1,exit:n=!1,threshold:u=.5}={}){const[o,c]=s(u),b=e({visible:!1,enters:!0===i?1/0:+i,exits:!0===n?1/0:+n}),f=t();return r((()=>{function e(){const[e,r]=o(),t=e>0&&e<1&&r>0&&r<1,{visible:s,enters:i,exits:n}=b.current;!s&&t&&i&&(b.current.enters--,f()),s&&!t&&n&&(b.current.exits--,f()),b.current.visible=t}return o.subscribe(e),()=>o.unsubscribe(e)}),[]),[f,c]}export{i as default};
2
+ import{useRef as r,useEffect as e}from"react";import t from"./use-trigger.js";import n from"./use-viewport.js";function o({enter:o=1,exit:u=!1,threshold:c=.5}={}){const[s,i]=n(c),f=r(!1),l=t(),m=t();return e((()=>{function r(){const[r,e]=i(),t=r>0&&r<1&&e>0&&e<1;!f.current&&t&&l.called<(!0===o?1/0:+o)&&l(),f.current&&!t&&m.called<(!0===u?1/0:+u)&&m(),f.current=t}return r(),i.subscribe(r),()=>i.unsubscribe(r)}),[l,m]),[s,l,m]}export{o as default};
3
3
  //# sourceMappingURL=use-visible.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as r}from"react/jsx-runtime";import{useRef as t,useState as n,useEffect as e,Children as i,isValidElement as o}from"react";import u from"../animatable.js";import c from"../hooks/use-mount-effect.js";function f(r,t={}){return i.forEach(r,(r=>{var n;o(r)&&((null===(n=r.type)||void 0===n?void 0:n.isLively)&&"id"in r.props&&(t[r.props.id]=!0),f(r.props.children,t))})),t}function l(r,t){const n=typeof r,e=typeof t;if(n!==e)return!1;if(o(r))return!(!o(t)||r.key!==t.key)&&l(r.props,t.props);if(Array.isArray(r)){if(!Array.isArray(t)||r.length!==t.length)return!1;for(let n=0;n<r.length;n++)if(!l(r[n],t[n]))return!1;return!0}if("object"===n&&null!==r&&null!==t){const n=Object.keys(r),e=Object.keys(t);if(n.length!==e.length)return!1;if(!n.length)return r.toString()===t.toString();for(let i=0;i<n.length;i++)if(!(n[i]in t)||!l(r[n[i]],t[e[i]]))return!1;return!0}return"function"===n&&n===e||r===t}function a(r,t){try{return l(r,t)}catch(r){return!1}}function s({children:i,transition:o}){const l=t(null),s=t(f(i)),[p,h]=n(i);return e((()=>{if(!l.current||a(p,i))return;let r=0,t=f(i);for(const n of l.current.children)n.current&&!n.current.manual&&n.current.id in s.current&&!(n.current.id in t)&&(r=Math.max(n.current.trigger("unmount"),r));s.current=t,setTimeout((()=>h(i)),1e3*r)}),[i]),c((()=>{var r;if(l.current)for(const t of l.current.children)(null===(r=t.current)||void 0===r?void 0:r.timeline.mounted)&&t.current.adaptive&&t.current.timeline.transition(void 0,o)}),[p]),r(u,{ref:l,cachable:[],passthrough:!0,children:p})}export{s as default};
2
+ import{jsx as e}from"react/jsx-runtime";import{useRef as n,useState as r,Children as t,isValidElement as o,cloneElement as c}from"react";import i from"../animatable.js";import u from"../hooks/use-mount-effect.js";import{Groups as s}from"./morph.js";function d(e,n,r=[]){const t="nodes"in e?e.nodes:e;for(let e=0;e<t.length;e++){const o=[...r,e];let c=n(t[e],o);if(c||(c=d(t[e].nodes,n,o)),c)return c}}function l(e,n){return d(e,((e,r)=>{if(e.key===n)return r}))||null}function a(e,n){let r=e[n[0]];for(let e=1;e<n.length&&r;e++)r=r.nodes[n[e]];return r}function m(e,n,r,t){var o;const c=n[n.length-1],i=n.length>1?null===(o=a(e,n.slice(0,-1)))||void 0===o?void 0:o.nodes:e;i&&(t?i.splice(c,r,t):i.splice(c,r))}function f({tree:e,nodes:n,mounting:r,partialIndex:i=[],keys:u=new Set}){return t.forEach(n,((n,t)=>{const s=o(n),d=s&&(Array.isArray(n.props.children)||o(n.props.children)),m=s&&n.type.isLively&&"id"in n.props,p=[...i,t],h=d&&!m?c(n,void 0,[]):n,y=m?n.props.id:"$l."+p.join("");if(m){const n=l(e,y);if(null===n)r.set(y,{node:h,index:p});else{const r=a(e,n);r&&(r.node=h)}}else{const n=a(e,p);n&&n.key.startsWith("$l.")?n.node=h:r.set(y,{node:h,index:p})}d&&!m&&f({tree:e,nodes:n.props.children,mounting:r,partialIndex:p,keys:u}),u.add(y)})),u}function p(e){return e.map((e=>o(e.node)?e.nodes.length?c(e.node,{key:e.key},p(e.nodes)):c(e.node,{key:e.key}):e.node))}function h({children:t,transition:o}){var c;const a=n(null),[h,y]=r({}),g=n([]),v=n(new Map),k=n(void 0),x=n(0),j=n(new Set),w=f({tree:g.current,nodes:t,mounting:v.current});if(v.current.forEach(((e,n)=>{w.has(n)||v.current.delete(n)})),d(g.current,(e=>{w.has(e.key)||j.current.add(e.key)})),j.current.size&&a.current){for(const e of a.current.children){const n=null===(c=e.current)||void 0===c?void 0:c.id,r=j.current.has(n);if(e.current&&(r&&w.has(n)&&(e.current.timeline.mounted=!0,j.current.delete(n)),r&&e.current.timeline.mounted)){const n=Date.now()+1e3*e.current.trigger("unmount",{immediate:!0});if(x.current=Math.max(x.current,n),e.current.group){const n=s[e.current.group].get(e.current.timeline);n&&(n.state="unmounted")}e.current.timeline.mounted=!1}}const e=x.current-Date.now();clearTimeout(k.current);const n=(e=!0)=>{j.current.forEach((e=>{const n=l(g.current,e);n&&m(g.current,n,1)})),j.current.clear(),e&&y({})};e>0?k.current=setTimeout(n,e):n(!1)}return!j.current.size&&v.current.size&&(v.current.forEach((({node:e,index:n},r)=>{m(g.current,n,0,{key:r,node:e,nodes:[]})})),v.current.clear()),u((()=>{var e;if(a.current)for(const n of a.current.children)(null===(e=n.current)||void 0===e?void 0:e.id)&&n.current.timeline.mounted&&n.current.adaptive&&null!==l(g.current,n.current.id)&&n.current.timeline.transition(void 0,o)})),e(i,{ref:a,passthrough:!0,cachable:[],children:p(g.current)})}export{h as default};
3
3
  //# sourceMappingURL=layout-group.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{__rest as t}from"tslib";import{jsx as r}from"react/jsx-runtime";import{use as e,useRef as i,useState as n,useEffect as o}from"react";import u,{AnimatableContext as s}from"../animatable.js";import{combineRefs as l}from"../core/utils.js";import m from"../hooks/use-mount-effect.js";const c={};function a(a){var{children:f,transition:d={},show:g=!0,group:p}=a,v=t(a,["children","transition","show","group"]);const b=e(s),h=i(null),[j,w]=n(g),[x,T]=n(g);return p=(null==b?void 0:b.group)?`${b.group}__${p}`:p,m((()=>{if(!h.current)return;const t=h.current.timeline;let r;c[p].targets.forEach((e=>{e.mounted&&e!==t&&(r=e)})),g&&!t.mounted&&(c[p].visible=!0,r?t.transition(r,d):h.current.trigger("mount")),T(g)}),[g]),o((()=>{var t;if(!h.current)return;const r=h.current.timeline;if(!g&&r.mounted){if(!c[p].visible){const r=null===(t=h.current)||void 0===t?void 0:t.trigger("unmount");setTimeout((()=>w(!1)),1e3*r)}c[p].targets.delete(r)}(g||c[p].visible)&&w(g),setTimeout((()=>c[p].visible=!1)),r.mounted=g}),[x]),g||j!==g?r(u,Object.assign({},v,{manual:!0,group:p,ref:l((t=>{p in c||(c[p]={targets:new Set,visible:!1}),t&&(c[p].targets.add(t.timeline),h.current=t)}),v.ref),children:f})):null}a.isLively=!0;export{a as default};
2
+ import{__rest as t}from"tslib";import{jsx as e}from"react/jsx-runtime";import{use as o,useRef as r}from"react";import n,{AnimatableContext as i}from"../animatable.js";import{combineRefs as s}from"../core/utils.js";import u from"../hooks/use-mount-effect.js";const m={};function a(a){var{children:l,group:c,transition:d}=a,f=t(a,["children","group","transition"]);const p=o(i),g=(null==p?void 0:p.group)?`${p.group}.${c}`:c;g in m||(m[g]=new Map);const v=r(null);return u((()=>{var t,e;const o=null===(t=v.current)||void 0===t?void 0:t.timeline;if(!o)return;if(m[g].has(o)){m[g].get(o).state="mounted"}else m[g].set(o,{state:"mounted"});const r=Array.from(m[g].entries()).find((([t,e])=>"unmounted"===e.state));return r&&!o.mounted?(o.transition(r[0],d),r[1].state="collected"):o.mounted||null===(e=v.current)||void 0===e||e.trigger("mount"),o.mounted=!0,()=>{const t=m[g].get(o);t.state="unmounted",setTimeout((()=>t.state="collected"),1)}}),[]),e(n,Object.assign({},f,{group:g,manual:!0,ref:s(v,f.ref),children:l}))}a.isLively=!0;export{m as Groups,a as default};
3
3
  //# sourceMappingURL=morph.js.map
@@ -11,7 +11,7 @@ export type AnimatableType<T extends string = any> = {
11
11
  children: React.RefObject<AnimatableType | null>[];
12
12
  inherit: boolean | undefined;
13
13
  adaptive: boolean;
14
- manual: boolean;
14
+ group: string | undefined;
15
15
  id: string;
16
16
  };
17
17
  type SharedProps<T extends string = any> = {
@@ -13,8 +13,9 @@ export default class Track {
13
13
  active: Action[];
14
14
  queue: Action[];
15
15
  cache: StyleCache;
16
- scale: [number, number];
17
16
  paused: boolean;
17
+ scale: [number, number];
18
+ correctedBorderRadius: string;
18
19
  constructor(element: HTMLElement | SVGElement, deform: boolean, cachable?: CachableKey[]);
19
20
  push(action: Action): void;
20
21
  next(): void;
@@ -24,6 +25,6 @@ export default class Track {
24
25
  transition(previous: Track | undefined, options: TransitionOptions): void;
25
26
  apply(prop: string, val: any): void;
26
27
  decomposeScale(): [number, number];
27
- computeBorderRadius(borderRadius?: string): string;
28
+ computeBorderRadius(): void;
28
29
  correct(): void;
29
30
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { AnimatableKeyframe } from "./clip";
3
+ import type Track from "./track";
3
4
  type SharedKeys<T, P> = keyof Omit<T | P, keyof (Omit<T, keyof P> & Omit<P, keyof T>)>;
4
5
  type MergedMaps<T, P> = T & P & {
5
6
  [K in SharedKeys<T, P>]: MergedPair<T[K], P[K]>;
@@ -34,4 +35,5 @@ export declare function distributeAnimatableKeyframes(prop: string, keyframes: A
34
35
  [key: number]: Keyframe;
35
36
  };
36
37
  export declare function normalizeAnimatableKeyframes(keyframes: (AnimatableKeyframe | undefined)[]): boolean;
38
+ export declare function createDynamic(prop: string, keyframes: Keyframe[], easing: string): (this: Track, t: number) => string;
37
39
  export {};
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export default function usePath<T extends SVGGeometryElement = any>(): [(transform: (value: [number, number], index: number) => any) => (progress: number, index: number) => any, React.Ref<T>];
2
+ export default function usePath<T extends SVGGeometryElement = any>(): [React.Ref<T>, (transform: (value: [number, number], index: number) => any) => (progress: number, index: number) => any];
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { Link } from "../core/link";
3
- export default function useViewport<T extends Element = any>(threshold?: number): [Link<[number, number]>, React.Ref<T>];
3
+ export default function useViewport<T extends Element = any>(threshold?: number): [React.Ref<T>, Link<[number, number]>];
@@ -4,4 +4,4 @@ export default function useVisible<T extends Element = any>({ enter, exit, thres
4
4
  enter?: boolean | number;
5
5
  exit?: boolean | number;
6
6
  threshold?: number;
7
- }): [Trigger, React.Ref<T>];
7
+ }): [React.Ref<T>, Trigger, Trigger];
@@ -1,9 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { Easing } from "../core/clip";
2
+ import type { TransitionOptions } from "../core/track";
3
3
  export default function LayoutGroup({ children, transition }: {
4
4
  children: React.ReactNode;
5
- transition?: {
6
- duration?: number;
7
- easing?: Easing;
8
- };
5
+ transition?: Omit<TransitionOptions, 'reverse'>;
9
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,15 @@
1
1
  import { AnimatableProps } from "../animatable";
2
+ import Timeline from "../core/timeline";
2
3
  import { TransitionOptions } from "../core/track";
3
- type MorphProps = {
4
+ export declare const Groups: {
5
+ [key: string]: Map<Timeline, {
6
+ state: 'mounted' | 'unmounted' | 'collected';
7
+ }>;
8
+ };
9
+ declare function Morph({ children, group, transition, ...props }: {
4
10
  group: string;
5
11
  transition?: Omit<TransitionOptions, 'reverse'>;
6
- show?: boolean;
7
- } & AnimatableProps;
8
- declare function Morph({ children, transition, // should be able to be inherited
9
- show, group, ...props }: MorphProps): import("react/jsx-runtime").JSX.Element | null;
12
+ } & AnimatableProps): import("react/jsx-runtime").JSX.Element;
10
13
  declare namespace Morph {
11
14
  var isLively: boolean;
12
15
  }
package/package.json CHANGED
@@ -1,22 +1,27 @@
1
1
  {
2
2
  "name": "@infinityfx/lively",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.10",
4
4
  "type": "module",
5
5
  "description": "Feature complete, lightweight react animation library.",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/types/index.d.ts",
9
9
  "exports": {
10
- ".": "./dist/index.js",
11
- "./animations": "./dist/animations.js",
12
- "./hooks": "./dist/hooks.js",
13
- "./layout": "./dist/layout.js"
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./hooks": {
15
+ "types": "./dist/types/hooks.d.ts",
16
+ "default": "./dist/hooks.js"
17
+ },
18
+ "./layout": {
19
+ "types": "./dist/types/layout.d.ts",
20
+ "default": "./dist/layout.js"
21
+ }
14
22
  },
15
23
  "typesVersions": {
16
24
  "*": {
17
- "animations": [
18
- "./dist/types/animations.d.ts"
19
- ],
20
25
  "hooks": [
21
26
  "./dist/types/hooks.d.ts"
22
27
  ],
@@ -68,4 +73,4 @@
68
73
  "typescript": "^5.4.5"
69
74
  },
70
75
  "sideEffects": false
71
- }
76
+ }
@@ -1,2 +0,0 @@
1
- import o from"../core/clip.js";const t=new o({opacity:1,duration:.65},{opacity:0});export{t as default};
2
- //# sourceMappingURL=fade.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fade.js","sources":["../../src/animations/fade.ts"],"sourcesContent":[null],"names":["Fade","Clip","opacity","duration"],"mappings":"+BAEA,MAAMA,EAAO,IAAIC,EAAK,CAClBC,QAAS,EACTC,SAAU,KACX,CACCD,QAAS"}
@@ -1,2 +0,0 @@
1
- import t from"../core/clip.js";const a=new t({opacity:1,translate:"0px 0px",duration:.5},{opacity:0,translate:"0px 20px"});export{a as default};
2
- //# sourceMappingURL=move.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"move.js","sources":["../../src/animations/move.ts"],"sourcesContent":[null],"names":["Move","Clip","opacity","translate","duration"],"mappings":"+BAEA,MAAMA,EAAO,IAAIC,EAAK,CAClBC,QAAS,EACTC,UAAW,UACXC,SAAU,IACX,CACCF,QAAS,EACTC,UAAW"}
@@ -1,2 +0,0 @@
1
- import o from"../core/clip.js";const a=new o({opacity:1,scale:1,duration:.25},{opacity:0,scale:.85});export{a as default};
2
- //# sourceMappingURL=pop.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pop.js","sources":["../../src/animations/pop.ts"],"sourcesContent":[null],"names":["Pop","Clip","opacity","scale","duration"],"mappings":"+BAEA,MAAMA,EAAM,IAAIC,EAAK,CACjBC,QAAS,EACTC,MAAO,EACPC,SAAU,KACX,CACCF,QAAS,EACTC,MAAO"}
@@ -1,2 +0,0 @@
1
- import e from"../core/clip.js";const r=new e({scale:1},{transformOrigin:"left",scale:"0 1"});export{r as default};
2
- //# sourceMappingURL=scale.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scale.js","sources":["../../src/animations/scale.ts"],"sourcesContent":[null],"names":["Scale","Clip","scale","transformOrigin"],"mappings":"+BAEA,MAAMA,EAAQ,IAAIC,EAAK,CACnBC,MAAO,GACR,CACCC,gBAAiB,OACjBD,MAAO"}
@@ -1,2 +0,0 @@
1
- import t from"../core/clip.js";const e=new t({clipPath:"inset(0% 0% 0% 0%)"},{clipPath:"inset(0% 100% 0% 0%)"});export{e as default};
2
- //# sourceMappingURL=wipe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wipe.js","sources":["../../src/animations/wipe.ts"],"sourcesContent":[null],"names":["Wipe","Clip","clipPath"],"mappings":"+BAEA,MAAMA,EAAO,IAAIC,EAAK,CAClBC,SAAU,sBACX,CACCA,SAAU"}
@@ -1,2 +0,0 @@
1
- export{default as Fade}from"./animations/fade.js";export{default as Move}from"./animations/move.js";export{default as Pop}from"./animations/pop.js";export{default as Scale}from"./animations/scale.js";export{default as Wipe}from"./animations/wipe.js";export{default as Clip}from"./core/clip.js";
2
- //# sourceMappingURL=animations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"animations.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import Clip from "../core/clip";
2
- declare const Fade: Clip;
3
- export default Fade;
@@ -1,3 +0,0 @@
1
- import Clip from "../core/clip";
2
- declare const Move: Clip;
3
- export default Move;
@@ -1,3 +0,0 @@
1
- import Clip from "../core/clip";
2
- declare const Pop: Clip;
3
- export default Pop;
@@ -1,3 +0,0 @@
1
- import Clip from "../core/clip";
2
- declare const Scale: Clip;
3
- export default Scale;
@@ -1,3 +0,0 @@
1
- import Clip from "../core/clip";
2
- declare const Wipe: Clip;
3
- export default Wipe;
@@ -1,7 +0,0 @@
1
- import Fade from "./animations/fade";
2
- import Move from "./animations/move";
3
- import Pop from "./animations/pop";
4
- import Scale from "./animations/scale";
5
- import Wipe from "./animations/wipe";
6
- import Clip from "./core/clip";
7
- export { Fade, Move, Pop, Scale, Wipe, Clip };