@infinityfx/lively 3.0.0-beta.6 → 3.0.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 CHANGED
@@ -6,57 +6,75 @@
6
6
  ![NPM weekly downloads](https://img.shields.io/npm/dw/@infinityfx/lively)
7
7
  ![NPM downloads](https://img.shields.io/npm/dt/@infinityfx/lively)
8
8
 
9
- Feature complete, lightweight react animation library. Lively lets u create performant animations without the hassle.
9
+ Feature complete, lightweight react animation library. Lively lets u create complex animations without the hassle.
10
10
 
11
11
  ## Table of contents
12
12
  - [Get started](#get-started)
13
13
  - [Installation](#installation)
14
14
  - [Usage](#usage)
15
- - [Base components](#base-components)
15
+ - [Defining animations](#defining-animations)
16
+ - [Components](#components)
16
17
  - [Animatable `<Animatable />`](#animatable-animatable)
17
18
  - [Animate `<Animate />`](#animate-animate)
18
- - [Reactivity](#reactivity)
19
- - [Auto-animation](#auto-animation)
20
19
  - [LayoutGroup `<LayoutGroup />`](#layoutgroup-layoutgroup)
21
20
  - [Morph `<Morph />`](#morph-morph)
22
- - [Parallax `<Parallax />`](#parallax-parallax)
23
- - [`WriteOn <WriteOn />`](#writeon-writeon)
24
- - [`ColorWipe <ColorWipe />`](#colorwipe-colorwipe)
25
- - [Animations](#animations)
26
- - [Overview](#overview)
27
- - [Create your own](#create-your-own)
28
21
  - [Hooks](#hooks)
29
- - [`useUnmount()`](#useunmount)
30
22
  - [`useLink()`](#uselink)
31
23
  - [`useScroll()`](#usescroll)
32
24
  - [`usePath()`](#usepath)
25
+ - [`useAudio()`](#useaudio)
33
26
  - [`useReducedMotion()`](#usereducedmotion)
27
+ - [Animations](#animations)
28
+ - [Bundled](#bundled)
29
+ - [Creating clips](#creating-clips)
34
30
 
35
- ## Get started
31
+ # Get started
36
32
 
37
- ### Installation
33
+ ## Installation
38
34
 
39
35
  ```sh
40
36
  $ npm i @infinityfx/lively
41
37
  ```
42
38
 
43
- ### Usage
39
+ ## Usage
44
40
 
45
41
  ```jsx
46
- import { Animate } from '@infinityfx/lively';
42
+ import { Animatable } from '@infinityfx/lively';
47
43
 
48
44
  ...
49
45
 
50
- <Animate onMount>
46
+ <Animatable onMount initial={{ opacity: 0 }} animate={{ opacity: 1 }}>
51
47
  <div class="my-class">
52
48
  Lorem ipsum enim amet consequat ut reprehenderit cupidatat et incididunt qui minim culpa. Dolor do laborum nulla pariatur tempor excepteur duis et ipsum.
53
49
  </div>
54
- </Animate>
50
+ </Animatable>
55
51
  ```
56
52
 
57
- ## Base components
53
+ ## Defining animations
58
54
 
59
- ### Animatable `<Animatable />`
55
+ 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.
56
+
57
+ ```jsx
58
+ <Animatable
59
+ animate={{
60
+ opacity: 1,
61
+ scale: ['0 0', '0.5 0', '1 1'],
62
+ borderRadius: (progress) => progress * 10,
63
+ duration: 2, // Animation will last 2 seconds
64
+ immediate: true // Animation will override any currently playing animation
65
+ }}
66
+ animations={{
67
+ myAnimation: {
68
+ opacity: [0, 1, 0.5]
69
+ }
70
+ }}>
71
+ ...
72
+ </Animatable>
73
+ ```
74
+
75
+ # Components
76
+
77
+ ## Animatable `<Animatable />`
60
78
 
61
79
  Base animation component that allows for fully customizable animations.
62
80
 
@@ -73,9 +91,9 @@ import { Animatable } from '@infinityfx/lively';
73
91
  </Animatable>
74
92
  ```
75
93
 
76
- ### Animate `<Animate />`
94
+ ## Animate `<Animate />`
77
95
 
78
- Fully automatic animation based on pre-fab animations.
96
+ Fully automated animations based on animation clips.
79
97
 
80
98
  ```jsx
81
99
  import { Animate } from '@infinityfx/lively';
@@ -83,31 +101,25 @@ import { Scale, Fade } from '@infinityfx/lively/animations';
83
101
 
84
102
  ...
85
103
 
86
- <Animate onMount animations={[Scale({ duration: 2 }), Fade]}>
104
+ <Animate onMount animations={[Scale.unique({ duration: 2 }), Fade]}>
87
105
  <div class="my-class">
88
106
  ...
89
107
  </div>
90
108
  </Animate>
91
109
  ```
92
110
 
93
- ## Reactivity
111
+ ## LayoutGroup `<LayoutGroup />`
94
112
 
95
- Lively implements fully reactive animations using the [`useLink()`](#uselink) and [`useScroll()`](#usescroll) hooks.
96
-
97
- ## Auto-animation
98
-
99
- ### LayoutGroup `<LayoutGroup />`
100
-
101
- Animates `<Animatable />` and `<Morph />` components, that are direct children when their layout changes.
113
+ 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.
102
114
 
103
115
  ```jsx
104
116
  import { Animatable } from '@infinityfx/lively';
105
- import { LayoutGroup } from '@infinityfx/lively/auto';
117
+ import { LayoutGroup } from '@infinityfx/lively/layout';
106
118
 
107
119
  ...
108
120
 
109
121
  <LayoutGroup>
110
- <Animatable>
122
+ <Animatable key="mykey" onUnmount animate={{ opacity: 1 }} initial={{ opacity: 0 }}>
111
123
  <div class="my-class">
112
124
  Hello world!
113
125
  </div>
@@ -115,147 +127,38 @@ import { LayoutGroup } from '@infinityfx/lively/auto';
115
127
  </LayoutGroup>
116
128
  ```
117
129
 
118
- ### Morph `<Morph />`
130
+ ## Morph `<Morph />`
119
131
 
120
132
  Morphs one element into another.
121
133
 
122
134
  ```jsx
123
- import { Morph } from '@infinityfx/lively/auto';
135
+ import { useState } from 'react';
136
+ import { Morph } from '@infinityfx/lively/layout';
124
137
 
125
138
  ...
126
139
 
127
- <Morph active={state}>
140
+ const [state, setState] = useState(false);
141
+
142
+ ...
143
+
144
+ <Morph id="mymorph" shown={state}>
128
145
  <div onClick={() => setState(!state)}>
129
146
  ...
130
147
  </div>
131
148
  </Morph>
132
149
 
133
- <Morph active={!state}>
150
+ <Morph id="mymorph" shown={!state} transition={{ duration: 0.5 }}>
134
151
  <div onClick={() => setState(!state)}>
135
152
  ...
136
153
  </div>
137
154
  </Morph>
138
155
  ```
139
156
 
140
- #### Parallax `<Parallax />`
141
-
142
- Easily create parallax motion based on page scroll position.
143
-
144
- ```jsx
145
- import { Parallax } from '@infinityfx/lively/auto';
146
-
147
- ...
148
-
149
- <Parallax amount={0.5}> // default amount = 0.5
150
- <div class="my-class">
151
- ...
152
- </div>
153
- </Parallax>
154
- ```
155
-
156
- ### WriteOn `<WriteOn />`
157
-
158
- ```jsx
159
- import { WriteOn } from '@infinityfx/lively/auto';
160
-
161
- ...
162
-
163
- <WriteOn>Lorem ipsum dolor sit amet</WriteOn>
164
- ```
165
-
166
- ### ColorWipe `<ColorWipe />`
167
-
168
- ```jsx
169
- import { ColorWipe } from '@infinityfx/lively/auto';
170
-
171
- ...
172
-
173
- <ColorWipe>
174
- <div class="my-class">...</div>
175
- </ColorWipe>
176
- ```
177
-
178
- ## Animations
179
-
180
- ### Overview
181
-
182
- Lively exports a submodule called animations which contains various pre-fab animations that can be used in tandem with the `<Animate />` and `<Animatable />` components. These animations can be used as is, or can be configured with extra options by calling the respective animation as a function which takes as an argument the options object.
183
-
184
- ```jsx
185
- import { Move } from '@infinityfx/lively/animations';
186
-
187
- // configure the animation
188
- Move({ direction: 'down' }); // default = 'up'
189
- ```
190
-
191
- These pre-fab can be used as followed with either an `<Animate />` or `<Animatable />` component:
192
-
193
- ```jsx
194
- import { Move } from '@infinityfx/lively/animations';
195
- import { Animate } from '@infinityfx/lively/auto';
196
-
197
- ...
198
-
199
- <Animate animations={[Move, Move({ ... })]}>...</Animate>
200
- ```
201
-
202
- ```jsx
203
- import { Move } from '@infinityfx/lively/animations';
204
- import { Animatable } from '@infinityfx/lively';
205
-
206
- ...
207
-
208
- <Animatable animations={{
209
- myAnimationName: Move,
210
- myOtherAnimation: Move({ ... })
211
- }}>...</Animatable>
212
-
213
- // or
214
-
215
- <Animatable animate={Move}>...</Animatable>
216
- ```
217
-
218
- ### Create your own
219
-
220
- If you whish to create your own pre-fab animation, you can do so using the `.create()` method of the `Animation` class. This method takes a function which gets the animation configuration options passed as an argument. The function must return the animation properties/keyframes.
221
-
222
- ```js
223
- import { Animation } from '@infinityfx/lively/animations';
224
-
225
- const myCustomAnimation = Animation.create((options) => {
226
-
227
- // do whatever you want here.
228
-
229
- // This function must return an Array with 2 Objects, containing the animation properties and/or keyframes and the initial values for the animation respectively.
230
- return [{ ... }, { ... }];
231
- });
232
-
233
- export default myCustomAnimation;
234
- ```
235
-
236
- ## Hooks
157
+ # Hooks
237
158
 
238
159
  Lively comes with a set of hooks that allow for the creation of complex reactive animations.
239
160
 
240
- ### `useUnmount()`
241
-
242
- The useUnmount hook can be used to animate out components that are being unmounted. It can be used in tandem with the `<Animatable />` and `<Animate />` components.
243
-
244
- ```jsx
245
- import { useUnmount } from '@infinityfx/lively/hooks';
246
- import { Animatable } from '@infinityfx/lively';
247
-
248
- export default function Page() {
249
-
250
- const [mounted, setMounted, ref] = useUnmount(true /* initial mounted value */);
251
-
252
- return mounted &&
253
- <Animatable ref={ref} onMount onUnmount>...</Animatable>;
254
-
255
- }
256
- ```
257
-
258
- ### `useLink()`
161
+ ## `useLink()`
259
162
 
260
163
  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.
261
164
 
@@ -284,53 +187,125 @@ Additionally you can provide a link with a function to transform the value to a
284
187
  ```jsx
285
188
  const [link, setValue] = useLink(0 /* initial value */);
286
189
 
287
- return <Animatable animate={{
288
- position: link(input => {
289
- input /= 100; // example where the input value needs to be divided for the correct output format.
190
+ ...
290
191
 
291
- return { x: input, y: input }; // we return an object instead of a number for the position property.
192
+ <Animatable animate={{
193
+ translate: link(input => {
194
+ return `${input} ${input}`; // we return a string instead of a number for the translate property.
292
195
  })
293
196
  }}>...</Animatable>;
294
197
  ```
295
198
 
296
- ### `useScroll()`
199
+ ## `useScroll()`
297
200
 
298
- The `useScroll` hook is an extension of the `useLink` hook which returns a reactive value that corresponds to the current scroll position of the window.
201
+ The `useScroll` hook returns a reactive link that corresponds to the current scroll position of the window.
299
202
 
300
203
  ```jsx
301
204
  const value = useScroll();
302
205
 
206
+ ...
207
+
303
208
  // gradually fade in element when scrolling the window
304
- return <Animatable animate={{
209
+ <Animatable animate={{
305
210
  opacity: value(val => val / document.body.scrollHeight)
306
211
  }}>...</Animatable>;
307
212
  ```
308
213
 
309
- ### `usePath()`
214
+ ## `usePath()`
310
215
 
311
216
  The `usePath` hook can be used to animate an element along an SVG path.
312
217
 
313
218
  ```jsx
314
- const [link, ref] = usePath([100, 0], 2); // offset the path by 100px along the x-axis and scale it up by a factor of 2.
219
+ const [link, ref] = usePath();
220
+
221
+ ...
315
222
 
316
- return <>
223
+ <>
317
224
  <Animatable animate={{
318
- translate: link
225
+ translate: link(([x, y]) => `${x} ${y}`)
319
226
  }}>...</Animatable>
320
227
 
321
228
  <svg>
322
- <path ref={ref} d="..." /> {/* Some svg path to reference */}
229
+ <path ref={ref} d="..." />
323
230
  </svg>
324
231
  </>;
325
232
  ```
326
233
 
327
- ### `useReducedMotion()`
234
+ ## `useAudio()`
235
+
236
+ The `useAudio` hook can be used to create animations that react to the frequency response of playing audio.
237
+
238
+ ```jsx
239
+ const source = useRef();
240
+ const link = useAudio(source.current, { bands: 8 });
241
+
242
+ ...
243
+
244
+ <>
245
+ <Animatable animate={{
246
+ scale: link((values, i) => `1 ${values[i]}`)
247
+ }}>...</Animatable>
248
+
249
+ <audio ref={source} src="myaudio.mp3">
250
+ </>;
251
+ ```
252
+
253
+ ## `useReducedMotion()`
328
254
 
329
255
  The `useReducedMotion` hook checks whether a user prefers the use of reduced motion on a page.
330
256
 
331
257
  ```jsx
332
258
  const reduced = useReducedMotion();
333
259
 
260
+ ...
261
+
334
262
  // If the user prefers reduced motion, then pause the animation.
335
- return <Animatable animate={{ ... }} paused={reduced}>...</Animatable>;
263
+ <Animatable animate={{ ... }} paused={reduced}>...</Animatable>;
264
+ ```
265
+
266
+ # Animations
267
+
268
+ ## Bundled
269
+
270
+ 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.
271
+
272
+ ```jsx
273
+ import { Move, Scale } from '@infinityfx/lively/animations';
274
+ import { Animate } from '@infinityfx/lively/auto';
275
+ import { Animatable } from '@infinityfx/lively';
276
+
277
+ ...
278
+
279
+ const myClip = Move.unique({ duration: 2 }); // configure the animation
280
+
281
+ ...
282
+
283
+ <>
284
+ <Animate animations={[myClip]}>...</Animate>
285
+
286
+ <Animatable animations={{
287
+ myAnimation: Scale,
288
+ myOtherAnimation: Scale.unique({ delay: 1 })
289
+ }}>...</Animatable>
290
+ </>
291
+ ```
292
+
293
+ ## Creating clips
294
+
295
+ 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.
296
+
297
+ ```js
298
+ import { Clip } from '@infinityfx/lively/animations';
299
+
300
+ const myCustomAnimation = new Clip(
301
+ {
302
+ opacity: 1, // value to animate to
303
+ duration: 2 // Clip will have a duration of 2 seconds
304
+ },
305
+ {
306
+ opacity: 0 // initial value
307
+ }
308
+ );
309
+
310
+ export default myCustomAnimation;
336
311
  ```
@@ -0,0 +1,2 @@
1
+ import{C as t,_ as e,a as i}from"./clip-a50f113a.js";import{jsx as r,Fragment as n}from"react/jsx-runtime";import{forwardRef as a,useRef as o,useCallback as s,useImperativeHandle as c,useEffect as u,Children as h,isValidElement as d,cloneElement as l}from"react";import{l as p,I as f,m}from"./utils-1031ecb2.js";var v=function(){function e(t){this.element=t,this.computed=getComputedStyle(t),this.data=this.read()}return e.prototype.read=function(){var t=this.element.getBoundingClientRect(),e=t.x,i=t.y,r=t.width,n=t.height,a=this.computed,o=a.borderRadius,s=a.opacity,c=a.backgroundColor,u=a.color,h=a.rotate;return{x:e-window.scrollX,y:i+window.scrollY,width:r,height:n,borderRadius:o,opacity:s,backgroundColor:c,color:u,rotate:h}},e.prototype.update=function(){this.data=this.read()},e.prototype.difference=function(e,i){void 0===e&&(e=this.data);for(var r=i.duration,n=i.easing,a=this.read(),o={duration:r,easing:n},s=0,c=["borderRadius","backgroundColor","color","rotate","opacity"];s<c.length;s++){var u=c[s];o[u]=[e[u],a[u]]}return[new t({translate:["".concat(e.x-a.x,"px ").concat(e.y-a.y,"px"),"0px 0px"],scale:["".concat(0===a.width?1:e.width/a.width," ").concat(0===a.height?1:e.height/a.height),"1 1"],composite:!0,duration:r,easing:n}),new t(o)]},e}(),g=function(){function t(t,e){this.playing=0,this.active=[],this.queue=[],this.onupdate=null,this.onremove=null,this.scaleDelta=[1,1],this.element=t,this.deform=e,this.cache=new v(t)}return t.prototype.push=function(t){var e;return this.element.isConnected?(t.onfinish=this.next.bind(this),this.playing&&!t.composited?(this.queue.push(t),t.animation.pause()):(this.active.push(t),t.composited||this.playing++),t):null===(e=this.onremove)||void 0===e?void 0:e.call(this)},t.prototype.next=function(){var t,e;if(!this.element.isConnected)return null===(t=this.onremove)||void 0===t?void 0:t.call(this);null===(e=this.onupdate)||void 0===e||e.call(this),this.cache.update(),--this.playing>0||(this.active=this.queue.length?this.queue.splice(0,1):[],this.playing=this.active.length,this.play())},t.prototype.clear=function(){this.active=this.active.filter((function(t){return t.animation.cancel(),t.composited})),this.queue=[],this.playing=0},t.prototype.pause=function(){for(var t=0,e=this.active;t<e.length;t++){e[t].animation.pause()}},t.prototype.play=function(){for(var t=0,e=this.active;t<e.length;t++){e[t].animation.play()}},t.prototype.step=function(t){for(var e=0,i=this.active;e<i.length;e++){i[e].step(t)}},t.prototype.transition=function(t,e){var i=this,r=this.cache.difference(null==t?void 0:t.cache.data,e);this.cache.update(),null==t||t.cache.update(),null==t||t.clear(),r.forEach((function(t){return t.play(i,{})}))},t.prototype.apply=function(t,e){this.set(t,e),this.correct()},t.prototype.set=function(t,e){"borderRadius"===t&&(e=this.computeBorderRadius(e)),this.element.style[t]="strokeDashoffset"===t?p(e):e},t.prototype.decomposeScale=function(){var t=this.cache.computed.scale.split(" "),e=t[0],i=t[1],r=Math.max(parseFloat(e)||1,1e-4);/%$/.test(e)&&(r/=100);var n=i?Math.max(parseFloat(i),1e-4):r;return/%$/.test(i)&&(n/=100),[r,n]},t.prototype.computeBorderRadius=function(t){if(void 0===t&&(t=this.cache.computed.borderRadius),this.deform)return t;var e=t.match(/([\d\.]+)(?:.*\/.*?([\d\.]+))?/)||["","0","0"];e[0];var i=e[1],r=e[2],n=parseFloat(i)*this.scaleDelta[0],a=r?parseFloat(r)*this.scaleDelta[1]:n;return this.scaleDelta=this.decomposeScale(),"".concat(n/this.scaleDelta[0],"px / ").concat(a/this.scaleDelta[1],"px")},t.prototype.correct=function(){if(!this.deform){this.element.style.borderRadius=this.computeBorderRadius();for(var t=this.decomposeScale(),e=t[0],i=t[1],r=0;r<this.element.children.length;r++){this.element.children[r].style.transform="scale(".concat(1/e,", ").concat(1/i,")")}}},t}(),y=function(){function e(t){var e=t.stagger,i=void 0===e?.1:e,r=t.staggerLimit,n=void 0===r?10:r,a=t.deform,o=void 0===a||a;this.index=0,this.paused=!1,this.tracks=new f,this.frame=0,this.stagger=i,this.staggerLimit=n-1,this.deform=o}return e.prototype.step=function(){cancelAnimationFrame(this.frame),this.tracks.forEach((function(t,e){return t.step(e)})),this.frame=requestAnimationFrame(this.step.bind(this))},e.prototype.time=function(t){return t.duration+this.stagger*Math.min(this.staggerLimit,this.tracks.size-1)},e.prototype.port=function(e,i,r){var n;if(!this.paused)for(var a=0;a<this.tracks.size;a++){var o=i(a);r?new t((n={duration:r,easing:"ease"},n[e]=o,n)).play(this.tracks.values[a],{}):this.tracks.values[a].apply(e,o)}},e.prototype.transition=function(t,e){for(var i=void 0===e?{}:e,r=i.duration,n=void 0===r?.5:r,a=i.easing,o=void 0===a?"ease":a,s=0;s<this.tracks.size;s++)this.tracks.values[s].transition(null==t?void 0:t.tracks.values[s],{duration:n,easing:o})},e.prototype.insert=function(t){var e=this;if(t&&("TRACK_INDEX"in t||(t.TRACK_INDEX=this.index++),!this.tracks.has(t.TRACK_INDEX))){var i=new g(t,this.deform);this.tracks.add(t.TRACK_INDEX,i),i.onremove=function(){return e.tracks.remove(t.TRACK_INDEX)}}},e.prototype.add=function(t,e){for(var i=e.immediate,r=void 0!==i&&i,n=e.composite,a=e.reverse,o=e.delay,s=void 0===o?0:o,c=0;c<this.tracks.size;c++)r&&this.tracks.values[c].clear(),t.play(this.tracks.values[c],{delay:s+Math.min(c,this.staggerLimit)*(this.stagger<0?t.duration/this.tracks.size:this.stagger),composite:n,reverse:a})},e.prototype.pause=function(){for(var t=0,e=this.tracks.values;t<e.length;t++){e[t].pause()}this.paused=!0},e.prototype.play=function(){for(var t=0,e=this.tracks.values;t<e.length;t++){e[t].play()}this.paused=!1},e}(),k=a((function(a,p){var f=a.children,v=a.animations,g=a.playbook,x=void 0===g?[]:g,b=a.animate,w=a.initial,R=a.stagger,C=a.staggerLimit,D=a.deform,_=a.order,A=a.onMount,L=void 0!==A&&A,E=a.onUnmount,z=void 0!==E&&E,F=a.noCascade,M=void 0!==F&&F,X=a.text,q=void 0!==X&&X,I=a.disabled,N=void 0!==I&&I,K=a.paused,T=void 0!==K&&K,B=a.id,S=void 0===B?"":B,j=void 0!==_?_:1,U=o({}),V=o(!1),$=o(new y({stagger:q?-1:R,staggerLimit:q?Number.MAX_VALUE:C,deform:D})),W=o([]),Y=o([]);if(!U.current.__initialized)for(var G in U.current.__initialized=!0,U.current.animate=t.from(b,w,$.current),v)U.current[G]=t.from(v[G],w);var H=s((function(t,e,i){if(void 0===e&&(e={}),void 0===i&&(i=1),!t||N||j>1&&i<2)return 0;"string"!=typeof t&&(t="animate");var r=U.current[t];if(!r)return 0;for(var n=0,a=e.delay||0,o=$.current.time(r),s=0,c=Y.current;s<c.length;s++){var u=c[s];if(u){var h=u.play(t,m({delay:a+o},e),i+1);n=Math.max(n,h)}}var d=(e.reverse?n:a)*(j/i);return $.current.add(r,m({delay:d},e)),o+d}),[N,j]);return c(p,(function(){return{play:H,timeline:$.current,mounted:V.current,onUnmount:z,id:S}}),[z]),u((function(){(T||N)&&$.current.pause(),T||N||$.current.play()}),[T,N]),u((function(){for(var t=0;t<x.length;t++){var i=x[t],r=i.name,n=i.trigger,a=e(i,["name","trigger"]);n!==W.current[t]&&n&&H(r,a),W.current[t]=n}}),[x]),u((function(){$.current.step(),V.current=!0,document.fonts.ready.then((function(){return H(L,{immediate:!0})}))}),[]),r(n,{children:function t(e,n,a){return void 0===n&&(n=!0),h.map(e,(function(e){var a=d(e),o=a&&e.type===k,s=a?e.props:{},c={};if(o){if(!M){var u=Y.current.length++;c.order=void 0!==s.order?s.order:(void 0!==_?_:1)+1,c.paused=T,c.ref=function(t){return Y.current[u]=t},c.id=S+u,m(c,s,{animate:b,initial:w,animations:v,stagger:R,staggerLimit:C,deform:D})}}else if(n){var h=a&&e.ref;c.pathLength=1,c.ref=function(t){$.current.insert(t),h&&"current"in h&&(h.current=t),h instanceof Function&&h(t)},c.style=m({backfaceVisibility:"hidden",strokeDasharray:1},w||U.current.animate.initial,s.style)}return a?l(e,c,t(s.children,!1)):n&&["string","number","boolean"].includes(typeof e)?q&&"string"==typeof e?e.split("").map((function(t,e){return r("span",i({ref:function(t){return $.current.insert(t)},style:{minWidth:" "===t?"0.35em":0}},{children:t}))})):r("div",i({},c,{children:e})):e}))}(f)})}));export{k as A};
2
+ //# sourceMappingURL=animatable-abd618ff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animatable-abd618ff.js","sources":["../src/core/cache.ts","../src/core/track.ts","../src/core/timeline.ts","../src/animatable.tsx"],"sourcesContent":[null,null,null,null],"names":["StyleCache","element","this","computed","getComputedStyle","data","read","prototype","_a","getBoundingClientRect","x","y","width","height","_b","borderRadius","opacity","backgroundColor","color","rotate","window","scrollX","scrollY","update","difference","from","duration","easing","to","keyframes","_i","length","key","Clip","translate","concat","scale","composite","Track","deform","playing","active","queue","onupdate","onremove","scaleDelta","cache","push","action","isConnected","onfinish","next","bind","composited","animation","pause","call","splice","play","clear","filter","cancel","step","index","transition","previous","options","_this","clips","forEach","clip","apply","prop","val","set","correct","computeBorderRadius","style","lengthToOffset","decomposeScale","split","xString","yString","Math","max","parseFloat","test","match","xr","yr","i","children","transform","Timeline","stagger","_c","staggerLimit","_d","paused","tracks","IndexedList","frame","cancelAnimationFrame","track","requestAnimationFrame","time","min","size","port","link","values","insert","TRACK_INDEX","has","add","remove","immediate","reverse","delay","Animatable","forwardRef","ref","animations","playbook","animate","initial","order","onMount","onUnmount","_e","noCascade","_f","text","_g","disabled","_h","_j","id","cascadeOrder","undefined","clipMap","useRef","mounted","timeline","Number","MAX_VALUE","playbookState","nodes","current","__initialized","name_1","useCallback","layer","cascadeDelay","layerDelay","node","delay_1","merge","useImperativeHandle","useEffect","name_2","name","trigger","__rest","document","fonts","ready","then","_jsx","render","isDirectChild","isParent","Children","map","child","valid","isValidElement","isAnimatable","type","childProps","props","i_1","el","ref_1","pathLength","Function","backfaceVisibility","strokeDasharray","cloneElement","includes","char","__assign","minWidth"],"mappings":"wTAcA,IAAAA,EAAA,WAMI,SAAAA,EAAYC,GACRC,KAAKD,QAAUA,EACfC,KAAKC,SAAWC,iBAAiBH,GACjCC,KAAKG,KAAOH,KAAKI,OA6CzB,OA1CIN,EAAAO,UAAAD,KAAA,WACU,IAAAE,EAA0BN,KAAKD,QAAQQ,wBAArCC,MAAGC,MAAGC,UAAOC,WACfC,EAA4DZ,KAAKC,SAA/DY,iBAAcC,YAASC,oBAAiBC,UAAOC,WAEvD,MAAO,CACHT,EAAGA,EAAIU,OAAOC,QACdV,EAAGA,EAAIS,OAAOE,QACdV,MAAKA,EACLC,OAAMA,EACNE,aAAYA,EACZC,QAAOA,EACPC,gBAAeA,EACfC,MAAKA,EACLC,OAAMA,IAIdnB,EAAAO,UAAAgB,OAAA,WACIrB,KAAKG,KAAOH,KAAKI,QAGrBN,EAAAO,UAAAiB,WAAA,SAAWC,EAA6BjB,QAA7B,IAAAiB,IAAAA,EAAkBvB,KAAKG,MAI9B,QAJsCqB,EAAQlB,EAAAkB,SAAEC,EAAMnB,EAAAmB,OAChDC,EAAK1B,KAAKI,OAEVuB,EAAiB,CAAEH,WAAUC,OAAMA,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AAMI,WAAa,EACnBJ,EAAM3D,IAAM,SAAA6D,GACRvC,EAASK,QAAQrC,OAAOuE,GACpBC,GAAO,YAAaA,IAAKA,EAAInC,QAAUkC,GACvCC,aAAeE,UAAUF,EAAID,IAErCF,EAAMvG,MAAQgF,EAAM,CAAE6B,mBAAoB,SAAUC,gBAAiB,GAAK9D,GAAWe,EAAQQ,QAAQxB,QAAQC,QAASsD,EAAWtG,OAGzI,OAAKkG,EAUEa,EAAad,EAAOM,EAAOX,EAAOU,EAAWxF,UAAU,IATrD+E,GAAkB,CAAC,SAAU,SAAU,WAAWmB,gBAAgBf,GAEnE1C,GAAyB,iBAAV0C,EACRA,EAAM9F,MAAM,IAAI6F,KAAI,SAACiB,EAAMpG,GAAM,OAAA8E,EAAA,OAAAuB,EAAA,CAAMtE,IAAK,SAAA6D,GAAM,OAAAvC,EAASK,QAAQrC,OAAOuE,IAAKzG,MAAO,CAAEmH,SAAmB,MAATF,EAAe,SAAW,IAAM,CAAAnG,SAAAmG,QAGtItB,EAAS,MAAAuB,EAAA,GAAAX,EAAQ,CAAAzF,SAAAmF,KAN8DA,KAaxFL,CAAO9E"}
@@ -1,2 +1,2 @@
1
- import{C as t}from"./clip-a50f113a.js";export{M as Move,P as Pop}from"./pop-60cc89e0.js";import"./utils-1031ecb2.js";var i=new t({opacity:1,duration:.65},{opacity:0}),o=new t({scale:1},{transformOrigin:"left",scale:"0 1"}),a=new t({clipPath:"inset(0% 0% 0% 0%)"},{clipPath:"inset(0% 100% 0% 0%)"});export{i as Fade,o as Scale,a as Wipe};
1
+ import{C as t}from"./clip-a50f113a.js";export{M as Move,P as Pop}from"./pop-60cc89e0.js";import"./utils-1031ecb2.js";var i=new t({opacity:1,duration:.65},{opacity:0}),o=new t({scale:1},{transformOrigin:"left",scale:"0 1"}),a=new t({clipPath:"inset(0% 0% 0% 0%)"},{clipPath:"inset(0% 100% 0% 0%)"});export{t as Clip,i as Fade,o as Scale,a as Wipe};
2
2
  //# sourceMappingURL=animations.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{A as r}from"./animatable-f37b703c.js";import{_ as i,a as o}from"./clip-a50f113a.js";import{jsx as n,Fragment as t}from"react/jsx-runtime";import{forwardRef as a,Children as e,isValidElement as m,cloneElement as s}from"react";import{M as p,P as c}from"./pop-60cc89e0.js";import"./utils-1031ecb2.js";var l=a((function(a,l){var f=a.children,u=a.animations,d=void 0===u?[p,c]:u,v=a.levels,h=void 0===v?2:v,j=i(a,["children","animations","levels"]);return n(t,{children:function i(t,a){void 0===a&&(a=h);for(var p,c=h-a;!(p=d[c])&&c>=0;)c--;return a<1||e.count(t)<1?t:n(r,o({},j,{ref:l,animate:p},{children:e.map(t,(function(r){return m(r)?s(r,{},i(r.props.children,a-1)):r}))}))}(f)})}));export{r as Animatable,l as Animate};
1
+ import{A as r}from"./animatable-abd618ff.js";import{_ as i,a as o}from"./clip-a50f113a.js";import{jsx as n,Fragment as t}from"react/jsx-runtime";import{forwardRef as a,Children as e,isValidElement as m,cloneElement as s}from"react";import{M as p,P as c}from"./pop-60cc89e0.js";import"./utils-1031ecb2.js";var l=a((function(a,l){var f=a.children,u=a.animations,d=void 0===u?[p,c]:u,v=a.levels,h=void 0===v?2:v,j=i(a,["children","animations","levels"]);return n(t,{children:function i(t,a){void 0===a&&(a=h);for(var p,c=h-a;!(p=d[c])&&c>=0;)c--;return a<1||e.count(t)<1?t:n(r,o({},j,{ref:l,animate:p},{children:e.map(t,(function(r){return m(r)?s(r,{},i(r.props.children,a-1)):r}))}))}(f)})}));export{r as Animatable,l as Animate};
2
2
  //# sourceMappingURL=index.js.map
package/dist/layout.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as n,Fragment as r}from"react/jsx-runtime";import{useRef as t,useCallback as i,Children as e,isValidElement as o,useState as u,useEffect as c,useLayoutEffect as a,cloneElement as f,useId as d}from"react";import{A as l}from"./animatable-f37b703c.js";import{I as m}from"./utils-1031ecb2.js";import{a as p}from"./clip-a50f113a.js";function s(d){var p=d.children,s=d.adaptive,v=void 0===s||s,y=d.transition,h=void 0===y?{}:y,w=t(new m),j=0,k=function(n){return e.map(n,(function(n){if(!o(n)||n.type!==l)return n;var r=j++,t=n.props.order>1?{}:{id:n.key,ref:function(n){n?w.current.add(r,n):w.current.remove(r)}};return f(n,t,k(n.props.children))}))},x=i((function(n,r){return void 0===r&&(r={}),e.forEach(n,(function(n){o(n)&&n.type===l&&null!==n.key&&(r[n.key]=!0,x(n.props.children,r))})),r}),[]),U=u((function(){return k(p)})),b=U[0],g=U[1];return c((function(){for(var n=x(p),r=0,t=0,i=w.current.values;t<i.length;t++){var e=i[t];e.onUnmount&&!(e.id in n)&&(r=Math.max(r,e.play(e.onUnmount,{reverse:"string"!=typeof e.onUnmount,immediate:!0})))}setTimeout((function(){return g(k(p))}),1e3*r)}),[p]),("undefined"==typeof window?c:a)((function(){"undefined"!=typeof window&&v&&w.current.forEach((function(n){n.mounted&&n.timeline.transition(void 0,h)}))}),[b]),n(r,{children:b})}var v={};function y(i){var a=i.children,m=i.shown,s=i.id,y=i.transition,h=void 0===y?{}:y,w=t(null),j=d(),k=u(!1),x=k[0],U=k[1];return c((function(){if(w.current&&m){var n;for(var r in v[s])if(r!==j&&(n=v[s][r]))break;n&&(w.current.timeline.transition(n.timeline,h),U(!x))}}),[m]),c((function(){v[s][j]=m?w.current:null}),[x]),e.only(a)&&o(a)?n(l,p({id:s,ref:function(n){w.current=n,s in v||(v[s]={}),j in v[s]||(v[s][j]=m?n:null)}},{children:f(a,{style:p(p({},a.props.style),{opacity:m?1:0})})})):n(r,{children:a})}export{s as LayoutGroup,y as Morph};
1
+ import{jsx as n,Fragment as r}from"react/jsx-runtime";import{useRef as t,useCallback as i,Children as e,isValidElement as o,useState as u,useEffect as c,useLayoutEffect as a,cloneElement as f,useId as d}from"react";import{A as l}from"./animatable-abd618ff.js";import{I as m}from"./utils-1031ecb2.js";import{a as p}from"./clip-a50f113a.js";function s(d){var p=d.children,s=d.adaptive,v=void 0===s||s,y=d.transition,h=void 0===y?{}:y,w=t(new m),j=0,k=function(n){return e.map(n,(function(n){if(!o(n)||n.type!==l)return n;var r=j++,t=n.props.order>1?{}:{id:n.key,ref:function(n){n?w.current.add(r,n):w.current.remove(r)}};return f(n,t,k(n.props.children))}))},x=i((function(n,r){return void 0===r&&(r={}),e.forEach(n,(function(n){o(n)&&n.type===l&&null!==n.key&&(r[n.key]=!0,x(n.props.children,r))})),r}),[]),U=u((function(){return k(p)})),b=U[0],g=U[1];return c((function(){for(var n=x(p),r=0,t=0,i=w.current.values;t<i.length;t++){var e=i[t];e.onUnmount&&!(e.id in n)&&(r=Math.max(r,e.play(e.onUnmount,{reverse:"string"!=typeof e.onUnmount,immediate:!0})))}setTimeout((function(){return g(k(p))}),1e3*r)}),[p]),("undefined"==typeof window?c:a)((function(){"undefined"!=typeof window&&v&&w.current.forEach((function(n){n.mounted&&n.timeline.transition(void 0,h)}))}),[b]),n(r,{children:b})}var v={};function y(i){var a=i.children,m=i.shown,s=i.id,y=i.transition,h=void 0===y?{}:y,w=t(null),j=d(),k=u(!1),x=k[0],U=k[1];return c((function(){if(w.current&&m){var n;for(var r in v[s])if(r!==j&&(n=v[s][r]))break;n&&(w.current.timeline.transition(n.timeline,h),U(!x))}}),[m]),c((function(){v[s][j]=m?w.current:null}),[x]),e.only(a)&&o(a)?n(l,p({id:s,ref:function(n){w.current=n,s in v||(v[s]={}),j in v[s]||(v[s][j]=m?n:null)}},{children:f(a,{style:p(p({},a.props.style),{opacity:m?1:0})})})):n(r,{children:a})}export{s as LayoutGroup,y as Morph};
2
2
  //# sourceMappingURL=layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sources":["../src/layout-group.tsx","../src/morph.tsx"],"sourcesContent":[null,null],"names":["LayoutGroup","_a","children","_b","adaptive","_c","transition","animatables","useRef","IndexedList","animatableIndex","render","Children","map","child","isValidElement","type","Animatable","i","props","order","id","key","ref","el","current","add","remove","cloneElement","snapshot","useCallback","forEach","_d","useState","state","setState","useEffect","mounted","unmounting","_i","values","length","entry","onUnmount","Math","max","play","reverse","immediate","setTimeout","window","useLayoutEffect","timeline","undefined","_jsx","_Fragment","Morphs","Morph","shown","uuid","useId","updated","setUpdated","prev","only","__assign","style","opacity"],"mappings":"mVAOwB,SAAAA,EAAYC,GAAE,IAAAC,EAAQD,EAAAC,SAAEC,EAAeF,EAAAG,SAAfA,OAAW,IAAAD,GAAIA,EAAEE,EAAeJ,EAAAK,WAAfA,OAAU,IAAAD,EAAG,GAAEA,EACtEE,EAAcC,EAAoC,IAAIC,GAExDC,EAAkB,EAChBC,EAAS,SAACT,GACZ,OAAOU,EAASC,IAAIX,GAAU,SAAAY,GAC1B,IAAKC,EAAeD,IAAUA,EAAME,OAASC,EAAY,OAAOH,EAEhE,IAAMI,EAAIR,IACJS,EAAQL,EAAMK,MAAMC,MAAQ,EAAI,GAAK,CACvCC,GAAIP,EAAMQ,IACVC,IAAK,SAACC,GACFA,EAAKjB,EAAYkB,QAAQC,IAAIR,EAAGM,GAAMjB,EAAYkB,QAAQE,OAAOT,KAGzE,OAAOU,EAAad,EAAOK,EAAOR,EAAOG,EAAMK,MAAMjB,eAIvD2B,EAAWC,GAAY,SAAC5B,EAA2BW,GASrD,YATqD,IAAAA,IAAAA,EAAoC,IACzFD,EAASmB,QAAQ7B,GAAU,SAAAY,GAClBC,EAAeD,IAAUA,EAAME,OAASC,GAA4B,OAAdH,EAAMQ,MAEjET,EAAIC,EAAMQ,MAAO,EAEjBO,EAASf,EAAMK,MAAMjB,SAAUW,OAG5BA,IACR,IAEGmB,EAAoBC,GAAS,WAAM,OAAAtB,EAAOT,MAAzCgC,OAAOC,OA4Bd,OA1BAC,GAAU,WAIN,IAHA,IAAMC,EAAUR,EAAS3B,GACrBoC,EAAa,EAE6BC,EAAA,EAA1BtC,EAAAM,EAAYkB,QAAQe,OAApBD,EAAAtC,EAAAwC,OAAAF,IAA4B,CAA3C,IAAMG,EAAKzC,EAAAsC,GACR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OnC,KAAMmC,EAAOnC,GAAIsC,GAAQD,EAAQlC,EAAK,QAE1D,CAAAtB,SAAA0B,EAAa1B,EAAU,CAAEgE,MAAKD,EAAAA,EAAA,GAAO/D,EAASiB,MAAM+C,OAAK,CAAEC,QAAST,EAAQ,EAAI,SAPnBJ,EAAAC,EAAA,CAAArD,SAAGA"}
1
+ {"version":3,"file":"layout.js","sources":["../src/layout/layout-group.tsx","../src/layout/morph.tsx"],"sourcesContent":[null,null],"names":["LayoutGroup","_a","children","_b","adaptive","_c","transition","animatables","useRef","IndexedList","animatableIndex","render","Children","map","child","isValidElement","type","Animatable","i","props","order","id","key","ref","el","current","add","remove","cloneElement","snapshot","useCallback","forEach","_d","useState","state","setState","useEffect","mounted","unmounting","_i","values","length","entry","onUnmount","Math","max","play","reverse","immediate","setTimeout","window","useLayoutEffect","timeline","undefined","_jsx","_Fragment","Morphs","Morph","shown","uuid","useId","updated","setUpdated","prev","only","__assign","style","opacity"],"mappings":"mVAOwB,SAAAA,EAAYC,GAAE,IAAAC,EAAQD,EAAAC,SAAEC,EAAeF,EAAAG,SAAfA,OAAW,IAAAD,GAAIA,EAAEE,EAAeJ,EAAAK,WAAfA,OAAU,IAAAD,EAAG,GAAEA,EACtEE,EAAcC,EAAoC,IAAIC,GAExDC,EAAkB,EAChBC,EAAS,SAACT,GACZ,OAAOU,EAASC,IAAIX,GAAU,SAAAY,GAC1B,IAAKC,EAAeD,IAAUA,EAAME,OAASC,EAAY,OAAOH,EAEhE,IAAMI,EAAIR,IACJS,EAAQL,EAAMK,MAAMC,MAAQ,EAAI,GAAK,CACvCC,GAAIP,EAAMQ,IACVC,IAAK,SAACC,GACFA,EAAKjB,EAAYkB,QAAQC,IAAIR,EAAGM,GAAMjB,EAAYkB,QAAQE,OAAOT,KAGzE,OAAOU,EAAad,EAAOK,EAAOR,EAAOG,EAAMK,MAAMjB,eAIvD2B,EAAWC,GAAY,SAAC5B,EAA2BW,GASrD,YATqD,IAAAA,IAAAA,EAAoC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AOkC,EAAOnC,GACrB,GAAIC,IAAQqC,IAERI,EAAOP,EAAOnC,GAAIC,IAAM,MAG3ByC,IAELxC,EAAIE,QAAQ2B,SAAS9C,WAAWyD,EAAKX,SAAU9C,GAE/CwD,GAAYD,OACb,CAACH,IAEJtB,GAAU,WACNoB,EAAOnC,GAAIsC,GAAQD,EAAQnC,EAAIE,QAAU,OAC1C,CAACoC,IAECjD,EAASoD,KAAK9D,IAAca,EAAeb,GAEzCoD,EAACrC,EAAUgD,EAAA,CAAC5C,GAAIA,EAAIE,IAAK,SAAAC,GAC5BD,EAAIE,QAAUD,EACRH,KAAMmC,IAASA,EAAOnC,GAAM,IAC5BsC,KAAQH,EAAOnC,KAAMmC,EAAOnC,GAAIsC,GAAQD,EAAQlC,EAAK,QAE1D,CAAAtB,SAAA0B,EAAa1B,EAAU,CAAEgE,MAAKD,EAAAA,EAAA,GAAO/D,EAASiB,MAAM+C,OAAK,CAAEC,QAAST,EAAQ,EAAI,SAPnBJ,EAAAC,EAAA,CAAArD,SAAGA"}
@@ -3,4 +3,5 @@ import Move from "./animations/move";
3
3
  import Pop from "./animations/pop";
4
4
  import Scale from "./animations/scale";
5
5
  import Wipe from "./animations/wipe";
6
- export { Fade, Move, Pop, Scale, Wipe };
6
+ import Clip from "./core/clip";
7
+ export { Fade, Move, Pop, Scale, Wipe, Clip };
@@ -8,10 +8,11 @@ export default class Track {
8
8
  active: Action[];
9
9
  queue: Action[];
10
10
  onupdate: (() => void) | null;
11
+ onremove: (() => void) | null;
11
12
  cache: StyleCache;
12
13
  scaleDelta: [number, number];
13
14
  constructor(element: HTMLElement, deform: boolean);
14
- push(action: Action): Action;
15
+ push(action: Action): void | Action;
15
16
  next(): void;
16
17
  clear(): void;
17
18
  pause(): void;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { Easing } from "./core/clip";
2
+ import type { Easing } from "../core/clip";
3
3
  export default function LayoutGroup({ children, adaptive, transition }: {
4
4
  children: React.ReactNode;
5
5
  adaptive?: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Easing } from "./core/clip";
2
+ import { Easing } from "../core/clip";
3
3
  export default function Morph({ children, shown, id, transition }: {
4
4
  children: React.ReactNode;
5
5
  shown: boolean;
@@ -1,3 +1,3 @@
1
- import LayoutGroup from "./layout-group";
2
- import Morph from "./morph";
1
+ import LayoutGroup from "./layout/layout-group";
2
+ import Morph from "./layout/morph";
3
3
  export { LayoutGroup, Morph };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinityfx/lively",
3
- "version": "3.0.0-beta.6",
3
+ "version": "3.0.0",
4
4
  "type": "module",
5
5
  "description": "Feature complete, lightweight react animation library.",
6
6
  "main": "dist/cjs/index.js",
@@ -1,2 +0,0 @@
1
- import{C as t,_ as e,a as i}from"./clip-a50f113a.js";import{jsx as r,Fragment as a}from"react/jsx-runtime";import{forwardRef as n,useRef as o,useCallback as s,useImperativeHandle as c,useEffect as u,Children as h,isValidElement as d,cloneElement as p}from"react";import{l,I as f,m}from"./utils-1031ecb2.js";var v=function(){function e(t){this.element=t,this.computed=getComputedStyle(t),this.data=this.read()}return e.prototype.read=function(){var t=this.element.getBoundingClientRect(),e=t.x,i=t.y,r=t.width,a=t.height,n=this.computed,o=n.borderRadius,s=n.opacity,c=n.backgroundColor,u=n.color,h=n.rotate;return{x:e-window.scrollX,y:i+window.scrollY,width:r,height:a,borderRadius:o,opacity:s,backgroundColor:c,color:u,rotate:h}},e.prototype.update=function(){this.data=this.read()},e.prototype.difference=function(e,i){void 0===e&&(e=this.data);for(var r=i.duration,a=i.easing,n=this.read(),o={duration:r,easing:a},s=0,c=["borderRadius","backgroundColor","color","rotate","opacity"];s<c.length;s++){var u=c[s];o[u]=[e[u],n[u]]}return[new t({translate:["".concat(e.x-n.x,"px ").concat(e.y-n.y,"px"),"0px 0px"],scale:["".concat(0===n.width?1:e.width/n.width," ").concat(0===n.height?1:e.height/n.height),"1 1"],composite:!0,duration:r,easing:a}),new t(o)]},e}(),g=function(){function t(t,e){this.playing=0,this.active=[],this.queue=[],this.onupdate=null,this.scaleDelta=[1,1],this.element=t,this.deform=e,this.cache=new v(t)}return t.prototype.push=function(t){return t.onfinish=this.next.bind(this),this.playing&&!t.composited?(this.queue.push(t),t.animation.pause()):(this.active.push(t),this.playing++),t},t.prototype.next=function(){var t;null===(t=this.onupdate)||void 0===t||t.call(this),this.cache.update(),--this.playing>0||(this.active=this.queue.length?this.queue.splice(0,1):[],this.playing=this.active.length,this.play())},t.prototype.clear=function(){this.active=this.active.filter((function(t){return t.animation.cancel(),t.composited})),this.queue=[],this.playing=this.active.length},t.prototype.pause=function(){for(var t=0,e=this.active;t<e.length;t++){e[t].animation.pause()}},t.prototype.play=function(){for(var t=0,e=this.active;t<e.length;t++){e[t].animation.play()}},t.prototype.step=function(t){for(var e=0,i=this.active;e<i.length;e++){i[e].step(t)}},t.prototype.transition=function(t,e){var i=this,r=this.cache.difference(null==t?void 0:t.cache.data,e);this.cache.update(),null==t||t.cache.update(),null==t||t.clear(),r.forEach((function(t){return t.play(i,{})}))},t.prototype.apply=function(t,e){this.set(t,e),this.correct()},t.prototype.set=function(t,e){"borderRadius"===t&&(e=this.computeBorderRadius(e)),this.element.style[t]="strokeDashoffset"===t?l(e):e},t.prototype.decomposeScale=function(){var t=this.cache.computed.scale.split(" "),e=t[0],i=t[1],r=Math.max(parseFloat(e)||1,1e-4);/%$/.test(e)&&(r/=100);var a=i?Math.max(parseFloat(i),1e-4):r;return/%$/.test(i)&&(a/=100),[r,a]},t.prototype.computeBorderRadius=function(t){if(void 0===t&&(t=this.cache.computed.borderRadius),this.deform)return t;var e=t.match(/([\d\.]+)(?:.*\/.*?([\d\.]+))?/)||["","0","0"];e[0];var i=e[1],r=e[2],a=parseFloat(i)*this.scaleDelta[0],n=r?parseFloat(r)*this.scaleDelta[1]:a;return this.scaleDelta=this.decomposeScale(),"".concat(a/this.scaleDelta[0],"px / ").concat(n/this.scaleDelta[1],"px")},t.prototype.correct=function(){if(!this.deform){this.element.style.borderRadius=this.computeBorderRadius();for(var t=this.decomposeScale(),e=t[0],i=t[1],r=0;r<this.element.children.length;r++){this.element.children[r].style.transform="scale(".concat(1/e,", ").concat(1/i,")")}}},t}(),y=function(){function e(t){var e=t.stagger,i=void 0===e?.1:e,r=t.staggerLimit,a=void 0===r?10:r,n=t.deform,o=void 0===n||n;this.index=0,this.paused=!1,this.tracks=new f,this.frame=0,this.stagger=i,this.staggerLimit=a-1,this.deform=o}return e.prototype.step=function(){cancelAnimationFrame(this.frame),this.tracks.forEach((function(t,e){return t.step(e)})),this.frame=requestAnimationFrame(this.step.bind(this))},e.prototype.time=function(t){return t.duration+this.stagger*Math.min(this.staggerLimit,this.tracks.size-1)},e.prototype.port=function(e,i,r){var a;if(!this.paused)for(var n=0;n<this.tracks.size;n++){var o=i(n);r?new t((a={duration:r,easing:"ease"},a[e]=o,a)).play(this.tracks.values[n],{}):this.tracks.values[n].apply(e,o)}},e.prototype.transition=function(t,e){for(var i=void 0===e?{}:e,r=i.duration,a=void 0===r?.5:r,n=i.easing,o=void 0===n?"ease":n,s=0;s<this.tracks.size;s++)this.tracks.values[s].transition(null==t?void 0:t.tracks.values[s],{duration:a,easing:o})},e.prototype.insert=function(t){t&&("TRACK_INDEX"in t||(t.TRACK_INDEX=this.index++),this.tracks.has(t.TRACK_INDEX)||this.tracks.add(t.TRACK_INDEX,new g(t,this.deform)))},e.prototype.add=function(t,e){for(var i=e.immediate,r=void 0!==i&&i,a=e.composite,n=e.reverse,o=e.delay,s=void 0===o?0:o,c=0;c<this.tracks.size;c++)r&&this.tracks.values[c].clear(),t.play(this.tracks.values[c],{delay:s+Math.min(c,this.staggerLimit)*(this.stagger<0?t.duration/this.tracks.size:this.stagger),composite:a,reverse:n})},e.prototype.pause=function(){for(var t=0,e=this.tracks.values;t<e.length;t++){e[t].pause()}this.paused=!0},e.prototype.play=function(){for(var t=0,e=this.tracks.values;t<e.length;t++){e[t].play()}this.paused=!1},e}(),k=n((function(n,l){var f=n.children,v=n.animations,g=n.playbook,x=void 0===g?[]:g,b=n.animate,w=n.initial,R=n.stagger,D=n.staggerLimit,C=n.deform,_=n.order,A=n.onMount,L=void 0!==A&&A,z=n.onUnmount,E=void 0!==z&&z,F=n.noCascade,M=void 0!==F&&F,q=n.text,X=void 0!==q&&q,I=n.disabled,N=void 0!==I&&I,B=n.paused,K=void 0!==B&&B,S=n.id,T=void 0===S?"":S,j=void 0!==_?_:1,U=o({}),V=o(!1),$=o(new y({stagger:X?-1:R,staggerLimit:X?Number.MAX_VALUE:D,deform:C})),W=o([]),Y=o([]);if(!U.current.__initialized)for(var G in U.current.__initialized=!0,U.current.animate=t.from(b,w,$.current),v)U.current[G]=t.from(v[G],w);var H=s((function(t,e,i){if(void 0===e&&(e={}),void 0===i&&(i=1),!t||N||j>1&&i<2)return 0;"string"!=typeof t&&(t="animate");var r=U.current[t];if(!r)return 0;for(var a=0,n=e.delay||0,o=$.current.time(r),s=0,c=Y.current;s<c.length;s++){var u=c[s];if(u){var h=u.play(t,m({delay:n+o},e),i+1);a=Math.max(a,h)}}var d=(e.reverse?a:n)*(j/i);return $.current.add(r,m({delay:d},e)),o+d}),[N,j]);return c(l,(function(){return{play:H,timeline:$.current,mounted:V.current,onUnmount:E,id:T}}),[E]),u((function(){(K||N)&&$.current.pause(),K||N||$.current.play()}),[K,N]),u((function(){for(var t=0;t<x.length;t++){var i=x[t],r=i.name,a=i.trigger,n=e(i,["name","trigger"]);a!==W.current[t]&&a&&H(r,n),W.current[t]=a}}),[x]),u((function(){$.current.step(),V.current=!0,document.fonts.ready.then((function(){return H(L,{immediate:!0})}))}),[]),r(a,{children:function t(e,a,n){return void 0===a&&(a=!0),h.map(e,(function(e){var n=d(e),o=n&&e.type===k,s=n?e.props:{},c={};if(o){if(!M){var u=Y.current.length++;c.order=void 0!==s.order?s.order:(void 0!==_?_:1)+1,c.paused=K,c.ref=function(t){return Y.current[u]=t},c.id=T+u,m(c,s,{animate:b,initial:w,animations:v,stagger:R,staggerLimit:D,deform:C})}}else if(a){var h=n&&e.ref;c.pathLength=1,c.ref=function(t){$.current.insert(t),h&&"current"in h&&(h.current=t),h instanceof Function&&h(t)},c.style=m({backfaceVisibility:"hidden",strokeDasharray:1},w||U.current.animate.initial,s.style)}return n?p(e,c,t(s.children,!1)):a&&["string","number","boolean"].includes(typeof e)?X&&"string"==typeof e?e.split("").map((function(t,e){return r("span",i({ref:function(t){return $.current.insert(t)},style:{minWidth:" "===t?"0.35em":0}},{children:t}))})):r("div",i({},c,{children:e})):e}))}(f)})}));export{k as A};
2
- //# sourceMappingURL=animatable-f37b703c.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"animatable-f37b703c.js","sources":["../src/core/cache.ts","../src/core/track.ts","../src/core/timeline.ts","../src/animatable.tsx"],"sourcesContent":[null,null,null,null],"names":["StyleCache","element","this","computed","getComputedStyle","data","read","prototype","_a","getBoundingClientRect","x","y","width","height","_b","borderRadius","opacity","backgroundColor","color","rotate","window","scrollX","scrollY","update","difference","from","duration","easing","to","keyframes","_i","length","key","Clip","translate","concat","scale","composite","Track","deform","playing","active","queue","onupdate","scaleDelta","cache","push","action","onfinish","next","bind","composited","animation","pause","call","splice","play","clear","filter","cancel","step","index","transition","previous","options","_this","clips","forEach","clip","apply","prop","val","set","correct","computeBorderRadius","style","lengthToOffset","decomposeScale","split","xString","yString","Math","max","parseFloat","test","match","xr","yr","i","children","transform","Timeline","stagger","_c","staggerLimit","_d","paused","tracks","IndexedList","frame","cancelAnimationFrame","track","requestAnimationFrame","time","min","size","port","link","values","insert","TRACK_INDEX","has","add","immediate","reverse","delay","Animatable","forwardRef","ref","animations","playbook","animate","initial","order","onMount","onUnmount","_e","noCascade","_f","text","_g","disabled","_h","_j","id","cascadeOrder","undefined","clipMap","useRef","mounted","timeline","Number","MAX_VALUE","playbookState","nodes","current","__initialized","name_1","useCallback","layer","cascadeDelay","layerDelay","node","delay_1","merge","useImperativeHandle","useEffect","name_2","name","trigger","__rest","document","fonts","ready","then","_jsx","render","isDirectChild","isParent","Children","map","child","valid","isValidElement","isAnimatable","type","childProps","props","i_1","el","ref_1","pathLength","Function","backfaceVisibility","strokeDasharray","cloneElement","includes","char","__assign","minWidth"],"mappings":"mTAcA,IAAAA,EAAA,WAMI,SAAAA,EAAYC,GACRC,KAAKD,QAAUA,EACfC,KAAKC,SAAWC,iBAAiBH,GACjCC,KAAKG,KAAOH,KAAKI,OA6CzB,OA1CIN,EAAAO,UAAAD,KAAA,WACU,IAAAE,EAA0BN,KAAKD,QAAQQ,wBAArCC,MAAGC,MAAGC,UAAOC,WACfC,EAA4DZ,KAAKC,SAA/DY,iBAAcC,YAASC,oBAAiBC,UAAOC,WAEvD,MAAO,CACHT,EAAGA,EAAIU,OAAOC,QACdV,EAAGA,EAAIS,OAAOE,QACdV,MAAKA,EACLC,OAAMA,EACNE,aAAYA,EACZC,QAAOA,EACPC,gBAAeA,EACfC,MAAKA,EACLC,OAAMA,IAIdnB,EAAAO,UAAAgB,OAAA,WACIrB,KAAKG,KAAOH,KAAKI,QAGrBN,EAAAO,UAAAiB,WAAA,SAAWC,EAA6BjB,QAA7B,IAAAiB,IAAAA,EAAkBvB,KAAKG,MAI9B,QAJsCqB,EAAQlB,EAAAkB,SAAEC,EAAMnB,EAAAmB,OAChDC,EAAK1B,KAAKI,OAEVuB,EAAiB,CAAEH,WAAUC,OAAMA,OACvBb,EAAA,CAAC,eAAgB,kBAAmB,QAAS,SAAU,WAAvDgB,EAAiEhB,EAAAiB,OAAjED,IAAmE,CAAhF,IAAME,EAAGlB,EAAAgB,GACVD,EAAUG,GAAO,CAACP,EAAKO,GAAyBJ,EAAGI,IAGvD,MAAO,CACH,IAAIC,EAAK,CACLC,UAAW,CAAC,GAAGC,OAAAV,EAAKf,EAAIkB,EAAGlB,gBAAOe,EAAKd,EAAIiB,EAAGjB,EAAC,MAAM,WACrDyB,MAAO,CAAC,GAAGD,OAAa,IAAbP,EAA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