@infinityfx/lively 5.0.0-alpha.0 → 5.0.0-alpha.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.
- package/dist/animate.js +1 -1
- package/dist/core/animation-link.js.map +1 -1
- package/dist/core/animator.js +1 -1
- package/dist/core/animator.js.map +1 -1
- package/dist/core/clip.js +1 -1
- package/dist/core/clip.js.map +1 -1
- package/dist/core/state.js +1 -1
- package/dist/core/state.js.map +1 -1
- package/dist/core/track.js +1 -1
- package/dist/core/track.js.map +1 -1
- package/dist/core/utils.js +1 -1
- package/dist/core/utils.js.map +1 -1
- package/dist/hooks/use-tap.js +1 -1
- package/dist/layout-group.js +1 -1
- package/dist/presets.js +2 -0
- package/dist/presets.js.map +1 -0
- package/dist/types/animate.d.ts +6 -6
- package/dist/types/core/animation-link.d.ts +2 -1
- package/dist/types/core/animator.d.ts +19 -10
- package/dist/types/core/clip.d.ts +2 -2
- package/dist/types/core/state.d.ts +2 -3
- package/dist/types/core/track.d.ts +8 -5
- package/dist/types/core/utils.d.ts +46 -36
- package/dist/types/layout-group.d.ts +1 -1
- package/dist/types/presets.d.ts +3 -0
- package/package.json +6 -6
- package/dist/animations.js +0 -2
- package/dist/animations.js.map +0 -1
- package/dist/types/animations.d.ts +0 -3
- /package/dist/{animations → presets}/text-animation.js +0 -0
- /package/dist/{animations → presets}/text-animation.js.map +0 -0
- /package/dist/{animations → presets}/view-animation.js +0 -0
- /package/dist/{animations → presets}/view-animation.js.map +0 -0
- /package/dist/types/{animations → presets}/text-animation.d.ts +0 -0
- /package/dist/types/{animations → presets}/view-animation.d.ts +0 -0
package/dist/animate.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{createContext as
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{createContext as n,useId as e,use as i,useRef as r,useState as o,useImperativeHandle as s,useLayoutEffect as a,useEffect as c,Children as m,isValidElement as d,cloneElement as l}from"react";import u from"./core/animator.js";import f from"./core/clip.js";import{serializeTriggers as p,getLifeCycleAnimations as g,forEachTrigger as y,mergeStyles as h,getInitialStyleFromLinks as j,mergeRefs as k}from"./core/utils.js";import{LayoutGroupContext as w}from"./layout-group.js";import{registerToLayoutGroup as v,getMorphTarget as L,deleteMorphTarget as E,unregisterFromLayoutGroup as C}from"./core/state.js";const b=n("");function x({ref:n,children:x,inherit:z=!1,initial:A={},animate:D={},triggers:I={animate:["mount"]},stagger:S=.07,staggerLimit:T=10,deformCorrection:U,transition:_,morph:M,clips:O,paused:P=!1,onAnimationEnd:q}){const B=I._livelyId??"_la"+e(),F=i(b),G=i(w),H=r(0),J=r(null),K=r(p(I)),N=r(null);if(!N.current){const t={animate:D instanceof f?D:new f(D,A)};for(const n in O)t[n]=O[n]instanceof f?O[n]:new f(O[n],A);const n=N.current=new u({id:B,clips:t,lifeCycleAnimations:g(I),deformCorrection:U,transition:_,stagger:S,staggerLimit:T});n.register(F,z,M),n.addLinks(D)}const{current:Q}=N,[R,V]=o(v(G,Q.id));return s(n,(()=>Q),[]),a((()=>{if(H.current=Date.now(),Q.register(F,z,M),Q.addLinks(D),M){const t=J.current||L(M,Q.id);J.current=t,t&&(Q.isMounting=!0,Q.transition(t),E(M,t.id),Q.state="mounted",V(!0),t.delayUnmountUntil=0,t.unmount())}v(G,Q.id),R&&(Q.state="mounted"),document.fonts.ready.finally((()=>Q.mount()));const t=()=>Q.forEachTrack((t=>t.snapshot()));return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),Q.dispose(M),C(G,Q.id)}}),[]),c((()=>{y(I,((t,n,e)=>{const i=K.current[t];n.forEach(((n,r)=>{i[r]!==n&&!1!==n&&Q.play(t,Object.assign({tag:t},e[r])),i[r]=n}))}))}),[I]),c((()=>{if(!(D instanceof f||"mounted"!==Q.state))for(const t in D){const n=D[t];t in Q.links&&"object"!=typeof n&&Q.links[t].set(n,{duration:D.duration,easing:D.easing,composite:D.composite})}}),[D]),c((()=>(q&&Q.on("animationend",q),()=>{q&&Q.off("animationend",q)})),[q]),c((()=>Q.setPlayState(P)),[P]),t(b,{value:Q.id,children:m.map(x,((t,n)=>{if(!d(t))return t;let{ref:e,style:i}=t.props;return i=h(i,Q.mergeInitialStyles(A,R?"mounted":"unmounted"),j(Q.links,n)),l(t,{ref:k(e||null,(t=>Q.addTrack(t,n))),style:i,pathLength:"strokeDasharray"in i?1:void 0,"data-lively":Q.id})}))})}export{b as AnimateContext,x as default};
|
|
3
3
|
//# sourceMappingURL=animate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation-link.js","sources":["../../src/core/animation-link.ts"],"sourcesContent":[null],"names":["AnimationLink","constructor","initial","getWithIndex","this","options","duration","eventListeners","value","set","Object","assign","dispatch","get","index","on","event","callback","Set","add","delete","forEach"],"mappings":"
|
|
1
|
+
{"version":3,"file":"animation-link.js","sources":["../../src/core/animation-link.ts"],"sourcesContent":[null],"names":["AnimationLink","constructor","initial","getWithIndex","this","options","duration","eventListeners","value","set","Object","assign","dispatch","get","index","on","event","callback","Set","add","delete","forEach"],"mappings":"AAUc,MAAOA,EAWjB,WAAAC,CAAYC,EAAYC,GARxBC,KAAAC,QAA6B,CACzBC,SAAU,IAGdF,KAAAG,eAEI,CAAA,EAGAH,KAAKI,MAAQN,EACbE,KAAKD,aAAeA,QAAuBC,KAAKI,MACpD,CAEA,GAAAC,CAAID,EAAUH,EAA6B,IACvCD,KAAKI,MAAQA,EACbE,OAAOC,OAAOP,KAAKC,QAASA,GAE5BD,KAAKQ,SAAS,SAClB,CAEA,GAAAC,CAAIC,EAAQ,GACR,OAAOV,KAAKD,aAAaW,EAC7B,CAEA,EAAAC,CAAGC,EAA2BC,GAK1B,OAJMD,KAASZ,KAAKG,iBAAiBH,KAAKG,eAAeS,GAAS,IAAIE,KAEtEd,KAAKG,eAAeS,GAAQG,IAAIF,GAEzB,KACHb,KAAKG,eAAeS,IAAQI,OAAOH,EAAS,CAEpD,CAEA,QAAAL,CAASI,GACLZ,KAAKG,eAAeS,IAAQK,SAAQJ,GAAYA,EAASb,KAAKI,QAClE"}
|
package/dist/core/animator.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./clip.js";import{
|
|
1
|
+
import t from"./clip.js";import{registerAnimator as i,registerAsMorph as s,getParentAnimator as e,unregisterAnimator as n,deleteMorphTarget as a}from"./state.js";import r from"./track.js";import{extractAnimationLinks as h}from"./utils.js";class o{constructor({id:t,clips:i,lifeCycleAnimations:s,deformCorrection:e,transition:n,stagger:a,staggerLimit:r}){this.parent=null,this.dependents=new Set,this.inherit=[],this.links={},this.onDisposeLinks=null,this.tracks=new Set,this.trackList=[],this.initialStyles={},this.eventListeners={},this.state="unmounted",this.delayUnmountUntil=0,this.isMounting=!0,this.paused=!1,this.timeout=0,this.frame=0;const{cache:h,...o}=n||{};this.id=t,this.clips=i,this.lifeCycleAnimations=s,this.ignoreScaleDeformation=void 0!==e&&!e,this.defaultTransitionOptions=o,this.cache=h||["x","y","sx","sy","rotate","borderRadius"],this.align="object"==typeof e?e:{x:"left",y:"top"},this.stagger=a,this.staggerLimit=r,void 0===e&&this.inherit.push("ignoreScaleDeformation"),void 0===e&&this.inherit.push("align"),n||this.inherit.push("defaultTransitionOptions"),h||this.inherit.push("cache")}register(t,n,a){if(clearTimeout(this.timeout),i(this.id,this),a&&s(a,this.id),t&&!1!==n&&(this.parent=e(t,"boolean"==typeof n?0:n)),this.parent){this.parent.dependents.add(this);for(const t of this.inherit)this[t]=this.parent[t]}}mount(){"unmounted"===this.state&&this.trigger("mount"),this.state="mounted",cancelAnimationFrame(this.frame),this.tick()}dispose(t){this.onDisposeLinks?.(),cancelAnimationFrame(this.frame),this.trackList.forEach((t=>t.cache=t.snapshot())),this.state="unmounted",this.stop(),this.timeout=setTimeout((()=>{n(this.id),t&&a(t,this.id),this.parent&&this.parent.dependents.delete(this)}),1)}on(t,i){t in this.eventListeners||(this.eventListeners[t]=new Set),this.eventListeners[t].add(i)}off(t,i){this.eventListeners[t]?.delete(i)}dispatch(t,...i){this.eventListeners[t]?.forEach((t=>t(...i)))}tick(){this.paused||this.trackList.forEach((t=>{this.ignoreScaleDeformation||t.correct()})),this.frame=requestAnimationFrame(this.tick.bind(this))}addLinks(i){const[s,e]=h(i,((i,s)=>{this.forEachTrack(((e,n)=>{const a=new t({...s.options,composite:"override",[i]:s.get(n)});e.push(a)}))}));this.links=s,this.onDisposeLinks=e}addTrack(t,i){if(!(t instanceof HTMLElement||t instanceof SVGElement)||this.tracks.has(t))return;const s=new r(t,this.cache,this.align),e=this.lifeCycleAnimations.mount;this.tracks.add(t),this.trackList.splice(i,0,s),"mounted"===this.state&&e&&e.forEach((([t,i])=>s.push(this.clips[t],i)))}mergeInitialStyles(t,i){if(i in this.initialStyles)return this.initialStyles[i];const s="mounted"===i,e=(this.lifeCycleAnimations.mount||[]).map((([t,i])=>[this.clips[t],(i.reverse||!1)!==s])).filter((([t])=>!t.isEmpty));if(e.length){const i={backfaceVisibility:"hidden",willChange:"transform"};for(const[t,s]of e){const e=s!==t.reverse?t.keyframes.length-1:0,{offset:n,...a}=t.keyframes[e];Object.assign(i,a)}t=Object.assign(i,t)}else this.parent&&(t=this.parent.mergeInitialStyles(t,i));return this.initialStyles[i]=t}pretime(t,i){if(t.isEmpty)return 0;const{duration:s,delay:e,iterations:n}=t.getConfig(i);return(s*n+e)/1e3+Math.max(Math.min(this.tracks.size,this.staggerLimit)-1,0)*this.stagger}trigger(t,i={}){let s=this.lifeCycleAnimations[t],e=0;return s&&s.forEach((([t,s])=>e=Math.max(this.play(t,Object.assign(s,i)),e))),e}play(t,{cascade:i="forward",delay:s=0,tag:e,...n}={}){if(this.paused||this.parent&&!e)return 0;let a="string"==typeof t?this.clips[t]:t;e&&e in this.clips&&(a=this.clips[e]),e||"string"!=typeof t||(e=t);const r=this.pretime(a,n),h=this.cascade(a,{...n,delay:"reverse"===i?s:r+s,tag:e});return this.push(a,{...n,delay:"reverse"===i?h+s:s,tag:e})}cascade(t,i){let s=0;return this.dependents.forEach((e=>{s=Math.max(s,e.play(t,i))})),s}forEachTrack(t){let i=0;for(;i<this.tracks.size;){const s=this.trackList[i];s.element.isConnected?t(s,i++):(this.tracks.delete(s.element),this.trackList.splice(i,1))}}push(t,{override:i,delay:s=0,tag:e,...n}){if(t.isEmpty)return 0;let a=0;return this.forEachTrack(((r,h)=>{i&&r.clear();const o=r.push(t,{...n,delay:s+Math.min(h,this.staggerLimit-1)*this.stagger},h===this.tracks.size-1?()=>this.dispatch("animationend",e):void 0);a=Math.max(a,o)})),a}transition(t,i=this.defaultTransitionOptions){!this.paused&&this.cache.length&&(this.trackList.forEach(((s,e)=>{const{cache:n}=t&&e<t.tracks.size?t.trackList[e]:{};s.transition(n,i)})),this.dispatch("transitionstart"))}setPlayState(t){this.trackList.forEach((i=>i.toggle(t))),this.paused=t,this.dependents.forEach((i=>i.setPlayState(t)))}stop(t){this.trackList.forEach((i=>i.clear(t)))}unmount(){this.trackList.forEach((t=>t.element.style.display="none"))}}export{o as default};
|
|
2
2
|
//# sourceMappingURL=animator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animator.js","sources":["../../src/core/animator.ts"],"sourcesContent":[null],"names":["Animator","constructor","id","clips","lifeCycleAnimations","
|
|
1
|
+
{"version":3,"file":"animator.js","sources":["../../src/core/animator.ts"],"sourcesContent":[null],"names":["Animator","constructor","id","clips","lifeCycleAnimations","deformCorrection","transition","stagger","staggerLimit","this","parent","dependents","Set","inherit","links","onDisposeLinks","tracks","trackList","initialStyles","eventListeners","state","delayUnmountUntil","isMounting","paused","timeout","frame","cache","options","ignoreScaleDeformation","undefined","defaultTransitionOptions","align","x","y","push","register","parentId","morph","clearTimeout","registerAnimator","registerAsMorph","getParentAnimator","add","key","mount","trigger","cancelAnimationFrame","tick","dispose","forEach","track","snapshot","stop","setTimeout","unregisterAnimator","deleteMorphTarget","delete","on","event","callback","off","dispatch","args","correct","requestAnimationFrame","bind","addLinks","animate","disposeLinks","extractAnimationLinks","link","forEachTrack","i","clip","Clip","composite","get","addTrack","element","index","HTMLElement","SVGElement","has","Track","animations","splice","name","mergeInitialStyles","styles","mode","reversed","map","reverse","filter","isEmpty","length","merged","backfaceVisibility","willChange","keyframes","offset","Object","assign","pretime","duration","delay","iterations","getConfig","Math","max","min","size","elapsed","opts","play","animation","cascade","tag","cascadeDelay","animator","isConnected","override","clear","added","from","setPlayState","toggle","unmount","style","display"],"mappings":"+OAmBc,MAAOA,EAsCjB,WAAAC,EAAYC,GAAEA,EAAEC,MAAEA,EAAKC,oBAAEA,EAAmBC,iBAAEA,EAAgBC,WAAEA,EAAUC,QAAEA,EAAOC,aAAEA,IAnCrFC,KAAAC,OAA+B,KAC/BD,KAAAE,WAAiC,IAAIC,IACrCH,KAAAI,QAAyF,GAOzFJ,KAAAK,MAEI,CAAA,EACJL,KAAAM,eAAsC,KACtCN,KAAAO,OAAuB,IAAIJ,IAC3BH,KAAAQ,UAAqB,GAOrBR,KAAAS,cAGI,CAAA,EACJT,KAAAU,eAEI,CAAA,EACJV,KAAAW,MAAgD,YAChDX,KAAAY,kBAAoB,EACpBZ,KAAAa,YAAa,EACbb,KAAAc,QAAS,EACTd,KAAAe,QAAU,EACVf,KAAAgB,MAAQ,EAiBJ,MAAMC,MAAEA,KAAUC,GAAYrB,GAAc,CAAA,EAE5CG,KAAKP,GAAKA,EACVO,KAAKN,MAAQA,EACbM,KAAKL,oBAAsBA,EAC3BK,KAAKmB,4BAA8CC,IAArBxB,IAA0CA,EACxEI,KAAKqB,yBAA2BH,EAChClB,KAAKiB,MAAQA,GAAS,CAAC,IAAK,IAAK,KAAM,KAAM,SAAU,gBACvDjB,KAAKsB,MAAoC,iBAArB1B,EAAgCA,EAAmB,CAAE2B,EAAG,OAAQC,EAAG,OACvFxB,KAAKF,QAAUA,EACfE,KAAKD,aAAeA,OAEKqB,IAArBxB,GAAgCI,KAAKI,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AAsBjG,EAA6BlB,KAAKqB,2BAC3DrB,KAAKc,QAAWd,KAAKiB,MAAMqE,SAE/BtF,KAAKQ,UAAUgC,SAAQ,CAACC,EAAOsB,KAC3B,MAAM9C,MAAEA,GAAUkG,GAAQpD,EAAIoD,EAAK5G,OAAO+F,KAAOa,EAAK3G,UAAUuD,GAAK,CAAA,EAErEtB,EAAM5C,WAAWoB,EAAOC,EAAQ,IAGpClB,KAAKoD,SAAS,mBAClB,CAEA,YAAAgE,CAAatG,GACTd,KAAKQ,UAAUgC,SAAQC,GAASA,EAAM4E,OAAOvG,KAC7Cd,KAAKc,OAASA,EAEdd,KAAKE,WAAWsC,SAAQsE,GAAYA,EAASM,aAAatG,IAC9D,CAEA,IAAA6B,CAAK+D,GACD1G,KAAKQ,UAAUgC,SAAQC,GAASA,EAAMwE,MAAMP,IAChD,CAEA,OAAAY,GACItH,KAAKQ,UAAUgC,SAAQC,GAASA,EAAM4B,QAAQkD,MAAMC,QAAU,QAClE"}
|
package/dist/core/clip.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{parseClipKeyframes as e}from"./utils.js";class t{constructor({duration:t=.5,delay:s=0,repeat:i=1,alternate:a=!1,reverse:r=!1,easing:
|
|
1
|
+
import{parseClipKeyframes as e}from"./utils.js";class t{constructor({duration:t=.5,delay:s=0,repeat:i=1,alternate:a=!1,reverse:r=!1,easing:o="ease",composite:n="none",...l},h={}){this.duration=t,this.delay=s,this.repeat=i,this.alternate=a,this.reverse=r,this.easing=o,this.composite=n,this.keyframes=e(l,h),this.isEmpty=!this.keyframes.length}getConfig({delay:e=0,repeat:t=this.repeat,alternate:s=this.alternate,reverse:i=this.reverse,composite:a=this.composite,commit:r=!0}){return{duration:1e3*this.duration,delay:1e3*(this.delay+e),iterations:t,direction:s?i?"alternate-reverse":"alternate":i?"reverse":"normal",easing:this.easing,composite:"combine"===a?"accumulate":"replace",fill:"both",blendmode:a,commit:r}}}export{t as default};
|
|
2
2
|
//# sourceMappingURL=clip.js.map
|
package/dist/core/clip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip.js","sources":["../../src/core/clip.ts"],"sourcesContent":[null],"names":["Clip","constructor","duration","delay","repeat","alternate","reverse","easing","composite","keyframes","initial","this","parseClipKeyframes","isEmpty","length","getConfig","commit","iterations","
|
|
1
|
+
{"version":3,"file":"clip.js","sources":["../../src/core/clip.ts"],"sourcesContent":[null],"names":["Clip","constructor","duration","delay","repeat","alternate","reverse","easing","composite","keyframes","initial","this","parseClipKeyframes","isEmpty","length","getConfig","commit","iterations","direction","fill","blendmode"],"mappings":"gDAoCc,MAAOA,EAYjB,WAAAC,EAAYC,SACRA,EAAW,GAAEC,MACbA,EAAQ,EAACC,OACTA,EAAS,EAACC,UACVA,GAAY,EAAKC,QACjBA,GAAU,EAAKC,OACfA,EAAS,OAAMC,UACfA,EAAY,UACTC,GACSC,EAAwB,IACpCC,KAAKT,SAAWA,EAChBS,KAAKR,MAAQA,EACbQ,KAAKP,OAASA,EACdO,KAAKN,UAAYA,EACjBM,KAAKL,QAAUA,EACfK,KAAKJ,OAASA,EACdI,KAAKH,UAAYA,EAEjBG,KAAKF,UAAYG,EAAmBH,EAAWC,GAC/CC,KAAKE,SAAWF,KAAKF,UAAUK,MACnC,CAEA,SAAAC,EAAUZ,MACNA,EAAQ,EAACC,OACTA,EAASO,KAAKP,OAAMC,UACpBA,EAAYM,KAAKN,UAASC,QAC1BA,EAAUK,KAAKL,QAAOE,UACtBA,EAAYG,KAAKH,UAASQ,OAC1BA,GAAS,IAGT,MAAO,CACHd,SAA0B,IAAhBS,KAAKT,SACfC,MAA8B,KAAtBQ,KAAKR,MAAQA,GACrBc,WAAYb,EACZc,UAAWb,EACNC,EAAU,oBAA+B,YACzCA,EAAU,UAAqB,SACpCC,OAAQI,KAAKJ,OACbC,UAAyB,YAAdA,EAA0B,aAAwB,UAC7DW,KAAM,OACNC,UAAWZ,EACXQ,SAER"}
|
package/dist/core/state.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t=new Map,n=new Map,e=new Map;function o(n,e){let o=t.get(n)||null;for(let t=0;t<e;t++){if(!o)return null;o=o.parent}return o}function u(n
|
|
1
|
+
const t=new Map,n=new Map,e=new Map;function o(n,e){let o=t.get(n)||null;for(let t=0;t<e;t++){if(!o)return null;o=o.parent}return o}function u(n,e){t.set(n,e)}function i(n){t.delete(n)}function r(t,e){const o=n.get(t)||{animators:new Set,skipInitialMount:e};return n.set(t,o),o}function c(t){n.delete(t)}function s(t,e){const o=n.get(t);return!!o&&(o.animators.add(e),o.skipInitialMount)}function f(t,e){const o=n.get(t);o&&o.animators.delete(e)}function a(n,e){n.forEach((n=>{const o=t.get(n);o&&e(o)}))}function l(t,n){const o=e.get(t)||new Set;o.add(n),e.set(t,o)}function d(n,o){const u=e.get(n);if(!u)return null;for(const n of u){const e=t.get(n);if(e&&e.id!==o&&"mounted"!==e.state)return e}return null}function g(t,n){const o=e.get(t);return o&&o.delete(n),0}export{g as deleteMorphTarget,a as forEachAnimator,d as getMorphTarget,o as getParentAnimator,u as registerAnimator,l as registerAsMorph,r as registerLayoutGroup,s as registerToLayoutGroup,i as unregisterAnimator,f as unregisterFromLayoutGroup,c as unregisterLayoutGroup};
|
|
2
2
|
//# sourceMappingURL=state.js.map
|
package/dist/core/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sources":["../../src/core/state.ts"],"sourcesContent":[null],"names":["registeredAnimators","Map","registeredLayoutGroups","morphGroups","getParentAnimator","id","stepsRemoved","parent","get","i","
|
|
1
|
+
{"version":3,"file":"state.js","sources":["../../src/core/state.ts"],"sourcesContent":[null],"names":["registeredAnimators","Map","registeredLayoutGroups","morphGroups","getParentAnimator","id","stepsRemoved","parent","get","i","registerAnimator","animator","set","unregisterAnimator","delete","registerLayoutGroup","skipInitialMount","data","animators","Set","unregisterLayoutGroup","registerToLayoutGroup","layoutId","layoutGroup","add","unregisterFromLayoutGroup","forEachAnimator","ids","callback","forEach","registerAsMorph","morphId","group","getMorphTarget","receiverId","targets","state","deleteMorphTarget"],"mappings":"AAEA,MAAMA,EAAsB,IAAIC,IAE1BC,EAAyB,IAAID,IAK7BE,EAAc,IAAIF,IAElB,SAAUG,EAAkBC,EAAYC,GAC1C,IAAIC,EAASP,EAAoBQ,IAAIH,IAAO,KAE5C,IAAK,IAAII,EAAI,EAAGA,EAAIH,EAAcG,IAAK,CACnC,IAAKF,EAAQ,OAAO,KAEpBA,EAASA,EAAOA,MACpB,CAEA,OAAOA,CACX,CAEM,SAAUG,EAAiBL,EAAYM,GACzCX,EAAoBY,IAAIP,EAAIM,EAChC,CAEM,SAAUE,EAAmBR,GAC/BL,EAAoBc,OAAOT,EAC/B,CAEM,SAAUU,EAAoBV,EAAYW,GAC5C,MAAMC,EAAOf,EAAuBM,IAAIH,IAAO,CAC3Ca,UAAW,IAAIC,IACfH,oBAKJ,OAFAd,EAAuBU,IAAIP,EAAIY,GAExBA,CACX,CAGM,SAAUG,EAAsBf,GAClCH,EAAuBY,OAAOT,EAClC,CAEM,SAAUgB,EAAsBC,EAAkBjB,GACpD,MAAMkB,EAAcrB,EAAuBM,IAAIc,GAE/C,QAAIC,IACAA,EAAYL,UAAUM,IAAInB,GACnBkB,EAAYP,iBAI3B,CAEM,SAAUS,EAA0BH,EAAkBjB,GACxD,MAAMkB,EAAcrB,EAAuBM,IAAIc,GAE3CC,GAAaA,EAAYL,UAAUJ,OAAOT,EAClD,CAEM,SAAUqB,EAAgBC,EAAkBC,GAC9CD,EAAIE,SAAQxB,IACR,MAAMM,EAAWX,EAAoBQ,IAAIH,GACrCM,GAAUiB,EAASjB,EAAS,GAExC,CAEM,SAAUmB,EAAgBC,EAAiB1B,GAC7C,MAAM2B,EAAQ7B,EAAYK,IAAIuB,IAAY,IAAIZ,IAC9Ca,EAAMR,IAAInB,GAEVF,EAAYS,IAAImB,EAASC,EAC7B,CAEM,SAAUC,EAAeF,EAAiBG,GAC5C,MAAMC,EAAUhC,EAAYK,IAAIuB,GAChC,IAAKI,EAAS,OAAO,KAErB,IAAK,MAAM9B,KAAM8B,EAAS,CACtB,MAAMxB,EAAWX,EAAoBQ,IAAIH,GACzC,GAAIM,GAAYA,EAASN,KAAO6B,GAAiC,YAAnBvB,EAASyB,MAAqB,OAAOzB,CACvF,CAEA,OAAO,IACX,CAEM,SAAU0B,EAAkBN,EAAiB1B,GAC/C,MAAM2B,EAAQ7B,EAAYK,IAAIuB,GAG9B,OAFIC,GAAOA,EAAMlB,OAAOT,GAEjB,CACX"}
|
package/dist/core/track.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./clip.js";import{clampLowerBound as e,scaleCorrectShadow as
|
|
1
|
+
import t from"./clip.js";import{getElementBounds as s,clampLowerBound as e,correctForParentScale as i,scaleCorrectShadow as n,scaleCorrectRadius as a}from"./utils.js";class o{constructor(t,s,e){this.scale=[1,1],this.correctionAnimation=null,this.queue=[],this.animations=[],this.active=0,this.timeout=0,this.correctAfterEnded=!0,this.element=t,this.shouldCache=s,this.align=e,this.styles=getComputedStyle(t),this.cache=this.snapshot(),this.correct()}snapshot(){const t={x:0,y:0,sx:1,sy:1};if(this.element instanceof SVGElement)return t;for(const s of this.shouldCache)t[s]=this.styles[s];const{x:e,y:i,width:n,height:a}=s(this.element);return t.sx=n,t.sy=a,t.x=e,t.y=i,t}push(t,s={},e){const{commit:i,blendmode:n,...a}=t.getConfig(s),o=this.element.animate(t.keyframes,a);return o.name=s.tag,o.blendmode=n,o.onfinish=()=>{try{i&&o.commitStyles()}catch{}finally{o.cancel(),this.advance(),e?.()}},this.active&&"none"===n?(o.pause(),this.queue.push(o),0):(this.animations.push(o),"none"===n&&this.active++,(a.duration*a.iterations+a.delay)/1e3)}advance(){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.cache=this.snapshot()),1/120),--this.active>0||(this.animations=this.animations.filter((t=>"running"===t.playState)),this.animations.push(...this.queue.splice(0,1)),this.active=this.animations.filter((t=>"none"===t.blendmode)).length,this.correctAfterEnded=!0)}transition(s=this.cache,i={}){const n=this.snapshot(),a={composite:"override",...i},o=[1,1],h=[0,0];for(const t of this.shouldCache)switch(t){case"x":case"y":h["x"===t?0:1]=s[t]-n[t];break;case"sx":case"sy":o["sx"===t?0:1]=s[t]/e(n[t]);break;default:a[t]=[s[t],n[t]]}[new t(a),new t({scale:[o.join(" "),null],translate:[h.map((t=>`${t}px`)).join(" "),null],composite:"combine",...i})].filter((t=>!t.isEmpty)).forEach((t=>this.push(t,{commit:!1}))),this.cache=n}clear(t){this.animations.forEach((s=>{if(!t||s.name===t){s.onfinish=null;try{s.finish()}catch{s.cancel()}}})),this.animations=this.animations.filter((t=>"running"===t.playState)),this.active=this.animations.filter((t=>"none"===t.blendmode)).length}toggle(t){this.animations.forEach((s=>s[t?"pause":"play"]()))}correct(){if(this.element instanceof SVGElement)return;const t=(/none|0px/.test(this.styles.translate)?"0 0":this.styles.translate).split(" ").map(parseFloat);if(i(this.element,t,this.align),!this.animations.length&&!this.correctAfterEnded)return;this.correctAfterEnded=!1,this.correctionAnimation?.cancel(),this.scale=s(this.element).scale;const e={borderRadius:a(this.styles.borderRadius,this.scale),boxShadow:n(this.styles.boxShadow,this.scale)};e.borderRadius===this.styles.borderRadius&&e.boxShadow===this.styles.boxShadow||(this.correctionAnimation=this.element.animate(e,{duration:0,fill:"forwards"}))}}export{o as default};
|
|
2
2
|
//# sourceMappingURL=track.js.map
|
package/dist/core/track.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.js","sources":["../../src/core/track.ts"],"sourcesContent":[null],"names":["Track","constructor","element","shouldCache","this","scale","correctionAnimation","queue","animations","active","
|
|
1
|
+
{"version":3,"file":"track.js","sources":["../../src/core/track.ts"],"sourcesContent":[null],"names":["Track","constructor","element","shouldCache","align","this","scale","correctionAnimation","queue","animations","active","timeout","correctAfterEnded","styles","getComputedStyle","cache","snapshot","correct","data","x","y","sx","sy","SVGElement","key","width","height","getElementBounds","push","clip","options","onEnded","commit","blendmode","config","getConfig","animation","animate","keyframes","name","tag","onfinish","commitStyles","cancel","advance","pause","duration","iterations","delay","clearTimeout","setTimeout","filter","playState","splice","length","transition","from","composite","translate","clampLowerBound","Clip","join","map","num","isEmpty","forEach","clear","entry","finish","toggle","paused","offset","test","split","parseFloat","correctForParentScale","corrected","borderRadius","scaleCorrectRadius","boxShadow","scaleCorrectShadow","fill"],"mappings":"uKA0Bc,MAAOA,EAejB,WAAAC,CAAYC,EAAmCC,EAAyBC,GARxEC,KAAAC,MAAoB,CAAC,EAAG,GACxBD,KAAAE,oBAAwC,KACxCF,KAAAG,MAA0B,GAC1BH,KAAAI,WAA+B,GAC/BJ,KAAAK,OAAS,EACTL,KAAAM,QAAU,EACVN,KAAAO,mBAAoB,EAGhBP,KAAKH,QAAUA,EACfG,KAAKF,YAAcA,EACnBE,KAAKD,MAAQA,EAEbC,KAAKQ,OAASC,iBAAiBZ,GAC/BG,KAAKU,MAAQV,KAAKW,WAClBX,KAAKY,SACT,CAEA,QAAAD,GACI,MAAME,EAAmB,CAAEC,EAAG,EAAGC,EAAG,EAAGC,GAAI,EAAGC,GAAI,GAClD,GAAIjB,KAAKH,mBAAmBqB,WAAY,OAAOL,EAG/C,IAAK,MAAMM,KAAOnB,KAAKF,YAAae,EAAKM,GAAOnB,KAAKQ,OAAOW,GAE5D,MAAML,EAAEA,EAACC,EAAEA,EAACK,MAAEA,EAAKC,OAAEA,GAAWC,EAAiBtB,KAAKH,SAMtD,OALAgB,EAAKG,GAAKI,EACVP,EAAKI,GAAKI,EACVR,EAAKC,EAAIA,EACTD,EAAKE,EAAIA,EAEFF,CACX,CAEA,IAAAU,CAAKC,EAAYC,EAA4B,CAAA,EAAIC,GAC7C,MAAMC,OAAEA,EAAMC,UAAEA,KAAcC,GAAWL,EAAKM,UAAUL,GAClDM,EAAY/B,KAAKH,QAAQmC,QAAQR,EAAKS,UAAWJ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xE,KAAKQ,OAAOgE,cACvCD,EAAUG,YAAc1E,KAAKQ,OAAOkE,YAAW1E,KAAKE,oBAAsBF,KAAKH,QAAQmC,QAAQuC,EAAW,CACtG9B,SAAU,EACVmC,KAAM,aAElB"}
|
package/dist/core/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isValidElement as t}from"react";import n from"./clip.js";import
|
|
1
|
+
import{isValidElement as t}from"react";import n from"./clip.js";import e from"./animation-link.js";import{getParentAnimator as o}from"./state.js";const s=1e-4;function r(t,n=8){const e=1/Math.pow(10,n);return isNaN(t)?e:(t<0?-1:1)*Math.max(Math.abs(t),e)}const i=t=>Array.isArray(t)?t:[t];function f(...t){return n=>{t.forEach((t=>{t&&"current"in t&&(t.current=n),t instanceof Function&&t(n)}))}}function a(...t){const n={};for(const e of t)Object.assign(n,e);return"strokeLength"in n&&(n.strokeDashoffset=2-n.strokeLength,delete n.strokeLength),"strokeDashoffset"in n&&(n.strokeDasharray=2),n}function c(t,n){for(const e in t){if("_livelyId"===e)continue;const o=[];n(e,t[e].map((t=>{const{on:n,...e}="object"==typeof t&&"on"in t?t:{on:t};return o.push(e),n})),o)}}function l(t){const n={};return c(t,((t,e)=>{n[t]=e})),n}function u(t){const n={};return c(t,((t,e,o)=>{["mount","unmount"].forEach((s=>{const r=e.indexOf(s);r<0||(s in n||(n[s]=[]),n[s].push([t,o[r]]))}))})),n}function p(t){let n,e=[],o=0;for(let r=0;r<t.length;r++){const i=t[r],f=Math.round(r/(t.length-1)/s)*s;if(null===i)continue;const a="object"!=typeof i?{offset:f,to:i}:i;"offset"in a||(a.offset=f),e.push(a);const c=a.to??a.after;n===c&&o++,n=c}return o===e.length?null:e}function h(t,n,e,o){t.has(n)||t.set(n,{offset:n});const s=t.get(n);if("strokeLength"===e)return s.strokeDashoffset=2-o;s[e]=o}function m(t,n){const o=new Map;for(const r in t){const i=t[r];if(i instanceof e)continue;const f=Array.isArray(i)?i:[i];f.length<2&&f.unshift(n[r]??null);const a=p(f);if(a)for(let{to:t,after:n,offset:e}of a)void 0!==n&&(1===e&&(e-=s),h(o,e+s,r,n)),void 0!==t&&h(o,e,r,t)}return Array.from(o.values()).sort(((t,n)=>t.offset-n.offset))}function g(t,n=[0,0]){if(!t||"none"===t)return n;const e=t.split(/\s+/).map(parseFloat);return e.length<2&&(e[1]=e[0]),e}function y(t){let n=.5*t.offsetWidth,e=.5*t.offsetHeight,o=1,s=1,i=t,f=!1;for(;i instanceof HTMLElement;){i!==t&&i.dataset.lively&&(f=!0);const{transform:r,scale:a,translate:c}=getComputedStyle(i),[l,u]=r.match(/^matrix(?:3d)?\((.+)\)$/)||[];if(u){const[t,r,i,a,c,l]=u.split(",").map(parseFloat);o*=Math.sqrt(t*t+r*r),s*=Math.sqrt(i*i+a*a),f||(n+=c,e+=l)}const[p,h]=g(a,[1,1]);if(o*=p,s*=h,!f){const[t,o]=g(c);n+=i.offsetLeft+t,e+=i.offsetTop+o}i=i.parentElement}return{scale:[r(o),r(s)],width:t.offsetWidth*o,height:t.offsetHeight*s,x:n,y:e}}function d(t,n){if(/^\s*$|0px/.test(t))return t;const e=t.split(/\s*\/\s*/);return e.length<2&&(e[1]=e[0]),e.map(((t,e)=>t.split(" ").map((t=>parseFloat(t)/n[e]+(t.match(/[^\d\.]+$/)?.[0]||"px"))).join(" "))).join("/")}function x(t,n){if(/^\s*$|none/.test(t))return t;const[e,o,s]=t.split(/(?<=px),\s?/)[0].split(/(?<=\))\s|\s(?=inset)/);if(!o)return"";const[r,i,f,a]=o.split(" ").map(parseFloat),c=1/Math.max(...n),l=new Array(3).fill([r/n[0],i/n[1],f*c,a*c]);return n[0]<n[1]?(l[1][0]-=1/n[0],l[2][0]+=1/n[0]):(l[1][1]-=1/n[1],l[2][1]+=1/n[1]),l.map((t=>`${e} ${t.map((t=>`${t}px`)).join(" ")}${s?" inset":""}`)).join(", ")}function $(t,n,e){let s,r=t;for(;r=r?.parentElement;)if(r.dataset.lively){s=o(r.dataset.lively,0);break}if(!r||!s||!s.trackList.some((t=>t.animations.length||t.correctAfterEnded)))return;const{scale:i}=y(r),f=1/i[0],a=1/i[1],c="center"===e.x?0:(t.offsetWidth-t.offsetWidth*f)/2*("right"===e.x?1:-1),l="center"===e.y?0:(t.offsetHeight-t.offsetHeight*a)/2*("bottom"===e.y?1:-1);t.style.transform=`translate(${c-2*n[0]}px, ${l-2*n[1]}px) scale(${f}, ${a}) translate(${n[0]/f}px, ${n[1]/a}px)`}function k(n,e,o){const s=Array.isArray(n)?n:[n];for(let n=0;n<s.length;n++){if(!t(s[n]))continue;const{props:r,key:i}=s[n],f=o+(null!==i?`${i}_`:n);"object"==typeof r.triggers&&(r.triggers._livelyId=f,e.delete(f)),k(r.children,e,f)}return e}function j(n,e){const o=Array.isArray(n)?n:[n],s=[];for(let n=0;n<o.length;n++){if(!t(o[n]))continue;const{key:r}=o[n],i="_la"+(null!==r?`${r}_`:n);e.has(i)&&s.push([n,o[n]])}return s}const A={duration:0,delay:1,repeat:2,alternate:3,reverse:4,easing:5,composite:6};function v(t,o){const s={},r=[];if(!(t instanceof n))for(const n in t){let i=t[n];"object"==typeof i||n in A||(i=new e(i)),i instanceof e&&(r.push(i.on("change",(()=>o(n,i)))),s[n]=i)}return[s,()=>r.forEach((t=>t()))]}function M(t,n){const e={};for(const o in t)e[o]=t[o].get(n);return e}export{A as ClipConfigKeys,h as addKeyframeEntry,i as asArray,r as clampLowerBound,$ as correctForParentScale,v as extractAnimationLinks,k as filterRemovedAnimators,c as forEachTrigger,y as getElementBounds,M as getInitialStyleFromLinks,u as getLifeCycleAnimations,j as getRemovedAnimators,s as keyframeEpsilon,f as mergeRefs,a as mergeStyles,m as parseClipKeyframes,g as parseIndiviualTransform,d as scaleCorrectRadius,x as scaleCorrectShadow,l as serializeTriggers,p as transformKeyframeList};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
package/dist/core/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/core/utils.ts"],"sourcesContent":[null],"names":["keyframeEpsilon","clampLowerBound","num","precision","Math","
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/core/utils.ts"],"sourcesContent":[null],"names":["keyframeEpsilon","clampLowerBound","num","precision","lowerBound","Math","pow","isNaN","max","abs","asArray","value","Array","isArray","mergeRefs","refs","forEach","ref","current","Function","mergeStyles","stylesList","merged","styles","Object","assign","strokeDashoffset","strokeLength","strokeDasharray","forEachTrigger","triggers","callback","key","optionsArray","map","on","options","push","serializeTriggers","serialized","list","getLifeCycleAnimations","animations","trigger","index","indexOf","transformKeyframeList","last","keyframes","equal","i","length","offset","round","keyframe","to","after","addKeyframeEntry","prop","has","set","entry","get","parseClipKeyframes","initial","Map","AnimationLink","array","unshift","transformed","undefined","from","values","sort","a","b","parseIndiviualTransform","defaultValue","nums","split","parseFloat","getElementBounds","element","x","offsetWidth","y","offsetHeight","sx","sy","el","reachedBoundary","HTMLElement","dataset","lively","transform","scale","translate","getComputedStyle","_","matrix","match","c","d","tx","ty","sqrt","isx","isy","offsetLeft","offsetTop","parentElement","width","height","scaleCorrectRadius","radius","test","axis","join","scaleCorrectShadow","shadow","color","params","inset","ofx","ofy","blr","spr","ratio","shadows","fill","val","correctForParentScale","align","animator","parent","getParentAnimator","trackList","some","track","correctAfterEnded","dx","dy","style","filterRemovedAnimators","children","toRemove","prefix","isValidElement","props","id","_livelyId","delete","getRemovedAnimators","removed","animators","ClipConfigKeys","duration","delay","repeat","alternate","reverse","easing","composite","extractAnimationLinks","animate","links","callbacks","Clip","remove","getInitialStyleFromLinks"],"mappings":"kJAQO,MAAMA,EAAkB,cAEfC,EAAgBC,EAAaC,EAAY,GACrD,MAAMC,EAAa,EAAIC,KAAKC,IAAI,GAAIH,GAEpC,OAAII,MAAML,GAAaE,GAEfF,EAAM,GAAI,EAAK,GAAKG,KAAKG,IAAIH,KAAKI,IAAIP,GAAME,EACxD,CAEO,MAAMM,EAAWC,GAA6BC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AAK,IAAIxG,EAAI,EAAGA,EAAIiB,EAAMhB,OAAQD,IAAK,CACnC,IAAKiG,EAAehF,EAAMjB,IAAK,SAE/B,MAAMlB,IAAEA,GAAQmC,EAAMjB,GAChBmG,EAAK,OAAiB,OAARrH,EAAe,GAAGA,KAASkB,GAE3CuG,EAAQ9F,IAAI0F,IAAKK,EAAUrH,KAAK,CAACa,EAAGiB,EAAMjB,IAClD,CAEA,OAAOwG,CACX,CAEO,MAAMC,EAET,CACAC,SAAU,EACVC,MAAO,EACPC,OAAQ,EACRC,UAAW,EACXC,QAAS,EACTC,OAAQ,EACRC,UAAW,GAGT,SAAUC,EAAsBC,EAA6BrI,GAC/D,MAAMsI,EAEF,CAAA,EACEC,EAA4B,GAGlC,KAAMF,aAAmBG,GACrB,IAAK,MAAMvI,KAAOoI,EAAS,CACvB,IAAIzJ,EAAQyJ,EAAQpI,GACC,iBAAVrB,GAAwBqB,KAAO2H,IAAiBhJ,EAAQ,IAAIuD,EAAcvD,IAEjFA,aAAiBuD,IACjBoG,EAAUjI,KAAK1B,EAAMwB,GAAG,UAAU,IAAMJ,EAASC,EAAgBrB,MAEjE0J,EAAMrI,GAAkBrB,EAEhC,CAGJ,MAAO,CAAC0J,EAfa,IAAMC,EAAUtJ,SAAQwJ,GAAUA,MAgB3D,CAEM,SAAUC,EAAyBJ,EAEtCzH,GACC,MAAMrB,EAAuB,CAAA,EAE7B,IAAK,MAAMS,KAAOqI,EACd9I,EAAOS,GAAkBqI,EAAMrI,GAAiB8B,IAAIlB,GAGxD,OAAOrB,CACX"}
|
package/dist/hooks/use-tap.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useRef as n,useState as r,useEffect as t}from"react";function e(){const e=n(null),[o,i]=r(!1);return t((()=>{if(!e.current)return;const n=new AbortController;return e.current.addEventListener("pointerdown",(()=>i(!0)),{signal:n.signal}),
|
|
2
|
+
import{useRef as n,useState as r,useEffect as t}from"react";function e(){const e=n(null),[o,i]=r(!1);return t((()=>{if(!e.current)return;const n=new AbortController;return e.current.addEventListener("pointerdown",(()=>i(!0)),{signal:n.signal}),window.addEventListener("pointerup",(()=>i(!1)),{signal:n.signal}),()=>n.abort()}),[]),[e,o]}export{e as default};
|
|
3
3
|
//# sourceMappingURL=use-tap.js.map
|
package/dist/layout-group.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{createContext as
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{createContext as n,useId as e,useRef as r,useState as o,useLayoutEffect as i,useEffect as a}from"react";import{filterRemovedAnimators as s,getRemovedAnimators as u}from"./core/utils.js";import{registerLayoutGroup as c,forEachAnimator as m,unregisterLayoutGroup as l}from"./core/state.js";const d=n("");function f({children:n,skipInitialMount:f=!1,mode:p="wait"}){const g="_lg"+e(),h=r(0),w=r(n),y=c(g,f),[M,v]=o(0),U=s(n,new Set(y.animators),`${g}_la_`);if(U.size){if("sync"===p){const t=Array.isArray(n)?n.slice():[n];for(const[n,e]of u(w.current,U))t.splice(n,0,e);w.current=t}m(U,(t=>{if("mounted"===t.state){const n=t.trigger("unmount",{cascade:"reverse",composite:"override"});t.delayUnmountUntil=Date.now()+1e3*n,n&&(t.state="unmounting",t.dispatch("unmount"))}}))}let j=0;m(y.animators,(t=>j=Math.max(j,t.delayUnmountUntil)));const x=j-Date.now();return clearTimeout(h.current),x>0?(m(y.animators,(t=>{"unmounting"!==t.state||U.has(t.id)||(t.trigger("mount",{override:!0}),t.state="mounted")})),h.current=setTimeout((()=>{w.current=n,v((t=>t+1))}),x)):"wait"===p&&(w.current=n),i((()=>{m(y.animators,(t=>{"mounted"!==t.state||t.isMounting||t.transition(),t.isMounting=!1}))}),[n]),a((()=>(y.skipInitialMount=!1,()=>{l(g),clearTimeout(h.current)})),[]),t(d,{value:g,children:w.current})}export{d as LayoutGroupContext,f as default};
|
|
3
3
|
//# sourceMappingURL=layout-group.js.map
|
package/dist/presets.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/types/animate.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import Animator, { AnimationOptions, AnimationTrigger } from "./core/animator";
|
|
2
2
|
import Clip, { ClipInitials, ClipOptions } from "./core/clip";
|
|
3
|
-
import { CacheKey } from "./core/track";
|
|
3
|
+
import { CacheKey, CorrectionAlignment } from "./core/track";
|
|
4
4
|
import { TransitionOptions } from "./core/animation-link";
|
|
5
5
|
export type AnimateTriggers<T extends string> = {
|
|
6
|
-
[key in T]?: AnimationTrigger
|
|
7
|
-
on: AnimationTrigger
|
|
8
|
-
} & AnimationOptions);
|
|
6
|
+
[key in T]?: (AnimationTrigger | {
|
|
7
|
+
on: AnimationTrigger;
|
|
8
|
+
} & AnimationOptions)[];
|
|
9
9
|
};
|
|
10
10
|
export type AnimateProps<T extends string> = {
|
|
11
11
|
ref?: React.Ref<Animator<T | 'animate'>>;
|
|
@@ -19,7 +19,7 @@ export type AnimateProps<T extends string> = {
|
|
|
19
19
|
triggers?: AnimateTriggers<T | 'animate'>;
|
|
20
20
|
stagger?: number;
|
|
21
21
|
staggerLimit?: number;
|
|
22
|
-
|
|
22
|
+
deformCorrection?: CorrectionAlignment | boolean;
|
|
23
23
|
transition?: TransitionOptions & {
|
|
24
24
|
cache?: CacheKey[];
|
|
25
25
|
};
|
|
@@ -28,4 +28,4 @@ export type AnimateProps<T extends string> = {
|
|
|
28
28
|
onAnimationEnd?: (animation?: T) => void;
|
|
29
29
|
};
|
|
30
30
|
export declare const AnimateContext: import("react").Context<string>;
|
|
31
|
-
export default function Animate<T extends string>({ ref, children, inherit, initial, animate, triggers, stagger, staggerLimit,
|
|
31
|
+
export default function Animate<T extends string>({ ref, children, inherit, initial, animate, triggers, stagger, staggerLimit, deformCorrection, transition, morph, clips, paused, onAnimationEnd }: AnimateProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Easing } from "./clip";
|
|
1
|
+
import { BlendMode, Easing } from "./clip";
|
|
2
2
|
export type TransitionOptions = {
|
|
3
3
|
duration?: number;
|
|
4
4
|
easing?: Easing;
|
|
5
|
+
composite?: BlendMode;
|
|
5
6
|
};
|
|
6
7
|
export type AnimationLinkEvent = 'change';
|
|
7
8
|
export default class AnimationLink<T, K = T> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import AnimationLink, { TransitionOptions } from "./animation-link";
|
|
2
2
|
import Clip, { ClipConfig, ClipInitials, ClipKey, ClipOptions } from "./clip";
|
|
3
|
-
import Track, { CacheKey } from "./track";
|
|
3
|
+
import Track, { CacheKey, CorrectionAlignment } from "./track";
|
|
4
4
|
export type LifeCycleTrigger = 'mount' | 'unmount';
|
|
5
5
|
export type AnimationTrigger = LifeCycleTrigger | boolean | number;
|
|
6
6
|
export type AnimationOptions = Omit<ClipConfig, 'duration' | 'easing'> & {
|
|
@@ -14,11 +14,12 @@ export default class Animator<T extends string> {
|
|
|
14
14
|
id: string;
|
|
15
15
|
parent: Animator<any> | null;
|
|
16
16
|
dependents: Set<Animator<any>>;
|
|
17
|
+
inherit: ('ignoreScaleDeformation' | 'defaultTransitionOptions' | 'cache' | 'align')[];
|
|
17
18
|
clips: {
|
|
18
19
|
[key in T]: Clip;
|
|
19
20
|
};
|
|
20
21
|
lifeCycleAnimations: {
|
|
21
|
-
[key in LifeCycleTrigger]?: T[];
|
|
22
|
+
[key in LifeCycleTrigger]?: [T, AnimationOptions][];
|
|
22
23
|
};
|
|
23
24
|
links: {
|
|
24
25
|
[key in ClipKey]?: AnimationLink<any>;
|
|
@@ -29,40 +30,47 @@ export default class Animator<T extends string> {
|
|
|
29
30
|
ignoreScaleDeformation: boolean;
|
|
30
31
|
defaultTransitionOptions: TransitionOptions;
|
|
31
32
|
cache: CacheKey[];
|
|
33
|
+
align: CorrectionAlignment;
|
|
32
34
|
stagger: number;
|
|
33
35
|
staggerLimit: number;
|
|
34
|
-
initialStyles:
|
|
36
|
+
initialStyles: {
|
|
37
|
+
mounted?: ClipInitials;
|
|
38
|
+
unmounted?: ClipInitials;
|
|
39
|
+
};
|
|
35
40
|
eventListeners: {
|
|
36
41
|
[key in AnimatorEvent]?: Set<(...args: any) => void>;
|
|
37
42
|
};
|
|
38
43
|
state: 'unmounted' | 'unmounting' | 'mounted';
|
|
44
|
+
delayUnmountUntil: number;
|
|
45
|
+
isMounting: boolean;
|
|
39
46
|
paused: boolean;
|
|
47
|
+
timeout: number;
|
|
40
48
|
frame: number;
|
|
41
|
-
constructor({ id, clips, lifeCycleAnimations,
|
|
49
|
+
constructor({ id, clips, lifeCycleAnimations, deformCorrection, transition, stagger, staggerLimit }: {
|
|
42
50
|
id: string;
|
|
43
51
|
clips: {
|
|
44
52
|
[key in T]: Clip;
|
|
45
53
|
};
|
|
46
54
|
lifeCycleAnimations: {
|
|
47
|
-
[key in LifeCycleTrigger]?: T[];
|
|
55
|
+
[key in LifeCycleTrigger]?: [T, AnimationOptions][];
|
|
48
56
|
};
|
|
49
|
-
|
|
50
|
-
transition
|
|
57
|
+
deformCorrection?: CorrectionAlignment | boolean;
|
|
58
|
+
transition?: TransitionOptions & {
|
|
51
59
|
cache?: CacheKey[];
|
|
52
60
|
};
|
|
53
61
|
stagger: number;
|
|
54
62
|
staggerLimit: number;
|
|
55
63
|
});
|
|
56
|
-
register(parentId: string, inherit: boolean | number): void;
|
|
64
|
+
register(parentId: string, inherit: boolean | number, morph?: string): void;
|
|
57
65
|
mount(): void;
|
|
58
|
-
dispose(): void;
|
|
66
|
+
dispose(morph?: string): void;
|
|
59
67
|
on<K extends (...args: any) => void>(event: AnimatorEvent, callback: K): void;
|
|
60
68
|
off<K extends (...args: any) => void>(event: AnimatorEvent, callback: K): void;
|
|
61
69
|
dispatch(event: AnimatorEvent, ...args: any): void;
|
|
62
70
|
tick(): void;
|
|
63
71
|
addLinks(animate: Clip | ClipOptions): void;
|
|
64
72
|
addTrack(element: any, index: number): void;
|
|
65
|
-
mergeInitialStyles(styles: ClipInitials): ClipInitials;
|
|
73
|
+
mergeInitialStyles(styles: ClipInitials, mode: 'mounted' | 'unmounted'): ClipInitials;
|
|
66
74
|
pretime(clip: Clip, options: AnimationOptions): number;
|
|
67
75
|
trigger(on: LifeCycleTrigger, options?: AnimationOptions): number;
|
|
68
76
|
play(animation: T | Clip, { cascade, delay, tag, ...options }?: AnimationOptions): number;
|
|
@@ -72,4 +80,5 @@ export default class Animator<T extends string> {
|
|
|
72
80
|
transition(from?: Animator<any>, options?: TransitionOptions): void;
|
|
73
81
|
setPlayState(paused: boolean): void;
|
|
74
82
|
stop(animation?: T): void;
|
|
83
|
+
unmount(): void;
|
|
75
84
|
}
|
|
@@ -39,11 +39,11 @@ export default class Clip {
|
|
|
39
39
|
duration: number;
|
|
40
40
|
delay: number;
|
|
41
41
|
iterations: number;
|
|
42
|
-
|
|
42
|
+
direction: "reverse" | "alternate" | "alternate-reverse" | "normal";
|
|
43
43
|
easing: Easing;
|
|
44
44
|
composite: "accumulate" | "replace";
|
|
45
|
+
fill: "both";
|
|
45
46
|
blendmode: BlendMode;
|
|
46
47
|
commit: boolean;
|
|
47
48
|
};
|
|
48
|
-
static mergeInitialStyles(clips: Clip[], styles: ClipInitials): ClipInitials;
|
|
49
49
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Animator from "./animator";
|
|
2
2
|
export declare function getParentAnimator(id: string, stepsRemoved: number): Animator<any> | null;
|
|
3
|
-
export declare function isRegistered(id: string): boolean;
|
|
4
3
|
export declare function registerAnimator(id: string, animator: Animator<any>): void;
|
|
5
4
|
export declare function unregisterAnimator(id: string): void;
|
|
6
5
|
export declare function registerLayoutGroup(id: string, skipInitialMount: boolean): {
|
|
@@ -11,6 +10,6 @@ export declare function unregisterLayoutGroup(id: string): void;
|
|
|
11
10
|
export declare function registerToLayoutGroup(layoutId: string, id: string): boolean;
|
|
12
11
|
export declare function unregisterFromLayoutGroup(layoutId: string, id: string): void;
|
|
13
12
|
export declare function forEachAnimator(ids: Set<string>, callback: (animator: Animator<any>) => void): void;
|
|
14
|
-
export declare function registerAsMorph(morphId: string,
|
|
13
|
+
export declare function registerAsMorph(morphId: string, id: string): void;
|
|
15
14
|
export declare function getMorphTarget(morphId: string, receiverId: string): Animator<any> | null;
|
|
16
|
-
export declare function deleteMorphTarget(morphId: string,
|
|
15
|
+
export declare function deleteMorphTarget(morphId: string, id: string): number;
|
|
@@ -15,21 +15,24 @@ export type TrackAnimation = Animation & {
|
|
|
15
15
|
name?: string;
|
|
16
16
|
blendmode: BlendMode;
|
|
17
17
|
};
|
|
18
|
+
export type CorrectionAlignment = {
|
|
19
|
+
x: 'left' | 'center' | 'right';
|
|
20
|
+
y: 'top' | 'center' | 'bottom';
|
|
21
|
+
};
|
|
18
22
|
export default class Track {
|
|
19
23
|
element: HTMLElement | SVGElement;
|
|
20
24
|
shouldCache: CacheKey[];
|
|
25
|
+
align: CorrectionAlignment;
|
|
21
26
|
styles: CSSStyleDeclaration;
|
|
22
27
|
cache: StyleCache;
|
|
23
28
|
scale: ScaleTuple;
|
|
24
|
-
corrected: {
|
|
25
|
-
borderRadius: string;
|
|
26
|
-
boxShadow: string;
|
|
27
|
-
};
|
|
28
29
|
correctionAnimation: Animation | null;
|
|
29
30
|
queue: TrackAnimation[];
|
|
30
31
|
animations: TrackAnimation[];
|
|
31
32
|
active: number;
|
|
32
|
-
|
|
33
|
+
timeout: number;
|
|
34
|
+
correctAfterEnded: boolean;
|
|
35
|
+
constructor(element: HTMLElement | SVGElement, shouldCache: CacheKey[], align: CorrectionAlignment);
|
|
33
36
|
snapshot(): StyleCache;
|
|
34
37
|
push(clip: Clip, options?: AnimationOptions, onEnded?: () => void): number;
|
|
35
38
|
advance(): void;
|
|
@@ -2,19 +2,19 @@ import { AnimationOptions, AnimationTrigger } from "./animator";
|
|
|
2
2
|
import Clip, { ClipConfig, ClipInitials, ClipKey, ClipKeyframe, ClipKeyframes, ClipOptions } from "./clip";
|
|
3
3
|
import { AnimateTriggers } from "../animate";
|
|
4
4
|
import AnimationLink from "./animation-link";
|
|
5
|
+
import { CorrectionAlignment } from "./track";
|
|
5
6
|
export declare const keyframeEpsilon = 0.0001;
|
|
6
|
-
export declare
|
|
7
|
+
export declare function clampLowerBound(num: number, precision?: number): number;
|
|
7
8
|
export declare const asArray: (value: number | number[]) => number[];
|
|
8
9
|
export declare function mergeRefs(...refs: React.Ref<any>[]): (value: any) => void;
|
|
9
10
|
export declare function mergeStyles(...stylesList: (ClipInitials | undefined)[]): import("react").CSSProperties;
|
|
10
|
-
export declare function forEachTrigger<T extends string>(triggers: AnimateTriggers<T>, callback: (key: T, triggerList: AnimationTrigger[], options: AnimationOptions) => void): void;
|
|
11
|
+
export declare function forEachTrigger<T extends string>(triggers: AnimateTriggers<T>, callback: (key: T, triggerList: AnimationTrigger[], options: AnimationOptions[]) => void): void;
|
|
11
12
|
export declare function serializeTriggers<T extends string>(triggers: AnimateTriggers<T>): {
|
|
12
13
|
[key: string]: any[];
|
|
13
14
|
};
|
|
14
|
-
export declare function shouldTrigger(previous: any[], current: any[]): boolean;
|
|
15
15
|
export declare function getLifeCycleAnimations<T extends string>(triggers: AnimateTriggers<T>): {
|
|
16
|
-
mount?: T[] | undefined;
|
|
17
|
-
unmount?: T[] | undefined;
|
|
16
|
+
mount?: [T, AnimationOptions][] | undefined;
|
|
17
|
+
unmount?: [T, AnimationOptions][] | undefined;
|
|
18
18
|
};
|
|
19
19
|
export declare function transformKeyframeList(list: ClipKeyframe[]): {
|
|
20
20
|
to?: string | number;
|
|
@@ -24,41 +24,23 @@ export declare function transformKeyframeList(list: ClipKeyframe[]): {
|
|
|
24
24
|
export declare function addKeyframeEntry(map: Map<number, Keyframe>, offset: number, prop: string, value: string | number): number | undefined;
|
|
25
25
|
export declare function parseClipKeyframes(keyframes: ClipKeyframes, initial: ClipInitials): Keyframe[];
|
|
26
26
|
export type ScaleTuple = readonly [number, number];
|
|
27
|
-
export declare function
|
|
28
|
-
export declare function
|
|
29
|
-
|
|
27
|
+
export declare function parseIndiviualTransform(value: string, defaultValue?: number[]): number[];
|
|
28
|
+
export declare function getElementBounds(element: HTMLElement): {
|
|
29
|
+
scale: ScaleTuple;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
export declare function scaleCorrectRadius(radius: string, scale: ScaleTuple): string;
|
|
36
|
+
export declare function scaleCorrectShadow(shadow: string, scale: ScaleTuple): string;
|
|
37
|
+
export declare function correctForParentScale(element: HTMLElement, offset: [number, number], align: CorrectionAlignment): void;
|
|
38
|
+
export declare function filterRemovedAnimators(children: React.ReactNode, toRemove: Set<string>, prefix: string): Set<string>;
|
|
39
|
+
export declare function getRemovedAnimators(children: React.ReactNode, removed: Set<string>): [number, import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>][];
|
|
30
40
|
export declare const ClipConfigKeys: {
|
|
31
41
|
[key in keyof Required<ClipConfig>]: number;
|
|
32
42
|
};
|
|
33
43
|
export declare function extractAnimationLinks(animate: Clip | ClipOptions, callback: (key: ClipKey, link: AnimationLink<any>) => void): readonly [{
|
|
34
|
-
strokeLength?: AnimationLink<any, any> | undefined;
|
|
35
|
-
strokeDashoffset?: AnimationLink<any, any> | undefined;
|
|
36
|
-
all?: AnimationLink<any, any> | undefined;
|
|
37
|
-
contain?: AnimationLink<any, any> | undefined;
|
|
38
|
-
color?: AnimationLink<any, any> | undefined;
|
|
39
|
-
overlay?: AnimationLink<any, any> | undefined;
|
|
40
|
-
left?: AnimationLink<any, any> | undefined;
|
|
41
|
-
right?: AnimationLink<any, any> | undefined;
|
|
42
|
-
bottom?: AnimationLink<any, any> | undefined;
|
|
43
|
-
top?: AnimationLink<any, any> | undefined;
|
|
44
|
-
inset?: AnimationLink<any, any> | undefined;
|
|
45
|
-
page?: AnimationLink<any, any> | undefined;
|
|
46
|
-
content?: AnimationLink<any, any> | undefined;
|
|
47
|
-
flex?: AnimationLink<any, any> | undefined;
|
|
48
|
-
grid?: AnimationLink<any, any> | undefined;
|
|
49
|
-
position?: AnimationLink<any, any> | undefined;
|
|
50
|
-
fill?: AnimationLink<any, any> | undefined;
|
|
51
|
-
clip?: AnimationLink<any, any> | undefined;
|
|
52
|
-
stroke?: AnimationLink<any, any> | undefined;
|
|
53
|
-
x?: AnimationLink<any, any> | undefined;
|
|
54
|
-
y?: AnimationLink<any, any> | undefined;
|
|
55
|
-
caret?: AnimationLink<any, any> | undefined;
|
|
56
|
-
zoom?: AnimationLink<any, any> | undefined;
|
|
57
|
-
clear?: AnimationLink<any, any> | undefined;
|
|
58
|
-
border?: AnimationLink<any, any> | undefined;
|
|
59
|
-
padding?: AnimationLink<any, any> | undefined;
|
|
60
|
-
filter?: AnimationLink<any, any> | undefined;
|
|
61
|
-
offset?: AnimationLink<any, any> | undefined;
|
|
62
44
|
accentColor?: AnimationLink<any, any> | undefined;
|
|
63
45
|
alignContent?: AnimationLink<any, any> | undefined;
|
|
64
46
|
alignItems?: AnimationLink<any, any> | undefined;
|
|
@@ -134,6 +116,7 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
134
116
|
borderTopRightRadius?: AnimationLink<any, any> | undefined;
|
|
135
117
|
borderTopStyle?: AnimationLink<any, any> | undefined;
|
|
136
118
|
borderTopWidth?: AnimationLink<any, any> | undefined;
|
|
119
|
+
bottom?: AnimationLink<any, any> | undefined;
|
|
137
120
|
boxDecorationBreak?: AnimationLink<any, any> | undefined;
|
|
138
121
|
boxShadow?: AnimationLink<any, any> | undefined;
|
|
139
122
|
boxSizing?: AnimationLink<any, any> | undefined;
|
|
@@ -143,8 +126,10 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
143
126
|
captionSide?: AnimationLink<any, any> | undefined;
|
|
144
127
|
caretColor?: AnimationLink<any, any> | undefined;
|
|
145
128
|
caretShape?: AnimationLink<any, any> | undefined;
|
|
129
|
+
clear?: AnimationLink<any, any> | undefined;
|
|
146
130
|
clipPath?: AnimationLink<any, any> | undefined;
|
|
147
131
|
clipRule?: AnimationLink<any, any> | undefined;
|
|
132
|
+
color?: AnimationLink<any, any> | undefined;
|
|
148
133
|
colorAdjust?: AnimationLink<any, any> | undefined;
|
|
149
134
|
colorInterpolationFilters?: AnimationLink<any, any> | undefined;
|
|
150
135
|
colorScheme?: AnimationLink<any, any> | undefined;
|
|
@@ -156,12 +141,14 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
156
141
|
columnRuleWidth?: AnimationLink<any, any> | undefined;
|
|
157
142
|
columnSpan?: AnimationLink<any, any> | undefined;
|
|
158
143
|
columnWidth?: AnimationLink<any, any> | undefined;
|
|
144
|
+
contain?: AnimationLink<any, any> | undefined;
|
|
159
145
|
containIntrinsicBlockSize?: AnimationLink<any, any> | undefined;
|
|
160
146
|
containIntrinsicHeight?: AnimationLink<any, any> | undefined;
|
|
161
147
|
containIntrinsicInlineSize?: AnimationLink<any, any> | undefined;
|
|
162
148
|
containIntrinsicWidth?: AnimationLink<any, any> | undefined;
|
|
163
149
|
containerName?: AnimationLink<any, any> | undefined;
|
|
164
150
|
containerType?: AnimationLink<any, any> | undefined;
|
|
151
|
+
content?: AnimationLink<any, any> | undefined;
|
|
165
152
|
contentVisibility?: AnimationLink<any, any> | undefined;
|
|
166
153
|
counterIncrement?: AnimationLink<any, any> | undefined;
|
|
167
154
|
counterReset?: AnimationLink<any, any> | undefined;
|
|
@@ -175,8 +162,10 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
175
162
|
dominantBaseline?: AnimationLink<any, any> | undefined;
|
|
176
163
|
emptyCells?: AnimationLink<any, any> | undefined;
|
|
177
164
|
fieldSizing?: AnimationLink<any, any> | undefined;
|
|
165
|
+
fill?: AnimationLink<any, any> | undefined;
|
|
178
166
|
fillOpacity?: AnimationLink<any, any> | undefined;
|
|
179
167
|
fillRule?: AnimationLink<any, any> | undefined;
|
|
168
|
+
filter?: AnimationLink<any, any> | undefined;
|
|
180
169
|
flexBasis?: AnimationLink<any, any> | undefined;
|
|
181
170
|
flexDirection?: AnimationLink<any, any> | undefined;
|
|
182
171
|
flexGrow?: AnimationLink<any, any> | undefined;
|
|
@@ -243,6 +232,7 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
243
232
|
justifyItems?: AnimationLink<any, any> | undefined;
|
|
244
233
|
justifySelf?: AnimationLink<any, any> | undefined;
|
|
245
234
|
justifyTracks?: AnimationLink<any, any> | undefined;
|
|
235
|
+
left?: AnimationLink<any, any> | undefined;
|
|
246
236
|
letterSpacing?: AnimationLink<any, any> | undefined;
|
|
247
237
|
lightingColor?: AnimationLink<any, any> | undefined;
|
|
248
238
|
lineBreak?: AnimationLink<any, any> | undefined;
|
|
@@ -320,6 +310,7 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
320
310
|
overflowWrap?: AnimationLink<any, any> | undefined;
|
|
321
311
|
overflowX?: AnimationLink<any, any> | undefined;
|
|
322
312
|
overflowY?: AnimationLink<any, any> | undefined;
|
|
313
|
+
overlay?: AnimationLink<any, any> | undefined;
|
|
323
314
|
overscrollBehaviorBlock?: AnimationLink<any, any> | undefined;
|
|
324
315
|
overscrollBehaviorInline?: AnimationLink<any, any> | undefined;
|
|
325
316
|
overscrollBehaviorX?: AnimationLink<any, any> | undefined;
|
|
@@ -332,10 +323,12 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
332
323
|
paddingLeft?: AnimationLink<any, any> | undefined;
|
|
333
324
|
paddingRight?: AnimationLink<any, any> | undefined;
|
|
334
325
|
paddingTop?: AnimationLink<any, any> | undefined;
|
|
326
|
+
page?: AnimationLink<any, any> | undefined;
|
|
335
327
|
paintOrder?: AnimationLink<any, any> | undefined;
|
|
336
328
|
perspective?: AnimationLink<any, any> | undefined;
|
|
337
329
|
perspectiveOrigin?: AnimationLink<any, any> | undefined;
|
|
338
330
|
pointerEvents?: AnimationLink<any, any> | undefined;
|
|
331
|
+
position?: AnimationLink<any, any> | undefined;
|
|
339
332
|
positionAnchor?: AnimationLink<any, any> | undefined;
|
|
340
333
|
positionArea?: AnimationLink<any, any> | undefined;
|
|
341
334
|
positionTryFallbacks?: AnimationLink<any, any> | undefined;
|
|
@@ -345,6 +338,7 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
345
338
|
quotes?: AnimationLink<any, any> | undefined;
|
|
346
339
|
r?: AnimationLink<any, any> | undefined;
|
|
347
340
|
resize?: AnimationLink<any, any> | undefined;
|
|
341
|
+
right?: AnimationLink<any, any> | undefined;
|
|
348
342
|
rotate?: AnimationLink<any, any> | undefined;
|
|
349
343
|
rowGap?: AnimationLink<any, any> | undefined;
|
|
350
344
|
rubyAlign?: AnimationLink<any, any> | undefined;
|
|
@@ -391,8 +385,10 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
391
385
|
speakAs?: AnimationLink<any, any> | undefined;
|
|
392
386
|
stopColor?: AnimationLink<any, any> | undefined;
|
|
393
387
|
stopOpacity?: AnimationLink<any, any> | undefined;
|
|
388
|
+
stroke?: AnimationLink<any, any> | undefined;
|
|
394
389
|
strokeColor?: AnimationLink<any, any> | undefined;
|
|
395
390
|
strokeDasharray?: AnimationLink<any, any> | undefined;
|
|
391
|
+
strokeDashoffset?: AnimationLink<any, any> | undefined;
|
|
396
392
|
strokeLinecap?: AnimationLink<any, any> | undefined;
|
|
397
393
|
strokeLinejoin?: AnimationLink<any, any> | undefined;
|
|
398
394
|
strokeMiterlimit?: AnimationLink<any, any> | undefined;
|
|
@@ -431,6 +427,7 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
431
427
|
textWrapMode?: AnimationLink<any, any> | undefined;
|
|
432
428
|
textWrapStyle?: AnimationLink<any, any> | undefined;
|
|
433
429
|
timelineScope?: AnimationLink<any, any> | undefined;
|
|
430
|
+
top?: AnimationLink<any, any> | undefined;
|
|
434
431
|
touchAction?: AnimationLink<any, any> | undefined;
|
|
435
432
|
transform?: AnimationLink<any, any> | undefined;
|
|
436
433
|
transformBox?: AnimationLink<any, any> | undefined;
|
|
@@ -461,11 +458,16 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
461
458
|
wordSpacing?: AnimationLink<any, any> | undefined;
|
|
462
459
|
wordWrap?: AnimationLink<any, any> | undefined;
|
|
463
460
|
writingMode?: AnimationLink<any, any> | undefined;
|
|
461
|
+
x?: AnimationLink<any, any> | undefined;
|
|
462
|
+
y?: AnimationLink<any, any> | undefined;
|
|
464
463
|
zIndex?: AnimationLink<any, any> | undefined;
|
|
464
|
+
zoom?: AnimationLink<any, any> | undefined;
|
|
465
|
+
all?: AnimationLink<any, any> | undefined;
|
|
465
466
|
animation?: AnimationLink<any, any> | undefined;
|
|
466
467
|
animationRange?: AnimationLink<any, any> | undefined;
|
|
467
468
|
background?: AnimationLink<any, any> | undefined;
|
|
468
469
|
backgroundPosition?: AnimationLink<any, any> | undefined;
|
|
470
|
+
border?: AnimationLink<any, any> | undefined;
|
|
469
471
|
borderBlock?: AnimationLink<any, any> | undefined;
|
|
470
472
|
borderBlockColor?: AnimationLink<any, any> | undefined;
|
|
471
473
|
borderBlockEnd?: AnimationLink<any, any> | undefined;
|
|
@@ -487,17 +489,21 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
487
489
|
borderStyle?: AnimationLink<any, any> | undefined;
|
|
488
490
|
borderTop?: AnimationLink<any, any> | undefined;
|
|
489
491
|
borderWidth?: AnimationLink<any, any> | undefined;
|
|
492
|
+
caret?: AnimationLink<any, any> | undefined;
|
|
490
493
|
columnRule?: AnimationLink<any, any> | undefined;
|
|
491
494
|
columns?: AnimationLink<any, any> | undefined;
|
|
492
495
|
containIntrinsicSize?: AnimationLink<any, any> | undefined;
|
|
493
496
|
container?: AnimationLink<any, any> | undefined;
|
|
497
|
+
flex?: AnimationLink<any, any> | undefined;
|
|
494
498
|
flexFlow?: AnimationLink<any, any> | undefined;
|
|
495
499
|
font?: AnimationLink<any, any> | undefined;
|
|
496
500
|
gap?: AnimationLink<any, any> | undefined;
|
|
501
|
+
grid?: AnimationLink<any, any> | undefined;
|
|
497
502
|
gridArea?: AnimationLink<any, any> | undefined;
|
|
498
503
|
gridColumn?: AnimationLink<any, any> | undefined;
|
|
499
504
|
gridRow?: AnimationLink<any, any> | undefined;
|
|
500
505
|
gridTemplate?: AnimationLink<any, any> | undefined;
|
|
506
|
+
inset?: AnimationLink<any, any> | undefined;
|
|
501
507
|
insetBlock?: AnimationLink<any, any> | undefined;
|
|
502
508
|
insetInline?: AnimationLink<any, any> | undefined;
|
|
503
509
|
lineClamp?: AnimationLink<any, any> | undefined;
|
|
@@ -508,9 +514,11 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
508
514
|
mask?: AnimationLink<any, any> | undefined;
|
|
509
515
|
maskBorder?: AnimationLink<any, any> | undefined;
|
|
510
516
|
motion?: AnimationLink<any, any> | undefined;
|
|
517
|
+
offset?: AnimationLink<any, any> | undefined;
|
|
511
518
|
outline?: AnimationLink<any, any> | undefined;
|
|
512
519
|
overflow?: AnimationLink<any, any> | undefined;
|
|
513
520
|
overscrollBehavior?: AnimationLink<any, any> | undefined;
|
|
521
|
+
padding?: AnimationLink<any, any> | undefined;
|
|
514
522
|
paddingBlock?: AnimationLink<any, any> | undefined;
|
|
515
523
|
paddingInline?: AnimationLink<any, any> | undefined;
|
|
516
524
|
placeContent?: AnimationLink<any, any> | undefined;
|
|
@@ -788,6 +796,7 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
788
796
|
boxOrdinalGroup?: AnimationLink<any, any> | undefined;
|
|
789
797
|
boxOrient?: AnimationLink<any, any> | undefined;
|
|
790
798
|
boxPack?: AnimationLink<any, any> | undefined;
|
|
799
|
+
clip?: AnimationLink<any, any> | undefined;
|
|
791
800
|
fontStretch?: AnimationLink<any, any> | undefined;
|
|
792
801
|
gridColumnGap?: AnimationLink<any, any> | undefined;
|
|
793
802
|
gridGap?: AnimationLink<any, any> | undefined;
|
|
@@ -889,6 +898,7 @@ export declare function extractAnimationLinks(animate: Clip | ClipOptions, callb
|
|
|
889
898
|
colorInterpolation?: AnimationLink<any, any> | undefined;
|
|
890
899
|
colorRendering?: AnimationLink<any, any> | undefined;
|
|
891
900
|
glyphOrientationVertical?: AnimationLink<any, any> | undefined;
|
|
901
|
+
strokeLength?: AnimationLink<any, any> | undefined;
|
|
892
902
|
}, () => void];
|
|
893
903
|
export declare function getInitialStyleFromLinks(links: {
|
|
894
904
|
[key in ClipKey]?: AnimationLink<any>;
|
|
@@ -3,5 +3,5 @@ export declare const LayoutGroupContext: React.Context<string>;
|
|
|
3
3
|
export default function LayoutGroup({ children, skipInitialMount, mode }: {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
skipInitialMount?: boolean;
|
|
6
|
-
mode?: 'wait' | '
|
|
6
|
+
mode?: 'wait' | 'sync';
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infinityfx/lively",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Feature complete, lightweight react animation library.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"types": "./dist/types/hooks.d.ts",
|
|
16
16
|
"default": "./dist/hooks.js"
|
|
17
17
|
},
|
|
18
|
-
"./
|
|
19
|
-
"types": "./dist/types/
|
|
20
|
-
"default": "./dist/
|
|
18
|
+
"./presets": {
|
|
19
|
+
"types": "./dist/types/presets.d.ts",
|
|
20
|
+
"default": "./dist/presets.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"typesVersions": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"hooks": [
|
|
26
26
|
"./dist/types/hooks.d.ts"
|
|
27
27
|
],
|
|
28
|
-
"
|
|
29
|
-
"./dist/types/
|
|
28
|
+
"presets": [
|
|
29
|
+
"./dist/types/presets.d.ts"
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
},
|
package/dist/animations.js
DELETED
package/dist/animations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animations.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|