@infinityfx/lively 5.0.0-alpha.10 → 5.0.0-alpha.11
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/core/clip.js +1 -1
- package/dist/core/clip.js.map +1 -1
- package/dist/core/track.js +1 -1
- package/dist/core/track.js.map +1 -1
- package/dist/types/core/clip.d.ts +1 -1
- package/package.json +1 -1
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: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};
|
|
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:r?"both":"none",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","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,
|
|
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,KAAMH,EAAS,OAAkB,OACjCI,UAAWZ,EACXQ,SAER"}
|
package/dist/core/track.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"./clip.js";import{getElementBounds as s,clampLowerBound as
|
|
1
|
+
import t from"./clip.js";import{getElementBounds as s,clampLowerBound as i,correctForParentScale as e,scaleCorrectShadow as n,scaleCorrectRadius as a}from"./utils.js";class o{constructor(t,s,i){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=i,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:i,y:e,width:n,height:a}=s(this.element);return t.sx=n,t.sy=a,t.x=i,t.y=e,t}push(t,s={},i){const{commit:e,blendmode:n,...a}=t.getConfig(s),o=this.element.animate(t.keyframes,a);return o.name=s.tag,o.blendmode=n,o.onfinish=()=>{try{e&&o.commitStyles()}catch{}finally{o.cancel(),this.advance(),i?.()}},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,e={}){this.clear("layout-transition");const n=this.snapshot(),a={composite:"override",...e},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]/i(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",...e})].filter((t=>!t.isEmpty)).forEach((t=>this.push(t,{commit:!1,tag:"layout-transition"}))),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(e(this.element,t,this.align),!this.animations.length&&!this.correctAfterEnded)return;this.correctAfterEnded=!1,this.correctionAnimation?.cancel(),this.scale=s(this.element).scale;const i={borderRadius:a(this.styles.borderRadius,this.scale),boxShadow:n(this.styles.boxShadow,this.scale)};i.borderRadius===this.styles.borderRadius&&i.boxShadow===this.styles.boxShadow||(this.correctionAnimation=this.element.animate(i,{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","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","
|
|
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","clear","composite","translate","clampLowerBound","Clip","join","map","num","isEmpty","forEach","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,K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