@tanstack/vue-router
Advanced tools
| import * as Vue from 'vue'; | ||
| export type NonRouteComponent = 'pendingComponent' | 'errorComponent' | 'notFoundComponent'; | ||
| export declare const nonRouteComponentContext: Vue.InjectionKey<Vue.ComputedRef<NonRouteComponent>> | undefined; | ||
| export declare function renderInNonRouteComponentContext(component: Vue.Component, props: Record<string, any> | undefined, context: NonRouteComponent): Vue.VNode; |
| import * as Vue from "vue"; | ||
| //#region src/nonRouteComponentContext.tsx | ||
| var nonRouteComponentContext = process.env.NODE_ENV !== "production" ? Symbol("nonRouteComponentContext") : void 0; | ||
| var NonRouteComponentContextProvider = process.env.NODE_ENV !== "production" ? Vue.defineComponent({ | ||
| name: "NonRouteComponentContextProvider", | ||
| props: { value: { | ||
| type: String, | ||
| required: true | ||
| } }, | ||
| setup(props, { slots }) { | ||
| Vue.provide(nonRouteComponentContext, Vue.computed(() => props.value)); | ||
| return () => slots.default?.(); | ||
| } | ||
| }) : void 0; | ||
| function renderInNonRouteComponentContext(component, props, context) { | ||
| return Vue.h(NonRouteComponentContextProvider, { value: context }, { default: () => Vue.h(component, props) }); | ||
| } | ||
| //#endregion | ||
| export { nonRouteComponentContext, renderInNonRouteComponentContext }; | ||
| //# sourceMappingURL=nonRouteComponentContext.js.map |
| {"version":3,"file":"nonRouteComponentContext.js","names":["Vue","nonRouteComponentContext","process","env","NODE_ENV","Symbol","undefined","NonRouteComponentContextProvider","defineComponent","name","props","value","type","String","required","setup","slots","provide","computed","default","renderInNonRouteComponentContext","component","context","h"],"sources":["../../src/nonRouteComponentContext.tsx"],"sourcesContent":["import * as Vue from 'vue'\n\nexport type NonRouteComponent =\n | 'pendingComponent'\n | 'errorComponent'\n | 'notFoundComponent'\n\nexport const nonRouteComponentContext =\n process.env.NODE_ENV !== 'production'\n ? (Symbol('nonRouteComponentContext') as Vue.InjectionKey<\n Vue.ComputedRef<NonRouteComponent>\n >)\n : undefined\n\nconst NonRouteComponentContextProvider =\n process.env.NODE_ENV !== 'production'\n ? Vue.defineComponent({\n name: 'NonRouteComponentContextProvider',\n props: {\n value: {\n type: String as Vue.PropType<NonRouteComponent>,\n required: true,\n },\n },\n setup(props, { slots }) {\n Vue.provide(\n nonRouteComponentContext!,\n Vue.computed(() => props.value),\n )\n return () => slots.default?.()\n },\n })\n : undefined\n\nexport function renderInNonRouteComponentContext(\n component: Vue.Component,\n props: Record<string, any> | undefined,\n context: NonRouteComponent,\n): Vue.VNode {\n return Vue.h(\n NonRouteComponentContextProvider!,\n { value: context },\n { default: () => Vue.h(component, props) },\n )\n}\n"],"mappings":";;AAOA,IAAaC,2BAAAA,QAAAA,IAAAA,aACc,eACpBI,OAAO,0BAA0B,IAGlCC,KAAAA;AAEN,IAAMC,mCAAAA,QAAAA,IAAAA,aACqB,eACrBP,IAAIQ,gBAAgB;CAClBC,MAAM;CACNC,OAAO,EACLC,OAAO;EACLC,MAAMC;EACNC,UAAU;CACZ,EACF;CACAC,MAAML,OAAO,EAAEM,SAAS;EACtBhB,IAAIiB,QACFhB,0BACAD,IAAIkB,eAAeR,MAAMC,KAAK,CAChC;EACA,aAAaK,MAAMG,UAAU;CAC/B;AACF,CAAC,IACDb,KAAAA;AAEN,SAAgBc,iCACdC,WACAX,OACAY,SACW;CACX,OAAOtB,IAAIuB,EACThB,kCACA,EAAEI,OAAOW,QAAQ,GACjB,EAAEH,eAAenB,IAAIuB,EAAEF,WAAWX,KAAK,EAAE,CAC3C;AACF"} |
| import * as Vue from 'vue'; | ||
| export type NonRouteComponent = 'pendingComponent' | 'errorComponent' | 'notFoundComponent'; | ||
| export declare const nonRouteComponentContext: Vue.InjectionKey<Vue.ComputedRef<NonRouteComponent>> | undefined; | ||
| export declare function renderInNonRouteComponentContext(component: Vue.Component, props: Record<string, any> | undefined, context: NonRouteComponent): Vue.VNode; |
| import * as Vue from 'vue'; | ||
| export const nonRouteComponentContext = process.env.NODE_ENV !== 'production' | ||
| ? Symbol('nonRouteComponentContext') | ||
| : undefined; | ||
| const NonRouteComponentContextProvider = process.env.NODE_ENV !== 'production' | ||
| ? Vue.defineComponent({ | ||
| name: 'NonRouteComponentContextProvider', | ||
| props: { | ||
| value: { | ||
| type: String, | ||
| required: true, | ||
| }, | ||
| }, | ||
| setup(props, { slots }) { | ||
| Vue.provide(nonRouteComponentContext, Vue.computed(() => props.value)); | ||
| return () => slots.default?.(); | ||
| }, | ||
| }) | ||
| : undefined; | ||
| export function renderInNonRouteComponentContext(component, props, context) { | ||
| return Vue.h(NonRouteComponentContextProvider, { value: context }, { default: () => Vue.h(component, props) }); | ||
| } | ||
| //# sourceMappingURL=nonRouteComponentContext.jsx.map |
| {"version":3,"file":"nonRouteComponentContext.jsx","sourceRoot":"","sources":["../../src/nonRouteComponentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAO1B,MAAM,CAAC,MAAM,wBAAwB,GACnC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;IACnC,CAAC,CAAE,MAAM,CAAC,0BAA0B,CAEhC;IACJ,CAAC,CAAC,SAAS,CAAA;AAEf,MAAM,gCAAgC,GACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;IACnC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;QAClB,IAAI,EAAE,kCAAkC;QACxC,KAAK,EAAE;YACL,KAAK,EAAE;gBACL,IAAI,EAAE,MAAyC;gBAC/C,QAAQ,EAAE,IAAI;aACf;SACF;QACD,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE;YACpB,GAAG,CAAC,OAAO,CACT,wBAAyB,EACzB,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAChC,CAAA;YACD,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAA;QAChC,CAAC;KACF,CAAC;IACJ,CAAC,CAAC,SAAS,CAAA;AAEf,MAAM,UAAU,gCAAgC,CAC9C,SAAwB,EACxB,KAAsC,EACtC,OAA0B;IAE1B,OAAO,GAAG,CAAC,CAAC,CACV,gCAAiC,EACjC,EAAE,KAAK,EAAE,OAAO,EAAE,EAClB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAC3C,CAAA;AACH,CAAC"} |
| import * as Vue from 'vue' | ||
| export type NonRouteComponent = | ||
| | 'pendingComponent' | ||
| | 'errorComponent' | ||
| | 'notFoundComponent' | ||
| export const nonRouteComponentContext = | ||
| process.env.NODE_ENV !== 'production' | ||
| ? (Symbol('nonRouteComponentContext') as Vue.InjectionKey< | ||
| Vue.ComputedRef<NonRouteComponent> | ||
| >) | ||
| : undefined | ||
| const NonRouteComponentContextProvider = | ||
| process.env.NODE_ENV !== 'production' | ||
| ? Vue.defineComponent({ | ||
| name: 'NonRouteComponentContextProvider', | ||
| props: { | ||
| value: { | ||
| type: String as Vue.PropType<NonRouteComponent>, | ||
| required: true, | ||
| }, | ||
| }, | ||
| setup(props, { slots }) { | ||
| Vue.provide( | ||
| nonRouteComponentContext!, | ||
| Vue.computed(() => props.value), | ||
| ) | ||
| return () => slots.default?.() | ||
| }, | ||
| }) | ||
| : undefined | ||
| export function renderInNonRouteComponentContext( | ||
| component: Vue.Component, | ||
| props: Record<string, any> | undefined, | ||
| context: NonRouteComponent, | ||
| ): Vue.VNode { | ||
| return Vue.h( | ||
| NonRouteComponentContextProvider!, | ||
| { value: context }, | ||
| { default: () => Vue.h(component, props) }, | ||
| ) | ||
| } |
@@ -0,1 +1,2 @@ | ||
| import { renderInNonRouteComponentContext } from "./nonRouteComponentContext.js"; | ||
| import * as Vue from "vue"; | ||
@@ -29,6 +30,11 @@ //#region src/CatchBoundary.tsx | ||
| }); | ||
| return () => error.value ? Vue.h(props.errorComponent ?? ErrorComponent, { | ||
| error: error.value, | ||
| reset | ||
| }) : props.children; | ||
| return () => { | ||
| if (!error.value) return props.children; | ||
| const errorComponent = props.errorComponent ?? ErrorComponent; | ||
| const errorProps = { | ||
| error: error.value, | ||
| reset | ||
| }; | ||
| return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(errorComponent, errorProps, "errorComponent") : Vue.h(errorComponent, errorProps); | ||
| }; | ||
| } | ||
@@ -35,0 +41,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"CatchBoundary.js","names":["Vue","VueErrorBoundary","defineComponent","name","props","onError","Function","resetKey","String","Number","Object","children","errorComponent","setup","error","ref","reset","value","watch","newKey","oldKey","onErrorCaptured","err","Promise","then","h","ErrorComponent","CatchBoundary","getResetKey","onCatch","inheritAttrs","show","process","env","NODE_ENV","toggleShow","style","padding","maxWidth","display","alignItems","gap","fontSize","appearance","border","fontWeight","borderRadius","onClick","height","color","overflow","message"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport type { ErrorRouteComponent } from './route'\n\ntype CatchBoundaryProps = {\n getResetKey: () => unknown\n children: Vue.VNode\n errorComponent?: ErrorRouteComponent | Vue.Component\n onCatch?: (error: Error) => void\n}\n\nconst VueErrorBoundary = Vue.defineComponent({\n name: 'VueErrorBoundary',\n props: {\n onError: Function,\n resetKey: [String, Number, Object],\n children: null,\n errorComponent: null,\n },\n setup(props) {\n const error = Vue.ref<Error | null>(null)\n\n const reset = () => {\n error.value = null\n }\n\n Vue.watch(\n () => props.resetKey,\n (newKey, oldKey) => {\n if (newKey !== oldKey && error.value) {\n reset()\n }\n },\n )\n\n Vue.onErrorCaptured((err: Error) => {\n if (\n err instanceof Promise ||\n (err && typeof (err as any).then === 'function')\n ) {\n return false\n }\n\n error.value = err\n\n if (props.onError) {\n props.onError(err)\n }\n\n return false\n })\n\n return () =>\n error.value\n ? Vue.h(props.errorComponent ?? ErrorComponent, {\n error: error.value,\n reset,\n })\n : (props.children as Vue.VNode)\n },\n})\n\nexport function CatchBoundary(props: CatchBoundaryProps) {\n return Vue.h(VueErrorBoundary, {\n resetKey: props.getResetKey() as any,\n onError: props.onCatch,\n children: props.children,\n errorComponent: props.errorComponent,\n })\n}\nCatchBoundary.inheritAttrs = false\nCatchBoundary.props = ['getResetKey', 'children', 'errorComponent', 'onCatch']\n\nexport const ErrorComponent = Vue.defineComponent({\n name: 'ErrorComponent',\n props: {\n error: Object,\n reset: Function,\n },\n setup(props) {\n const show = Vue.ref(process.env.NODE_ENV !== 'production')\n\n const toggleShow = () => {\n show.value = !show.value\n }\n\n return () =>\n Vue.h('div', { style: { padding: '.5rem', maxWidth: '100%' } }, [\n Vue.h(\n 'div',\n { style: { display: 'flex', alignItems: 'center', gap: '.5rem' } },\n [\n Vue.h(\n 'strong',\n { style: { fontSize: '1rem' } },\n 'Something went wrong!',\n ),\n Vue.h(\n 'button',\n {\n style: {\n appearance: 'none',\n fontSize: '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n },\n onClick: toggleShow,\n },\n show.value ? 'Hide Error' : 'Show Error',\n ),\n ],\n ),\n Vue.h('div', { style: { height: '.25rem' } }),\n show.value\n ? Vue.h('div', {}, [\n Vue.h(\n 'pre',\n {\n style: {\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n },\n },\n [\n props.error?.message\n ? Vue.h('code', {}, props.error.message)\n : null,\n ],\n ),\n ])\n : null,\n ])\n },\n})\n"],"mappings":";;AAUA,IAAMC,mBAAmBD,IAAIE,gBAAgB;CAC3CC,MAAM;CACNC,OAAO;EACLC,SAASC;EACTC,UAAU;GAACC;GAAQC;GAAQC;EAAM;EACjCC,UAAU;EACVC,gBAAgB;CAClB;CACAC,MAAMT,OAAO;EACX,MAAMU,QAAQd,IAAIe,IAAkB,IAAI;EAExC,MAAMC,cAAc;GAClBF,MAAMG,QAAQ;EAChB;EAEAjB,IAAIkB,YACId,MAAMG,WACXY,QAAQC,WAAW;GAClB,IAAID,WAAWC,UAAUN,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AY;KACZC,cAAc;IAChB;IACAC,SAASZ;GACX,GACAJ,KAAKd,QAAQ,eAAe,YAC9B,CAAC,CAEL;GACAjB,IAAIyB,EAAE,OAAO,EAAEW,OAAO,EAAEY,QAAQ,SAAS,EAAE,CAAC;GAC5CjB,KAAKd,QACDjB,IAAIyB,EAAE,OAAO,CAAC,GAAG,CACfzB,IAAIyB,EACF,OACA,EACEW,OAAO;IACLM,UAAU;IACVE,QAAQ;IACRE,cAAc;IACdT,SAAS;IACTY,OAAO;IACPC,UAAU;GACZ,EACF,GACA,CACE9C,MAAMU,OAAOqC,UACTnD,IAAIyB,EAAE,QAAQ,CAAC,GAAGrB,MAAMU,MAAMqC,OAAO,IACrC,IAAI,CAEZ,CAAC,CACF,IACD;EAAI,CACT;CACL;AACF,CAAC"} | ||
| {"version":3,"file":"CatchBoundary.js","names":["Vue","renderInNonRouteComponentContext","VueErrorBoundary","defineComponent","name","props","onError","Function","resetKey","String","Number","Object","children","errorComponent","setup","error","ref","reset","value","watch","newKey","oldKey","onErrorCaptured","err","Promise","then","ErrorComponent","errorProps","process","env","NODE_ENV","h","CatchBoundary","getResetKey","onCatch","inheritAttrs","show","toggleShow","style","padding","maxWidth","display","alignItems","gap","fontSize","appearance","border","fontWeight","borderRadius","onClick","height","color","overflow","message"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { renderInNonRouteComponentContext } from './nonRouteComponentContext'\nimport type { ErrorRouteComponent } from './route'\n\ntype CatchBoundaryProps = {\n getResetKey: () => unknown\n children: Vue.VNode\n errorComponent?: ErrorRouteComponent | Vue.Component\n onCatch?: (error: Error) => void\n}\n\nconst VueErrorBoundary = Vue.defineComponent({\n name: 'VueErrorBoundary',\n props: {\n onError: Function,\n resetKey: [String, Number, Object],\n children: null,\n errorComponent: null,\n },\n setup(props) {\n const error = Vue.ref<Error | null>(null)\n\n const reset = () => {\n error.value = null\n }\n\n Vue.watch(\n () => props.resetKey,\n (newKey, oldKey) => {\n if (newKey !== oldKey && error.value) {\n reset()\n }\n },\n )\n\n Vue.onErrorCaptured((err: Error) => {\n if (\n err instanceof Promise ||\n (err && typeof (err as any).then === 'function')\n ) {\n return false\n }\n\n error.value = err\n\n if (props.onError) {\n props.onError(err)\n }\n\n return false\n })\n\n return () => {\n if (!error.value) {\n return props.children as Vue.VNode\n }\n\n const errorComponent = props.errorComponent ?? ErrorComponent\n const errorProps = {\n error: error.value,\n reset,\n }\n\n return process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n errorComponent,\n errorProps,\n 'errorComponent',\n )\n : Vue.h(errorComponent, errorProps)\n }\n },\n})\n\nexport function CatchBoundary(props: CatchBoundaryProps) {\n return Vue.h(VueErrorBoundary, {\n resetKey: props.getResetKey() as any,\n onError: props.onCatch,\n children: props.children,\n errorComponent: props.errorComponent,\n })\n}\nCatchBoundary.inheritAttrs = false\nCatchBoundary.props = ['getResetKey', 'children', 'errorComponent', 'onCatch']\n\nexport const ErrorComponent = Vue.defineComponent({\n name: 'ErrorComponent',\n props: {\n error: Object,\n reset: Function,\n },\n setup(props) {\n const show = Vue.ref(process.env.NODE_ENV !== 'production')\n\n const toggleShow = () => {\n show.value = !show.value\n }\n\n return () =>\n Vue.h('div', { style: { padding: '.5rem', maxWidth: '100%' } }, [\n Vue.h(\n 'div',\n { style: { display: 'flex', alignItems: 'center', gap: '.5rem' } },\n [\n Vue.h(\n 'strong',\n { style: { fontSize: '1rem' } },\n 'Something went wrong!',\n ),\n Vue.h(\n 'button',\n {\n style: {\n appearance: 'none',\n fontSize: '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n },\n onClick: toggleShow,\n },\n show.value ? 'Hide Error' : 'Show Error',\n ),\n ],\n ),\n Vue.h('div', { style: { height: '.25rem' } }),\n show.value\n ? Vue.h('div', {}, [\n Vue.h(\n 'pre',\n {\n style: {\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n },\n },\n [\n props.error?.message\n ? Vue.h('code', {}, props.error.message)\n : null,\n ],\n ),\n ])\n : null,\n ])\n },\n})\n"],"mappings":";;;AAWA,IAAME,mBAAmBF,IAAIG,gBAAgB;CAC3CC,MAAM;CACNC,OAAO;EACLC,SAASC;EACTC,UAAU;GAACC;GAAQC;GAAQC;EAAM;EACjCC,UAAU;EACVC,gBAAgB;CAClB;CACAC,MAAMT,OAAO;EACX,MAAMU,QAAQf,IAAIgB,IAAkB,IAAI;EAExC,MAAMC,cAAc;GAClBF,MAAMG,QAAQ;EAChB;EAEAlB,IAAImB,YACId,MAAMG,WACXY,QAAQC,WAAW;GAClB,IAAID,WAAWC,UAAUN,MAAMG,OAC7BD,MAAM;EAEV,CACF;EAEAjB,IAAIsB,iBAAiBC,QAAe;GAClC,IACEA,eAAeC,WACdD,OAAO,OAAQA,IAAYE,SAAS,YAErC,OAAO;GAGTV,MAAMG,QAAQK;GAEd,IAAIlB,MAAMC,SACRD,MAAMC,QAAQiB,GAAG;GAGnB,OAAO;EACT,CAAC;EAED,aAAa;GACX,IAAI,CAACR,MAAMG,OACT,OAAOb,MAAMO;GAGf,MAAMC,iBAAiBR,MAAMQ,kBAAkBa;GAC/C,MAAMC,aAAa;IACjBZ,OAAOA,MAAMG;IACbD;GACF;GAEA,OAAA,QAAA,IAAA,aAAgC,eAC5BhB,iCACEY,gBACAc,YACA,gBACF,IACA3B,IAAI+B,EAAElB,gBAAgBc,UAAU;EACtC;CACF;AACF,CAAC;AAED,SAAgBK,cAAc3B,OAA2B;CACvD,OAAOL,IAAI+B,EAAE7B,kBAAkB;EAC7BM,UAAUH,MAAM4B,YAAY;EAC5B3B,SAASD,MAAM6B;EACftB,UAAUP,MAAMO;EAChBC,gBAAgBR,MAAMQ;CACxB,CAAC;AACH;AACAmB,cAAcG,eAAe;AAC7BH,cAAc3B,QAAQ;CAAC;CAAe;CAAY;CAAkB;AAAS;AAE7E,IAAaqB,iBAAiB1B,IAAIG,gBAAgB;CAChDC,MAAM;CACNC,OAAO;EACLU,OAAOJ;EACPM,OAAOV;CACT;CACAO,MAAMT,OAAO;EACX,MAAM+B,OAAOpC,IAAIgB,IAAAA,QAAAA,IAAAA,aAA6B,YAAY;EAE1D,MAAMqB,mBAAmB;GACvBD,KAAKlB,QAAQ,CAACkB,KAAKlB;EACrB;EAEA,aACElB,IAAI+B,EAAE,OAAO,EAAEO,OAAO;GAAEC,SAAS;GAASC,UAAU;EAAO,EAAE,GAAG;GAC9DxC,IAAI+B,EACF,OACA,EAAEO,OAAO;IAAEG,SAAS;IAAQC,YAAY;IAAUC,KAAK;GAAQ,EAAE,GACjE,CACE3C,IAAI+B,EACF,UACA,EAAEO,OAAO,EAAEM,UAAU,OAAO,EAAE,GAC9B,uBACF,GACA5C,IAAI+B,EACF,UACA;IACEO,OAAO;KACLO,YAAY;KACZD,UAAU;KACVE,QAAQ;KACRP,SAAS;KACTQ,YAAY;KACZC,cAAc;IAChB;IACAC,SAASZ;GACX,GACAD,KAAKlB,QAAQ,eAAe,YAC9B,CAAC,CAEL;GACAlB,IAAI+B,EAAE,OAAO,EAAEO,OAAO,EAAEY,QAAQ,SAAS,EAAE,CAAC;GAC5Cd,KAAKlB,QACDlB,IAAI+B,EAAE,OAAO,CAAC,GAAG,CACf/B,IAAI+B,EACF,OACA,EACEO,OAAO;IACLM,UAAU;IACVE,QAAQ;IACRE,cAAc;IACdT,SAAS;IACTY,OAAO;IACPC,UAAU;GACZ,EACF,GACA,CACE/C,MAAMU,OAAOsC,UACTrD,IAAI+B,EAAE,QAAQ,CAAC,GAAG1B,MAAMU,MAAMsC,OAAO,IACrC,IAAI,CAEZ,CAAC,CACF,IACD;EAAI,CACT;CACL;AACF,CAAC"} |
@@ -40,3 +40,2 @@ import { AnyRouter, Constrain, LinkOptions, RegisteredRouter, RoutePaths } from '@tanstack/router-core'; | ||
| isActive: boolean; | ||
| isTransitioning: boolean; | ||
| }) => Vue.VNodeChild); | ||
@@ -43,0 +42,0 @@ } |
+35
-45
@@ -11,3 +11,2 @@ import { useRouter } from "./useRouter.js"; | ||
| const router = useRouter(); | ||
| const isTransitioning = Vue.ref(false); | ||
| let hasRenderFetched = false; | ||
@@ -83,3 +82,2 @@ if (!router) { | ||
| isActive, | ||
| isTransitioning: false, | ||
| resolvedActiveProps, | ||
@@ -101,3 +99,3 @@ resolvedInactiveProps, | ||
| const preload = Vue.computed(() => { | ||
| if (options.reloadDocument) return false; | ||
| if (options.reloadDocument || options.disabled) return false; | ||
| return options.preload ?? router.options.defaultPreload; | ||
@@ -114,9 +112,28 @@ }); | ||
| }); | ||
| const preloadViewportIoCallback = (entry) => { | ||
| if (entry?.isIntersecting) doPreload(); | ||
| const enqueuePreload = (e) => { | ||
| if (!e) { | ||
| clearTimeout(timeoutMap.get(ref)); | ||
| timeoutMap.delete(ref); | ||
| return; | ||
| } | ||
| if (!(e.isIntersecting ?? preload.value === "intent")) { | ||
| if (e.isIntersecting === false) { | ||
| clearTimeout(timeoutMap.get(ref)); | ||
| timeoutMap.delete(ref); | ||
| } | ||
| return; | ||
| } | ||
| if (!preloadDelay.value) { | ||
| doPreload(); | ||
| return; | ||
| } | ||
| if (!timeoutMap.has(ref)) timeoutMap.set(ref, setTimeout(() => { | ||
| timeoutMap.delete(ref); | ||
| doPreload(); | ||
| }, preloadDelay.value)); | ||
| }; | ||
| useIntersectionObserver(ref, preloadViewportIoCallback, { rootMargin: "100px" }, () => !!options.disabled || preload.value !== "viewport"); | ||
| useIntersectionObserver(ref, enqueuePreload, () => preload.value !== "viewport"); | ||
| Vue.effect(() => { | ||
| if (hasRenderFetched) return; | ||
| if (!options.disabled && preload.value === "render") { | ||
| if (preload.value === "render") { | ||
| doPreload(); | ||
@@ -132,7 +149,2 @@ hasRenderFetched = true; | ||
| e.preventDefault(); | ||
| isTransitioning.value = true; | ||
| const unsub = router.subscribe("onResolved", () => { | ||
| unsub(); | ||
| isTransitioning.value = false; | ||
| }); | ||
| router.navigate({ | ||
@@ -149,26 +161,10 @@ ...options, | ||
| }; | ||
| const enqueueIntentPreload = (e) => { | ||
| if (options.disabled || preload.value !== "intent") return; | ||
| if (!preloadDelay.value) { | ||
| doPreload(); | ||
| return; | ||
| } | ||
| const eventTarget = e.currentTarget || e.target; | ||
| if (!eventTarget || timeoutMap.has(eventTarget)) return; | ||
| timeoutMap.set(eventTarget, setTimeout(() => { | ||
| timeoutMap.delete(eventTarget); | ||
| doPreload(); | ||
| }, preloadDelay.value)); | ||
| }; | ||
| const handleTouchStart = (_) => { | ||
| if (options.disabled || preload.value !== "intent") return; | ||
| const handleTouchStart = () => { | ||
| if (preload.value !== "intent") return; | ||
| doPreload(); | ||
| }; | ||
| const handleLeave = (e) => { | ||
| if (options.disabled) return; | ||
| const eventTarget = e.currentTarget || e.target; | ||
| if (eventTarget) { | ||
| const id = timeoutMap.get(eventTarget); | ||
| clearTimeout(id); | ||
| timeoutMap.delete(eventTarget); | ||
| const handleLeave = () => { | ||
| if (preload.value === "intent") { | ||
| clearTimeout(timeoutMap.get(ref)); | ||
| timeoutMap.delete(ref); | ||
| } | ||
@@ -186,5 +182,5 @@ }; | ||
| onBlur: composeEventHandlers([options.onBlur, handleLeave]), | ||
| onFocus: composeEventHandlers([options.onFocus, enqueueIntentPreload]), | ||
| onMouseenter: composeEventHandlers([eventHandlers.onMouseenter, enqueueIntentPreload]), | ||
| onMouseover: composeEventHandlers([eventHandlers.onMouseover, enqueueIntentPreload]), | ||
| onFocus: composeEventHandlers([options.onFocus, enqueuePreload]), | ||
| onMouseenter: composeEventHandlers([eventHandlers.onMouseenter, enqueuePreload]), | ||
| onMouseover: composeEventHandlers([eventHandlers.onMouseover, enqueuePreload]), | ||
| onMouseleave: composeEventHandlers([eventHandlers.onMouseleave, handleLeave]), | ||
@@ -202,3 +198,2 @@ onMouseout: composeEventHandlers([eventHandlers.onMouseout, handleLeave]), | ||
| isActive: isActive.value, | ||
| isTransitioning: isTransitioning.value, | ||
| resolvedActiveProps, | ||
@@ -239,3 +234,3 @@ resolvedInactiveProps, | ||
| } | ||
| function combineResultProps({ href, options, isActive, isTransitioning, resolvedActiveProps, resolvedInactiveProps, resolvedClassName, resolvedStyle, ref, staticEventHandlers }) { | ||
| function combineResultProps({ href, options, isActive, resolvedActiveProps, resolvedInactiveProps, resolvedClassName, resolvedStyle, ref, staticEventHandlers }) { | ||
| const result = { | ||
@@ -259,3 +254,2 @@ ...getPropsSafeToSpread(options), | ||
| } | ||
| if (isTransitioning) result["data-transitioning"] = "transitioning"; | ||
| for (const key of Object.keys(resolvedActiveProps)) if (key !== "class" && key !== "style") result[key] = resolvedActiveProps[key]; | ||
@@ -353,7 +347,3 @@ for (const key of Object.keys(resolvedInactiveProps)) if (key !== "class" && key !== "style") result[key] = resolvedInactiveProps[key]; | ||
| const isActive = linkProps["data-status"] === "active"; | ||
| const isTransitioning = linkProps["data-transitioning"] === "transitioning"; | ||
| const slotContent = slots.default ? slots.default({ | ||
| isActive, | ||
| isTransitioning | ||
| }) : []; | ||
| const slotContent = slots.default ? slots.default({ isActive }) : []; | ||
| if (Component === "svg") { | ||
@@ -360,0 +350,0 @@ const svgLinkProps = { ...linkProps }; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"link.js","names":["Vue","deepEqual","exactPathTest","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","useStore","useRouter","useIntersectionObserver","timeoutMap","WeakMap","useLinkProps","options","router","isTransitioning","ref","hasRenderFetched","console","warn","computed","type","URL","to","eventHandlers","getLinkEventHandlers","value","protocolAllowlist","process","env","NODE_ENV","safeProps","getPropsSafeToSpread","target","disabled","style","class","onClick","onBlur","onFocus","onMouseenter","onMouseleave","onMouseover","onMouseout","onTouchstart","Object","keys","forEach","key","undefined","externalProps","href","next","buildLocation","getHref","isActive","getIsActive","stores","location","get","activeOptions","resolvedActiveProps","resolvedInactiveProps","resolvedClassName","resolvedStyle","resolveStyleProps","result","combineResultProps","currentLocation","l","equal","prev","opts","_fromLocation","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","doPreload","preloadRoute","_builtLocation","catch","err","preloadViewportIoCallback","entry","isIntersecting","rootMargin","effect","handleClick","e","elementTarget","currentTarget","getAttribute","effectiveTarget","isCtrlEvent","defaultPrevented","button","preventDefault","unsub","subscribe","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","enqueueIntentPreload","eventTarget","has","set","setTimeout","delete","handleTouchStart","_","handleLeave","id","clearTimeout","composeEventHandlers","handlers","event","handler","resolvedStyleProps","staticEventHandlers","computedProps","activeProps","inactiveProps","classes","filter","Boolean","length","join","assign","role","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","onTouchStart","_activeProps","_inactiveProps","_activeOptions","_to","_preload","_preloadDelay","preloadIntentProximity","_preloadIntentProximity","_hashScrollIntoView","_replace","_startTransition","_resetScroll","_viewTransition","children","_children","_target","_disabled","_style","_class","_onClick","_onBlur","_onFocus","_onMouseEnter","_onMouseenter","_onMouseLeave","_onMouseleave","_onMouseOver","_onMouseover","_onMouseOut","_onMouseout","_onTouchStart","_onTouchstart","_ignoreBlocker","params","_params","search","_search","hash","_hash","state","_state","mask","_mask","_reloadDocument","unsafeRelative","_unsafeRelative","_asChild","__asChild","from","_from","additionalProps","_additionalProps","propsSafeToSpread","loc","nextLoc","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","includeSearch","searchTest","partial","ignoreUndefined","explicitUndefined","includeHash","nextLocation","maskedLocation","publicHref","external","history","createHref","createLink","Comp","defineComponent","name","inheritAttrs","setup","attrs","slots","h","LinkImpl","props","allProps","linkPropsSource","Component","linkProps","unref","slotContent","default","svgLinkProps","Link","metaKey","altKey","ctrlKey","shiftKey","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport {\n deepEqual,\n exactPathTest,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\n\nimport { useStore } from '@tanstack/vue-store'\nimport { useRouter } from './useRouter'\nimport { useIntersectionObserver } from './utils'\n\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n ParsedLocation,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type { AnchorHTMLAttributes, ReservedProps } from '@vue/runtime-dom'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\n\ntype EventHandler<TEvent = Event> = (e: TEvent) => void\n\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\n\ntype DataAttributes = {\n [K in `data-${string}`]?: unknown\n}\n\ntype LinkHTMLAttributes = AnchorHTMLAttributes &\n ReservedProps &\n DataAttributes & {\n // Vue's runtime-dom types use lowercase event names.\n // Also accept camelCase versions for external API compatibility.\n onMouseEnter?: EventHandler<MouseEvent>\n onMouseLeave?: EventHandler<MouseEvent>\n onMouseOver?: EventHandler<MouseEvent>\n onMouseOut?: EventHandler<MouseEvent>\n onTouchStart?: EventHandler<TouchEvent>\n\n // `disabled` is not a valid <a> attribute, but is useful when using `asChild`.\n disabled?: boolean\n }\n\ntype VueStyleLinkEventHandlers = {\n onMouseenter?: EventHandler<MouseEvent>\n onMouseleave?: EventHandler<MouseEvent>\n onMouseover?: EventHandler<MouseEvent>\n onMouseout?: EventHandler<MouseEvent>\n onTouchstart?: EventHandler<TouchEvent>\n}\n\ninterface StyledProps {\n class?: LinkHTMLAttributes['class']\n style?: LinkHTMLAttributes['style']\n [key: string]: unknown\n}\n\ntype PropsOfComponent<TComp> =\n // Functional components\n TComp extends (props: infer P, ...args: Array<unknown>) => any\n ? P\n : // Vue components (defineComponent, class components, etc)\n TComp extends Vue.Component<infer P>\n ? P\n : Record<string, unknown>\n\ntype AnyLinkPropsOptions = UseLinkPropsOptions<any, any, any, any, any>\ntype LinkEventOptions = AnyLinkPropsOptions & Partial<VueStyleLinkEventHandlers>\n\nexport function useLinkProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '',\n>(\n options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n): LinkHTMLAttributes {\n const router = useRouter()\n const isTransitioning = Vue.ref(false)\n let hasRenderFetched = false\n\n // Ensure router is defined before proceeding\n if (!router) {\n console.warn('useRouter must be used inside a <RouterProvider> component!')\n return Vue.computed(() => ({})) as unknown as LinkHTMLAttributes\n }\n\n // Determine if the link is external or internal\n const type = Vue.computed(() => {\n try {\n new URL(`${options.to}`)\n return 'external'\n } catch {\n return 'internal'\n }\n })\n\n const ref = Vue.ref<Element | null>(null)\n const eventHandlers = getLinkEventHandlers(options as LinkEventOptions)\n\n if (type.value === 'external') {\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(options.to as string, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${options.to}`)\n }\n // Return props without href to prevent navigation\n const safeProps: Record<string, unknown> = {\n ...getPropsSafeToSpread(options as AnyLinkPropsOptions),\n ref,\n // No href attribute - blocks the dangerous protocol\n target: options.target,\n disabled: options.disabled,\n style: options.style,\n class: options.class,\n onClick: options.onClick,\n onBlur: options.onBlur,\n onFocus: options.onFocus,\n onMouseenter: eventHandlers.onMouseenter,\n onMouseleave: eventHandlers.onMouseleave,\n onMouseover: eventHandlers.onMouseover,\n onMouseout: eventHandlers.onMouseout,\n onTouchstart: eventHandlers.onTouchstart,\n }\n\n // Remove undefined values\n Object.keys(safeProps).forEach((key) => {\n if (safeProps[key] === undefined) {\n delete safeProps[key]\n }\n })\n\n return Vue.computed(\n () => safeProps as LinkHTMLAttributes,\n ) as unknown as LinkHTMLAttributes\n }\n\n // External links just have simple props\n const externalProps: Record<string, unknown> = {\n ...getPropsSafeToSpread(options as AnyLinkPropsOptions),\n ref,\n href: options.to,\n target: options.target,\n disabled: options.disabled,\n style: options.style,\n class: options.class,\n onClick: options.onClick,\n onBlur: options.onBlur,\n onFocus: options.onFocus,\n onMouseenter: eventHandlers.onMouseenter,\n onMouseleave: eventHandlers.onMouseleave,\n onMouseover: eventHandlers.onMouseover,\n onMouseout: eventHandlers.onMouseout,\n onTouchstart: eventHandlers.onTouchstart,\n }\n\n // Remove undefined values\n Object.keys(externalProps).forEach((key) => {\n if (externalProps[key] === undefined) {\n delete externalProps[key]\n }\n })\n\n return Vue.computed(\n () => externalProps as LinkHTMLAttributes,\n ) as unknown as LinkHTMLAttributes\n }\n\n // During SSR we render exactly once and do not need reactivity.\n // Avoid store subscriptions, effects and observers on the server.\n if (isServer ?? router.isServer) {\n const next = router.buildLocation(options as any)\n const href = getHref(options as AnyLinkPropsOptions, router, next)\n\n const isActive = getIsActive(\n router.stores.location.get(),\n next,\n options.activeOptions,\n router,\n )\n\n const {\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n } = resolveStyleProps(options as AnyLinkPropsOptions, isActive)\n\n const result = combineResultProps({\n href,\n options: options as AnyLinkPropsOptions,\n isActive,\n isTransitioning: false,\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n })\n\n return Vue.ref(\n result as LinkHTMLAttributes,\n ) as unknown as LinkHTMLAttributes\n }\n\n const currentLocation = useStore(router.stores.location, (l) => l, {\n equal: (prev, next) => prev.href === next.href,\n })\n\n const next = Vue.computed(() => {\n // Rebuild when inherited search/hash or the current route context changes.\n\n const opts = { _fromLocation: currentLocation.value, ...options }\n return router.buildLocation(opts)\n })\n\n const preload = Vue.computed(() => {\n if (options.reloadDocument) {\n return false\n }\n return options.preload ?? router.options.defaultPreload\n })\n\n const preloadDelay = Vue.computed(\n () => options.preloadDelay ?? router.options.defaultPreloadDelay ?? 0,\n )\n\n const isActive = Vue.computed(() =>\n getIsActive(\n currentLocation.value,\n next.value,\n options.activeOptions,\n router,\n ),\n )\n\n const doPreload = () =>\n router\n .preloadRoute({ ...options, _builtLocation: next.value } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const preloadViewportIoCallback = (\n entry: IntersectionObserverEntry | undefined,\n ) => {\n if (entry?.isIntersecting) {\n doPreload()\n }\n }\n\n useIntersectionObserver(\n ref,\n preloadViewportIoCallback,\n { rootMargin: '100px' },\n () => !!options.disabled || preload.value !== 'viewport',\n )\n\n Vue.effect(() => {\n if (hasRenderFetched) {\n return\n }\n if (!options.disabled && preload.value === 'render') {\n doPreload()\n hasRenderFetched = true\n }\n })\n\n // The click handler\n const handleClick = (e: PointerEvent): void => {\n // Check actual element's target attribute as fallback\n const elementTarget = (\n e.currentTarget as HTMLAnchorElement | SVGAElement\n )?.getAttribute('target')\n const effectiveTarget =\n options.target !== undefined ? options.target : elementTarget\n\n if (\n !options.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n // Don't prevent default or handle navigation if reloadDocument is true\n if (options.reloadDocument) {\n return\n }\n\n e.preventDefault()\n\n isTransitioning.value = true\n\n const unsub = router.subscribe('onResolved', () => {\n unsub()\n isTransitioning.value = false\n })\n\n // All is well? Navigate!\n router.navigate({\n ...options,\n replace: options.replace,\n resetScroll: options.resetScroll,\n hashScrollIntoView: options.hashScrollIntoView,\n startTransition: options.startTransition,\n viewTransition: options.viewTransition,\n ignoreBlocker: options.ignoreBlocker,\n })\n }\n }\n\n const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {\n if (options.disabled || preload.value !== 'intent') return\n\n if (!preloadDelay.value) {\n doPreload()\n return\n }\n\n const eventTarget = e.currentTarget || e.target\n\n if (!eventTarget || timeoutMap.has(eventTarget)) return\n\n timeoutMap.set(\n eventTarget,\n setTimeout(() => {\n timeoutMap.delete(eventTarget)\n doPreload()\n }, preloadDelay.value),\n )\n }\n\n const handleTouchStart = (_: TouchEvent) => {\n if (options.disabled || preload.value !== 'intent') return\n doPreload()\n }\n\n const handleLeave = (e: MouseEvent | FocusEvent) => {\n if (options.disabled) return\n const eventTarget = e.currentTarget || e.target\n\n if (eventTarget) {\n const id = timeoutMap.get(eventTarget)\n clearTimeout(id)\n timeoutMap.delete(eventTarget)\n }\n }\n\n // Helper to compose event handlers - with explicit return type and better type handling\n function composeEventHandlers<T extends Event>(\n handlers: Array<EventHandler<T> | undefined>,\n ): (e: T) => void {\n return (event: T) => {\n for (const handler of handlers) {\n if (handler) {\n handler(event)\n }\n }\n }\n }\n\n // Get the active and inactive props\n const resolvedStyleProps = Vue.computed(() =>\n resolveStyleProps(options as AnyLinkPropsOptions, isActive.value),\n )\n\n const href = Vue.computed(() =>\n getHref(options as AnyLinkPropsOptions, router, next.value),\n )\n\n // Create static event handlers that don't change between renders\n const staticEventHandlers = {\n onClick: composeEventHandlers<PointerEvent>([options.onClick, handleClick]),\n onBlur: composeEventHandlers<FocusEvent>([options.onBlur, handleLeave]),\n onFocus: composeEventHandlers<FocusEvent>([\n options.onFocus,\n enqueueIntentPreload,\n ]),\n onMouseenter: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseenter,\n enqueueIntentPreload,\n ]),\n onMouseover: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseover,\n enqueueIntentPreload,\n ]),\n onMouseleave: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseleave,\n handleLeave,\n ]),\n onMouseout: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseout,\n handleLeave,\n ]),\n onTouchstart: composeEventHandlers<TouchEvent>([\n eventHandlers.onTouchstart,\n handleTouchStart,\n ]),\n }\n\n // Compute all props synchronously to avoid hydration mismatches\n // Using Vue.computed ensures props are calculated at render time, not after\n const computedProps = Vue.computed<LinkHTMLAttributes>(() => {\n const {\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n } = resolvedStyleProps.value\n return combineResultProps({\n href: href.value,\n options: options as AnyLinkPropsOptions,\n ref,\n staticEventHandlers,\n isActive: isActive.value,\n isTransitioning: isTransitioning.value,\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n })\n })\n\n // Return the computed ref itself - callers should access .value\n return computedProps as unknown as LinkHTMLAttributes\n}\n\nfunction resolveStyleProps(options: AnyLinkPropsOptions, isActive: boolean) {\n const activeProps = options.activeProps || (() => ({ class: 'active' }))\n const resolvedActiveProps: StyledProps = (isActive\n ? typeof activeProps === 'function'\n ? activeProps()\n : activeProps\n : {}) || { class: undefined, style: undefined }\n\n const inactiveProps = options.inactiveProps || (() => ({}))\n\n const resolvedInactiveProps: StyledProps = (isActive\n ? {}\n : typeof inactiveProps === 'function'\n ? inactiveProps()\n : inactiveProps) || { class: undefined, style: undefined }\n\n const classes = [\n options.class,\n resolvedActiveProps?.class,\n resolvedInactiveProps?.class,\n ].filter(Boolean)\n const resolvedClassName = classes.length ? classes.join(' ') : undefined\n\n const result: Record<string, string | number> = {}\n\n // Merge styles from all sources\n if (options.style) {\n Object.assign(result, options.style)\n }\n\n if (resolvedActiveProps?.style) {\n Object.assign(result, resolvedActiveProps.style)\n }\n\n if (resolvedInactiveProps?.style) {\n Object.assign(result, resolvedInactiveProps.style)\n }\n\n const resolvedStyle = hasKeys(result) ? result : undefined\n return {\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n }\n}\n\nfunction combineResultProps({\n href,\n options,\n isActive,\n isTransitioning,\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n ref,\n staticEventHandlers,\n}: {\n initial?: LinkHTMLAttributes\n href: string | undefined\n options: AnyLinkPropsOptions\n isActive: boolean\n isTransitioning: boolean\n resolvedActiveProps: StyledProps\n resolvedInactiveProps: StyledProps\n resolvedClassName?: string\n resolvedStyle?: Record<string, string | number>\n ref?: Vue.VNodeRef | undefined\n staticEventHandlers?: {\n onClick: any\n onBlur: any\n onFocus: any\n onMouseenter: any\n onMouseover: any\n onMouseleave: any\n onMouseout: any\n onTouchstart: any\n }\n}) {\n const result: Record<string, unknown> = {\n ...getPropsSafeToSpread(options),\n ref,\n ...staticEventHandlers,\n href,\n disabled: !!options.disabled,\n target: options.target,\n }\n\n if (resolvedStyle) {\n result.style = resolvedStyle\n }\n\n if (resolvedClassName) {\n result.class = resolvedClassName\n }\n\n if (options.disabled) {\n result.role = 'link'\n result['aria-disabled'] = true\n }\n\n if (isActive) {\n result['data-status'] = 'active'\n result['aria-current'] = 'page'\n }\n\n if (isTransitioning) {\n result['data-transitioning'] = 'transitioning'\n }\n\n for (const key of Object.keys(resolvedActiveProps)) {\n if (key !== 'class' && key !== 'style') {\n result[key] = resolvedActiveProps[key]\n }\n }\n\n for (const key of Object.keys(resolvedInactiveProps)) {\n if (key !== 'class' && key !== 'style') {\n result[key] = resolvedInactiveProps[key]\n }\n }\n return result\n}\n\nfunction getLinkEventHandlers(\n options: LinkEventOptions,\n): VueStyleLinkEventHandlers {\n return {\n onMouseenter: options.onMouseEnter ?? options.onMouseenter,\n onMouseleave: options.onMouseLeave ?? options.onMouseleave,\n onMouseover: options.onMouseOver ?? options.onMouseover,\n onMouseout: options.onMouseOut ?? options.onMouseout,\n onTouchstart: options.onTouchStart ?? options.onTouchstart,\n }\n}\n\nconst getPropsSafeToSpread = (options: AnyLinkPropsOptions) => {\n const {\n activeProps: _activeProps,\n inactiveProps: _inactiveProps,\n activeOptions: _activeOptions,\n to: _to,\n preload: _preload,\n preloadDelay: _preloadDelay,\n preloadIntentProximity: _preloadIntentProximity,\n hashScrollIntoView: _hashScrollIntoView,\n replace: _replace,\n startTransition: _startTransition,\n resetScroll: _resetScroll,\n viewTransition: _viewTransition,\n children: _children,\n target: _target,\n disabled: _disabled,\n style: _style,\n class: _class,\n onClick: _onClick,\n onBlur: _onBlur,\n onFocus: _onFocus,\n onMouseEnter: _onMouseEnter,\n onMouseenter: _onMouseenter,\n onMouseLeave: _onMouseLeave,\n onMouseleave: _onMouseleave,\n onMouseOver: _onMouseOver,\n onMouseover: _onMouseover,\n onMouseOut: _onMouseOut,\n onMouseout: _onMouseout,\n onTouchStart: _onTouchStart,\n onTouchstart: _onTouchstart,\n ignoreBlocker: _ignoreBlocker,\n params: _params,\n search: _search,\n hash: _hash,\n state: _state,\n mask: _mask,\n reloadDocument: _reloadDocument,\n unsafeRelative: _unsafeRelative,\n _asChild: __asChild,\n from: _from,\n additionalProps: _additionalProps,\n ...propsSafeToSpread\n } = options as AnyLinkPropsOptions & {\n additionalProps?: unknown\n children?: unknown\n _asChild?: unknown\n }\n\n return propsSafeToSpread\n}\n\nfunction getIsActive(\n loc: {\n pathname: string\n search: any\n hash: string\n },\n nextLoc: {\n pathname: string\n search: any\n hash: string\n },\n activeOptions: LinkOptions['activeOptions'],\n router: AnyRouter,\n) {\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n loc.pathname,\n nextLoc.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(loc.pathname, router.basepath)\n const nextPath = removeTrailingSlash(nextLoc.pathname, router.basepath)\n\n const pathIsFuzzyEqual =\n currentPath.startsWith(nextPath) &&\n (currentPath.length === nextPath.length ||\n currentPath[nextPath.length] === '/')\n if (!pathIsFuzzyEqual) {\n return false\n }\n }\n\n if (activeOptions?.includeSearch ?? true) {\n const searchTest = deepEqual(loc.search, nextLoc.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n return loc.hash === nextLoc.hash\n }\n return true\n}\n\nfunction getHref(\n options: AnyLinkPropsOptions,\n router: AnyRouter,\n nextLocation?: ParsedLocation,\n) {\n if (options.disabled) {\n return undefined\n }\n const location = nextLocation?.maskedLocation ?? nextLocation\n\n // Use publicHref - it contains the correct href for display\n // When a rewrite changes the origin, publicHref is the full URL\n // Otherwise it's the origin-stripped path\n // This avoids constructing URL objects in the hot path\n const publicHref = location?.publicHref\n if (!publicHref) return undefined\n\n const external = location?.external\n if (external) return publicHref\n\n return router.history.createHref(publicHref) || '/'\n}\n\n// Type definitions\nexport type UseLinkPropsOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkHTMLAttributes\n\nexport type ActiveLinkOptions<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n (TComp extends keyof HTMLElementTagNameMap\n ? LinkHTMLAttributes\n : PropsOfComponent<TComp>) & {\n [key: `data-${string}`]: unknown\n }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n /**\n * A function that returns additional props for the `active` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n /**\n * A function that returns additional props for the `inactive` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkPropsChildren\n\nexport interface LinkPropsChildren {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | Vue.VNodeChild\n | ((state: {\n isActive: boolean\n isTransitioning: boolean\n }) => Vue.VNodeChild)\n}\n\ntype LinkComponentVueProps<TComp> = TComp extends keyof HTMLElementTagNameMap\n ? Omit<LinkHTMLAttributes, keyof CreateLinkProps>\n : Omit<PropsOfComponent<TComp>, keyof CreateLinkProps>\n\nexport type LinkComponentProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkComponentVueProps<TComp> &\n LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n any,\n any,\n string,\n string,\n string,\n string\n>\n\nexport type LinkComponent<\n in out TComp,\n in out TDefaultFrom extends string = string,\n> = <\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = TDefaultFrom,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(\n props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => Vue.VNode\n\nexport interface LinkComponentRoute<\n in out TDefaultFrom extends string = string,\n> {\n defaultFrom: TDefaultFrom;\n <\n TRouter extends AnyRouter = RegisteredRouter,\n const TTo extends string | undefined = undefined,\n const TMaskTo extends string = '',\n >(\n props: LinkComponentProps<\n 'a',\n TRouter,\n this['defaultFrom'],\n TTo,\n this['defaultFrom'],\n TMaskTo\n >,\n ): Vue.VNode\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => Vue.VNode>,\n): LinkComponent<TComp> {\n return Vue.defineComponent({\n name: 'CreatedLink',\n inheritAttrs: false,\n setup(_, { attrs, slots }) {\n return () => Vue.h(LinkImpl, { ...attrs, _asChild: Comp }, slots)\n },\n }) as any\n}\n\nconst LinkImpl = Vue.defineComponent({\n name: 'Link',\n inheritAttrs: false,\n props: [\n '_asChild',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'from',\n 'search',\n 'params',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'disabled',\n 'additionalProps',\n 'viewTransition',\n 'resetScroll',\n 'startTransition',\n 'hashScrollIntoView',\n 'replace',\n 'ignoreBlocker',\n 'target',\n ],\n setup(props, { attrs, slots }) {\n // Call useLinkProps ONCE during setup with combined props and attrs\n const allProps = { ...props, ...attrs }\n const linkPropsSource = useLinkProps(allProps) as\n | LinkHTMLAttributes\n | Vue.ComputedRef<LinkHTMLAttributes>\n\n return () => {\n const Component = props._asChild || 'a'\n\n const linkProps = Vue.unref(linkPropsSource)\n\n const isActive = linkProps['data-status'] === 'active'\n const isTransitioning =\n linkProps['data-transitioning'] === 'transitioning'\n\n // Create the slot content or empty array if no default slot\n const slotContent = slots.default\n ? slots.default({\n isActive,\n isTransitioning,\n })\n : []\n\n // Special handling for SVG links - wrap an <a> inside the SVG\n if (Component === 'svg') {\n // Create props without class for svg link\n const svgLinkProps = { ...linkProps }\n delete svgLinkProps.class\n return Vue.h('svg', {}, [Vue.h('a', svgLinkProps, slotContent)])\n }\n\n // For custom functional components (non-string), pass children as a prop\n // since they may expect children as a prop like in Solid\n if (typeof Component !== 'string') {\n return Vue.h(\n Component,\n { ...linkProps, children: slotContent },\n slotContent,\n )\n }\n\n // Return the component with props and children\n return Vue.h(Component, linkProps, slotContent)\n }\n },\n})\n\n/**\n * Link component with proper TypeScript generics support\n */\nexport const Link = LinkImpl as unknown as Vue.Component<unknown> &\n Vue.Component<CreateLinkProps> &\n LinkComponent<'a'>\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nexport type LinkOptionsFnOptions<\n TOptions,\n TComp,\n TRouter extends AnyRouter = RegisteredRouter,\n> =\n TOptions extends ReadonlyArray<any>\n ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n const TOptions,\n TRouter extends AnyRouter = RegisteredRouter,\n>(\n options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n return options as any\n}\n"],"mappings":";;;;;;;AA+BA,IAAMW,6BAAa,IAAIC,QAAoD;AA+C3E,SAAgBC,aAOdC,SACoB;CACpB,MAAMC,SAASN,UAAU;CACzB,MAAMO,kBAAkBhB,IAAIiB,IAAI,KAAK;CACrC,IAAIC,mBAAmB;CAGvB,IAAI,CAACH,QAAQ;EACXI,QAAQC,KAAK,6DAA6D;EAC1E,OAAOpB,IAAIqB,gBAAgB,CAAC,EAAE;CAChC;CAGA,MAAMC,OAAOtB,IAAIqB,eAAe;EAC9B,IAAI;GACF,IAAIE,IAAI,GAAGT,QAAQU,IAAI;GACvB,OAAO;EACT,QAAQ;GACN,OAAO;EACT;CACF,CAAC;CAED,MAAMP,MAAMjB,IAAIiB,IAAoB,IAAI;CACxC,MAAMQ,gBAAgBC,qBAAqBZ,OAA2B;CAEtE,IAAIQ,KAAKK,UAAU,YAAY;EAE7B,IAAIvB,oBAAoBU,QAAQU,IAAcT,OAAOa,iBAAiB,GAAG;GACvE,IAAA,QAAA,IAAA,aAA6B,cAC3BT,QAAQC,KAAK,yCAAyCN,QAAQU,IAAI;GAGpE,MAAMQ,YAAqC;IACzC,GAAGC,qBAAqBnB,OAA8B;IACtDG;IAEAiB,QAAQpB,QAAQoB;IAChBC,UAAUrB,QAAQqB;IAClBC,OAAOtB,QAAQsB;IACfC,OAAOvB,QAAQuB;IACfC,SAASxB,QAAQwB;IACjBC,QAAQzB,QAAQyB;IAChBC,SAAS1B,QAAQ0B;IACjBC,c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||
| {"version":3,"file":"link.js","names":["Vue","deepEqual","exactPathTest","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","useStore","useRouter","useIntersectionObserver","timeoutMap","WeakMap","useLinkProps","options","router","hasRenderFetched","console","warn","computed","type","URL","to","ref","eventHandlers","getLinkEventHandlers","value","protocolAllowlist","process","env","NODE_ENV","safeProps","getPropsSafeToSpread","target","disabled","style","class","onClick","onBlur","onFocus","onMouseenter","onMouseleave","onMouseover","onMouseout","onTouchstart","Object","keys","forEach","key","undefined","externalProps","href","next","buildLocation","getHref","isActive","getIsActive","stores","location","get","activeOptions","resolvedActiveProps","resolvedInactiveProps","resolvedClassName","resolvedStyle","resolveStyleProps","result","combineResultProps","currentLocation","l","equal","prev","opts","_fromLocation","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","doPreload","preloadRoute","_builtLocation","catch","err","enqueuePreload","e","clearTimeout","delete","isIntersecting","has","set","setTimeout","effect","handleClick","elementTarget","currentTarget","getAttribute","effectiveTarget","isCtrlEvent","defaultPrevented","button","preventDefault","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","handleTouchStart","handleLeave","composeEventHandlers","handlers","event","handler","resolvedStyleProps","staticEventHandlers","computedProps","activeProps","inactiveProps","classes","filter","Boolean","length","join","assign","role","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","onTouchStart","_activeProps","_inactiveProps","_activeOptions","_to","_preload","_preloadDelay","preloadIntentProximity","_preloadIntentProximity","_hashScrollIntoView","_replace","_startTransition","_resetScroll","_viewTransition","children","_children","_target","_disabled","_style","_class","_onClick","_onBlur","_onFocus","_onMouseEnter","_onMouseenter","_onMouseLeave","_onMouseleave","_onMouseOver","_onMouseover","_onMouseOut","_onMouseout","_onTouchStart","_onTouchstart","_ignoreBlocker","params","_params","search","_search","hash","_hash","state","_state","mask","_mask","_reloadDocument","unsafeRelative","_unsafeRelative","_asChild","__asChild","from","_from","additionalProps","_additionalProps","propsSafeToSpread","loc","nextLoc","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","includeSearch","searchTest","partial","ignoreUndefined","explicitUndefined","includeHash","nextLocation","maskedLocation","publicHref","external","history","createHref","createLink","Comp","defineComponent","name","inheritAttrs","setup","_","attrs","slots","h","LinkImpl","props","allProps","linkPropsSource","Component","linkProps","unref","slotContent","default","svgLinkProps","Link","metaKey","altKey","ctrlKey","shiftKey","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport {\n deepEqual,\n exactPathTest,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\n\nimport { useStore } from '@tanstack/vue-store'\nimport { useRouter } from './useRouter'\nimport { useIntersectionObserver } from './utils'\n\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n ParsedLocation,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type { AnchorHTMLAttributes, ReservedProps } from '@vue/runtime-dom'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\n\ntype EventHandler<TEvent = Event> = (e: TEvent) => void\n\nconst timeoutMap = new WeakMap<object, ReturnType<typeof setTimeout>>()\n\ntype DataAttributes = {\n [K in `data-${string}`]?: unknown\n}\n\ntype LinkHTMLAttributes = AnchorHTMLAttributes &\n ReservedProps &\n DataAttributes & {\n // Vue's runtime-dom types use lowercase event names.\n // Also accept camelCase versions for external API compatibility.\n onMouseEnter?: EventHandler<MouseEvent>\n onMouseLeave?: EventHandler<MouseEvent>\n onMouseOver?: EventHandler<MouseEvent>\n onMouseOut?: EventHandler<MouseEvent>\n onTouchStart?: EventHandler<TouchEvent>\n\n // `disabled` is not a valid <a> attribute, but is useful when using `asChild`.\n disabled?: boolean\n }\n\ntype VueStyleLinkEventHandlers = {\n onMouseenter?: EventHandler<MouseEvent>\n onMouseleave?: EventHandler<MouseEvent>\n onMouseover?: EventHandler<MouseEvent>\n onMouseout?: EventHandler<MouseEvent>\n onTouchstart?: EventHandler<TouchEvent>\n}\n\ninterface StyledProps {\n class?: LinkHTMLAttributes['class']\n style?: LinkHTMLAttributes['style']\n [key: string]: unknown\n}\n\ntype PropsOfComponent<TComp> =\n // Functional components\n TComp extends (props: infer P, ...args: Array<unknown>) => any\n ? P\n : // Vue components (defineComponent, class components, etc)\n TComp extends Vue.Component<infer P>\n ? P\n : Record<string, unknown>\n\ntype AnyLinkPropsOptions = UseLinkPropsOptions<any, any, any, any, any>\ntype LinkEventOptions = AnyLinkPropsOptions & Partial<VueStyleLinkEventHandlers>\n\nexport function useLinkProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '',\n>(\n options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n): LinkHTMLAttributes {\n const router = useRouter()\n let hasRenderFetched = false\n\n // Ensure router is defined before proceeding\n if (!router) {\n console.warn('useRouter must be used inside a <RouterProvider> component!')\n return Vue.computed(() => ({})) as unknown as LinkHTMLAttributes\n }\n\n // Determine if the link is external or internal\n const type = Vue.computed(() => {\n try {\n new URL(`${options.to}`)\n return 'external'\n } catch {\n return 'internal'\n }\n })\n\n const ref = Vue.ref<Element | null>(null)\n const eventHandlers = getLinkEventHandlers(options as LinkEventOptions)\n\n if (type.value === 'external') {\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(options.to as string, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${options.to}`)\n }\n // Return props without href to prevent navigation\n const safeProps: Record<string, unknown> = {\n ...getPropsSafeToSpread(options as AnyLinkPropsOptions),\n ref,\n // No href attribute - blocks the dangerous protocol\n target: options.target,\n disabled: options.disabled,\n style: options.style,\n class: options.class,\n onClick: options.onClick,\n onBlur: options.onBlur,\n onFocus: options.onFocus,\n onMouseenter: eventHandlers.onMouseenter,\n onMouseleave: eventHandlers.onMouseleave,\n onMouseover: eventHandlers.onMouseover,\n onMouseout: eventHandlers.onMouseout,\n onTouchstart: eventHandlers.onTouchstart,\n }\n\n // Remove undefined values\n Object.keys(safeProps).forEach((key) => {\n if (safeProps[key] === undefined) {\n delete safeProps[key]\n }\n })\n\n return Vue.computed(\n () => safeProps as LinkHTMLAttributes,\n ) as unknown as LinkHTMLAttributes\n }\n\n // External links just have simple props\n const externalProps: Record<string, unknown> = {\n ...getPropsSafeToSpread(options as AnyLinkPropsOptions),\n ref,\n href: options.to,\n target: options.target,\n disabled: options.disabled,\n style: options.style,\n class: options.class,\n onClick: options.onClick,\n onBlur: options.onBlur,\n onFocus: options.onFocus,\n onMouseenter: eventHandlers.onMouseenter,\n onMouseleave: eventHandlers.onMouseleave,\n onMouseover: eventHandlers.onMouseover,\n onMouseout: eventHandlers.onMouseout,\n onTouchstart: eventHandlers.onTouchstart,\n }\n\n // Remove undefined values\n Object.keys(externalProps).forEach((key) => {\n if (externalProps[key] === undefined) {\n delete externalProps[key]\n }\n })\n\n return Vue.computed(\n () => externalProps as LinkHTMLAttributes,\n ) as unknown as LinkHTMLAttributes\n }\n\n // During SSR we render exactly once and do not need reactivity.\n // Avoid store subscriptions, effects and observers on the server.\n if (isServer ?? router.isServer) {\n const next = router.buildLocation(options as any)\n const href = getHref(options as AnyLinkPropsOptions, router, next)\n\n const isActive = getIsActive(\n router.stores.location.get(),\n next,\n options.activeOptions,\n router,\n )\n\n const {\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n } = resolveStyleProps(options as AnyLinkPropsOptions, isActive)\n\n const result = combineResultProps({\n href,\n options: options as AnyLinkPropsOptions,\n isActive,\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n })\n\n return Vue.ref(\n result as LinkHTMLAttributes,\n ) as unknown as LinkHTMLAttributes\n }\n\n const currentLocation = useStore(router.stores.location, (l) => l, {\n equal: (prev, next) => prev.href === next.href,\n })\n\n const next = Vue.computed(() => {\n // Rebuild when inherited search/hash or the current route context changes.\n\n const opts = { _fromLocation: currentLocation.value, ...options }\n return router.buildLocation(opts)\n })\n\n const preload = Vue.computed(() => {\n if (options.reloadDocument || options.disabled) {\n return false\n }\n return options.preload ?? router.options.defaultPreload\n })\n\n const preloadDelay = Vue.computed(\n () => options.preloadDelay ?? router.options.defaultPreloadDelay ?? 0,\n )\n\n const isActive = Vue.computed(() =>\n getIsActive(\n currentLocation.value,\n next.value,\n options.activeOptions,\n router,\n ),\n )\n\n const doPreload = () =>\n router\n .preloadRoute({ ...options, _builtLocation: next.value } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const enqueuePreload = (\n e?: MouseEvent | FocusEvent | IntersectionObserverEntry,\n ) => {\n if (!e) {\n clearTimeout(timeoutMap.get(ref))\n timeoutMap.delete(ref)\n return\n }\n\n if (\n !(\n (e as IntersectionObserverEntry).isIntersecting ??\n preload.value === 'intent'\n )\n ) {\n if ((e as IntersectionObserverEntry).isIntersecting === false) {\n clearTimeout(timeoutMap.get(ref))\n timeoutMap.delete(ref)\n }\n return\n }\n\n if (!preloadDelay.value) {\n doPreload()\n return\n }\n\n if (!timeoutMap.has(ref)) {\n timeoutMap.set(\n ref,\n setTimeout(() => {\n timeoutMap.delete(ref)\n doPreload()\n }, preloadDelay.value),\n )\n }\n }\n\n useIntersectionObserver(\n ref,\n enqueuePreload,\n () => preload.value !== 'viewport',\n )\n\n Vue.effect(() => {\n if (hasRenderFetched) {\n return\n }\n if (preload.value === 'render') {\n doPreload()\n hasRenderFetched = true\n }\n })\n\n // The click handler\n const handleClick = (e: PointerEvent): void => {\n // Check actual element's target attribute as fallback\n const elementTarget = (\n e.currentTarget as HTMLAnchorElement | SVGAElement\n )?.getAttribute('target')\n const effectiveTarget =\n options.target !== undefined ? options.target : elementTarget\n\n if (\n !options.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n // Don't prevent default or handle navigation if reloadDocument is true\n if (options.reloadDocument) {\n return\n }\n\n e.preventDefault()\n\n // All is well? Navigate!\n router.navigate({\n ...options,\n replace: options.replace,\n resetScroll: options.resetScroll,\n hashScrollIntoView: options.hashScrollIntoView,\n startTransition: options.startTransition,\n viewTransition: options.viewTransition,\n ignoreBlocker: options.ignoreBlocker,\n })\n }\n }\n\n const handleTouchStart = () => {\n if (preload.value !== 'intent') return\n doPreload()\n }\n\n const handleLeave = () => {\n if (preload.value === 'intent') {\n clearTimeout(timeoutMap.get(ref))\n timeoutMap.delete(ref)\n }\n }\n\n // Helper to compose event handlers - with explicit return type and better type handling\n function composeEventHandlers<T extends Event>(\n handlers: Array<EventHandler<T> | undefined>,\n ): (e: T) => void {\n return (event: T) => {\n for (const handler of handlers) {\n if (handler) {\n handler(event)\n }\n }\n }\n }\n\n // Get the active and inactive props\n const resolvedStyleProps = Vue.computed(() =>\n resolveStyleProps(options as AnyLinkPropsOptions, isActive.value),\n )\n\n const href = Vue.computed(() =>\n getHref(options as AnyLinkPropsOptions, router, next.value),\n )\n\n // Create static event handlers that don't change between renders\n const staticEventHandlers = {\n onClick: composeEventHandlers<PointerEvent>([options.onClick, handleClick]),\n onBlur: composeEventHandlers<FocusEvent>([options.onBlur, handleLeave]),\n onFocus: composeEventHandlers<FocusEvent>([\n options.onFocus,\n enqueuePreload,\n ]),\n onMouseenter: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseenter,\n enqueuePreload,\n ]),\n onMouseover: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseover,\n enqueuePreload,\n ]),\n onMouseleave: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseleave,\n handleLeave,\n ]),\n onMouseout: composeEventHandlers<MouseEvent>([\n eventHandlers.onMouseout,\n handleLeave,\n ]),\n onTouchstart: composeEventHandlers<TouchEvent>([\n eventHandlers.onTouchstart,\n handleTouchStart,\n ]),\n }\n\n // Compute all props synchronously to avoid hydration mismatches\n // Using Vue.computed ensures props are calculated at render time, not after\n const computedProps = Vue.computed<LinkHTMLAttributes>(() => {\n const {\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n } = resolvedStyleProps.value\n return combineResultProps({\n href: href.value,\n options: options as AnyLinkPropsOptions,\n ref,\n staticEventHandlers,\n isActive: isActive.value,\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n })\n })\n\n // Return the computed ref itself - callers should access .value\n return computedProps as unknown as LinkHTMLAttributes\n}\n\nfunction resolveStyleProps(options: AnyLinkPropsOptions, isActive: boolean) {\n const activeProps = options.activeProps || (() => ({ class: 'active' }))\n const resolvedActiveProps: StyledProps = (isActive\n ? typeof activeProps === 'function'\n ? activeProps()\n : activeProps\n : {}) || { class: undefined, style: undefined }\n\n const inactiveProps = options.inactiveProps || (() => ({}))\n\n const resolvedInactiveProps: StyledProps = (isActive\n ? {}\n : typeof inactiveProps === 'function'\n ? inactiveProps()\n : inactiveProps) || { class: undefined, style: undefined }\n\n const classes = [\n options.class,\n resolvedActiveProps?.class,\n resolvedInactiveProps?.class,\n ].filter(Boolean)\n const resolvedClassName = classes.length ? classes.join(' ') : undefined\n\n const result: Record<string, string | number> = {}\n\n // Merge styles from all sources\n if (options.style) {\n Object.assign(result, options.style)\n }\n\n if (resolvedActiveProps?.style) {\n Object.assign(result, resolvedActiveProps.style)\n }\n\n if (resolvedInactiveProps?.style) {\n Object.assign(result, resolvedInactiveProps.style)\n }\n\n const resolvedStyle = hasKeys(result) ? result : undefined\n return {\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n }\n}\n\nfunction combineResultProps({\n href,\n options,\n isActive,\n resolvedActiveProps,\n resolvedInactiveProps,\n resolvedClassName,\n resolvedStyle,\n ref,\n staticEventHandlers,\n}: {\n initial?: LinkHTMLAttributes\n href: string | undefined\n options: AnyLinkPropsOptions\n isActive: boolean\n resolvedActiveProps: StyledProps\n resolvedInactiveProps: StyledProps\n resolvedClassName?: string\n resolvedStyle?: Record<string, string | number>\n ref?: Vue.VNodeRef | undefined\n staticEventHandlers?: {\n onClick: any\n onBlur: any\n onFocus: any\n onMouseenter: any\n onMouseover: any\n onMouseleave: any\n onMouseout: any\n onTouchstart: any\n }\n}) {\n const result: Record<string, unknown> = {\n ...getPropsSafeToSpread(options),\n ref,\n ...staticEventHandlers,\n href,\n disabled: !!options.disabled,\n target: options.target,\n }\n\n if (resolvedStyle) {\n result.style = resolvedStyle\n }\n\n if (resolvedClassName) {\n result.class = resolvedClassName\n }\n\n if (options.disabled) {\n result.role = 'link'\n result['aria-disabled'] = true\n }\n\n if (isActive) {\n result['data-status'] = 'active'\n result['aria-current'] = 'page'\n }\n\n for (const key of Object.keys(resolvedActiveProps)) {\n if (key !== 'class' && key !== 'style') {\n result[key] = resolvedActiveProps[key]\n }\n }\n\n for (const key of Object.keys(resolvedInactiveProps)) {\n if (key !== 'class' && key !== 'style') {\n result[key] = resolvedInactiveProps[key]\n }\n }\n return result\n}\n\nfunction getLinkEventHandlers(\n options: LinkEventOptions,\n): VueStyleLinkEventHandlers {\n return {\n onMouseenter: options.onMouseEnter ?? options.onMouseenter,\n onMouseleave: options.onMouseLeave ?? options.onMouseleave,\n onMouseover: options.onMouseOver ?? options.onMouseover,\n onMouseout: options.onMouseOut ?? options.onMouseout,\n onTouchstart: options.onTouchStart ?? options.onTouchstart,\n }\n}\n\nconst getPropsSafeToSpread = (options: AnyLinkPropsOptions) => {\n const {\n activeProps: _activeProps,\n inactiveProps: _inactiveProps,\n activeOptions: _activeOptions,\n to: _to,\n preload: _preload,\n preloadDelay: _preloadDelay,\n preloadIntentProximity: _preloadIntentProximity,\n hashScrollIntoView: _hashScrollIntoView,\n replace: _replace,\n startTransition: _startTransition,\n resetScroll: _resetScroll,\n viewTransition: _viewTransition,\n children: _children,\n target: _target,\n disabled: _disabled,\n style: _style,\n class: _class,\n onClick: _onClick,\n onBlur: _onBlur,\n onFocus: _onFocus,\n onMouseEnter: _onMouseEnter,\n onMouseenter: _onMouseenter,\n onMouseLeave: _onMouseLeave,\n onMouseleave: _onMouseleave,\n onMouseOver: _onMouseOver,\n onMouseover: _onMouseover,\n onMouseOut: _onMouseOut,\n onMouseout: _onMouseout,\n onTouchStart: _onTouchStart,\n onTouchstart: _onTouchstart,\n ignoreBlocker: _ignoreBlocker,\n params: _params,\n search: _search,\n hash: _hash,\n state: _state,\n mask: _mask,\n reloadDocument: _reloadDocument,\n unsafeRelative: _unsafeRelative,\n _asChild: __asChild,\n from: _from,\n additionalProps: _additionalProps,\n ...propsSafeToSpread\n } = options as AnyLinkPropsOptions & {\n additionalProps?: unknown\n children?: unknown\n _asChild?: unknown\n }\n\n return propsSafeToSpread\n}\n\nfunction getIsActive(\n loc: {\n pathname: string\n search: any\n hash: string\n },\n nextLoc: {\n pathname: string\n search: any\n hash: string\n },\n activeOptions: LinkOptions['activeOptions'],\n router: AnyRouter,\n) {\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n loc.pathname,\n nextLoc.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(loc.pathname, router.basepath)\n const nextPath = removeTrailingSlash(nextLoc.pathname, router.basepath)\n\n const pathIsFuzzyEqual =\n currentPath.startsWith(nextPath) &&\n (currentPath.length === nextPath.length ||\n currentPath[nextPath.length] === '/')\n if (!pathIsFuzzyEqual) {\n return false\n }\n }\n\n if (activeOptions?.includeSearch ?? true) {\n const searchTest = deepEqual(loc.search, nextLoc.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n return loc.hash === nextLoc.hash\n }\n return true\n}\n\nfunction getHref(\n options: AnyLinkPropsOptions,\n router: AnyRouter,\n nextLocation?: ParsedLocation,\n) {\n if (options.disabled) {\n return undefined\n }\n const location = nextLocation?.maskedLocation ?? nextLocation\n\n // Use publicHref - it contains the correct href for display\n // When a rewrite changes the origin, publicHref is the full URL\n // Otherwise it's the origin-stripped path\n // This avoids constructing URL objects in the hot path\n const publicHref = location?.publicHref\n if (!publicHref) return undefined\n\n const external = location?.external\n if (external) return publicHref\n\n return router.history.createHref(publicHref) || '/'\n}\n\n// Type definitions\nexport type UseLinkPropsOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkHTMLAttributes\n\nexport type ActiveLinkOptions<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n (TComp extends keyof HTMLElementTagNameMap\n ? LinkHTMLAttributes\n : PropsOfComponent<TComp>) & {\n [key: `data-${string}`]: unknown\n }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n /**\n * A function that returns additional props for the `active` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n /**\n * A function that returns additional props for the `inactive` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkPropsChildren\n\nexport interface LinkPropsChildren {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?: Vue.VNodeChild | ((state: { isActive: boolean }) => Vue.VNodeChild)\n}\n\ntype LinkComponentVueProps<TComp> = TComp extends keyof HTMLElementTagNameMap\n ? Omit<LinkHTMLAttributes, keyof CreateLinkProps>\n : Omit<PropsOfComponent<TComp>, keyof CreateLinkProps>\n\nexport type LinkComponentProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkComponentVueProps<TComp> &\n LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n any,\n any,\n string,\n string,\n string,\n string\n>\n\nexport type LinkComponent<\n in out TComp,\n in out TDefaultFrom extends string = string,\n> = <\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = TDefaultFrom,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(\n props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => Vue.VNode\n\nexport interface LinkComponentRoute<\n in out TDefaultFrom extends string = string,\n> {\n defaultFrom: TDefaultFrom;\n <\n TRouter extends AnyRouter = RegisteredRouter,\n const TTo extends string | undefined = undefined,\n const TMaskTo extends string = '',\n >(\n props: LinkComponentProps<\n 'a',\n TRouter,\n this['defaultFrom'],\n TTo,\n this['defaultFrom'],\n TMaskTo\n >,\n ): Vue.VNode\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => Vue.VNode>,\n): LinkComponent<TComp> {\n return Vue.defineComponent({\n name: 'CreatedLink',\n inheritAttrs: false,\n setup(_, { attrs, slots }) {\n return () => Vue.h(LinkImpl, { ...attrs, _asChild: Comp }, slots)\n },\n }) as any\n}\n\nconst LinkImpl = Vue.defineComponent({\n name: 'Link',\n inheritAttrs: false,\n props: [\n '_asChild',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'from',\n 'search',\n 'params',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'disabled',\n 'additionalProps',\n 'viewTransition',\n 'resetScroll',\n 'startTransition',\n 'hashScrollIntoView',\n 'replace',\n 'ignoreBlocker',\n 'target',\n ],\n setup(props, { attrs, slots }) {\n // Call useLinkProps ONCE during setup with combined props and attrs\n const allProps = { ...props, ...attrs }\n const linkPropsSource = useLinkProps(allProps) as\n | LinkHTMLAttributes\n | Vue.ComputedRef<LinkHTMLAttributes>\n\n return () => {\n const Component = props._asChild || 'a'\n\n const linkProps = Vue.unref(linkPropsSource)\n\n const isActive = linkProps['data-status'] === 'active'\n\n // Create the slot content or empty array if no default slot\n const slotContent = slots.default ? slots.default({ isActive }) : []\n\n // Special handling for SVG links - wrap an <a> inside the SVG\n if (Component === 'svg') {\n // Create props without class for svg link\n const svgLinkProps = { ...linkProps }\n delete svgLinkProps.class\n return Vue.h('svg', {}, [Vue.h('a', svgLinkProps, slotContent)])\n }\n\n // For custom functional components (non-string), pass children as a prop\n // since they may expect children as a prop like in Solid\n if (typeof Component !== 'string') {\n return Vue.h(\n Component,\n { ...linkProps, children: slotContent },\n slotContent,\n )\n }\n\n // Return the component with props and children\n return Vue.h(Component, linkProps, slotContent)\n }\n },\n})\n\n/**\n * Link component with proper TypeScript generics support\n */\nexport const Link = LinkImpl as unknown as Vue.Component<unknown> &\n Vue.Component<CreateLinkProps> &\n LinkComponent<'a'>\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nexport type LinkOptionsFnOptions<\n TOptions,\n TComp,\n TRouter extends AnyRouter = RegisteredRouter,\n> =\n TOptions extends ReadonlyArray<any>\n ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n const TOptions,\n TRouter extends AnyRouter = RegisteredRouter,\n>(\n options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n return options as any\n}\n"],"mappings":";;;;;;;AA+BA,IAAMW,6BAAa,IAAIC,QAA+C;AA+CtE,SAAgBC,aAOdC,SACoB;CACpB,MAAMC,SAASN,UAAU;CACzB,IAAIO,mBAAmB;CAGvB,IAAI,CAACD,QAAQ;EACXE,QAAQC,KAAK,6DAA6D;EAC1E,OAAOlB,IAAImB,gBAAgB,CAAC,EAAE;CAChC;CAGA,MAAMC,OAAOpB,IAAImB,eAAe;EAC9B,IAAI;GACF,IAAIE,IAAI,GAAGP,QAAQQ,IAAI;GACvB,OAAO;EACT,QAAQ;GACN,OAAO;EACT;CACF,CAAC;CAED,MAAMC,MAAMvB,IAAIuB,IAAoB,IAAI;CACxC,MAAMC,gBAAgBC,qBAAqBX,OAA2B;CAEtE,IAAIM,KAAKM,UAAU,YAAY;EAE7B,IAAItB,oBAAoBU,QAAQQ,IAAcP,OAAOY,iBAAiB,GAAG;GACvE,IAAA,QAAA,IAAA,aAA6B,cAC3BV,QAAQC,KAAK,yCAAyCJ,QAAQQ,IAAI;GAGpE,MAAMS,YAAqC;IACzC,GAAGC,qBAAqBlB,OAA8B;IACtDS;IAEAU,QAAQnB,QAAQmB;IAChBC,UAAUpB,QAAQoB;IAClBC,OAAOrB,QAAQqB;IACfC,OAAOtB,QAAQsB;IACfC,SAASvB,QAAQuB;IACjBC,QAAQxB,QAAQwB;IAChBC,SAASzB,QAAQ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EJ,OAAOC,SAAS;EAG7B,MAAMK,kBAAkB/M,aAAa8M;GADlB,GAAGD;GAAO,GAAGJ;EACKK,CAAQ;EAI7C,aAAa;GACX,MAAME,YAAYH,MAAMxC,YAAY;GAEpC,MAAM4C,YAAY9N,IAAI+N,MAAMH,eAAe;GAE3C,MAAMrK,WAAWuK,UAAU,mBAAmB;GAG9C,MAAME,cAAcT,MAAMU,UAAUV,MAAMU,QAAQ,EAAE1K,SAAS,CAAC,IAAI,CAAA;GAGlE,IAAIsK,cAAc,OAAO;IAEvB,MAAMK,eAAe,EAAE,GAAGJ,UAAU;IACpC,OAAOI,aAAa9L;IACpB,OAAOpC,IAAIwN,EAAE,OAAO,CAAC,GAAG,CAACxN,IAAIwN,EAAE,KAAKU,cAAcF,WAAW,CAAC,CAAC;GACjE;GAIA,IAAI,OAAOH,cAAc,UACvB,OAAO7N,IAAIwN,EACTK,WACA;IAAE,GAAGC;IAAW7E,UAAU+E;GAAY,GACtCA,WACF;GAIF,OAAOhO,IAAIwN,EAAEK,WAAWC,WAAWE,WAAW;EAChD;CACF;AACF,CAAC;;;;AAKD,IAAaG,OAAOV;AAIpB,SAASvH,YAAYb,GAAe;CAClC,OAAO,CAAC,EAAEA,EAAE+I,WAAW/I,EAAEgJ,UAAUhJ,EAAEiJ,WAAWjJ,EAAEkJ;AACpD;AAkBA,IAAaC,eAAmC1N,YAAY;CAC1D,OAAOA;AACT"} |
+20
-10
@@ -0,1 +1,2 @@ | ||
| import { nonRouteComponentContext, renderInNonRouteComponentContext } from "./nonRouteComponentContext.js"; | ||
| import { CatchBoundary } from "./CatchBoundary.js"; | ||
@@ -28,3 +29,3 @@ import { useRouter } from "./useRouter.js"; | ||
| const PendingComponent = route?.options.pendingComponent ?? router.options.defaultPendingComponent; | ||
| const pendingElement = PendingComponent ? Vue.h(PendingComponent) : void 0; | ||
| const pendingElement = PendingComponent ? process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(PendingComponent, void 0, "pendingComponent") : Vue.h(PendingComponent) : void 0; | ||
| const routeErrorComponent = route?.options.errorComponent ?? router.options.defaultErrorComponent; | ||
@@ -42,3 +43,3 @@ const routeOnCatch = route?.options.onCatch ?? router.options.defaultOnCatch; | ||
| if (error.routeId !== routeId) throw error; | ||
| return Vue.h(routeNotFoundComponent, error); | ||
| return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(routeNotFoundComponent, error, "notFoundComponent") : Vue.h(routeNotFoundComponent, error); | ||
| }, | ||
@@ -95,9 +96,12 @@ children: content | ||
| const RouteErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent; | ||
| if (RouteErrorComponent) return Vue.h(RouteErrorComponent, { | ||
| error: match.error, | ||
| reset: () => { | ||
| router.invalidate(); | ||
| }, | ||
| info: { componentStack: "" } | ||
| }); | ||
| if (RouteErrorComponent) { | ||
| const errorProps = { | ||
| error: match.error, | ||
| reset: () => { | ||
| router.invalidate(); | ||
| }, | ||
| info: { componentStack: "" } | ||
| }; | ||
| return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(RouteErrorComponent, errorProps, "errorComponent") : Vue.h(RouteErrorComponent, errorProps); | ||
| } | ||
| throw match.error; | ||
@@ -107,3 +111,3 @@ } | ||
| const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent; | ||
| if (PendingComponent) return Vue.h(PendingComponent); | ||
| if (PendingComponent) return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(PendingComponent, void 0, "pendingComponent") : Vue.h(PendingComponent); | ||
| return null; | ||
@@ -120,2 +124,8 @@ } | ||
| setup() { | ||
| if (process.env.NODE_ENV !== "production") { | ||
| const nonRouteComponent = Vue.inject(nonRouteComponentContext, void 0); | ||
| if (nonRouteComponent) Vue.watch(nonRouteComponent, (component) => { | ||
| console.warn(`Warning: An <Outlet /> was rendered inside a ${component}. <Outlet /> should only be rendered inside a route component.`); | ||
| }, { immediate: true }); | ||
| } | ||
| const router = useRouter(); | ||
@@ -122,0 +132,0 @@ const parentRouteId = Vue.inject(routeIdContext); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Match.js","names":["Vue","isNotFound","rootRouteId","isServer","useStore","CatchBoundary","ClientOnly","useRouter","CatchNotFound","routeIdContext","renderRouteNotFound","ScrollRestoration","Match","defineComponent","name","props","routeId","type","String","required","setup","router","activeMatch","stores","getMatchStore","value","equal","Object","is","provide","match","route","routesById","undefined","PendingComponent","options","pendingComponent","defaultPendingComponent","pendingElement","h","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","ShellComponent","shellComponent","resolvedNoSsr","ssr","renderMatchContent","matchInner","MatchInner","content","fallback","default","error","children","getResetKey","process","env","NODE_ENV","console","warn","id","parentRoute","Fragment","scrollRestoration","inject","combinedState","computed","matchRouteId","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","state","remountKey","status","RouteErrorComponent","reset","invalidate","info","componentStack","Comp","defaultComponent","key","Outlet","parentRouteId","parentMatch","childMatch","matches","index","findIndex","child","_notFound","nextMatch"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { isNotFound, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary } from './CatchBoundary'\nimport { ClientOnly } from './ClientOnly'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { routeIdContext } from './matchContext'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { VNode } from 'vue'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = Vue.defineComponent({\n name: 'Match',\n props: {\n routeId: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const router = useRouter()\n\n const routeId = props.routeId\n\n const activeMatch = useStore(\n router.stores.getMatchStore(routeId),\n (value) => value,\n { equal: Object.is },\n )\n // Provide routeId context (stable string) for children.\n // MatchInner, Outlet, and useMatch all consume this.\n Vue.provide(routeIdContext, routeId)\n\n return (): VNode => {\n const match = activeMatch.value\n const route = match ? (router.routesById[routeId] as AnyRoute) : undefined\n const PendingComponent =\n route?.options.pendingComponent ??\n router.options.defaultPendingComponent\n const pendingElement = PendingComponent\n ? Vue.h(PendingComponent)\n : undefined\n const routeErrorComponent =\n route?.options.errorComponent ?? router.options.defaultErrorComponent\n const routeOnCatch =\n route?.options.onCatch ?? router.options.defaultOnCatch\n const routeNotFoundComponent = route?.isRoot\n ? (route.options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route?.options.notFoundComponent\n const ShellComponent = route?.isRoot\n ? ((route.options as RootRouteOptions).shellComponent as any)\n : undefined\n const resolvedNoSsr = match?.ssr === false || match?.ssr === 'data-only'\n\n const renderMatchContent = (): VNode => {\n const matchInner = Vue.h(MatchInner)\n\n let content: VNode = resolvedNoSsr\n ? Vue.h(\n ClientOnly,\n {\n fallback: pendingElement,\n },\n {\n default: () => matchInner,\n },\n )\n : matchInner\n\n // Wrap in NotFound boundary if needed\n if (routeNotFoundComponent) {\n content = Vue.h(CatchNotFound, {\n fallback: (error: any) => {\n error.routeId ??= routeId\n\n if (error.routeId !== routeId) {\n throw error\n }\n\n return Vue.h(routeNotFoundComponent, error)\n },\n children: content,\n })\n }\n\n // Wrap in error boundary if needed\n if (routeErrorComponent) {\n content = CatchBoundary({\n getResetKey: () => activeMatch.value,\n errorComponent: routeErrorComponent,\n onCatch: (error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) {\n error.routeId ??= routeId\n throw error\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Warning: Error in route match: ${match?.id}`)\n }\n routeOnCatch?.(error)\n },\n children: content,\n })\n }\n\n if (route?.parentRoute?.id !== rootRouteId) {\n return content\n }\n\n return Vue.h(Vue.Fragment, null, [\n content,\n Vue.h(Vue.Fragment, null, [\n (isServer ?? router.isServer) && router.options.scrollRestoration\n ? Vue.h(ScrollRestoration)\n : null,\n ]),\n ])\n }\n\n if (!ShellComponent) {\n return renderMatchContent()\n }\n\n return Vue.h(ShellComponent, null, {\n // Important: return a fresh VNode on each slot invocation so that shell\n // components can re-render without reusing a cached VNode instance.\n default: () => renderMatchContent(),\n })\n }\n },\n})\n\n// On Rendered can't happen above the root layout because it actually\nexport const MatchInner = Vue.defineComponent({\n name: 'MatchInner',\n setup() {\n const router = useRouter()\n\n // Use routeId from context (provided by parent Match) — stable string.\n const routeId = Vue.inject(routeIdContext)!\n const activeMatch = useStore(router.stores.getMatchStore(routeId))\n\n // Combined selector for match state AND remount key\n // This ensures both are computed in the same selector call with consistent data\n const combinedState = Vue.computed(() => {\n const match = activeMatch.value\n if (!match) {\n // Route no longer exists - truly navigating away\n return null\n }\n\n const matchRouteId = match.routeId as string\n\n // Compute remount key\n const remountFn =\n (router.routesById[matchRouteId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n\n const remountDeps = remountFn\n ? remountFn({\n routeId: matchRouteId,\n loaderDeps: match.loaderDeps,\n params: match._strictParams,\n search: match._strictSearch,\n })\n : undefined\n\n return [\n match,\n remountDeps ? JSON.stringify(remountDeps) : undefined,\n ] as const\n })\n\n return (): VNode | null => {\n // If match doesn't exist, return null (component is being unmounted or not ready)\n const state = combinedState.value\n if (!state) {\n return null\n }\n const [match, remountKey] = state\n const route = router.routesById[match.routeId]!\n\n // Handle different match statuses\n if (match.status === 'notFound') {\n return renderRouteNotFound(router, route, match.error)\n }\n\n if (match.status === 'error') {\n // Check if this route or any parent has an error component\n const RouteErrorComponent =\n route.options.errorComponent ?? router.options.defaultErrorComponent\n\n // If this route has an error component, render it directly\n // This is more reliable than relying on Vue's error boundary\n if (RouteErrorComponent) {\n return Vue.h(RouteErrorComponent, {\n error: match.error,\n reset: () => {\n router.invalidate()\n },\n info: {\n componentStack: '',\n },\n })\n }\n\n // If there's no error component for this route, throw the error\n // so it can bubble up to the nearest parent with an error component\n throw match.error\n }\n\n if (match.status === 'pending') {\n // In Vue, we render the pending component directly instead of throwing a promise\n // because Vue's Suspense doesn't catch thrown promises like React does\n const PendingComponent =\n route.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n if (PendingComponent) {\n return Vue.h(PendingComponent)\n }\n\n // If no pending component, return null while loading\n return null\n }\n\n // Success status - render the component with remount key\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n // Pass key as a prop - Vue.h properly handles 'key' as a special prop\n return Vue.h(\n Comp,\n remountKey !== undefined ? { key: remountKey } : undefined,\n )\n }\n\n return Vue.h(\n Outlet,\n remountKey !== undefined ? { key: remountKey } : undefined,\n )\n }\n },\n})\n\nexport const Outlet = Vue.defineComponent({\n name: 'Outlet',\n setup() {\n const router = useRouter()\n const parentRouteId = Vue.inject(routeIdContext)!\n\n const parentMatch = useStore(router.stores.getMatchStore(parentRouteId))\n\n const route = router.routesById[parentRouteId]!\n\n const childMatch = useStore(router.stores.matches, (matches) => {\n const index = matches.findIndex(\n (match) => match.routeId === parentRouteId,\n )\n const child = matches[index + 1]\n return child\n ? ([\n child.routeId,\n child.routeId + JSON.stringify(child._strictParams),\n ] as const)\n : undefined\n })\n\n return (): VNode | null => {\n if (parentMatch.value?._notFound) {\n return renderRouteNotFound(router, route, parentMatch.value.error)\n }\n\n const child = childMatch.value\n if (!child) {\n return null\n }\n\n const nextMatch = Vue.h(Match, {\n routeId: child[0 /* routeId */],\n // Key based on routeId + params only (not loaderDeps)\n // This ensures component recreates when params change,\n // but NOT when only loaderDeps change\n key: child[1 /* key */],\n })\n\n // Note: We intentionally do NOT wrap in Suspense here.\n // The top-level Suspense in Matches already covers the root.\n // The old code compared matchId (e.g. \"__root__/\") with rootRouteId (\"__root__\")\n // which never matched, so this Suspense was effectively dead code.\n // With routeId-based lookup, parentRouteId === rootRouteId would match,\n // causing a double-Suspense that corrupts Vue's DOM during updates.\n return nextMatch\n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AAIvD,KAAAA,CACnD;EACF;CACF;AACF,CAAC;AAED,IAAaiE,SAASlG,IAAIa,gBAAgB;CACxCC,MAAM;CACNM,QAAQ;EACN,MAAMC,SAASd,UAAU;EACzB,MAAM4F,gBAAgBnG,IAAIyE,OAAOhE,cAAc;EAE/C,MAAM2F,cAAchG,SAASiB,OAAOE,OAAOC,cAAc2E,aAAa,CAAC;EAEvE,MAAMpE,QAAQV,OAAOW,WAAWmE;EAEhC,MAAME,aAAajG,SAASiB,OAAOE,OAAO+E,UAAUA,YAAY;GAI9D,MAAMG,QAAQH,QAHAA,QAAQE,WACnB1E,UAAUA,MAAMd,YAAYmF,aAETI,IAAQ;GAC9B,OAAOE,QACF,CACCA,MAAMzF,SACNyF,MAAMzF,UAAUqE,KAAKC,UAAUmB,MAAMvB,aAAa,CAAC,IAErDjD,KAAAA;EACN,CAAC;EAED,aAA2B;GACzB,IAAImE,YAAY3E,OAAOiF,WACrB,OAAOhG,oBAAoBW,QAAQU,OAAOqE,YAAY3E,MAAMoC,KAAK;GAGnE,MAAM4C,QAAQJ,WAAW5E;GACzB,IAAI,CAACgF,OACH,OAAO;GAiBT,OAdkBzG,IAAIuC,EAAE3B,OAAO;IAC7BI,SAASyF,MAAM;IAIfR,KAAKQ,MAAM;GACb,CAQOE;EACT;CACF;AACF,CAAC"} | ||
| {"version":3,"file":"Match.js","names":["Vue","isNotFound","rootRouteId","isServer","useStore","CatchBoundary","ClientOnly","useRouter","CatchNotFound","routeIdContext","renderRouteNotFound","ScrollRestoration","nonRouteComponentContext","renderInNonRouteComponentContext","Match","defineComponent","name","props","routeId","type","String","required","setup","router","activeMatch","stores","getMatchStore","value","equal","Object","is","provide","match","route","routesById","undefined","PendingComponent","options","pendingComponent","defaultPendingComponent","pendingElement","process","env","NODE_ENV","h","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","ShellComponent","shellComponent","resolvedNoSsr","ssr","renderMatchContent","matchInner","MatchInner","content","fallback","default","error","children","getResetKey","console","warn","id","parentRoute","Fragment","scrollRestoration","inject","combinedState","computed","matchRouteId","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","state","remountKey","status","RouteErrorComponent","errorProps","reset","invalidate","info","componentStack","Comp","defaultComponent","key","Outlet","nonRouteComponent","watch","immediate","parentRouteId","parentMatch","childMatch","matches","index","findIndex","child","_notFound","nextMatch"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { isNotFound, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary } from './CatchBoundary'\nimport { ClientOnly } from './ClientOnly'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { routeIdContext } from './matchContext'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport {\n nonRouteComponentContext,\n renderInNonRouteComponentContext,\n} from './nonRouteComponentContext'\nimport type { VNode } from 'vue'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = Vue.defineComponent({\n name: 'Match',\n props: {\n routeId: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const router = useRouter()\n\n const routeId = props.routeId\n\n const activeMatch = useStore(\n router.stores.getMatchStore(routeId),\n (value) => value,\n { equal: Object.is },\n )\n // Provide routeId context (stable string) for children.\n // MatchInner, Outlet, and useMatch all consume this.\n Vue.provide(routeIdContext, routeId)\n\n return (): VNode => {\n const match = activeMatch.value\n const route = match ? (router.routesById[routeId] as AnyRoute) : undefined\n const PendingComponent =\n route?.options.pendingComponent ??\n router.options.defaultPendingComponent\n const pendingElement = PendingComponent\n ? process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n PendingComponent,\n undefined,\n 'pendingComponent',\n )\n : Vue.h(PendingComponent)\n : undefined\n const routeErrorComponent =\n route?.options.errorComponent ?? router.options.defaultErrorComponent\n const routeOnCatch =\n route?.options.onCatch ?? router.options.defaultOnCatch\n const routeNotFoundComponent = route?.isRoot\n ? (route.options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route?.options.notFoundComponent\n const ShellComponent = route?.isRoot\n ? ((route.options as RootRouteOptions).shellComponent as any)\n : undefined\n const resolvedNoSsr = match?.ssr === false || match?.ssr === 'data-only'\n\n const renderMatchContent = (): VNode => {\n const matchInner = Vue.h(MatchInner)\n\n let content: VNode = resolvedNoSsr\n ? Vue.h(\n ClientOnly,\n {\n fallback: pendingElement,\n },\n {\n default: () => matchInner,\n },\n )\n : matchInner\n\n // Wrap in NotFound boundary if needed\n if (routeNotFoundComponent) {\n content = Vue.h(CatchNotFound, {\n fallback: (error: any) => {\n error.routeId ??= routeId\n\n if (error.routeId !== routeId) {\n throw error\n }\n\n return process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n routeNotFoundComponent,\n error,\n 'notFoundComponent',\n )\n : Vue.h(routeNotFoundComponent, error)\n },\n children: content,\n })\n }\n\n // Wrap in error boundary if needed\n if (routeErrorComponent) {\n content = CatchBoundary({\n getResetKey: () => activeMatch.value,\n errorComponent: routeErrorComponent,\n onCatch: (error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) {\n error.routeId ??= routeId\n throw error\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Warning: Error in route match: ${match?.id}`)\n }\n routeOnCatch?.(error)\n },\n children: content,\n })\n }\n\n if (route?.parentRoute?.id !== rootRouteId) {\n return content\n }\n\n return Vue.h(Vue.Fragment, null, [\n content,\n Vue.h(Vue.Fragment, null, [\n (isServer ?? router.isServer) && router.options.scrollRestoration\n ? Vue.h(ScrollRestoration)\n : null,\n ]),\n ])\n }\n\n if (!ShellComponent) {\n return renderMatchContent()\n }\n\n return Vue.h(ShellComponent, null, {\n // Important: return a fresh VNode on each slot invocation so that shell\n // components can re-render without reusing a cached VNode instance.\n default: () => renderMatchContent(),\n })\n }\n },\n})\n\n// On Rendered can't happen above the root layout because it actually\nexport const MatchInner = Vue.defineComponent({\n name: 'MatchInner',\n setup() {\n const router = useRouter()\n\n // Use routeId from context (provided by parent Match) — stable string.\n const routeId = Vue.inject(routeIdContext)!\n const activeMatch = useStore(router.stores.getMatchStore(routeId))\n\n // Combined selector for match state AND remount key\n // This ensures both are computed in the same selector call with consistent data\n const combinedState = Vue.computed(() => {\n const match = activeMatch.value\n if (!match) {\n // Route no longer exists - truly navigating away\n return null\n }\n\n const matchRouteId = match.routeId as string\n\n // Compute remount key\n const remountFn =\n (router.routesById[matchRouteId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n\n const remountDeps = remountFn\n ? remountFn({\n routeId: matchRouteId,\n loaderDeps: match.loaderDeps,\n params: match._strictParams,\n search: match._strictSearch,\n })\n : undefined\n\n return [\n match,\n remountDeps ? JSON.stringify(remountDeps) : undefined,\n ] as const\n })\n\n return (): VNode | null => {\n // If match doesn't exist, return null (component is being unmounted or not ready)\n const state = combinedState.value\n if (!state) {\n return null\n }\n const [match, remountKey] = state\n const route = router.routesById[match.routeId]!\n\n // Handle different match statuses\n if (match.status === 'notFound') {\n return renderRouteNotFound(router, route, match.error)\n }\n\n if (match.status === 'error') {\n // Check if this route or any parent has an error component\n const RouteErrorComponent =\n route.options.errorComponent ?? router.options.defaultErrorComponent\n\n // If this route has an error component, render it directly\n // This is more reliable than relying on Vue's error boundary\n if (RouteErrorComponent) {\n const errorProps = {\n error: match.error,\n reset: () => {\n router.invalidate()\n },\n info: {\n componentStack: '',\n },\n }\n return process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n RouteErrorComponent,\n errorProps,\n 'errorComponent',\n )\n : Vue.h(RouteErrorComponent, errorProps)\n }\n\n // If there's no error component for this route, throw the error\n // so it can bubble up to the nearest parent with an error component\n throw match.error\n }\n\n if (match.status === 'pending') {\n // In Vue, we render the pending component directly instead of throwing a promise\n // because Vue's Suspense doesn't catch thrown promises like React does\n const PendingComponent =\n route.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n if (PendingComponent) {\n return process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n PendingComponent,\n undefined,\n 'pendingComponent',\n )\n : Vue.h(PendingComponent)\n }\n\n // If no pending component, return null while loading\n return null\n }\n\n // Success status - render the component with remount key\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n // Pass key as a prop - Vue.h properly handles 'key' as a special prop\n return Vue.h(\n Comp,\n remountKey !== undefined ? { key: remountKey } : undefined,\n )\n }\n\n return Vue.h(\n Outlet,\n remountKey !== undefined ? { key: remountKey } : undefined,\n )\n }\n },\n})\n\nexport const Outlet = Vue.defineComponent({\n name: 'Outlet',\n setup() {\n if (process.env.NODE_ENV !== 'production') {\n const nonRouteComponent = Vue.inject(nonRouteComponentContext!, undefined)\n if (nonRouteComponent) {\n Vue.watch(\n nonRouteComponent,\n (component) => {\n console.warn(\n `Warning: An <Outlet /> was rendered inside a ${component}. <Outlet /> should only be rendered inside a route component.`,\n )\n },\n { immediate: true },\n )\n }\n }\n\n const router = useRouter()\n const parentRouteId = Vue.inject(routeIdContext)!\n\n const parentMatch = useStore(router.stores.getMatchStore(parentRouteId))\n\n const route = router.routesById[parentRouteId]!\n\n const childMatch = useStore(router.stores.matches, (matches) => {\n const index = matches.findIndex(\n (match) => match.routeId === parentRouteId,\n )\n const child = matches[index + 1]\n return child\n ? ([\n child.routeId,\n child.routeId + JSON.stringify(child._strictParams),\n ] as const)\n : undefined\n })\n\n return (): VNode | null => {\n if (parentMatch.value?._notFound) {\n return renderRouteNotFound(router, route, parentMatch.value.error)\n }\n\n const child = childMatch.value\n if (!child) {\n return null\n }\n\n const nextMatch = Vue.h(Match, {\n routeId: child[0 /* routeId */],\n // Key based on routeId + params only (not loaderDeps)\n // This ensures component recreates when params change,\n // but NOT when only loaderDeps change\n key: child[1 /* key */],\n })\n\n // Note: We intentionally do NOT wrap in Suspense here.\n // The top-level Suspense in Matches already covers the root.\n // The old code compared matchId (e.g. \"__root__/\") with rootRouteId (\"__root__\")\n // which never matched, so this Suspense was effectively dead code.\n // With routeId-based lookup, parentRouteId === rootRouteId would match,\n // causing a double-Suspense that corrupts Vue's DOM during updates.\n return nextMatch\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAac,QAAQd,IAAIe,gBAAgB;CACvCC,MAAM;CACNC,OAAO,EACLC,SAAS;EACPC,MAAMC;EACNC,UAAU;CACZ,EACF;CACAC,MAAML,OAAO;EACX,MAAMM,SAAShB,UAAU;EAEzB,MAAMW,UAAUD,MAAMC;EAEtB,MAAMM,cAAcpB,SAClBmB,OAAOE,OAAOC,cAAcR,OAAO,IAClCS,UAAUA,OACX,EAAEC,OAAOC,OAAOC,GAAG,CACrB;EAGA9B,IAAI+B,QAAQtB,gBAAgBS,OAAO;EAEnC,aAAoB;GAClB,MAAMc,QAAQR,YAAYG;GAC1B,MAAMM,QAAQD,QAAST,OAAOW,WAAWhB,WAAwBiB,KAAAA;GACjE,MAAMC,mBACJH,OAAOI,QAAQC,oBACff,OAAOc,QAAQE;GACjB,MAAMC,iBAAiBJ,mBAAAA,QAAAA,IAAAA,aACM,eACvBvB,iCACEuB,kBACAD,KAAAA,GACA,kBACF,IACAnC,IAAI4C,EAAER,gBAAgB,IACxBD,KAAAA;GACJ,MAAMU,sBACJZ,OAAOI,QAAQS,kBAAkBvB,OAAOc,QAAQU;GAClD,MAAMC,eACJf,OAAOI,QAAQY,WAAW1B,OAAOc,QAAQa;GAC3C,MAAMC,yBAAyBlB,OAAOmB,SACjCnB,MAAMI,QAAQgB,qBACf9B,OAAOc,QAAQiB,eAAejB,QAAQkB,YACtCtB,OAAOI,QAAQgB;GACnB,MAAMG,iBAAiBvB,OAAOmB,SACxBnB,MAAMI,QAA6BoB,iBACrCtB,KAAAA;GACJ,MAAMuB,gBAAgB1B,OAAO2B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UqE,KAAKC,UAAUuB,MAAM3B,aAAa,CAAC,IAErDjD,KAAAA;EACN,CAAC;EAED,aAA2B;GACzB,IAAIuE,YAAY/E,OAAOqF,WACrB,OAAOtG,oBAAoBa,QAAQU,OAAOyE,YAAY/E,MAAMuC,KAAK;GAGnE,MAAM6C,QAAQJ,WAAWhF;GACzB,IAAI,CAACoF,OACH,OAAO;GAiBT,OAdkB/G,IAAI4C,EAAE9B,OAAO;IAC7BI,SAAS6F,MAAM;IAIfX,KAAKW,MAAM;GACb,CAQOE;EACT;CACF;AACF,CAAC"} |
@@ -0,1 +1,2 @@ | ||
| import { renderInNonRouteComponentContext } from "./nonRouteComponentContext.js"; | ||
| import { CatchBoundary } from "./CatchBoundary.js"; | ||
@@ -16,3 +17,3 @@ import { useRouter } from "./useRouter.js"; | ||
| return () => { | ||
| const pendingElement = router.options.defaultPendingComponent ? Vue.h(router.options.defaultPendingComponent) : null; | ||
| const pendingElement = router.options.defaultPendingComponent ? process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(router.options.defaultPendingComponent, void 0, "pendingComponent") : Vue.h(router.options.defaultPendingComponent) : null; | ||
| const inner = (isServer ?? router.isServer) || typeof document !== "undefined" && router.ssr ? Vue.h(MatchesInner) : Vue.h(Vue.Suspense, { fallback: pendingElement }, { default: () => Vue.h(MatchesInner) }); | ||
@@ -19,0 +20,0 @@ return router.options.InnerWrap ? Vue.h(router.options.InnerWrap, null, { default: () => inner }) : inner; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Matches.js","names":["Vue","isServer","useStore","CatchBoundary","useRouter","useTransitionerSetup","routeIdContext","Match","Matches","defineComponent","name","setup","router","pendingElement","options","defaultPendingComponent","h","inner","document","ssr","MatchesInner","Suspense","fallback","default","InnerWrap","errorComponentFn","props","class","error","message","String","onClick","reset","matches","stores","routeId","computed","value","childElement","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","console","warn","toString","undefined","children","useMatchRoute","location","href","resolvedLocation","status","opts","matchRoute","pending","caseSensitive","fuzzy","includeSearch","rest","MatchRoute","from","type","required","to","Boolean","slots","params","match","Fragment","useMatches","select","useParentMatches","contextRouteId","inject","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { useTransitionerSetup } from './Transitioner'\nimport { routeIdContext } from './matchContext'\nimport { Match } from './Match'\nimport type {\n AnyRouter,\n DeepPartial,\n ErrorComponentProps,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\n// Define a type for the error component function\ntype ErrorRouteComponentType = (props: ErrorComponentProps) => Vue.VNode\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Vue.ComponentOptions['meta'] | undefined>\n links?: Array<Vue.ComponentOptions['link'] | undefined>\n scripts?: Array<Vue.ComponentOptions['script'] | undefined>\n headScripts?: Array<Vue.ComponentOptions['script'] | undefined>\n }\n}\n\nexport const Matches = Vue.defineComponent({\n name: 'Matches',\n setup() {\n const router = useRouter()\n useTransitionerSetup()\n\n return () => {\n const pendingElement = router.options.defaultPendingComponent\n ? Vue.h(router.options.defaultPendingComponent)\n : null\n\n // Do not render a root Suspense during SSR or hydrating from SSR\n const inner =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? Vue.h(MatchesInner)\n : Vue.h(\n Vue.Suspense,\n { fallback: pendingElement },\n {\n default: () => Vue.h(MatchesInner),\n },\n )\n\n return router.options.InnerWrap\n ? Vue.h(router.options.InnerWrap, null, { default: () => inner })\n : inner\n }\n },\n})\n\n// Create a simple error component function that matches ErrorRouteComponent\nconst errorComponentFn: ErrorRouteComponentType = (\n props: ErrorComponentProps,\n) => {\n return Vue.h('div', { class: 'error' }, [\n Vue.h('h1', null, 'Error'),\n Vue.h('p', null, props.error.message || String(props.error)),\n Vue.h('button', { onClick: props.reset }, 'Try Again'),\n ])\n}\n\nconst MatchesInner = Vue.defineComponent({\n name: 'MatchesInner',\n setup() {\n const router = useRouter()\n\n const matches = useStore(router.stores.matches)\n const routeId = Vue.computed(() => matches.value[0]?.routeId)\n\n return () => {\n // Generate a placeholder element if routeId.value is not present\n const childElement = routeId.value\n ? Vue.h(Match, { routeId: routeId.value })\n : Vue.h('div')\n\n // If disableGlobalCatchBoundary is true, don't wrap in CatchBoundary\n if (router.options.disableGlobalCatchBoundary) {\n return childElement\n }\n\n return Vue.h(CatchBoundary, {\n getResetKey: () => matches.value,\n errorComponent: errorComponentFn,\n onCatch:\n process.env.NODE_ENV !== 'production'\n ? (error: Error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined,\n children: childElement,\n })\n }\n },\n})\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n const location = useStore(router.stores.location, (value) => value.href)\n const resolvedLocation = useStore(\n router.stores.resolvedLocation,\n (value) => value?.href,\n )\n const status = useStore(router.stores.status)\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Vue.Ref<\n false | ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n > => {\n const matchRoute = Vue.computed(() => {\n location.value\n resolvedLocation.value\n status.value\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n\n return matchRoute\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: ResolveRoute<TRouter, TFrom, TTo>['types']['allParams'],\n ) => Vue.VNode)\n | Vue.VNode\n}\n\n// Create a type for the MatchRoute component that includes the generics\nexport interface MatchRouteComponentType {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n >(\n props: MakeMatchRouteOptions<TRouter, TFrom, TTo>,\n ): Vue.VNode\n new (): {\n $props: {\n from?: string\n to?: string\n fuzzy?: boolean\n caseSensitive?: boolean\n includeSearch?: boolean\n pending?: boolean\n }\n }\n}\n\nexport const MatchRoute = Vue.defineComponent({\n name: 'MatchRoute',\n props: {\n // Define props to match MakeMatchRouteOptions\n from: {\n type: String,\n required: false,\n },\n to: {\n type: String,\n required: false,\n },\n fuzzy: {\n type: Boolean,\n required: false,\n },\n caseSensitive: {\n type: Boolean,\n required: false,\n },\n includeSearch: {\n type: Boolean,\n required: false,\n },\n pending: {\n type: Boolean,\n required: false,\n },\n },\n setup(props, { slots }) {\n const params = useMatchRoute()(props)\n\n return () => {\n const match = params.value as boolean\n\n // Create a component that renders the slot in a reactive manner\n if (!match || !slots.default) {\n return null\n }\n\n // For function slots, pass the params\n if (typeof slots.default === 'function') {\n // Use h to create a wrapper component that will call the slot function\n return Vue.h(Vue.Fragment, null, slots.default(match))\n }\n\n // For normal slots, just render them\n return Vue.h(Vue.Fragment, null, slots.default)\n }\n },\n}) as unknown as MatchRouteComponentType\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return useStore(router.stores.matches, (matches) => {\n return opts?.select\n ? opts.select(matches as Array<MakeRouteMatchUnion<TRouter>>)\n : (matches as any)\n })\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Vue.inject(routeIdContext)\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.routeId === contextRouteId),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Vue.inject(routeIdContext)\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.routeId === contextRouteId) + 1,\n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ACtB,MAAMC,SAASnB,cAAc,EAAEzB,KAAK;EAEpC,aAAa;GACX,MAAM6C,QAAQD,OAAOjC;GAGrB,IAAI,CAACkC,SAAS,CAACF,MAAM9C,SACnB,OAAO;GAIT,IAAI,OAAO8C,MAAM9C,YAAY,YAE3B,OAAOvB,IAAIgB,EAAEhB,IAAIwE,UAAU,MAAMH,MAAM9C,QAAQgD,KAAK,CAAC;GAIvD,OAAOvE,IAAIgB,EAAEhB,IAAIwE,UAAU,MAAMH,MAAM9C,OAAO;EAChD;CACF;AACF,CAAC;AAWD,SAAgBkD,WAIdjB,MAC+C;CAE/C,OAAOtD,SADQE,UACCQ,EAAOsB,OAAOD,UAAUA,YAAY;EAClD,OAAOuB,MAAMkB,SACTlB,KAAKkB,OAAOzC,OAA8C,IACzDA;CACP,CAAC;AACH;AAEA,SAAgB0C,iBAIdnB,MAC+C;CAC/C,MAAMoB,iBAAiB5E,IAAI6E,OAAOvE,cAAc;CAEhD,OAAOmE,WAAW,EAChBC,SAASzC,YAAiD;EACxDA,UAAUA,QAAQ6C,MAChB,GACA7C,QAAQ8C,WAAWC,MAAMA,EAAE7C,YAAYyC,cAAc,CACvD;EACA,OAAOpB,MAAMkB,SAASlB,KAAKkB,OAAOzC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV;AAEA,SAAgBgD,gBAIdzB,MAC+C;CAC/C,MAAMoB,iBAAiB5E,IAAI6E,OAAOvE,cAAc;CAEhD,OAAOmE,WAAW,EAChBC,SAASzC,YAAiD;EACxDA,UAAUA,QAAQ6C,MAChB7C,QAAQ8C,WAAWC,MAAMA,EAAE7C,YAAYyC,cAAc,IAAI,CAC3D;EACA,OAAOpB,MAAMkB,SAASlB,KAAKkB,OAAOzC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"} | ||
| {"version":3,"file":"Matches.js","names":["Vue","isServer","useStore","CatchBoundary","useRouter","useTransitionerSetup","routeIdContext","Match","renderInNonRouteComponentContext","Matches","defineComponent","name","setup","router","pendingElement","options","defaultPendingComponent","process","env","NODE_ENV","undefined","h","inner","document","ssr","MatchesInner","Suspense","fallback","default","InnerWrap","errorComponentFn","props","class","error","message","String","onClick","reset","matches","stores","routeId","computed","value","childElement","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","console","warn","toString","children","useMatchRoute","location","href","resolvedLocation","status","opts","matchRoute","pending","caseSensitive","fuzzy","includeSearch","rest","MatchRoute","from","type","required","to","Boolean","slots","params","match","Fragment","useMatches","select","useParentMatches","contextRouteId","inject","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { useTransitionerSetup } from './Transitioner'\nimport { routeIdContext } from './matchContext'\nimport { Match } from './Match'\nimport { renderInNonRouteComponentContext } from './nonRouteComponentContext'\nimport type {\n AnyRouter,\n DeepPartial,\n ErrorComponentProps,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\n// Define a type for the error component function\ntype ErrorRouteComponentType = (props: ErrorComponentProps) => Vue.VNode\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Vue.ComponentOptions['meta'] | undefined>\n links?: Array<Vue.ComponentOptions['link'] | undefined>\n scripts?: Array<Vue.ComponentOptions['script'] | undefined>\n headScripts?: Array<Vue.ComponentOptions['script'] | undefined>\n }\n}\n\nexport const Matches = Vue.defineComponent({\n name: 'Matches',\n setup() {\n const router = useRouter()\n useTransitionerSetup()\n\n return () => {\n const pendingElement = router.options.defaultPendingComponent\n ? process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n router.options.defaultPendingComponent,\n undefined,\n 'pendingComponent',\n )\n : Vue.h(router.options.defaultPendingComponent)\n : null\n\n // Do not render a root Suspense during SSR or hydrating from SSR\n const inner =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? Vue.h(MatchesInner)\n : Vue.h(\n Vue.Suspense,\n { fallback: pendingElement },\n {\n default: () => Vue.h(MatchesInner),\n },\n )\n\n return router.options.InnerWrap\n ? Vue.h(router.options.InnerWrap, null, { default: () => inner })\n : inner\n }\n },\n})\n\n// Create a simple error component function that matches ErrorRouteComponent\nconst errorComponentFn: ErrorRouteComponentType = (\n props: ErrorComponentProps,\n) => {\n return Vue.h('div', { class: 'error' }, [\n Vue.h('h1', null, 'Error'),\n Vue.h('p', null, props.error.message || String(props.error)),\n Vue.h('button', { onClick: props.reset }, 'Try Again'),\n ])\n}\n\nconst MatchesInner = Vue.defineComponent({\n name: 'MatchesInner',\n setup() {\n const router = useRouter()\n\n const matches = useStore(router.stores.matches)\n const routeId = Vue.computed(() => matches.value[0]?.routeId)\n\n return () => {\n // Generate a placeholder element if routeId.value is not present\n const childElement = routeId.value\n ? Vue.h(Match, { routeId: routeId.value })\n : Vue.h('div')\n\n // If disableGlobalCatchBoundary is true, don't wrap in CatchBoundary\n if (router.options.disableGlobalCatchBoundary) {\n return childElement\n }\n\n return Vue.h(CatchBoundary, {\n getResetKey: () => matches.value,\n errorComponent: errorComponentFn,\n onCatch:\n process.env.NODE_ENV !== 'production'\n ? (error: Error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined,\n children: childElement,\n })\n }\n },\n})\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n const location = useStore(router.stores.location, (value) => value.href)\n const resolvedLocation = useStore(\n router.stores.resolvedLocation,\n (value) => value?.href,\n )\n const status = useStore(router.stores.status)\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Vue.Ref<\n false | ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n > => {\n const matchRoute = Vue.computed(() => {\n location.value\n resolvedLocation.value\n status.value\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n\n return matchRoute\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: ResolveRoute<TRouter, TFrom, TTo>['types']['allParams'],\n ) => Vue.VNode)\n | Vue.VNode\n}\n\n// Create a type for the MatchRoute component that includes the generics\nexport interface MatchRouteComponentType {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n >(\n props: MakeMatchRouteOptions<TRouter, TFrom, TTo>,\n ): Vue.VNode\n new (): {\n $props: {\n from?: string\n to?: string\n fuzzy?: boolean\n caseSensitive?: boolean\n includeSearch?: boolean\n pending?: boolean\n }\n }\n}\n\nexport const MatchRoute = Vue.defineComponent({\n name: 'MatchRoute',\n props: {\n // Define props to match MakeMatchRouteOptions\n from: {\n type: String,\n required: false,\n },\n to: {\n type: String,\n required: false,\n },\n fuzzy: {\n type: Boolean,\n required: false,\n },\n caseSensitive: {\n type: Boolean,\n required: false,\n },\n includeSearch: {\n type: Boolean,\n required: false,\n },\n pending: {\n type: Boolean,\n required: false,\n },\n },\n setup(props, { slots }) {\n const params = useMatchRoute()(props)\n\n return () => {\n const match = params.value as boolean\n\n // Create a component that renders the slot in a reactive manner\n if (!match || !slots.default) {\n return null\n }\n\n // For function slots, pass the params\n if (typeof slots.default === 'function') {\n // Use h to create a wrapper component that will call the slot function\n return Vue.h(Vue.Fragment, null, slots.default(match))\n }\n\n // For normal slots, just render them\n return Vue.h(Vue.Fragment, null, slots.default)\n }\n },\n}) as unknown as MatchRouteComponentType\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return useStore(router.stores.matches, (matches) => {\n return opts?.select\n ? opts.select(matches as Array<MakeRouteMatchUnion<TRouter>>)\n : (matches as any)\n })\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Vue.inject(routeIdContext)\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.routeId === contextRouteId),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Vue.inject(routeIdContext)\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.routeId === contextRouteId) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;AAmCA,IAAaS,UAAUT,IAAIU,gBAAgB;CACzCC,MAAM;CACNC,QAAQ;EACN,MAAMC,SAAST,UAAU;EACzBC,qBAAqB;EAErB,aAAa;GACX,MAAMS,iBAAiBD,OAAOE,QAAQC,0BAAAA,QAAAA,IAAAA,aACT,eACvBR,iCACEK,OAAOE,QAAQC,yBACfI,KAAAA,GACA,kBACF,IACApB,IAAIqB,EAAER,OAAOE,QAAQC,uBAAuB,IAC9C;GAGJ,MAAMM,SACHrB,YAAYY,OAAOZ,aACnB,OAAOsB,aAAa,eAAeV,OAAOW,MACvCxB,IAAIqB,EAAEI,YAAY,IAClBzB,IAAIqB,EACFrB,IAAI0B,UACJ,EAAEC,UAAUb,eAAe,GAC3B,EACEc,eAAe5B,IAAIqB,EAAEI,YAAY,EACnC,CACF;GAEN,OAAOZ,OAAOE,QAAQc,YAClB7B,IAAIqB,EAAER,OAAOE,QAAQc,WAAW,MAAM,EAAED,eAAeN,MAAM,CAAC,IAC9DA;EACN;CACF;AACF,CAAC;AAGD,IAAMQ,oBACJC,UACG;CACH,OAAO/B,IAAIqB,EAAE,OAAO,EAAEW,OAAO,QAAQ,GAAG;EACtChC,IAAIqB,EAAE,MAAM,MAAM,OAAO;EACzBrB,IAAIqB,EAAE,KAAK,MAAMU,MAAME,MAAMC,WAAWC,OAAOJ,MAAME,KAAK,CAAC;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AC/C,MAAMoB,iBAAiB7E,IAAI8E,OAAOxE,cAAc;CAEhD,OAAOoE,WAAW,EAChBC,SAASrC,YAAiD;EACxDA,UAAUA,QAAQyC,MAChBzC,QAAQ0C,WAAWC,MAAMA,EAAEzC,YAAYqC,cAAc,IAAI,CAC3D;EACA,OAAOpB,MAAMkB,SAASlB,KAAKkB,OAAOrC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"} |
@@ -0,1 +1,2 @@ | ||
| import { renderInNonRouteComponentContext } from "./nonRouteComponentContext.js"; | ||
| import { DefaultGlobalNotFound } from "./not-found.js"; | ||
@@ -14,3 +15,3 @@ import * as Vue from "vue"; | ||
| if (!route.options.notFoundComponent) { | ||
| if (router.options.defaultNotFoundComponent) return Vue.h(router.options.defaultNotFoundComponent, data); | ||
| if (router.options.defaultNotFoundComponent) return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(router.options.defaultNotFoundComponent, data, "notFoundComponent") : Vue.h(router.options.defaultNotFoundComponent, data); | ||
| if (process.env.NODE_ENV !== "production") { | ||
@@ -21,3 +22,3 @@ if (!route.options.notFoundComponent) console.warn(`Warning: A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`); | ||
| } | ||
| return Vue.h(route.options.notFoundComponent, data); | ||
| return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(route.options.notFoundComponent, data, "notFoundComponent") : Vue.h(route.options.notFoundComponent, data); | ||
| } | ||
@@ -24,0 +25,0 @@ //#endregion |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"renderRouteNotFound.js","names":["Vue","DefaultGlobalNotFound","renderRouteNotFound","router","route","data","options","notFoundComponent","defaultNotFoundComponent","h","process","env","NODE_ENV","console","warn","id"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { DefaultGlobalNotFound } from './not-found'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\n/**\n * Renders a not found component for a route when no matching route is found.\n *\n * @param router - The router instance containing the route configuration\n * @param route - The route that triggered the not found state\n * @param data - Additional data to pass to the not found component\n * @returns The rendered not found component or a default fallback component\n */\nexport function renderRouteNotFound(\n router: AnyRouter,\n route: AnyRoute,\n data: any,\n): Vue.VNode {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return Vue.h(router.options.defaultNotFoundComponent, data)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n console.warn(\n `Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,\n )\n }\n }\n\n return Vue.h(DefaultGlobalNotFound)\n }\n\n return Vue.h(route.options.notFoundComponent, data)\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgBE,oBACdC,QACAC,OACAC,MACW;CACX,IAAI,CAACD,MAAME,QAAQC,mBAAmB;EACpC,IAAIJ,OAAOG,QAAQE,0BACjB,OAAOR,IAAIS,EAAEN,OAAOG,QAAQE,0BAA0BH,IAAI;EAG5D,IAAA,QAAA,IAAA,aAA6B;OACvB,CAACD,MAAME,QAAQC,mBACjBM,QAAQC,KACN,kEAAkEV,MAAMW,GAAE,mPAC5E;EAAA;EAIJ,OAAOf,IAAIS,EAAER,qBAAqB;CACpC;CAEA,OAAOD,IAAIS,EAAEL,MAAME,QAAQC,mBAAmBF,IAAI;AACpD"} | ||
| {"version":3,"file":"renderRouteNotFound.js","names":["Vue","DefaultGlobalNotFound","renderInNonRouteComponentContext","renderRouteNotFound","router","route","data","options","notFoundComponent","defaultNotFoundComponent","process","env","NODE_ENV","h","console","warn","id"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { DefaultGlobalNotFound } from './not-found'\nimport { renderInNonRouteComponentContext } from './nonRouteComponentContext'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\n/**\n * Renders a not found component for a route when no matching route is found.\n *\n * @param router - The router instance containing the route configuration\n * @param route - The route that triggered the not found state\n * @param data - Additional data to pass to the not found component\n * @returns The rendered not found component or a default fallback component\n */\nexport function renderRouteNotFound(\n router: AnyRouter,\n route: AnyRoute,\n data: any,\n): Vue.VNode {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n router.options.defaultNotFoundComponent,\n data,\n 'notFoundComponent',\n )\n : Vue.h(router.options.defaultNotFoundComponent, data)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n console.warn(\n `Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,\n )\n }\n }\n\n return Vue.h(DefaultGlobalNotFound)\n }\n\n return process.env.NODE_ENV !== 'production'\n ? renderInNonRouteComponentContext(\n route.options.notFoundComponent,\n data,\n 'notFoundComponent',\n )\n : Vue.h(route.options.notFoundComponent, data)\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgBG,oBACdC,QACAC,OACAC,MACW;CACX,IAAI,CAACD,MAAME,QAAQC,mBAAmB;EACpC,IAAIJ,OAAOG,QAAQE,0BACjB,OAAA,QAAA,IAAA,aAAgC,eAC5BP,iCACEE,OAAOG,QAAQE,0BACfH,MACA,mBACF,IACAN,IAAIa,EAAET,OAAOG,QAAQE,0BAA0BH,IAAI;EAGzD,IAAA,QAAA,IAAA,aAA6B;OACvB,CAACD,MAAME,QAAQC,mBACjBM,QAAQC,KACN,kEAAkEV,MAAMW,GAAE,mPAC5E;EAAA;EAIJ,OAAOhB,IAAIa,EAAEZ,qBAAqB;CACpC;CAEA,OAAA,QAAA,IAAA,aAAgC,eAC5BC,iCACEG,MAAME,QAAQC,mBACdF,MACA,mBACF,IACAN,IAAIa,EAAER,MAAME,QAAQC,mBAAmBF,IAAI;AACjD"} |
@@ -15,5 +15,4 @@ import * as Vue from 'vue'; | ||
| * @param ref - The ref to observe | ||
| * @param intersectionObserverOptions - The options to pass to the IntersectionObserver | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @param disabled - Whether observation is disabled | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @returns The IntersectionObserver instance | ||
@@ -27,3 +26,2 @@ * @example | ||
| * (entry) => { doSomething(entry) }, | ||
| * { rootMargin: '10px' }, | ||
| * () => false | ||
@@ -34,3 +32,3 @@ * ) | ||
| */ | ||
| export declare function useIntersectionObserver<T extends Element>(ref: Vue.Ref<T | null>, callback: (entry: IntersectionObserverEntry | undefined) => void, intersectionObserverOptions: IntersectionObserverInit | undefined, disabled: () => boolean): Vue.Ref<IntersectionObserver | null>; | ||
| export declare function useIntersectionObserver<T extends Element>(ref: Vue.Ref<T | null>, callback: (entry?: IntersectionObserverEntry) => void, disabled: () => boolean): Vue.Ref<IntersectionObserver | null>; | ||
| export declare function splitProps<T extends Record<string, any>>(props: T, keys: Array<keyof T>): Vue.ComputedRef<{ | ||
@@ -37,0 +35,0 @@ [k: string]: unknown; |
+10
-8
@@ -11,5 +11,4 @@ import * as Vue from "vue"; | ||
| * @param ref - The ref to observe | ||
| * @param intersectionObserverOptions - The options to pass to the IntersectionObserver | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @param disabled - Whether observation is disabled | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @returns The IntersectionObserver instance | ||
@@ -23,3 +22,2 @@ * @example | ||
| * (entry) => { doSomething(entry) }, | ||
| * { rootMargin: '10px' }, | ||
| * () => false | ||
@@ -30,3 +28,3 @@ * ) | ||
| */ | ||
| function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, disabled) { | ||
| function useIntersectionObserver(ref, callback, disabled) { | ||
| const isIntersectionObserverAvailable = typeof IntersectionObserver === "function"; | ||
@@ -36,6 +34,9 @@ const observerRef = Vue.ref(null); | ||
| const r = ref.value; | ||
| if (!r || !isIntersectionObserverAvailable || disabled()) return; | ||
| const observer = new IntersectionObserver(([entry]) => { | ||
| callback(entry); | ||
| }, intersectionObserverOptions); | ||
| if (disabled() || !r || !isIntersectionObserverAvailable) { | ||
| onCleanup(() => callback()); | ||
| return; | ||
| } | ||
| const observer = new IntersectionObserver((entries) => { | ||
| callback(entries.pop()); | ||
| }, { rootMargin: "100px" }); | ||
| observerRef.value = observer; | ||
@@ -46,2 +47,3 @@ observer.observe(r); | ||
| observerRef.value = null; | ||
| callback(); | ||
| }); | ||
@@ -48,0 +50,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import * as Vue from 'vue'\n\nexport const useLayoutEffect =\n typeof window !== 'undefined' ? Vue.effect : Vue.effect\n\nexport const usePrevious = (fn: () => boolean) => {\n return Vue.computed(\n (\n prev: { current: boolean | null; previous: boolean | null } = {\n current: null,\n previous: null,\n },\n ) => {\n const current = fn()\n\n if (prev.current !== current) {\n prev.previous = prev.current\n prev.current = current\n }\n\n return prev\n },\n )\n}\n\n/**\n * React hook to wrap `IntersectionObserver`.\n *\n * This hook will create an `IntersectionObserver` and observe the ref passed to it.\n *\n * When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.\n *\n * @param ref - The ref to observe\n * @param intersectionObserverOptions - The options to pass to the IntersectionObserver\n * @param disabled - Whether observation is disabled\n * @param callback - The callback to call when the intersection changes\n * @returns The IntersectionObserver instance\n * @example\n * ```tsx\n * const MyComponent = () => {\n * const ref = React.useRef<HTMLDivElement>(null)\n * useIntersectionObserver(\n * ref,\n * (entry) => { doSomething(entry) },\n * { rootMargin: '10px' },\n * () => false\n * )\n * return <div ref={ref} />\n * ```\n */\nexport function useIntersectionObserver<T extends Element>(\n ref: Vue.Ref<T | null>,\n callback: (entry: IntersectionObserverEntry | undefined) => void,\n intersectionObserverOptions: IntersectionObserverInit = {},\n disabled: () => boolean,\n): Vue.Ref<IntersectionObserver | null> {\n const isIntersectionObserverAvailable =\n typeof IntersectionObserver === 'function'\n const observerRef = Vue.ref<IntersectionObserver | null>(null)\n\n // Use watchEffect with cleanup to properly manage the observer lifecycle\n Vue.watchEffect((onCleanup) => {\n const r = ref.value\n if (!r || !isIntersectionObserverAvailable || disabled()) {\n return\n }\n\n const observer = new IntersectionObserver(([entry]) => {\n callback(entry)\n }, intersectionObserverOptions)\n\n observerRef.value = observer\n observer.observe(r)\n\n onCleanup(() => {\n observer.disconnect()\n observerRef.value = null\n })\n })\n\n return observerRef\n}\n\nexport function splitProps<T extends Record<string, any>>(\n props: T,\n keys: Array<keyof T>,\n) {\n // Get the specified props\n const selectedProps = Vue.computed(() => {\n return Object.fromEntries(keys.map((key) => [key, props[key]]))\n })\n\n // Get remaining props as attrs\n const remainingAttrs = Vue.computed(() => {\n const attrs = Vue.useAttrs()\n return Object.fromEntries(\n Object.entries(attrs).filter(([key]) => !keys.includes(key as keyof T)),\n )\n })\n\n return [selectedProps, remainingAttrs]\n}\n\nexport type ParentProps<T = {}> = T & {\n children?: Vue.VNode | Array<Vue.VNode> | string\n}\n"],"mappings":";AAGE,OAAO,WAAW,cAAc,IAAI,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CnD,SAAgB,wBACd,KACA,UACA,8BAAwD,CAAC,GACzD,UACsC;CACtC,MAAM,kCACJ,OAAO,yBAAyB;CAClC,MAAM,cAAc,IAAI,IAAiC,IAAI;CAG7D,IAAI,aAAa,cAAc;EAC7B,MAAM,IAAI,IAAI;EACd,IAAI,CAAC,KAAK,CAAC,mCAAmC,SAAS,GACrD;EAGF,MAAM,WAAW,IAAI,sBAAsB,CAAC,WAAW;GACrD,SAAS,KAAK;EAChB,GAAG,2BAA2B;EAE9B,YAAY,QAAQ;EACpB,SAAS,QAAQ,CAAC;EAElB,gBAAgB;GACd,SAAS,WAAW;GACpB,YAAY,QAAQ;EACtB,CAAC;CACH,CAAC;CAED,OAAO;AACT"} | ||
| {"version":3,"file":"utils.js","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import * as Vue from 'vue'\n\nexport const useLayoutEffect =\n typeof window !== 'undefined' ? Vue.effect : Vue.effect\n\nexport const usePrevious = (fn: () => boolean) => {\n return Vue.computed(\n (\n prev: { current: boolean | null; previous: boolean | null } = {\n current: null,\n previous: null,\n },\n ) => {\n const current = fn()\n\n if (prev.current !== current) {\n prev.previous = prev.current\n prev.current = current\n }\n\n return prev\n },\n )\n}\n\n/**\n * React hook to wrap `IntersectionObserver`.\n *\n * This hook will create an `IntersectionObserver` and observe the ref passed to it.\n *\n * When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.\n *\n * @param ref - The ref to observe\n * @param callback - The callback to call when the intersection changes\n * @param disabled - Whether observation is disabled\n * @returns The IntersectionObserver instance\n * @example\n * ```tsx\n * const MyComponent = () => {\n * const ref = React.useRef<HTMLDivElement>(null)\n * useIntersectionObserver(\n * ref,\n * (entry) => { doSomething(entry) },\n * () => false\n * )\n * return <div ref={ref} />\n * ```\n */\nexport function useIntersectionObserver<T extends Element>(\n ref: Vue.Ref<T | null>,\n callback: (entry?: IntersectionObserverEntry) => void,\n disabled: () => boolean,\n): Vue.Ref<IntersectionObserver | null> {\n const isIntersectionObserverAvailable =\n typeof IntersectionObserver === 'function'\n const observerRef = Vue.ref<IntersectionObserver | null>(null)\n\n // Use watchEffect with cleanup to properly manage the observer lifecycle\n Vue.watchEffect((onCleanup) => {\n const r = ref.value\n if (disabled() || !r || !isIntersectionObserverAvailable) {\n onCleanup(() => callback())\n return\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n callback(entries.pop())\n },\n { rootMargin: '100px' },\n )\n\n observerRef.value = observer\n observer.observe(r)\n\n onCleanup(() => {\n observer.disconnect()\n observerRef.value = null\n callback()\n })\n })\n\n return observerRef\n}\n\nexport function splitProps<T extends Record<string, any>>(\n props: T,\n keys: Array<keyof T>,\n) {\n // Get the specified props\n const selectedProps = Vue.computed(() => {\n return Object.fromEntries(keys.map((key) => [key, props[key]]))\n })\n\n // Get remaining props as attrs\n const remainingAttrs = Vue.computed(() => {\n const attrs = Vue.useAttrs()\n return Object.fromEntries(\n Object.entries(attrs).filter(([key]) => !keys.includes(key as keyof T)),\n )\n })\n\n return [selectedProps, remainingAttrs]\n}\n\nexport type ParentProps<T = {}> = T & {\n children?: Vue.VNode | Array<Vue.VNode> | string\n}\n"],"mappings":";AAGE,OAAO,WAAW,cAAc,IAAI,SAAS,IAAI;;;;;;;;;;;;;;;;;;;;;;;;AA6CnD,SAAgB,wBACd,KACA,UACA,UACsC;CACtC,MAAM,kCACJ,OAAO,yBAAyB;CAClC,MAAM,cAAc,IAAI,IAAiC,IAAI;CAG7D,IAAI,aAAa,cAAc;EAC7B,MAAM,IAAI,IAAI;EACd,IAAI,SAAS,KAAK,CAAC,KAAK,CAAC,iCAAiC;GACxD,gBAAgB,SAAS,CAAC;GAC1B;EACF;EAEA,MAAM,WAAW,IAAI,sBAClB,YAAY;GACX,SAAS,QAAQ,IAAI,CAAC;EACxB,GACA,EAAE,YAAY,QAAQ,CACxB;EAEA,YAAY,QAAQ;EACpB,SAAS,QAAQ,CAAC;EAElB,gBAAgB;GACd,SAAS,WAAW;GACpB,YAAY,QAAQ;GACpB,SAAS;EACX,CAAC;CACH,CAAC;CAED,OAAO;AACT"} |
| import * as Vue from 'vue'; | ||
| import { renderInNonRouteComponentContext } from './nonRouteComponentContext'; | ||
| const VueErrorBoundary = Vue.defineComponent({ | ||
@@ -31,8 +32,15 @@ name: 'VueErrorBoundary', | ||
| }); | ||
| return () => error.value | ||
| ? Vue.h(props.errorComponent ?? ErrorComponent, { | ||
| return () => { | ||
| if (!error.value) { | ||
| return props.children; | ||
| } | ||
| const errorComponent = props.errorComponent ?? ErrorComponent; | ||
| const errorProps = { | ||
| error: error.value, | ||
| reset, | ||
| }) | ||
| : props.children; | ||
| }; | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(errorComponent, errorProps, 'errorComponent') | ||
| : Vue.h(errorComponent, errorProps); | ||
| }; | ||
| }, | ||
@@ -39,0 +47,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"CatchBoundary.jsx","sourceRoot":"","sources":["../../src/CatchBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAU1B,MAAM,gBAAgB,GAAG,GAAG,CAAC,eAAe,CAAC;IAC3C,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE;QACL,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAClC,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,IAAI;KACrB;IACD,KAAK,CAAC,KAAK;QACT,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAe,IAAI,CAAC,CAAA;QAEzC,MAAM,KAAK,GAAG,GAAG,EAAE;YACjB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAA;QACpB,CAAC,CAAA;QAED,GAAG,CAAC,KAAK,CACP,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EACpB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;YACjB,IAAI,MAAM,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;gBACrC,KAAK,EAAE,CAAA;YACT,CAAC;QACH,CAAC,CACF,CAAA;QAED,GAAG,CAAC,eAAe,CAAC,CAAC,GAAU,EAAE,EAAE;YACjC,IACE,GAAG,YAAY,OAAO;gBACtB,CAAC,GAAG,IAAI,OAAQ,GAAW,CAAC,IAAI,KAAK,UAAU,CAAC,EAChD,CAAC;gBACD,OAAO,KAAK,CAAA;YACd,CAAC;YAED,KAAK,CAAC,KAAK,GAAG,GAA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AAG,CAAC,CAAC,CACH,KAAK,EACL;wBACE,KAAK,EAAE;4BACL,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,eAAe;4BACvB,YAAY,EAAE,QAAQ;4BACtB,OAAO,EAAE,OAAO;4BAChB,KAAK,EAAE,KAAK;4BACZ,QAAQ,EAAE,MAAM;yBACjB;qBACF,EACD;wBACE,KAAK,CAAC,KAAK,EAAE,OAAO;4BAClB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;4BACxC,CAAC,CAAC,IAAI;qBACT,CACF;iBACF,CAAC;gBACJ,CAAC,CAAC,IAAI;SACT,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAA"} |
@@ -40,3 +40,2 @@ import * as Vue from 'vue'; | ||
| isActive: boolean; | ||
| isTransitioning: boolean; | ||
| }) => Vue.VNodeChild); | ||
@@ -43,0 +42,0 @@ } |
+36
-52
@@ -10,3 +10,2 @@ import * as Vue from 'vue'; | ||
| const router = useRouter(); | ||
| const isTransitioning = Vue.ref(false); | ||
| let hasRenderFetched = false; | ||
@@ -99,3 +98,2 @@ // Ensure router is defined before proceeding | ||
| isActive, | ||
| isTransitioning: false, | ||
| resolvedActiveProps, | ||
@@ -117,3 +115,3 @@ resolvedInactiveProps, | ||
| const preload = Vue.computed(() => { | ||
| if (options.reloadDocument) { | ||
| if (options.reloadDocument || options.disabled) { | ||
| return false; | ||
@@ -131,8 +129,28 @@ } | ||
| }); | ||
| const preloadViewportIoCallback = (entry) => { | ||
| if (entry?.isIntersecting) { | ||
| const enqueuePreload = (e) => { | ||
| if (!e) { | ||
| clearTimeout(timeoutMap.get(ref)); | ||
| timeoutMap.delete(ref); | ||
| return; | ||
| } | ||
| if (!(e.isIntersecting ?? | ||
| preload.value === 'intent')) { | ||
| if (e.isIntersecting === false) { | ||
| clearTimeout(timeoutMap.get(ref)); | ||
| timeoutMap.delete(ref); | ||
| } | ||
| return; | ||
| } | ||
| if (!preloadDelay.value) { | ||
| doPreload(); | ||
| return; | ||
| } | ||
| if (!timeoutMap.has(ref)) { | ||
| timeoutMap.set(ref, setTimeout(() => { | ||
| timeoutMap.delete(ref); | ||
| doPreload(); | ||
| }, preloadDelay.value)); | ||
| } | ||
| }; | ||
| useIntersectionObserver(ref, preloadViewportIoCallback, { rootMargin: '100px' }, () => !!options.disabled || preload.value !== 'viewport'); | ||
| useIntersectionObserver(ref, enqueuePreload, () => preload.value !== 'viewport'); | ||
| Vue.effect(() => { | ||
@@ -142,3 +160,3 @@ if (hasRenderFetched) { | ||
| } | ||
| if (!options.disabled && preload.value === 'render') { | ||
| if (preload.value === 'render') { | ||
| doPreload(); | ||
@@ -163,7 +181,2 @@ hasRenderFetched = true; | ||
| e.preventDefault(); | ||
| isTransitioning.value = true; | ||
| const unsub = router.subscribe('onResolved', () => { | ||
| unsub(); | ||
| isTransitioning.value = false; | ||
| }); | ||
| // All is well? Navigate! | ||
@@ -181,30 +194,11 @@ router.navigate({ | ||
| }; | ||
| const enqueueIntentPreload = (e) => { | ||
| if (options.disabled || preload.value !== 'intent') | ||
| const handleTouchStart = () => { | ||
| if (preload.value !== 'intent') | ||
| return; | ||
| if (!preloadDelay.value) { | ||
| doPreload(); | ||
| return; | ||
| } | ||
| const eventTarget = e.currentTarget || e.target; | ||
| if (!eventTarget || timeoutMap.has(eventTarget)) | ||
| return; | ||
| timeoutMap.set(eventTarget, setTimeout(() => { | ||
| timeoutMap.delete(eventTarget); | ||
| doPreload(); | ||
| }, preloadDelay.value)); | ||
| }; | ||
| const handleTouchStart = (_) => { | ||
| if (options.disabled || preload.value !== 'intent') | ||
| return; | ||
| doPreload(); | ||
| }; | ||
| const handleLeave = (e) => { | ||
| if (options.disabled) | ||
| return; | ||
| const eventTarget = e.currentTarget || e.target; | ||
| if (eventTarget) { | ||
| const id = timeoutMap.get(eventTarget); | ||
| clearTimeout(id); | ||
| timeoutMap.delete(eventTarget); | ||
| const handleLeave = () => { | ||
| if (preload.value === 'intent') { | ||
| clearTimeout(timeoutMap.get(ref)); | ||
| timeoutMap.delete(ref); | ||
| } | ||
@@ -231,11 +225,11 @@ }; | ||
| options.onFocus, | ||
| enqueueIntentPreload, | ||
| enqueuePreload, | ||
| ]), | ||
| onMouseenter: composeEventHandlers([ | ||
| eventHandlers.onMouseenter, | ||
| enqueueIntentPreload, | ||
| enqueuePreload, | ||
| ]), | ||
| onMouseover: composeEventHandlers([ | ||
| eventHandlers.onMouseover, | ||
| enqueueIntentPreload, | ||
| enqueuePreload, | ||
| ]), | ||
@@ -265,3 +259,2 @@ onMouseleave: composeEventHandlers([ | ||
| isActive: isActive.value, | ||
| isTransitioning: isTransitioning.value, | ||
| resolvedActiveProps, | ||
@@ -314,3 +307,3 @@ resolvedInactiveProps, | ||
| } | ||
| function combineResultProps({ href, options, isActive, isTransitioning, resolvedActiveProps, resolvedInactiveProps, resolvedClassName, resolvedStyle, ref, staticEventHandlers, }) { | ||
| function combineResultProps({ href, options, isActive, resolvedActiveProps, resolvedInactiveProps, resolvedClassName, resolvedStyle, ref, staticEventHandlers, }) { | ||
| const result = { | ||
@@ -338,5 +331,2 @@ ...getPropsSafeToSpread(options), | ||
| } | ||
| if (isTransitioning) { | ||
| result['data-transitioning'] = 'transitioning'; | ||
| } | ||
| for (const key of Object.keys(resolvedActiveProps)) { | ||
@@ -461,10 +451,4 @@ if (key !== 'class' && key !== 'style') { | ||
| const isActive = linkProps['data-status'] === 'active'; | ||
| const isTransitioning = linkProps['data-transitioning'] === 'transitioning'; | ||
| // Create the slot content or empty array if no default slot | ||
| const slotContent = slots.default | ||
| ? slots.default({ | ||
| isActive, | ||
| isTransitioning, | ||
| }) | ||
| : []; | ||
| const slotContent = slots.default ? slots.default({ isActive }) : []; | ||
| // Special handling for SVG links - wrap an <a> inside the SVG | ||
@@ -471,0 +455,0 @@ if (Component === 'svg') { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"link.jsx","sourceRoot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ACF,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,QAEA,CAAA;AAEpB,SAAS,WAAW,CAAC,CAAa;IAChC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAA;AAC7D,CAAC;AAkBD,MAAM,CAAC,MAAM,WAAW,GAAuB,CAAC,OAAO,EAAE,EAAE;IACzD,OAAO,OAAc,CAAA;AACvB,CAAC,CAAA"} |
@@ -12,2 +12,3 @@ import * as Vue from 'vue'; | ||
| import { ScrollRestoration } from './scroll-restoration'; | ||
| import { nonRouteComponentContext, renderInNonRouteComponentContext, } from './nonRouteComponentContext'; | ||
| export const Match = Vue.defineComponent({ | ||
@@ -34,3 +35,5 @@ name: 'Match', | ||
| const pendingElement = PendingComponent | ||
| ? Vue.h(PendingComponent) | ||
| ? process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(PendingComponent, undefined, 'pendingComponent') | ||
| : Vue.h(PendingComponent) | ||
| : undefined; | ||
@@ -64,3 +67,5 @@ const routeErrorComponent = route?.options.errorComponent ?? router.options.defaultErrorComponent; | ||
| } | ||
| return Vue.h(routeNotFoundComponent, error); | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(routeNotFoundComponent, error, 'notFoundComponent') | ||
| : Vue.h(routeNotFoundComponent, error); | ||
| }, | ||
@@ -163,3 +168,3 @@ children: content, | ||
| if (RouteErrorComponent) { | ||
| return Vue.h(RouteErrorComponent, { | ||
| const errorProps = { | ||
| error: match.error, | ||
@@ -172,3 +177,6 @@ reset: () => { | ||
| }, | ||
| }); | ||
| }; | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(RouteErrorComponent, errorProps, 'errorComponent') | ||
| : Vue.h(RouteErrorComponent, errorProps); | ||
| } | ||
@@ -185,3 +193,5 @@ // If there's no error component for this route, throw the error | ||
| if (PendingComponent) { | ||
| return Vue.h(PendingComponent); | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(PendingComponent, undefined, 'pendingComponent') | ||
| : Vue.h(PendingComponent); | ||
| } | ||
@@ -204,2 +214,10 @@ // If no pending component, return null while loading | ||
| setup() { | ||
| if (process.env.NODE_ENV !== 'production') { | ||
| const nonRouteComponent = Vue.inject(nonRouteComponentContext, undefined); | ||
| if (nonRouteComponent) { | ||
| Vue.watch(nonRouteComponent, (component) => { | ||
| console.warn(`Warning: An <Outlet /> was rendered inside a ${component}. <Outlet /> should only be rendered inside a route component.`); | ||
| }, { immediate: true }); | ||
| } | ||
| } | ||
| const router = useRouter(); | ||
@@ -206,0 +224,0 @@ const parentRouteId = Vue.inject(routeIdContext); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Match.jsx","sourceRoot":"","sources":["../../src/Match.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAIxD,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC;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 +9,3 @@ import * as Vue from 'vue'; | ||
| import { Match } from './Match'; | ||
| import { renderInNonRouteComponentContext } from './nonRouteComponentContext'; | ||
| export const Matches = Vue.defineComponent({ | ||
@@ -17,3 +18,5 @@ name: 'Matches', | ||
| const pendingElement = router.options.defaultPendingComponent | ||
| ? Vue.h(router.options.defaultPendingComponent) | ||
| ? process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(router.options.defaultPendingComponent, undefined, 'pendingComponent') | ||
| : Vue.h(router.options.defaultPendingComponent) | ||
| : null; | ||
@@ -20,0 +23,0 @@ // Do not render a root Suspense during SSR or hydrating from SSR |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Matches.jsx","sourceRoot":"","sources":["../../src/Matches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AA2B/B,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,eAAe,CAAC;IACzC,IAAI,EAAE,SAAS;IACf,KAAK;QACH,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,oBAAoB,EAAE,CAAA;QAEtB,OAAO,GAAG,EAAE;YACV,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,uBAAuB;gBAC3D,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC;gBAC/C,CAAC,CA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E,CAAC,OAA4C,EAAE,EAAE;YACvD,OAAO,GAAG,OAAO,CAAC,KAAK,CACrB,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,cAAc,CAAC,GAAG,CAAC,CAC3D,CAAA;YACD,OAAO,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,CAAC;KACK,CAAC,CAAA;AACX,CAAC"} |
| import * as Vue from 'vue'; | ||
| import { DefaultGlobalNotFound } from './not-found'; | ||
| import { renderInNonRouteComponentContext } from './nonRouteComponentContext'; | ||
| /** | ||
@@ -14,3 +15,5 @@ * Renders a not found component for a route when no matching route is found. | ||
| if (router.options.defaultNotFoundComponent) { | ||
| return Vue.h(router.options.defaultNotFoundComponent, data); | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(router.options.defaultNotFoundComponent, data, 'notFoundComponent') | ||
| : Vue.h(router.options.defaultNotFoundComponent, data); | ||
| } | ||
@@ -24,4 +27,6 @@ if (process.env.NODE_ENV !== 'production') { | ||
| } | ||
| return Vue.h(route.options.notFoundComponent, data); | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext(route.options.notFoundComponent, data, 'notFoundComponent') | ||
| : Vue.h(route.options.notFoundComponent, data); | ||
| } | ||
| //# sourceMappingURL=renderRouteNotFound.jsx.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"renderRouteNotFound.jsx","sourceRoot":"","sources":["../../src/renderRouteNotFound.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAGnD;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,KAAe,EACf,IAAS;IAET,IAAI,CAAC,KAA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,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAA;QAC1D,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;gBACrC,OAAO,CAAC,IAAI,CACV,kEAAkE,KAAK,CAAC,EAAE,oPAAoP,CAC/T,CAAA;YACH,CAAC;QACH,CAAC;QAED,OAAO,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QAC1C,CAAC,CAAC,gCAAgC,CAC9B,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAC/B,IAAI,EACJ,mBAAmB,CACpB;QACH,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAA;AAClD,CAAC"} |
@@ -15,5 +15,4 @@ import * as Vue from 'vue'; | ||
| * @param ref - The ref to observe | ||
| * @param intersectionObserverOptions - The options to pass to the IntersectionObserver | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @param disabled - Whether observation is disabled | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @returns The IntersectionObserver instance | ||
@@ -27,3 +26,2 @@ * @example | ||
| * (entry) => { doSomething(entry) }, | ||
| * { rootMargin: '10px' }, | ||
| * () => false | ||
@@ -34,3 +32,3 @@ * ) | ||
| */ | ||
| export declare function useIntersectionObserver<T extends Element>(ref: Vue.Ref<T | null>, callback: (entry: IntersectionObserverEntry | undefined) => void, intersectionObserverOptions: IntersectionObserverInit | undefined, disabled: () => boolean): Vue.Ref<IntersectionObserver | null>; | ||
| export declare function useIntersectionObserver<T extends Element>(ref: Vue.Ref<T | null>, callback: (entry?: IntersectionObserverEntry) => void, disabled: () => boolean): Vue.Ref<IntersectionObserver | null>; | ||
| export declare function splitProps<T extends Record<string, any>>(props: T, keys: Array<keyof T>): Vue.ComputedRef<{ | ||
@@ -37,0 +35,0 @@ [k: string]: unknown; |
@@ -24,5 +24,4 @@ import * as Vue from 'vue'; | ||
| * @param ref - The ref to observe | ||
| * @param intersectionObserverOptions - The options to pass to the IntersectionObserver | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @param disabled - Whether observation is disabled | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @returns The IntersectionObserver instance | ||
@@ -36,3 +35,2 @@ * @example | ||
| * (entry) => { doSomething(entry) }, | ||
| * { rootMargin: '10px' }, | ||
| * () => false | ||
@@ -43,3 +41,3 @@ * ) | ||
| */ | ||
| export function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, disabled) { | ||
| export function useIntersectionObserver(ref, callback, disabled) { | ||
| const isIntersectionObserverAvailable = typeof IntersectionObserver === 'function'; | ||
@@ -50,8 +48,9 @@ const observerRef = Vue.ref(null); | ||
| const r = ref.value; | ||
| if (!r || !isIntersectionObserverAvailable || disabled()) { | ||
| if (disabled() || !r || !isIntersectionObserverAvailable) { | ||
| onCleanup(() => callback()); | ||
| return; | ||
| } | ||
| const observer = new IntersectionObserver(([entry]) => { | ||
| callback(entry); | ||
| }, intersectionObserverOptions); | ||
| const observer = new IntersectionObserver((entries) => { | ||
| callback(entries.pop()); | ||
| }, { rootMargin: '100px' }); | ||
| observerRef.value = observer; | ||
@@ -62,2 +61,3 @@ observer.observe(r); | ||
| observerRef.value = null; | ||
| callback(); | ||
| }); | ||
@@ -64,0 +64,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAE1B,MAAM,CAAC,MAAM,eAAe,GAC1B,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CA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AG,IAAI,CAAA;YACxB,QAAQ,EAAE,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,KAAQ,EACR,IAAoB;IAEpB,0BAA0B;IAC1B,MAAM,aAAa,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;QACtC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;IAEF,+BAA+B;IAC/B,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;QACvC,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAA;QAC5B,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAc,CAAC,CAAC,CACxE,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;AACxC,CAAC"} |
+2
-2
| { | ||
| "name": "@tanstack/vue-router", | ||
| "version": "1.170.23", | ||
| "version": "1.170.24", | ||
| "description": "Modern and scalable routing for Vue applications", | ||
@@ -67,3 +67,3 @@ "author": "Tanner Linsley", | ||
| "@tanstack/history": "1.162.1", | ||
| "@tanstack/router-core": "1.171.21" | ||
| "@tanstack/router-core": "1.171.22" | ||
| }, | ||
@@ -70,0 +70,0 @@ "devDependencies": { |
| import * as Vue from 'vue' | ||
| import { renderInNonRouteComponentContext } from './nonRouteComponentContext' | ||
| import type { ErrorRouteComponent } from './route' | ||
@@ -52,9 +53,21 @@ | ||
| return () => | ||
| error.value | ||
| ? Vue.h(props.errorComponent ?? ErrorComponent, { | ||
| error: error.value, | ||
| reset, | ||
| }) | ||
| : (props.children as Vue.VNode) | ||
| return () => { | ||
| if (!error.value) { | ||
| return props.children as Vue.VNode | ||
| } | ||
| const errorComponent = props.errorComponent ?? ErrorComponent | ||
| const errorProps = { | ||
| error: error.value, | ||
| reset, | ||
| } | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| errorComponent, | ||
| errorProps, | ||
| 'errorComponent', | ||
| ) | ||
| : Vue.h(errorComponent, errorProps) | ||
| } | ||
| }, | ||
@@ -61,0 +74,0 @@ }) |
+49
-73
@@ -32,3 +32,3 @@ import * as Vue from 'vue' | ||
| const timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>() | ||
| const timeoutMap = new WeakMap<object, ReturnType<typeof setTimeout>>() | ||
@@ -90,3 +90,2 @@ type DataAttributes = { | ||
| const router = useRouter() | ||
| const isTransitioning = Vue.ref(false) | ||
| let hasRenderFetched = false | ||
@@ -205,3 +204,2 @@ | ||
| isActive, | ||
| isTransitioning: false, | ||
| resolvedActiveProps, | ||
@@ -230,3 +228,3 @@ resolvedInactiveProps, | ||
| const preload = Vue.computed(() => { | ||
| if (options.reloadDocument) { | ||
| if (options.reloadDocument || options.disabled) { | ||
| return false | ||
@@ -258,8 +256,38 @@ } | ||
| const preloadViewportIoCallback = ( | ||
| entry: IntersectionObserverEntry | undefined, | ||
| const enqueuePreload = ( | ||
| e?: MouseEvent | FocusEvent | IntersectionObserverEntry, | ||
| ) => { | ||
| if (entry?.isIntersecting) { | ||
| if (!e) { | ||
| clearTimeout(timeoutMap.get(ref)) | ||
| timeoutMap.delete(ref) | ||
| return | ||
| } | ||
| if ( | ||
| !( | ||
| (e as IntersectionObserverEntry).isIntersecting ?? | ||
| preload.value === 'intent' | ||
| ) | ||
| ) { | ||
| if ((e as IntersectionObserverEntry).isIntersecting === false) { | ||
| clearTimeout(timeoutMap.get(ref)) | ||
| timeoutMap.delete(ref) | ||
| } | ||
| return | ||
| } | ||
| if (!preloadDelay.value) { | ||
| doPreload() | ||
| return | ||
| } | ||
| if (!timeoutMap.has(ref)) { | ||
| timeoutMap.set( | ||
| ref, | ||
| setTimeout(() => { | ||
| timeoutMap.delete(ref) | ||
| doPreload() | ||
| }, preloadDelay.value), | ||
| ) | ||
| } | ||
| } | ||
@@ -269,5 +297,4 @@ | ||
| ref, | ||
| preloadViewportIoCallback, | ||
| { rootMargin: '100px' }, | ||
| () => !!options.disabled || preload.value !== 'viewport', | ||
| enqueuePreload, | ||
| () => preload.value !== 'viewport', | ||
| ) | ||
@@ -279,3 +306,3 @@ | ||
| } | ||
| if (!options.disabled && preload.value === 'render') { | ||
| if (preload.value === 'render') { | ||
| doPreload() | ||
@@ -309,9 +336,2 @@ hasRenderFetched = true | ||
| isTransitioning.value = true | ||
| const unsub = router.subscribe('onResolved', () => { | ||
| unsub() | ||
| isTransitioning.value = false | ||
| }) | ||
| // All is well? Navigate! | ||
@@ -330,36 +350,11 @@ router.navigate({ | ||
| const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => { | ||
| if (options.disabled || preload.value !== 'intent') return | ||
| if (!preloadDelay.value) { | ||
| doPreload() | ||
| return | ||
| } | ||
| const eventTarget = e.currentTarget || e.target | ||
| if (!eventTarget || timeoutMap.has(eventTarget)) return | ||
| timeoutMap.set( | ||
| eventTarget, | ||
| setTimeout(() => { | ||
| timeoutMap.delete(eventTarget) | ||
| doPreload() | ||
| }, preloadDelay.value), | ||
| ) | ||
| } | ||
| const handleTouchStart = (_: TouchEvent) => { | ||
| if (options.disabled || preload.value !== 'intent') return | ||
| const handleTouchStart = () => { | ||
| if (preload.value !== 'intent') return | ||
| doPreload() | ||
| } | ||
| const handleLeave = (e: MouseEvent | FocusEvent) => { | ||
| if (options.disabled) return | ||
| const eventTarget = e.currentTarget || e.target | ||
| if (eventTarget) { | ||
| const id = timeoutMap.get(eventTarget) | ||
| clearTimeout(id) | ||
| timeoutMap.delete(eventTarget) | ||
| const handleLeave = () => { | ||
| if (preload.value === 'intent') { | ||
| clearTimeout(timeoutMap.get(ref)) | ||
| timeoutMap.delete(ref) | ||
| } | ||
@@ -396,11 +391,11 @@ } | ||
| options.onFocus, | ||
| enqueueIntentPreload, | ||
| enqueuePreload, | ||
| ]), | ||
| onMouseenter: composeEventHandlers<MouseEvent>([ | ||
| eventHandlers.onMouseenter, | ||
| enqueueIntentPreload, | ||
| enqueuePreload, | ||
| ]), | ||
| onMouseover: composeEventHandlers<MouseEvent>([ | ||
| eventHandlers.onMouseover, | ||
| enqueueIntentPreload, | ||
| enqueuePreload, | ||
| ]), | ||
@@ -436,3 +431,2 @@ onMouseleave: composeEventHandlers<MouseEvent>([ | ||
| isActive: isActive.value, | ||
| isTransitioning: isTransitioning.value, | ||
| resolvedActiveProps, | ||
@@ -500,3 +494,2 @@ resolvedInactiveProps, | ||
| isActive, | ||
| isTransitioning, | ||
| resolvedActiveProps, | ||
@@ -513,3 +506,2 @@ resolvedInactiveProps, | ||
| isActive: boolean | ||
| isTransitioning: boolean | ||
| resolvedActiveProps: StyledProps | ||
@@ -558,6 +550,2 @@ resolvedInactiveProps: StyledProps | ||
| if (isTransitioning) { | ||
| result['data-transitioning'] = 'transitioning' | ||
| } | ||
| for (const key of Object.keys(resolvedActiveProps)) { | ||
@@ -770,8 +758,3 @@ if (key !== 'class' && key !== 'style') { | ||
| // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns | ||
| children?: | ||
| | Vue.VNodeChild | ||
| | ((state: { | ||
| isActive: boolean | ||
| isTransitioning: boolean | ||
| }) => Vue.VNodeChild) | ||
| children?: Vue.VNodeChild | ((state: { isActive: boolean }) => Vue.VNodeChild) | ||
| } | ||
@@ -889,12 +872,5 @@ | ||
| const isActive = linkProps['data-status'] === 'active' | ||
| const isTransitioning = | ||
| linkProps['data-transitioning'] === 'transitioning' | ||
| // Create the slot content or empty array if no default slot | ||
| const slotContent = slots.default | ||
| ? slots.default({ | ||
| isActive, | ||
| isTransitioning, | ||
| }) | ||
| : [] | ||
| const slotContent = slots.default ? slots.default({ isActive }) : [] | ||
@@ -901,0 +877,0 @@ // Special handling for SVG links - wrap an <a> inside the SVG |
+49
-5
@@ -12,2 +12,6 @@ import * as Vue from 'vue' | ||
| import { ScrollRestoration } from './scroll-restoration' | ||
| import { | ||
| nonRouteComponentContext, | ||
| renderInNonRouteComponentContext, | ||
| } from './nonRouteComponentContext' | ||
| import type { VNode } from 'vue' | ||
@@ -45,3 +49,9 @@ import type { AnyRoute, RootRouteOptions } from '@tanstack/router-core' | ||
| const pendingElement = PendingComponent | ||
| ? Vue.h(PendingComponent) | ||
| ? process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| PendingComponent, | ||
| undefined, | ||
| 'pendingComponent', | ||
| ) | ||
| : Vue.h(PendingComponent) | ||
| : undefined | ||
@@ -86,3 +96,9 @@ const routeErrorComponent = | ||
| return Vue.h(routeNotFoundComponent, error) | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| routeNotFoundComponent, | ||
| error, | ||
| 'notFoundComponent', | ||
| ) | ||
| : Vue.h(routeNotFoundComponent, error) | ||
| }, | ||
@@ -203,3 +219,3 @@ children: content, | ||
| if (RouteErrorComponent) { | ||
| return Vue.h(RouteErrorComponent, { | ||
| const errorProps = { | ||
| error: match.error, | ||
@@ -212,3 +228,10 @@ reset: () => { | ||
| }, | ||
| }) | ||
| } | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| RouteErrorComponent, | ||
| errorProps, | ||
| 'errorComponent', | ||
| ) | ||
| : Vue.h(RouteErrorComponent, errorProps) | ||
| } | ||
@@ -229,3 +252,9 @@ | ||
| if (PendingComponent) { | ||
| return Vue.h(PendingComponent) | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| PendingComponent, | ||
| undefined, | ||
| 'pendingComponent', | ||
| ) | ||
| : Vue.h(PendingComponent) | ||
| } | ||
@@ -258,2 +287,17 @@ | ||
| setup() { | ||
| if (process.env.NODE_ENV !== 'production') { | ||
| const nonRouteComponent = Vue.inject(nonRouteComponentContext!, undefined) | ||
| if (nonRouteComponent) { | ||
| Vue.watch( | ||
| nonRouteComponent, | ||
| (component) => { | ||
| console.warn( | ||
| `Warning: An <Outlet /> was rendered inside a ${component}. <Outlet /> should only be rendered inside a route component.`, | ||
| ) | ||
| }, | ||
| { immediate: true }, | ||
| ) | ||
| } | ||
| } | ||
| const router = useRouter() | ||
@@ -260,0 +304,0 @@ const parentRouteId = Vue.inject(routeIdContext)! |
+8
-1
@@ -9,2 +9,3 @@ import * as Vue from 'vue' | ||
| import { Match } from './Match' | ||
| import { renderInNonRouteComponentContext } from './nonRouteComponentContext' | ||
| import type { | ||
@@ -44,3 +45,9 @@ AnyRouter, | ||
| const pendingElement = router.options.defaultPendingComponent | ||
| ? Vue.h(router.options.defaultPendingComponent) | ||
| ? process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| router.options.defaultPendingComponent, | ||
| undefined, | ||
| 'pendingComponent', | ||
| ) | ||
| : Vue.h(router.options.defaultPendingComponent) | ||
| : null | ||
@@ -47,0 +54,0 @@ |
| import * as Vue from 'vue' | ||
| import { DefaultGlobalNotFound } from './not-found' | ||
| import { renderInNonRouteComponentContext } from './nonRouteComponentContext' | ||
| import type { AnyRoute, AnyRouter } from '@tanstack/router-core' | ||
@@ -20,3 +21,9 @@ | ||
| if (router.options.defaultNotFoundComponent) { | ||
| return Vue.h(router.options.defaultNotFoundComponent, data) | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| router.options.defaultNotFoundComponent, | ||
| data, | ||
| 'notFoundComponent', | ||
| ) | ||
| : Vue.h(router.options.defaultNotFoundComponent, data) | ||
| } | ||
@@ -35,3 +42,9 @@ | ||
| return Vue.h(route.options.notFoundComponent, data) | ||
| return process.env.NODE_ENV !== 'production' | ||
| ? renderInNonRouteComponentContext( | ||
| route.options.notFoundComponent, | ||
| data, | ||
| 'notFoundComponent', | ||
| ) | ||
| : Vue.h(route.options.notFoundComponent, data) | ||
| } |
+11
-9
@@ -34,5 +34,4 @@ import * as Vue from 'vue' | ||
| * @param ref - The ref to observe | ||
| * @param intersectionObserverOptions - The options to pass to the IntersectionObserver | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @param disabled - Whether observation is disabled | ||
| * @param callback - The callback to call when the intersection changes | ||
| * @returns The IntersectionObserver instance | ||
@@ -46,3 +45,2 @@ * @example | ||
| * (entry) => { doSomething(entry) }, | ||
| * { rootMargin: '10px' }, | ||
| * () => false | ||
@@ -55,4 +53,3 @@ * ) | ||
| ref: Vue.Ref<T | null>, | ||
| callback: (entry: IntersectionObserverEntry | undefined) => void, | ||
| intersectionObserverOptions: IntersectionObserverInit = {}, | ||
| callback: (entry?: IntersectionObserverEntry) => void, | ||
| disabled: () => boolean, | ||
@@ -67,9 +64,13 @@ ): Vue.Ref<IntersectionObserver | null> { | ||
| const r = ref.value | ||
| if (!r || !isIntersectionObserverAvailable || disabled()) { | ||
| if (disabled() || !r || !isIntersectionObserverAvailable) { | ||
| onCleanup(() => callback()) | ||
| return | ||
| } | ||
| const observer = new IntersectionObserver(([entry]) => { | ||
| callback(entry) | ||
| }, intersectionObserverOptions) | ||
| const observer = new IntersectionObserver( | ||
| (entries) => { | ||
| callback(entries.pop()) | ||
| }, | ||
| { rootMargin: '100px' }, | ||
| ) | ||
@@ -82,2 +83,3 @@ observerRef.value = observer | ||
| observerRef.value = null | ||
| callback() | ||
| }) | ||
@@ -84,0 +86,0 @@ }) |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
915234
1.62%372
1.92%13998
1.21%74
80.49%+ Added
- Removed