@ssgoi/core 2.5.2 → 2.5.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/animate.d.ts.map +1 -0
- package/dist/{animation-scheduler.d.ts → animator/animation-scheduler.d.ts} +1 -1
- package/dist/animator/animation-scheduler.d.ts.map +1 -0
- package/dist/{animator.d.ts → animator/index.d.ts} +2 -2
- package/dist/animator/index.d.ts.map +1 -0
- package/dist/animator/ticker.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +279 -267
- package/dist/presets/index.cjs +1 -1
- package/dist/presets/index.js +2 -2
- package/dist/ssgoi-transition/create-context-manager.d.ts +18 -0
- package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +46 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -0
- package/dist/ssgoi-transition/create-swipe-detector.d.ts +10 -0
- package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -0
- package/dist/ssgoi-transition/find-matching-transition.d.ts +24 -0
- package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -0
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +7 -0
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +1 -0
- package/dist/ssgoi-transition/types.d.ts +8 -0
- package/dist/ssgoi-transition/types.d.ts.map +1 -0
- package/dist/{create-transition-callback.d.ts → transition/create-transition-callback.d.ts} +1 -1
- package/dist/transition/create-transition-callback.d.ts.map +1 -0
- package/dist/{transition-strategy.d.ts → transition/transition-strategy.d.ts} +1 -1
- package/dist/transition/transition-strategy.d.ts.map +1 -0
- package/dist/{transition.d.ts → transition/transition.d.ts} +1 -1
- package/dist/transition/transition.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/number.d.ts +46 -0
- package/dist/utils/number.d.ts.map +1 -0
- package/dist/view-transitions/drill.d.ts.map +1 -1
- package/dist/view-transitions/fade.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.d.ts +1 -0
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +646 -480
- package/dist/view-transitions/instagram.d.ts +8 -0
- package/dist/view-transitions/instagram.d.ts.map +1 -0
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/dist/view-transitions/scroll.d.ts.map +1 -1
- package/dist/view-transitions/slide.d.ts.map +1 -1
- package/dist/view-transitions/strip.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/animate.d.ts.map +0 -1
- package/dist/animation-scheduler.d.ts.map +0 -1
- package/dist/animator.d.ts.map +0 -1
- package/dist/create-ssgoi-transition-context.d.ts +0 -15
- package/dist/create-ssgoi-transition-context.d.ts.map +0 -1
- package/dist/create-transition-callback.d.ts.map +0 -1
- package/dist/ticker.d.ts.map +0 -1
- package/dist/transition-strategy.d.ts.map +0 -1
- package/dist/transition.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -17
- package/dist/utils.d.ts.map +0 -1
- /package/dist/{animate.d.ts → animator/animate.d.ts} +0 -0
- /package/dist/{ticker.d.ts → animator/ticker.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../../src/lib/animator/animate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,iBAAiB,CAgFlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation-scheduler.d.ts","sourceRoot":"","sources":["../../src/lib/animator/animation-scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAGjB,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAYlB;;;;;;;;;;GAUG;AACH,qBAAa,kBAAkB,CAAC,eAAe,GAAG,MAAM,CACtD,YAAW,mBAAmB,CAAC,MAAM,CAAC;IAEtC,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,SAAS,CAA0D;IAC3E,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,UAAU,CAAgB;gBAEtB,MAAM,EAAE,iBAAiB,CAAC,eAAe,CAAC;IAKtD,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;IAsB3B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IA+EzB,OAAO,CAAC,kBAAkB;IA4B1B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkC9B,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,qBAAqB;IAqB7B,OAAO,IAAI,IAAI;IAiCf,QAAQ,IAAI,IAAI;IAiChB,IAAI,IAAI,IAAI;IAYZ,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;KAAE,GAAG,IAAI;IAoD5E,eAAe,IAAI,cAAc,CAAC,MAAM,CAAC;CAQ1C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpringConfig, AnimationController, AnimationState } from '
|
|
1
|
+
import { SpringConfig, AnimationController, AnimationState } from '../types';
|
|
2
2
|
export interface AnimationOptions<TAnimationValue = number> {
|
|
3
3
|
from: TAnimationValue;
|
|
4
4
|
to: TAnimationValue;
|
|
@@ -44,4 +44,4 @@ export declare class Animator<TAnimationValue = number> implements AnimationCont
|
|
|
44
44
|
velocity: TAnimationValue extends number ? number : Record<string, number>;
|
|
45
45
|
}, newOptions: Partial<AnimationOptions<TAnimationValue>>): Animator<TAnimationValue>;
|
|
46
46
|
}
|
|
47
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/animator/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,gBAAgB,CAAC,eAAe,GAAG,MAAM;IACxD,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,qBAAa,QAAQ,CAAC,eAAe,GAAG,MAAM,CAC5C,YAAW,mBAAmB,CAAC,eAAe,CAAC;IAE/C,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,QAAQ,CAEW;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAqC;IAGrD,OAAO,CAAC,YAAY,CAAkD;IACtE,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,iBAAiB,CAAqB;gBAElC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IA2B/D,OAAO,CAAC,OAAO,CA+Fb;IAEF,OAAO,CAAC,aAAa,CAoHnB;IAGF,OAAO,IAAI,IAAI;IAKf,QAAQ,IAAI,IAAI;IAKhB,OAAO,IAAI,IAAI;IAcf,OAAO,CAAC,aAAa;IAYrB,IAAI,IAAI,IAAI;IAyBZ,WAAW,IAAI,eAAe,SAAS,MAAM,GACzC,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI1B,eAAe,IAAI,eAAe;IAIlC,cAAc,IAAI,OAAO;IAIzB,eAAe,IAAI,cAAc,CAAC,eAAe,CAAC;IAWlD,WAAW,CACT,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACzE,IAAI;IAIP,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAKtC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GAAG,IAAI;IAY3E,MAAM,CAAC,SAAS,CAAC,eAAe,GAAG,MAAM,EACvC,KAAK,EAAE;QACL,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GACpC,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5B,EACD,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GACrD,QAAQ,CAAC,eAAe,CAAC;CAM7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../../src/lib/animator/ticker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEnE,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,SAAS,CAAS;IAG1B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,OAAO,CAAK;IAGpB,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,WAAW,CAAM;IAGzB,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,QAAQ,CAAY;IAE5B,OAAO,CAAC,IAAI,CAmCV;IAEF,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;IAe/C,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAW3C;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAK1D;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB,gBAAgB,IAAI,MAAM;IAI1B,UAAU,IAAI,MAAM;CAGrB;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var F=Object.defineProperty;var H=(n,t,e)=>t in n?F(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var d=(n,t,e)=>H(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./types.cjs"),W=require("./jaemin-DL1-g_B5.cjs");class q{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,"gap",1e3/240);d(this,"nextTime",this.gap);d(this,"tick",()=>{const t=Date.now();let e=t-this.lastUpdate;(e>this.lagThreshold||e<0)&&(this.startTime+=e-this.adjustedLag,e=this.adjustedLag),this.lastUpdate=t;const i=t-this.startTime,r=i-this.nextTime;if(r>0){const o=e/1e3;this.elapsed=i/1e3,this.nextTime+=r+(r>=this.gap?4:this.gap-r),this.listeners.forEach(s=>{s(o,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(t){return this.listeners.add(t),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(t)}}unsubscribe(t){this.listeners.delete(t),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(t,e){this.lagThreshold=t,this.adjustedLag=Math.min(e,t)}fps(t){this.gap=1e3/t,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const x=new q;function k(n){const{from:t,to:e,stiffness:i,damping:r,mass:o,velocity:s=0,onUpdate:m,onComplete:l}=n;let h=t,u=s,a=!0;const p=Math.sqrt(i/o),c=r/(2*Math.sqrt(i*o)),S=.01,w=.01;let f=0;const g=.05,v=A=>{if(!a)return;const E=Math.min(A,.033),y=-2*E*c*p*u,b=E*p*p*(e-h);u+=y+b,h+=E*u;const T=Math.abs(e-h),C=Math.abs(u);if(T<S&&C<w){if(f+=E,f>=g){h=e,u=0,a=!1,m(h),x.unsubscribe(v),l();return}}else f=0;m(h)};return x.subscribe(v),{stop:()=>{a&&(a=!1,x.unsubscribe(v))}}}class O{constructor(t){d(this,"options");d(this,"currentValue");d(this,"velocity");d(this,"isAnimating",!1);d(this,"controls",null);d(this,"animationMap",null);d(this,"activeAnimations",new Set);d(this,"completedAnimations",new Set);d(this,"updatedProperties",new Set);d(this,"animate",(t=!1)=>{!this.isAnimating&&this.options.onStart&&this.options.onStart(),this.isAnimating=!0;const e=t?this.options.from:this.options.to;if(typeof this.currentValue=="object"&&this.currentValue!==null){this.animateObject(e);return}let i=this.currentValue,r=performance.now();const o={from:this.currentValue,to:e,stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="number"&&(o.velocity=this.velocity*1e3),this.controls=k({...o,onUpdate:s=>{const m=performance.now(),l=(m-r)/1e3;if(l>0){if(typeof s=="number"&&typeof i=="number"){const h=(s-i)/l;this.velocity=h/1e3}else if(typeof s=="object"&&s!==null){const h={};Object.keys(s).forEach(u=>{const a=s[u],p=i[u];if(typeof a=="number"&&typeof p=="number"){const c=(a-p)/l;h[u]=c/1e3}}),this.velocity=h}i=s,r=m}this.currentValue=s,this.options.onUpdate(s)},onComplete:()=>{this.currentValue=e,this.isAnimating=!1,this.controls=null,typeof this.velocity=="object"&&this.velocity!==null?Object.keys(this.velocity).forEach(s=>{this.velocity[s]=0}):this.velocity=0,this.options.onComplete()}})});d(this,"animateObject",t=>{const e=this.currentValue,i=Object.keys(e);this.animationMap=new Map,this.activeAnimations.clear(),this.completedAnimations.clear(),this.updatedProperties.clear();const r={...e},o={};let s=!1;const m=()=>{const l=i.filter(u=>!this.completedAnimations.has(u));if(l.every(u=>this.updatedProperties.has(u))&&l.length>0){if(typeof this.velocity=="object"&&this.velocity){const u=performance.now();Object.keys(r).forEach(a=>{if(o[a]){const p=(u-o[a])/1e3,c=this.currentValue[a],S=r[a];typeof c=="number"&&typeof S=="number"&&p>0&&(this.velocity[a]=(S-c)/p/1e3)}o[a]=u})}this.currentValue={...r},this.options.onUpdate(this.currentValue),this.updatedProperties.clear(),!s&&this.options.onStart&&(s=!0,this.options.onStart())}};i.forEach(l=>{this.activeAnimations.add(l);const h={from:e[l],to:t[l],stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="object"&&this.velocity&&l in this.velocity&&(h.velocity=this.velocity[l]*1e3);const u=k({...h,onUpdate:a=>{r[l]=a,this.updatedProperties.add(l),m()},onComplete:()=>{this.completedAnimations.add(l),this.updatedProperties.delete(l),this.completedAnimations.size===i.length&&(this.currentValue=t,this.isAnimating=!1,this.animationMap=null,typeof this.velocity=="object"&&this.velocity&&Object.keys(this.velocity).forEach(a=>{this.velocity[a]=0}),this.options.onComplete())}});this.animationMap.set(l,u)})});if(this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:100,damping:10},onUpdate:t.onUpdate??(()=>{}),onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from,typeof this.options.from=="object"&&this.options.from!==null){const e={};Object.keys(this.options.from).forEach(i=>{e[i]=0}),this.velocity=e}else this.velocity=0}forward(){this.stop(),this.animate(!1)}backward(){this.stop(),this.animate(!0)}reverse(){const t=this.options.from;if(this.options.from=this.options.to,this.options.to=t,this.isAnimating){const e=this.shouldReverse();this.stop(),this.animate(!e)}}shouldReverse(){return typeof this.currentValue=="number"&&typeof this.options.from=="number"&&typeof this.options.to=="number"?this.currentValue>(this.options.from+this.options.to)/2:!1}stop(){this.isAnimating=!1,this.controls&&(this.controls.stop(),this.controls=null),this.animationMap&&(this.animationMap.forEach(t=>{t.stop()}),this.animationMap.clear(),this.animationMap=null),this.updatedProperties.clear()}getVelocity(){return this.velocity}getCurrentValue(){return this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{type:"single",position:this.currentValue,velocity:this.velocity,from:this.options.from,to:this.options.to}}setVelocity(t){this.velocity=t}setValue(t){this.currentValue=t}updateOptions(t){if(this.options={...this.options,...t},this.isAnimating&&this.controls){const e=this.shouldReverse();this.stop(),this.animate(!e)}}static fromState(t,e){const i=new O(e);return i.setValue(t.position),i.setVelocity(t.velocity),i}}class U{constructor(t){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,"timeoutIds",[]);this.config=t,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const e=this.generateId(),i=new O({from:t.from,to:t.to,spring:t.spring,onUpdate:t.tick,onComplete:()=>this.onAnimatorComplete(e),onStart:t.onStart});this.animators.set(e,{id:e,item:t,animator:i,startTime:null}),this.springOrder.push(e)})}normalizeSchedule(t){const e=this.config.schedule??"overlap";return this.springOrder.map((i,r)=>{const o=this.animators.get(i);if(!o)throw new Error(`AnimationScheduler: animator with id "${i}" not found during normalization`);if(e==="overlap")return{type:"offset",id:i,delay:0};if(e==="wait")return t==="forward"&&r===0?{type:"offset",id:i,delay:0}:t==="backward"&&r===this.springOrder.length-1?{type:"offset",id:i,delay:0}:{type:"wait",id:i};const s=o.item.offset??0;if(t==="forward")return{type:"offset",id:i,delay:s};const m=this.animators.size===0?0:Math.max(...Array.from(this.animators.values()).map(l=>l.item.offset??0));return{type:"offset",id:i,delay:m-s}})}onAnimatorComplete(t){var i,r,o,s,m,l;const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on completion`);return}this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(r=(i=e.item).onComplete)==null||r.call(i),(s=(o=this.config).onProgress)==null||s.call(o,this.completedCount,this.config.springs.length),this.handleWaitModeChaining(t),this.completedCount===this.config.springs.length&&((l=(m=this.config).onEnd)==null||l.call(m)))}handleWaitModeChaining(t){if(this.config.schedule!=="wait")return;const e=this.springOrder.indexOf(t);if(this.direction==="forward"){const o=this.springOrder[e+1];if(!o)return;const s=this.animators.get(o);s&&s.startTime===null&&this.startAnimator(o);return}const i=this.springOrder[e-1];if(!i)return;const r=this.animators.get(i);r&&r.startTime===null&&this.startBackwardAnimator(i)}startAnimator(t){const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on start`);return}if(e.startTime!==null){console.warn(`AnimationScheduler: animator with id "${t}" already started`);return}e.startTime=Date.now(),e.animator.forward()}startBackwardAnimator(t){const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on backward start`);return}if(e.startTime!==null){console.warn(`AnimationScheduler: animator with id "${t}" already started`);return}e.startTime=Date.now(),e.animator.backward()}forward(){var e,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),(i=(e=this.config).onStart)==null||i.call(e),this.normalizeSchedule("forward").forEach(r=>{if(r.type==="wait")return;if(r.delay===0){this.startAnimator(r.id);return}const o=window.setTimeout(()=>this.startAnimator(r.id),r.delay);this.timeoutIds.push(o)})}backward(){var e,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),(i=(e=this.config).onStart)==null||i.call(e),this.normalizeSchedule("backward").forEach(r=>{if(r.type==="wait")return;if(r.delay===0){this.startBackwardAnimator(r.id);return}const o=window.setTimeout(()=>this.startBackwardAnimator(r.id),r.delay);this.timeoutIds.push(o)})}stop(){this.timeoutIds.forEach(t=>clearTimeout(t)),this.timeoutIds=[],this.animators.forEach(t=>{t.animator.stop(),t.startTime=null})}reverse(t){((t==null?void 0:t.offsetMode)??"immediate")!=="immediate"&&console.warn('AnimationScheduler.reverse(): Only "immediate" offsetMode is currently supported. Falling back to "immediate".'),this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(i=>{if(i.startTime===null)return;const r=i.animator.getCurrentState();if(r.type!=="single")return;if(r.position===r.to){const s=O.fromState({position:1,velocity:0},{from:i.item.to??1,to:i.item.from??0,spring:i.item.spring,onUpdate:i.item.tick,onComplete:()=>this.onAnimatorComplete(i.id),onStart:i.item.onStart});s.forward(),i.animator=s;return}i.animator.reverse()})}getCurrentState(){return{type:"multi",completed:this.completedCount,total:this.config.springs.length,direction:this.direction}}}const j=Symbol.for("TRANSITION_STRATEGY"),L=n=>({runIn:async t=>{const{currentAnimation:e}=n;if(e&&e.direction==="out"){const s=e.controller.getCurrentState();if(e.controller.stop(),s.type==="multi")return e.controller.reverse(),{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if(t.out){const m=await t.out,{from:l=1,to:h=0}=m;return{config:m,state:{position:s.position,velocity:s.velocity},from:l,to:h,direction:"backward"}}}const i=await t.in;if(!i)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in i)return{config:i,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:r=0,to:o=1}=i;return{config:i,state:{position:r,velocity:0},from:r,to:o,direction:"forward"}},runOut:async t=>{const{currentAnimation:e}=n;if(e&&e.direction==="in"){const s=e.controller.getCurrentState();if(e.controller.stop(),s.type==="multi")return e.controller.reverse(),{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if(t.in){const m=await t.in,{from:l=0,to:h=1}=m;return{config:m,state:{position:s.position,velocity:s.velocity},from:l,to:h,direction:"backward"}}}const i=await t.out;if(!i)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in i)return{config:i,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:r=1,to:o=0}=i;return{config:i,state:{position:r,velocity:0},from:r,to:o,direction:"forward"}}}),_=()=>({runIn:async n=>{const t=await n.in;if(!t)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in t)return{config:t,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:e=0,to:i=1}=t;return{config:t,state:{position:e,velocity:0},from:e,to:i,direction:"forward"}},runOut:async n=>{const t=await n.out;if(!t)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in t)return{config:t,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:e=1,to:i=0}=t;return{config:t,state:{position:e,velocity:0},from:e,to:i,direction:"forward"}}});function K(n,t){var u;let e=null,i=null,r=null,o=null;const s={get currentAnimation(){return e}},m=((u=t==null?void 0:t.strategy)==null?void 0:u.call(t,s))||L(s),l=async a=>{var v,A,E;i&&(i.remove(),i=null);const p=n(),c=p.in&&await p.in(a),S=!(t!=null&&t.strategy)&&p.out?await p.out(a):void 0;if(!c)return;if(I.isMultiSpring(c)){const y={in:Promise.resolve(c),out:S&&Promise.resolve(S)};if(!(await m.runIn(y)).config){e&&(e.direction="in");return}(v=c.prepare)==null||v.call(c,a),c.wait&&await c.wait();const T=new U({...c,onEnd:()=>{var C;e=null,(C=c.onEnd)==null||C.call(c)}});e={controller:T,direction:"in"},T.forward();return}const w={in:Promise.resolve(c),out:S&&Promise.resolve(S)},f=await m.runIn(w);if(!f.config)return;if("springs"in f.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(E=(A=f.config).prepare)==null||E.call(A,a),f.config.wait&&await f.config.wait();const g=O.fromState(f.state,{from:f.from,to:f.to,spring:f.config.spring,onStart:f.config.onStart,onUpdate:f.config.tick,onComplete:()=>{var y,b;e=null,(b=(y=f.config)==null?void 0:y.onEnd)==null||b.call(y)}});e={controller:g,direction:"in"},f.direction==="forward"?g.forward():g.backward()},h=async a=>{var v,A,E;i=a;const p=n(),c=p.out&&await p.out(a);if(!c)return;if(I.isMultiSpring(c)){const y={in:void 0,out:Promise.resolve(c)};if(!(await m.runOut(y)).config){e&&(e.direction="out"),i&&(i.remove(),i=null);return}(v=c.prepare)==null||v.call(c,a),g(),c.wait&&await c.wait();const T=new U({...c,onEnd:()=>{var C,M;(C=c.onEnd)==null||C.call(c),i&&(i.remove(),i=null),e=null,(M=t==null?void 0:t.onCleanupEnd)==null||M.call(t)}});e={controller:T,direction:"out"},T.forward();return}const S={in:void 0,out:Promise.resolve(c)},w=await m.runOut(S);if(!w.config)return;if("springs"in w.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(E=(A=w.config).prepare)==null||E.call(A,a),g(),w.config.wait&&await w.config.wait();const f=O.fromState(w.state,{from:w.from,to:w.to,spring:w.config.spring,onStart:w.config.onStart,onUpdate:w.config.tick,onComplete:()=>{var y,b,T;(b=(y=w.config)==null?void 0:y.onEnd)==null||b.call(y),i&&(i.remove(),i=null),e=null,(T=t==null?void 0:t.onCleanupEnd)==null||T.call(t)}});e={controller:f,direction:"out"},w.direction==="forward"?f.forward():f.backward();function g(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};return a=>{if(a)return r=a.parentElement,o=a.nextElementSibling,l(a),()=>{const p=a.cloneNode(!0);h(p)}}}const B=3,Y=n=>{if(!n)return null;const t=n.split(`
|
|
2
|
-
`).map(e=>e.trim());for(let e=
|
|
1
|
+
"use strict";var N=Object.defineProperty;var F=(n,t,e)=>t in n?N(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var m=(n,t,e)=>F(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./types.cjs"),Y=require("./jaemin-DL1-g_B5.cjs");class W{constructor(){m(this,"listeners",new Set);m(this,"rafId",null);m(this,"isRunning",!1);m(this,"startTime",Date.now());m(this,"lastUpdate",this.startTime);m(this,"elapsed",0);m(this,"lagThreshold",500);m(this,"adjustedLag",33);m(this,"gap",1e3/240);m(this,"nextTime",this.gap);m(this,"tick",()=>{const t=Date.now();let e=t-this.lastUpdate;(e>this.lagThreshold||e<0)&&(this.startTime+=e-this.adjustedLag,e=this.adjustedLag),this.lastUpdate=t;const i=t-this.startTime,o=i-this.nextTime;if(o>0){const r=e/1e3;this.elapsed=i/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(s=>{s(r,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(t){return this.listeners.add(t),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(t)}}unsubscribe(t){this.listeners.delete(t),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(t,e){this.lagThreshold=t,this.adjustedLag=Math.min(e,t)}fps(t){this.gap=1e3/t,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const R=new W;function k(n){const{from:t,to:e,stiffness:i,damping:o,mass:r,velocity:s=0,onUpdate:d,onComplete:l}=n;let h=t,u=s,a=!0;const p=Math.sqrt(i/r),c=o/(2*Math.sqrt(i*r)),g=.01,w=.01;let f=0;const y=.05,S=T=>{if(!a)return;const A=Math.min(T,.033),v=-2*A*c*p*u,b=A*p*p*(e-h);u+=v+b,h+=A*u;const E=Math.abs(e-h),C=Math.abs(u);if(E<g&&C<w){if(f+=A,f>=y){h=e,u=0,a=!1,d(h),R.unsubscribe(S),l();return}}else f=0;d(h)};return R.subscribe(S),{stop:()=>{a&&(a=!1,R.unsubscribe(S))}}}class O{constructor(t){m(this,"options");m(this,"currentValue");m(this,"velocity");m(this,"isAnimating",!1);m(this,"controls",null);m(this,"animationMap",null);m(this,"activeAnimations",new Set);m(this,"completedAnimations",new Set);m(this,"updatedProperties",new Set);m(this,"animate",(t=!1)=>{!this.isAnimating&&this.options.onStart&&this.options.onStart(),this.isAnimating=!0;const e=t?this.options.from:this.options.to;if(typeof this.currentValue=="object"&&this.currentValue!==null){this.animateObject(e);return}let i=this.currentValue,o=performance.now();const r={from:this.currentValue,to:e,stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="number"&&(r.velocity=this.velocity*1e3),this.controls=k({...r,onUpdate:s=>{const d=performance.now(),l=(d-o)/1e3;if(l>0){if(typeof s=="number"&&typeof i=="number"){const h=(s-i)/l;this.velocity=h/1e3}else if(typeof s=="object"&&s!==null){const h={};Object.keys(s).forEach(u=>{const a=s[u],p=i[u];if(typeof a=="number"&&typeof p=="number"){const c=(a-p)/l;h[u]=c/1e3}}),this.velocity=h}i=s,o=d}this.currentValue=s,this.options.onUpdate(s)},onComplete:()=>{this.currentValue=e,this.isAnimating=!1,this.controls=null,typeof this.velocity=="object"&&this.velocity!==null?Object.keys(this.velocity).forEach(s=>{this.velocity[s]=0}):this.velocity=0,this.options.onComplete()}})});m(this,"animateObject",t=>{const e=this.currentValue,i=Object.keys(e);this.animationMap=new Map,this.activeAnimations.clear(),this.completedAnimations.clear(),this.updatedProperties.clear();const o={...e},r={};let s=!1;const d=()=>{const l=i.filter(u=>!this.completedAnimations.has(u));if(l.every(u=>this.updatedProperties.has(u))&&l.length>0){if(typeof this.velocity=="object"&&this.velocity){const u=performance.now();Object.keys(o).forEach(a=>{if(r[a]){const p=(u-r[a])/1e3,c=this.currentValue[a],g=o[a];typeof c=="number"&&typeof g=="number"&&p>0&&(this.velocity[a]=(g-c)/p/1e3)}r[a]=u})}this.currentValue={...o},this.options.onUpdate(this.currentValue),this.updatedProperties.clear(),!s&&this.options.onStart&&(s=!0,this.options.onStart())}};i.forEach(l=>{this.activeAnimations.add(l);const h={from:e[l],to:t[l],stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="object"&&this.velocity&&l in this.velocity&&(h.velocity=this.velocity[l]*1e3);const u=k({...h,onUpdate:a=>{o[l]=a,this.updatedProperties.add(l),d()},onComplete:()=>{this.completedAnimations.add(l),this.updatedProperties.delete(l),this.completedAnimations.size===i.length&&(this.currentValue=t,this.isAnimating=!1,this.animationMap=null,typeof this.velocity=="object"&&this.velocity&&Object.keys(this.velocity).forEach(a=>{this.velocity[a]=0}),this.options.onComplete())}});this.animationMap.set(l,u)})});if(this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:100,damping:10},onUpdate:t.onUpdate??(()=>{}),onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from,typeof this.options.from=="object"&&this.options.from!==null){const e={};Object.keys(this.options.from).forEach(i=>{e[i]=0}),this.velocity=e}else this.velocity=0}forward(){this.stop(),this.animate(!1)}backward(){this.stop(),this.animate(!0)}reverse(){const t=this.options.from;if(this.options.from=this.options.to,this.options.to=t,this.isAnimating){const e=this.shouldReverse();this.stop(),this.animate(!e)}}shouldReverse(){return typeof this.currentValue=="number"&&typeof this.options.from=="number"&&typeof this.options.to=="number"?this.currentValue>(this.options.from+this.options.to)/2:!1}stop(){this.isAnimating=!1,this.controls&&(this.controls.stop(),this.controls=null),this.animationMap&&(this.animationMap.forEach(t=>{t.stop()}),this.animationMap.clear(),this.animationMap=null),this.updatedProperties.clear()}getVelocity(){return this.velocity}getCurrentValue(){return this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{type:"single",position:this.currentValue,velocity:this.velocity,from:this.options.from,to:this.options.to}}setVelocity(t){this.velocity=t}setValue(t){this.currentValue=t}updateOptions(t){if(this.options={...this.options,...t},this.isAnimating&&this.controls){const e=this.shouldReverse();this.stop(),this.animate(!e)}}static fromState(t,e){const i=new O(e);return i.setValue(t.position),i.setVelocity(t.velocity),i}}class L{constructor(t){m(this,"config");m(this,"animators",new Map);m(this,"springOrder",[]);m(this,"completedCount",0);m(this,"completedAnimators",new Set);m(this,"direction","forward");m(this,"idCounter",0);m(this,"timeoutIds",[]);this.config=t,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const e=this.generateId(),i=new O({from:t.from,to:t.to,spring:t.spring,onUpdate:t.tick,onComplete:()=>this.onAnimatorComplete(e),onStart:t.onStart});this.animators.set(e,{id:e,item:t,animator:i,startTime:null}),this.springOrder.push(e)})}normalizeSchedule(t){const e=this.config.schedule??"overlap";return this.springOrder.map((i,o)=>{const r=this.animators.get(i);if(!r)throw new Error(`AnimationScheduler: animator with id "${i}" not found during normalization`);if(e==="overlap")return{type:"offset",id:i,delay:0};if(e==="wait")return t==="forward"&&o===0?{type:"offset",id:i,delay:0}:t==="backward"&&o===this.springOrder.length-1?{type:"offset",id:i,delay:0}:{type:"wait",id:i};const s=r.item.offset??0;if(t==="forward")return{type:"offset",id:i,delay:s};const d=this.animators.size===0?0:Math.max(...Array.from(this.animators.values()).map(l=>l.item.offset??0));return{type:"offset",id:i,delay:d-s}})}onAnimatorComplete(t){var i,o,r,s,d,l;const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on completion`);return}this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(i=e.item).onComplete)==null||o.call(i),(s=(r=this.config).onProgress)==null||s.call(r,this.completedCount,this.config.springs.length),this.handleWaitModeChaining(t),this.completedCount===this.config.springs.length&&((l=(d=this.config).onEnd)==null||l.call(d)))}handleWaitModeChaining(t){if(this.config.schedule!=="wait")return;const e=this.springOrder.indexOf(t);if(this.direction==="forward"){const r=this.springOrder[e+1];if(!r)return;const s=this.animators.get(r);s&&s.startTime===null&&this.startAnimator(r);return}const i=this.springOrder[e-1];if(!i)return;const o=this.animators.get(i);o&&o.startTime===null&&this.startBackwardAnimator(i)}startAnimator(t){const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on start`);return}if(e.startTime!==null){console.warn(`AnimationScheduler: animator with id "${t}" already started`);return}e.startTime=Date.now(),e.animator.forward()}startBackwardAnimator(t){const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on backward start`);return}if(e.startTime!==null){console.warn(`AnimationScheduler: animator with id "${t}" already started`);return}e.startTime=Date.now(),e.animator.backward()}forward(){var e,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),(i=(e=this.config).onStart)==null||i.call(e),this.normalizeSchedule("forward").forEach(o=>{if(o.type==="wait")return;if(o.delay===0){this.startAnimator(o.id);return}const r=window.setTimeout(()=>this.startAnimator(o.id),o.delay);this.timeoutIds.push(r)})}backward(){var e,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),(i=(e=this.config).onStart)==null||i.call(e),this.normalizeSchedule("backward").forEach(o=>{if(o.type==="wait")return;if(o.delay===0){this.startBackwardAnimator(o.id);return}const r=window.setTimeout(()=>this.startBackwardAnimator(o.id),o.delay);this.timeoutIds.push(r)})}stop(){this.timeoutIds.forEach(t=>clearTimeout(t)),this.timeoutIds=[],this.animators.forEach(t=>{t.animator.stop(),t.startTime=null})}reverse(t){((t==null?void 0:t.offsetMode)??"immediate")!=="immediate"&&console.warn('AnimationScheduler.reverse(): Only "immediate" offsetMode is currently supported. Falling back to "immediate".'),this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(i=>{if(i.startTime===null)return;const o=i.animator.getCurrentState();if(o.type!=="single")return;if(o.position===o.to){const s=O.fromState({position:1,velocity:0},{from:i.item.to??1,to:i.item.from??0,spring:i.item.spring,onUpdate:i.item.tick,onComplete:()=>this.onAnimatorComplete(i.id),onStart:i.item.onStart});s.forward(),i.animator=s;return}i.animator.reverse()})}getCurrentState(){return{type:"multi",completed:this.completedCount,total:this.config.springs.length,direction:this.direction}}}const j=Symbol.for("TRANSITION_STRATEGY"),z=n=>({runIn:async t=>{const{currentAnimation:e}=n;if(e&&e.direction==="out"){const s=e.controller.getCurrentState();if(e.controller.stop(),s.type==="multi")return e.controller.reverse(),{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if(t.out){const d=await t.out,{from:l=1,to:h=0}=d;return{config:d,state:{position:s.position,velocity:s.velocity},from:l,to:h,direction:"backward"}}}const i=await t.in;if(!i)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in i)return{config:i,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:o=0,to:r=1}=i;return{config:i,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}},runOut:async t=>{const{currentAnimation:e}=n;if(e&&e.direction==="in"){const s=e.controller.getCurrentState();if(e.controller.stop(),s.type==="multi")return e.controller.reverse(),{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if(t.in){const d=await t.in,{from:l=0,to:h=1}=d;return{config:d,state:{position:s.position,velocity:s.velocity},from:l,to:h,direction:"backward"}}}const i=await t.out;if(!i)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in i)return{config:i,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:o=1,to:r=0}=i;return{config:i,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}}}),_=()=>({runIn:async n=>{const t=await n.in;if(!t)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in t)return{config:t,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:e=0,to:i=1}=t;return{config:t,state:{position:e,velocity:0},from:e,to:i,direction:"forward"}},runOut:async n=>{const t=await n.out;if(!t)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in t)return{config:t,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:e=1,to:i=0}=t;return{config:t,state:{position:e,velocity:0},from:e,to:i,direction:"forward"}}});function X(n,t){var u;let e=null,i=null,o=null,r=null;const s={get currentAnimation(){return e}},d=((u=t==null?void 0:t.strategy)==null?void 0:u.call(t,s))||z(s),l=async a=>{var S,T,A;i&&(i.remove(),i=null);const p=n(),c=p.in&&await p.in(a),g=!(t!=null&&t.strategy)&&p.out?p.out(a):void 0;if(!c)return;if(M.isMultiSpring(c)){const v={in:Promise.resolve(c),out:g&&Promise.resolve(g)};if(!(await d.runIn(v)).config){e&&(e.direction="in");return}(S=c.prepare)==null||S.call(c,a),c.wait&&await c.wait();const E=new L({...c,onEnd:()=>{var C;e=null,(C=c.onEnd)==null||C.call(c)}});e={controller:E,direction:"in"},E.forward();return}const w={in:Promise.resolve(c),out:g&&Promise.resolve(g)},f=await d.runIn(w);if(!f.config)return;if("springs"in f.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(A=(T=f.config).prepare)==null||A.call(T,a),f.config.wait&&await f.config.wait();const y=O.fromState(f.state,{from:f.from,to:f.to,spring:f.config.spring,onStart:f.config.onStart,onUpdate:f.config.tick,onComplete:()=>{var v,b;e=null,(b=(v=f.config)==null?void 0:v.onEnd)==null||b.call(v)}});e={controller:y,direction:"in"},f.direction==="forward"?y.forward():y.backward()},h=async a=>{var S,T,A;i=a;const p=n(),c=p.out&&await p.out(a);if(!c)return;if(M.isMultiSpring(c)){const v={in:void 0,out:Promise.resolve(c)};if(!(await d.runOut(v)).config){e&&(e.direction="out"),i&&(i.remove(),i=null);return}(S=c.prepare)==null||S.call(c,a),y(),c.wait&&await c.wait();const E=new L({...c,onEnd:()=>{var C,I;(C=c.onEnd)==null||C.call(c),i&&(i.remove(),i=null),e=null,(I=t==null?void 0:t.onCleanupEnd)==null||I.call(t)}});e={controller:E,direction:"out"},E.forward();return}const g={in:void 0,out:Promise.resolve(c)},w=await d.runOut(g);if(!w.config)return;if("springs"in w.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(A=(T=w.config).prepare)==null||A.call(T,a),y(),w.config.wait&&await w.config.wait();const f=O.fromState(w.state,{from:w.from,to:w.to,spring:w.config.spring,onStart:w.config.onStart,onUpdate:w.config.tick,onComplete:()=>{var v,b,E;(b=(v=w.config)==null?void 0:v.onEnd)==null||b.call(v),i&&(i.remove(),i=null),e=null,(E=t==null?void 0:t.onCleanupEnd)==null||E.call(t)}});e={controller:f,direction:"out"},w.direction==="forward"?f.forward():f.backward();function y(){!o||!i||(r&&o.contains(r)?o.insertBefore(i,r):o.appendChild(i))}};return a=>{if(a)return o=a.parentElement,r=a.nextElementSibling,l(a),()=>{if(a.isConnected){const p=a.cloneNode(!0);h(p)}else h(a)}}}const q=3,K=n=>{if(!n)return null;const t=n.split(`
|
|
2
|
+
`).map(e=>e.trim());for(let e=q;e<Math.min(t.length,6);e++){const i=t[e],o=i==null?void 0:i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!o)continue;const r=o[1]??"",s=o[2]??"0",d=o[3]??"0";return{file:r.split(/[\\/]/).pop()||r,line:s,column:d}}return null},x=new Map,V=new Map;function B(n,t,e){x.set(n,t);let i=V.get(n);return i||(i=X(()=>{const o=x.get(n);return o||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:e,onCleanupEnd:()=>$(n)}),V.set(n,i),i)}function $(n){x.delete(n),V.delete(n)}function H(){const n=K(new Error().stack);return n?`auto_${n.file}_${n.line}_${n.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const D=globalThis.FinalizationRegistry,U=D?new D(n=>{try{$(n)}catch{}}):void 0;function G(n){const t=n.key??H();if(n.ref&&U)try{U.register(n.ref,t)}catch{}return B(t,{in:n.in,out:n.out},n[j])}function J(n){const t=n.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...n,...t]}function Q(n){let t=!1,e=0,i=0,o=!1;const r=50,s=50,d=c=>{if(!n)return;const g=c.touches[0];g&&(o=g.clientX<s,o&&(e=g.clientX,i=g.clientY))},l=c=>{if(!n||!o||t)return;const g=c.touches[0];if(!g)return;const w=g.clientX-e,f=g.clientY-i;w>r&&Math.abs(w)>Math.abs(f)&&(t=!0,setTimeout(()=>{t=!1},500))},h=()=>{n&&(o=!1,e=0,i=0)};return{initialize:()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",d,{passive:!0}),window.addEventListener("touchmove",l,{passive:!0}),window.addEventListener("touchend",h,{passive:!0}))},cleanup:()=>{typeof window>"u"||(window.removeEventListener("touchstart",d),window.removeEventListener("touchmove",l),window.removeEventListener("touchend",h))},isSwipePending:()=>t}}const Z=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t),i=e.overflow+e.overflowY+e.overflowX;if(i.includes("auto")||i.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement},tt=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return t;t=t.parentElement}return document.body};function et(){let n=null,t=null;const e=new Map;let i=null;const o=()=>{n&&i&&e.set(i,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(u,a)=>{t=u,n||(n=Z(u),(n===document.documentElement?window:n).addEventListener("scroll",o,{passive:!0})),i=a},calculateScrollOffset:(u,a)=>{const p=u&&e.has(u)?e.get(u):{x:0,y:0},c=a&&e.has(a)?e.get(a):{x:0,y:0};return{x:-c.x+p.x,y:-c.y+p.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>t?tt(t):document.body,getScrollPosition:u=>u&&e.has(u)?e.get(u):{x:0,y:0}}}function P(n,t){if(t==="*")return!0;if(t.endsWith("/*")){const e=t.slice(0,-2);return n===e||n.startsWith(e+"/")}return n===t}function it(n,t,e){for(const i of e)if(P(n,i.from)&&P(t,i.to))return i.transition;for(const i of e)if((i.from==="*"||P(n,i.from))&&(i.to==="*"||P(t,i.to)))return i.transition;return null}function nt(n){const{transitions:t=[],defaultTransition:e,middleware:i=(f,y)=>({from:f,to:y}),skipOnIosSwipe:o=!0}=n;let r=null;const s=J(t),{initializeContext:d,calculateScrollOffset:l,getScrollContainer:h,getPositionedParentElement:u,getScrollPosition:a}=et(),p=Q(o);p.initialize();function c(){if(r!=null&&r.from&&(r!=null&&r.to)){const{from:f,to:y}=i(r.from,r.to),T=it(f,y,s)||e,A=l(r.from,r.to),v={scrollOffset:A,scroll:a(r.from),get scrollingElement(){return h()||document.documentElement},get positionedParent(){return u()}},b={scrollOffset:A,get scroll(){return r?a(r.to):{x:0,y:0}},get scrollingElement(){return h()||document.documentElement},get positionedParent(){return u()}};T&&(T.out&&r.outResolve&&r.outResolve(E=>T.out(E,v)),T.in&&r.inResolve&&r.inResolve(E=>T.in(E,b))),r=null}}const g=async(f,y)=>p.isSwipePending()?()=>({}):y==="in"&&(!r||!r.from)?()=>({}):(r||(r={}),y==="out"?(r.from=f,new Promise(S=>{r.outResolve=S,c()})):(r.to=f,new Promise(S=>{r.inResolve=S,c()})));return f=>({key:f,in:async y=>(d(y,f),(await g(f,"in"))(y)),out:async y=>(await g(f,"out"))(y),[j]:_})}exports.isMultiSpring=M.isMultiSpring;exports.isSingleSpring=M.isSingleSpring;exports.jaeminInternal=Y.jaeminInternal;exports.TRANSITION_STRATEGY=j;exports.createDefaultStrategy=z;exports.createPageTransitionStrategy=_;exports.createSggoiTransitionContext=nt;exports.generateAutoKey=H;exports.transition=G;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './types';
|
|
2
|
-
export * from './transition';
|
|
3
|
-
export * from './create-ssgoi-transition-context';
|
|
4
|
-
export * from './transition-strategy';
|
|
2
|
+
export * from './transition/transition';
|
|
3
|
+
export * from './ssgoi-transition/create-ssgoi-transition-context';
|
|
4
|
+
export * from './transition/transition-strategy';
|
|
5
5
|
export { jaeminInternal } from './view-transitions/jaemin';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oDAAoD,CAAC;AACnE,cAAc,kCAAkC,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|