@ssgoi/core 4.3.0 → 4.3.1

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.
@@ -27,9 +27,9 @@ export declare class RunnerProvider {
27
27
  * Get bound runner based on animation mode
28
28
  *
29
29
  * @param options Animation mode options (tick or css)
30
- * @returns Bound runner function or null if no animation mode specified
30
+ * @returns Bound runner function (empty runner if no animation mode specified)
31
31
  * @throws Error if both tick and css are provided
32
32
  */
33
- static from(options: RunnerOptions): BoundRunner | null;
33
+ static from(options: RunnerOptions): BoundRunner;
34
34
  }
35
35
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/runner/provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,CAAC;AAE7E,qBAAa,cAAc;IACzB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW,GAAG,IAAI;CA0BxD"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/runner/provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,CAAC;AAqB7E,qBAAa,cAAc;IACzB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW;CA0BjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"single-animator.d.ts","sourceRoot":"","sources":["../../src/lib/animator/single-animator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/D,OA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IAAI;IAWf,IAAI,IAAI,IAAI;IAWZ,WAAW,IAAI,MAAM;IAIrB,eAAe,IAAI,MAAM;IAIzB,cAAc,IAAI,OAAO;IAIzB,eAAe,IAAI,cAAc;IASjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;CAG1D"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var st=Object.defineProperty;var at=(e,n,t)=>n in e?st(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var m=(e,n,t)=>at(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./types.cjs"),z=require("./provider-Cs5iBqRD.cjs");class ct{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,"maxDeltaTime",33);m(this,"gap",1e3/240);m(this,"nextTime",this.gap);m(this,"tick",()=>{const n=Date.now();let i=n-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=n;const r=n-this.startTime,o=r-this.nextTime;if(o>0){const c=i/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(a=>{a(c,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(n){return this.listeners.add(n),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(n)}}unsubscribe(n){this.listeners.delete(n),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(n,t){this.lagThreshold=n,this.adjustedLag=Math.min(t,n)}fps(n){this.gap=1e3/n,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const N=new ct;function lt(e){const{integrator:n,from:t,to:i,velocity:r=0,onUpdate:o,onComplete:c,onStart:a}=e;let s={position:t,velocity:r},u=!0,h=0,p=!1;const w=S=>{if(u){if(p||(p=!0,a==null||a()),s=n.step(s,i,S),n.isSettled(s,i)){if(h+=Math.min(S,.033),h>=z.SETTLE_THRESHOLD){s={position:i,velocity:0},u=!1,o(s.position),N.unsubscribe(w),c();return}}else h=0;o(s.position)}};return N.subscribe(w),{stop:()=>{u&&(u=!1,N.unsubscribe(w))},getPosition:()=>s.position,getVelocity:()=>s.velocity,isRunning:()=>u}}const F=1e3/60;function ut(e,n,t,i=0){let o={position:n,velocity:i},c=0;const a=[];for(let s=0;s<600;s++){const u=s*F;if(a.push({time:u,position:o.position,velocity:o.velocity}),o=e.step(o,t,F/1e3),e.isSettled(o,t)){if(c+=F/1e3,c>=z.SETTLE_THRESHOLD){a.push({time:(s+1)*F,position:t,velocity:0});break}}else c=0}return a}function G(e,n){if(e.length===0)return{position:0,velocity:0};const t=e[0],i=e[e.length-1];if(n<=0)return{position:t.position,velocity:t.velocity};if(n>=i.time)return{position:i.position,velocity:i.velocity};let r=0,o=e.length-1;for(;r<o-1;){const u=Math.floor((r+o)/2);e[u].time<=n?r=u:o=u}const c=e[r],a=e[o],s=(n-c.time)/(a.time-c.time);return{position:c.position+(a.position-c.position)*s,velocity:c.velocity+(a.velocity-c.velocity)*s}}function ft(e,n){return e.map(t=>n(t.position))}function mt(e){const{integrator:n,element:t,from:i,to:r,velocity:o=0,style:c,onComplete:a,onStart:s}=e,u=ut(n,i,r,o);if(u.length===0)return s==null||s(),a(),{stop:()=>{},getPosition:()=>r,getVelocity:()=>0,isRunning:()=>!1};const h=ft(u,c),p=u[u.length-1],w=p.time,S=h[0];if(S)for(const y of Object.keys(S))t.style[y]="";const d=t.animate(h,{duration:w,fill:"forwards",easing:"linear",composite:"replace"});let l=!0;const A=performance.now();return s==null||s(),d.onfinish=()=>{l&&(l=!1,a())},{stop:()=>{l&&(l=!1,d.cancel())},getPosition:()=>{if(!l)return p.position;const y=performance.now()-A;return G(u,y).position},getVelocity:()=>{if(!l)return 0;const y=performance.now()-A;return G(u,y).velocity},isRunning:()=>l}}class dt{static from(n){const{tick:t,css:i}=n;if(t&&i)throw new Error("Cannot use both 'tick' and 'css' options together");return i?r=>mt({...r,element:i.element,style:i.style}):t?r=>lt({...r,onUpdate:t}):null}}class J{}const ht={stiffness:300,damping:30};class $ extends J{constructor(t){super();m(this,"options");m(this,"runner");m(this,"controls",null);m(this,"isAnimating",!1);m(this,"currentValue");m(this,"currentVelocity",0);m(this,"updateFn");if(this.options={from:t.from??0,to:t.to??1,physics:t.physics,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from,t.tick)this.updateFn=i=>{var r;return(r=t.tick)==null?void 0:r.call(t,i)};else if(t.css){const{element:i,style:r}=t.css;this.updateFn=o=>{const c=r(o);for(const[a,s]of Object.entries(c))i.style[a]=typeof s=="number"?String(s):s}}else this.updateFn=()=>{};this.runner=dt.from({tick:t.tick,css:t.css})}syncState(){var t;(t=this.updateFn)==null||t.call(this,this.currentValue)}createIntegrator(){const t=this.options.physics;return t!=null&&t.integrator?t.integrator():t!=null&&t.spring||t!=null&&t.inertia?z.IntegratorProvider.from({spring:t.spring,inertia:t.inertia}):new z.SpringIntegrator(ht)}runAnimation(t){var i,r;if(this.isAnimating=!0,!this.runner){(r=(i=this.options).onStart)==null||r.call(i),this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.options.onComplete();return}this.controls=this.runner({integrator:this.createIntegrator(),from:this.currentValue,to:t,velocity:this.currentVelocity,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}}}class D extends J{constructor(t){super();m(this,"config");m(this,"animators",new Map);m(this,"itemOrder",[]);m(this,"completedCount",0);m(this,"completedAnimators",new Set);m(this,"direction","forward");m(this,"idCounter",0);m(this,"rafId",null);m(this,"from");m(this,"to");m(this,"initialState");this.config=t.config,this.from=t.from,this.to=t.to,this.initialState=t.state??{position:t.from,velocity:0},this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.items.forEach((t,i)=>{const r=this.generateId(),o=new $({from:this.from,to:this.to,physics:t.physics,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(r),onStart:t.onStart});(i===0||t.normalizedOffset===0)&&(o.setValue(this.initialState.position),o.setVelocity(this.initialState.velocity),o.syncState()),this.animators.set(r,{id:r,item:t,animator:o,started:!1}),this.itemOrder.push(r)})}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.itemOrder:[...this.itemOrder].reverse()}onAnimatorComplete(t){var r,o,c,a,s,u;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),(a=(c=this.config).onProgress)==null||a.call(c,this.completedCount,this.config.items.length),this.completedCount===this.config.items.length&&(this.stopScheduler(),(u=(s=this.config).onEnd)==null||u.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 c=t[i-1],a=this.animators.get(c);if(!a||!a.started)continue;const s=this.getAnimatorProgress(a),u=o.item.normalizedOffset;s>=u&&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.itemOrder[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=new $({from:this.to,to:this.from,physics:t.item.physics,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.setValue(this.to),o.setVelocity(0),o.syncState(),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){return new D({...i,state:t})}}const W=Symbol.for("TRANSITION_STRATEGY"),Q=e=>({runIn:async n=>{const{currentAnimation:t}=e;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.out)return{config:await n.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}return 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=>{const{currentAnimation:t}=e;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.in)return{config:await n.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}return 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"}}}),Z=()=>({runIn:async e=>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=>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"}}),j="data-ssgoi-scope",X="data-ssgoi-scope-ready";function gt(){return e=>{if(e)return e.setAttribute(j,""),queueMicrotask(()=>{queueMicrotask(()=>{e.setAttribute(X,"true")})}),()=>{}}}function tt(e){return e.hasAttribute(X)}function et(e){return e.closest(`[${j}]`)}const pt=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.parentElement}return document.documentElement},wt=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return n;n=n.parentElement}return document.body};function K(e){return new Promise(n=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})})}function yt(e,n){var S;let t=null,i=null,r=null,o=null;const c={get currentAnimation(){return t}},a=((S=n==null?void 0:n.strategy)==null?void 0:S.call(n,c))||Q(c),s=async d=>{var k;i&&(i.remove(),i=null);const l=e(),A=l.in&&l.in(d),y=!(n!=null&&n.strategy)&&l.out?l.out(d):void 0;if(!A)return;const V={in:C.normalizeToMultiAnimation(A),out:y?C.normalizeToMultiAnimation(y):void 0},g=await a.runIn(V);if(!g.config){t&&(t.direction="in");return}const f=g.config;(k=f.prepare)==null||k.call(f);const v=C.normalizeSchedule({...f,onEnd:()=>{var R;t=null,(R=f.onEnd)==null||R.call(f)}},d);f.wait&&await f.wait();const T=D.fromState(g.state,{config:v,from:g.from,to:g.to});t={controller:T,direction:"in"},await K(),g.direction==="forward"?T.forward():T.backward()},u=async d=>{var R;i=d;const l=e(),A=!(n!=null&&n.strategy)&&l.in?l.in(d):void 0,y=l.out&&l.out(d);if(!y)return;const V={in:A?C.normalizeToMultiAnimation(A):void 0,out:C.normalizeToMultiAnimation(y)},g=await a.runOut(V);if(!g.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const f=g.config;k(),(R=f.prepare)==null||R.call(f);const v=C.normalizeSchedule({...f,onEnd:()=>{var P,I;(P=f.onEnd)==null||P.call(f),i&&(i.remove(),i=null),t=null,(I=n==null?void 0:n.onCleanupEnd)==null||I.call(n)}},d);f.wait&&await f.wait();const T=D.fromState(g.state,{config:v,from:g.from,to:g.to});t={controller:T,direction:"out"},await K(),g.direction==="forward"?T.forward():T.backward();function k(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};let h=null,p=!1;const w=d=>()=>{if(p)return;p=!0;const l=d.cloneNode(!0);h?queueMicrotask(()=>{document.contains(h)&&u(l)}):u(l)};return d=>{if(d)return requestAnimationFrame(()=>{r=d.parentElement,o=d.nextElementSibling}),p=!1,(n==null?void 0:n.scope)==="local"?queueMicrotask(()=>{h=et(d),!(h&&!tt(h))&&s(d)}):s(d),w(d)}}const b=new Map;let E=null,U=!1;function it(e){if(e instanceof HTMLElement&&b.has(e)){const t=b.get(e);b.delete(e),queueMicrotask(()=>{t()})}const n=e.childNodes;for(let t=0;t<n.length;t++){const i=n[t];i&&it(i)}}function St(){U||typeof document>"u"||(U=!0,E=new MutationObserver(e=>{for(const n of e){const t=n.removedNodes;for(let i=0;i<t.length;i++){const r=t[i];r&&it(r)}}}),document.body?E.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{E==null||E.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}function nt(e,n){St(),b.set(e,n)}function vt(e){return b.has(e)}function At(){return b.size}function Ct(e){const n=b.get(e);return n?(b.delete(e),n(),!0):!1}function Tt(){b.clear(),E==null||E.disconnect(),E=null,U=!1}const x=new Map,H=new Map,Y=new Map;function Et(e,n,t){x.set(e,n);let i=H.get(e);if(i)return i;const r=n;return i=yt(()=>{const o=x.get(e);return o||(console.warn(`Transition "${String(e)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{x.get(e)===r&&bt(e)}}),H.set(e,i),i}function bt(e){x.delete(e),H.delete(e),Y.delete(e)}function kt(e,n="manual"){const t=Et(e.key,{in:e.in,out:e.out},{strategy:e[W],scope:e.scope});if(n==="manual")return t;let i=Y.get(e.key);return i||(i=r=>{if(r){const o=t(r);o&&nt(r,o)}},Y.set(e.key,i),i)}function Rt(e){const n=e.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...e,...n]}function Pt(e){let n=!1,t=0,i=0,r=!1;const o=50,c=d=>{if(!e)return;const l=d.touches[0];l&&(r=l.clientX<o,r&&(t=l.clientX,i=l.clientY))},a=d=>{if(!e||!r)return;const l=d.touches[0];if(!l)return;const A=l.clientX-t,y=l.clientY-i;A>window.outerWidth/2-5&&Math.abs(A)>Math.abs(y)?n=!0:n=!1},s=()=>{e&&(r=!1,t=0,i=0)},u=()=>n,h=()=>{typeof window>"u"||e&&(window.addEventListener("touchstart",c,{passive:!0}),window.addEventListener("touchmove",a,{passive:!0}),window.addEventListener("touchend",s,{passive:!0}))},p=()=>{typeof window>"u"||(window.removeEventListener("touchstart",c),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",s))};let w=0;return{initialize:h,cleanup:p,isSwipePending:u,resetSwipeDetection:()=>{w++,w>1&&(w=0,n=!1)}}}function Vt(){let e=null,n=null;const t=new Map;let i=null;const r=()=>{e&&i&&t.set(i,{x:e.scrollLeft,y:e.scrollTop})};return{initializeContext:(h,p)=>{n=h,e||(e=pt(h),(e===document.documentElement?window:e).addEventListener("scroll",r,{passive:!0})),i=p},calculateScrollOffset:(h,p)=>{const w=h&&t.has(h)?t.get(h):{x:0,y:0},S=p&&t.has(p)?t.get(p):{x:0,y:0};return{x:-S.x+w.x,y:-S.y+w.y}},getScrollContainer:()=>e,getPositionedParentElement:()=>n?wt(n):document.body,getScrollPosition:h=>h&&t.has(h)?t.get(h):{x:0,y:0}}}function O(e,n){if(n==="*")return!0;if(n.endsWith("/*")){const t=n.slice(0,-2);return e===t||e.startsWith(t+"/")}return e===n}function B(e,n,t){for(const i of t)if(O(e,i.from)&&O(n,i.to))return i.transition;for(const i of t)if((i.from==="*"||O(e,i.from))&&(i.to==="*"||O(n,i.to)))return i.transition;return null}function rt(){let e=null;function n(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){const t={from:e.from,to:e.to};e.outResolve(t),e.inResolve(t),e=null}}return{trigger(t,i){e||(e={}),i==="out"?e.from=t:e.to=t},get(t){return t==="in"&&(!e||!e.from)?Promise.resolve(null):new Promise(i=>{e||(e={}),t==="out"?e.outResolve=i:e.inResolve=i,n()})}}}function ot(){let e=null;function n(){var i,r;e&&((i=e.outResolve)==null||i.call(e,null),(r=e.inResolve)==null||r.call(e,null),e=null)}function t(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){const i={from:e.from,to:e.to};e.outResolve(i),e.inResolve(i),e=null}}return{trigger(i,r){e&&(r==="out"&&e.from&&e.from!==i||r==="in"&&e.to&&e.to!==i)&&n(),e||(e={}),r==="out"?e.from=i:e.to=i},get(i){return new Promise(r=>{e||(e={}),i==="out"?e.outResolve=r:e.inResolve=r,t()})}}}function It(e,n){const{transitions:t=[],defaultTransition:i,middleware:r=(g,f)=>({from:g,to:f}),skipOnIosSwipe:o=!0}=e,{outFirst:c=!0,createNavigationDetector:a}=n||{},s=(a==null?void 0:a())??(c?rt():ot()),u=Rt(t),{initializeContext:h,calculateScrollOffset:p,getScrollContainer:w,getPositionedParentElement:S,getScrollPosition:d}=Vt(),l=Pt(o);l.initialize();const A=async(g,f)=>{if(l.isSwipePending())return l.resetSwipeDetection(),()=>({});s.trigger(g,f);const v=await s.get(f);if(!v)return()=>({});const{from:T,to:k}=r(v.from,v.to),P=B(T,k,u)||i;if(!P)return()=>({});const I=p(v.from,v.to);if(f==="out"){const L={scrollOffset:I,scroll:d(v.from),get scrollingElement(){return w()||document.documentElement},get positionedParent(){return S()}};return M=>P.out(M,L)}else{const L={scrollOffset:I,get scroll(){return d(v.to)},get scrollingElement(){return w()||document.documentElement},get positionedParent(){return S()}};return async M=>{const _=await Promise.resolve(P.in(M,L)),q=_.onStart;return _.onStart=()=>{M.style.visibility="visible",q==null||q()},_}}},y=g=>({key:g,in:async f=>(h(f,g),(await A(g,"in"))(f)),out:async f=>(await A(g,"out"))(f),[W]:Z}),V=(g,f)=>{const{from:v,to:T}=r(g,f);return!!(B(v,T,u)||i)};return a?{getTransition:y,hasMatchingTransition:V}:y}exports.isCssAnimation=C.isCssAnimation;exports.isMultiAnimation=C.isMultiAnimation;exports.isSingleAnimation=C.isSingleAnimation;exports.isTickAnimation=C.isTickAnimation;exports.normalizeSchedule=C.normalizeSchedule;exports.normalizeToMultiAnimation=C.normalizeToMultiAnimation;exports.SCOPE_ATTR=j;exports.SCOPE_READY_ATTR=X;exports.TRANSITION_STRATEGY=W;exports.createAnyOrderDetector=ot;exports.createDefaultStrategy=Q;exports.createOutFirstDetector=rt;exports.createPageTransitionStrategy=Z;exports.createSggoiTransitionContext=It;exports.createTransitionScope=gt;exports.findScope=et;exports.getWatchedCount=At;exports.isScopeReady=tt;exports.isWatched=vt;exports.resetObserver=Tt;exports.transition=kt;exports.triggerUnmount=Ct;exports.watchUnmount=nt;
1
+ "use strict";var st=Object.defineProperty;var at=(e,n,t)=>n in e?st(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var m=(e,n,t)=>at(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./types.cjs"),D=require("./provider-Cs5iBqRD.cjs");class ct{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,"maxDeltaTime",33);m(this,"gap",1e3/240);m(this,"nextTime",this.gap);m(this,"tick",()=>{const n=Date.now();let i=n-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=n;const r=n-this.startTime,o=r-this.nextTime;if(o>0){const l=i/1e3;this.elapsed=r/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(c=>{c(l,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(n){return this.listeners.add(n),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(n)}}unsubscribe(n){this.listeners.delete(n),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(n,t){this.lagThreshold=n,this.adjustedLag=Math.min(t,n)}fps(n){this.gap=1e3/n,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const N=new ct;function lt(e){const{integrator:n,from:t,to:i,velocity:r=0,onUpdate:o,onComplete:l,onStart:c}=e;let s={position:t,velocity:r},f=!0,h=0,p=!1;const w=S=>{if(f){if(p||(p=!0,c==null||c()),s=n.step(s,i,S),n.isSettled(s,i)){if(h+=Math.min(S,.033),h>=D.SETTLE_THRESHOLD){s={position:i,velocity:0},f=!1,o(s.position),N.unsubscribe(w),l();return}}else h=0;o(s.position)}};return N.subscribe(w),{stop:()=>{f&&(f=!1,N.unsubscribe(w))},getPosition:()=>s.position,getVelocity:()=>s.velocity,isRunning:()=>f}}const O=1e3/60;function ut(e,n,t,i=0){let o={position:n,velocity:i},l=0;const c=[];for(let s=0;s<600;s++){const f=s*O;if(c.push({time:f,position:o.position,velocity:o.velocity}),o=e.step(o,t,O/1e3),e.isSettled(o,t)){if(l+=O/1e3,l>=D.SETTLE_THRESHOLD){c.push({time:(s+1)*O,position:t,velocity:0});break}}else l=0}return c}function G(e,n){if(e.length===0)return{position:0,velocity:0};const t=e[0],i=e[e.length-1];if(n<=0)return{position:t.position,velocity:t.velocity};if(n>=i.time)return{position:i.position,velocity:i.velocity};let r=0,o=e.length-1;for(;r<o-1;){const f=Math.floor((r+o)/2);e[f].time<=n?r=f:o=f}const l=e[r],c=e[o],s=(n-l.time)/(c.time-l.time);return{position:l.position+(c.position-l.position)*s,velocity:l.velocity+(c.velocity-l.velocity)*s}}function ft(e,n){return e.map(t=>n(t.position))}function mt(e){const{integrator:n,element:t,from:i,to:r,velocity:o=0,style:l,onComplete:c,onStart:s}=e,f=ut(n,i,r,o);if(f.length===0)return s==null||s(),c(),{stop:()=>{},getPosition:()=>r,getVelocity:()=>0,isRunning:()=>!1};const h=ft(f,l),p=f[f.length-1],w=p.time,S=h[0];if(S)for(const y of Object.keys(S))t.style[y]="";const d=t.animate(h,{duration:w,fill:"forwards",easing:"linear",composite:"replace"});let u=!0;const A=performance.now();return s==null||s(),d.onfinish=()=>{u&&(u=!1,c())},{stop:()=>{u&&(u=!1,d.cancel())},getPosition:()=>{if(!u)return p.position;const y=performance.now()-A;return G(f,y).position},getVelocity:()=>{if(!u)return 0;const y=performance.now()-A;return G(f,y).velocity},isRunning:()=>u}}function dt(e){const{to:n,onStart:t,onComplete:i}=e;return t==null||t(),i(),{stop:()=>{},getPosition:()=>n,getVelocity:()=>0,isRunning:()=>!1}}class ht{static from(n){const{tick:t,css:i}=n;if(t&&i)throw new Error("Cannot use both 'tick' and 'css' options together");return i?r=>mt({...r,element:i.element,style:i.style}):t?r=>lt({...r,onUpdate:t}):dt}}class J{}const gt={stiffness:300,damping:30};class $ extends J{constructor(t){super();m(this,"options");m(this,"runner");m(this,"controls",null);m(this,"isAnimating",!1);m(this,"currentValue");m(this,"currentVelocity",0);m(this,"updateFn");if(this.options={from:t.from??0,to:t.to??1,physics:t.physics,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from,t.tick)this.updateFn=i=>{var r;return(r=t.tick)==null?void 0:r.call(t,i)};else if(t.css){const{element:i,style:r}=t.css;this.updateFn=o=>{const l=r(o);for(const[c,s]of Object.entries(l))i.style[c]=typeof s=="number"?String(s):s}}else this.updateFn=()=>{};this.runner=ht.from({tick:t.tick,css:t.css})}syncState(){var t;(t=this.updateFn)==null||t.call(this,this.currentValue)}createIntegrator(){const t=this.options.physics;return t!=null&&t.integrator?t.integrator():t!=null&&t.spring||t!=null&&t.inertia?D.IntegratorProvider.from({spring:t.spring,inertia:t.inertia}):new D.SpringIntegrator(gt)}runAnimation(t){this.isAnimating=!0,this.controls=this.runner({integrator:this.createIntegrator(),from:this.currentValue,to:t,velocity:this.currentVelocity,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}}}class L extends J{constructor(t){super();m(this,"config");m(this,"animators",new Map);m(this,"itemOrder",[]);m(this,"completedCount",0);m(this,"completedAnimators",new Set);m(this,"direction","forward");m(this,"idCounter",0);m(this,"rafId",null);m(this,"from");m(this,"to");m(this,"initialState");this.config=t.config,this.from=t.from,this.to=t.to,this.initialState=t.state??{position:t.from,velocity:0},this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.items.forEach((t,i)=>{const r=this.generateId(),o=new $({from:this.from,to:this.to,physics:t.physics,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(r),onStart:t.onStart});(i===0||t.normalizedOffset===0)&&(o.setValue(this.initialState.position),o.setVelocity(this.initialState.velocity),o.syncState()),this.animators.set(r,{id:r,item:t,animator:o,started:!1}),this.itemOrder.push(r)})}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.itemOrder:[...this.itemOrder].reverse()}onAnimatorComplete(t){var r,o,l,c,s,f;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=(l=this.config).onProgress)==null||c.call(l,this.completedCount,this.config.items.length),this.completedCount===this.config.items.length&&(this.stopScheduler(),(f=(s=this.config).onEnd)==null||f.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 l=t[i-1],c=this.animators.get(l);if(!c||!c.started)continue;const s=this.getAnimatorProgress(c),f=o.item.normalizedOffset;s>=f&&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.itemOrder[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=new $({from:this.to,to:this.from,physics:t.item.physics,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.setValue(this.to),o.setVelocity(0),o.syncState(),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){return new L({...i,state:t})}}const W=Symbol.for("TRANSITION_STRATEGY"),Q=e=>({runIn:async n=>{const{currentAnimation:t}=e;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.out)return{config:await n.out,state:{position:r,velocity:o},from:1,to:0,direction:"backward"}}return 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=>{const{currentAnimation:t}=e;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),o=t.controller.getVelocity();if(t.controller.stop(),n.in)return{config:await n.in,state:{position:r,velocity:o},from:0,to:1,direction:"backward"}}return 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"}}}),Z=()=>({runIn:async e=>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=>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"}}),j="data-ssgoi-scope",X="data-ssgoi-scope-ready";function pt(){return e=>{if(e)return e.setAttribute(j,""),queueMicrotask(()=>{queueMicrotask(()=>{e.setAttribute(X,"true")})}),()=>{}}}function tt(e){return e.hasAttribute(X)}function et(e){return e.closest(`[${j}]`)}const wt=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.parentElement}return document.documentElement},yt=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return n;n=n.parentElement}return document.body};function K(e){return new Promise(n=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})})}function St(e,n){var S;let t=null,i=null,r=null,o=null;const l={get currentAnimation(){return t}},c=((S=n==null?void 0:n.strategy)==null?void 0:S.call(n,l))||Q(l),s=async d=>{var P,V;i&&(i.remove(),i=null);const u=e(),A=u.in&&u.in(d),y=!(n!=null&&n.strategy)&&u.out?u.out(d):void 0;if(!A)return;const I={in:C.normalizeToMultiAnimation(A),out:y?C.normalizeToMultiAnimation(y):void 0},g=await c.runIn(I);if(!g.config){t&&(t.direction="in");return}const a=g.config;(P=a.prepare)==null||P.call(a);const v=C.normalizeSchedule({...a,onEnd:()=>{var E;t=null,(E=a.onEnd)==null||E.call(a)}},d);a.wait&&await a.wait();const T=L.fromState(g.state,{config:v,from:g.from,to:g.to});t={controller:T,direction:"in"},(V=a.onReady)==null||V.call(a),await K(),g.direction==="forward"?T.forward():T.backward()},f=async d=>{var V,E;i=d;const u=e(),A=!(n!=null&&n.strategy)&&u.in?u.in(d):void 0,y=u.out&&u.out(d);if(!y)return;const I={in:A?C.normalizeToMultiAnimation(A):void 0,out:C.normalizeToMultiAnimation(y)},g=await c.runOut(I);if(!g.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const a=g.config;P(),(V=a.prepare)==null||V.call(a);const v=C.normalizeSchedule({...a,onEnd:()=>{var M,k;(M=a.onEnd)==null||M.call(a),i&&(i.remove(),i=null),t=null,(k=n==null?void 0:n.onCleanupEnd)==null||k.call(n)}},d);a.wait&&await a.wait();const T=L.fromState(g.state,{config:v,from:g.from,to:g.to});t={controller:T,direction:"out"},(E=a.onReady)==null||E.call(a),await K(),g.direction==="forward"?T.forward():T.backward();function P(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};let h=null,p=!1;const w=d=>()=>{if(p)return;p=!0;const u=d.cloneNode(!0);h?queueMicrotask(()=>{document.contains(h)&&f(u)}):f(u)};return d=>{if(d)return requestAnimationFrame(()=>{r=d.parentElement,o=d.nextElementSibling}),p=!1,(n==null?void 0:n.scope)==="local"?queueMicrotask(()=>{h=et(d),!(h&&!tt(h))&&s(d)}):s(d),w(d)}}const R=new Map;let b=null,U=!1;function it(e){if(e instanceof HTMLElement&&R.has(e)){const t=R.get(e);R.delete(e),queueMicrotask(()=>{t()})}const n=e.childNodes;for(let t=0;t<n.length;t++){const i=n[t];i&&it(i)}}function vt(){U||typeof document>"u"||(U=!0,b=new MutationObserver(e=>{for(const n of e){const t=n.removedNodes;for(let i=0;i<t.length;i++){const r=t[i];r&&it(r)}}}),document.body?b.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{b==null||b.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}function nt(e,n){vt(),R.set(e,n)}function At(e){return R.has(e)}function Ct(){return R.size}function Tt(e){const n=R.get(e);return n?(R.delete(e),n(),!0):!1}function Et(){R.clear(),b==null||b.disconnect(),b=null,U=!1}const z=new Map,H=new Map,Y=new Map;function bt(e,n,t){z.set(e,n);let i=H.get(e);if(i)return i;const r=n;return i=St(()=>{const o=z.get(e);return o||(console.warn(`Transition "${String(e)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{z.get(e)===r&&Rt(e)}}),H.set(e,i),i}function Rt(e){z.delete(e),H.delete(e),Y.delete(e)}function kt(e,n="manual"){const t=bt(e.key,{in:e.in,out:e.out},{strategy:e[W],scope:e.scope});if(n==="manual")return t;let i=Y.get(e.key);return i||(i=r=>{if(r){const o=t(r);o&&nt(r,o)}},Y.set(e.key,i),i)}function Pt(e){const n=e.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...e,...n]}function Vt(e){let n=!1,t=0,i=0,r=!1;const o=50,l=d=>{if(!e)return;const u=d.touches[0];u&&(r=u.clientX<o,r&&(t=u.clientX,i=u.clientY))},c=d=>{if(!e||!r)return;const u=d.touches[0];if(!u)return;const A=u.clientX-t,y=u.clientY-i;A>window.outerWidth/2-5&&Math.abs(A)>Math.abs(y)?n=!0:n=!1},s=()=>{e&&(r=!1,t=0,i=0)},f=()=>n,h=()=>{typeof window>"u"||e&&(window.addEventListener("touchstart",l,{passive:!0}),window.addEventListener("touchmove",c,{passive:!0}),window.addEventListener("touchend",s,{passive:!0}))},p=()=>{typeof window>"u"||(window.removeEventListener("touchstart",l),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",s))};let w=0;return{initialize:h,cleanup:p,isSwipePending:f,resetSwipeDetection:()=>{requestAnimationFrame(()=>{w++,w>1&&(w=0,n=!1)})}}}function It(){let e=null,n=null;const t=new Map;let i=null;const r=()=>{e&&i&&t.set(i,{x:e.scrollLeft,y:e.scrollTop})};return{initializeContext:(h,p)=>{n=h,e||(e=wt(h),(e===document.documentElement?window:e).addEventListener("scroll",r,{passive:!0})),i=p},calculateScrollOffset:(h,p)=>{const w=h&&t.has(h)?t.get(h):{x:0,y:0},S=p&&t.has(p)?t.get(p):{x:0,y:0};return{x:-S.x+w.x,y:-S.y+w.y}},getScrollContainer:()=>e,getPositionedParentElement:()=>n?yt(n):document.body,getScrollPosition:h=>h&&t.has(h)?t.get(h):{x:0,y:0}}}function x(e,n){if(n==="*")return!0;if(n.endsWith("/*")){const t=n.slice(0,-2);return e===t||e.startsWith(t+"/")}return e===n}function B(e,n,t){for(const i of t)if(x(e,i.from)&&x(n,i.to))return i.transition;for(const i of t)if((i.from==="*"||x(e,i.from))&&(i.to==="*"||x(n,i.to)))return i.transition;return null}function rt(){let e=null;function n(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){const t={from:e.from,to:e.to};e.outResolve(t),e.inResolve(t),e=null}}return{trigger(t,i){e||(e={}),i==="out"?e.from=t:e.to=t},get(t){return t==="in"&&(!e||!e.from)?Promise.resolve(null):new Promise(i=>{e||(e={}),t==="out"?e.outResolve=i:e.inResolve=i,n()})}}}function ot(){let e=null;function n(){var i,r;e&&((i=e.outResolve)==null||i.call(e,null),(r=e.inResolve)==null||r.call(e,null),e=null)}function t(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){const i={from:e.from,to:e.to};e.outResolve(i),e.inResolve(i),e=null}}return{trigger(i,r){e&&(r==="out"&&e.from&&e.from!==i||r==="in"&&e.to&&e.to!==i)&&n(),e||(e={}),r==="out"?e.from=i:e.to=i},get(i){return new Promise(r=>{e||(e={}),i==="out"?e.outResolve=r:e.inResolve=r,t()})}}}function Mt(e,n){const{transitions:t=[],defaultTransition:i,middleware:r=(g,a)=>({from:g,to:a}),skipOnIosSwipe:o=!0}=e,{outFirst:l=!0,createNavigationDetector:c}=n||{},s=(c==null?void 0:c())??(l?rt():ot()),f=Pt(t),{initializeContext:h,calculateScrollOffset:p,getScrollContainer:w,getPositionedParentElement:S,getScrollPosition:d}=It(),u=Vt(o);u.initialize();const A=async(g,a)=>{if(u.isSwipePending())return u.resetSwipeDetection(),a==="in"?async k=>({onReady:()=>{k.style.visibility="visible"}}):()=>({});s.trigger(g,a);const v=await s.get(a);if(!v)return()=>({});const{from:T,to:P}=r(v.from,v.to),E=B(T,P,f)||i;if(!E)return()=>({});const M=p(v.from,v.to);if(a==="out"){const k={scrollOffset:M,scroll:d(v.from),get scrollingElement(){return w()||document.documentElement},get positionedParent(){return S()}};return F=>E.out(F,k)}else{const k={scrollOffset:M,get scroll(){return d(v.to)},get scrollingElement(){return w()||document.documentElement},get positionedParent(){return S()}};return async F=>{const _=await Promise.resolve(E.in(F,k)),q=_.onReady;return _.onReady=()=>{F.style.visibility="visible",q==null||q()},_}}},y=g=>({key:g,in:async a=>(h(a,g),(await A(g,"in"))(a)),out:async a=>(await A(g,"out"))(a),[W]:Z}),I=(g,a)=>{if(u.isSwipePending())return!1;const{from:v,to:T}=r(g,a);return!!(B(v,T,f)||i)};return c?{getTransition:y,hasMatchingTransition:I}:y}exports.isCssAnimation=C.isCssAnimation;exports.isMultiAnimation=C.isMultiAnimation;exports.isSingleAnimation=C.isSingleAnimation;exports.isTickAnimation=C.isTickAnimation;exports.normalizeSchedule=C.normalizeSchedule;exports.normalizeToMultiAnimation=C.normalizeToMultiAnimation;exports.SCOPE_ATTR=j;exports.SCOPE_READY_ATTR=X;exports.TRANSITION_STRATEGY=W;exports.createAnyOrderDetector=ot;exports.createDefaultStrategy=Q;exports.createOutFirstDetector=rt;exports.createPageTransitionStrategy=Z;exports.createSggoiTransitionContext=Mt;exports.createTransitionScope=pt;exports.findScope=et;exports.getWatchedCount=Ct;exports.isScopeReady=tt;exports.isWatched=At;exports.resetObserver=Et;exports.transition=kt;exports.triggerUnmount=Tt;exports.watchUnmount=nt;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var tt = Object.defineProperty;
2
2
  var et = (e, n, t) => n in e ? tt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
3
  var m = (e, n, t) => et(e, typeof n != "symbol" ? n + "" : n, t);
4
- import { normalizeToMultiAnimation as F, normalizeSchedule as X } from "./types.js";
5
- import { isCssAnimation as _t, isMultiAnimation as Nt, isSingleAnimation as Ut, isTickAnimation as Ht } from "./types.js";
4
+ import { normalizeToMultiAnimation as M, normalizeSchedule as X } from "./types.js";
5
+ import { isCssAnimation as Nt, isMultiAnimation as Ut, isSingleAnimation as Ht, isTickAnimation as Xt } from "./types.js";
6
6
  import { S as $, I as it, a as nt } from "./provider-Cu4NSF1Q.js";
7
7
  class rt {
8
8
  constructor() {
@@ -30,9 +30,9 @@ class rt {
30
30
  i > this.lagThreshold || i < 0 ? (this.startTime += i - this.adjustedLag, i = this.adjustedLag) : i > this.maxDeltaTime && (i = this.maxDeltaTime), this.lastUpdate = n;
31
31
  const r = n - this.startTime, o = r - this.nextTime;
32
32
  if (o > 0) {
33
- const c = i / 1e3;
34
- this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((a) => {
35
- a(c, this.elapsed);
33
+ const l = i / 1e3;
34
+ this.elapsed = r / 1e3, this.nextTime += o + (o >= this.gap ? 4 : this.gap - o), this.listeners.forEach((c) => {
35
+ c(l, this.elapsed);
36
36
  });
37
37
  }
38
38
  this.listeners.size > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.isRunning = !1, this.rafId = null);
@@ -76,15 +76,15 @@ function ot(e) {
76
76
  to: i,
77
77
  velocity: r = 0,
78
78
  onUpdate: o,
79
- onComplete: c,
80
- onStart: a
79
+ onComplete: l,
80
+ onStart: c
81
81
  } = e;
82
- let s = { position: t, velocity: r }, u = !0, h = 0, p = !1;
82
+ let s = { position: t, velocity: r }, f = !0, h = 0, p = !1;
83
83
  const w = (v) => {
84
- if (u) {
85
- if (p || (p = !0, a == null || a()), s = n.step(s, i, v), n.isSettled(s, i)) {
84
+ if (f) {
85
+ if (p || (p = !0, c == null || c()), s = n.step(s, i, v), n.isSettled(s, i)) {
86
86
  if (h += Math.min(v, 0.033), h >= $) {
87
- s = { position: i, velocity: 0 }, u = !1, o(s.position), _.unsubscribe(w), c();
87
+ s = { position: i, velocity: 0 }, f = !1, o(s.position), _.unsubscribe(w), l();
88
88
  return;
89
89
  }
90
90
  } else
@@ -94,36 +94,36 @@ function ot(e) {
94
94
  };
95
95
  return _.subscribe(w), {
96
96
  stop: () => {
97
- u && (u = !1, _.unsubscribe(w));
97
+ f && (f = !1, _.unsubscribe(w));
98
98
  },
99
99
  getPosition: () => s.position,
100
100
  getVelocity: () => s.velocity,
101
- isRunning: () => u
101
+ isRunning: () => f
102
102
  };
103
103
  }
104
- const M = 1e3 / 60;
104
+ const x = 1e3 / 60;
105
105
  function st(e, n, t, i = 0) {
106
- let o = { position: n, velocity: i }, c = 0;
107
- const a = [];
106
+ let o = { position: n, velocity: i }, l = 0;
107
+ const c = [];
108
108
  for (let s = 0; s < 600; s++) {
109
- const u = s * M;
110
- if (a.push({
111
- time: u,
109
+ const f = s * x;
110
+ if (c.push({
111
+ time: f,
112
112
  position: o.position,
113
113
  velocity: o.velocity
114
- }), o = e.step(o, t, M / 1e3), e.isSettled(o, t)) {
115
- if (c += M / 1e3, c >= $) {
116
- a.push({
117
- time: (s + 1) * M,
114
+ }), o = e.step(o, t, x / 1e3), e.isSettled(o, t)) {
115
+ if (l += x / 1e3, l >= $) {
116
+ c.push({
117
+ time: (s + 1) * x,
118
118
  position: t,
119
119
  velocity: 0
120
120
  });
121
121
  break;
122
122
  }
123
123
  } else
124
- c = 0;
124
+ l = 0;
125
125
  }
126
- return a;
126
+ return c;
127
127
  }
128
128
  function Y(e, n) {
129
129
  if (e.length === 0)
@@ -135,13 +135,13 @@ function Y(e, n) {
135
135
  return { position: i.position, velocity: i.velocity };
136
136
  let r = 0, o = e.length - 1;
137
137
  for (; r < o - 1; ) {
138
- const u = Math.floor((r + o) / 2);
139
- e[u].time <= n ? r = u : o = u;
138
+ const f = Math.floor((r + o) / 2);
139
+ e[f].time <= n ? r = f : o = f;
140
140
  }
141
- const c = e[r], a = e[o], s = (n - c.time) / (a.time - c.time);
141
+ const l = e[r], c = e[o], s = (n - l.time) / (c.time - l.time);
142
142
  return {
143
- position: c.position + (a.position - c.position) * s,
144
- velocity: c.velocity + (a.velocity - c.velocity) * s
143
+ position: l.position + (c.position - l.position) * s,
144
+ velocity: l.velocity + (c.velocity - l.velocity) * s
145
145
  };
146
146
  }
147
147
  function at(e, n) {
@@ -154,19 +154,19 @@ function ct(e) {
154
154
  from: i,
155
155
  to: r,
156
156
  velocity: o = 0,
157
- style: c,
158
- onComplete: a,
157
+ style: l,
158
+ onComplete: c,
159
159
  onStart: s
160
- } = e, u = st(n, i, r, o);
161
- if (u.length === 0)
162
- return s == null || s(), a(), {
160
+ } = e, f = st(n, i, r, o);
161
+ if (f.length === 0)
162
+ return s == null || s(), c(), {
163
163
  stop: () => {
164
164
  },
165
165
  getPosition: () => r,
166
166
  getVelocity: () => 0,
167
167
  isRunning: () => !1
168
168
  };
169
- const h = at(u, c), p = u[u.length - 1], w = p.time, v = h[0];
169
+ const h = at(f, l), p = f[f.length - 1], w = p.time, v = h[0];
170
170
  if (v)
171
171
  for (const y of Object.keys(v))
172
172
  t.style[y] = "";
@@ -176,35 +176,45 @@ function ct(e) {
176
176
  easing: "linear",
177
177
  composite: "replace"
178
178
  });
179
- let l = !0;
179
+ let u = !0;
180
180
  const C = performance.now();
181
181
  return s == null || s(), d.onfinish = () => {
182
- l && (l = !1, a());
182
+ u && (u = !1, c());
183
183
  }, {
184
184
  stop: () => {
185
- l && (l = !1, d.cancel());
185
+ u && (u = !1, d.cancel());
186
186
  },
187
187
  getPosition: () => {
188
- if (!l)
188
+ if (!u)
189
189
  return p.position;
190
190
  const y = performance.now() - C;
191
- return Y(u, y).position;
191
+ return Y(f, y).position;
192
192
  },
193
193
  getVelocity: () => {
194
- if (!l)
194
+ if (!u)
195
195
  return 0;
196
196
  const y = performance.now() - C;
197
- return Y(u, y).velocity;
197
+ return Y(f, y).velocity;
198
+ },
199
+ isRunning: () => u
200
+ };
201
+ }
202
+ function lt(e) {
203
+ const { to: n, onStart: t, onComplete: i } = e;
204
+ return t == null || t(), i(), {
205
+ stop: () => {
198
206
  },
199
- isRunning: () => l
207
+ getPosition: () => n,
208
+ getVelocity: () => 0,
209
+ isRunning: () => !1
200
210
  };
201
211
  }
202
- class lt {
212
+ class ut {
203
213
  /**
204
214
  * Get bound runner based on animation mode
205
215
  *
206
216
  * @param options Animation mode options (tick or css)
207
- * @returns Bound runner function or null if no animation mode specified
217
+ * @returns Bound runner function (empty runner if no animation mode specified)
208
218
  * @throws Error if both tick and css are provided
209
219
  */
210
220
  static from(n) {
@@ -218,12 +228,12 @@ class lt {
218
228
  }) : t ? (r) => ot({
219
229
  ...r,
220
230
  onUpdate: t
221
- }) : null;
231
+ }) : lt;
222
232
  }
223
233
  }
224
234
  class K {
225
235
  }
226
- const ut = { stiffness: 300, damping: 30 };
236
+ const ft = { stiffness: 300, damping: 30 };
227
237
  class j extends K {
228
238
  constructor(t) {
229
239
  super();
@@ -249,14 +259,14 @@ class j extends K {
249
259
  else if (t.css) {
250
260
  const { element: i, style: r } = t.css;
251
261
  this.updateFn = (o) => {
252
- const c = r(o);
253
- for (const [a, s] of Object.entries(c))
254
- i.style[a] = typeof s == "number" ? String(s) : s;
262
+ const l = r(o);
263
+ for (const [c, s] of Object.entries(l))
264
+ i.style[c] = typeof s == "number" ? String(s) : s;
255
265
  };
256
266
  } else
257
267
  this.updateFn = () => {
258
268
  };
259
- this.runner = lt.from({
269
+ this.runner = ut.from({
260
270
  tick: t.tick,
261
271
  css: t.css
262
272
  });
@@ -278,15 +288,10 @@ class j extends K {
278
288
  return t != null && t.integrator ? t.integrator() : t != null && t.spring || t != null && t.inertia ? it.from({
279
289
  spring: t.spring,
280
290
  inertia: t.inertia
281
- }) : new nt(ut);
291
+ }) : new nt(ft);
282
292
  }
283
293
  runAnimation(t) {
284
- var i, r;
285
- if (this.isAnimating = !0, !this.runner) {
286
- (r = (i = this.options).onStart) == null || r.call(i), this.currentValue = t, this.currentVelocity = 0, this.isAnimating = !1, this.options.onComplete();
287
- return;
288
- }
289
- this.controls = this.runner({
294
+ this.isAnimating = !0, this.controls = this.runner({
290
295
  integrator: this.createIntegrator(),
291
296
  from: this.currentValue,
292
297
  to: t,
@@ -339,7 +344,7 @@ class j extends K {
339
344
  this.options = { ...this.options, ...t };
340
345
  }
341
346
  }
342
- class L extends K {
347
+ class D extends K {
343
348
  constructor(t) {
344
349
  super();
345
350
  m(this, "config");
@@ -397,9 +402,9 @@ class L extends K {
397
402
  return this.direction === "forward" ? this.itemOrder : [...this.itemOrder].reverse();
398
403
  }
399
404
  onAnimatorComplete(t) {
400
- var r, o, c, a, s, u;
405
+ var r, o, l, c, s, f;
401
406
  const i = this.animators.get(t);
402
- !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.items.length), this.completedCount === this.config.items.length && (this.stopScheduler(), (u = (s = this.config).onEnd) == null || u.call(s)));
407
+ !i || this.completedAnimators.has(t) || (this.completedAnimators.add(t), this.completedCount++, (o = (r = i.item).onComplete) == null || o.call(r), (c = (l = this.config).onProgress) == null || c.call(l, this.completedCount, this.config.items.length), this.completedCount === this.config.items.length && (this.stopScheduler(), (f = (s = this.config).onEnd) == null || f.call(s)));
403
408
  }
404
409
  /**
405
410
  * Check and start springs based on previous spring's progress
@@ -414,10 +419,10 @@ class L extends K {
414
419
  this.startAnimator(r);
415
420
  continue;
416
421
  }
417
- const c = t[i - 1], a = this.animators.get(c);
418
- if (!a || !a.started) continue;
419
- const s = this.getAnimatorProgress(a), u = o.item.normalizedOffset;
420
- s >= u && this.startAnimator(r);
422
+ const l = t[i - 1], c = this.animators.get(l);
423
+ if (!c || !c.started) continue;
424
+ const s = this.getAnimatorProgress(c), f = o.item.normalizedOffset;
425
+ s >= f && this.startAnimator(r);
421
426
  }
422
427
  }
423
428
  startAnimator(t) {
@@ -532,10 +537,10 @@ class L extends K {
532
537
  * Uses first animator's state for initialization
533
538
  */
534
539
  static fromState(t, i) {
535
- return new L({ ...i, state: t });
540
+ return new D({ ...i, state: t });
536
541
  }
537
542
  }
538
- const B = Symbol.for("TRANSITION_STRATEGY"), ft = (e) => ({
543
+ const B = Symbol.for("TRANSITION_STRATEGY"), mt = (e) => ({
539
544
  runIn: async (n) => {
540
545
  const { currentAnimation: t } = e;
541
546
  if (t && t.direction === "out") {
@@ -602,7 +607,7 @@ const B = Symbol.for("TRANSITION_STRATEGY"), ft = (e) => ({
602
607
  direction: "forward"
603
608
  };
604
609
  }
605
- }), mt = () => ({
610
+ }), dt = () => ({
606
611
  runIn: async (e) => e.in ? {
607
612
  config: await e.in,
608
613
  state: {
@@ -640,7 +645,7 @@ const B = Symbol.for("TRANSITION_STRATEGY"), ft = (e) => ({
640
645
  direction: "forward"
641
646
  }
642
647
  }), J = "data-ssgoi-scope", Q = "data-ssgoi-scope-ready";
643
- function It() {
648
+ function Ft() {
644
649
  return (e) => {
645
650
  if (e)
646
651
  return e.setAttribute(J, ""), queueMicrotask(() => {
@@ -651,13 +656,13 @@ function It() {
651
656
  };
652
657
  };
653
658
  }
654
- function dt(e) {
659
+ function ht(e) {
655
660
  return e.hasAttribute(Q);
656
661
  }
657
- function ht(e) {
662
+ function gt(e) {
658
663
  return e.closest(`[${J}]`);
659
664
  }
660
- const gt = (e) => {
665
+ const pt = (e) => {
661
666
  let n = e.parentElement;
662
667
  for (; n && n !== document.body; ) {
663
668
  const t = window.getComputedStyle(n), i = t.overflow + t.overflowY + t.overflowX;
@@ -666,7 +671,7 @@ const gt = (e) => {
666
671
  n = n.parentElement;
667
672
  }
668
673
  return document.documentElement;
669
- }, pt = (e) => {
674
+ }, wt = (e) => {
670
675
  let n = e.parentElement;
671
676
  for (; n && n !== document.body; ) {
672
677
  const t = window.getComputedStyle(n).position;
@@ -685,80 +690,80 @@ function W(e) {
685
690
  });
686
691
  });
687
692
  }
688
- function wt(e, n) {
693
+ function yt(e, n) {
689
694
  var v;
690
695
  let t = null, i = null, r = null, o = null;
691
- const c = {
696
+ const l = {
692
697
  get currentAnimation() {
693
698
  return t;
694
699
  }
695
- }, a = ((v = n == null ? void 0 : n.strategy) == null ? void 0 : v.call(n, c)) || ft(c), s = async (d) => {
696
- var b;
700
+ }, c = ((v = n == null ? void 0 : n.strategy) == null ? void 0 : v.call(n, l)) || mt(l), s = async (d) => {
701
+ var R, P;
697
702
  i && (i.remove(), i = null);
698
- const l = e(), C = l.in && l.in(d), y = !(n != null && n.strategy) && l.out ? l.out(d) : void 0;
703
+ const u = e(), C = u.in && u.in(d), y = !(n != null && n.strategy) && u.out ? u.out(d) : void 0;
699
704
  if (!C)
700
705
  return;
701
- const P = {
702
- in: F(C),
703
- out: y ? F(y) : void 0
704
- }, g = await a.runIn(P);
706
+ const V = {
707
+ in: M(C),
708
+ out: y ? M(y) : void 0
709
+ }, g = await c.runIn(V);
705
710
  if (!g.config) {
706
711
  t && (t.direction = "in");
707
712
  return;
708
713
  }
709
- const f = g.config;
710
- (b = f.prepare) == null || b.call(f);
714
+ const a = g.config;
715
+ (R = a.prepare) == null || R.call(a);
711
716
  const S = X(
712
717
  {
713
- ...f,
718
+ ...a,
714
719
  onEnd: () => {
715
- var k;
716
- t = null, (k = f.onEnd) == null || k.call(f);
720
+ var E;
721
+ t = null, (E = a.onEnd) == null || E.call(a);
717
722
  }
718
723
  },
719
724
  d
720
725
  );
721
- f.wait && await f.wait();
722
- const A = L.fromState(g.state, {
726
+ a.wait && await a.wait();
727
+ const A = D.fromState(g.state, {
723
728
  config: S,
724
729
  from: g.from,
725
730
  to: g.to
726
731
  });
727
- t = { controller: A, direction: "in" }, await W(), g.direction === "forward" ? A.forward() : A.backward();
728
- }, u = async (d) => {
729
- var k;
732
+ t = { controller: A, direction: "in" }, (P = a.onReady) == null || P.call(a), await W(), g.direction === "forward" ? A.forward() : A.backward();
733
+ }, f = async (d) => {
734
+ var P, E;
730
735
  i = d;
731
- const l = e(), C = !(n != null && n.strategy) && l.in ? l.in(d) : void 0, y = l.out && l.out(d);
736
+ const u = e(), C = !(n != null && n.strategy) && u.in ? u.in(d) : void 0, y = u.out && u.out(d);
732
737
  if (!y)
733
738
  return;
734
- const P = {
735
- in: C ? F(C) : void 0,
736
- out: F(y)
737
- }, g = await a.runOut(P);
739
+ const V = {
740
+ in: C ? M(C) : void 0,
741
+ out: M(y)
742
+ }, g = await c.runOut(V);
738
743
  if (!g.config) {
739
744
  t && (t.direction = "out"), i && (i.remove(), i = null);
740
745
  return;
741
746
  }
742
- const f = g.config;
743
- b(), (k = f.prepare) == null || k.call(f);
747
+ const a = g.config;
748
+ R(), (P = a.prepare) == null || P.call(a);
744
749
  const S = X(
745
750
  {
746
- ...f,
751
+ ...a,
747
752
  onEnd: () => {
748
- var V, R;
749
- (V = f.onEnd) == null || V.call(f), i && (i.remove(), i = null), t = null, (R = n == null ? void 0 : n.onCleanupEnd) == null || R.call(n);
753
+ var I, k;
754
+ (I = a.onEnd) == null || I.call(a), i && (i.remove(), i = null), t = null, (k = n == null ? void 0 : n.onCleanupEnd) == null || k.call(n);
750
755
  }
751
756
  },
752
757
  d
753
758
  );
754
- f.wait && await f.wait();
755
- const A = L.fromState(g.state, {
759
+ a.wait && await a.wait();
760
+ const A = D.fromState(g.state, {
756
761
  config: S,
757
762
  from: g.from,
758
763
  to: g.to
759
764
  });
760
- t = { controller: A, direction: "out" }, await W(), g.direction === "forward" ? A.forward() : A.backward();
761
- function b() {
765
+ t = { controller: A, direction: "out" }, (E = a.onReady) == null || E.call(a), await W(), g.direction === "forward" ? A.forward() : A.backward();
766
+ function R() {
762
767
  !r || !i || (o && r.contains(o) ? r.insertBefore(i, o) : r.appendChild(i));
763
768
  }
764
769
  };
@@ -766,26 +771,26 @@ function wt(e, n) {
766
771
  const w = (d) => () => {
767
772
  if (p) return;
768
773
  p = !0;
769
- const l = d.cloneNode(!0);
774
+ const u = d.cloneNode(!0);
770
775
  h ? queueMicrotask(() => {
771
- document.contains(h) && u(l);
772
- }) : u(l);
776
+ document.contains(h) && f(u);
777
+ }) : f(u);
773
778
  };
774
779
  return (d) => {
775
780
  if (d)
776
781
  return requestAnimationFrame(() => {
777
782
  r = d.parentElement, o = d.nextElementSibling;
778
783
  }), p = !1, (n == null ? void 0 : n.scope) === "local" ? queueMicrotask(() => {
779
- h = ht(d), !(h && !dt(h)) && s(d);
784
+ h = gt(d), !(h && !ht(h)) && s(d);
780
785
  }) : s(d), w(d);
781
786
  };
782
787
  }
783
- const T = /* @__PURE__ */ new Map();
784
- let E = null, N = !1;
788
+ const b = /* @__PURE__ */ new Map();
789
+ let T = null, N = !1;
785
790
  function Z(e) {
786
- if (e instanceof HTMLElement && T.has(e)) {
787
- const t = T.get(e);
788
- T.delete(e), queueMicrotask(() => {
791
+ if (e instanceof HTMLElement && b.has(e)) {
792
+ const t = b.get(e);
793
+ b.delete(e), queueMicrotask(() => {
789
794
  t();
790
795
  });
791
796
  }
@@ -795,8 +800,8 @@ function Z(e) {
795
800
  i && Z(i);
796
801
  }
797
802
  }
798
- function yt() {
799
- N || typeof document > "u" || (N = !0, E = new MutationObserver((e) => {
803
+ function vt() {
804
+ N || typeof document > "u" || (N = !0, T = new MutationObserver((e) => {
800
805
  for (const n of e) {
801
806
  const t = n.removedNodes;
802
807
  for (let i = 0; i < t.length; i++) {
@@ -804,13 +809,13 @@ function yt() {
804
809
  r && Z(r);
805
810
  }
806
811
  }
807
- }), document.body ? E.observe(document.body, {
812
+ }), document.body ? T.observe(document.body, {
808
813
  childList: !0,
809
814
  subtree: !0
810
815
  }) : document.addEventListener(
811
816
  "DOMContentLoaded",
812
817
  () => {
813
- E == null || E.observe(document.body, {
818
+ T == null || T.observe(document.body, {
814
819
  childList: !0,
815
820
  subtree: !0
816
821
  });
@@ -818,48 +823,48 @@ function yt() {
818
823
  { once: !0 }
819
824
  ));
820
825
  }
821
- function vt(e, n) {
822
- yt(), T.set(e, n);
826
+ function St(e, n) {
827
+ vt(), b.set(e, n);
823
828
  }
824
- function Ft(e) {
825
- return T.has(e);
829
+ function Mt(e) {
830
+ return b.has(e);
826
831
  }
827
- function Mt() {
828
- return T.size;
832
+ function xt() {
833
+ return b.size;
829
834
  }
830
- function xt(e) {
831
- const n = T.get(e);
832
- return n ? (T.delete(e), n(), !0) : !1;
835
+ function Ot(e) {
836
+ const n = b.get(e);
837
+ return n ? (b.delete(e), n(), !0) : !1;
833
838
  }
834
- function Ot() {
835
- T.clear(), E == null || E.disconnect(), E = null, N = !1;
839
+ function Lt() {
840
+ b.clear(), T == null || T.disconnect(), T = null, N = !1;
836
841
  }
837
- const O = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
838
- function St(e, n, t) {
839
- O.set(e, n);
842
+ const L = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map();
843
+ function Ct(e, n, t) {
844
+ L.set(e, n);
840
845
  let i = U.get(e);
841
846
  if (i)
842
847
  return i;
843
848
  const r = n;
844
- return i = wt(
849
+ return i = yt(
845
850
  () => {
846
- const o = O.get(e);
851
+ const o = L.get(e);
847
852
  return o || (console.warn(`Transition "${String(e)}" not found`), {});
848
853
  },
849
854
  {
850
855
  strategy: t == null ? void 0 : t.strategy,
851
856
  scope: t == null ? void 0 : t.scope,
852
857
  onCleanupEnd: () => {
853
- O.get(e) === r && Ct(e);
858
+ L.get(e) === r && At(e);
854
859
  }
855
860
  }
856
861
  ), U.set(e, i), i;
857
862
  }
858
- function Ct(e) {
859
- O.delete(e), U.delete(e), H.delete(e);
863
+ function At(e) {
864
+ L.delete(e), U.delete(e), H.delete(e);
860
865
  }
861
- function Lt(e, n = "manual") {
862
- const t = St(
866
+ function Dt(e, n = "manual") {
867
+ const t = Ct(
863
868
  e.key,
864
869
  {
865
870
  in: e.in,
@@ -876,11 +881,11 @@ function Lt(e, n = "manual") {
876
881
  return i || (i = (r) => {
877
882
  if (r) {
878
883
  const o = t(r);
879
- o && vt(r, o);
884
+ o && St(r, o);
880
885
  }
881
886
  }, H.set(e.key, i), i);
882
887
  }
883
- function At(e) {
888
+ function Et(e) {
884
889
  const n = e.filter((t) => t.symmetric).map((t) => ({
885
890
  from: t.to,
886
891
  to: t.from,
@@ -888,36 +893,38 @@ function At(e) {
888
893
  }));
889
894
  return [...e, ...n];
890
895
  }
891
- function Et(e) {
896
+ function Tt(e) {
892
897
  let n = !1, t = 0, i = 0, r = !1;
893
- const o = 50, c = (d) => {
898
+ const o = 50, l = (d) => {
894
899
  if (!e) return;
895
- const l = d.touches[0];
896
- l && (r = l.clientX < o, r && (t = l.clientX, i = l.clientY));
897
- }, a = (d) => {
900
+ const u = d.touches[0];
901
+ u && (r = u.clientX < o, r && (t = u.clientX, i = u.clientY));
902
+ }, c = (d) => {
898
903
  if (!e || !r) return;
899
- const l = d.touches[0];
900
- if (!l) return;
901
- const C = l.clientX - t, y = l.clientY - i;
904
+ const u = d.touches[0];
905
+ if (!u) return;
906
+ const C = u.clientX - t, y = u.clientY - i;
902
907
  C > window.outerWidth / 2 - 5 && Math.abs(C) > Math.abs(y) ? n = !0 : n = !1;
903
908
  }, s = () => {
904
909
  e && (r = !1, t = 0, i = 0);
905
- }, u = () => n, h = () => {
906
- typeof window > "u" || e && (window.addEventListener("touchstart", c, { passive: !0 }), window.addEventListener("touchmove", a, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
910
+ }, f = () => n, h = () => {
911
+ typeof window > "u" || e && (window.addEventListener("touchstart", l, { passive: !0 }), window.addEventListener("touchmove", c, { passive: !0 }), window.addEventListener("touchend", s, { passive: !0 }));
907
912
  }, p = () => {
908
- typeof window > "u" || (window.removeEventListener("touchstart", c), window.removeEventListener("touchmove", a), window.removeEventListener("touchend", s));
913
+ typeof window > "u" || (window.removeEventListener("touchstart", l), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", s));
909
914
  };
910
915
  let w = 0;
911
916
  return {
912
917
  initialize: h,
913
918
  cleanup: p,
914
- isSwipePending: u,
919
+ isSwipePending: f,
915
920
  resetSwipeDetection: () => {
916
- w++, w > 1 && (w = 0, n = !1);
921
+ requestAnimationFrame(() => {
922
+ w++, w > 1 && (w = 0, n = !1);
923
+ });
917
924
  }
918
925
  };
919
926
  }
920
- function Tt() {
927
+ function bt() {
921
928
  let e = null, n = null;
922
929
  const t = /* @__PURE__ */ new Map();
923
930
  let i = null;
@@ -929,7 +936,7 @@ function Tt() {
929
936
  };
930
937
  return {
931
938
  initializeContext: (h, p) => {
932
- n = h, e || (e = gt(h), (e === document.documentElement ? window : e).addEventListener("scroll", r, {
939
+ n = h, e || (e = pt(h), (e === document.documentElement ? window : e).addEventListener("scroll", r, {
933
940
  passive: !0
934
941
  })), i = p;
935
942
  },
@@ -941,11 +948,11 @@ function Tt() {
941
948
  };
942
949
  },
943
950
  getScrollContainer: () => e,
944
- getPositionedParentElement: () => n ? pt(n) : document.body,
951
+ getPositionedParentElement: () => n ? wt(n) : document.body,
945
952
  getScrollPosition: (h) => h && t.has(h) ? t.get(h) : { x: 0, y: 0 }
946
953
  };
947
954
  }
948
- function x(e, n) {
955
+ function O(e, n) {
949
956
  if (n === "*")
950
957
  return !0;
951
958
  if (n.endsWith("/*")) {
@@ -956,14 +963,14 @@ function x(e, n) {
956
963
  }
957
964
  function G(e, n, t) {
958
965
  for (const i of t)
959
- if (x(e, i.from) && x(n, i.to))
966
+ if (O(e, i.from) && O(n, i.to))
960
967
  return i.transition;
961
968
  for (const i of t)
962
- if ((i.from === "*" || x(e, i.from)) && (i.to === "*" || x(n, i.to)))
969
+ if ((i.from === "*" || O(e, i.from)) && (i.to === "*" || O(n, i.to)))
963
970
  return i.transition;
964
971
  return null;
965
972
  }
966
- function bt() {
973
+ function kt() {
967
974
  let e = null;
968
975
  function n() {
969
976
  if (e != null && e.from && (e != null && e.to) && (e != null && e.outResolve) && (e != null && e.inResolve)) {
@@ -982,7 +989,7 @@ function bt() {
982
989
  }
983
990
  };
984
991
  }
985
- function kt() {
992
+ function Rt() {
986
993
  let e = null;
987
994
  function n() {
988
995
  var i, r;
@@ -1005,41 +1012,45 @@ function kt() {
1005
1012
  }
1006
1013
  };
1007
1014
  }
1008
- function Dt(e, n) {
1015
+ function zt(e, n) {
1009
1016
  const {
1010
1017
  transitions: t = [],
1011
1018
  defaultTransition: i,
1012
- middleware: r = (g, f) => ({ from: g, to: f }),
1019
+ middleware: r = (g, a) => ({ from: g, to: a }),
1013
1020
  // Identity function as default
1014
1021
  skipOnIosSwipe: o = !0
1015
1022
  // Default to true - skip animations on iOS swipe
1016
- } = e, { outFirst: c = !0, createNavigationDetector: a } = n || {}, s = (a == null ? void 0 : a()) ?? (c ? bt() : kt()), u = At(t), {
1023
+ } = e, { outFirst: l = !0, createNavigationDetector: c } = n || {}, s = (c == null ? void 0 : c()) ?? (l ? kt() : Rt()), f = Et(t), {
1017
1024
  initializeContext: h,
1018
1025
  calculateScrollOffset: p,
1019
1026
  getScrollContainer: w,
1020
1027
  getPositionedParentElement: v,
1021
1028
  getScrollPosition: d
1022
- } = Tt(), l = Et(o);
1023
- l.initialize();
1024
- const C = async (g, f) => {
1025
- if (l.isSwipePending())
1026
- return l.resetSwipeDetection(), () => ({});
1027
- s.trigger(g, f);
1028
- const S = await s.get(f);
1029
+ } = bt(), u = Tt(o);
1030
+ u.initialize();
1031
+ const C = async (g, a) => {
1032
+ if (u.isSwipePending())
1033
+ return u.resetSwipeDetection(), a === "in" ? async (k) => ({
1034
+ onReady: () => {
1035
+ k.style.visibility = "visible";
1036
+ }
1037
+ }) : () => ({});
1038
+ s.trigger(g, a);
1039
+ const S = await s.get(a);
1029
1040
  if (!S) return () => ({});
1030
- const { from: A, to: b } = r(
1041
+ const { from: A, to: R } = r(
1031
1042
  S.from,
1032
1043
  S.to
1033
- ), V = G(
1044
+ ), E = G(
1034
1045
  A,
1035
- b,
1036
- u
1046
+ R,
1047
+ f
1037
1048
  ) || i;
1038
- if (!V) return () => ({});
1039
- const R = p(S.from, S.to);
1040
- if (f === "out") {
1041
- const D = {
1042
- scrollOffset: R,
1049
+ if (!E) return () => ({});
1050
+ const I = p(S.from, S.to);
1051
+ if (a === "out") {
1052
+ const k = {
1053
+ scrollOffset: I,
1043
1054
  scroll: d(S.from),
1044
1055
  get scrollingElement() {
1045
1056
  return w() || document.documentElement;
@@ -1048,10 +1059,10 @@ function Dt(e, n) {
1048
1059
  return v();
1049
1060
  }
1050
1061
  };
1051
- return (I) => V.out(I, D);
1062
+ return (F) => E.out(F, k);
1052
1063
  } else {
1053
- const D = {
1054
- scrollOffset: R,
1064
+ const k = {
1065
+ scrollOffset: I,
1055
1066
  get scroll() {
1056
1067
  return d(S.to);
1057
1068
  },
@@ -1062,54 +1073,56 @@ function Dt(e, n) {
1062
1073
  return v();
1063
1074
  }
1064
1075
  };
1065
- return async (I) => {
1066
- const z = await Promise.resolve(V.in(I, D)), q = z.onStart;
1067
- return z.onStart = () => {
1068
- I.style.visibility = "visible", q == null || q();
1076
+ return async (F) => {
1077
+ const z = await Promise.resolve(E.in(F, k)), q = z.onReady;
1078
+ return z.onReady = () => {
1079
+ F.style.visibility = "visible", q == null || q();
1069
1080
  }, z;
1070
1081
  };
1071
1082
  }
1072
1083
  }, y = (g) => ({
1073
1084
  key: g,
1074
- in: async (f) => (h(f, g), (await C(g, "in"))(f)),
1075
- out: async (f) => (await C(g, "out"))(f),
1085
+ in: async (a) => (h(a, g), (await C(g, "in"))(a)),
1086
+ out: async (a) => (await C(g, "out"))(a),
1076
1087
  // Add page transition strategy for page-level transitions
1077
- [B]: mt
1078
- }), P = (g, f) => {
1079
- const { from: S, to: A } = r(g, f);
1088
+ [B]: dt
1089
+ }), V = (g, a) => {
1090
+ if (u.isSwipePending())
1091
+ return !1;
1092
+ const { from: S, to: A } = r(g, a);
1080
1093
  return !!(G(
1081
1094
  S,
1082
1095
  A,
1083
- u
1096
+ f
1084
1097
  ) || i);
1085
1098
  };
1086
- return a ? {
1099
+ return c ? {
1087
1100
  getTransition: y,
1088
- hasMatchingTransition: P
1101
+ hasMatchingTransition: V
1089
1102
  } : y;
1090
1103
  }
1091
1104
  export {
1092
1105
  J as SCOPE_ATTR,
1093
1106
  Q as SCOPE_READY_ATTR,
1094
1107
  B as TRANSITION_STRATEGY,
1095
- kt as createAnyOrderDetector,
1096
- ft as createDefaultStrategy,
1097
- bt as createOutFirstDetector,
1098
- mt as createPageTransitionStrategy,
1099
- Dt as createSggoiTransitionContext,
1100
- It as createTransitionScope,
1101
- ht as findScope,
1102
- Mt as getWatchedCount,
1103
- _t as isCssAnimation,
1104
- Nt as isMultiAnimation,
1105
- dt as isScopeReady,
1106
- Ut as isSingleAnimation,
1107
- Ht as isTickAnimation,
1108
- Ft as isWatched,
1108
+ Rt as createAnyOrderDetector,
1109
+ mt as createDefaultStrategy,
1110
+ kt as createOutFirstDetector,
1111
+ dt as createPageTransitionStrategy,
1112
+ zt as createSggoiTransitionContext,
1113
+ Ft as createTransitionScope,
1114
+ gt as findScope,
1115
+ xt as getWatchedCount,
1116
+ Nt as isCssAnimation,
1117
+ Ut as isMultiAnimation,
1118
+ ht as isScopeReady,
1119
+ Ht as isSingleAnimation,
1120
+ Xt as isTickAnimation,
1121
+ Mt as isWatched,
1109
1122
  X as normalizeSchedule,
1110
- F as normalizeToMultiAnimation,
1111
- Ot as resetObserver,
1112
- Lt as transition,
1113
- xt as triggerUnmount,
1114
- vt as watchUnmount
1123
+ M as normalizeToMultiAnimation,
1124
+ Lt as resetObserver,
1125
+ Dt as transition,
1126
+ Ot as triggerUnmount,
1127
+ St as watchUnmount
1115
1128
  };
@@ -1 +1 @@
1
- {"version":3,"file":"create-swipe-detector.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-swipe-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO;;;;;EAuFnD"}
1
+ {"version":3,"file":"create-swipe-detector.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-swipe-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO;;;;;EAyFnD"}
@@ -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;AAI/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,CAwOpB"}
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;AAI/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,CA4OpB"}
package/dist/types.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(t){return("tick"in t||"css"in t)&&!("items"in t)}function a(t){return"items"in t}function d(t){return"css"in t&&typeof t.css=="function"}function p(t){return"tick"in t&&typeof t.tick=="function"}async function f(t){const e=await t;return a(e)?{prepare:e.prepare,wait:e.wait,onStart:e.onStart,onEnd:e.onEnd,items:e.items,schedule:e.schedule}:{prepare:e.prepare,wait:e.wait,onStart:e.onStart,onEnd:e.onEnd,items:[{physics:e.physics,tick:e.tick,css:e.css}],schedule:"parallel"}}function h(t,e){const o=t.schedule??"parallel",r=t.items.map(s=>{let i;switch(o){case"parallel":i=0;break;case"sequential":i=1;break;case"stagger":i=Math.max(0,Math.min(1,s.offset??0));break;default:i=0}const{css:n,offset:k,...c}=s,u=n?typeof n=="function"?e?{element:e,style:n}:void 0:{element:n.element,style:n.style}:void 0;return{...c,css:u,normalizedOffset:i}}),{schedule:y,...l}=t;return{...l,items:r}}exports.isCssAnimation=d;exports.isMultiAnimation=a;exports.isSingleAnimation=m;exports.isTickAnimation=p;exports.normalizeSchedule=h;exports.normalizeToMultiAnimation=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(t){return("tick"in t||"css"in t)&&!("items"in t)}function a(t){return"items"in t}function d(t){return"css"in t&&typeof t.css=="function"}function p(t){return"tick"in t&&typeof t.tick=="function"}async function f(t){const e=await t;return a(e)?{prepare:e.prepare,wait:e.wait,onReady:e.onReady,onStart:e.onStart,onEnd:e.onEnd,items:e.items,schedule:e.schedule}:{prepare:e.prepare,wait:e.wait,onReady:e.onReady,onStart:e.onStart,onEnd:e.onEnd,items:[{physics:e.physics,tick:e.tick,css:e.css}],schedule:"parallel"}}function y(t,e){const o=t.schedule??"parallel",r=t.items.map(s=>{let n;switch(o){case"parallel":n=0;break;case"sequential":n=1;break;case"stagger":n=Math.max(0,Math.min(1,s.offset??0));break;default:n=0}const{css:i,offset:k,...c}=s,u=i?typeof i=="function"?e?{element:e,style:i}:void 0:{element:i.element,style:i.style}:void 0;return{...c,css:u,normalizedOffset:n}}),{schedule:h,...l}=t;return{...l,items:r}}exports.isCssAnimation=d;exports.isMultiAnimation=a;exports.isSingleAnimation=m;exports.isTickAnimation=p;exports.normalizeSchedule=y;exports.normalizeToMultiAnimation=f;
package/dist/types.d.ts CHANGED
@@ -123,6 +123,7 @@ export type ScheduleType = "parallel" | "sequential" | "stagger";
123
123
  export type BaseTransitionConfig = {
124
124
  prepare?: () => void;
125
125
  wait?: () => Promise<void>;
126
+ onReady?: () => void;
126
127
  onStart?: () => void;
127
128
  onEnd?: () => void;
128
129
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAEhG,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,0BAA0B,CAAC;IAC7D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,C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,GAAG,QAAQ,CAAC,GAAG;IAC5E,GAAG,CAAC,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAA;KAAE,CAAC;IACzE,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAC/C,oBAAoB,EACpB,OAAO,GAAG,UAAU,CACrB,GAAG;IACF,KAAK,EAAE,uBAAuB,EAAE,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,WAAW,GACpB,8BAA8B,CA8ChC;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
package/dist/types.js CHANGED
@@ -7,14 +7,15 @@ function u(t) {
7
7
  function f(t) {
8
8
  return "css" in t && typeof t.css == "function";
9
9
  }
10
- function h(t) {
10
+ function y(t) {
11
11
  return "tick" in t && typeof t.tick == "function";
12
12
  }
13
- async function k(t) {
13
+ async function h(t) {
14
14
  const e = await t;
15
15
  return u(e) ? {
16
16
  prepare: e.prepare,
17
17
  wait: e.wait,
18
+ onReady: e.onReady,
18
19
  onStart: e.onStart,
19
20
  onEnd: e.onEnd,
20
21
  items: e.items,
@@ -22,6 +23,7 @@ async function k(t) {
22
23
  } : {
23
24
  prepare: e.prepare,
24
25
  wait: e.wait,
26
+ onReady: e.onReady,
25
27
  onStart: e.onStart,
26
28
  onEnd: e.onEnd,
27
29
  items: [
@@ -34,7 +36,7 @@ async function k(t) {
34
36
  schedule: "parallel"
35
37
  };
36
38
  }
37
- function y(t, e) {
39
+ function k(t, e) {
38
40
  const a = t.schedule ?? "parallel", r = t.items.map(
39
41
  (i) => {
40
42
  let n;
@@ -51,10 +53,10 @@ function y(t, e) {
51
53
  default:
52
54
  n = 0;
53
55
  }
54
- const { css: s, offset: d, ...c } = i, l = s ? typeof s == "function" ? e ? { element: e, style: s } : void 0 : { element: s.element, style: s.style } : void 0;
56
+ const { css: s, offset: m, ...c } = i, l = s ? typeof s == "function" ? e ? { element: e, style: s } : void 0 : { element: s.element, style: s.style } : void 0;
55
57
  return { ...c, css: l, normalizedOffset: n };
56
58
  }
57
- ), { schedule: m, ...o } = t;
59
+ ), { schedule: d, ...o } = t;
58
60
  return {
59
61
  ...o,
60
62
  items: r
@@ -64,7 +66,7 @@ export {
64
66
  f as isCssAnimation,
65
67
  u as isMultiAnimation,
66
68
  p as isSingleAnimation,
67
- h as isTickAnimation,
68
- y as normalizeSchedule,
69
- k as normalizeToMultiAnimation
69
+ y as isTickAnimation,
70
+ k as normalizeSchedule,
71
+ h as normalizeToMultiAnimation
70
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/core",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
5
5
  "private": false,
6
6
  "type": "module",