@lazycatcloud/vue-router-stack 0.0.4 → 0.0.5

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 CHANGED
@@ -101,7 +101,7 @@ stackRouter.popTo("/album/detail");
101
101
  stackRouter.resetRoot("/");
102
102
  ```
103
103
 
104
- 单次导航可以控制方向、动画、时长和缓动:
104
+ 单次导航可以控制页面复用、方向、动画、时长和缓动:
105
105
 
106
106
  ```ts
107
107
  stackRouter.push("/search/result", {
@@ -112,6 +112,11 @@ stackRouter.push("/timeline", {
112
112
  direction: "none",
113
113
  });
114
114
 
115
+ stackRouter.push("/album", {
116
+ reuse: true,
117
+ transition: "fade",
118
+ });
119
+
115
120
  stackRouter.push("/detail", {
116
121
  transition: "sheet",
117
122
  duration: 300,
@@ -119,7 +124,9 @@ stackRouter.push("/detail", {
119
124
  });
120
125
  ```
121
126
 
122
- `direction: "none"` 和 `direction: "root"` 会强制不播放转场,适合 tab 切换和清栈回首页。
127
+ `direction: "none"` 保持原有语义:重复进入相同 `fullPath` 时会复用已有页面实例,并强制不播放转场,适合无需动画的 tab 切换。`direction: "root"` 也会强制关闭转场。
128
+
129
+ `reuse: true` 可以让普通的 `forward` 导航在重复进入相同 `fullPath` 时复用已有页面实例,并且不会关闭转场。PC tab 可以将它与 `transition: "fade"` 组合使用。
123
130
 
124
131
  ## 转场动画
125
132
 
@@ -38,6 +38,7 @@ export type StackTransitionFactory = (context: StackTransitionContext) => StackT
38
38
  export type StackTransitionRegistry = Record<string, StackTransitionFactory>;
39
39
  export interface StackNavigationOptions {
40
40
  direction?: RouteDirection;
41
+ reuse?: boolean;
41
42
  transition?: StackTransitionName;
42
43
  duration?: number;
43
44
  easing?: string;
@@ -51,6 +52,7 @@ export interface RouteInfo {
51
52
  query: RouteLocationNormalizedLoaded["query"];
52
53
  action: RouteAction;
53
54
  direction: RouteDirection;
55
+ reuse?: boolean;
54
56
  source: StackNavigationSource;
55
57
  entryDirection: RouteDirection;
56
58
  lastPathname?: string;
@@ -76,6 +78,7 @@ export interface PendingNavigation {
76
78
  direction: RouteDirection;
77
79
  source: StackNavigationSource;
78
80
  delta?: number;
81
+ reuse?: boolean;
79
82
  transition?: StackTransitionName;
80
83
  duration?: number;
81
84
  easing?: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),R=require("vue-router"),Q={};function U(t="route"){const n=(Q[t]??0)+1;return Q[t]=n,`${t}-${n}`}const J="slide",re="cubic-bezier(0.3, 0, 0.66, 1)";function oe(t){return t}const ne=({direction:t})=>t==="back"?{leaving:[{transform:"translateX(0)"},{transform:"translateX(100%)"}]}:{entering:[{transform:"translateX(100%)"},{transform:"translateX(0)"}]},ae=()=>({entering:[{opacity:0},{opacity:1}],leaving:[{opacity:1},{opacity:0}]}),ce=({direction:t})=>{const n=t==="back";return{entering:n?[{transform:"scale(0.98)",opacity:0},{transform:"scale(1)",opacity:1}]:[{transform:"scale(1.04)",opacity:0},{transform:"scale(1)",opacity:1}],leaving:n?[{transform:"scale(1)",opacity:1},{transform:"scale(1.04)",opacity:0}]:[{transform:"scale(1)",opacity:1},{transform:"scale(0.98)",opacity:0}]}},ie=()=>({}),se={slide:ne,fade:ae,scale:ce,none:ie};function ue(t,n){const a=n[t];return a||n[J]}function Y(t,n,a){if(!n||!t.animate||Number(a.duration)<=0)return Promise.resolve();const l=t.animate(n,a);return l.finished.then(()=>l.cancel())}async function le(t,n){const a=t(n),l={duration:n.duration,easing:n.easing,fill:"both",...a.options};await Promise.all([Y(n.enteringElement,a.entering,l),Y(n.leavingElement,a.leaving,l)])}const H=Symbol("stack-router");function de(){const t=window.history.state;return typeof(t==null?void 0:t.position)=="number"?t.position:window.history.length}function M(t,n){return n||(t==="pop"?"back":t==="replace"?"none":"forward")}function fe(t){const n=R.createRouter(t),a=[],l=i.shallowRef(),d=t.transitionDuration??210,D=t.transitionEasing??re,E=t.transition??J,k={...se,...t.transitions},P=t.maxStackSize??30;let m=-1,u,w=!1;const b=(c,r,s,f,y=!1,p="stack")=>{u={action:c,direction:M(c,r),source:p,delta:s,transition:f==null?void 0:f.transition,duration:f==null?void 0:f.duration,easing:f==null?void 0:f.easing,resetRoot:y}},F=(c,r)=>{const s=(u==null?void 0:u.action)??"push",f=M(s,u==null?void 0:u.direction),y=l.value,p=s==="push"&&f==="forward",z=T(c);return{id:U("route"),key:c.fullPath,fullPath:c.fullPath,pathname:c.path,params:c.params,query:c.query,action:s,direction:f,source:(u==null?void 0:u.source)??"stack",entryDirection:f,lastPathname:(y==null?void 0:y.pathname)||(r.name?r.path:void 0),pushedByRoute:p?y==null?void 0:y.pathname:y==null?void 0:y.pushedByRoute,position:de(),delta:u==null?void 0:u.delta,transition:(u==null?void 0:u.transition)??E,transitionDuration:(u==null?void 0:u.duration)??d,transitionEasing:(u==null?void 0:u.easing)??D,cache:z}},T=c=>{const r=c.meta.stack;return c.meta.stackCache!==!1&&(r==null?void 0:r.cache)!==!1},K=()=>{if(P<=0||a.length<=P)return;const c=a.length-P;a.splice(0,c),m=Math.max(0,m-c)},W=c=>{if(c.action==="pop"){let r=-1;if(c.direction==="forward"||(c.delta??0)>0){for(let s=m+1;s<a.length;s++)if(a[s].key===c.key){r=s;break}}else for(let s=m-1;s>=0;s--)if(a[s].key===c.key){r=s;break}if(r>=0){const s=a[r];a[r]={...s,...c,id:s.id,source:c.source,entryDirection:s.entryDirection,transition:s.transition,transitionDuration:s.transitionDuration,transitionEasing:s.transitionEasing},m=r}else a.push({...c,direction:"none",entryDirection:"none",transition:"none",isStackFallback:!0}),m=a.length-1}else if(c.action==="replace"){if(u!=null&&u.resetRoot){a.splice(0,a.length,c),m=0,l.value=a[m];return}m>=0?a[m]=c:(a.push(c),m=0)}else m<a.length-1&&a.splice(m+1),a.push(c),m=a.length-1;K(),l.value=a[m]};t.history.listen((c,r,s)=>{const f="delta"in s?s.delta:void 0,y=s.direction==="back"?"back":s.direction==="forward"?"forward":void 0;u?(u.delta=f,u.direction=M(u.action,u.direction??y)):b(s.type==="pop"?"pop":s.type,y,f,void 0,!1,"external")}),n.beforeEach(c=>!((u==null?void 0:u.action)==="pop"&&w&&!a.some(r=>r.fullPath===c.fullPath))),n.afterEach((c,r,s)=>{if(s){u=void 0;return}W(F(c,r)),u=void 0});const L=n.push.bind(n),S=n.replace.bind(n),G=n.back.bind(n),x=n.forward.bind(n),$=n.go.bind(n),A=(c,r)=>(b("push",(r==null?void 0:r.direction)??"forward",void 0,r),L(c)),j=(c,r)=>(b("replace",(r==null?void 0:r.direction)??"root",void 0,r),S(c)),B=(c,r)=>{const s=n.resolve(c).fullPath;let f=-1;for(let p=m;p>=0;p--)if(a[p].fullPath===s){f=p;break}if(f<0)return!1;const y=f-m;return y===0||(b("pop",(r==null?void 0:r.direction)??"back",y,r),$(y)),!0},V=(c,r)=>{const s=n.resolve(c).fullPath;if(m>=0&&n.currentRoute.value.fullPath===s){const f=a[m],y={...f,id:U("route"),action:"replace",direction:(r==null?void 0:r.direction)??"root",source:"stack",entryDirection:(r==null?void 0:r.direction)??"root",delta:void 0,transition:(r==null?void 0:r.transition)??f.transition,transitionDuration:(r==null?void 0:r.duration)??f.transitionDuration,transitionEasing:(r==null?void 0:r.easing)??f.transitionEasing,cache:!0,isStackFallback:!1};return a.splice(0,a.length,y),m=0,w=!0,l.value=y,Promise.resolve(void 0)}return b("replace",(r==null?void 0:r.direction)??"root",void 0,r,!0),w=!0,S(c)},_=()=>{b("pop","back",-1),G()},v=()=>{b("pop","forward",1),x()},e=n;e.push=A,e.replace=j,e.popTo=B,e.resetRoot=V,e.back=_,e.forward=v;const o={router:e,transitionDuration:d,transitionEasing:D,transition:E,transitions:k,maxStackSize:P,shouldTransition:t.shouldTransition,current:l,get history(){return a},canGoBack:(c=1)=>m-c>=0,push:A,replace:j,popTo:B,resetRoot:V,back:_,forward:v},h=n.install.bind(n);return n.install=c=>{c.provide(H,o),h(c)},e}const Z="onPageWillEnter",X="onPageDidEnter",N="onPageWillLeave",O="onPageDidLeave";function he(t,n,a){if(!a)throw new Error(`${t} must be called inside setup().`);const l=a.proxy,d=l[t]??[];d.push(()=>{a.isUnmounted||n()}),l[t]=d,a.exposed&&(a.exposed[t]=d)}function C(t){return(n,a=i.getCurrentInstance())=>he(t,n,a)}const me=C(Z),ye=C(X),ke=C(N),Re=C(O);function pe(){const t=i.inject(H);if(!t)throw new Error("useStackRouter must be used after createStackRouter().");return{router:t.router,canGoBack:t.canGoBack,push:t.push,replace:t.replace,popTo:t.popTo,resetRoot:t.resetRoot,back:t.back,forward:t.forward}}function ee(){const t=i.inject(H);if(!t)throw new Error("RouterOutlet must be used with createStackRouter().");return t}function I(t,n){const a=t.value;if(!a)return;const l=a[n];Array.isArray(l)?l.forEach(d=>d()):typeof l=="function"&&l.call(a)}function g(t){t.classList.remove("rs-page-hidden","rs-page-invisible"),t.removeAttribute("aria-hidden")}function q(t){t.classList.add("rs-page-hidden"),t.setAttribute("aria-hidden","true")}function te(t){var n;return(n=t.components)==null?void 0:n.default}function be(t){const n=te(t);return n!==void 0&&typeof n=="object"&&"name"in n&&n.name==="RouterView"}const Pe=i.defineComponent({name:"RouterOutlet",setup(){const t=ee(),n=R.useRoute(),a=i.inject(R.routeLocationKey),l=i.inject(R.matchedRouteKey,void 0),d=i.computed(()=>{const e=l==null?void 0:l.value;if(!e)return 0;const o=n.matched.findIndex(h=>h===e);return o>=0?o+1:0}),D=i.computed(()=>n.matched[d.value]),E=i.computed(()=>{for(let e=d.value;e<n.matched.length;e++){const o=n.matched[e];if(!be(o))return o}return D.value}),k=i.shallowRef([]),P=i.ref("");let m=0;i.provide(R.matchedRouteKey,E);const u=e=>k.value.find(o=>o.id===e),w=e=>k.value.find(o=>o.routeIds.has(e)),b=e=>k.value.find(o=>o.routeKey===e),F=e=>e.action==="push"&&e.direction==="forward"&&k.value.some(o=>o.routeKey===e.key),T=e=>{k.value.forEach(o=>{o.pageElement&&(o===e?g(o.pageElement):q(o.pageElement))})},K=e=>{const o=k.value.findIndex(h=>h===e);o>=0&&(k.value=k.value.slice(0,o+1))},W=e=>{k.value=k.value.filter(o=>o!==e)},L=e=>{const o=new Set(t.history.map(h=>h.id));k.value.forEach(h=>{h.routeIds=new Set([...h.routeIds].filter(c=>o.has(c)))}),k.value=k.value.filter(h=>h===e||h.routeInfo.cache&&h.routeIds.size>0)},S=e=>{var h;const o=e.props.default;return o?o===!0?((h=t.current.value)==null?void 0:h.params)??{}:typeof o=="function"?o(a):o:{}},G=(e,o)=>e.routeInfo.action==="pop"?o.routeInfo.transition??e.routeInfo.transition??t.transition:e.routeInfo.transition??t.transition,x=e=>e.entryDirection==="none"||e.entryDirection==="root"||e.transition==="none",$=(e,o)=>!(e.routeInfo.isStackFallback||e.routeInfo.direction==="none"||e.routeInfo.direction==="root"||e.routeInfo.action==="pop"&&(x(e.routeInfo)||x(o.routeInfo))),A=(e,o)=>{var c;const h=$(e,o);return((c=t.shouldTransition)==null?void 0:c.call(t,{action:e.routeInfo.action,direction:e.routeInfo.direction,source:e.routeInfo.source,entering:e.routeInfo,leaving:o.routeInfo,defaultResult:h}))??h},j=(e,o)=>e.routeInfo.action==="pop"?o.routeInfo.transitionDuration??e.routeInfo.transitionDuration??t.transitionDuration:e.routeInfo.transitionDuration??t.transitionDuration,B=(e,o)=>e.routeInfo.action==="pop"?o.routeInfo.transitionEasing??e.routeInfo.transitionEasing??t.transitionEasing:e.routeInfo.transitionEasing??t.transitionEasing,V=async(e,o)=>{const h=++m;await i.nextTick();const c=e.pageElement;if(!c)return;if(I(e.componentRef,Z),!o||o===e||!o.pageElement){g(c),I(e.componentRef,X),L(e),T(e);return}const r=o.pageElement,s=A(e,o),f=s?G(e,o):"none",y=s?j(e,o):0,p=B(e,o),z=ue(f||J,t.transitions);I(o.componentRef,N),g(c),g(r),await le(z,{direction:e.routeInfo.direction,action:e.routeInfo.action,routeInfo:e.routeInfo,enteringElement:c,leavingElement:r,duration:y,easing:p}),h===m&&(q(r),I(o.componentRef,O),I(e.componentRef,X),e.routeInfo.action==="pop"?K(e):e.routeInfo.action==="replace"&&W(o),L(e),T(e))},_=async()=>{const e=E.value,o=t.current.value;if(!e||!o)return;const h=te(e);if(!h)return;const c=u(P.value);let r=w(o.id);!r&&!F(o)&&(r=b(o.key)),r?(r.routeIds.add(o.id),r.routeKey=o.key,r.routeInfo=o,r.matchedRoute=e,r.component=h,r.props=S(e),r.mounted=!0):(r={id:U("view"),routeKey:o.key,routeIds:new Set([o.id]),routeInfo:o,matchedRoute:e,component:h,props:S(e),componentRef:i.ref(),mounted:!0},k.value=[...k.value,r]),P.value=r.id,await V(r,c)};return i.watch(()=>{var e;return[(e=t.current.value)==null?void 0:e.id,E.value]},()=>{_()},{immediate:!0}),i.onUnmounted(()=>{m++,k.value=[]}),{injectedRoute:a,viewItems:k,registerStackPage:(e,o)=>{e.pageElement=o,e.id===P.value?g(o):q(o)}}},render(){return i.h("div",{class:"rs-outlet"},this.viewItems.filter(t=>t.mounted).map(t=>i.h(t.component,{key:t.id,ref:t.componentRef,...t.props,registerStackPage:n=>this.registerStackPage(t,n)})))}}),Ee=i.defineComponent({name:"RouterPage",props:{registerStackPage:{type:Function,default:void 0}},setup(t,{attrs:n,slots:a}){const l=i.ref();return i.onMounted(()=>{var d;l.value&&((d=t.registerStackPage)==null||d.call(t,l.value))}),()=>{var d;return i.h("section",{...n,ref:l,class:["rs-page",n.class]},(d=a.default)==null?void 0:d.call(a))}}}),we=i.defineComponent({name:"StackRouterDebugPanel",props:{initialOpen:{type:Boolean,default:!1}},setup(t){const n=ee(),a=i.ref(t.initialOpen);return()=>{const l=n.current.value;return i.h("aside",{class:"rs-debug-panel"},[i.h("button",{class:"rs-debug-toggle",type:"button",onClick:()=>{a.value=!a.value}},a.value?"Stack x":"Stack"),a.value?i.h("section",{class:"rs-debug-body"},[i.h("header",[i.h("strong","Router Stack"),i.h("span",`${n.history.length} pages`)]),i.h("dl",[i.h("dt","current"),i.h("dd",(l==null?void 0:l.fullPath)??"-"),i.h("dt","canGoBack"),i.h("dd",String(n.canGoBack()))]),i.h("ol",n.history.map(d=>i.h("li",{key:d.id,class:{"rs-debug-active":d.id===(l==null?void 0:l.id),"rs-debug-no-cache":!d.cache}},[i.h("code",d.fullPath),i.h("span",[`${d.action}/${d.direction}`,` source:${d.source}`,` entry:${d.entryDirection}`,` cache:${d.cache?"yes":"no"}`,` transition:${d.transition??"-"}`])])))]):void 0])}}});Object.defineProperty(exports,"RouterLink",{enumerable:!0,get:()=>R.RouterLink});Object.defineProperty(exports,"RouterView",{enumerable:!0,get:()=>R.RouterView});Object.defineProperty(exports,"createMemoryHistory",{enumerable:!0,get:()=>R.createMemoryHistory});Object.defineProperty(exports,"createWebHashHistory",{enumerable:!0,get:()=>R.createWebHashHistory});Object.defineProperty(exports,"createWebHistory",{enumerable:!0,get:()=>R.createWebHistory});Object.defineProperty(exports,"useRoute",{enumerable:!0,get:()=>R.useRoute});Object.defineProperty(exports,"useRouter",{enumerable:!0,get:()=>R.useRouter});exports.RouterOutlet=Pe;exports.RouterPage=Ee;exports.StackRouterDebugPanel=we;exports.createStackRouter=fe;exports.defineStackTransition=oe;exports.onPageDidEnter=ye;exports.onPageDidLeave=Re;exports.onPageWillEnter=me;exports.onPageWillLeave=ke;exports.stackRouterKey=H;exports.useStackRouter=pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),R=require("vue-router"),Y={};function X(t="route"){const n=(Y[t]??0)+1;return Y[t]=n,`${t}-${n}`}const Q="slide",re="cubic-bezier(0.3, 0, 0.66, 1)";function oe(t){return t}const ne=({direction:t})=>t==="back"?{leaving:[{transform:"translateX(0)"},{transform:"translateX(100%)"}]}:{entering:[{transform:"translateX(100%)"},{transform:"translateX(0)"}]},ae=()=>({entering:[{opacity:0},{opacity:1}],leaving:[{opacity:1},{opacity:0}]}),ce=({direction:t})=>{const n=t==="back";return{entering:n?[{transform:"scale(0.98)",opacity:0},{transform:"scale(1)",opacity:1}]:[{transform:"scale(1.04)",opacity:0},{transform:"scale(1)",opacity:1}],leaving:n?[{transform:"scale(1)",opacity:1},{transform:"scale(1.04)",opacity:0}]:[{transform:"scale(1)",opacity:1},{transform:"scale(0.98)",opacity:0}]}},ie=()=>({}),se={slide:ne,fade:ae,scale:ce,none:ie};function ue(t,n){const c=n[t];return c||n[Q]}function Z(t,n,c){if(!n||!t.animate||Number(c.duration)<=0)return Promise.resolve();const l=t.animate(n,c);return l.finished.then(()=>l.cancel())}async function le(t,n){const c=t(n),l={duration:n.duration,easing:n.easing,fill:"both",...c.options};await Promise.all([Z(n.enteringElement,c.entering,l),Z(n.leavingElement,c.leaving,l)])}const H=Symbol("stack-router");function de(){const t=window.history.state;return typeof(t==null?void 0:t.position)=="number"?t.position:window.history.length}function q(t,n){return n||(t==="pop"?"back":t==="replace"?"none":"forward")}function fe(t){const n=R.createRouter(t),c=[],l=s.shallowRef(),f=t.transitionDuration??210,g=t.transitionEasing??re,w=t.transition??Q,k={...se,...t.transitions},P=t.maxStackSize??30;let m=-1,i,E=!1;const p=(a,r,u,d,y=!1,b="stack")=>{i={action:a,direction:q(a,r),source:b,delta:u,reuse:d==null?void 0:d.reuse,transition:d==null?void 0:d.transition,duration:d==null?void 0:d.duration,easing:d==null?void 0:d.easing,resetRoot:y}},F=(a,r)=>{const u=(i==null?void 0:i.action)??"push",d=q(u,i==null?void 0:i.direction),y=l.value,b=u==="push"&&d==="forward",M=T(a);return{id:X("route"),key:a.fullPath,fullPath:a.fullPath,pathname:a.path,params:a.params,query:a.query,action:u,direction:d,reuse:(i==null?void 0:i.reuse)??!1,source:(i==null?void 0:i.source)??"stack",entryDirection:d,lastPathname:(y==null?void 0:y.pathname)||(r.name?r.path:void 0),pushedByRoute:b?y==null?void 0:y.pathname:y==null?void 0:y.pushedByRoute,position:de(),delta:i==null?void 0:i.delta,transition:(i==null?void 0:i.transition)??w,transitionDuration:(i==null?void 0:i.duration)??f,transitionEasing:(i==null?void 0:i.easing)??g,cache:M}},T=a=>{const r=a.meta.stack;return a.meta.stackCache!==!1&&(r==null?void 0:r.cache)!==!1},K=()=>{if(P<=0||c.length<=P)return;const a=c.length-P;c.splice(0,a),m=Math.max(0,m-a)},W=a=>{if(a.action==="pop"){let r=-1;if(a.direction==="forward"||(a.delta??0)>0){for(let u=m+1;u<c.length;u++)if(c[u].key===a.key){r=u;break}}else for(let u=m-1;u>=0;u--)if(c[u].key===a.key){r=u;break}if(r>=0){const u=c[r];c[r]={...u,...a,id:u.id,reuse:u.reuse,source:a.source,entryDirection:u.entryDirection,transition:u.transition,transitionDuration:u.transitionDuration,transitionEasing:u.transitionEasing},m=r}else c.push({...a,direction:"none",entryDirection:"none",transition:"none",isStackFallback:!0}),m=c.length-1}else if(a.action==="replace"){if(i!=null&&i.resetRoot){c.splice(0,c.length,a),m=0,l.value=c[m];return}m>=0?c[m]=a:(c.push(a),m=0)}else m<c.length-1&&c.splice(m+1),c.push(a),m=c.length-1;K(),l.value=c[m]};t.history.listen((a,r,u)=>{const d="delta"in u?u.delta:void 0,y=u.direction==="back"?"back":u.direction==="forward"?"forward":void 0;i?(i.delta=d,i.direction=q(i.action,i.direction??y)):p(u.type==="pop"?"pop":u.type,y,d,void 0,!1,"external")}),n.beforeEach(a=>!((i==null?void 0:i.action)==="pop"&&E&&!c.some(r=>r.fullPath===a.fullPath))),n.afterEach((a,r,u)=>{if(u){i=void 0;return}W(F(a,r)),i=void 0});const L=n.push.bind(n),I=n.replace.bind(n),G=n.back.bind(n),x=n.forward.bind(n),$=n.go.bind(n),A=(a,r)=>(p("push",(r==null?void 0:r.direction)??"forward",void 0,r),L(a)),j=(a,r)=>(p("replace",(r==null?void 0:r.direction)??"root",void 0,r),I(a)),B=(a,r)=>{const u=n.resolve(a).fullPath;let d=-1;for(let b=m;b>=0;b--)if(c[b].fullPath===u){d=b;break}if(d<0)return!1;const y=d-m;return y===0||(p("pop",(r==null?void 0:r.direction)??"back",y,r),$(y)),!0},V=(a,r)=>{const u=n.resolve(a).fullPath;if(m>=0&&n.currentRoute.value.fullPath===u){const d=c[m],y={...d,id:X("route"),action:"replace",direction:(r==null?void 0:r.direction)??"root",source:"stack",entryDirection:(r==null?void 0:r.direction)??"root",delta:void 0,reuse:(r==null?void 0:r.reuse)??d.reuse,transition:(r==null?void 0:r.transition)??d.transition,transitionDuration:(r==null?void 0:r.duration)??d.transitionDuration,transitionEasing:(r==null?void 0:r.easing)??d.transitionEasing,cache:!0,isStackFallback:!1};return c.splice(0,c.length,y),m=0,E=!0,l.value=y,Promise.resolve(void 0)}return p("replace",(r==null?void 0:r.direction)??"root",void 0,r,!0),E=!0,I(a)},_=()=>{p("pop","back",-1),G()},z=()=>{p("pop","forward",1),x()},e=n;e.push=A,e.replace=j,e.popTo=B,e.resetRoot=V,e.back=_,e.forward=z;const o={router:e,transitionDuration:f,transitionEasing:g,transition:w,transitions:k,maxStackSize:P,shouldTransition:t.shouldTransition,current:l,get history(){return c},canGoBack:(a=1)=>m-a>=0,push:A,replace:j,popTo:B,resetRoot:V,back:_,forward:z},h=n.install.bind(n);return n.install=a=>{a.provide(H,o),h(a)},e}const v="onPageWillEnter",J="onPageDidEnter",N="onPageWillLeave",O="onPageDidLeave";function he(t,n,c){if(!c)throw new Error(`${t} must be called inside setup().`);const l=c.proxy,f=l[t]??[];f.push(()=>{c.isUnmounted||n()}),l[t]=f,c.exposed&&(c.exposed[t]=f)}function C(t){return(n,c=s.getCurrentInstance())=>he(t,n,c)}const me=C(v),ye=C(J),ke=C(N),Re=C(O);function be(){const t=s.inject(H);if(!t)throw new Error("useStackRouter must be used after createStackRouter().");return{router:t.router,canGoBack:t.canGoBack,push:t.push,replace:t.replace,popTo:t.popTo,resetRoot:t.resetRoot,back:t.back,forward:t.forward}}function ee(){const t=s.inject(H);if(!t)throw new Error("RouterOutlet must be used with createStackRouter().");return t}function S(t,n){const c=t.value;if(!c)return;const l=c[n];Array.isArray(l)?l.forEach(f=>f()):typeof l=="function"&&l.call(c)}function D(t){t.classList.remove("rs-page-hidden","rs-page-invisible"),t.removeAttribute("aria-hidden")}function U(t){t.classList.add("rs-page-hidden"),t.setAttribute("aria-hidden","true")}function te(t){var n;return(n=t.components)==null?void 0:n.default}function pe(t){const n=te(t);return n!==void 0&&typeof n=="object"&&"name"in n&&n.name==="RouterView"}const Pe=s.defineComponent({name:"RouterOutlet",setup(){const t=ee(),n=R.useRoute(),c=s.inject(R.routeLocationKey),l=s.inject(R.matchedRouteKey,void 0),f=s.computed(()=>{const e=l==null?void 0:l.value;if(!e)return 0;const o=n.matched.findIndex(h=>h===e);return o>=0?o+1:0}),g=s.computed(()=>n.matched[f.value]),w=s.computed(()=>{for(let e=f.value;e<n.matched.length;e++){const o=n.matched[e];if(!pe(o))return o}return g.value}),k=s.shallowRef([]),P=s.ref("");let m=0;s.provide(R.matchedRouteKey,w);const i=e=>k.value.find(o=>o.id===e),E=e=>k.value.find(o=>o.routeIds.has(e)),p=e=>k.value.find(o=>o.routeKey===e),F=e=>e.action==="push"&&e.direction==="forward"&&!e.reuse&&k.value.some(o=>o.routeKey===e.key),T=e=>{k.value.forEach(o=>{o.pageElement&&(o===e?D(o.pageElement):U(o.pageElement))})},K=e=>{const o=t.history.findIndex(a=>a.id===e.routeInfo.id);if(o<0)return;const h=new Set(t.history.slice(0,o+1).map(a=>a.id));k.value.forEach(a=>{a.routeIds=new Set([...a.routeIds].filter(r=>h.has(r)))}),k.value=k.value.filter(a=>a===e||a.routeIds.size>0)},W=e=>{k.value=k.value.filter(o=>o!==e)},L=e=>{const o=new Set(t.history.map(h=>h.id));k.value.forEach(h=>{h.routeIds=new Set([...h.routeIds].filter(a=>o.has(a)))}),k.value=k.value.filter(h=>h===e||h.routeInfo.cache&&h.routeIds.size>0)},I=e=>{var h;const o=e.props.default;return o?o===!0?((h=t.current.value)==null?void 0:h.params)??{}:typeof o=="function"?o(c):o:{}},G=(e,o)=>e.routeInfo.action==="pop"?o.routeInfo.transition??e.routeInfo.transition??t.transition:e.routeInfo.transition??t.transition,x=e=>e.entryDirection==="none"||e.entryDirection==="root"||e.transition==="none",$=(e,o)=>!(e.routeInfo.isStackFallback||e.routeInfo.direction==="none"||e.routeInfo.direction==="root"||e.routeInfo.action==="pop"&&(x(e.routeInfo)||x(o.routeInfo))),A=(e,o)=>{var a;const h=$(e,o);return((a=t.shouldTransition)==null?void 0:a.call(t,{action:e.routeInfo.action,direction:e.routeInfo.direction,source:e.routeInfo.source,entering:e.routeInfo,leaving:o.routeInfo,defaultResult:h}))??h},j=(e,o)=>e.routeInfo.action==="pop"?o.routeInfo.transitionDuration??e.routeInfo.transitionDuration??t.transitionDuration:e.routeInfo.transitionDuration??t.transitionDuration,B=(e,o)=>e.routeInfo.action==="pop"?o.routeInfo.transitionEasing??e.routeInfo.transitionEasing??t.transitionEasing:e.routeInfo.transitionEasing??t.transitionEasing,V=async(e,o)=>{const h=++m;await s.nextTick();const a=e.pageElement;if(!a)return;if(S(e.componentRef,v),!o||o===e||!o.pageElement){D(a),S(e.componentRef,J),L(e),T(e);return}const r=o.pageElement,u=A(e,o),d=u?G(e,o):"none",y=u?j(e,o):0,b=B(e,o),M=ue(d||Q,t.transitions);S(o.componentRef,N),D(a),D(r),await le(M,{direction:e.routeInfo.direction,action:e.routeInfo.action,routeInfo:e.routeInfo,enteringElement:a,leavingElement:r,duration:y,easing:b}),h===m&&(U(r),S(o.componentRef,O),S(e.componentRef,J),e.routeInfo.action==="pop"?K(e):e.routeInfo.action==="replace"&&W(o),L(e),T(e))},_=async()=>{const e=w.value,o=t.current.value;if(!e||!o)return;const h=te(e);if(!h)return;const a=i(P.value);let r=E(o.id);!r&&!F(o)&&(r=p(o.key)),r?(r.routeIds.add(o.id),r.routeKey=o.key,r.routeInfo=o,r.matchedRoute=e,r.component=h,r.props=I(e),r.mounted=!0):(r={id:X("view"),routeKey:o.key,routeIds:new Set([o.id]),routeInfo:o,matchedRoute:e,component:h,props:I(e),componentRef:s.ref(),mounted:!0},k.value=[...k.value,r]),P.value=r.id,await V(r,a)};return s.watch(()=>{var e;return[(e=t.current.value)==null?void 0:e.id,w.value]},()=>{_()},{immediate:!0}),s.onUnmounted(()=>{m++,k.value=[]}),{injectedRoute:c,viewItems:k,registerStackPage:(e,o)=>{e.pageElement=o,e.id===P.value?D(o):U(o)}}},render(){return s.h("div",{class:"rs-outlet"},this.viewItems.filter(t=>t.mounted).map(t=>s.h(t.component,{key:t.id,ref:t.componentRef,...t.props,registerStackPage:n=>this.registerStackPage(t,n)})))}}),we=s.defineComponent({name:"RouterPage",props:{registerStackPage:{type:Function,default:void 0}},setup(t,{attrs:n,slots:c}){const l=s.ref();return s.onMounted(()=>{var f;l.value&&((f=t.registerStackPage)==null||f.call(t,l.value))}),()=>{var f;return s.h("section",{...n,ref:l,class:["rs-page",n.class]},(f=c.default)==null?void 0:f.call(c))}}}),Ee=s.defineComponent({name:"StackRouterDebugPanel",props:{initialOpen:{type:Boolean,default:!1}},setup(t){const n=ee(),c=s.ref(t.initialOpen);return()=>{const l=n.current.value;return s.h("aside",{class:"rs-debug-panel"},[s.h("button",{class:"rs-debug-toggle",type:"button",onClick:()=>{c.value=!c.value}},c.value?"Stack x":"Stack"),c.value?s.h("section",{class:"rs-debug-body"},[s.h("header",[s.h("strong","Router Stack"),s.h("span",`${n.history.length} pages`)]),s.h("dl",[s.h("dt","current"),s.h("dd",(l==null?void 0:l.fullPath)??"-"),s.h("dt","canGoBack"),s.h("dd",String(n.canGoBack()))]),s.h("ol",n.history.map(f=>s.h("li",{key:f.id,class:{"rs-debug-active":f.id===(l==null?void 0:l.id),"rs-debug-no-cache":!f.cache}},[s.h("code",f.fullPath),s.h("span",[`${f.action}/${f.direction}`,` source:${f.source}`,` entry:${f.entryDirection}`,` cache:${f.cache?"yes":"no"}`,` transition:${f.transition??"-"}`])])))]):void 0])}}});Object.defineProperty(exports,"RouterLink",{enumerable:!0,get:()=>R.RouterLink});Object.defineProperty(exports,"RouterView",{enumerable:!0,get:()=>R.RouterView});Object.defineProperty(exports,"createMemoryHistory",{enumerable:!0,get:()=>R.createMemoryHistory});Object.defineProperty(exports,"createWebHashHistory",{enumerable:!0,get:()=>R.createWebHashHistory});Object.defineProperty(exports,"createWebHistory",{enumerable:!0,get:()=>R.createWebHistory});Object.defineProperty(exports,"useRoute",{enumerable:!0,get:()=>R.useRoute});Object.defineProperty(exports,"useRouter",{enumerable:!0,get:()=>R.useRouter});exports.RouterOutlet=Pe;exports.RouterPage=we;exports.StackRouterDebugPanel=Ee;exports.createStackRouter=fe;exports.defineStackTransition=oe;exports.onPageDidEnter=ye;exports.onPageDidLeave=Re;exports.onPageWillEnter=me;exports.onPageWillLeave=ke;exports.stackRouterKey=H;exports.useStackRouter=be;
@@ -1,16 +1,16 @@
1
- import { shallowRef as et, getCurrentInstance as it, inject as F, defineComponent as Q, h as k, computed as X, ref as C, provide as st, watch as ut, onUnmounted as lt, nextTick as dt, onMounted as ft } from "vue";
2
- import { createRouter as ht, useRoute as mt, routeLocationKey as yt, matchedRouteKey as N } from "vue-router";
3
- import { RouterLink as zt, RouterView as jt, createMemoryHistory as Ut, createWebHashHistory as Xt, createWebHistory as Mt, useRoute as qt, useRouter as vt } from "vue-router";
1
+ import { shallowRef as te, getCurrentInstance as se, inject as F, defineComponent as Y, h as k, computed as X, ref as C, provide as ie, watch as ue, onUnmounted as le, nextTick as de, onMounted as fe } from "vue";
2
+ import { createRouter as he, useRoute as me, routeLocationKey as ye, matchedRouteKey as v } from "vue-router";
3
+ import { RouterLink as ze, RouterView as je, createMemoryHistory as Ue, createWebHashHistory as Xe, createWebHistory as Me, useRoute as qe, useRouter as Je } from "vue-router";
4
4
  const O = {};
5
- function v(e = "route") {
6
- const n = (O[e] ?? 0) + 1;
7
- return O[e] = n, `${e}-${n}`;
5
+ function J(t = "route") {
6
+ const n = (O[t] ?? 0) + 1;
7
+ return O[t] = n, `${t}-${n}`;
8
8
  }
9
- const Y = "slide", kt = "cubic-bezier(0.3, 0, 0.66, 1)";
10
- function Lt(e) {
11
- return e;
9
+ const Z = "slide", ke = "cubic-bezier(0.3, 0, 0.66, 1)";
10
+ function Le(t) {
11
+ return t;
12
12
  }
13
- const pt = ({ direction: e }) => e === "back" ? {
13
+ const Re = ({ direction: t }) => t === "back" ? {
14
14
  leaving: [
15
15
  { transform: "translateX(0)" },
16
16
  { transform: "translateX(100%)" }
@@ -20,11 +20,11 @@ const pt = ({ direction: e }) => e === "back" ? {
20
20
  { transform: "translateX(100%)" },
21
21
  { transform: "translateX(0)" }
22
22
  ]
23
- }, Rt = () => ({
23
+ }, pe = () => ({
24
24
  entering: [{ opacity: 0 }, { opacity: 1 }],
25
25
  leaving: [{ opacity: 1 }, { opacity: 0 }]
26
- }), Et = ({ direction: e }) => {
27
- const n = e === "back";
26
+ }), we = ({ direction: t }) => {
27
+ const n = t === "back";
28
28
  return {
29
29
  entering: n ? [
30
30
  { transform: "scale(0.98)", opacity: 0 },
@@ -41,224 +41,228 @@ const pt = ({ direction: e }) => e === "back" ? {
41
41
  { transform: "scale(0.98)", opacity: 0 }
42
42
  ]
43
43
  };
44
- }, wt = () => ({}), bt = {
45
- slide: pt,
46
- fade: Rt,
47
- scale: Et,
48
- none: wt
44
+ }, Ee = () => ({}), be = {
45
+ slide: Re,
46
+ fade: pe,
47
+ scale: we,
48
+ none: Ee
49
49
  };
50
- function Pt(e, n) {
51
- const a = n[e];
52
- return a || n[Y];
50
+ function Ie(t, n) {
51
+ const c = n[t];
52
+ return c || n[Z];
53
53
  }
54
- function tt(e, n, a) {
55
- if (!n || !e.animate || Number(a.duration) <= 0)
54
+ function ee(t, n, c) {
55
+ if (!n || !t.animate || Number(c.duration) <= 0)
56
56
  return Promise.resolve();
57
- const u = e.animate(n, a);
57
+ const u = t.animate(n, c);
58
58
  return u.finished.then(() => u.cancel());
59
59
  }
60
- async function It(e, n) {
61
- const a = e(n), u = {
60
+ async function Pe(t, n) {
61
+ const c = t(n), u = {
62
62
  duration: n.duration,
63
63
  easing: n.easing,
64
64
  fill: "both",
65
- ...a.options
65
+ ...c.options
66
66
  };
67
67
  await Promise.all([
68
- tt(n.enteringElement, a.entering, u),
69
- tt(n.leavingElement, a.leaving, u)
68
+ ee(n.enteringElement, c.entering, u),
69
+ ee(n.leavingElement, c.leaving, u)
70
70
  ]);
71
71
  }
72
- const Z = Symbol("stack-router");
73
- function St() {
74
- const e = window.history.state;
75
- return typeof (e == null ? void 0 : e.position) == "number" ? e.position : window.history.length;
72
+ const N = Symbol("stack-router");
73
+ function Se() {
74
+ const t = window.history.state;
75
+ return typeof (t == null ? void 0 : t.position) == "number" ? t.position : window.history.length;
76
76
  }
77
- function M(e, n) {
78
- return n || (e === "pop" ? "back" : e === "replace" ? "none" : "forward");
77
+ function M(t, n) {
78
+ return n || (t === "pop" ? "back" : t === "replace" ? "none" : "forward");
79
79
  }
80
- function At(e) {
81
- const n = ht(e), a = [], u = et(), l = e.transitionDuration ?? 210, D = e.transitionEasing ?? kt, w = e.transition ?? Y, y = {
82
- ...bt,
83
- ...e.transitions
84
- }, E = e.maxStackSize ?? 30;
80
+ function Ae(t) {
81
+ const n = he(t), c = [], u = te(), d = t.transitionDuration ?? 210, D = t.transitionEasing ?? ke, E = t.transition ?? Z, y = {
82
+ ...be,
83
+ ...t.transitions
84
+ }, w = t.maxStackSize ?? 30;
85
85
  let h = -1, s, b = !1;
86
- const R = (c, o, i, d, m = !1, p = "stack") => {
86
+ const p = (a, r, i, l, m = !1, R = "stack") => {
87
87
  s = {
88
- action: c,
89
- direction: M(c, o),
90
- source: p,
88
+ action: a,
89
+ direction: M(a, r),
90
+ source: R,
91
91
  delta: i,
92
- transition: d == null ? void 0 : d.transition,
93
- duration: d == null ? void 0 : d.duration,
94
- easing: d == null ? void 0 : d.easing,
92
+ reuse: l == null ? void 0 : l.reuse,
93
+ transition: l == null ? void 0 : l.transition,
94
+ duration: l == null ? void 0 : l.duration,
95
+ easing: l == null ? void 0 : l.easing,
95
96
  resetRoot: m
96
97
  };
97
- }, H = (c, o) => {
98
- const i = (s == null ? void 0 : s.action) ?? "push", d = M(i, s == null ? void 0 : s.direction), m = u.value, p = i === "push" && d === "forward", U = T(c);
98
+ }, H = (a, r) => {
99
+ const i = (s == null ? void 0 : s.action) ?? "push", l = M(i, s == null ? void 0 : s.direction), m = u.value, R = i === "push" && l === "forward", U = T(a);
99
100
  return {
100
- id: v("route"),
101
- key: c.fullPath,
102
- fullPath: c.fullPath,
103
- pathname: c.path,
104
- params: c.params,
105
- query: c.query,
101
+ id: J("route"),
102
+ key: a.fullPath,
103
+ fullPath: a.fullPath,
104
+ pathname: a.path,
105
+ params: a.params,
106
+ query: a.query,
106
107
  action: i,
107
- direction: d,
108
+ direction: l,
109
+ reuse: (s == null ? void 0 : s.reuse) ?? !1,
108
110
  source: (s == null ? void 0 : s.source) ?? "stack",
109
- entryDirection: d,
110
- lastPathname: (m == null ? void 0 : m.pathname) || (o.name ? o.path : void 0),
111
- pushedByRoute: p ? m == null ? void 0 : m.pathname : m == null ? void 0 : m.pushedByRoute,
112
- position: St(),
111
+ entryDirection: l,
112
+ lastPathname: (m == null ? void 0 : m.pathname) || (r.name ? r.path : void 0),
113
+ pushedByRoute: R ? m == null ? void 0 : m.pathname : m == null ? void 0 : m.pushedByRoute,
114
+ position: Se(),
113
115
  delta: s == null ? void 0 : s.delta,
114
- transition: (s == null ? void 0 : s.transition) ?? w,
115
- transitionDuration: (s == null ? void 0 : s.duration) ?? l,
116
+ transition: (s == null ? void 0 : s.transition) ?? E,
117
+ transitionDuration: (s == null ? void 0 : s.duration) ?? d,
116
118
  transitionEasing: (s == null ? void 0 : s.easing) ?? D,
117
119
  cache: U
118
120
  };
119
- }, T = (c) => {
120
- const o = c.meta.stack;
121
- return c.meta.stackCache !== !1 && (o == null ? void 0 : o.cache) !== !1;
121
+ }, T = (a) => {
122
+ const r = a.meta.stack;
123
+ return a.meta.stackCache !== !1 && (r == null ? void 0 : r.cache) !== !1;
122
124
  }, K = () => {
123
- if (E <= 0 || a.length <= E) return;
124
- const c = a.length - E;
125
- a.splice(0, c), h = Math.max(0, h - c);
126
- }, $ = (c) => {
127
- if (c.action === "pop") {
128
- let o = -1;
129
- if (c.direction === "forward" || (c.delta ?? 0) > 0) {
130
- for (let i = h + 1; i < a.length; i++)
131
- if (a[i].key === c.key) {
132
- o = i;
125
+ if (w <= 0 || c.length <= w) return;
126
+ const a = c.length - w;
127
+ c.splice(0, a), h = Math.max(0, h - a);
128
+ }, $ = (a) => {
129
+ if (a.action === "pop") {
130
+ let r = -1;
131
+ if (a.direction === "forward" || (a.delta ?? 0) > 0) {
132
+ for (let i = h + 1; i < c.length; i++)
133
+ if (c[i].key === a.key) {
134
+ r = i;
133
135
  break;
134
136
  }
135
137
  } else
136
138
  for (let i = h - 1; i >= 0; i--)
137
- if (a[i].key === c.key) {
138
- o = i;
139
+ if (c[i].key === a.key) {
140
+ r = i;
139
141
  break;
140
142
  }
141
- if (o >= 0) {
142
- const i = a[o];
143
- a[o] = {
143
+ if (r >= 0) {
144
+ const i = c[r];
145
+ c[r] = {
144
146
  ...i,
145
- ...c,
147
+ ...a,
146
148
  id: i.id,
147
- source: c.source,
149
+ reuse: i.reuse,
150
+ source: a.source,
148
151
  entryDirection: i.entryDirection,
149
152
  transition: i.transition,
150
153
  transitionDuration: i.transitionDuration,
151
154
  transitionEasing: i.transitionEasing
152
- }, h = o;
155
+ }, h = r;
153
156
  } else
154
- a.push({
155
- ...c,
157
+ c.push({
158
+ ...a,
156
159
  direction: "none",
157
160
  entryDirection: "none",
158
161
  transition: "none",
159
162
  isStackFallback: !0
160
- }), h = a.length - 1;
161
- } else if (c.action === "replace") {
163
+ }), h = c.length - 1;
164
+ } else if (a.action === "replace") {
162
165
  if (s != null && s.resetRoot) {
163
- a.splice(0, a.length, c), h = 0, u.value = a[h];
166
+ c.splice(0, c.length, a), h = 0, u.value = c[h];
164
167
  return;
165
168
  }
166
- h >= 0 ? a[h] = c : (a.push(c), h = 0);
169
+ h >= 0 ? c[h] = a : (c.push(a), h = 0);
167
170
  } else
168
- h < a.length - 1 && a.splice(h + 1), a.push(c), h = a.length - 1;
169
- K(), u.value = a[h];
171
+ h < c.length - 1 && c.splice(h + 1), c.push(a), h = c.length - 1;
172
+ K(), u.value = c[h];
170
173
  };
171
- e.history.listen((c, o, i) => {
172
- const d = "delta" in i ? i.delta : void 0, m = i.direction === "back" ? "back" : i.direction === "forward" ? "forward" : void 0;
173
- s ? (s.delta = d, s.direction = M(
174
+ t.history.listen((a, r, i) => {
175
+ const l = "delta" in i ? i.delta : void 0, m = i.direction === "back" ? "back" : i.direction === "forward" ? "forward" : void 0;
176
+ s ? (s.delta = l, s.direction = M(
174
177
  s.action,
175
178
  s.direction ?? m
176
- )) : R(
179
+ )) : p(
177
180
  i.type === "pop" ? "pop" : i.type,
178
181
  m,
179
- d,
182
+ l,
180
183
  void 0,
181
184
  !1,
182
185
  "external"
183
186
  );
184
- }), n.beforeEach((c) => !((s == null ? void 0 : s.action) === "pop" && b && !a.some((o) => o.fullPath === c.fullPath))), n.afterEach((c, o, i) => {
187
+ }), n.beforeEach((a) => !((s == null ? void 0 : s.action) === "pop" && b && !c.some((r) => r.fullPath === a.fullPath))), n.afterEach((a, r, i) => {
185
188
  if (i) {
186
189
  s = void 0;
187
190
  return;
188
191
  }
189
- $(H(c, o)), s = void 0;
192
+ $(H(a, r)), s = void 0;
190
193
  });
191
- const g = n.push.bind(n), P = n.replace.bind(n), W = n.back.bind(n), x = n.forward.bind(n), z = n.go.bind(n), L = (c, o) => (R(
194
+ const g = n.push.bind(n), I = n.replace.bind(n), W = n.back.bind(n), x = n.forward.bind(n), z = n.go.bind(n), L = (a, r) => (p(
192
195
  "push",
193
- (o == null ? void 0 : o.direction) ?? "forward",
196
+ (r == null ? void 0 : r.direction) ?? "forward",
194
197
  void 0,
195
- o
196
- ), g(c)), A = (c, o) => (R(
198
+ r
199
+ ), g(a)), A = (a, r) => (p(
197
200
  "replace",
198
- (o == null ? void 0 : o.direction) ?? "root",
201
+ (r == null ? void 0 : r.direction) ?? "root",
199
202
  void 0,
200
- o
201
- ), P(c)), B = (c, o) => {
202
- const i = n.resolve(c).fullPath;
203
- let d = -1;
204
- for (let p = h; p >= 0; p--)
205
- if (a[p].fullPath === i) {
206
- d = p;
203
+ r
204
+ ), I(a)), B = (a, r) => {
205
+ const i = n.resolve(a).fullPath;
206
+ let l = -1;
207
+ for (let R = h; R >= 0; R--)
208
+ if (c[R].fullPath === i) {
209
+ l = R;
207
210
  break;
208
211
  }
209
- if (d < 0) return !1;
210
- const m = d - h;
211
- return m === 0 || (R(
212
+ if (l < 0) return !1;
213
+ const m = l - h;
214
+ return m === 0 || (p(
212
215
  "pop",
213
- (o == null ? void 0 : o.direction) ?? "back",
216
+ (r == null ? void 0 : r.direction) ?? "back",
214
217
  m,
215
- o
218
+ r
216
219
  ), z(m)), !0;
217
- }, _ = (c, o) => {
218
- const i = n.resolve(c).fullPath;
220
+ }, _ = (a, r) => {
221
+ const i = n.resolve(a).fullPath;
219
222
  if (h >= 0 && n.currentRoute.value.fullPath === i) {
220
- const d = a[h], m = {
221
- ...d,
222
- id: v("route"),
223
+ const l = c[h], m = {
224
+ ...l,
225
+ id: J("route"),
223
226
  action: "replace",
224
- direction: (o == null ? void 0 : o.direction) ?? "root",
227
+ direction: (r == null ? void 0 : r.direction) ?? "root",
225
228
  source: "stack",
226
- entryDirection: (o == null ? void 0 : o.direction) ?? "root",
229
+ entryDirection: (r == null ? void 0 : r.direction) ?? "root",
227
230
  delta: void 0,
228
- transition: (o == null ? void 0 : o.transition) ?? d.transition,
229
- transitionDuration: (o == null ? void 0 : o.duration) ?? d.transitionDuration,
230
- transitionEasing: (o == null ? void 0 : o.easing) ?? d.transitionEasing,
231
+ reuse: (r == null ? void 0 : r.reuse) ?? l.reuse,
232
+ transition: (r == null ? void 0 : r.transition) ?? l.transition,
233
+ transitionDuration: (r == null ? void 0 : r.duration) ?? l.transitionDuration,
234
+ transitionEasing: (r == null ? void 0 : r.easing) ?? l.transitionEasing,
231
235
  cache: !0,
232
236
  isStackFallback: !1
233
237
  };
234
- return a.splice(0, a.length, m), h = 0, b = !0, u.value = m, Promise.resolve(void 0);
238
+ return c.splice(0, c.length, m), h = 0, b = !0, u.value = m, Promise.resolve(void 0);
235
239
  }
236
- return R(
240
+ return p(
237
241
  "replace",
238
- (o == null ? void 0 : o.direction) ?? "root",
242
+ (r == null ? void 0 : r.direction) ?? "root",
239
243
  void 0,
240
- o,
244
+ r,
241
245
  !0
242
- ), b = !0, P(c);
246
+ ), b = !0, I(a);
243
247
  }, V = () => {
244
- R("pop", "back", -1), W();
248
+ p("pop", "back", -1), W();
245
249
  }, j = () => {
246
- R("pop", "forward", 1), x();
247
- }, t = n;
248
- t.push = L, t.replace = A, t.popTo = B, t.resetRoot = _, t.back = V, t.forward = j;
249
- const r = {
250
- router: t,
251
- transitionDuration: l,
250
+ p("pop", "forward", 1), x();
251
+ }, e = n;
252
+ e.push = L, e.replace = A, e.popTo = B, e.resetRoot = _, e.back = V, e.forward = j;
253
+ const o = {
254
+ router: e,
255
+ transitionDuration: d,
252
256
  transitionEasing: D,
253
- transition: w,
257
+ transition: E,
254
258
  transitions: y,
255
- maxStackSize: E,
256
- shouldTransition: e.shouldTransition,
259
+ maxStackSize: w,
260
+ shouldTransition: t.shouldTransition,
257
261
  current: u,
258
262
  get history() {
259
- return a;
263
+ return c;
260
264
  },
261
- canGoBack: (c = 1) => h - c >= 0,
265
+ canGoBack: (a = 1) => h - a >= 0,
262
266
  push: L,
263
267
  replace: A,
264
268
  popTo: B,
@@ -266,176 +270,188 @@ function At(e) {
266
270
  back: V,
267
271
  forward: j
268
272
  }, f = n.install.bind(n);
269
- return n.install = (c) => {
270
- c.provide(Z, r), f(c);
271
- }, t;
273
+ return n.install = (a) => {
274
+ a.provide(N, o), f(a);
275
+ }, e;
272
276
  }
273
- const ot = "onPageWillEnter", J = "onPageDidEnter", rt = "onPageWillLeave", nt = "onPageDidLeave";
274
- function Dt(e, n, a) {
275
- if (!a)
276
- throw new Error(`${e} must be called inside setup().`);
277
- const u = a.proxy, l = u[e] ?? [];
278
- l.push(() => {
279
- a.isUnmounted || n();
280
- }), u[e] = l, a.exposed && (a.exposed[e] = l);
277
+ const re = "onPageWillEnter", Q = "onPageDidEnter", oe = "onPageWillLeave", ne = "onPageDidLeave";
278
+ function De(t, n, c) {
279
+ if (!c)
280
+ throw new Error(`${t} must be called inside setup().`);
281
+ const u = c.proxy, d = u[t] ?? [];
282
+ d.push(() => {
283
+ c.isUnmounted || n();
284
+ }), u[t] = d, c.exposed && (c.exposed[t] = d);
281
285
  }
282
- function G(e) {
283
- return (n, a = it()) => Dt(e, n, a);
286
+ function G(t) {
287
+ return (n, c = se()) => De(t, n, c);
284
288
  }
285
- const Bt = G(ot), _t = G(J), Vt = G(rt), Ft = G(nt);
286
- function Ct() {
287
- const e = F(Z);
288
- if (!e)
289
+ const Be = G(re), _e = G(Q), Ve = G(oe), Fe = G(ne);
290
+ function Ce() {
291
+ const t = F(N);
292
+ if (!t)
289
293
  throw new Error("useStackRouter must be used after createStackRouter().");
290
294
  return {
291
- router: e.router,
292
- canGoBack: e.canGoBack,
293
- push: e.push,
294
- replace: e.replace,
295
- popTo: e.popTo,
296
- resetRoot: e.resetRoot,
297
- back: e.back,
298
- forward: e.forward
295
+ router: t.router,
296
+ canGoBack: t.canGoBack,
297
+ push: t.push,
298
+ replace: t.replace,
299
+ popTo: t.popTo,
300
+ resetRoot: t.resetRoot,
301
+ back: t.back,
302
+ forward: t.forward
299
303
  };
300
304
  }
301
- function at() {
302
- const e = F(Z);
303
- if (!e)
305
+ function ae() {
306
+ const t = F(N);
307
+ if (!t)
304
308
  throw new Error("RouterOutlet must be used with createStackRouter().");
305
- return e;
309
+ return t;
306
310
  }
307
- function I(e, n) {
308
- const a = e.value;
309
- if (!a) return;
310
- const u = a[n];
311
- Array.isArray(u) ? u.forEach((l) => l()) : typeof u == "function" && u.call(a);
311
+ function P(t, n) {
312
+ const c = t.value;
313
+ if (!c) return;
314
+ const u = c[n];
315
+ Array.isArray(u) ? u.forEach((d) => d()) : typeof u == "function" && u.call(c);
312
316
  }
313
- function S(e) {
314
- e.classList.remove("rs-page-hidden", "rs-page-invisible"), e.removeAttribute("aria-hidden");
317
+ function S(t) {
318
+ t.classList.remove("rs-page-hidden", "rs-page-invisible"), t.removeAttribute("aria-hidden");
315
319
  }
316
- function q(e) {
317
- e.classList.add("rs-page-hidden"), e.setAttribute("aria-hidden", "true");
320
+ function q(t) {
321
+ t.classList.add("rs-page-hidden"), t.setAttribute("aria-hidden", "true");
318
322
  }
319
- function ct(e) {
323
+ function ce(t) {
320
324
  var n;
321
- return (n = e.components) == null ? void 0 : n.default;
325
+ return (n = t.components) == null ? void 0 : n.default;
322
326
  }
323
- function Tt(e) {
324
- const n = ct(e);
327
+ function Te(t) {
328
+ const n = ce(t);
325
329
  return n !== void 0 && typeof n == "object" && "name" in n && n.name === "RouterView";
326
330
  }
327
- const Gt = Q({
331
+ const Ge = Y({
328
332
  name: "RouterOutlet",
329
333
  setup() {
330
- const e = at(), n = mt(), a = F(yt), u = F(N, void 0), l = X(() => {
331
- const t = u == null ? void 0 : u.value;
332
- if (!t) return 0;
333
- const r = n.matched.findIndex(
334
- (f) => f === t
334
+ const t = ae(), n = me(), c = F(ye), u = F(v, void 0), d = X(() => {
335
+ const e = u == null ? void 0 : u.value;
336
+ if (!e) return 0;
337
+ const o = n.matched.findIndex(
338
+ (f) => f === e
335
339
  );
336
- return r >= 0 ? r + 1 : 0;
337
- }), D = X(() => n.matched[l.value]), w = X(() => {
338
- for (let t = l.value; t < n.matched.length; t++) {
339
- const r = n.matched[t];
340
- if (!Tt(r))
341
- return r;
340
+ return o >= 0 ? o + 1 : 0;
341
+ }), D = X(() => n.matched[d.value]), E = X(() => {
342
+ for (let e = d.value; e < n.matched.length; e++) {
343
+ const o = n.matched[e];
344
+ if (!Te(o))
345
+ return o;
342
346
  }
343
347
  return D.value;
344
- }), y = et([]), E = C("");
348
+ }), y = te([]), w = C("");
345
349
  let h = 0;
346
- st(N, w);
347
- const s = (t) => y.value.find((r) => r.id === t), b = (t) => y.value.find((r) => r.routeIds.has(t)), R = (t) => y.value.find((r) => r.routeKey === t), H = (t) => t.action === "push" && t.direction === "forward" && y.value.some((r) => r.routeKey === t.key), T = (t) => {
348
- y.value.forEach((r) => {
349
- r.pageElement && (r === t ? S(r.pageElement) : q(r.pageElement));
350
+ ie(v, E);
351
+ const s = (e) => y.value.find((o) => o.id === e), b = (e) => y.value.find((o) => o.routeIds.has(e)), p = (e) => y.value.find((o) => o.routeKey === e), H = (e) => e.action === "push" && e.direction === "forward" && !e.reuse && y.value.some((o) => o.routeKey === e.key), T = (e) => {
352
+ y.value.forEach((o) => {
353
+ o.pageElement && (o === e ? S(o.pageElement) : q(o.pageElement));
350
354
  });
351
- }, K = (t) => {
352
- const r = y.value.findIndex((f) => f === t);
353
- r >= 0 && (y.value = y.value.slice(0, r + 1));
354
- }, $ = (t) => {
355
- y.value = y.value.filter((r) => r !== t);
356
- }, g = (t) => {
357
- const r = new Set(
358
- e.history.map((f) => f.id)
355
+ }, K = (e) => {
356
+ const o = t.history.findIndex(
357
+ (a) => a.id === e.routeInfo.id
358
+ );
359
+ if (o < 0) return;
360
+ const f = new Set(
361
+ t.history.slice(0, o + 1).map((a) => a.id)
362
+ );
363
+ y.value.forEach((a) => {
364
+ a.routeIds = new Set(
365
+ [...a.routeIds].filter((r) => f.has(r))
366
+ );
367
+ }), y.value = y.value.filter(
368
+ (a) => a === e || a.routeIds.size > 0
369
+ );
370
+ }, $ = (e) => {
371
+ y.value = y.value.filter((o) => o !== e);
372
+ }, g = (e) => {
373
+ const o = new Set(
374
+ t.history.map((f) => f.id)
359
375
  );
360
376
  y.value.forEach((f) => {
361
377
  f.routeIds = new Set(
362
- [...f.routeIds].filter((c) => r.has(c))
378
+ [...f.routeIds].filter((a) => o.has(a))
363
379
  );
364
380
  }), y.value = y.value.filter(
365
- (f) => f === t || f.routeInfo.cache && f.routeIds.size > 0
381
+ (f) => f === e || f.routeInfo.cache && f.routeIds.size > 0
366
382
  );
367
- }, P = (t) => {
383
+ }, I = (e) => {
368
384
  var f;
369
- const r = t.props.default;
370
- return r ? r === !0 ? ((f = e.current.value) == null ? void 0 : f.params) ?? {} : typeof r == "function" ? r(a) : r : {};
371
- }, W = (t, r) => t.routeInfo.action === "pop" ? r.routeInfo.transition ?? t.routeInfo.transition ?? e.transition : t.routeInfo.transition ?? e.transition, x = (t) => t.entryDirection === "none" || t.entryDirection === "root" || t.transition === "none", z = (t, r) => !(t.routeInfo.isStackFallback || t.routeInfo.direction === "none" || t.routeInfo.direction === "root" || t.routeInfo.action === "pop" && (x(t.routeInfo) || x(r.routeInfo))), L = (t, r) => {
372
- var c;
373
- const f = z(t, r);
374
- return ((c = e.shouldTransition) == null ? void 0 : c.call(e, {
375
- action: t.routeInfo.action,
376
- direction: t.routeInfo.direction,
377
- source: t.routeInfo.source,
378
- entering: t.routeInfo,
379
- leaving: r.routeInfo,
385
+ const o = e.props.default;
386
+ return o ? o === !0 ? ((f = t.current.value) == null ? void 0 : f.params) ?? {} : typeof o == "function" ? o(c) : o : {};
387
+ }, W = (e, o) => e.routeInfo.action === "pop" ? o.routeInfo.transition ?? e.routeInfo.transition ?? t.transition : e.routeInfo.transition ?? t.transition, x = (e) => e.entryDirection === "none" || e.entryDirection === "root" || e.transition === "none", z = (e, o) => !(e.routeInfo.isStackFallback || e.routeInfo.direction === "none" || e.routeInfo.direction === "root" || e.routeInfo.action === "pop" && (x(e.routeInfo) || x(o.routeInfo))), L = (e, o) => {
388
+ var a;
389
+ const f = z(e, o);
390
+ return ((a = t.shouldTransition) == null ? void 0 : a.call(t, {
391
+ action: e.routeInfo.action,
392
+ direction: e.routeInfo.direction,
393
+ source: e.routeInfo.source,
394
+ entering: e.routeInfo,
395
+ leaving: o.routeInfo,
380
396
  defaultResult: f
381
397
  })) ?? f;
382
- }, A = (t, r) => t.routeInfo.action === "pop" ? r.routeInfo.transitionDuration ?? t.routeInfo.transitionDuration ?? e.transitionDuration : t.routeInfo.transitionDuration ?? e.transitionDuration, B = (t, r) => t.routeInfo.action === "pop" ? r.routeInfo.transitionEasing ?? t.routeInfo.transitionEasing ?? e.transitionEasing : t.routeInfo.transitionEasing ?? e.transitionEasing, _ = async (t, r) => {
398
+ }, A = (e, o) => e.routeInfo.action === "pop" ? o.routeInfo.transitionDuration ?? e.routeInfo.transitionDuration ?? t.transitionDuration : e.routeInfo.transitionDuration ?? t.transitionDuration, B = (e, o) => e.routeInfo.action === "pop" ? o.routeInfo.transitionEasing ?? e.routeInfo.transitionEasing ?? t.transitionEasing : e.routeInfo.transitionEasing ?? t.transitionEasing, _ = async (e, o) => {
383
399
  const f = ++h;
384
- await dt();
385
- const c = t.pageElement;
386
- if (!c) return;
387
- if (I(t.componentRef, ot), !r || r === t || !r.pageElement) {
388
- S(c), I(t.componentRef, J), g(t), T(t);
400
+ await de();
401
+ const a = e.pageElement;
402
+ if (!a) return;
403
+ if (P(e.componentRef, re), !o || o === e || !o.pageElement) {
404
+ S(a), P(e.componentRef, Q), g(e), T(e);
389
405
  return;
390
406
  }
391
- const o = r.pageElement, i = L(t, r), d = i ? W(t, r) : "none", m = i ? A(t, r) : 0, p = B(t, r), U = Pt(
392
- d || Y,
393
- e.transitions
407
+ const r = o.pageElement, i = L(e, o), l = i ? W(e, o) : "none", m = i ? A(e, o) : 0, R = B(e, o), U = Ie(
408
+ l || Z,
409
+ t.transitions
394
410
  );
395
- I(r.componentRef, rt), S(c), S(o), await It(U, {
396
- direction: t.routeInfo.direction,
397
- action: t.routeInfo.action,
398
- routeInfo: t.routeInfo,
399
- enteringElement: c,
400
- leavingElement: o,
411
+ P(o.componentRef, oe), S(a), S(r), await Pe(U, {
412
+ direction: e.routeInfo.direction,
413
+ action: e.routeInfo.action,
414
+ routeInfo: e.routeInfo,
415
+ enteringElement: a,
416
+ leavingElement: r,
401
417
  duration: m,
402
- easing: p
403
- }), f === h && (q(o), I(r.componentRef, nt), I(t.componentRef, J), t.routeInfo.action === "pop" ? K(t) : t.routeInfo.action === "replace" && $(r), g(t), T(t));
418
+ easing: R
419
+ }), f === h && (q(r), P(o.componentRef, ne), P(e.componentRef, Q), e.routeInfo.action === "pop" ? K(e) : e.routeInfo.action === "replace" && $(o), g(e), T(e));
404
420
  }, V = async () => {
405
- const t = w.value, r = e.current.value;
406
- if (!t || !r) return;
407
- const f = ct(t);
421
+ const e = E.value, o = t.current.value;
422
+ if (!e || !o) return;
423
+ const f = ce(e);
408
424
  if (!f) return;
409
- const c = s(E.value);
410
- let o = b(r.id);
411
- !o && !H(r) && (o = R(r.key)), o ? (o.routeIds.add(r.id), o.routeKey = r.key, o.routeInfo = r, o.matchedRoute = t, o.component = f, o.props = P(t), o.mounted = !0) : (o = {
412
- id: v("view"),
413
- routeKey: r.key,
414
- routeIds: /* @__PURE__ */ new Set([r.id]),
415
- routeInfo: r,
416
- matchedRoute: t,
425
+ const a = s(w.value);
426
+ let r = b(o.id);
427
+ !r && !H(o) && (r = p(o.key)), r ? (r.routeIds.add(o.id), r.routeKey = o.key, r.routeInfo = o, r.matchedRoute = e, r.component = f, r.props = I(e), r.mounted = !0) : (r = {
428
+ id: J("view"),
429
+ routeKey: o.key,
430
+ routeIds: /* @__PURE__ */ new Set([o.id]),
431
+ routeInfo: o,
432
+ matchedRoute: e,
417
433
  component: f,
418
- props: P(t),
434
+ props: I(e),
419
435
  componentRef: C(),
420
436
  mounted: !0
421
- }, y.value = [...y.value, o]), E.value = o.id, await _(o, c);
437
+ }, y.value = [...y.value, r]), w.value = r.id, await _(r, a);
422
438
  };
423
- return ut(
439
+ return ue(
424
440
  () => {
425
- var t;
426
- return [(t = e.current.value) == null ? void 0 : t.id, w.value];
441
+ var e;
442
+ return [(e = t.current.value) == null ? void 0 : e.id, E.value];
427
443
  },
428
444
  () => {
429
445
  V();
430
446
  },
431
447
  { immediate: !0 }
432
- ), lt(() => {
448
+ ), le(() => {
433
449
  h++, y.value = [];
434
450
  }), {
435
- injectedRoute: a,
451
+ injectedRoute: c,
436
452
  viewItems: y,
437
- registerStackPage: (t, r) => {
438
- t.pageElement = r, t.id === E.value ? S(r) : q(r);
453
+ registerStackPage: (e, o) => {
454
+ e.pageElement = o, e.id === w.value ? S(o) : q(o);
439
455
  }
440
456
  };
441
457
  },
@@ -443,17 +459,17 @@ const Gt = Q({
443
459
  return k(
444
460
  "div",
445
461
  { class: "rs-outlet" },
446
- this.viewItems.filter((e) => e.mounted).map(
447
- (e) => k(e.component, {
448
- key: e.id,
449
- ref: e.componentRef,
450
- ...e.props,
451
- registerStackPage: (n) => this.registerStackPage(e, n)
462
+ this.viewItems.filter((t) => t.mounted).map(
463
+ (t) => k(t.component, {
464
+ key: t.id,
465
+ ref: t.componentRef,
466
+ ...t.props,
467
+ registerStackPage: (n) => this.registerStackPage(t, n)
452
468
  })
453
469
  )
454
470
  );
455
471
  }
456
- }), Ht = Q({
472
+ }), He = Y({
457
473
  name: "RouterPage",
458
474
  props: {
459
475
  registerStackPage: {
@@ -461,13 +477,13 @@ const Gt = Q({
461
477
  default: void 0
462
478
  }
463
479
  },
464
- setup(e, { attrs: n, slots: a }) {
480
+ setup(t, { attrs: n, slots: c }) {
465
481
  const u = C();
466
- return ft(() => {
467
- var l;
468
- u.value && ((l = e.registerStackPage) == null || l.call(e, u.value));
482
+ return fe(() => {
483
+ var d;
484
+ u.value && ((d = t.registerStackPage) == null || d.call(t, u.value));
469
485
  }), () => {
470
- var l;
486
+ var d;
471
487
  return k(
472
488
  "section",
473
489
  {
@@ -475,11 +491,11 @@ const Gt = Q({
475
491
  ref: u,
476
492
  class: ["rs-page", n.class]
477
493
  },
478
- (l = a.default) == null ? void 0 : l.call(a)
494
+ (d = c.default) == null ? void 0 : d.call(c)
479
495
  );
480
496
  };
481
497
  }
482
- }), Kt = Q({
498
+ }), Ke = Y({
483
499
  name: "StackRouterDebugPanel",
484
500
  props: {
485
501
  initialOpen: {
@@ -487,8 +503,8 @@ const Gt = Q({
487
503
  default: !1
488
504
  }
489
505
  },
490
- setup(e) {
491
- const n = at(), a = C(e.initialOpen);
506
+ setup(t) {
507
+ const n = ae(), c = C(t.initialOpen);
492
508
  return () => {
493
509
  const u = n.current.value;
494
510
  return k("aside", { class: "rs-debug-panel" }, [
@@ -498,12 +514,12 @@ const Gt = Q({
498
514
  class: "rs-debug-toggle",
499
515
  type: "button",
500
516
  onClick: () => {
501
- a.value = !a.value;
517
+ c.value = !c.value;
502
518
  }
503
519
  },
504
- a.value ? "Stack x" : "Stack"
520
+ c.value ? "Stack x" : "Stack"
505
521
  ),
506
- a.value ? k("section", { class: "rs-debug-body" }, [
522
+ c.value ? k("section", { class: "rs-debug-body" }, [
507
523
  k("header", [
508
524
  k("strong", "Router Stack"),
509
525
  k("span", `${n.history.length} pages`)
@@ -517,23 +533,23 @@ const Gt = Q({
517
533
  k(
518
534
  "ol",
519
535
  n.history.map(
520
- (l) => k(
536
+ (d) => k(
521
537
  "li",
522
538
  {
523
- key: l.id,
539
+ key: d.id,
524
540
  class: {
525
- "rs-debug-active": l.id === (u == null ? void 0 : u.id),
526
- "rs-debug-no-cache": !l.cache
541
+ "rs-debug-active": d.id === (u == null ? void 0 : u.id),
542
+ "rs-debug-no-cache": !d.cache
527
543
  }
528
544
  },
529
545
  [
530
- k("code", l.fullPath),
546
+ k("code", d.fullPath),
531
547
  k("span", [
532
- `${l.action}/${l.direction}`,
533
- ` source:${l.source}`,
534
- ` entry:${l.entryDirection}`,
535
- ` cache:${l.cache ? "yes" : "no"}`,
536
- ` transition:${l.transition ?? "-"}`
548
+ `${d.action}/${d.direction}`,
549
+ ` source:${d.source}`,
550
+ ` entry:${d.entryDirection}`,
551
+ ` cache:${d.cache ? "yes" : "no"}`,
552
+ ` transition:${d.transition ?? "-"}`
537
553
  ])
538
554
  ]
539
555
  )
@@ -545,22 +561,22 @@ const Gt = Q({
545
561
  }
546
562
  });
547
563
  export {
548
- zt as RouterLink,
549
- Gt as RouterOutlet,
550
- Ht as RouterPage,
551
- jt as RouterView,
552
- Kt as StackRouterDebugPanel,
553
- Ut as createMemoryHistory,
554
- At as createStackRouter,
555
- Xt as createWebHashHistory,
556
- Mt as createWebHistory,
557
- Lt as defineStackTransition,
558
- _t as onPageDidEnter,
559
- Ft as onPageDidLeave,
560
- Bt as onPageWillEnter,
561
- Vt as onPageWillLeave,
562
- Z as stackRouterKey,
563
- qt as useRoute,
564
- vt as useRouter,
565
- Ct as useStackRouter
564
+ ze as RouterLink,
565
+ Ge as RouterOutlet,
566
+ He as RouterPage,
567
+ je as RouterView,
568
+ Ke as StackRouterDebugPanel,
569
+ Ue as createMemoryHistory,
570
+ Ae as createStackRouter,
571
+ Xe as createWebHashHistory,
572
+ Me as createWebHistory,
573
+ Le as defineStackTransition,
574
+ _e as onPageDidEnter,
575
+ Fe as onPageDidLeave,
576
+ Be as onPageWillEnter,
577
+ Ve as onPageWillLeave,
578
+ N as stackRouterKey,
579
+ qe as useRoute,
580
+ Je as useRouter,
581
+ Ce as useStackRouter
566
582
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/vue-router-stack",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Page stack, caching, transitions, and lifecycle utilities built on vue-router.",
5
5
  "private": false,
6
6
  "type": "module",