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