@ssgoi/core 2.1.0 → 2.2.0
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/README.md +10 -11
- package/dist/animator.d.ts.map +1 -1
- package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/create-transition-callback.d.ts.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.js +204 -126
- package/dist/transition-strategy.d.ts +5 -0
- package/dist/transition-strategy.d.ts.map +1 -1
- package/dist/transition.d.ts.map +1 -1
- package/dist/transitions/blur.d.ts.map +1 -1
- package/dist/transitions/bounce.d.ts +1 -1
- package/dist/transitions/bounce.d.ts.map +1 -1
- package/dist/transitions/fly.d.ts.map +1 -1
- package/dist/transitions/index.cjs +1 -1
- package/dist/transitions/index.d.ts +1 -0
- package/dist/transitions/index.d.ts.map +1 -1
- package/dist/transitions/index.js +175 -119
- package/dist/transitions/mask.d.ts +31 -0
- package/dist/transitions/mask.d.ts.map +1 -0
- package/dist/transitions/none.d.ts.map +1 -1
- package/dist/transitions/rotate.d.ts +1 -1
- package/dist/transitions/scale.d.ts +1 -1
- package/dist/transitions/slide.d.ts +2 -2
- package/dist/transitions/slide.d.ts.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/get-rect.d.ts +7 -0
- package/dist/utils/get-rect.d.ts.map +1 -0
- package/dist/utils/get-scrolling-element.d.ts +6 -0
- package/dist/utils/get-scrolling-element.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/parse-caller-location.d.ts +6 -0
- package/dist/utils/parse-caller-location.d.ts.map +1 -0
- package/dist/utils/prepare-outgoing.d.ts +6 -0
- package/dist/utils/prepare-outgoing.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +7 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/view-transitions/blind.d.ts +13 -0
- package/dist/view-transitions/blind.d.ts.map +1 -0
- 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 +30 -1
- package/dist/view-transitions/index.d.ts +2 -0
- package/dist/view-transitions/index.d.ts.map +1 -1
- package/dist/view-transitions/index.js +371 -217
- package/dist/view-transitions/pinterest.d.ts.map +1 -1
- package/dist/view-transitions/slide.d.ts +8 -0
- package/dist/view-transitions/slide.d.ts.map +1 -0
- package/package.json +14 -9
- package/dist/utils-8Eptbv7c.cjs +0 -2
- package/dist/utils-DTRMUQW4.js +0 -31
- package/dist/view-transitions/ripple.d.ts +0 -7
- package/dist/view-transitions/ripple.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -73,12 +73,12 @@ Define different transitions for different routes:
|
|
|
73
73
|
```tsx
|
|
74
74
|
const config = {
|
|
75
75
|
transitions: [
|
|
76
|
-
//
|
|
77
|
-
{ from: '/home', to: '/about', transition:
|
|
78
|
-
{ from: '/about', to: '/home', transition:
|
|
76
|
+
// Scroll between tabs
|
|
77
|
+
{ from: '/home', to: '/about', transition: scroll({ direction: 'up' }) },
|
|
78
|
+
{ from: '/about', to: '/home', transition: scroll({ direction: 'down' }) },
|
|
79
79
|
|
|
80
|
-
//
|
|
81
|
-
{ from: '/products', to: '/products/*', transition:
|
|
80
|
+
// Drill in when entering details
|
|
81
|
+
{ from: '/products', to: '/products/*', transition: drill({ direction: 'enter' }) },
|
|
82
82
|
|
|
83
83
|
// Pinterest-style image transitions
|
|
84
84
|
{ from: '/gallery', to: '/photo/*', transition: pinterest() }
|
|
@@ -95,7 +95,7 @@ Automatically create bidirectional transitions:
|
|
|
95
95
|
{
|
|
96
96
|
from: '/home',
|
|
97
97
|
to: '/about',
|
|
98
|
-
transition:
|
|
98
|
+
transition: scroll({ direction: 'up' }),
|
|
99
99
|
symmetric: true // Automatically creates reverse transition
|
|
100
100
|
}
|
|
101
101
|
```
|
|
@@ -125,11 +125,10 @@ function Card() {
|
|
|
125
125
|
|
|
126
126
|
### Page Transitions
|
|
127
127
|
- `fade` - Smooth opacity transition
|
|
128
|
-
- `
|
|
129
|
-
- `
|
|
128
|
+
- `scroll` - Vertical scrolling (up/down)
|
|
129
|
+
- `drill` - Drill in/out effect (enter/exit)
|
|
130
130
|
- `hero` - Shared element transitions
|
|
131
131
|
- `pinterest` - Pinterest-style expand effect
|
|
132
|
-
- `ripple` - Material Design ripple effect
|
|
133
132
|
|
|
134
133
|
### Element Transitions
|
|
135
134
|
- `fadeIn` / `fadeOut`
|
|
@@ -146,14 +145,14 @@ function Card() {
|
|
|
146
145
|
```tsx
|
|
147
146
|
// app/layout.tsx
|
|
148
147
|
import { Ssgoi } from '@ssgoi/react';
|
|
149
|
-
import {
|
|
148
|
+
import { scroll } from '@ssgoi/react/view-transitions';
|
|
150
149
|
|
|
151
150
|
export default function RootLayout({ children }) {
|
|
152
151
|
return (
|
|
153
152
|
<html>
|
|
154
153
|
<body>
|
|
155
154
|
<Ssgoi config={{
|
|
156
|
-
defaultTransition:
|
|
155
|
+
defaultTransition: scroll({ direction: 'up' })
|
|
157
156
|
}}>
|
|
158
157
|
<div style={{ position: 'relative', minHeight: '100vh' }}>
|
|
159
158
|
{children}
|
package/dist/animator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animator.d.ts","sourceRoot":"","sources":["../src/lib/animator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,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;IAC5C,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"animator.d.ts","sourceRoot":"","sources":["../src/lib/animator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,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;IAC5C,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;QACjB,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3E,IAAI,EAAE,eAAe,CAAC;QACtB,EAAE,EAAE,eAAe,CAAC;KACrB;IAUD,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../src/lib/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAGb,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../src/lib/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAGb,MAAM,SAAS,CAAC;AAgIjB;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,GACnB,YAAY,CAkGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../src/lib/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CAAC,eAAe,GAAG,MAAM,EAC/D,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,EAC3D,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../src/lib/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CAAC,eAAe,GAAG,MAAM,EAC/D,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,EAC3D,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CACT,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CA0IpB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use strict";var I=Object.defineProperty;var
|
|
1
|
+
"use strict";var I=Object.defineProperty;var N=(i,t,o)=>t in i?I(i,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[t]=o;var g=(i,t,o)=>N(i,typeof t!="symbol"?t+"":t,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("popmotion");class A{constructor(t){g(this,"options");g(this,"currentValue");g(this,"velocity");g(this,"isAnimating",!1);g(this,"controls",null);g(this,"animationMap",null);g(this,"activeAnimations",new Set);g(this,"completedAnimations",new Set);g(this,"updatedProperties",new Set);g(this,"animate",(t=!1)=>{!this.isAnimating&&this.options.onStart&&this.options.onStart(),this.isAnimating=!0;const o=t?this.options.from:this.options.to;if(typeof this.currentValue=="object"&&this.currentValue!==null){this.animateObject(o,t);return}let n=this.currentValue,e=performance.now();const u={from:this.currentValue,to:o,stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="number"&&(u.velocity=this.velocity*1e3),this.controls=R.animate({...u,onUpdate:s=>{const f=performance.now(),h=(f-e)/1e3;if(h>0){if(typeof s=="number"&&typeof n=="number"){const a=(s-n)/h;this.velocity=a/1e3}else if(typeof s=="object"&&s!==null){const a={};Object.keys(s).forEach(m=>{const r=s[m],c=n[m];if(typeof r=="number"&&typeof c=="number"){const p=(r-c)/h;a[m]=p/1e3}}),this.velocity=a}n=s,e=f}this.currentValue=s,this.options.onUpdate(s)},onComplete:()=>{this.currentValue=o,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()}})});g(this,"animateObject",(t,o)=>{const n=this.currentValue,e=Object.keys(n);this.animationMap=new Map,this.activeAnimations.clear(),this.completedAnimations.clear(),this.updatedProperties.clear();const u={...n},s={};let f=!1;const h=()=>{const a=e.filter(r=>!this.completedAnimations.has(r));if(a.every(r=>this.updatedProperties.has(r))&&a.length>0){if(typeof this.velocity=="object"&&this.velocity){const r=performance.now();Object.keys(u).forEach(c=>{if(s[c]){const p=(r-s[c])/1e3,l=this.currentValue[c],d=u[c];typeof l=="number"&&typeof d=="number"&&p>0&&(this.velocity[c]=(d-l)/p/1e3)}s[c]=r})}this.currentValue={...u},this.options.onUpdate(this.currentValue),this.updatedProperties.clear(),!f&&this.options.onStart&&(f=!0,this.options.onStart())}};e.forEach(a=>{this.activeAnimations.add(a);const m={from:n[a],to:t[a],stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="object"&&this.velocity&&a in this.velocity&&(m.velocity=this.velocity[a]*1e3);const r=R.animate({...m,onUpdate:c=>{u[a]=c,this.updatedProperties.add(a),h()},onComplete:()=>{this.completedAnimations.add(a),this.updatedProperties.delete(a),this.completedAnimations.size===e.length&&(this.currentValue=t,this.isAnimating=!1,this.animationMap=null,typeof this.velocity=="object"&&this.velocity&&Object.keys(this.velocity).forEach(c=>{this.velocity[c]=0}),this.options.onComplete())}});this.animationMap.set(a,r)})});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 o={};Object.keys(this.options.from).forEach(n=>{o[n]=0}),this.velocity=o}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 o=this.shouldReverse();this.stop(),this.animate(!o)}}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{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 o=this.shouldReverse();this.stop(),this.animate(!o)}}static fromState(t,o){const n=new A(o);return n.setValue(t.position),n.setVelocity(t.velocity),n}}const V=Symbol.for("TRANSITION_STRATEGY"),M=i=>({runIn:async t=>{const{currentAnimation:o}=i;if(o&&o.direction==="out"){const s=o.animator.getCurrentState();if(o.animator.stop(),t.out){const f=await t.out,{from:h=1,to:a=0}=f;return{config:f,state:s,from:h,to:a,direction:"backward"}}}const n=await t.in;if(!n)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:e=0,to:u=1}=n;return{config:n,state:{position:e,velocity:0},from:e,to:u,direction:"forward"}},runOut:async t=>{const{currentAnimation:o}=i;if(o&&o.direction==="in"){const s=o.animator.getCurrentState();if(o.animator.stop(),t.in){const f=await t.in,{from:h=0,to:a=1}=f;return{config:f,state:{position:s.position,velocity:s.velocity},from:h,to:a,direction:"backward"}}}const n=await t.out;if(!n)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:e=1,to:u=0}=n;return{config:n,state:{position:e,velocity:0},from:e,to:u,direction:"forward"}}}),_=i=>({runIn:async t=>{const o=await t.in;if(!o)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:n=0,to:e=1}=o;return{config:o,state:{position:n,velocity:0},from:n,to:e,direction:"forward"}},runOut:async t=>{const o=await t.out;if(!o)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:n=1,to:e=0}=o;return{config:o,state:{position:n,velocity:0},from:n,to:e,direction:"forward"}}});function D(i,t){var m;let o=null,n=null,e=null,u=null;const s={get currentAnimation(){return o}},f=((m=t==null?void 0:t.strategy)==null?void 0:m.call(t,s))||M(s),h=async r=>{var y,S;n&&(n.remove(),n=null);const c=i(),p={in:c.in&&Promise.resolve(c.in(r)),out:c.out&&Promise.resolve(c.out(r))},l=await f.runIn(p);if(!l.config)return;(S=(y=l.config).prepare)==null||S.call(y,r),l.config.wait&&await l.config.wait();const d=A.fromState(l.state,{from:l.from,to:l.to,spring:l.config.spring,onStart:l.config.onStart,onUpdate:l.config.tick,onComplete:()=>{var v,w;o=null,(w=(v=l.config)==null?void 0:v.onEnd)==null||w.call(v)}});o={animator:d,direction:"in"},l.direction==="forward"?d.forward():d.backward()},a=async r=>{var S,v;n=r;const c=i(),p={in:c.in&&Promise.resolve(c.in(r)),out:c.out&&Promise.resolve(c.out(r))},l=await f.runOut(p);if(!l.config)return;(v=(S=l.config).prepare)==null||v.call(S,r),y(),l.config.wait&&await l.config.wait();const d=A.fromState(l.state,{from:l.from,to:l.to,spring:l.config.spring,onStart:l.config.onStart,onUpdate:l.config.tick,onComplete:()=>{var w,E,O;(E=(w=l.config)==null?void 0:w.onEnd)==null||E.call(w),n&&(n.remove(),n=null),o=null,(O=t==null?void 0:t.onCleanupEnd)==null||O.call(t)}});o={animator:d,direction:"out"},l.direction==="forward"?d.forward():d.backward();function y(){!e||!n||(u&&e.contains(u)?e.insertBefore(n,u):e.appendChild(n))}};return r=>{if(r)return e=r.parentElement,u=r.nextElementSibling,h(r),()=>{const c=r.cloneNode(!0);a(c)}}}const k=3,K=i=>{if(!i)return null;const t=i.split(`
|
|
2
|
+
`).map(o=>o.trim());for(let o=k;o<Math.min(t.length,6);o++){const n=t[o],e=n==null?void 0:n.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!e)continue;const u=e[1]??"",s=e[2]??"0",f=e[3]??"0";return{file:u.split(/[\\/]/).pop()||u,line:s,column:f}}return null},T=new Map,C=new Map;function $(i,t,o){T.set(i,t);let n=C.get(i);return n||(n=D(()=>{const e=T.get(i);return e||(console.warn(`Transition "${String(i)}" not found`),{})},{strategy:o,onCleanupEnd:()=>x(i)}),C.set(i,n),n)}function x(i){T.delete(i),C.delete(i)}function U(){const i=K(new Error().stack);return i?`auto_${i.file}_${i.line}_${i.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const P=globalThis.FinalizationRegistry,j=P?new P(i=>{try{x(i)}catch{}}):void 0;function F(i){const t=i.key??U();if(i.ref&&j)try{j.register(i.ref,t)}catch{}return $(t,{in:i.in,out:i.out},i[V])}const W=i=>{let t=i.parentElement;for(;t&&t!==document.body;){const o=window.getComputedStyle(t),n=o.overflow+o.overflowY+o.overflowX;if(n.includes("auto")||n.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement};function L(i){const t=i.filter(o=>o.symmetric).map(o=>({from:o.to,to:o.from,transition:o.transition}));return[...i,...t]}function Y(){let i=null;const t=new Map;let o=null;const n=()=>{i&&o&&t.set(o,{x:i.scrollLeft,y:i.scrollTop})};return{startScrollTracking:(s,f)=>{i||(i=W(s),(i===document.documentElement?window:i).addEventListener("scroll",n,{passive:!0})),o=f},calculateScrollOffset:(s,f)=>{const h=s&&t.has(s)?t.get(s):{x:0,y:0},a=f&&t.has(f)?t.get(f):{x:0,y:0};return{x:-a.x+h.x,y:-a.y+h.y}}}}function z(i){const{transitions:t=[],defaultTransition:o,middleware:n=(m,r)=>({from:m,to:r})}=i;let e=null;const u=L(t),{startScrollTracking:s,calculateScrollOffset:f}=Y();function h(){if(e!=null&&e.from&&(e!=null&&e.to)){const{from:m,to:r}=n(e.from,e.to),p=G(m,r,u)||o,d={scrollOffset:f(e.from,e.to)};p&&(p.out&&e.outResolve&&e.outResolve(y=>p.out(y,d)),p.in&&e.inResolve&&e.inResolve(y=>p.in(y,d))),e=null}}const a=async(m,r)=>r==="in"&&(!e||!e.from)?()=>({}):(e||(e={}),r==="out"?(e.from=m,new Promise(c=>{e.outResolve=c,h()})):(e.to=m,new Promise(c=>{e.inResolve=c,h()})));return m=>({key:m,in:async r=>(s(r,m),(await a(m,"in"))(r)),out:async r=>(await a(m,"out"))(r),[V]:_})}function G(i,t,o){for(const n of o)if(b(i,n.from)&&b(t,n.to))return n.transition;for(const n of o)if((n.from==="*"||b(i,n.from))&&(n.to==="*"||b(t,n.to)))return n.transition;return null}function b(i,t){if(t==="*")return!0;if(t.endsWith("/*")){const o=t.slice(0,-2);return i===o||i.startsWith(o+"/")}return i===t}exports.TRANSITION_STRATEGY=V;exports.createDefaultStrategy=M;exports.createPageTransitionStrategy=_;exports.createSggoiTransitionContext=z;exports.generateAutoKey=U;exports.transition=F;
|