@ssgoi/core 3.1.2 → 3.1.4
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/animator/multi-animator.d.ts +0 -2
- package/dist/animator/multi-animator.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +100 -97
- package/dist/transition/create-transition-callback.d.ts.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +35 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +39 -36
- package/dist/view-transitions/blind.d.ts.map +1 -1
- package/dist/view-transitions/film.d.ts +1 -3
- package/dist/view-transitions/film.d.ts.map +1 -1
- package/dist/view-transitions/hero.d.ts.map +1 -1
- package/dist/view-transitions/index.cjs +15 -15
- package/dist/view-transitions/index.js +643 -588
- package/dist/view-transitions/instagram.d.ts.map +1 -1
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ export interface MultiAnimatorOptions {
|
|
|
4
4
|
config: NormalizedMultiSpringConfig;
|
|
5
5
|
from: number;
|
|
6
6
|
to: number;
|
|
7
|
-
element?: HTMLElement;
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
9
|
* MultiAnimator - Coordinates multiple spring animations
|
|
@@ -28,7 +27,6 @@ export declare class MultiAnimator extends Animation {
|
|
|
28
27
|
private direction;
|
|
29
28
|
private idCounter;
|
|
30
29
|
private rafId;
|
|
31
|
-
private element?;
|
|
32
30
|
private from;
|
|
33
31
|
private to;
|
|
34
32
|
constructor(options: MultiAnimatorOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/multi-animator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,2BAA2B,EAE3B,cAAc,EACf,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/multi-animator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,2BAA2B,EAE3B,cAAc,EACf,MAAM,UAAU,CAAC;AAYlB,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,2BAA2B,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,EAAE,CAAS;gBAEP,OAAO,EAAE,oBAAoB;IAQzC,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;IAuB3B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,kBAAkB;IAiB1B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,aAAa;IAcrB;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,IAAI,IAAI;IAYf,QAAQ,IAAI,IAAI;IAYhB,OAAO,CAAC,iBAAiB;IAMzB,IAAI,IAAI,IAAI;IAQZ,OAAO,IAAI,IAAI;IAiCf,eAAe,IAAI,cAAc;IAgBjC;;OAEG;IACH,eAAe,IAAI,MAAM;IAKzB;;OAEG;IACH,WAAW,IAAI,MAAM;IAKrB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK7B;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKnC;;OAEG;IACH,cAAc,IAAI,OAAO;IASzB;;;OAGG;IACH,MAAM,CAAC,SAAS,CACd,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAC7C,OAAO,EAAE,oBAAoB,GAC5B,aAAa;CAMjB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var J=Object.defineProperty;var Q=(n,e,t)=>e in n?J(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>Q(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./types.cjs"),Z=require("./jaemin-BG8HRXG1.cjs");class tt{constructor(){d(this,"listeners",new Set);d(this,"rafId",null);d(this,"isRunning",!1);d(this,"startTime",Date.now());d(this,"lastUpdate",this.startTime);d(this,"elapsed",0);d(this,"lagThreshold",500);d(this,"adjustedLag",33);d(this,"maxDeltaTime",33);d(this,"gap",1e3/240);d(this,"nextTime",this.gap);d(this,"tick",()=>{const e=Date.now();let i=e-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=e;const r=e-this.startTime,o=r-this.nextTime;if(o>0){const s=i/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(c=>{c(s,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(e){return this.listeners.add(e),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.listeners.delete(e),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(e,t){this.lagThreshold=e,this.adjustedLag=Math.min(t,e)}fps(e){this.gap=1e3/e,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const P=new tt;function N(n){const e=n.stiffness,t=n.damping,i=1,r=Math.sqrt(e/i),o=t/(2*Math.sqrt(e*i));return{omega:r,zeta:o}}function Y(n,e,t,i){const{omega:r,zeta:o}=t,{position:s,velocity:c}=n,a=Math.min(i,.033),l=-2*a*o*r*c,f=a*r*r*(e-s),w=c+l+f;return{position:s+a*w,velocity:w}}const et=.01,it=.01,H=.05;function j(n,e){const t=Math.abs(e-n.position),i=Math.abs(n.velocity);return t<et&&i<it}function nt(n){const{from:e,to:t,spring:i,velocity:r=0,onUpdate:o,onComplete:s,onStart:c}=n;let a={position:e,velocity:r},l=!0,f=0,w=!1;const u=N(i),h=p=>{if(l){if(w||(w=!0,c==null||c()),a=Y(a,t,u,p),j(a,t)){if(f+=Math.min(p,.033),f>=H){a={position:t,velocity:0},l=!1,o(a.position),P.unsubscribe(h),s();return}}else f=0;o(a.position)}};return P.subscribe(h),{stop:()=>{l&&(l=!1,P.unsubscribe(h))},getPosition:()=>a.position,getVelocity:()=>a.velocity,isRunning:()=>l}}const b=1e3/60;function ot(n,e,t,i=0){const r=N(t),o=600;let s={position:n,velocity:i},c=0;const a=[];for(let l=0;l<o;l++){const f=l*b;if(a.push({time:f,position:s.position,velocity:s.velocity}),s=Y(s,e,r,b/1e3),j(s,e)){if(c+=b/1e3,c>=H){a.push({time:(l+1)*b,position:e,velocity:0});break}}else c=0}return a}function D(n,e){if(n.length===0)return{position:0,velocity:0};const t=n[0],i=n[n.length-1];if(e<=0)return{position:t.position,velocity:t.velocity};if(e>=i.time)return{position:i.position,velocity:i.velocity};let r=0,o=n.length-1;for(;r<o-1;){const l=Math.floor((r+o)/2);n[l].time<=e?r=l:o=l}const s=n[r],c=n[o],a=(e-s.time)/(c.time-s.time);return{position:s.position+(c.position-s.position)*a,velocity:s.velocity+(c.velocity-s.velocity)*a}}function rt(n,e){return n.map(t=>e(t.position))}function st(n){const{element:e,from:t,to:i,spring:r,velocity:o=0,style:s,onComplete:c,onStart:a}=n,l=ot(t,i,r,o);if(l.length===0)return a==null||a(),c(),{stop:()=>{},getPosition:()=>i,getVelocity:()=>0,isRunning:()=>!1};const f=rt(l,s),w=l[l.length-1],u=w.time,h=e.animate(f,{duration:u,fill:"forwards",easing:"linear"});let p=!0;const S=performance.now();return a==null||a(),h.onfinish=()=>{p&&(p=!1,c())},{stop:()=>{p&&(p=!1,h.cancel())},getPosition:()=>{if(!p)return w.position;const y=performance.now()-S;return D(l,y).position},getVelocity:()=>{if(!p)return 0;const y=performance.now()-S;return D(l,y).velocity},isRunning:()=>p}}function at(n){const{from:e,to:t,spring:i,velocity:r,onComplete:o,onStart:s,tick:c,css:a}=n;if(c&&a)throw new Error("Cannot use both 'tick' and 'css' options together");return!c&&!a?(s==null||s(),o(),{stop:()=>{},getPosition:()=>t,getVelocity:()=>0,isRunning:()=>!1}):a?st({element:a.element,from:e,to:t,spring:i,velocity:r,style:a.style,onComplete:o,onStart:s}):nt({from:e,to:t,spring:i,velocity:r,onUpdate:c,onComplete:o,onStart:s})}class X{}class V extends X{constructor(t){super();d(this,"options");d(this,"controls",null);d(this,"isAnimating",!1);d(this,"currentValue");d(this,"currentVelocity",0);if(t.tick&&t.css)throw new Error("Cannot use both 'tick' and 'css' options together");this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:300,damping:30},tick:t.tick,css:t.css,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from}runAnimation(t){this.isAnimating=!0,this.controls=at({from:this.currentValue,to:t,spring:this.options.spring,velocity:this.currentVelocity,tick:this.options.tick,css:this.options.css,onStart:this.options.onStart,onComplete:()=>{this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.controls=null,this.options.onComplete()}})}forward(){this.stop(),this.runAnimation(this.options.to)}backward(){this.stop(),this.runAnimation(this.options.from)}reverse(){const t=this.options.from;this.options.from=this.options.to,this.options.to=t,this.isAnimating&&(this.stop(),this.runAnimation(this.options.to))}stop(){this.controls&&(this.currentValue=this.controls.getPosition(),this.currentVelocity=this.controls.getVelocity(),this.controls.stop(),this.controls=null),this.isAnimating=!1}getVelocity(){var t;return((t=this.controls)==null?void 0:t.getVelocity())??this.currentVelocity}getCurrentValue(){var t;return((t=this.controls)==null?void 0:t.getPosition())??this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{position:this.getCurrentValue(),velocity:this.getVelocity(),from:this.options.from,to:this.options.to}}setValue(t){this.currentValue=t}setVelocity(t){this.currentVelocity=t}updateOptions(t){this.options={...this.options,...t}}static fromState(t,i){const r=new V(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}class I extends X{constructor(t){super();d(this,"config");d(this,"animators",new Map);d(this,"springOrder",[]);d(this,"completedCount",0);d(this,"completedAnimators",new Set);d(this,"direction","forward");d(this,"idCounter",0);d(this,"rafId",null);d(this,"element");d(this,"from");d(this,"to");this.config=t.config,this.from=t.from,this.to=t.to,this.element=t.element,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const i=this.generateId(),r=new V({from:this.from,to:this.to,spring:t.spring,tick:t.tick,css:t.css&&this.element?{element:this.element,style:t.css}:void 0,onComplete:()=>this.onAnimatorComplete(i),onStart:t.onStart});this.animators.set(i,{id:i,item:t,animator:r,started:!1}),this.springOrder.push(i)})}getAnimatorProgress(t){const i=t.animator.getCurrentState(),r=Math.abs(i.to-i.from);return r===0?1:Math.abs(i.position-i.from)/r}getOrderedIds(){return this.direction==="forward"?this.springOrder:[...this.springOrder].reverse()}onAnimatorComplete(t){var r,o,s,c,a,l;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(r=i.item).onComplete)==null||o.call(r),(c=(s=this.config).onProgress)==null||c.call(s,this.completedCount,this.config.springs.length),this.completedCount===this.config.springs.length&&(this.stopScheduler(),(l=(a=this.config).onEnd)==null||l.call(a)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let i=0;i<t.length;i++){const r=t[i],o=this.animators.get(r);if(!o||o.started)continue;if(i===0){this.startAnimator(r);continue}const s=t[i-1],c=this.animators.get(s);if(!c||!c.started)continue;const a=this.getAnimatorProgress(c),l=o.item.normalizedOffset;a>=l&&this.startAnimator(r)}}startAnimator(t){const i=this.animators.get(t);!i||i.started||(i.started=!0,this.direction==="forward"?i.animator.forward():i.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var i;const t=this.springOrder[0];return t?((i=this.animators.get(t))==null?void 0:i.animator)??null:null}forward(){var t,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}backward(){var t,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}resetStartedFlags(){this.animators.forEach(t=>{t.started=!1})}stop(){this.stopScheduler(),this.animators.forEach(t=>{t.animator.stop(),t.started=!1})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(!t.started)return;const i=t.animator.getCurrentState();if(i.position===i.to){const o=t.item.css&&this.element?{element:this.element,style:t.item.css}:void 0,s=V.fromState({position:this.to,velocity:0},{from:this.to,to:this.from,spring:t.item.spring,tick:t.item.tick,css:o,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});s.forward(),t.animator=s}else t.animator.reverse()})}getCurrentState(){const t=this.getFirstAnimator();return t?t.getCurrentState():{position:0,velocity:0,from:0,to:1}}getCurrentValue(){const t=this.getFirstAnimator();return(t==null?void 0:t.getCurrentValue())??0}getVelocity(){const t=this.getFirstAnimator();return(t==null?void 0:t.getVelocity())??0}setValue(t){const i=this.getFirstAnimator();i==null||i.setValue(t)}setVelocity(t){const i=this.getFirstAnimator();i==null||i.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,i){const r=new I(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}const x=Symbol.for("TRANSITION_STRATEGY"),$=n=>({runIn:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),e.out)return{config:await e.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}return e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),e.in)return{config:await e.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}return e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),K=()=>({runIn:async n=>n.in?{config:await n.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async n=>n.out?{config:await n.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),F="data-ssgoi-scope",z="data-ssgoi-scope-ready";function ct(){return n=>{if(n)return n.setAttribute(F,""),queueMicrotask(()=>{queueMicrotask(()=>{n.setAttribute(z,"true")})}),()=>{}}}function W(n){return n.hasAttribute(z)}function U(n){return n.closest(`[${F}]`)}function lt(n,e){var w;let t=null,i=null,r=null,o=null;const s={get currentAnimation(){return t}},c=((w=e==null?void 0:e.strategy)==null?void 0:w.call(e,s))||$(s),a=async u=>{var E;i&&(i.remove(),i=null);const h=n(),p=h.in&&h.in(u),S=!(e!=null&&e.strategy)&&h.out?h.out(u):void 0;if(!p)return;const y={in:v.normalizeToMultiSpring(p),out:S?v.normalizeToMultiSpring(S):void 0},m=await c.runIn(y);if(!m.config){t&&(t.direction="in");return}const g=m.config;(E=g.prepare)==null||E.call(g,u),g.wait&&await g.wait();const A=v.normalizeMultiSpringSchedule({...g,onEnd:()=>{var T;t=null,(T=g.onEnd)==null||T.call(g)}}),C=I.fromState(m.state,{config:A,from:m.from,to:m.to,element:u});t={controller:C,direction:"in"},m.direction==="forward"?C.forward():C.backward()},l=async u=>{var T;i=u;const h=n(),p=!(e!=null&&e.strategy)&&h.in?h.in(u):void 0,S=h.out&&h.out(u);if(!S)return;const y={in:p?v.normalizeToMultiSpring(p):void 0,out:v.normalizeToMultiSpring(S)},m=await c.runOut(y);if(!m.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const g=m.config;(T=g.prepare)==null||T.call(g,u),E(),g.wait&&await g.wait();const A=v.normalizeMultiSpringSchedule({...g,onEnd:()=>{var R,_;(R=g.onEnd)==null||R.call(g),i&&(i.remove(),i=null),t=null,(_=e==null?void 0:e.onCleanupEnd)==null||_.call(e)}}),C=I.fromState(m.state,{config:A,from:m.from,to:m.to,element:u});t={controller:C,direction:"out"},m.direction==="forward"?C.forward():C.backward();function E(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};let f=null;return u=>{if(u)return r=u.parentElement,o=u.nextElementSibling,(e==null?void 0:e.scope)==="local"?queueMicrotask(()=>{f=U(u),!(f&&!W(f))&&a(u)}):a(u),()=>{const h=u.isConnected?u.cloneNode(!0):u;f?queueMicrotask(()=>{document.contains(f)&&l(h)}):l(h)}}}const ut=3,ft=n=>{if(!n)return null;const e=n.split(`
|
|
2
|
-
`).map(t=>t.trim());for(let t=ut;t<Math.min(e.length,6);t++){const i=e[t],r=i==null?void 0:i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!r)continue;const o=r[1]??"",
|
|
1
|
+
"use strict";var J=Object.defineProperty;var Q=(n,e,t)=>e in n?J(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>Q(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./types.cjs"),Z=require("./jaemin-BG8HRXG1.cjs");class tt{constructor(){d(this,"listeners",new Set);d(this,"rafId",null);d(this,"isRunning",!1);d(this,"startTime",Date.now());d(this,"lastUpdate",this.startTime);d(this,"elapsed",0);d(this,"lagThreshold",500);d(this,"adjustedLag",33);d(this,"maxDeltaTime",33);d(this,"gap",1e3/240);d(this,"nextTime",this.gap);d(this,"tick",()=>{const e=Date.now();let i=e-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=e;const r=e-this.startTime,o=r-this.nextTime;if(o>0){const a=i/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(c=>{c(a,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(e){return this.listeners.add(e),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.listeners.delete(e),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(e,t){this.lagThreshold=e,this.adjustedLag=Math.min(t,e)}fps(e){this.gap=1e3/e,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const P=new tt;function N(n){const e=n.stiffness,t=n.damping,i=1,r=Math.sqrt(e/i),o=t/(2*Math.sqrt(e*i));return{omega:r,zeta:o}}function Y(n,e,t,i){const{omega:r,zeta:o}=t,{position:a,velocity:c}=n,s=Math.min(i,.033),l=-2*s*o*r*c,f=s*r*r*(e-a),w=c+l+f;return{position:a+s*w,velocity:w}}const et=.01,it=.01,H=.05;function j(n,e){const t=Math.abs(e-n.position),i=Math.abs(n.velocity);return t<et&&i<it}function nt(n){const{from:e,to:t,spring:i,velocity:r=0,onUpdate:o,onComplete:a,onStart:c}=n;let s={position:e,velocity:r},l=!0,f=0,w=!1;const u=N(i),h=p=>{if(l){if(w||(w=!0,c==null||c()),s=Y(s,t,u,p),j(s,t)){if(f+=Math.min(p,.033),f>=H){s={position:t,velocity:0},l=!1,o(s.position),P.unsubscribe(h),a();return}}else f=0;o(s.position)}};return P.subscribe(h),{stop:()=>{l&&(l=!1,P.unsubscribe(h))},getPosition:()=>s.position,getVelocity:()=>s.velocity,isRunning:()=>l}}const b=1e3/60;function ot(n,e,t,i=0){const r=N(t),o=600;let a={position:n,velocity:i},c=0;const s=[];for(let l=0;l<o;l++){const f=l*b;if(s.push({time:f,position:a.position,velocity:a.velocity}),a=Y(a,e,r,b/1e3),j(a,e)){if(c+=b/1e3,c>=H){s.push({time:(l+1)*b,position:e,velocity:0});break}}else c=0}return s}function D(n,e){if(n.length===0)return{position:0,velocity:0};const t=n[0],i=n[n.length-1];if(e<=0)return{position:t.position,velocity:t.velocity};if(e>=i.time)return{position:i.position,velocity:i.velocity};let r=0,o=n.length-1;for(;r<o-1;){const l=Math.floor((r+o)/2);n[l].time<=e?r=l:o=l}const a=n[r],c=n[o],s=(e-a.time)/(c.time-a.time);return{position:a.position+(c.position-a.position)*s,velocity:a.velocity+(c.velocity-a.velocity)*s}}function rt(n,e){return n.map(t=>e(t.position))}function st(n){const{element:e,from:t,to:i,spring:r,velocity:o=0,style:a,onComplete:c,onStart:s}=n,l=ot(t,i,r,o);if(l.length===0)return s==null||s(),c(),{stop:()=>{},getPosition:()=>i,getVelocity:()=>0,isRunning:()=>!1};const f=rt(l,a),w=l[l.length-1],u=w.time,h=e.animate(f,{duration:u,fill:"forwards",easing:"linear"});let p=!0;const S=performance.now();return s==null||s(),h.onfinish=()=>{p&&(p=!1,c())},{stop:()=>{p&&(p=!1,h.cancel())},getPosition:()=>{if(!p)return w.position;const y=performance.now()-S;return D(l,y).position},getVelocity:()=>{if(!p)return 0;const y=performance.now()-S;return D(l,y).velocity},isRunning:()=>p}}function at(n){const{from:e,to:t,spring:i,velocity:r,onComplete:o,onStart:a,tick:c,css:s}=n;if(c&&s)throw new Error("Cannot use both 'tick' and 'css' options together");return!c&&!s?(a==null||a(),o(),{stop:()=>{},getPosition:()=>t,getVelocity:()=>0,isRunning:()=>!1}):s?st({element:s.element,from:e,to:t,spring:i,velocity:r,style:s.style,onComplete:o,onStart:a}):nt({from:e,to:t,spring:i,velocity:r,onUpdate:c,onComplete:o,onStart:a})}class X{}class V extends X{constructor(t){super();d(this,"options");d(this,"controls",null);d(this,"isAnimating",!1);d(this,"currentValue");d(this,"currentVelocity",0);if(t.tick&&t.css)throw new Error("Cannot use both 'tick' and 'css' options together");this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:300,damping:30},tick:t.tick,css:t.css,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from}runAnimation(t){this.isAnimating=!0,this.controls=at({from:this.currentValue,to:t,spring:this.options.spring,velocity:this.currentVelocity,tick:this.options.tick,css:this.options.css,onStart:this.options.onStart,onComplete:()=>{this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.controls=null,this.options.onComplete()}})}forward(){this.stop(),this.runAnimation(this.options.to)}backward(){this.stop(),this.runAnimation(this.options.from)}reverse(){const t=this.options.from;this.options.from=this.options.to,this.options.to=t,this.isAnimating&&(this.stop(),this.runAnimation(this.options.to))}stop(){this.controls&&(this.currentValue=this.controls.getPosition(),this.currentVelocity=this.controls.getVelocity(),this.controls.stop(),this.controls=null),this.isAnimating=!1}getVelocity(){var t;return((t=this.controls)==null?void 0:t.getVelocity())??this.currentVelocity}getCurrentValue(){var t;return((t=this.controls)==null?void 0:t.getPosition())??this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{position:this.getCurrentValue(),velocity:this.getVelocity(),from:this.options.from,to:this.options.to}}setValue(t){this.currentValue=t}setVelocity(t){this.currentVelocity=t}updateOptions(t){this.options={...this.options,...t}}static fromState(t,i){const r=new V(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}class I extends X{constructor(t){super();d(this,"config");d(this,"animators",new Map);d(this,"springOrder",[]);d(this,"completedCount",0);d(this,"completedAnimators",new Set);d(this,"direction","forward");d(this,"idCounter",0);d(this,"rafId",null);d(this,"from");d(this,"to");this.config=t.config,this.from=t.from,this.to=t.to,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const i=this.generateId(),r=new V({from:this.from,to:this.to,spring:t.spring,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(i),onStart:t.onStart});this.animators.set(i,{id:i,item:t,animator:r,started:!1}),this.springOrder.push(i)})}getAnimatorProgress(t){const i=t.animator.getCurrentState(),r=Math.abs(i.to-i.from);return r===0?1:Math.abs(i.position-i.from)/r}getOrderedIds(){return this.direction==="forward"?this.springOrder:[...this.springOrder].reverse()}onAnimatorComplete(t){var r,o,a,c,s,l;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(r=i.item).onComplete)==null||o.call(r),(c=(a=this.config).onProgress)==null||c.call(a,this.completedCount,this.config.springs.length),this.completedCount===this.config.springs.length&&(this.stopScheduler(),(l=(s=this.config).onEnd)==null||l.call(s)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let i=0;i<t.length;i++){const r=t[i],o=this.animators.get(r);if(!o||o.started)continue;if(i===0){this.startAnimator(r);continue}const a=t[i-1],c=this.animators.get(a);if(!c||!c.started)continue;const s=this.getAnimatorProgress(c),l=o.item.normalizedOffset;s>=l&&this.startAnimator(r)}}startAnimator(t){const i=this.animators.get(t);!i||i.started||(i.started=!0,this.direction==="forward"?i.animator.forward():i.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var i;const t=this.springOrder[0];return t?((i=this.animators.get(t))==null?void 0:i.animator)??null:null}forward(){var t,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}backward(){var t,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}resetStartedFlags(){this.animators.forEach(t=>{t.started=!1})}stop(){this.stopScheduler(),this.animators.forEach(t=>{t.animator.stop(),t.started=!1})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(!t.started)return;const i=t.animator.getCurrentState();if(i.position===i.to){const o=V.fromState({position:this.to,velocity:0},{from:this.to,to:this.from,spring:t.item.spring,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.forward(),t.animator=o}else t.animator.reverse()})}getCurrentState(){const t=this.getFirstAnimator();return t?t.getCurrentState():{position:0,velocity:0,from:0,to:1}}getCurrentValue(){const t=this.getFirstAnimator();return(t==null?void 0:t.getCurrentValue())??0}getVelocity(){const t=this.getFirstAnimator();return(t==null?void 0:t.getVelocity())??0}setValue(t){const i=this.getFirstAnimator();i==null||i.setValue(t)}setVelocity(t){const i=this.getFirstAnimator();i==null||i.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,i){const r=new I(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}const x=Symbol.for("TRANSITION_STRATEGY"),$=n=>({runIn:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),e.out)return{config:await e.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}return e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),e.in)return{config:await e.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}return e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),K=()=>({runIn:async n=>n.in?{config:await n.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async n=>n.out?{config:await n.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),F="data-ssgoi-scope",z="data-ssgoi-scope-ready";function ct(){return n=>{if(n)return n.setAttribute(F,""),queueMicrotask(()=>{queueMicrotask(()=>{n.setAttribute(z,"true")})}),()=>{}}}function W(n){return n.hasAttribute(z)}function U(n){return n.closest(`[${F}]`)}function lt(n,e){var w;let t=null,i=null,r=null,o=null;const a={get currentAnimation(){return t}},c=((w=e==null?void 0:e.strategy)==null?void 0:w.call(e,a))||$(a),s=async u=>{var E;i&&(i.remove(),i=null);const h=n(),p=h.in&&h.in(u),S=!(e!=null&&e.strategy)&&h.out?h.out(u):void 0;if(!p)return;const y={in:v.normalizeToMultiSpring(p),out:S?v.normalizeToMultiSpring(S):void 0},m=await c.runIn(y);if(!m.config){t&&(t.direction="in");return}const g=m.config;(E=g.prepare)==null||E.call(g,u),g.wait&&await g.wait();const A=v.normalizeMultiSpringSchedule({...g,onEnd:()=>{var T;t=null,(T=g.onEnd)==null||T.call(g)}},u),C=I.fromState(m.state,{config:A,from:m.from,to:m.to});t={controller:C,direction:"in"},m.direction==="forward"?C.forward():C.backward()},l=async u=>{var T;i=u;const h=n(),p=!(e!=null&&e.strategy)&&h.in?h.in(u):void 0,S=h.out&&h.out(u);if(!S)return;const y={in:p?v.normalizeToMultiSpring(p):void 0,out:v.normalizeToMultiSpring(S)},m=await c.runOut(y);if(!m.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const g=m.config;(T=g.prepare)==null||T.call(g,u),E(),g.wait&&await g.wait();const A=v.normalizeMultiSpringSchedule({...g,onEnd:()=>{var R,_;(R=g.onEnd)==null||R.call(g),i&&(i.remove(),i=null),t=null,(_=e==null?void 0:e.onCleanupEnd)==null||_.call(e)}},u),C=I.fromState(m.state,{config:A,from:m.from,to:m.to});t={controller:C,direction:"out"},m.direction==="forward"?C.forward():C.backward();function E(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};let f=null;return u=>{if(u)return r=u.parentElement,o=u.nextElementSibling,(e==null?void 0:e.scope)==="local"?queueMicrotask(()=>{f=U(u),!(f&&!W(f))&&s(u)}):s(u),()=>{const h=u.isConnected?u.cloneNode(!0):u;f?queueMicrotask(()=>{document.contains(f)&&l(h)}):l(h)}}}const ut=3,ft=n=>{if(!n)return null;const e=n.split(`
|
|
2
|
+
`).map(t=>t.trim());for(let t=ut;t<Math.min(e.length,6);t++){const i=e[t],r=i==null?void 0:i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!r)continue;const o=r[1]??"",a=r[2]??"0",c=r[3]??"0";return{file:o.split(/[\\/]/).pop()||o,line:a,column:c}}return null},M=new Map,O=new Map;function dt(n,e,t){M.set(n,e);let i=O.get(n);if(i)return i;const r=e;return i=lt(()=>{const o=M.get(n);return o||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{M.get(n)===r&&G(n)}}),O.set(n,i),i}function G(n){M.delete(n),O.delete(n)}function B(){const n=ft(new Error().stack);return n?`auto_${n.file}_${n.line}_${n.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const L=globalThis.FinalizationRegistry,q=L?new L(n=>{try{G(n)}catch{}}):void 0;function mt(n){const e=n.key??B();if(n.ref&&q)try{q.register(n.ref,e)}catch{}return dt(e,{in:n.in,out:n.out},{strategy:n[x],scope:n.scope})}function ht(n){const e=n.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...n,...e]}function gt(n){let e=!1,t=0,i=0,r=!1;const o=50,a=p=>{if(!n)return;const S=p.touches[0];S&&(r=S.clientX<o,r&&(t=S.clientX,i=S.clientY))},c=p=>{if(!n||!r)return;const S=p.touches[0];if(!S)return;const y=S.clientX-t,m=S.clientY-i;y>window.outerWidth/2-5&&Math.abs(y)>Math.abs(m)?e=!0:e=!1},s=()=>{n&&(r=!1,t=0,i=0)},l=()=>e,f=()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("touchmove",c,{passive:!0}),window.addEventListener("touchend",s,{passive:!0}))},w=()=>{typeof window>"u"||(window.removeEventListener("touchstart",a),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",s))};let u=0;return{initialize:f,cleanup:w,isSwipePending:l,resetSwipeDetection:()=>{u++,u>1&&(u=0,e=!1)}}}const pt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)return e;e=e.parentElement}return document.documentElement},wt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return e;e=e.parentElement}return document.body};function yt(){let n=null,e=null;const t=new Map;let i=null;const r=()=>{n&&i&&t.set(i,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(f,w)=>{e=f,n||(n=pt(f),(n===document.documentElement?window:n).addEventListener("scroll",r,{passive:!0})),i=w},calculateScrollOffset:(f,w)=>{const u=f&&t.has(f)?t.get(f):{x:0,y:0},h=w&&t.has(w)?t.get(w):{x:0,y:0};return{x:-h.x+u.x,y:-h.y+u.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>e?wt(e):document.body,getScrollPosition:f=>f&&t.has(f)?t.get(f):{x:0,y:0}}}function k(n,e){if(e==="*")return!0;if(e.endsWith("/*")){const t=e.slice(0,-2);return n===t||n.startsWith(t+"/")}return n===e}function St(n,e,t){for(const i of t)if(k(n,i.from)&&k(e,i.to))return i.transition;for(const i of t)if((i.from==="*"||k(n,i.from))&&(i.to==="*"||k(e,i.to)))return i.transition;return null}function vt(n){const{transitions:e=[],defaultTransition:t,middleware:i=(y,m)=>({from:y,to:m}),skipOnIosSwipe:r=!0}=n;let o=null;const a=ht(e),{initializeContext:c,calculateScrollOffset:s,getScrollContainer:l,getPositionedParentElement:f,getScrollPosition:w}=yt(),u=gt(r);u.initialize();function h(){if(o!=null&&o.from&&(o!=null&&o.to)){const{from:y,to:m}=i(o.from,o.to),A=St(y,m,a)||t,C=s(o.from,o.to),E={scrollOffset:C,scroll:w(o.from),get scrollingElement(){return l()||document.documentElement},get positionedParent(){return f()}},T={scrollOffset:C,get scroll(){return o?w(o.to):{x:0,y:0}},get scrollingElement(){return l()||document.documentElement},get positionedParent(){return f()}};A&&(A.out&&o.outResolve&&o.outResolve(R=>A.out(R,E)),A.in&&o.inResolve&&o.inResolve(R=>A.in(R,T))),o=null}}const p=async(y,m)=>u.isSwipePending()?(u.resetSwipeDetection(),()=>({})):m==="in"&&(!o||!o.from)?()=>({}):(o||(o={}),m==="out"?(o.from=y,new Promise(g=>{o.outResolve=g,h()})):(o.to=y,new Promise(g=>{o.inResolve=g,h()})));return y=>({key:y,in:async m=>(c(m,y),(await p(y,"in"))(m)),out:async m=>(await p(y,"out"))(m),[x]:K})}exports.isCssAnimation=v.isCssAnimation;exports.isMultiSpring=v.isMultiSpring;exports.isSingleSpring=v.isSingleSpring;exports.isTickAnimation=v.isTickAnimation;exports.normalizeMultiSpringSchedule=v.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=v.normalizeToMultiSpring;exports.validateAnimationMode=v.validateAnimationMode;exports.validateSpringItem=v.validateSpringItem;exports.jaeminInternal=Z.jaeminInternal;exports.SCOPE_ATTR=F;exports.SCOPE_READY_ATTR=z;exports.TRANSITION_STRATEGY=x;exports.createDefaultStrategy=$;exports.createPageTransitionStrategy=K;exports.createSggoiTransitionContext=vt;exports.createTransitionScope=ct;exports.findScope=U;exports.generateAutoKey=B;exports.isScopeReady=W;exports.transition=mt;
|
package/dist/index.js
CHANGED
|
@@ -30,9 +30,9 @@ class G {
|
|
|
30
30
|
i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = e;
|
|
31
31
|
const r = e - this.startTime, o = r - this.nextTime;
|
|
32
32
|
if (o > 0) {
|
|
33
|
-
const
|
|
33
|
+
const c = i / 1e3;
|
|
34
34
|
this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
|
|
35
|
-
a(
|
|
35
|
+
a(c, this.elapsed);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
|
|
@@ -74,9 +74,9 @@ function z(n) {
|
|
|
74
74
|
return { omega: r, zeta: o };
|
|
75
75
|
}
|
|
76
76
|
function q(n, e, t, i) {
|
|
77
|
-
const { omega: r, zeta: o } = t, { position:
|
|
77
|
+
const { omega: r, zeta: o } = t, { position: c, velocity: a } = n, s = Math.min(i, 0.033), l = -2 * s * o * r * a, f = s * r * r * (e - c), w = a + l + f;
|
|
78
78
|
return {
|
|
79
|
-
position:
|
|
79
|
+
position: c + s * w,
|
|
80
80
|
velocity: w
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -92,45 +92,45 @@ function Q(n) {
|
|
|
92
92
|
spring: i,
|
|
93
93
|
velocity: r = 0,
|
|
94
94
|
onUpdate: o,
|
|
95
|
-
onComplete:
|
|
95
|
+
onComplete: c,
|
|
96
96
|
onStart: a
|
|
97
97
|
} = n;
|
|
98
|
-
let
|
|
98
|
+
let s = { position: e, velocity: r }, l = !0, f = 0, w = !1;
|
|
99
99
|
const u = z(i), h = (p) => {
|
|
100
100
|
if (l) {
|
|
101
|
-
if (w || (w = !0, a == null || a()),
|
|
101
|
+
if (w || (w = !0, a == null || a()), s = q(s, t, u, p), N(s, t)) {
|
|
102
102
|
if (f += Math.min(p, 0.033), f >= H) {
|
|
103
|
-
|
|
103
|
+
s = { position: t, velocity: 0 }, l = !1, o(s.position), x.unsubscribe(h), c();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
} else
|
|
107
107
|
f = 0;
|
|
108
|
-
o(
|
|
108
|
+
o(s.position);
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
return x.subscribe(h), {
|
|
112
112
|
stop: () => {
|
|
113
113
|
l && (l = !1, x.unsubscribe(h));
|
|
114
114
|
},
|
|
115
|
-
getPosition: () =>
|
|
116
|
-
getVelocity: () =>
|
|
115
|
+
getPosition: () => s.position,
|
|
116
|
+
getVelocity: () => s.velocity,
|
|
117
117
|
isRunning: () => l
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
const b = 1e3 / 60;
|
|
121
121
|
function Z(n, e, t, i = 0) {
|
|
122
122
|
const r = z(t), o = 600;
|
|
123
|
-
let
|
|
124
|
-
const
|
|
123
|
+
let c = { position: n, velocity: i }, a = 0;
|
|
124
|
+
const s = [];
|
|
125
125
|
for (let l = 0; l < o; l++) {
|
|
126
126
|
const f = l * b;
|
|
127
|
-
if (
|
|
127
|
+
if (s.push({
|
|
128
128
|
time: f,
|
|
129
|
-
position:
|
|
130
|
-
velocity:
|
|
131
|
-
}),
|
|
129
|
+
position: c.position,
|
|
130
|
+
velocity: c.velocity
|
|
131
|
+
}), c = q(c, e, r, b / 1e3), N(c, e)) {
|
|
132
132
|
if (a += b / 1e3, a >= H) {
|
|
133
|
-
|
|
133
|
+
s.push({
|
|
134
134
|
time: (l + 1) * b,
|
|
135
135
|
position: e,
|
|
136
136
|
velocity: 0
|
|
@@ -140,7 +140,7 @@ function Z(n, e, t, i = 0) {
|
|
|
140
140
|
} else
|
|
141
141
|
a = 0;
|
|
142
142
|
}
|
|
143
|
-
return
|
|
143
|
+
return s;
|
|
144
144
|
}
|
|
145
145
|
function D(n, e) {
|
|
146
146
|
if (n.length === 0)
|
|
@@ -155,10 +155,10 @@ function D(n, e) {
|
|
|
155
155
|
const l = Math.floor((r + o) / 2);
|
|
156
156
|
n[l].time <= e ? r = l : o = l;
|
|
157
157
|
}
|
|
158
|
-
const
|
|
158
|
+
const c = n[r], a = n[o], s = (e - c.time) / (a.time - c.time);
|
|
159
159
|
return {
|
|
160
|
-
position:
|
|
161
|
-
velocity:
|
|
160
|
+
position: c.position + (a.position - c.position) * s,
|
|
161
|
+
velocity: c.velocity + (a.velocity - c.velocity) * s
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
function tt(n, e) {
|
|
@@ -171,27 +171,27 @@ function et(n) {
|
|
|
171
171
|
to: i,
|
|
172
172
|
spring: r,
|
|
173
173
|
velocity: o = 0,
|
|
174
|
-
style:
|
|
174
|
+
style: c,
|
|
175
175
|
onComplete: a,
|
|
176
|
-
onStart:
|
|
176
|
+
onStart: s
|
|
177
177
|
} = n, l = Z(t, i, r, o);
|
|
178
178
|
if (l.length === 0)
|
|
179
|
-
return
|
|
179
|
+
return s == null || s(), a(), {
|
|
180
180
|
stop: () => {
|
|
181
181
|
},
|
|
182
182
|
getPosition: () => i,
|
|
183
183
|
getVelocity: () => 0,
|
|
184
184
|
isRunning: () => !1
|
|
185
185
|
};
|
|
186
|
-
const f = tt(l,
|
|
186
|
+
const f = tt(l, c), w = l[l.length - 1], u = w.time, h = e.animate(f, {
|
|
187
187
|
duration: u,
|
|
188
188
|
fill: "forwards",
|
|
189
189
|
easing: "linear"
|
|
190
190
|
// Spring physics already applied in keyframes
|
|
191
191
|
});
|
|
192
192
|
let p = !0;
|
|
193
|
-
const
|
|
194
|
-
return
|
|
193
|
+
const S = performance.now();
|
|
194
|
+
return s == null || s(), h.onfinish = () => {
|
|
195
195
|
p && (p = !1, a());
|
|
196
196
|
}, {
|
|
197
197
|
stop: () => {
|
|
@@ -200,37 +200,37 @@ function et(n) {
|
|
|
200
200
|
getPosition: () => {
|
|
201
201
|
if (!p)
|
|
202
202
|
return w.position;
|
|
203
|
-
const y = performance.now() -
|
|
203
|
+
const y = performance.now() - S;
|
|
204
204
|
return D(l, y).position;
|
|
205
205
|
},
|
|
206
206
|
getVelocity: () => {
|
|
207
207
|
if (!p)
|
|
208
208
|
return 0;
|
|
209
|
-
const y = performance.now() -
|
|
209
|
+
const y = performance.now() - S;
|
|
210
210
|
return D(l, y).velocity;
|
|
211
211
|
},
|
|
212
212
|
isRunning: () => p
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
function it(n) {
|
|
216
|
-
const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart:
|
|
217
|
-
if (a &&
|
|
216
|
+
const { from: e, to: t, spring: i, velocity: r, onComplete: o, onStart: c, tick: a, css: s } = n;
|
|
217
|
+
if (a && s)
|
|
218
218
|
throw new Error("Cannot use both 'tick' and 'css' options together");
|
|
219
|
-
return !a && !
|
|
219
|
+
return !a && !s ? (c == null || c(), o(), {
|
|
220
220
|
stop: () => {
|
|
221
221
|
},
|
|
222
222
|
getPosition: () => t,
|
|
223
223
|
getVelocity: () => 0,
|
|
224
224
|
isRunning: () => !1
|
|
225
|
-
}) :
|
|
226
|
-
element:
|
|
225
|
+
}) : s ? et({
|
|
226
|
+
element: s.element,
|
|
227
227
|
from: e,
|
|
228
228
|
to: t,
|
|
229
229
|
spring: i,
|
|
230
230
|
velocity: r,
|
|
231
|
-
style:
|
|
231
|
+
style: s.style,
|
|
232
232
|
onComplete: o,
|
|
233
|
-
onStart:
|
|
233
|
+
onStart: c
|
|
234
234
|
}) : Q({
|
|
235
235
|
from: e,
|
|
236
236
|
to: t,
|
|
@@ -238,7 +238,7 @@ function it(n) {
|
|
|
238
238
|
velocity: r,
|
|
239
239
|
onUpdate: a,
|
|
240
240
|
onComplete: o,
|
|
241
|
-
onStart:
|
|
241
|
+
onStart: c
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
class Y {
|
|
@@ -335,10 +335,9 @@ class P extends Y {
|
|
|
335
335
|
d(this, "direction", "forward");
|
|
336
336
|
d(this, "idCounter", 0);
|
|
337
337
|
d(this, "rafId", null);
|
|
338
|
-
d(this, "element");
|
|
339
338
|
d(this, "from");
|
|
340
339
|
d(this, "to");
|
|
341
|
-
this.config = t.config, this.from = t.from, this.to = t.to, this.
|
|
340
|
+
this.config = t.config, this.from = t.from, this.to = t.to, this.initializeAnimators();
|
|
342
341
|
}
|
|
343
342
|
generateId() {
|
|
344
343
|
return `spring_${this.idCounter++}`;
|
|
@@ -350,7 +349,7 @@ class P extends Y {
|
|
|
350
349
|
to: this.to,
|
|
351
350
|
spring: t.spring,
|
|
352
351
|
tick: t.tick,
|
|
353
|
-
css: t.css
|
|
352
|
+
css: t.css,
|
|
354
353
|
onComplete: () => this.onAnimatorComplete(i),
|
|
355
354
|
onStart: t.onStart
|
|
356
355
|
});
|
|
@@ -379,9 +378,9 @@ class P extends Y {
|
|
|
379
378
|
return this.direction === "forward" ? this.springOrder : [...this.springOrder].reverse();
|
|
380
379
|
}
|
|
381
380
|
onAnimatorComplete(t) {
|
|
382
|
-
var r, o,
|
|
381
|
+
var r, o, c, a, s, l;
|
|
383
382
|
const i = this.animators.get(t);
|
|
384
|
-
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (
|
|
383
|
+
!i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (a = (c = this.config).onProgress) == null || a.call(c, this.completedCount, this.config.springs.length), this.completedCount === this.config.springs.length && (this.stopScheduler(), (l = (s = this.config).onEnd) == null || l.call(s)));
|
|
385
384
|
}
|
|
386
385
|
/**
|
|
387
386
|
* Check and start springs based on previous spring's progress
|
|
@@ -396,10 +395,10 @@ class P extends Y {
|
|
|
396
395
|
this.startAnimator(r);
|
|
397
396
|
continue;
|
|
398
397
|
}
|
|
399
|
-
const
|
|
398
|
+
const c = t[i - 1], a = this.animators.get(c);
|
|
400
399
|
if (!a || !a.started) continue;
|
|
401
|
-
const
|
|
402
|
-
|
|
400
|
+
const s = this.getAnimatorProgress(a), l = o.item.normalizedOffset;
|
|
401
|
+
s >= l && this.startAnimator(r);
|
|
403
402
|
}
|
|
404
403
|
}
|
|
405
404
|
startAnimator(t) {
|
|
@@ -447,19 +446,19 @@ class P extends Y {
|
|
|
447
446
|
return;
|
|
448
447
|
const i = t.animator.getCurrentState();
|
|
449
448
|
if (i.position === i.to) {
|
|
450
|
-
const o =
|
|
449
|
+
const o = I.fromState(
|
|
451
450
|
{ position: this.to, velocity: 0 },
|
|
452
451
|
{
|
|
453
452
|
from: this.to,
|
|
454
453
|
to: this.from,
|
|
455
454
|
spring: t.item.spring,
|
|
456
455
|
tick: t.item.tick,
|
|
457
|
-
css:
|
|
456
|
+
css: t.item.css,
|
|
458
457
|
onComplete: () => this.onAnimatorComplete(t.id),
|
|
459
458
|
onStart: t.item.onStart
|
|
460
459
|
}
|
|
461
460
|
);
|
|
462
|
-
|
|
461
|
+
o.forward(), t.animator = o;
|
|
463
462
|
} else
|
|
464
463
|
t.animator.reverse();
|
|
465
464
|
});
|
|
@@ -626,7 +625,7 @@ const X = Symbol.for("TRANSITION_STRATEGY"), nt = (n) => ({
|
|
|
626
625
|
direction: "forward"
|
|
627
626
|
}
|
|
628
627
|
}), $ = "data-ssgoi-scope", j = "data-ssgoi-scope-ready";
|
|
629
|
-
function
|
|
628
|
+
function vt() {
|
|
630
629
|
return (n) => {
|
|
631
630
|
if (n)
|
|
632
631
|
return n.setAttribute($, ""), queueMicrotask(() => {
|
|
@@ -646,19 +645,19 @@ function st(n) {
|
|
|
646
645
|
function ct(n, e) {
|
|
647
646
|
var w;
|
|
648
647
|
let t = null, i = null, r = null, o = null;
|
|
649
|
-
const
|
|
648
|
+
const c = {
|
|
650
649
|
get currentAnimation() {
|
|
651
650
|
return t;
|
|
652
651
|
}
|
|
653
|
-
}, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e,
|
|
652
|
+
}, a = ((w = e == null ? void 0 : e.strategy) == null ? void 0 : w.call(e, c)) || nt(c), s = async (u) => {
|
|
654
653
|
var E;
|
|
655
654
|
i && (i.remove(), i = null);
|
|
656
|
-
const h = n(), p = h.in && h.in(u),
|
|
655
|
+
const h = n(), p = h.in && h.in(u), S = !(e != null && e.strategy) && h.out ? h.out(u) : void 0;
|
|
657
656
|
if (!p)
|
|
658
657
|
return;
|
|
659
658
|
const y = {
|
|
660
659
|
in: V(p),
|
|
661
|
-
out:
|
|
660
|
+
out: S ? V(S) : void 0
|
|
662
661
|
}, m = await a.runIn(y);
|
|
663
662
|
if (!m.config) {
|
|
664
663
|
t && (t.direction = "in");
|
|
@@ -666,28 +665,30 @@ function ct(n, e) {
|
|
|
666
665
|
}
|
|
667
666
|
const g = m.config;
|
|
668
667
|
(E = g.prepare) == null || E.call(g, u), g.wait && await g.wait();
|
|
669
|
-
const C = F(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
668
|
+
const C = F(
|
|
669
|
+
{
|
|
670
|
+
...g,
|
|
671
|
+
onEnd: () => {
|
|
672
|
+
var A;
|
|
673
|
+
t = null, (A = g.onEnd) == null || A.call(g);
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
u
|
|
677
|
+
), v = P.fromState(m.state, {
|
|
676
678
|
config: C,
|
|
677
679
|
from: m.from,
|
|
678
|
-
to: m.to
|
|
679
|
-
element: u
|
|
680
|
+
to: m.to
|
|
680
681
|
});
|
|
681
|
-
t = { controller:
|
|
682
|
+
t = { controller: v, direction: "in" }, m.direction === "forward" ? v.forward() : v.backward();
|
|
682
683
|
}, l = async (u) => {
|
|
683
684
|
var A;
|
|
684
685
|
i = u;
|
|
685
|
-
const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0,
|
|
686
|
-
if (!
|
|
686
|
+
const h = n(), p = !(e != null && e.strategy) && h.in ? h.in(u) : void 0, S = h.out && h.out(u);
|
|
687
|
+
if (!S)
|
|
687
688
|
return;
|
|
688
689
|
const y = {
|
|
689
690
|
in: p ? V(p) : void 0,
|
|
690
|
-
out: V(
|
|
691
|
+
out: V(S)
|
|
691
692
|
}, m = await a.runOut(y);
|
|
692
693
|
if (!m.config) {
|
|
693
694
|
t && (t.direction = "out"), i && (i.remove(), i = null);
|
|
@@ -695,19 +696,21 @@ function ct(n, e) {
|
|
|
695
696
|
}
|
|
696
697
|
const g = m.config;
|
|
697
698
|
(A = g.prepare) == null || A.call(g, u), E(), g.wait && await g.wait();
|
|
698
|
-
const C = F(
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
699
|
+
const C = F(
|
|
700
|
+
{
|
|
701
|
+
...g,
|
|
702
|
+
onEnd: () => {
|
|
703
|
+
var T, O;
|
|
704
|
+
(T = g.onEnd) == null || T.call(g), i && (i.remove(), i = null), t = null, (O = e == null ? void 0 : e.onCleanupEnd) == null || O.call(e);
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
u
|
|
708
|
+
), v = P.fromState(m.state, {
|
|
705
709
|
config: C,
|
|
706
710
|
from: m.from,
|
|
707
|
-
to: m.to
|
|
708
|
-
element: u
|
|
711
|
+
to: m.to
|
|
709
712
|
});
|
|
710
|
-
t = { controller:
|
|
713
|
+
t = { controller: v, direction: "out" }, m.direction === "forward" ? v.forward() : v.backward();
|
|
711
714
|
function E() {
|
|
712
715
|
!r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
|
|
713
716
|
}
|
|
@@ -716,8 +719,8 @@ function ct(n, e) {
|
|
|
716
719
|
return (u) => {
|
|
717
720
|
if (u)
|
|
718
721
|
return r = u.parentElement, o = u.nextElementSibling, (e == null ? void 0 : e.scope) === "local" ? queueMicrotask(() => {
|
|
719
|
-
f = st(u), !(f && !rt(f)) &&
|
|
720
|
-
}) :
|
|
722
|
+
f = st(u), !(f && !rt(f)) && s(u);
|
|
723
|
+
}) : s(u), () => {
|
|
721
724
|
const h = u.isConnected ? u.cloneNode(!0) : u;
|
|
722
725
|
f ? queueMicrotask(() => {
|
|
723
726
|
document.contains(f) && l(h);
|
|
@@ -733,8 +736,8 @@ const at = 3, lt = (n) => {
|
|
|
733
736
|
const i = e[t], r = i == null ? void 0 : i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);
|
|
734
737
|
if (!r)
|
|
735
738
|
continue;
|
|
736
|
-
const o = r[1] ?? "",
|
|
737
|
-
return { file: o.split(/[\\/]/).pop() || o, line:
|
|
739
|
+
const o = r[1] ?? "", c = r[2] ?? "0", a = r[3] ?? "0";
|
|
740
|
+
return { file: o.split(/[\\/]/).pop() || o, line: c, column: a };
|
|
738
741
|
}
|
|
739
742
|
return null;
|
|
740
743
|
}, R = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
@@ -803,22 +806,22 @@ function dt(n) {
|
|
|
803
806
|
}
|
|
804
807
|
function mt(n) {
|
|
805
808
|
let e = !1, t = 0, i = 0, r = !1;
|
|
806
|
-
const o = 50,
|
|
809
|
+
const o = 50, c = (p) => {
|
|
807
810
|
if (!n) return;
|
|
808
|
-
const
|
|
809
|
-
|
|
811
|
+
const S = p.touches[0];
|
|
812
|
+
S && (r = S.clientX < o, r && (t = S.clientX, i = S.clientY));
|
|
810
813
|
}, a = (p) => {
|
|
811
814
|
if (!n || !r) return;
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
814
|
-
const y =
|
|
815
|
+
const S = p.touches[0];
|
|
816
|
+
if (!S) return;
|
|
817
|
+
const y = S.clientX - t, m = S.clientY - i;
|
|
815
818
|
y > window.outerWidth / 2 - 5 && Math.abs(y) > Math.abs(m) ? e = !0 : e = !1;
|
|
816
|
-
},
|
|
819
|
+
}, s = () => {
|
|
817
820
|
n && (r = !1, t = 0, i = 0);
|
|
818
821
|
}, l = () => e, f = () => {
|
|
819
|
-
typeof window > "u" || n && (window.addEventListener("touchstart",
|
|
822
|
+
typeof window > "u" || n && (window.addEventListener("touchstart", c, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
|
|
820
823
|
}, w = () => {
|
|
821
|
-
typeof window > "u" || (window.removeEventListener("touchstart",
|
|
824
|
+
typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", s));
|
|
822
825
|
};
|
|
823
826
|
let u = 0;
|
|
824
827
|
return {
|
|
@@ -905,9 +908,9 @@ function At(n) {
|
|
|
905
908
|
// Default to true - skip animations on iOS swipe
|
|
906
909
|
} = n;
|
|
907
910
|
let o = null;
|
|
908
|
-
const
|
|
911
|
+
const c = dt(e), {
|
|
909
912
|
initializeContext: a,
|
|
910
|
-
calculateScrollOffset:
|
|
913
|
+
calculateScrollOffset: s,
|
|
911
914
|
getScrollContainer: l,
|
|
912
915
|
getPositionedParentElement: f,
|
|
913
916
|
getScrollPosition: w
|
|
@@ -921,12 +924,12 @@ function At(n) {
|
|
|
921
924
|
), C = wt(
|
|
922
925
|
y,
|
|
923
926
|
m,
|
|
924
|
-
|
|
925
|
-
) || t,
|
|
927
|
+
c
|
|
928
|
+
) || t, v = s(
|
|
926
929
|
o.from,
|
|
927
930
|
o.to
|
|
928
931
|
), E = {
|
|
929
|
-
scrollOffset:
|
|
932
|
+
scrollOffset: v,
|
|
930
933
|
scroll: w(o.from),
|
|
931
934
|
get scrollingElement() {
|
|
932
935
|
return l() || document.documentElement;
|
|
@@ -935,7 +938,7 @@ function At(n) {
|
|
|
935
938
|
return f();
|
|
936
939
|
}
|
|
937
940
|
}, A = {
|
|
938
|
-
scrollOffset:
|
|
941
|
+
scrollOffset: v,
|
|
939
942
|
get scroll() {
|
|
940
943
|
return o ? w(o.to) : { x: 0, y: 0 };
|
|
941
944
|
},
|
|
@@ -973,7 +976,7 @@ export {
|
|
|
973
976
|
nt as createDefaultStrategy,
|
|
974
977
|
ot as createPageTransitionStrategy,
|
|
975
978
|
At as createSggoiTransitionContext,
|
|
976
|
-
|
|
979
|
+
vt as createTransitionScope,
|
|
977
980
|
st as findScope,
|
|
978
981
|
ft as generateAutoKey,
|
|
979
982
|
Vt as isCssAnimation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;IAC5D,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,GACA,kBAAkB,
|
|
1
|
+
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,CAAC,EAC1C,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;IAC5D,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,GACA,kBAAkB,CAiNpB"}
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function S(n){return("tick"in n||"css"in n)&&!("springs"in n)}function r(n){return"springs"in n}function o(n){return"css"in n&&typeof n.css=="function"}function a(n){return"tick"in n&&typeof n.tick=="function"}function c(n){if(o(n)&&a(n))throw new Error("SingleSpringConfig cannot have both 'tick' and 'css' defined. Use one or the other.")}function l(n){if(n.tick&&n.css)throw new Error("SpringItem cannot have both 'tick' and 'css' defined. Use one or the other.")}async function h(n){const i=await n;return r(i)?(i.springs.forEach(l),i):(c(i),{prepare:i.prepare,wait:i.wait,onStart:i.onStart,onEnd:i.onEnd,springs:[{spring:i.spring,tick:i.tick,css:i.css}],schedule:"parallel"})}function m(n,i){const u=n.schedule??"parallel",p=n.springs.map(s=>{let e;switch(u){case"parallel":e=0;break;case"sequential":e=1;break;case"stagger":e=Math.max(0,Math.min(1,s.offset??0));break;default:e=0}const{css:t,offset:M,...f}=s,g=t?typeof t=="function"?i?{element:i,style:t}:void 0:{element:t.element,style:t.style}:void 0;return{...f,css:g,normalizedOffset:e}}),{schedule:k,...d}=n;return{...d,springs:p}}exports.isCssAnimation=o;exports.isMultiSpring=r;exports.isSingleSpring=S;exports.isTickAnimation=a;exports.normalizeMultiSpringSchedule=m;exports.normalizeToMultiSpring=h;exports.validateAnimationMode=c;exports.validateSpringItem=l;
|