Sign In

@tanstack/solid-router

Package Overview
Dependencies
Maintainers
3
Versions
478
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/solid-router - npm Package Compare versions

Comparing version
1.170.24
to
1.170.25
+19
dist/cjs/nonRouteComponentContext.cjs
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
let solid_js_web = require("solid-js/web");
let solid_js = require("solid-js");
solid_js = require_runtime.__toESM(solid_js, 1);
//#region src/nonRouteComponentContext.tsx
var nonRouteComponentContext = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ solid_js.createContext() : void 0;
function renderInNonRouteComponentContext(render, component) {
return (0, solid_js_web.createComponent)(nonRouteComponentContext.Provider, {
value: component,
get children() {
return render();
}
});
}
//#endregion
exports.nonRouteComponentContext = nonRouteComponentContext;
exports.renderInNonRouteComponentContext = renderInNonRouteComponentContext;
//# sourceMappingURL=nonRouteComponentContext.cjs.map
{"version":3,"file":"nonRouteComponentContext.cjs","names":["Solid","NonRouteComponent","nonRouteComponentContext","process","env","NODE_ENV","createContext","undefined","renderInNonRouteComponentContext","render","JSX","Element","component","Context","_$createComponent","Provider","value","children"],"sources":["../../src/nonRouteComponentContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nexport type NonRouteComponent =\n | 'pendingComponent'\n | 'errorComponent'\n | 'notFoundComponent'\n\nexport const nonRouteComponentContext =\n process.env.NODE_ENV !== 'production'\n ? /* @__PURE__ */ Solid.createContext<NonRouteComponent>()\n : undefined\n\nexport function renderInNonRouteComponentContext(\n render: () => Solid.JSX.Element,\n component: NonRouteComponent,\n) {\n const Context = nonRouteComponentContext!\n return <Context.Provider value={component}>{render()}</Context.Provider>\n}\n"],"mappings":";;;;;AAOA,IAAaE,2BAAAA,QAAAA,IAAAA,aACc,eACLF,yBAAMM,cAAiC,IACvDC,KAAAA;AAEN,SAAgBC,iCACdC,QACAG,WACA;CAEA,QAAA,GAAA,aAAA,iBAAQC,yBAAQE,UAAQ;EAACC,OAAOJ;EAAS,IAAAK,WAAA;GAAA,OAAGR,OAAO;EAAC;CAAA,CAAA;AACtD"}
import * as Solid from 'solid-js';
export type NonRouteComponent = 'pendingComponent' | 'errorComponent' | 'notFoundComponent';
export declare const nonRouteComponentContext: Solid.Context<NonRouteComponent | undefined> | undefined;
export declare function renderInNonRouteComponentContext(render: () => Solid.JSX.Element, component: NonRouteComponent): Solid.JSX.Element;
import * as Solid from 'solid-js';
export type NonRouteComponent = 'pendingComponent' | 'errorComponent' | 'notFoundComponent';
export declare const nonRouteComponentContext: Solid.Context<NonRouteComponent | undefined> | undefined;
export declare function renderInNonRouteComponentContext(render: () => Solid.JSX.Element, component: NonRouteComponent): Solid.JSX.Element;
import { createComponent } from "solid-js/web";
import * as Solid from "solid-js";
//#region src/nonRouteComponentContext.tsx
var nonRouteComponentContext = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Solid.createContext() : void 0;
function renderInNonRouteComponentContext(render, component) {
return createComponent(nonRouteComponentContext.Provider, {
value: component,
get children() {
return render();
}
});
}
//#endregion
export { nonRouteComponentContext, renderInNonRouteComponentContext };
//# sourceMappingURL=nonRouteComponentContext.js.map
{"version":3,"file":"nonRouteComponentContext.js","names":["Solid","NonRouteComponent","nonRouteComponentContext","process","env","NODE_ENV","createContext","undefined","renderInNonRouteComponentContext","render","JSX","Element","component","Context","_$createComponent","Provider","value","children"],"sources":["../../src/nonRouteComponentContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nexport type NonRouteComponent =\n | 'pendingComponent'\n | 'errorComponent'\n | 'notFoundComponent'\n\nexport const nonRouteComponentContext =\n process.env.NODE_ENV !== 'production'\n ? /* @__PURE__ */ Solid.createContext<NonRouteComponent>()\n : undefined\n\nexport function renderInNonRouteComponentContext(\n render: () => Solid.JSX.Element,\n component: NonRouteComponent,\n) {\n const Context = nonRouteComponentContext!\n return <Context.Provider value={component}>{render()}</Context.Provider>\n}\n"],"mappings":";;;AAOA,IAAaE,2BAAAA,QAAAA,IAAAA,aACc,eACLF,sBAAMM,cAAiC,IACvDC,KAAAA;AAEN,SAAgBC,iCACdC,QACAG,WACA;CAEA,OAAAE,gBAAQD,yBAAQE,UAAQ;EAACC,OAAOJ;EAAS,IAAAK,WAAA;GAAA,OAAGR,OAAO;EAAC;CAAA,CAAA;AACtD"}
import * as Solid from 'solid-js';
export type NonRouteComponent = 'pendingComponent' | 'errorComponent' | 'notFoundComponent';
export declare const nonRouteComponentContext: Solid.Context<NonRouteComponent | undefined> | undefined;
export declare function renderInNonRouteComponentContext(render: () => Solid.JSX.Element, component: NonRouteComponent): Solid.JSX.Element;
import * as Solid from 'solid-js';
export const nonRouteComponentContext = process.env.NODE_ENV !== 'production'
? /* @__PURE__ */ Solid.createContext()
: undefined;
export function renderInNonRouteComponentContext(render, component) {
const Context = nonRouteComponentContext;
return <Context.Provider value={component}>{render()}</Context.Provider>;
}
//# sourceMappingURL=nonRouteComponentContext.jsx.map
{"version":3,"file":"nonRouteComponentContext.jsx","sourceRoot":"","sources":["../../src/nonRouteComponentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAOjC,MAAM,CAAC,MAAM,wBAAwB,GACnC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;IACnC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,aAAa,EAAqB;IAC1D,CAAC,CAAC,SAAS,CAAA;AAEf,MAAM,UAAU,gCAAgC,CAC9C,MAA+B,EAC/B,SAA4B;IAE5B,MAAM,OAAO,GAAG,wBAAyB,CAAA;IACzC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;AAC1E,CAAC"}
import * as Solid from 'solid-js'
export type NonRouteComponent =
| 'pendingComponent'
| 'errorComponent'
| 'notFoundComponent'
export const nonRouteComponentContext =
process.env.NODE_ENV !== 'production'
? /* @__PURE__ */ Solid.createContext<NonRouteComponent>()
: undefined
export function renderInNonRouteComponentContext(
render: () => Solid.JSX.Element,
component: NonRouteComponent,
) {
const Context = nonRouteComponentContext!
return <Context.Provider value={component}>{render()}</Context.Provider>
}
+8
-1
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_nonRouteComponentContext = require("./nonRouteComponentContext.cjs");
let solid_js_web = require("solid-js/web");

@@ -12,3 +13,3 @@ let solid_js = require("solid-js");

solid_js.createEffect(solid_js.on(props.getResetKey, () => reset(), { defer: true }));
return (0, solid_js_web.createComponent)(solid_js_web.Dynamic, {
return process.env.NODE_ENV !== "production" ? require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(solid_js_web.Dynamic, {
get component() {

@@ -19,2 +20,8 @@ return props.errorComponent ?? ErrorComponent;

reset
}), "errorComponent") : (0, solid_js_web.createComponent)(solid_js_web.Dynamic, {
get component() {
return props.errorComponent ?? ErrorComponent;
},
error,
reset
});

@@ -21,0 +28,0 @@ },

+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"CatchBoundary.cjs","names":["Solid","Dynamic","ErrorRouteComponent","CatchBoundary","props","getResetKey","children","JSX","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","ErrorBoundary","fallback","reset","createEffect","on","defer","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","$$click","d","_$insert","_c$","_$memo","_el$6","_tmpl$2","_el$7","_c$2","message","_el$8","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport type { ErrorRouteComponent } from './route'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => unknown\n children: Solid.JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.ErrorBoundary\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(\n Solid.on(props.getResetKey, () => reset(), { defer: true }),\n )\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.ErrorBoundary>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n <strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;AAIA,SAAgBG,cACdC,OAMA;CACA,QAAA,GAAA,aAAA,iBACGJ,SAAMe,eAAa;EAClBC,WAAWL,OAAOM,UAAU;GAC1Bb,MAAMM,UAAUC,KAAK;GAErBX,SAAMkB,aACJlB,SAAMmB,GAAGf,MAAMC,mBAAmBY,MAAM,GAAG,EAAEG,OAAO,KAAK,CAAC,CAC5D;GAEA,QAAA,GAAA,aAAA,iBACGnB,aAAAA,SAAO;IAAA,IACNoB,YAAS;KAAA,OAAEjB,MAAMK,kBAAkBa;IAAc;IAC1CX;IACAM;GAAK,CAAA;EAGlB;EAAC,IAAAX,WAAA;GAAA,OAEAF,MAAME;EAAQ;CAAA,CAAA;AAGrB;AAEA,SAAgBgB,eAAe,EAAEX,SAAyB;CACxD,MAAM,CAACY,MAAMC,WAAWxB,SAAMyB,aAAAA,QAAAA,IAAAA,aACH,YAC3B;CAEA,cAAA;EAAA,IAAAI,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAE,QAAAH,MAAAC,WAAAG;EAAAJ,MAAAI;EAAAD,MAAAG,gBAauBb,SAASc,MAAM,CAACA,CAAC;EAACC,CAAAA,GAAAA,aAAAA,QAAAL,aAEhCX,KAAK,IAAI,eAAe,YAAY;EAAAgB,CAAAA,GAAAA,aAAAA,QAAAV,aAAA;GAAA,IAAAW,OAAAA,GAAAA,aAAAA,YAAA,CAAA,CAIxCjB,KAAK,CAAC;GAAA,aAANiB,IAAA,WAAA;IAAA,IAAAE,QAAAC,QAAA,GAAAC,QAAAF,MAAAV;IAAAO,CAAAA,GAAAA,aAAAA,QAAAK,cAAA;KAAA,IAAAC,QAAAA,GAAAA,aAAAA,YAAA,CAAA,CAYMlC,MAAMmC,OAAO;KAAA,aAAbD,KAAA,WAAA;MAAA,IAAAE,QAAAC,QAAA;MAAAT,CAAAA,GAAAA,aAAAA,QAAAQ,aAAuBpC,MAAMmC,OAAO;MAAA,OAAAC;KAAA,GAAA,IAAW;IAAI,GAAA,CAAA;IAAA,OAAAL;GAAA,GAAA,IAGtD;EAAI,GAAA,GAAA,IAAA;EAAA,OAAAb;CAAA,GAAA;AAGd;iCAAC,CAAA,OAAA,CAAA"}
{"version":3,"file":"CatchBoundary.cjs","names":["Solid","Dynamic","renderInNonRouteComponentContext","ErrorRouteComponent","CatchBoundary","props","getResetKey","children","JSX","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","ErrorBoundary","fallback","reset","createEffect","on","defer","process","env","NODE_ENV","component","ErrorComponent","show","setShow","createSignal","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","$$click","d","_$insert","_c$","_$memo","_el$6","_tmpl$2","_el$7","_c$2","message","_el$8","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { renderInNonRouteComponentContext } from './nonRouteComponentContext'\nimport type { ErrorRouteComponent } from './route'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => unknown\n children: Solid.JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.ErrorBoundary\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(\n Solid.on(props.getResetKey, () => reset(), { defer: true }),\n )\n\n return process.env.NODE_ENV !== 'production' ? (\n renderInNonRouteComponentContext(\n () => (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n ),\n 'errorComponent',\n )\n ) : (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.ErrorBoundary>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n <strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>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C,QAAAA,GAAAA,aAAAA,YAAA,CAAA,CAYMlC,MAAMmC,OAAO;KAAA,aAAbD,KAAA,WAAA;MAAA,IAAAE,QAAAC,QAAA;MAAAT,CAAAA,GAAAA,aAAAA,QAAAQ,aAAuBpC,MAAMmC,OAAO;MAAA,OAAAC;KAAA,GAAA,IAAW;IAAI,GAAA,CAAA;IAAA,OAAAL;GAAA,GAAA,IAGtD;EAAI,GAAA,GAAA,IAAA;EAAA,OAAAb;CAAA,GAAA;AAGd;iCAAC,CAAA,OAAA,CAAA"}

@@ -14,5 +14,8 @@ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");

var timeoutMap = /* @__PURE__ */ new WeakMap();
var cancelPreload = (eventTarget) => {
clearTimeout(timeoutMap.get(eventTarget));
timeoutMap.delete(eventTarget);
};
function useLinkProps(options) {
const router = require_useRouter.useRouter();
const [isTransitioning, setIsTransitioning] = solid_js.createSignal(false);
const shouldHydrateHash = !_tanstack_router_core_isServer.isServer && !!router.options.ssr;

@@ -104,3 +107,3 @@ const hasHydrated = require_ClientOnly.useHydrated();

const preload = solid_js.createMemo(() => {
if (options.reloadDocument || externalLink()) return false;
if (options.reloadDocument || externalLink() || local.disabled) return false;
return local.preload ?? router.options.defaultPreload;

@@ -137,10 +140,25 @@ });

});
const preloadViewportIoCallback = (entry) => {
if (entry?.isIntersecting) doPreload();
const [ref, setRef] = solid_js.createSignal(null);
const enqueuePreload = (e) => {
if (!e) {
cancelPreload(ref);
return;
}
if (!(e.isIntersecting ?? preload() === "intent")) {
if (e.isIntersecting === false) cancelPreload(ref);
return;
}
if (!preloadDelay()) {
doPreload();
return;
}
if (!timeoutMap.has(ref)) timeoutMap.set(ref, setTimeout(() => {
timeoutMap.delete(ref);
doPreload();
}, preloadDelay()));
};
const [ref, setRef] = solid_js.createSignal(null);
require_utils.useIntersectionObserver(ref, preloadViewportIoCallback, { rootMargin: "100px" }, !!local.disabled || preload() !== "viewport");
require_utils.useIntersectionObserver(ref, enqueuePreload, () => preload() !== "viewport");
solid_js.createEffect(() => {
if (hasRenderFetched) return;
if (!local.disabled && preload() === "render") {
if (preload() === "render") {
doPreload();

@@ -172,7 +190,2 @@ hasRenderFetched = true;

e.preventDefault();
setIsTransitioning(true);
const unsub = router.subscribe("onResolved", () => {
unsub();
setIsTransitioning(false);
});
router.navigate({

@@ -189,27 +202,8 @@ ...options,

};
const enqueueIntentPreload = (e) => {
if (local.disabled || preload() !== "intent") return;
if (!preloadDelay()) {
doPreload();
return;
}
const eventTarget = e.currentTarget || e.target;
if (!eventTarget || timeoutMap.has(eventTarget)) return;
timeoutMap.set(eventTarget, setTimeout(() => {
timeoutMap.delete(eventTarget);
doPreload();
}, preloadDelay()));
};
const handleTouchStart = (_) => {
if (local.disabled || preload() !== "intent") return;
const handleTouchStart = () => {
if (preload() !== "intent") return;
doPreload();
};
const handleLeave = (e) => {
if (local.disabled) return;
const eventTarget = e.currentTarget || e.target;
if (eventTarget) {
const id = timeoutMap.get(eventTarget);
clearTimeout(id);
timeoutMap.delete(eventTarget);
}
const handleLeave = () => {
if (preload() === "intent") cancelPreload(ref);
};

@@ -219,5 +213,5 @@ const simpleStyling = solid_js.createMemo(() => local.activeProps === STATIC_ACTIVE_PROPS_GET && local.inactiveProps === STATIC_INACTIVE_PROPS_GET && local.class === void 0 && local.style === void 0);

const onBlur = createComposedHandler(() => local.onBlur, handleLeave);
const onFocus = createComposedHandler(() => local.onFocus, enqueueIntentPreload);
const onMouseEnter = createComposedHandler(() => local.onMouseEnter, enqueueIntentPreload);
const onMouseOver = createComposedHandler(() => local.onMouseOver, enqueueIntentPreload);
const onFocus = createComposedHandler(() => local.onFocus, enqueuePreload);
const onMouseEnter = createComposedHandler(() => local.onMouseEnter, enqueuePreload);
const onMouseOver = createComposedHandler(() => local.onMouseOver, enqueuePreload);
const onMouseLeave = createComposedHandler(() => local.onMouseLeave, handleLeave);

@@ -241,4 +235,3 @@ const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave);

target: local.target,
...local.disabled && STATIC_DISABLED_PROPS,
...isTransitioning() && STATIC_TRANSITIONING_ATTRIBUTES
...local.disabled && STATIC_DISABLED_PROPS
};

@@ -289,3 +282,2 @@ if (simpleStyling()) return {

};
var STATIC_TRANSITIONING_ATTRIBUTES = { "data-transitioning": "transitioning" };
/** Call a JSX.EventHandlerUnion with the event. */

@@ -311,10 +303,5 @@ function callHandler(event, handler) {

const ch = local.children;
if (typeof ch === "function") return ch({
get isActive() {
return linkProps["data-status"] === "active";
},
get isTransitioning() {
return linkProps["data-transitioning"] === "transitioning";
}
});
if (typeof ch === "function") return ch({ get isActive() {
return linkProps["data-status"] === "active";
} });
return ch;

@@ -321,0 +308,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"link.cjs","names":["Solid","mergeRefs","deepEqual","exactPathTest","functionalUpdate","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","Dynamic","useRouter","useIntersectionObserver","useHydrated","AnyRouter","Constrain","LinkOptions","RegisteredRouter","RoutePaths","ValidateLinkOptions","ValidateLinkOptionsArray","timeoutMap","WeakMap","EventTarget","ReturnType","setTimeout","useLinkProps","TRouter","TFrom","options","UseLinkPropsOptions","TTo","TMaskFrom","TMaskTo","ComponentProps","router","isTransitioning","setIsTransitioning","createSignal","shouldHydrateHash","ssr","hasHydrated","hasRenderFetched","local","rest","splitProps","mergeProps","activeProps","STATIC_ACTIVE_PROPS_GET","inactiveProps","STATIC_INACTIVE_PROPS_GET","_","propsSafeToSpread","currentLocation","createMemo","stores","location","get","undefined","equals","prev","next","href","_fromLocation","nextOptions","untrack","buildLocation","hrefOption","disabled","maskedLocation","publicHref","external","history","createHref","externalLink","_href","protocolAllowlist","process","env","NODE_ENV","console","warn","to","safeInternal","isSafeInternal","indexOf","URL","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","isActive","activeOptions","current","nextLocation","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","length","includeSearch","searchTest","search","partial","ignoreUndefined","explicitUndefined","includeHash","currentHash","hash","doPreload","preloadRoute","_builtLocation","catch","err","preloadViewportIoCallback","entry","IntersectionObserverEntry","isIntersecting","ref","setRef","Element","rootMargin","createEffect","handleClick","e","MouseEvent","elementTarget","currentTarget","HTMLAnchorElement","SVGAElement","getAttribute","effectiveTarget","target","isCtrlEvent","defaultPrevented","button","preventDefault","unsub","subscribe","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","enqueueIntentPreload","FocusEvent","eventTarget","has","set","delete","handleTouchStart","TouchEvent","handleLeave","id","clearTimeout","simpleStyling","class","style","onClick","createComposedHandler","onBlur","onFocus","onMouseEnter","onMouseOver","onMouseLeave","onMouseOut","onTouchStart","ResolvedLinkStateProps","Omit","JSX","CSSProperties","resolvedProps","active","base","STATIC_DISABLED_PROPS","STATIC_TRANSITIONING_ATTRIBUTES","STATIC_DEFAULT_ACTIVE_ATTRIBUTES","EMPTY_OBJECT","className","filter","Boolean","join","STATIC_ACTIVE_ATTRIBUTES","STATIC_ACTIVE_PROPS","role","callHandler","Event","event","TEvent","T","handler","EventHandlerUnion","getHandler","fallback","ActiveLinkOptions","ActiveLinkOptionProps","TComp","ActiveLinkProps","Partial","LinkComponentSolidProps","key","LinkProps","LinkPropsChildren","children","state","ValidComponent","CreateLinkProps","LinkComponentProps","LinkComponent","TDefaultFrom","props","LinkComponentRoute","defaultFrom","createLink","Comp","_$createComponent","Link","_$mergeProps","_asChild","linkProps","ch","svgLinkProps","_el$","_tmpl$","_el$2","firstChild","_$spread","_$insert","_el$3","_tmpl$2","component","metaKey","altKey","ctrlKey","shiftKey","zero","charCodeAt","LinkOptionsFnOptions","TOptions","ReadonlyArray","LinkOptionsFn","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { mergeRefs } from '@solid-primitives/refs'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\n\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\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): Solid.ComponentProps<'a'> {\n const router = useRouter()\n const [isTransitioning, setIsTransitioning] = Solid.createSignal(false)\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n const [local, rest] = Solid.splitProps(\n Solid.mergeProps(\n {\n activeProps: STATIC_ACTIVE_PROPS_GET,\n inactiveProps: STATIC_INACTIVE_PROPS_GET,\n },\n options,\n ),\n [\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n ],\n )\n\n // const {\n // // custom props\n // activeProps = () => ({ class: 'active' }),\n // inactiveProps = () => ({}),\n // activeOptions,\n // to,\n // preload: userPreload,\n // preloadDelay: userPreloadDelay,\n // hashScrollIntoView,\n // replace,\n // startTransition,\n // resetScroll,\n // viewTransition,\n // // element props\n // children,\n // target,\n // disabled,\n // style,\n // class,\n // onClick,\n // onFocus,\n // onMouseEnter,\n // onMouseLeave,\n // onTouchStart,\n // ignoreBlocker,\n // ...rest\n // } = options\n\n const [_, propsSafeToSpread] = Solid.splitProps(rest, [\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n ])\n\n const currentLocation = Solid.createMemo(\n () => router.stores.location.get(),\n undefined,\n { equals: (prev, next) => prev.href === next.href },\n )\n\n const next = Solid.createMemo(() => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const nextOptions = { _fromLocation, ...options } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(nextOptions))\n })\n\n const hrefOption = Solid.createMemo(() => {\n if (options.disabled) return undefined\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 location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n })\n\n const externalLink = Solid.createMemo(() => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = options.to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n })\n\n const preload = Solid.createMemo(() => {\n if (options.reloadDocument || externalLink()) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n })\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(() => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(current.pathname, router.basepath)\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\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(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n })\n\n const doPreload = () =>\n router\n .preloadRoute({ ...options, _builtLocation: next() } 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 const [ref, setRef] = Solid.createSignal<Element | null>(null)\n\n useIntersectionObserver(\n ref,\n preloadViewportIoCallback,\n { rootMargin: '100px' },\n !!local.disabled || preload() !== 'viewport',\n )\n\n Solid.createEffect(() => {\n if (hasRenderFetched) {\n return\n }\n if (!local.disabled && preload() === 'render') {\n doPreload()\n hasRenderFetched = true\n }\n })\n\n if (externalLink()) {\n return Solid.mergeProps(\n propsSafeToSpread,\n {\n ref: mergeRefs(setRef, options.ref),\n href: externalLink(),\n },\n Solid.splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\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 local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n setIsTransitioning(true)\n\n const unsub = router.subscribe('onResolved', () => {\n unsub()\n setIsTransitioning(false)\n })\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ...options,\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {\n if (local.disabled || preload() !== 'intent') return\n\n if (!preloadDelay()) {\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()),\n )\n }\n\n const handleTouchStart = (_: TouchEvent) => {\n if (local.disabled || preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = (e: MouseEvent | FocusEvent) => {\n if (local.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 const simpleStyling = Solid.createMemo(\n () =>\n local.activeProps === STATIC_ACTIVE_PROPS_GET &&\n local.inactiveProps === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(\n () => local.onFocus,\n enqueueIntentPreload,\n )\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueueIntentPreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueueIntentPreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<Solid.ComponentProps<'a'>, 'style'> & {\n style?: Solid.JSX.CSSProperties\n }\n\n const resolvedProps = Solid.createMemo(() => {\n const active = isActive()\n\n const base = {\n href: hrefOption()?.href,\n ref: mergeRefs(setRef, options.ref),\n onClick,\n onBlur,\n onFocus,\n onMouseEnter,\n onMouseOver,\n onMouseLeave,\n onMouseOut,\n onTouchStart,\n disabled: !!local.disabled,\n target: local.target,\n ...(local.disabled && STATIC_DISABLED_PROPS),\n ...(isTransitioning() && STATIC_TRANSITIONING_ATTRIBUTES),\n }\n\n if (simpleStyling()) {\n return {\n ...base,\n ...(active && STATIC_DEFAULT_ACTIVE_ATTRIBUTES),\n }\n }\n\n const activeProps: ResolvedLinkStateProps = active\n ? (functionalUpdate(local.activeProps as any, {}) ?? EMPTY_OBJECT)\n : EMPTY_OBJECT\n const inactiveProps: ResolvedLinkStateProps = active\n ? EMPTY_OBJECT\n : functionalUpdate(local.inactiveProps, {})\n const style = {\n ...local.style,\n ...activeProps.style,\n ...inactiveProps.style,\n }\n const className = [local.class, activeProps.class, inactiveProps.class]\n .filter(Boolean)\n .join(' ')\n\n return {\n ...activeProps,\n ...inactiveProps,\n ...base,\n ...(hasKeys(style) ? { style } : undefined),\n ...(className ? { class: className } : undefined),\n ...(active && STATIC_ACTIVE_ATTRIBUTES),\n } as ResolvedLinkStateProps\n })\n\n return Solid.mergeProps(propsSafeToSpread, resolvedProps) as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\nconst STATIC_DEFAULT_ACTIVE_ATTRIBUTES = {\n class: 'active',\n 'data-status': 'active',\n 'aria-current': 'page',\n}\nconst STATIC_DISABLED_PROPS = {\n role: 'link',\n 'aria-disabled': true,\n}\nconst STATIC_ACTIVE_ATTRIBUTES = {\n 'data-status': 'active',\n 'aria-current': 'page',\n}\nconst STATIC_TRANSITIONING_ATTRIBUTES = {\n 'data-transitioning': 'transitioning',\n}\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: Solid.JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => Solid.JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\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 Omit<Solid.ComponentProps<'a'>, 'style'> & { style?: Solid.JSX.CSSProperties }\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 LinkComponentSolidProps<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 | Solid.JSX.Element\n | ((state: {\n isActive: boolean\n isTransitioning: boolean\n }) => Solid.JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends Solid.ValidComponent\n ? Omit<Solid.ComponentProps<TComp>, keyof CreateLinkProps>\n : never\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> = LinkComponentSolidProps<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) => Solid.JSX.Element\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 ): Solid.JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => Solid.JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = Solid.splitProps(\n props as typeof props & { _asChild: any },\n ['_asChild', 'children'],\n )\n\n const [_, linkProps] = Solid.splitProps(\n useLinkProps(rest as unknown as any),\n ['type'],\n )\n\n const children = Solid.createMemo(() => {\n const ch = local.children\n if (typeof ch === 'function') {\n return ch({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n get isTransitioning() {\n return (linkProps as any)['data-transitioning'] === 'transitioning'\n },\n })\n }\n\n return ch satisfies Solid.JSX.Element\n })\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = Solid.splitProps(linkProps, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as Solid.ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\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":";;;;;;;;;;;;AAiCA,IAAMqB,6BAAa,IAAIC,QAAoD;AAE3E,SAAgBI,aAOdG,SAC2B;CAC3B,MAAMM,SAASxB,kBAAAA,UAAU;CACzB,MAAM,CAACyB,iBAAiBC,sBAAsBrC,SAAMsC,aAAa,KAAK;CACtE,MAAMC,oBAAoB,CAAC9B,+BAAAA,YAAY,CAAC,CAAC0B,OAAON,QAAQW;CACxD,MAAMC,cAAc5B,mBAAAA,YAAY;CAEhC,IAAI6B,mBAAmB;CAEvB,MAAM,CAACC,OAAOC,QAAQ5C,SAAM6C,WAC1B7C,SAAM8C,WACJ;EACEC,aAAaC;EACbC,eAAeC;CACjB,GACArB,OACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;E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AW,CAAC,MAAM;CAC7C,OAAOD,SAAS;AAClB;AAkBA,IAAaM,eAAmC3N,YAAY;CAC1D,OAAOA;AACT"}
{"version":3,"file":"link.cjs","names":["Solid","mergeRefs","deepEqual","exactPathTest","functionalUpdate","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","Dynamic","useRouter","useIntersectionObserver","useHydrated","AnyRouter","Constrain","LinkOptions","RegisteredRouter","RoutePaths","ValidateLinkOptions","ValidateLinkOptionsArray","timeoutMap","WeakMap","ReturnType","setTimeout","cancelPreload","eventTarget","clearTimeout","get","delete","useLinkProps","TRouter","TFrom","options","UseLinkPropsOptions","TTo","TMaskFrom","TMaskTo","ComponentProps","router","shouldHydrateHash","ssr","hasHydrated","hasRenderFetched","local","rest","splitProps","mergeProps","activeProps","STATIC_ACTIVE_PROPS_GET","inactiveProps","STATIC_INACTIVE_PROPS_GET","_","propsSafeToSpread","currentLocation","createMemo","stores","location","undefined","equals","prev","next","href","_fromLocation","nextOptions","untrack","buildLocation","hrefOption","disabled","maskedLocation","publicHref","external","history","createHref","externalLink","_href","protocolAllowlist","process","env","NODE_ENV","console","warn","to","safeInternal","isSafeInternal","indexOf","URL","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","isActive","activeOptions","current","nextLocation","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","length","includeSearch","searchTest","search","partial","ignoreUndefined","explicitUndefined","includeHash","currentHash","hash","doPreload","preloadRoute","_builtLocation","catch","err","ref","setRef","createSignal","Element","enqueuePreload","e","MouseEvent","FocusEvent","IntersectionObserverEntry","isIntersecting","has","set","createEffect","handleClick","elementTarget","currentTarget","HTMLAnchorElement","SVGAElement","getAttribute","effectiveTarget","target","isCtrlEvent","defaultPrevented","button","preventDefault","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","handleTouchStart","handleLeave","simpleStyling","class","style","onClick","createComposedHandler","onBlur","onFocus","onMouseEnter","onMouseOver","onMouseLeave","onMouseOut","onTouchStart","ResolvedLinkStateProps","Omit","JSX","CSSProperties","resolvedProps","active","base","STATIC_DISABLED_PROPS","STATIC_DEFAULT_ACTIVE_ATTRIBUTES","EMPTY_OBJECT","className","filter","Boolean","join","STATIC_ACTIVE_ATTRIBUTES","STATIC_ACTIVE_PROPS","role","callHandler","Event","event","TEvent","T","handler","EventHandlerUnion","getHandler","fallback","ActiveLinkOptions","ActiveLinkOptionProps","TComp","ActiveLinkProps","Partial","LinkComponentSolidProps","key","LinkProps","LinkPropsChildren","children","state","ValidComponent","CreateLinkProps","LinkComponentProps","LinkComponent","TDefaultFrom","props","LinkComponentRoute","defaultFrom","createLink","Comp","_$createComponent","Link","_$mergeProps","_asChild","linkProps","ch","svgLinkProps","_el$","_tmpl$","_el$2","firstChild","_$spread","_$insert","_el$3","_tmpl$2","component","metaKey","altKey","ctrlKey","shiftKey","zero","charCodeAt","LinkOptionsFnOptions","TOptions","ReadonlyArray","LinkOptionsFn","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { mergeRefs } from '@solid-primitives/refs'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\n\nconst timeoutMap = new WeakMap<object, ReturnType<typeof setTimeout>>()\nconst cancelPreload = (eventTarget: object) => {\n clearTimeout(timeoutMap.get(eventTarget))\n timeoutMap.delete(eventTarget)\n}\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): Solid.ComponentProps<'a'> {\n const router = useRouter()\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n const [local, rest] = Solid.splitProps(\n Solid.mergeProps(\n {\n activeProps: STATIC_ACTIVE_PROPS_GET,\n inactiveProps: STATIC_INACTIVE_PROPS_GET,\n },\n options,\n ),\n [\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n ],\n )\n\n // const {\n // // custom props\n // activeProps = () => ({ class: 'active' }),\n // inactiveProps = () => ({}),\n // activeOptions,\n // to,\n // preload: userPreload,\n // preloadDelay: userPreloadDelay,\n // hashScrollIntoView,\n // replace,\n // startTransition,\n // resetScroll,\n // viewTransition,\n // // element props\n // children,\n // target,\n // disabled,\n // style,\n // class,\n // onClick,\n // onFocus,\n // onMouseEnter,\n // onMouseLeave,\n // onTouchStart,\n // ignoreBlocker,\n // ...rest\n // } = options\n\n const [_, propsSafeToSpread] = Solid.splitProps(rest, [\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n ])\n\n const currentLocation = Solid.createMemo(\n () => router.stores.location.get(),\n undefined,\n { equals: (prev, next) => prev.href === next.href },\n )\n\n const next = Solid.createMemo(() => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const nextOptions = { _fromLocation, ...options } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(nextOptions))\n })\n\n const hrefOption = Solid.createMemo(() => {\n if (options.disabled) return undefined\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 location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n })\n\n const externalLink = Solid.createMemo(() => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = options.to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n })\n\n const preload = Solid.createMemo(() => {\n if (options.reloadDocument || externalLink() || local.disabled) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n })\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(() => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(current.pathname, router.basepath)\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\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(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n })\n\n const doPreload = () =>\n router\n .preloadRoute({ ...options, _builtLocation: next() } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const [ref, setRef] = Solid.createSignal<Element | null>(null)\n\n const enqueuePreload = (\n e?: MouseEvent | FocusEvent | IntersectionObserverEntry,\n ) => {\n if (!e) {\n cancelPreload(ref)\n return\n }\n\n if (\n !(\n (e as IntersectionObserverEntry).isIntersecting ??\n preload() === 'intent'\n )\n ) {\n if ((e as IntersectionObserverEntry).isIntersecting === false) {\n cancelPreload(ref)\n }\n return\n }\n\n if (!preloadDelay()) {\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()),\n )\n }\n }\n\n useIntersectionObserver(ref, enqueuePreload, () => preload() !== 'viewport')\n\n Solid.createEffect(() => {\n if (hasRenderFetched) {\n return\n }\n if (preload() === 'render') {\n doPreload()\n hasRenderFetched = true\n }\n })\n\n if (externalLink()) {\n return Solid.mergeProps(\n propsSafeToSpread,\n {\n ref: mergeRefs(setRef, options.ref),\n href: externalLink(),\n },\n Solid.splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\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 local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ...options,\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const handleTouchStart = () => {\n if (preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = () => {\n if (preload() === 'intent') {\n cancelPreload(ref)\n }\n }\n\n const simpleStyling = Solid.createMemo(\n () =>\n local.activeProps === STATIC_ACTIVE_PROPS_GET &&\n local.inactiveProps === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(() => local.onFocus, enqueuePreload)\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueuePreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueuePreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<Solid.ComponentProps<'a'>, 'style'> & {\n style?: Solid.JSX.CSSProperties\n }\n\n const resolvedProps = Solid.createMemo(() => {\n const active = isActive()\n\n const base = {\n href: hrefOption()?.href,\n ref: mergeRefs(setRef, options.ref),\n onClick,\n onBlur,\n onFocus,\n onMouseEnter,\n onMouseOver,\n onMouseLeave,\n onMouseOut,\n onTouchStart,\n disabled: !!local.disabled,\n target: local.target,\n ...(local.disabled && STATIC_DISABLED_PROPS),\n }\n\n if (simpleStyling()) {\n return {\n ...base,\n ...(active && STATIC_DEFAULT_ACTIVE_ATTRIBUTES),\n }\n }\n\n const activeProps: ResolvedLinkStateProps = active\n ? (functionalUpdate(local.activeProps as any, {}) ?? EMPTY_OBJECT)\n : EMPTY_OBJECT\n const inactiveProps: ResolvedLinkStateProps = active\n ? EMPTY_OBJECT\n : functionalUpdate(local.inactiveProps, {})\n const style = {\n ...local.style,\n ...activeProps.style,\n ...inactiveProps.style,\n }\n const className = [local.class, activeProps.class, inactiveProps.class]\n .filter(Boolean)\n .join(' ')\n\n return {\n ...activeProps,\n ...inactiveProps,\n ...base,\n ...(hasKeys(style) ? { style } : undefined),\n ...(className ? { class: className } : undefined),\n ...(active && STATIC_ACTIVE_ATTRIBUTES),\n } as ResolvedLinkStateProps\n })\n\n return Solid.mergeProps(propsSafeToSpread, resolvedProps) as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\nconst STATIC_DEFAULT_ACTIVE_ATTRIBUTES = {\n class: 'active',\n 'data-status': 'active',\n 'aria-current': 'page',\n}\nconst STATIC_DISABLED_PROPS = {\n role: 'link',\n 'aria-disabled': true,\n}\nconst STATIC_ACTIVE_ATTRIBUTES = {\n 'data-status': 'active',\n 'aria-current': 'page',\n}\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: Solid.JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => Solid.JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\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 Omit<Solid.ComponentProps<'a'>, 'style'> & { style?: Solid.JSX.CSSProperties }\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 LinkComponentSolidProps<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 | Solid.JSX.Element\n | ((state: { isActive: boolean }) => Solid.JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends Solid.ValidComponent\n ? Omit<Solid.ComponentProps<TComp>, keyof CreateLinkProps>\n : never\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> = LinkComponentSolidProps<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) => Solid.JSX.Element\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 ): Solid.JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => Solid.JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = Solid.splitProps(\n props as typeof props & { _asChild: any },\n ['_asChild', 'children'],\n )\n\n const [_, linkProps] = Solid.splitProps(\n useLinkProps(rest as unknown as any),\n ['type'],\n )\n\n const children = Solid.createMemo(() => {\n const ch = local.children\n if (typeof ch === 'function') {\n return ch({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n })\n }\n\n return ch satisfies Solid.JSX.Element\n })\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = Solid.splitProps(linkProps, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as Solid.ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\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":";;;;;;;;;;;;AAiCA,IAAMqB,6BAAa,IAAIC,QAA+C;AACtE,IAAMG,iBAAiBC,gBAAwB;CAC7CC,aAAaN,WAA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AAOD,SAAS;AAClB;AAkBA,IAAaM,eAAmC7M,YAAY;CAC1D,OAAOA;AACT"}

@@ -28,3 +28,2 @@ import { AnyRouter, Constrain, LinkOptions, RegisteredRouter, RoutePaths } from '@tanstack/router-core';

isActive: boolean;
isTransitioning: boolean;
}) => Solid.JSX.Element);

@@ -31,0 +30,0 @@ }

const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_nonRouteComponentContext = require("./nonRouteComponentContext.cjs");
const require_CatchBoundary = require("./CatchBoundary.cjs");

@@ -37,2 +38,5 @@ const require_ClientOnly = require("./ClientOnly.cjs");

get fallback() {
if (process.env.NODE_ENV !== "production") return require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {
return resolvePendingComponent();
} }), "pendingComponent");
return (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {

@@ -52,4 +56,8 @@ return resolvePendingComponent();

get fallback() {
return (0, solid_js_web.memo)(() => !!shouldSkipSuspenseFallback())() ? void 0 : (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {
if (shouldSkipSuspenseFallback()) return;
if (process.env.NODE_ENV !== "production") return require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {
return resolvePendingComponent();
} }), "pendingComponent");
return (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {
return resolvePendingComponent();
} });

@@ -84,4 +92,6 @@ },

if (notFoundError.routeId !== currentMatch().routeId) throw notFoundError;
return (0, solid_js_web.createComponent)(solid_js_web.Dynamic, (0, solid_js_web.mergeProps)({ get component() {
return process.env.NODE_ENV !== "production" ? require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(solid_js_web.Dynamic, (0, solid_js_web.mergeProps)({ get component() {
return routeNotFoundComponent();
} }, notFoundError)), "notFoundComponent") : (0, solid_js_web.createComponent)(solid_js_web.Dynamic, (0, solid_js_web.mergeProps)({ get component() {
return routeNotFoundComponent();
} }, notFoundError));

@@ -98,2 +108,5 @@ },

get fallback() {
if (process.env.NODE_ENV !== "production") return require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {
return resolvePendingComponent();
} }), "pendingComponent");
return (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {

@@ -169,8 +182,16 @@ return resolvePendingComponent();

children: (_) => {
if (_tanstack_router_core_isServer.isServer ?? router.isServer) return (0, solid_js_web.createComponent)((route.options.errorComponent ?? router.options.defaultErrorComponent) || require_CatchBoundary.ErrorComponent, {
get error() {
return currentMatch().error;
},
info: { componentStack: "" }
});
if (_tanstack_router_core_isServer.isServer ?? router.isServer) {
const RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || require_CatchBoundary.ErrorComponent;
return process.env.NODE_ENV !== "production" ? require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(RouteErrorComponent, {
get error() {
return currentMatch().error;
},
info: { componentStack: "" }
}), "errorComponent") : (0, solid_js_web.createComponent)(RouteErrorComponent, {
get error() {
return currentMatch().error;
},
info: { componentStack: "" }
});
}
throw currentMatch().error;

@@ -191,2 +212,6 @@ }

var Outlet = () => {
if (process.env.NODE_ENV !== "production") {
const nonRouteComponent = solid_js.useContext(require_nonRouteComponentContext.nonRouteComponentContext);
if (nonRouteComponent) console.warn(`Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`);
}
const router = require_useRouter.useRouter();

@@ -223,2 +248,5 @@ const nearestParentMatch = solid_js.useContext(require_matchContext.nearestMatchContext);

get fallback() {
if (process.env.NODE_ENV !== "production") return require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {
return router.options.defaultPendingComponent;
} }), "pendingComponent");
return (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {

@@ -225,0 +253,0 @@ return router.options.defaultPendingComponent;

@@ -1,1 +0,1 @@

{"version":3,"file":"Match.cjs","names":["Solid","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","ClientOnly","AnyRoute","AnyRouter","RootRouteOptions","renderScrollRestoration","undefined","router","route","parentRoute","id","options","scrollRestoration","_$createComponent","Match","props","routeId","currentMatch","createMemo","stores","byRoute","get","nearestMatch","const","routesById","routeOptions","resolvePendingComponent","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ssr","shouldSkipSuspenseFallback","ShellComponent","shellComponent","MatchContent","Show","when","status","fallback","children","MatchInner","Provider","value","Suspense","_$memo","getResetKey","onCatch","error","Error","notFoundError","process","env","NODE_ENV","console","warn","defaultOnCatch","_$mergeProps","Switch","useContext","match","componentKey","current","remount","remountDeps","defaultRemountDeps","deps","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","childRouteId","_notFound","ids","indexOf","_routeKey"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport type {\n AnyRoute,\n AnyRouter,\n RootRouteOptions,\n} from '@tanstack/router-core'\n\n// Keep the client constant undefined so the server-only script can be dropped.\nconst renderScrollRestoration =\n isServer === false\n ? undefined\n : (router: AnyRouter, route: AnyRoute) =>\n (isServer ?? router.isServer) &&\n route.parentRoute?.id === rootRouteId &&\n router.options.scrollRestoration ? (\n <ScrollRestoration />\n ) : null\n\nexport const Match = (props: { routeId: string }) => {\n const router = useRouter()\n\n const currentMatch = Solid.createMemo(\n () => router.stores.byRoute.get(props.routeId)!.get()!,\n )\n\n const nearestMatch = [() => props.routeId, currentMatch] as const\n\n const route: AnyRoute = router.routesById[props.routeId]\n\n // Lazy route option mutations become observable with the next client match\n // publication. Server stores are non-reactive and options load before render.\n const routeOptions =\n (isServer ?? router.isServer)\n ? () => route.options\n : () => {\n currentMatch()\n return route.options\n }\n\n const resolvePendingComponent = () =>\n routeOptions().pendingComponent ?? router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n routeOptions().errorComponent ?? router.options.defaultErrorComponent\n\n const routeNotFoundComponent = () =>\n route.isRoot\n ? // If it's the root route, use the _notFound option, with fallback to the notFoundRoute's component\n (routeOptions().notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : routeOptions().notFoundComponent\n\n const resolvedNoSsr = () =>\n currentMatch().ssr === false || currentMatch().ssr === 'data-only'\n\n const shouldSkipSuspenseFallback = () =>\n (isServer ?? router.isServer)\n ? resolvedNoSsr()\n : currentMatch().ssr === 'data-only'\n\n const ShellComponent = route.isRoot\n ? ((route.options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n\n const MatchContent = () => (\n <Solid.Show\n when={currentMatch().status !== 'pending'}\n fallback={<Dynamic component={resolvePendingComponent()} />}\n >\n <MatchInner />\n </Solid.Show>\n )\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Solid.Suspense\n fallback={\n // Data-only SSR renders the inner fallback on the server, so\n // avoid adding an extra suspense fallback on the client.\n shouldSkipSuspenseFallback() ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={routeErrorComponent() ? CatchBoundary : SafeFragment}\n getResetKey={currentMatch}\n errorComponent={routeErrorComponent() as any}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatch().routeId\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatch().routeId}`,\n )\n }\n ;(route.options.onCatch ?? router.options.defaultOnCatch)?.(error)\n }}\n >\n <Dynamic\n component={\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n }\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatch().routeId\n\n if (notFoundError.routeId !== currentMatch().routeId) {\n throw notFoundError\n }\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr()}>\n <ClientOnly\n fallback={<Dynamic component={resolvePendingComponent()} />}\n >\n <MatchContent />\n </ClientOnly>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr()}>\n <MatchContent />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Solid.Suspense>\n </nearestMatchContext.Provider>\n\n {renderScrollRestoration?.(router, route)}\n </ShellComponent>\n )\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const nearestMatch = Solid.useContext(nearestMatchContext)\n const match = nearestMatch[1 /* match */]\n const routeId = nearestMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n const currentMatch = () => match()!\n\n const componentKey = () => {\n const current = currentMatch()\n const remount =\n route.options.remountDeps ?? router.options.defaultRemountDeps\n const deps = remount?.({\n routeId: routeId()!,\n loaderDeps: current.loaderDeps,\n params: current._strictParams,\n search: current._strictSearch,\n })\n return deps ? JSON.stringify(deps) : current.id\n }\n\n const out = () => {\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => renderRouteNotFound(router, route, currentMatch().error)}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route.options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch[1 /* match */]\n const routeId = nearestParentMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n\n const childRouteId = () => {\n if (parentMatch()!._notFound) {\n return\n }\n const ids = router.stores.ids.get()\n return ids[ids.indexOf(routeId()!) + 1]\n }\n\n return (\n <Solid.Show\n when={childRouteId()}\n keyed\n fallback={\n parentMatch()!._notFound\n ? renderRouteNotFound(router, route, parentMatch()!.error)\n : undefined\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match routeId={childRouteId()!} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match routeId={childRouteId()!} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,IAAMiB,0BACJf,+BAAAA,aAAa,QACTgB,KAAAA,KACCC,QAAmBC,WACjBlB,+BAAAA,YAAYiB,OAAOjB,aACpBkB,MAAMC,aAAaC,OAAO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AAE8E,aAAa;KAAE,EAAA,CAAA;IAAA;IAAA,IAAA/C,WAAA;KAAA,QAAA,GAAA,aAAA,iBAExC3D,SAAM+D,UAAQ;MAAA,IACbL,WAAQ;OAAA,QAAA,GAAA,aAAA,iBACLvD,aAAAA,SAAO,EAAA,IAAC6C,YAAS;QAAA,OAAE7B,OAAOI,QAAQiB;OAAuB,EAAA,CAAA;MAAA;MAAA,IAAAmB,WAAA;OAAA,QAAA,GAAA,aAAA,iBAG3DjC,OAAK,EAAA,IAACE,UAAO;QAAA,OAAE8E,aAAa;OAAE,EAAA,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA;EAIvC;CAAC,CAAA;AAGP"}
{"version":3,"file":"Match.cjs","names":["Solid","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","ClientOnly","nonRouteComponentContext","renderInNonRouteComponentContext","AnyRoute","AnyRouter","RootRouteOptions","renderScrollRestoration","undefined","router","route","parentRoute","id","options","scrollRestoration","_$createComponent","Match","props","routeId","currentMatch","createMemo","stores","byRoute","get","nearestMatch","const","routesById","routeOptions","resolvePendingComponent","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ssr","shouldSkipSuspenseFallback","ShellComponent","shellComponent","MatchContent","Show","when","status","fallback","process","env","NODE_ENV","children","MatchInner","Provider","value","Suspense","getResetKey","onCatch","error","Error","notFoundError","console","warn","defaultOnCatch","_$mergeProps","Switch","_$memo","useContext","match","componentKey","current","remount","remountDeps","defaultRemountDeps","deps","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","RouteErrorComponent","info","componentStack","nonRouteComponent","nearestParentMatch","parentMatch","childRouteId","_notFound","ids","indexOf","_routeKey"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport {\n nonRouteComponentContext,\n renderInNonRouteComponentContext,\n} from './nonRouteComponentContext'\nimport type {\n AnyRoute,\n AnyRouter,\n RootRouteOptions,\n} from '@tanstack/router-core'\n\n// Keep the client constant undefined so the server-only script can be dropped.\nconst renderScrollRestoration =\n isServer === false\n ? undefined\n : (router: AnyRouter, route: AnyRoute) =>\n (isServer ?? router.isServer) &&\n route.parentRoute?.id === rootRouteId &&\n router.options.scrollRestoration ? (\n <ScrollRestoration />\n ) : null\n\nexport const Match = (props: { routeId: string }) => {\n const router = useRouter()\n\n const currentMatch = Solid.createMemo(\n () => router.stores.byRoute.get(props.routeId)!.get()!,\n )\n\n const nearestMatch = [() => props.routeId, currentMatch] as const\n\n const route: AnyRoute = router.routesById[props.routeId]\n\n // Lazy route option mutations become observable with the next client match\n // publication. Server stores are non-reactive and options load before render.\n const routeOptions =\n (isServer ?? router.isServer)\n ? () => route.options\n : () => {\n currentMatch()\n return route.options\n }\n\n const resolvePendingComponent = () =>\n routeOptions().pendingComponent ?? router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n routeOptions().errorComponent ?? router.options.defaultErrorComponent\n\n const routeNotFoundComponent = () =>\n route.isRoot\n ? // If it's the root route, use the _notFound option, with fallback to the notFoundRoute's component\n (routeOptions().notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : routeOptions().notFoundComponent\n\n const resolvedNoSsr = () =>\n currentMatch().ssr === false || currentMatch().ssr === 'data-only'\n\n const shouldSkipSuspenseFallback = () =>\n (isServer ?? router.isServer)\n ? resolvedNoSsr()\n : currentMatch().ssr === 'data-only'\n\n const ShellComponent = route.isRoot\n ? ((route.options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n\n const MatchContent = () => (\n <Solid.Show\n when={currentMatch().status !== 'pending'}\n fallback={(() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => <Dynamic component={resolvePendingComponent()} />,\n 'pendingComponent',\n )\n }\n return <Dynamic component={resolvePendingComponent()} />\n })()}\n >\n <MatchInner />\n </Solid.Show>\n )\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Solid.Suspense\n fallback={(() => {\n // Data-only SSR renders the inner fallback on the server, so\n // avoid adding an extra suspense fallback on the client.\n if (shouldSkipSuspenseFallback()) {\n return undefined\n }\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => <Dynamic component={resolvePendingComponent()} />,\n 'pendingComponent',\n )\n }\n return <Dynamic component={resolvePendingComponent()} />\n })()}\n >\n <Dynamic\n component={routeErrorComponent() ? CatchBoundary : SafeFragment}\n getResetKey={currentMatch}\n errorComponent={routeErrorComponent() as any}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatch().routeId\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatch().routeId}`,\n )\n }\n ;(route.options.onCatch ?? router.options.defaultOnCatch)?.(error)\n }}\n >\n <Dynamic\n component={\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n }\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatch().routeId\n\n if (notFoundError.routeId !== currentMatch().routeId) {\n throw notFoundError\n }\n\n return process.env.NODE_ENV !== 'production' ? (\n renderInNonRouteComponentContext(\n () => (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n ),\n 'notFoundComponent',\n )\n ) : (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr()}>\n <ClientOnly\n fallback={(() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => (\n <Dynamic component={resolvePendingComponent()} />\n ),\n 'pendingComponent',\n )\n }\n return <Dynamic component={resolvePendingComponent()} />\n })()}\n >\n <MatchContent />\n </ClientOnly>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr()}>\n <MatchContent />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Solid.Suspense>\n </nearestMatchContext.Provider>\n\n {renderScrollRestoration?.(router, route)}\n </ShellComponent>\n )\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const nearestMatch = Solid.useContext(nearestMatchContext)\n const match = nearestMatch[1 /* match */]\n const routeId = nearestMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n const currentMatch = () => match()!\n\n const componentKey = () => {\n const current = currentMatch()\n const remount =\n route.options.remountDeps ?? router.options.defaultRemountDeps\n const deps = remount?.({\n routeId: routeId()!,\n loaderDeps: current.loaderDeps,\n params: current._strictParams,\n search: current._strictSearch,\n })\n return deps ? JSON.stringify(deps) : current.id\n }\n\n const out = () => {\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => renderRouteNotFound(router, route, currentMatch().error)}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route.options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return process.env.NODE_ENV !== 'production' ? (\n renderInNonRouteComponentContext(\n () => (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n ),\n 'errorComponent',\n )\n ) : (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n}\n\nexport const Outlet = () => {\n if (process.env.NODE_ENV !== 'production') {\n const nonRouteComponent = Solid.useContext(nonRouteComponentContext!)\n if (nonRouteComponent) {\n console.warn(\n `Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`,\n )\n }\n }\n\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch[1 /* match */]\n const routeId = nearestParentMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n\n const childRouteId = () => {\n if (parentMatch()!._notFound) {\n return\n }\n const ids = router.stores.ids.get()\n return ids[ids.indexOf(routeId()!) + 1]\n }\n\n return (\n <Solid.Show\n when={childRouteId()}\n keyed\n fallback={\n parentMatch()!._notFound\n ? renderRouteNotFound(router, route, parentMatch()!.error)\n : undefined\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match routeId={childRouteId()!} />}\n >\n <Solid.Suspense\n fallback={(() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => (\n <Dynamic\n component={router.options.defaultPendingComponent}\n />\n ),\n 'pendingComponent',\n )\n }\n return (\n <Dynamic component={router.options.defaultPendingComponent} />\n )\n })()}\n >\n <Match routeId={childRouteId()!} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;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AA7C,WAAA;KAAA,QAAA,GAAA,aAAA,iBAExChE,SAAMoE,UAAQ;MAAA,IACbR,WAAiB;OACf,IAAA,QAAA,IAAA,aAA6B,cAC3B,OAAO7C,iCAAAA,wCAAAA,GAAAA,aAAAA,iBAEFZ,aAAAA,SAAO,EAAA,IACN+C,YAAS;QAAA,OAAE7B,OAAOI,QAAQiB;OAAuB,EAAA,CAAA,GAGrD,kBACF;OAEF,QAAA,GAAA,aAAA,iBACGvC,aAAAA,SAAO,EAAA,IAAC+C,YAAS;QAAA,OAAE7B,OAAOI,QAAQiB;OAAuB,EAAA,CAAA;MAE9D;MAAC,IAAAsB,WAAA;OAAA,QAAA,GAAA,aAAA,iBAEApC,OAAK,EAAA,IAACE,UAAO;QAAA,OAAE+E,aAAa;OAAE,EAAA,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA;EAIvC;CAAC,CAAA;AAGP"}
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_nonRouteComponentContext = require("./nonRouteComponentContext.cjs");
const require_CatchBoundary = require("./CatchBoundary.cjs");

@@ -22,3 +23,6 @@ const require_useRouter = require("./useRouter.cjs");

get fallback() {
return PendingComponent ? (0, solid_js_web.createComponent)(PendingComponent, {}) : null;
return PendingComponent ? (() => {
if (process.env.NODE_ENV !== "production") return require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(PendingComponent, {}), "pendingComponent");
return (0, solid_js_web.createComponent)(PendingComponent, {});
})() : null;
},

@@ -25,0 +29,0 @@ get children() {

@@ -1,1 +0,1 @@

{"version":3,"file":"Matches.cjs","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Rendered","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","MatchesInner","routeId","stores","ids","get","match","byRoute","undefined","nearestMatch","const","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","location","resolvedLocation","status","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","res","useParentMatches","contextRouteId","useContext","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Rendered, Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n <Rendered />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const routeId = () => router.stores.ids.get()[0]\n const match = () =>\n routeId() ? router.stores.byRoute.get(routeId()!)?.get() : undefined\n const nearestMatch = [routeId, match] as const\n\n const matchComponent = () => {\n return (\n <Solid.Show when={routeId()}>\n <Match routeId={routeId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={match}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.location.get()\n router.stores.resolvedLocation.get()\n router.stores.status.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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":";;;;;;;;;;;;;AAkCA,SAAgBiC,UAAU;CACxB,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A,UAAmB;CAClC,OAAON,SAAMuF,YAAYwB,SAAgC;EACvD,MAAMJ,UAAUzE,OAAOkB,OAAOuD,QAAQrD,IAAI;EAG1C,MAAM0D,MAAM3B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;EAClD,IAAII,SAAStD,KAAAA,GAAW,OAAOuD;EAC/B,QAAA,GAAA,sBAAA,kBAAwBD,MAAMC,GAAG;CACnC,CAAC;AACH;AAEA,SAAgBC,iBAId5B,MACsD;CACtD,MAAM6B,iBAAiBlH,SAAMmH,WAAW1G,qBAAAA,mBAAmB,EAAE;CAE7D,OAAOqG,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChB,GACAT,QAAQU,WAAWC,MAAMA,EAAEnE,YAAY+D,eAAe,CAAC,CACzD;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV;AAEA,SAAgBY,gBAIdlC,MACsD;CACtD,MAAM6B,iBAAiBlH,SAAMmH,WAAW1G,qBAAAA,mBAAmB,EAAE;CAE7D,OAAOqG,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChBT,QAAQU,WAAWC,MAAMA,EAAEnE,YAAY+D,eAAe,CAAC,IAAI,CAC7D;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"}
{"version":3,"file":"Matches.cjs","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Rendered","Transitioner","nearestMatchContext","SafeFragment","Match","renderInNonRouteComponentContext","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","process","env","NODE_ENV","MatchesInner","routeId","stores","ids","get","match","byRoute","undefined","nearestMatch","const","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","location","resolvedLocation","status","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","res","useParentMatches","contextRouteId","useContext","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Rendered, Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport { renderInNonRouteComponentContext } from './nonRouteComponentContext'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={\n PendingComponent\n ? (() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => <PendingComponent />,\n 'pendingComponent',\n )\n }\n return <PendingComponent />\n })()\n : null\n }\n >\n <Transitioner />\n <MatchesInner />\n <Rendered />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const routeId = () => router.stores.ids.get()[0]\n const match = () =>\n routeId() ? router.stores.byRoute.get(routeId()!)?.get() : undefined\n const nearestMatch = [routeId, match] as const\n\n const matchComponent = () => {\n return (\n <Solid.Show when={routeId()}>\n <Match routeId={routeId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={match}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.location.get()\n router.stores.resolvedLocation.get()\n router.stores.status.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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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,MAAMgB,gBAAgBL,OAAO;EAC7B,MAAMM,QAAQH,MAAMrD;EAEpB,IAAI,OAAOwD,UAAU,YACnB,OAAQA,MAAcD,aAAa;EAGrC,OAAOA,gBAAgBC,QAAQ;CACjC,CAEUF,CAAa;AACzB;AAWA,SAAgBQ,WAIdzB,MACsD;CACtD,MAAMnD,SAAS7B,kBAAAA,UAAmB;CAClC,OAAON,SAAMwF,YAAYwB,SAAgC;EACvD,MAAMJ,UAAUzE,OAAOqB,OAAOoD,QAAQlD,IAAI;EAG1C,MAAMuD,MAAM3B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;EAClD,IAAII,SAASnD,KAAAA,GAAW,OAAOoD;EAC/B,QAAA,GAAA,sBAAA,kBAAwBD,MAAMC,GAAG;CACnC,CAAC;AACH;AAEA,SAAgBC,iBAId5B,MACsD;CACtD,MAAM6B,iBAAiBnH,SAAMoH,WAAW3G,qBAAAA,mBAAmB,EAAE;CAE7D,OAAOsG,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChB,GACAT,QAAQU,WAAWC,MAAMA,EAAEhE,YAAY4D,eAAe,CAAC,CACzD;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV;AAEA,SAAgBY,gBAIdlC,MACsD;CACtD,MAAM6B,iBAAiBnH,SAAMoH,WAAW3G,qBAAAA,mBAAmB,EAAE;CAE7D,OAAOsG,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChBT,QAAQU,WAAWC,MAAMA,EAAEhE,YAAY4D,eAAe,CAAC,IAAI,CAC7D;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"}

@@ -0,1 +1,2 @@

const require_nonRouteComponentContext = require("./nonRouteComponentContext.cjs");
const require_not_found = require("./not-found.cjs");

@@ -13,7 +14,16 @@ let solid_js_web = require("solid-js/web");

function renderRouteNotFound(router, route, data) {
if (process.env.NODE_ENV !== "production") {
if (!route.options.notFoundComponent) {
if (router.options.defaultNotFoundComponent) {
const DefaultNotFoundComponent = router.options.defaultNotFoundComponent;
return require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(DefaultNotFoundComponent, data), "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 (0, solid_js_web.createComponent)(require_not_found.DefaultGlobalNotFound, {});
}
const NotFoundComponent = route.options.notFoundComponent;
return require_nonRouteComponentContext.renderInNonRouteComponentContext(() => (0, solid_js_web.createComponent)(NotFoundComponent, data), "notFoundComponent");
}
if (!route.options.notFoundComponent) {
if (router.options.defaultNotFoundComponent) return (0, solid_js_web.createComponent)(router.options.defaultNotFoundComponent, data);
if (process.env.NODE_ENV !== "production") {
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 (0, solid_js_web.createComponent)(require_not_found.DefaultGlobalNotFound, {});

@@ -20,0 +30,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouteNotFound.cjs","names":["DefaultGlobalNotFound","AnyRoute","AnyRouter","renderRouteNotFound","router","route","data","options","notFoundComponent","defaultNotFoundComponent","_$createComponent","process","env","NODE_ENV","console","warn","id"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { 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) {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <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 <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgBG,oBACdC,QACAC,OACAC,MACA;CACA,IAAI,CAACD,MAAME,QAAQC,mBAAmB;EACpC,IAAIJ,OAAOG,QAAQE,0BACjB,QAAA,GAAA,aAAA,iBAAQL,OAAOG,QAAQE,0BAA6BH,IAAI;EAG1D,IAAA,QAAA,IAAA,aAA6B;OACvB,CAACD,MAAME,QAAQC,mBACjBM,QAAQC,KACN,kEAAkEV,MAAMW,GAAE,mPAC5E;EAAA;EAIJ,QAAA,GAAA,aAAA,iBAAQhB,kBAAAA,uBAAqB,CAAA,CAAA;CAC/B;CAEA,QAAA,GAAA,aAAA,iBAAQK,MAAME,QAAQC,mBAAsBF,IAAI;AAClD"}
{"version":3,"file":"renderRouteNotFound.cjs","names":["DefaultGlobalNotFound","renderInNonRouteComponentContext","AnyRoute","AnyRouter","renderRouteNotFound","router","route","data","process","env","NODE_ENV","options","notFoundComponent","defaultNotFoundComponent","DefaultNotFoundComponent","_$createComponent","console","warn","id","NotFoundComponent"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { 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) {\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n const DefaultNotFoundComponent = router.options.defaultNotFoundComponent\n return renderInNonRouteComponentContext(\n () => <DefaultNotFoundComponent {...data} />,\n 'notFoundComponent',\n )\n }\n\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 return <DefaultGlobalNotFound />\n }\n\n const NotFoundComponent = route.options.notFoundComponent\n return renderInNonRouteComponentContext(\n () => <NotFoundComponent {...data} />,\n 'notFoundComponent',\n )\n }\n\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <router.options.defaultNotFoundComponent {...data} />\n }\n\n return <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgBI,oBACdC,QACAC,OACAC,MACA;CACA,IAAA,QAAA,IAAA,aAA6B,cAAc;EACzC,IAAI,CAACD,MAAMK,QAAQC,mBAAmB;GACpC,IAAIP,OAAOM,QAAQE,0BAA0B;IAC3C,MAAMC,2BAA2BT,OAAOM,QAAQE;IAChD,OAAOZ,iCAAAA,wCAAAA,GAAAA,aAAAA,iBACEa,0BAA6BP,IAAI,GACxC,mBACF;GACF;GAEAS,QAAQC,KACN,kEAAkEX,MAAMY,GAAE,mPAC5E;GAEA,QAAA,GAAA,aAAA,iBAAQlB,kBAAAA,uBAAqB,CAAA,CAAA;EAC/B;EAEA,MAAMmB,oBAAoBb,MAAMK,QAAQC;EACxC,OAAOX,iCAAAA,wCAAAA,GAAAA,aAAAA,iBACEkB,mBAAsBZ,IAAI,GACjC,mBACF;CACF;CAEA,IAAI,CAACD,MAAMK,QAAQC,mBAAmB;EACpC,IAAIP,OAAOM,QAAQE,0BACjB,QAAA,GAAA,aAAA,iBAAQR,OAAOM,QAAQE,0BAA6BN,IAAI;EAG1D,QAAA,GAAA,aAAA,iBAAQP,kBAAAA,uBAAqB,CAAA,CAAA;CAC/B;CAEA,QAAA,GAAA,aAAA,iBAAQM,MAAMK,QAAQC,mBAAsBL,IAAI;AAClD"}

@@ -13,5 +13,4 @@ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");

* @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

@@ -25,3 +24,2 @@ * @example

* (entry) => { doSomething(entry) },
* { rootMargin: '10px' },
* false

@@ -32,3 +30,3 @@ * )

*/
function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, disabled) {
function useIntersectionObserver(ref, callback, disabled) {
const isIntersectionObserverAvailable = typeof IntersectionObserver === "function";

@@ -38,9 +36,13 @@ let observerRef = null;

const r = ref();
if (!r || !isIntersectionObserverAvailable || disabled) return;
observerRef = new IntersectionObserver(([entry]) => {
callback(entry);
}, intersectionObserverOptions);
if (disabled() || !r || !isIntersectionObserverAvailable) {
solid_js.onCleanup(() => callback());
return;
}
observerRef = new IntersectionObserver((entries) => {
callback(entries.pop());
}, { rootMargin: "100px" });
observerRef.observe(r);
solid_js.onCleanup(() => {
observerRef?.disconnect();
callback();
});

@@ -47,0 +49,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.cjs","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import * as Solid from 'solid-js'\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: Solid.Accessor<T | null>,\n callback: (entry: IntersectionObserverEntry | undefined) => void,\n intersectionObserverOptions: IntersectionObserverInit = {},\n disabled?: boolean,\n): Solid.Accessor<IntersectionObserver | null> {\n const isIntersectionObserverAvailable =\n typeof IntersectionObserver === 'function'\n let observerRef: IntersectionObserver | null = null\n\n Solid.createEffect(() => {\n const r = ref()\n if (!r || !isIntersectionObserverAvailable || disabled) {\n return\n }\n\n observerRef = new IntersectionObserver(([entry]) => {\n callback(entry)\n }, intersectionObserverOptions)\n\n observerRef.observe(r)\n\n Solid.onCleanup(() => {\n observerRef?.disconnect()\n })\n })\n\n return () => observerRef\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,wBACd,KACA,UACA,8BAAwD,CAAC,GACzD,UAC6C;CAC7C,MAAM,kCACJ,OAAO,yBAAyB;CAClC,IAAI,cAA2C;CAE/C,SAAM,mBAAmB;EACvB,MAAM,IAAI,IAAI;EACd,IAAI,CAAC,KAAK,CAAC,mCAAmC,UAC5C;EAGF,cAAc,IAAI,sBAAsB,CAAC,WAAW;GAClD,SAAS,KAAK;EAChB,GAAG,2BAA2B;EAE9B,YAAY,QAAQ,CAAC;EAErB,SAAM,gBAAgB;GACpB,aAAa,WAAW;EAC1B,CAAC;CACH,CAAC;CAED,aAAa;AACf"}
{"version":3,"file":"utils.cjs","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import * as Solid from 'solid-js'\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: Solid.Accessor<T | null>,\n callback: (entry?: IntersectionObserverEntry) => void,\n disabled: Solid.Accessor<boolean>,\n): Solid.Accessor<IntersectionObserver | null> {\n const isIntersectionObserverAvailable =\n typeof IntersectionObserver === 'function'\n let observerRef: IntersectionObserver | null = null\n\n Solid.createEffect(() => {\n const r = ref()\n if (disabled() || !r || !isIntersectionObserverAvailable) {\n Solid.onCleanup(() => callback())\n return\n }\n\n observerRef = new IntersectionObserver(\n (entries) => {\n callback(entries.pop())\n },\n { rootMargin: '100px' },\n )\n\n observerRef.observe(r)\n\n Solid.onCleanup(() => {\n observerRef?.disconnect()\n callback()\n })\n })\n\n return () => observerRef\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,wBACd,KACA,UACA,UAC6C;CAC7C,MAAM,kCACJ,OAAO,yBAAyB;CAClC,IAAI,cAA2C;CAE/C,SAAM,mBAAmB;EACvB,MAAM,IAAI,IAAI;EACd,IAAI,SAAS,KAAK,CAAC,KAAK,CAAC,iCAAiC;GACxD,SAAM,gBAAgB,SAAS,CAAC;GAChC;EACF;EAEA,cAAc,IAAI,sBACf,YAAY;GACX,SAAS,QAAQ,IAAI,CAAC;EACxB,GACA,EAAE,YAAY,QAAQ,CACxB;EAEA,YAAY,QAAQ,CAAC;EAErB,SAAM,gBAAgB;GACpB,aAAa,WAAW;GACxB,SAAS;EACX,CAAC;CACH,CAAC;CAED,aAAa;AACf"}

@@ -10,5 +10,4 @@ import * as Solid from 'solid-js';

* @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

@@ -22,3 +21,2 @@ * @example

* (entry) => { doSomething(entry) },
* { rootMargin: '10px' },
* false

@@ -29,2 +27,2 @@ * )

*/
export declare function useIntersectionObserver<T extends Element>(ref: Solid.Accessor<T | null>, callback: (entry: IntersectionObserverEntry | undefined) => void, intersectionObserverOptions?: IntersectionObserverInit, disabled?: boolean): Solid.Accessor<IntersectionObserver | null>;
export declare function useIntersectionObserver<T extends Element>(ref: Solid.Accessor<T | null>, callback: (entry?: IntersectionObserverEntry) => void, disabled: Solid.Accessor<boolean>): Solid.Accessor<IntersectionObserver | null>;

@@ -0,1 +1,2 @@

import { renderInNonRouteComponentContext } from "./nonRouteComponentContext.js";
import { Dynamic, createComponent, delegateEvents, insert, memo, template } from "solid-js/web";

@@ -10,3 +11,3 @@ import * as Solid from "solid-js";

Solid.createEffect(Solid.on(props.getResetKey, () => reset(), { defer: true }));
return createComponent(Dynamic, {
return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(() => createComponent(Dynamic, {
get component() {

@@ -17,2 +18,8 @@ return props.errorComponent ?? ErrorComponent;

reset
}), "errorComponent") : createComponent(Dynamic, {
get component() {
return props.errorComponent ?? ErrorComponent;
},
error,
reset
});

@@ -19,0 +26,0 @@ },

@@ -1,1 +0,1 @@

{"version":3,"file":"CatchBoundary.js","names":["Solid","Dynamic","ErrorRouteComponent","CatchBoundary","props","getResetKey","children","JSX","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","ErrorBoundary","fallback","reset","createEffect","on","defer","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","$$click","d","_$insert","_c$","_$memo","_el$6","_tmpl$2","_el$7","_c$2","message","_el$8","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport type { ErrorRouteComponent } from './route'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => unknown\n children: Solid.JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.ErrorBoundary\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(\n Solid.on(props.getResetKey, () => reset(), { defer: true }),\n )\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.ErrorBoundary>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n <strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;AAIA,SAAgBG,cACdC,OAMA;CACA,OAAAU,gBACGd,MAAMe,eAAa;EAClBC,WAAWL,OAAOM,UAAU;GAC1Bb,MAAMM,UAAUC,KAAK;GAErBX,MAAMkB,aACJlB,MAAMmB,GAAGf,MAAMC,mBAAmBY,MAAM,GAAG,EAAEG,OAAO,KAAK,CAAC,CAC5D;GAEA,OAAAN,gBACGb,SAAO;IAAA,IACNoB,YAAS;KAAA,OAAEjB,MAAMK,kBAAkBa;IAAc;IAC1CX;IACAM;GAAK,CAAA;EAGlB;EAAC,IAAAX,WAAA;GAAA,OAEAF,MAAME;EAAQ;CAAA,CAAA;AAGrB;AAEA,SAAgBgB,eAAe,EAAEX,SAAyB;CACxD,MAAM,CAACY,MAAMC,WAAWxB,MAAMyB,aAAAA,QAAAA,IAAAA,aACH,YAC3B;CAEA,cAAA;EAAA,IAAAI,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAE,QAAAH,MAAAC,WAAAG;EAAAJ,MAAAI;EAAAD,MAAAG,gBAauBb,SAASc,MAAM,CAACA,CAAC;EAACC,OAAAL,aAEhCX,KAAK,IAAI,eAAe,YAAY;EAAAgB,OAAAV,aAAA;GAAA,IAAAW,MAAAC,WAAA,CAAA,CAIxClB,KAAK,CAAC;GAAA,aAANiB,IAAA,WAAA;IAAA,IAAAE,QAAAC,QAAA,GAAAC,QAAAF,MAAAV;IAAAO,OAAAK,cAAA;KAAA,IAAAC,OAAAJ,WAAA,CAAA,CAYM9B,MAAMmC,OAAO;KAAA,aAAbD,KAAA,WAAA;MAAA,IAAAE,QAAAC,QAAA;MAAAT,OAAAQ,aAAuBpC,MAAMmC,OAAO;MAAA,OAAAC;KAAA,GAAA,IAAW;IAAI,GAAA,CAAA;IAAA,OAAAL;GAAA,GAAA,IAGtD;EAAI,GAAA,GAAA,IAAA;EAAA,OAAAb;CAAA,GAAA;AAGd;AAACoB,eAAA,CAAA,OAAA,CAAA"}
{"version":3,"file":"CatchBoundary.js","names":["Solid","Dynamic","renderInNonRouteComponentContext","ErrorRouteComponent","CatchBoundary","props","getResetKey","children","JSX","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","ErrorBoundary","fallback","reset","createEffect","on","defer","process","env","NODE_ENV","component","ErrorComponent","show","setShow","createSignal","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","$$click","d","_$insert","_c$","_$memo","_el$6","_tmpl$2","_el$7","_c$2","message","_el$8","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { renderInNonRouteComponentContext } from './nonRouteComponentContext'\nimport type { ErrorRouteComponent } from './route'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => unknown\n children: Solid.JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.ErrorBoundary\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(\n Solid.on(props.getResetKey, () => reset(), { defer: true }),\n )\n\n return process.env.NODE_ENV !== 'production' ? (\n renderInNonRouteComponentContext(\n () => (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n ),\n 'errorComponent',\n )\n ) : (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={error}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.ErrorBoundary>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n <strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;AAKA,SAAgBI,cACdC,OAMA;CACA,OAAAU,gBACGf,MAAMgB,eAAa;EAClBC,WAAWL,OAAOM,UAAU;GAC1Bb,MAAMM,UAAUC,KAAK;GAErBZ,MAAMmB,aACJnB,MAAMoB,GAAGf,MAAMC,mBAAmBY,MAAM,GAAG,EAAEG,OAAO,KAAK,CAAC,CAC5D;GAEA,OAAA,QAAA,IAAA,aAAgC,eAC9BnB,uCACEa,gBACGd,SAAO;IAAA,IACNwB,YAAS;KAAA,OAAEpB,MAAMK,kBAAkBgB;IAAc;IAC1Cd;IACAM;GAAK,CAAA,GAGhB,gBACF,IAACH,gBAEAd,SAAO;IAAA,IACNwB,YAAS;KAAA,OAAEpB,MAAMK,kBAAkBgB;IAAc;IAC1Cd;IACAM;GAAK,CAAA;EAGlB;EAAC,IAAAX,WAAA;GAAA,OAEAF,MAAME;EAAQ;CAAA,CAAA;AAGrB;AAEA,SAAgBmB,eAAe,EAAEd,SAAyB;CACxD,MAAM,CAACe,MAAMC,WAAW5B,MAAM6B,aAAAA,QAAAA,IAAAA,aACH,YAC3B;CAEA,cAAA;EAAA,IAAAC,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAE,QAAAH,MAAAC,WAAAG;EAAAJ,MAAAI;EAAAD,MAAAG,gBAauBV,SAASW,MAAM,CAACA,CAAC;EAACC,OAAAL,aAEhCR,KAAK,IAAI,eAAe,YAAY;EAAAa,OAAAV,aAAA;GAAA,IAAAW,MAAAC,WAAA,CAAA,CAIxCf,KAAK,CAAC;GAAA,aAANc,IAAA,WAAA;IAAA,IAAAE,QAAAC,QAAA,GAAAC,QAAAF,MAAAV;IAAAO,OAAAK,cAAA;KAAA,IAAAC,OAAAJ,WAAA,CAAA,CAYM9B,MAAMmC,OAAO;KAAA,aAAbD,KAAA,WAAA;MAAA,IAAAE,QAAAC,QAAA;MAAAT,OAAAQ,aAAuBpC,MAAMmC,OAAO;MAAA,OAAAC;KAAA,GAAA,IAAW;IAAI,GAAA,CAAA;IAAA,OAAAL;GAAA,GAAA,IAGtD;EAAI,GAAA,GAAA,IAAA;EAAA,OAAAb;CAAA,GAAA;AAGd;AAACoB,eAAA,CAAA,OAAA,CAAA"}

@@ -28,3 +28,2 @@ import { AnyRouter, Constrain, LinkOptions, RegisteredRouter, RoutePaths } from '@tanstack/router-core';

isActive: boolean;
isTransitioning: boolean;
}) => Solid.JSX.Element);

@@ -31,0 +30,0 @@ }

@@ -12,5 +12,8 @@ import { useHydrated } from "./ClientOnly.js";

var timeoutMap = /* @__PURE__ */ new WeakMap();
var cancelPreload = (eventTarget) => {
clearTimeout(timeoutMap.get(eventTarget));
timeoutMap.delete(eventTarget);
};
function useLinkProps(options) {
const router = useRouter();
const [isTransitioning, setIsTransitioning] = Solid.createSignal(false);
const shouldHydrateHash = !isServer && !!router.options.ssr;

@@ -102,3 +105,3 @@ const hasHydrated = useHydrated();

const preload = Solid.createMemo(() => {
if (options.reloadDocument || externalLink()) return false;
if (options.reloadDocument || externalLink() || local.disabled) return false;
return local.preload ?? router.options.defaultPreload;

@@ -135,10 +138,25 @@ });

});
const preloadViewportIoCallback = (entry) => {
if (entry?.isIntersecting) doPreload();
const [ref, setRef] = Solid.createSignal(null);
const enqueuePreload = (e) => {
if (!e) {
cancelPreload(ref);
return;
}
if (!(e.isIntersecting ?? preload() === "intent")) {
if (e.isIntersecting === false) cancelPreload(ref);
return;
}
if (!preloadDelay()) {
doPreload();
return;
}
if (!timeoutMap.has(ref)) timeoutMap.set(ref, setTimeout(() => {
timeoutMap.delete(ref);
doPreload();
}, preloadDelay()));
};
const [ref, setRef] = Solid.createSignal(null);
useIntersectionObserver(ref, preloadViewportIoCallback, { rootMargin: "100px" }, !!local.disabled || preload() !== "viewport");
useIntersectionObserver(ref, enqueuePreload, () => preload() !== "viewport");
Solid.createEffect(() => {
if (hasRenderFetched) return;
if (!local.disabled && preload() === "render") {
if (preload() === "render") {
doPreload();

@@ -170,7 +188,2 @@ hasRenderFetched = true;

e.preventDefault();
setIsTransitioning(true);
const unsub = router.subscribe("onResolved", () => {
unsub();
setIsTransitioning(false);
});
router.navigate({

@@ -187,27 +200,8 @@ ...options,

};
const enqueueIntentPreload = (e) => {
if (local.disabled || preload() !== "intent") return;
if (!preloadDelay()) {
doPreload();
return;
}
const eventTarget = e.currentTarget || e.target;
if (!eventTarget || timeoutMap.has(eventTarget)) return;
timeoutMap.set(eventTarget, setTimeout(() => {
timeoutMap.delete(eventTarget);
doPreload();
}, preloadDelay()));
};
const handleTouchStart = (_) => {
if (local.disabled || preload() !== "intent") return;
const handleTouchStart = () => {
if (preload() !== "intent") return;
doPreload();
};
const handleLeave = (e) => {
if (local.disabled) return;
const eventTarget = e.currentTarget || e.target;
if (eventTarget) {
const id = timeoutMap.get(eventTarget);
clearTimeout(id);
timeoutMap.delete(eventTarget);
}
const handleLeave = () => {
if (preload() === "intent") cancelPreload(ref);
};

@@ -217,5 +211,5 @@ const simpleStyling = Solid.createMemo(() => local.activeProps === STATIC_ACTIVE_PROPS_GET && local.inactiveProps === STATIC_INACTIVE_PROPS_GET && local.class === void 0 && local.style === void 0);

const onBlur = createComposedHandler(() => local.onBlur, handleLeave);
const onFocus = createComposedHandler(() => local.onFocus, enqueueIntentPreload);
const onMouseEnter = createComposedHandler(() => local.onMouseEnter, enqueueIntentPreload);
const onMouseOver = createComposedHandler(() => local.onMouseOver, enqueueIntentPreload);
const onFocus = createComposedHandler(() => local.onFocus, enqueuePreload);
const onMouseEnter = createComposedHandler(() => local.onMouseEnter, enqueuePreload);
const onMouseOver = createComposedHandler(() => local.onMouseOver, enqueuePreload);
const onMouseLeave = createComposedHandler(() => local.onMouseLeave, handleLeave);

@@ -239,4 +233,3 @@ const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave);

target: local.target,
...local.disabled && STATIC_DISABLED_PROPS,
...isTransitioning() && STATIC_TRANSITIONING_ATTRIBUTES
...local.disabled && STATIC_DISABLED_PROPS
};

@@ -287,3 +280,2 @@ if (simpleStyling()) return {

};
var STATIC_TRANSITIONING_ATTRIBUTES = { "data-transitioning": "transitioning" };
/** Call a JSX.EventHandlerUnion with the event. */

@@ -309,10 +301,5 @@ function callHandler(event, handler) {

const ch = local.children;
if (typeof ch === "function") return ch({
get isActive() {
return linkProps["data-status"] === "active";
},
get isTransitioning() {
return linkProps["data-transitioning"] === "transitioning";
}
});
if (typeof ch === "function") return ch({ get isActive() {
return linkProps["data-status"] === "active";
} });
return ch;

@@ -319,0 +306,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"link.js","names":["Solid","mergeRefs","deepEqual","exactPathTest","functionalUpdate","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","Dynamic","useRouter","useIntersectionObserver","useHydrated","AnyRouter","Constrain","LinkOptions","RegisteredRouter","RoutePaths","ValidateLinkOptions","ValidateLinkOptionsArray","timeoutMap","WeakMap","EventTarget","ReturnType","setTimeout","useLinkProps","TRouter","TFrom","options","UseLinkPropsOptions","TTo","TMaskFrom","TMaskTo","ComponentProps","router","isTransitioning","setIsTransitioning","createSignal","shouldHydrateHash","ssr","hasHydrated","hasRenderFetched","local","rest","splitProps","mergeProps","activeProps","STATIC_ACTIVE_PROPS_GET","inactiveProps","STATIC_INACTIVE_PROPS_GET","_","propsSafeToSpread","currentLocation","createMemo","stores","location","get","undefined","equals","prev","next","href","_fromLocation","nextOptions","untrack","buildLocation","hrefOption","disabled","maskedLocation","publicHref","external","history","createHref","externalLink","_href","protocolAllowlist","process","env","NODE_ENV","console","warn","to","safeInternal","isSafeInternal","indexOf","URL","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","isActive","activeOptions","current","nextLocation","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","length","includeSearch","searchTest","search","partial","ignoreUndefined","explicitUndefined","includeHash","currentHash","hash","doPreload","preloadRoute","_builtLocation","catch","err","preloadViewportIoCallback","entry","IntersectionObserverEntry","isIntersecting","ref","setRef","Element","rootMargin","createEffect","handleClick","e","MouseEvent","elementTarget","currentTarget","HTMLAnchorElement","SVGAElement","getAttribute","effectiveTarget","target","isCtrlEvent","defaultPrevented","button","preventDefault","unsub","subscribe","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","enqueueIntentPreload","FocusEvent","eventTarget","has","set","delete","handleTouchStart","TouchEvent","handleLeave","id","clearTimeout","simpleStyling","class","style","onClick","createComposedHandler","onBlur","onFocus","onMouseEnter","onMouseOver","onMouseLeave","onMouseOut","onTouchStart","ResolvedLinkStateProps","Omit","JSX","CSSProperties","resolvedProps","active","base","STATIC_DISABLED_PROPS","STATIC_TRANSITIONING_ATTRIBUTES","STATIC_DEFAULT_ACTIVE_ATTRIBUTES","EMPTY_OBJECT","className","filter","Boolean","join","STATIC_ACTIVE_ATTRIBUTES","STATIC_ACTIVE_PROPS","role","callHandler","Event","event","TEvent","T","handler","EventHandlerUnion","getHandler","fallback","ActiveLinkOptions","ActiveLinkOptionProps","TComp","ActiveLinkProps","Partial","LinkComponentSolidProps","key","LinkProps","LinkPropsChildren","children","state","ValidComponent","CreateLinkProps","LinkComponentProps","LinkComponent","TDefaultFrom","props","LinkComponentRoute","defaultFrom","createLink","Comp","_$createComponent","Link","_$mergeProps","_asChild","linkProps","ch","svgLinkProps","_el$","_tmpl$","_el$2","firstChild","_$spread","_$insert","_el$3","_tmpl$2","component","metaKey","altKey","ctrlKey","shiftKey","zero","charCodeAt","LinkOptionsFnOptions","TOptions","ReadonlyArray","LinkOptionsFn","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { mergeRefs } from '@solid-primitives/refs'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\n\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\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): Solid.ComponentProps<'a'> {\n const router = useRouter()\n const [isTransitioning, setIsTransitioning] = Solid.createSignal(false)\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n const [local, rest] = Solid.splitProps(\n Solid.mergeProps(\n {\n activeProps: STATIC_ACTIVE_PROPS_GET,\n inactiveProps: STATIC_INACTIVE_PROPS_GET,\n },\n options,\n ),\n [\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n ],\n )\n\n // const {\n // // custom props\n // activeProps = () => ({ class: 'active' }),\n // inactiveProps = () => ({}),\n // activeOptions,\n // to,\n // preload: userPreload,\n // preloadDelay: userPreloadDelay,\n // hashScrollIntoView,\n // replace,\n // startTransition,\n // resetScroll,\n // viewTransition,\n // // element props\n // children,\n // target,\n // disabled,\n // style,\n // class,\n // onClick,\n // onFocus,\n // onMouseEnter,\n // onMouseLeave,\n // onTouchStart,\n // ignoreBlocker,\n // ...rest\n // } = options\n\n const [_, propsSafeToSpread] = Solid.splitProps(rest, [\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n ])\n\n const currentLocation = Solid.createMemo(\n () => router.stores.location.get(),\n undefined,\n { equals: (prev, next) => prev.href === next.href },\n )\n\n const next = Solid.createMemo(() => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const nextOptions = { _fromLocation, ...options } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(nextOptions))\n })\n\n const hrefOption = Solid.createMemo(() => {\n if (options.disabled) return undefined\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 location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n })\n\n const externalLink = Solid.createMemo(() => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = options.to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n })\n\n const preload = Solid.createMemo(() => {\n if (options.reloadDocument || externalLink()) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n })\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(() => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(current.pathname, router.basepath)\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\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(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n })\n\n const doPreload = () =>\n router\n .preloadRoute({ ...options, _builtLocation: next() } 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 const [ref, setRef] = Solid.createSignal<Element | null>(null)\n\n useIntersectionObserver(\n ref,\n preloadViewportIoCallback,\n { rootMargin: '100px' },\n !!local.disabled || preload() !== 'viewport',\n )\n\n Solid.createEffect(() => {\n if (hasRenderFetched) {\n return\n }\n if (!local.disabled && preload() === 'render') {\n doPreload()\n hasRenderFetched = true\n }\n })\n\n if (externalLink()) {\n return Solid.mergeProps(\n propsSafeToSpread,\n {\n ref: mergeRefs(setRef, options.ref),\n href: externalLink(),\n },\n Solid.splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\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 local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n setIsTransitioning(true)\n\n const unsub = router.subscribe('onResolved', () => {\n unsub()\n setIsTransitioning(false)\n })\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ...options,\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {\n if (local.disabled || preload() !== 'intent') return\n\n if (!preloadDelay()) {\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()),\n )\n }\n\n const handleTouchStart = (_: TouchEvent) => {\n if (local.disabled || preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = (e: MouseEvent | FocusEvent) => {\n if (local.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 const simpleStyling = Solid.createMemo(\n () =>\n local.activeProps === STATIC_ACTIVE_PROPS_GET &&\n local.inactiveProps === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(\n () => local.onFocus,\n enqueueIntentPreload,\n )\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueueIntentPreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueueIntentPreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<Solid.ComponentProps<'a'>, 'style'> & {\n style?: Solid.JSX.CSSProperties\n }\n\n const resolvedProps = Solid.createMemo(() => {\n const active = isActive()\n\n const base = {\n href: hrefOption()?.href,\n ref: mergeRefs(setRef, options.ref),\n onClick,\n onBlur,\n onFocus,\n onMouseEnter,\n onMouseOver,\n onMouseLeave,\n onMouseOut,\n onTouchStart,\n disabled: !!local.disabled,\n target: local.target,\n ...(local.disabled && STATIC_DISABLED_PROPS),\n ...(isTransitioning() && STATIC_TRANSITIONING_ATTRIBUTES),\n }\n\n if (simpleStyling()) {\n return {\n ...base,\n ...(active && STATIC_DEFAULT_ACTIVE_ATTRIBUTES),\n }\n }\n\n const activeProps: ResolvedLinkStateProps = active\n ? (functionalUpdate(local.activeProps as any, {}) ?? EMPTY_OBJECT)\n : EMPTY_OBJECT\n const inactiveProps: ResolvedLinkStateProps = active\n ? EMPTY_OBJECT\n : functionalUpdate(local.inactiveProps, {})\n const style = {\n ...local.style,\n ...activeProps.style,\n ...inactiveProps.style,\n }\n const className = [local.class, activeProps.class, inactiveProps.class]\n .filter(Boolean)\n .join(' ')\n\n return {\n ...activeProps,\n ...inactiveProps,\n ...base,\n ...(hasKeys(style) ? { style } : undefined),\n ...(className ? { class: className } : undefined),\n ...(active && STATIC_ACTIVE_ATTRIBUTES),\n } as ResolvedLinkStateProps\n })\n\n return Solid.mergeProps(propsSafeToSpread, resolvedProps) as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\nconst STATIC_DEFAULT_ACTIVE_ATTRIBUTES = {\n class: 'active',\n 'data-status': 'active',\n 'aria-current': 'page',\n}\nconst STATIC_DISABLED_PROPS = {\n role: 'link',\n 'aria-disabled': true,\n}\nconst STATIC_ACTIVE_ATTRIBUTES = {\n 'data-status': 'active',\n 'aria-current': 'page',\n}\nconst STATIC_TRANSITIONING_ATTRIBUTES = {\n 'data-transitioning': 'transitioning',\n}\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: Solid.JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => Solid.JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\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 Omit<Solid.ComponentProps<'a'>, 'style'> & { style?: Solid.JSX.CSSProperties }\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 LinkComponentSolidProps<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 | Solid.JSX.Element\n | ((state: {\n isActive: boolean\n isTransitioning: boolean\n }) => Solid.JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends Solid.ValidComponent\n ? Omit<Solid.ComponentProps<TComp>, keyof CreateLinkProps>\n : never\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> = LinkComponentSolidProps<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) => Solid.JSX.Element\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 ): Solid.JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => Solid.JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = Solid.splitProps(\n props as typeof props & { _asChild: any },\n ['_asChild', 'children'],\n )\n\n const [_, linkProps] = Solid.splitProps(\n useLinkProps(rest as unknown as any),\n ['type'],\n )\n\n const children = Solid.createMemo(() => {\n const ch = local.children\n if (typeof ch === 'function') {\n return ch({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n get isTransitioning() {\n return (linkProps as any)['data-transitioning'] === 'transitioning'\n },\n })\n }\n\n return ch satisfies Solid.JSX.Element\n })\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = Solid.splitProps(linkProps, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as Solid.ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\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":";;;;;;;;;;AAiCA,IAAMqB,6BAAa,IAAIC,QAAoD;AAE3E,SAAgBI,aAOdG,SAC2B;CAC3B,MAAMM,SAASxB,UAAU;CACzB,MAAM,CAACyB,iBAAiBC,sBAAsBrC,MAAMsC,aAAa,KAAK;CACtE,MAAMC,oBAAoB,CAAC9B,YAAY,CAAC,CAAC0B,OAAON,QAAQW;CACxD,MAAMC,cAAc5B,YAAY;CAEhC,IAAI6B,mBAAmB;CAEvB,MAAM,CAACC,OAAOC,QAAQ5C,MAAM6C,WAC1B7C,MAAM8C,WACJ;EACEC,aAAaC;EACbC,eAAeC;CACjB,GACArB,OACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;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GAC/C;GACA,IAAI9L,kBAAkB;IACpB,OAAQ8L,UAAkB,0BAA0B;GACtD;EACF,CAAC;EAGH,OAAOC;CACT,CAAC;CAED,IAAIxL,MAAMsL,aAAa,OAAO;EAC5B,MAAM,CAAC9K,GAAGiL,gBAAgBpO,MAAM6C,WAAWqL,WAAW,CAAC,OAAO,CAAC;EAC/D,cAAA;GAAA,IAAAG,OAAAC,OAAA,GAAAC,QAAAF,KAAAG;GAAAC,OAAAF,OAEWH,cAAY,OAAA,IAAA;GAAAM,OAAAH,OAAGrB,QAAQ;GAAA,OAAAmB;EAAA,GAAA;CAGpC;CAEA,IAAI,CAAC1L,MAAMsL,UACT,cAAA;EAAA,IAAAU,QAAAC,QAAA;EAAAH,OAAAE,OAAcT,WAAS,OAAA,IAAA;EAAAQ,OAAAC,OAAGzB,QAAQ;EAAA,OAAAyB;CAAA,GAAA;CAGpC,OAAAb,gBACGpN,SAAOsN,WAAA,EAAA,IAACa,YAAS;EAAA,OAAElM,MAAMsL;CAAgC,EAAA,GAAMC,WAAS,EAAA,IAAAhB,WAAA;EAAA,OACtEA,SAAS;CAAC,EAAA,CAAA,CAAA;AAGjB;AAEA,SAASxE,YAAYT,GAAe;CAClC,OAAO,CAAC,EAAEA,EAAE6G,WAAW7G,EAAE8G,UAAU9G,EAAE+G,WAAW/G,EAAEgH;AACpD;AAEA,SAAS7J,eAAeF,IAAa;CACnC,IAAI,OAAOA,OAAO,UAAU,OAAO;CACnC,MAAMgK,OAAOhK,GAAGiK,WAAW,CAAC;CAC5B,IAAID,SAAS,IAAI,OAAOhK,GAAGiK,WAAW,CAAC,MAAM;CAC7C,OAAOD,SAAS;AAClB;AAkBA,IAAaM,eAAmC3N,YAAY;CAC1D,OAAOA;AACT"}
{"version":3,"file":"link.js","names":["Solid","mergeRefs","deepEqual","exactPathTest","functionalUpdate","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","Dynamic","useRouter","useIntersectionObserver","useHydrated","AnyRouter","Constrain","LinkOptions","RegisteredRouter","RoutePaths","ValidateLinkOptions","ValidateLinkOptionsArray","timeoutMap","WeakMap","ReturnType","setTimeout","cancelPreload","eventTarget","clearTimeout","get","delete","useLinkProps","TRouter","TFrom","options","UseLinkPropsOptions","TTo","TMaskFrom","TMaskTo","ComponentProps","router","shouldHydrateHash","ssr","hasHydrated","hasRenderFetched","local","rest","splitProps","mergeProps","activeProps","STATIC_ACTIVE_PROPS_GET","inactiveProps","STATIC_INACTIVE_PROPS_GET","_","propsSafeToSpread","currentLocation","createMemo","stores","location","undefined","equals","prev","next","href","_fromLocation","nextOptions","untrack","buildLocation","hrefOption","disabled","maskedLocation","publicHref","external","history","createHref","externalLink","_href","protocolAllowlist","process","env","NODE_ENV","console","warn","to","safeInternal","isSafeInternal","indexOf","URL","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","isActive","activeOptions","current","nextLocation","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","length","includeSearch","searchTest","search","partial","ignoreUndefined","explicitUndefined","includeHash","currentHash","hash","doPreload","preloadRoute","_builtLocation","catch","err","ref","setRef","createSignal","Element","enqueuePreload","e","MouseEvent","FocusEvent","IntersectionObserverEntry","isIntersecting","has","set","createEffect","handleClick","elementTarget","currentTarget","HTMLAnchorElement","SVGAElement","getAttribute","effectiveTarget","target","isCtrlEvent","defaultPrevented","button","preventDefault","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","handleTouchStart","handleLeave","simpleStyling","class","style","onClick","createComposedHandler","onBlur","onFocus","onMouseEnter","onMouseOver","onMouseLeave","onMouseOut","onTouchStart","ResolvedLinkStateProps","Omit","JSX","CSSProperties","resolvedProps","active","base","STATIC_DISABLED_PROPS","STATIC_DEFAULT_ACTIVE_ATTRIBUTES","EMPTY_OBJECT","className","filter","Boolean","join","STATIC_ACTIVE_ATTRIBUTES","STATIC_ACTIVE_PROPS","role","callHandler","Event","event","TEvent","T","handler","EventHandlerUnion","getHandler","fallback","ActiveLinkOptions","ActiveLinkOptionProps","TComp","ActiveLinkProps","Partial","LinkComponentSolidProps","key","LinkProps","LinkPropsChildren","children","state","ValidComponent","CreateLinkProps","LinkComponentProps","LinkComponent","TDefaultFrom","props","LinkComponentRoute","defaultFrom","createLink","Comp","_$createComponent","Link","_$mergeProps","_asChild","linkProps","ch","svgLinkProps","_el$","_tmpl$","_el$2","firstChild","_$spread","_$insert","_el$3","_tmpl$2","component","metaKey","altKey","ctrlKey","shiftKey","zero","charCodeAt","LinkOptionsFnOptions","TOptions","ReadonlyArray","LinkOptionsFn","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { mergeRefs } from '@solid-primitives/refs'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\n\nconst timeoutMap = new WeakMap<object, ReturnType<typeof setTimeout>>()\nconst cancelPreload = (eventTarget: object) => {\n clearTimeout(timeoutMap.get(eventTarget))\n timeoutMap.delete(eventTarget)\n}\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): Solid.ComponentProps<'a'> {\n const router = useRouter()\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n const [local, rest] = Solid.splitProps(\n Solid.mergeProps(\n {\n activeProps: STATIC_ACTIVE_PROPS_GET,\n inactiveProps: STATIC_INACTIVE_PROPS_GET,\n },\n options,\n ),\n [\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n ],\n )\n\n // const {\n // // custom props\n // activeProps = () => ({ class: 'active' }),\n // inactiveProps = () => ({}),\n // activeOptions,\n // to,\n // preload: userPreload,\n // preloadDelay: userPreloadDelay,\n // hashScrollIntoView,\n // replace,\n // startTransition,\n // resetScroll,\n // viewTransition,\n // // element props\n // children,\n // target,\n // disabled,\n // style,\n // class,\n // onClick,\n // onFocus,\n // onMouseEnter,\n // onMouseLeave,\n // onTouchStart,\n // ignoreBlocker,\n // ...rest\n // } = options\n\n const [_, propsSafeToSpread] = Solid.splitProps(rest, [\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n ])\n\n const currentLocation = Solid.createMemo(\n () => router.stores.location.get(),\n undefined,\n { equals: (prev, next) => prev.href === next.href },\n )\n\n const next = Solid.createMemo(() => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const nextOptions = { _fromLocation, ...options } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(nextOptions))\n })\n\n const hrefOption = Solid.createMemo(() => {\n if (options.disabled) return undefined\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 location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n })\n\n const externalLink = Solid.createMemo(() => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = options.to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n })\n\n const preload = Solid.createMemo(() => {\n if (options.reloadDocument || externalLink() || local.disabled) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n })\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(() => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(current.pathname, router.basepath)\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\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(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n })\n\n const doPreload = () =>\n router\n .preloadRoute({ ...options, _builtLocation: next() } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const [ref, setRef] = Solid.createSignal<Element | null>(null)\n\n const enqueuePreload = (\n e?: MouseEvent | FocusEvent | IntersectionObserverEntry,\n ) => {\n if (!e) {\n cancelPreload(ref)\n return\n }\n\n if (\n !(\n (e as IntersectionObserverEntry).isIntersecting ??\n preload() === 'intent'\n )\n ) {\n if ((e as IntersectionObserverEntry).isIntersecting === false) {\n cancelPreload(ref)\n }\n return\n }\n\n if (!preloadDelay()) {\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()),\n )\n }\n }\n\n useIntersectionObserver(ref, enqueuePreload, () => preload() !== 'viewport')\n\n Solid.createEffect(() => {\n if (hasRenderFetched) {\n return\n }\n if (preload() === 'render') {\n doPreload()\n hasRenderFetched = true\n }\n })\n\n if (externalLink()) {\n return Solid.mergeProps(\n propsSafeToSpread,\n {\n ref: mergeRefs(setRef, options.ref),\n href: externalLink(),\n },\n Solid.splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\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 local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ...options,\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const handleTouchStart = () => {\n if (preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = () => {\n if (preload() === 'intent') {\n cancelPreload(ref)\n }\n }\n\n const simpleStyling = Solid.createMemo(\n () =>\n local.activeProps === STATIC_ACTIVE_PROPS_GET &&\n local.inactiveProps === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(() => local.onFocus, enqueuePreload)\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueuePreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueuePreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<Solid.ComponentProps<'a'>, 'style'> & {\n style?: Solid.JSX.CSSProperties\n }\n\n const resolvedProps = Solid.createMemo(() => {\n const active = isActive()\n\n const base = {\n href: hrefOption()?.href,\n ref: mergeRefs(setRef, options.ref),\n onClick,\n onBlur,\n onFocus,\n onMouseEnter,\n onMouseOver,\n onMouseLeave,\n onMouseOut,\n onTouchStart,\n disabled: !!local.disabled,\n target: local.target,\n ...(local.disabled && STATIC_DISABLED_PROPS),\n }\n\n if (simpleStyling()) {\n return {\n ...base,\n ...(active && STATIC_DEFAULT_ACTIVE_ATTRIBUTES),\n }\n }\n\n const activeProps: ResolvedLinkStateProps = active\n ? (functionalUpdate(local.activeProps as any, {}) ?? EMPTY_OBJECT)\n : EMPTY_OBJECT\n const inactiveProps: ResolvedLinkStateProps = active\n ? EMPTY_OBJECT\n : functionalUpdate(local.inactiveProps, {})\n const style = {\n ...local.style,\n ...activeProps.style,\n ...inactiveProps.style,\n }\n const className = [local.class, activeProps.class, inactiveProps.class]\n .filter(Boolean)\n .join(' ')\n\n return {\n ...activeProps,\n ...inactiveProps,\n ...base,\n ...(hasKeys(style) ? { style } : undefined),\n ...(className ? { class: className } : undefined),\n ...(active && STATIC_ACTIVE_ATTRIBUTES),\n } as ResolvedLinkStateProps\n })\n\n return Solid.mergeProps(propsSafeToSpread, resolvedProps) as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\nconst STATIC_DEFAULT_ACTIVE_ATTRIBUTES = {\n class: 'active',\n 'data-status': 'active',\n 'aria-current': 'page',\n}\nconst STATIC_DISABLED_PROPS = {\n role: 'link',\n 'aria-disabled': true,\n}\nconst STATIC_ACTIVE_ATTRIBUTES = {\n 'data-status': 'active',\n 'aria-current': 'page',\n}\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: Solid.JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => Solid.JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\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 Omit<Solid.ComponentProps<'a'>, 'style'> & { style?: Solid.JSX.CSSProperties }\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 LinkComponentSolidProps<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 | Solid.JSX.Element\n | ((state: { isActive: boolean }) => Solid.JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends Solid.ValidComponent\n ? Omit<Solid.ComponentProps<TComp>, keyof CreateLinkProps>\n : never\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> = LinkComponentSolidProps<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) => Solid.JSX.Element\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 ): Solid.JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => Solid.JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = Solid.splitProps(\n props as typeof props & { _asChild: any },\n ['_asChild', 'children'],\n )\n\n const [_, linkProps] = Solid.splitProps(\n useLinkProps(rest as unknown as any),\n ['type'],\n )\n\n const children = Solid.createMemo(() => {\n const ch = local.children\n if (typeof ch === 'function') {\n return ch({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n })\n }\n\n return ch satisfies Solid.JSX.Element\n })\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = Solid.splitProps(linkProps, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as Solid.ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\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":";;;;;;;;;;AAiCA,IAAMqB,6BAAa,IAAIC,QAA+C;AACtE,IAAMG,iBAAiBC,gBAAwB;CAC7CC,aAAaN,WAAWO,IAAIF,WAAW,CAAC;CACxCL,WAAWQ,OAAOH,WAAW;AAC/B;AAEA,SAAgBI,aAOdG,SAC2B;CAC3B,MAAMM,SAAS5B,UAAU;CACzB,MAAM6B,oBAAoB,CAAC/B,YAAY,CAAC,CAAC8B,OAAON,QAAQQ;CACxD,MAAMC,cAAc7B,YAAY;CAEhC,IAAI8B,mBAAmB;CAEvB,MAAM,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;EAAA,GAAA;CAGpC;CAEA,IAAI,CAAC/K,MAAM2K,UACT,cAAA;EAAA,IAAAU,QAAAC,QAAA;EAAAH,OAAAE,OAAcT,WAAS,OAAA,IAAA;EAAAQ,OAAAC,OAAGzB,QAAQ;EAAA,OAAAyB;CAAA,GAAA;CAGpC,OAAAb,gBACG1M,SAAO4M,WAAA,EAAA,IAACa,YAAS;EAAA,OAAEvL,MAAM2K;CAAgC,EAAA,GAAMC,WAAS,EAAA,IAAAhB,WAAA;EAAA,OACtEA,SAAS;CAAC,EAAA,CAAA,CAAA;AAGjB;AAEA,SAAS5D,YAAYhB,GAAe;CAClC,OAAO,CAAC,EAAEA,EAAEwG,WAAWxG,EAAEyG,UAAUzG,EAAE0G,WAAW1G,EAAE2G;AACpD;AAEA,SAASnJ,eAAeF,IAAa;CACnC,IAAI,OAAOA,OAAO,UAAU,OAAO;CACnC,MAAMsJ,OAAOtJ,GAAGuJ,WAAW,CAAC;CAC5B,IAAID,SAAS,IAAI,OAAOtJ,GAAGuJ,WAAW,CAAC,MAAM;CAC7C,OAAOD,SAAS;AAClB;AAkBA,IAAaM,eAAmC7M,YAAY;CAC1D,OAAOA;AACT"}

@@ -0,1 +1,2 @@

import { nonRouteComponentContext, renderInNonRouteComponentContext } from "./nonRouteComponentContext.js";
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";

@@ -35,2 +36,5 @@ import { ClientOnly } from "./ClientOnly.js";

get fallback() {
if (process.env.NODE_ENV !== "production") return renderInNonRouteComponentContext(() => createComponent(Dynamic, { get component() {
return resolvePendingComponent();
} }), "pendingComponent");
return createComponent(Dynamic, { get component() {

@@ -50,4 +54,8 @@ return resolvePendingComponent();

get fallback() {
return memo(() => !!shouldSkipSuspenseFallback())() ? void 0 : createComponent(Dynamic, { get component() {
if (shouldSkipSuspenseFallback()) return;
if (process.env.NODE_ENV !== "production") return renderInNonRouteComponentContext(() => createComponent(Dynamic, { get component() {
return resolvePendingComponent();
} }), "pendingComponent");
return createComponent(Dynamic, { get component() {
return resolvePendingComponent();
} });

@@ -82,4 +90,6 @@ },

if (notFoundError.routeId !== currentMatch().routeId) throw notFoundError;
return createComponent(Dynamic, mergeProps({ get component() {
return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(() => createComponent(Dynamic, mergeProps({ get component() {
return routeNotFoundComponent();
} }, notFoundError)), "notFoundComponent") : createComponent(Dynamic, mergeProps({ get component() {
return routeNotFoundComponent();
} }, notFoundError));

@@ -96,2 +106,5 @@ },

get fallback() {
if (process.env.NODE_ENV !== "production") return renderInNonRouteComponentContext(() => createComponent(Dynamic, { get component() {
return resolvePendingComponent();
} }), "pendingComponent");
return createComponent(Dynamic, { get component() {

@@ -167,8 +180,16 @@ return resolvePendingComponent();

children: (_) => {
if (isServer ?? router.isServer) return createComponent((route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent, {
get error() {
return currentMatch().error;
},
info: { componentStack: "" }
});
if (isServer ?? router.isServer) {
const RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent;
return process.env.NODE_ENV !== "production" ? renderInNonRouteComponentContext(() => createComponent(RouteErrorComponent, {
get error() {
return currentMatch().error;
},
info: { componentStack: "" }
}), "errorComponent") : createComponent(RouteErrorComponent, {
get error() {
return currentMatch().error;
},
info: { componentStack: "" }
});
}
throw currentMatch().error;

@@ -189,2 +210,6 @@ }

var Outlet = () => {
if (process.env.NODE_ENV !== "production") {
const nonRouteComponent = Solid.useContext(nonRouteComponentContext);
if (nonRouteComponent) console.warn(`Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`);
}
const router = useRouter();

@@ -221,2 +246,5 @@ const nearestParentMatch = Solid.useContext(nearestMatchContext);

get fallback() {
if (process.env.NODE_ENV !== "production") return renderInNonRouteComponentContext(() => createComponent(Dynamic, { get component() {
return router.options.defaultPendingComponent;
} }), "pendingComponent");
return createComponent(Dynamic, { get component() {

@@ -223,0 +251,0 @@ return router.options.defaultPendingComponent;

@@ -1,1 +0,1 @@

{"version":3,"file":"Match.js","names":["Solid","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","ClientOnly","AnyRoute","AnyRouter","RootRouteOptions","renderScrollRestoration","undefined","router","route","parentRoute","id","options","scrollRestoration","_$createComponent","Match","props","routeId","currentMatch","createMemo","stores","byRoute","get","nearestMatch","const","routesById","routeOptions","resolvePendingComponent","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ssr","shouldSkipSuspenseFallback","ShellComponent","shellComponent","MatchContent","Show","when","status","fallback","children","MatchInner","Provider","value","Suspense","_$memo","getResetKey","onCatch","error","Error","notFoundError","process","env","NODE_ENV","console","warn","defaultOnCatch","_$mergeProps","Switch","useContext","match","componentKey","current","remount","remountDeps","defaultRemountDeps","deps","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","childRouteId","_notFound","ids","indexOf","_routeKey"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport type {\n AnyRoute,\n AnyRouter,\n RootRouteOptions,\n} from '@tanstack/router-core'\n\n// Keep the client constant undefined so the server-only script can be dropped.\nconst renderScrollRestoration =\n isServer === false\n ? undefined\n : (router: AnyRouter, route: AnyRoute) =>\n (isServer ?? router.isServer) &&\n route.parentRoute?.id === rootRouteId &&\n router.options.scrollRestoration ? (\n <ScrollRestoration />\n ) : null\n\nexport const Match = (props: { routeId: string }) => {\n const router = useRouter()\n\n const currentMatch = Solid.createMemo(\n () => router.stores.byRoute.get(props.routeId)!.get()!,\n )\n\n const nearestMatch = [() => props.routeId, currentMatch] as const\n\n const route: AnyRoute = router.routesById[props.routeId]\n\n // Lazy route option mutations become observable with the next client match\n // publication. Server stores are non-reactive and options load before render.\n const routeOptions =\n (isServer ?? router.isServer)\n ? () => route.options\n : () => {\n currentMatch()\n return route.options\n }\n\n const resolvePendingComponent = () =>\n routeOptions().pendingComponent ?? router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n routeOptions().errorComponent ?? router.options.defaultErrorComponent\n\n const routeNotFoundComponent = () =>\n route.isRoot\n ? // If it's the root route, use the _notFound option, with fallback to the notFoundRoute's component\n (routeOptions().notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : routeOptions().notFoundComponent\n\n const resolvedNoSsr = () =>\n currentMatch().ssr === false || currentMatch().ssr === 'data-only'\n\n const shouldSkipSuspenseFallback = () =>\n (isServer ?? router.isServer)\n ? resolvedNoSsr()\n : currentMatch().ssr === 'data-only'\n\n const ShellComponent = route.isRoot\n ? ((route.options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n\n const MatchContent = () => (\n <Solid.Show\n when={currentMatch().status !== 'pending'}\n fallback={<Dynamic component={resolvePendingComponent()} />}\n >\n <MatchInner />\n </Solid.Show>\n )\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Solid.Suspense\n fallback={\n // Data-only SSR renders the inner fallback on the server, so\n // avoid adding an extra suspense fallback on the client.\n shouldSkipSuspenseFallback() ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={routeErrorComponent() ? CatchBoundary : SafeFragment}\n getResetKey={currentMatch}\n errorComponent={routeErrorComponent() as any}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatch().routeId\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatch().routeId}`,\n )\n }\n ;(route.options.onCatch ?? router.options.defaultOnCatch)?.(error)\n }}\n >\n <Dynamic\n component={\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n }\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatch().routeId\n\n if (notFoundError.routeId !== currentMatch().routeId) {\n throw notFoundError\n }\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr()}>\n <ClientOnly\n fallback={<Dynamic component={resolvePendingComponent()} />}\n >\n <MatchContent />\n </ClientOnly>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr()}>\n <MatchContent />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Solid.Suspense>\n </nearestMatchContext.Provider>\n\n {renderScrollRestoration?.(router, route)}\n </ShellComponent>\n )\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const nearestMatch = Solid.useContext(nearestMatchContext)\n const match = nearestMatch[1 /* match */]\n const routeId = nearestMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n const currentMatch = () => match()!\n\n const componentKey = () => {\n const current = currentMatch()\n const remount =\n route.options.remountDeps ?? router.options.defaultRemountDeps\n const deps = remount?.({\n routeId: routeId()!,\n loaderDeps: current.loaderDeps,\n params: current._strictParams,\n search: current._strictSearch,\n })\n return deps ? JSON.stringify(deps) : current.id\n }\n\n const out = () => {\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => renderRouteNotFound(router, route, currentMatch().error)}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route.options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch[1 /* match */]\n const routeId = nearestParentMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n\n const childRouteId = () => {\n if (parentMatch()!._notFound) {\n return\n }\n const ids = router.stores.ids.get()\n return ids[ids.indexOf(routeId()!) + 1]\n }\n\n return (\n <Solid.Show\n when={childRouteId()}\n keyed\n fallback={\n parentMatch()!._notFound\n ? renderRouteNotFound(router, route, parentMatch()!.error)\n : undefined\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match routeId={childRouteId()!} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match routeId={childRouteId()!} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,IAAMiB,0BACJf,aAAa,QACTgB,KAAAA,KACCC,QAAmBC,WACjBlB,YAAYiB,OAAOjB,aACpBkB,MAAMC,aAAaC,OAAOrB,eAC1BkB,OAAOI,QAAQC,oBAAiBC,gBAC7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B;CACnC,MAAMpF,QAAQD,OAAOiB,WAAWR,QAAQ;CAExC,MAAM8E,qBAAqB;EACzB,IAAID,YAAY,EAAGE,WACjB;EAEF,MAAMC,MAAMzF,OAAOY,OAAO6E,IAAI3E,IAAI;EAClC,OAAO2E,IAAIA,IAAIC,QAAQjF,QAAQ,CAAE,IAAI;CACvC;CAEA,OAAAH,gBACGzB,MAAMuD,MAAI;EAAA,IACTC,OAAI;GAAA,OAAEkD,aAAa;EAAC;EACpBR,OAAK;EAAA,IACLxC,WAAQ;GAAA,OACNM,WAAA,CAAA,CAAAyC,YAAY,EAAGE,SAAS,EAAA,IACpBhG,oBAAoBQ,QAAQC,OAAOqF,YAAY,EAAGtC,KAAK,IACvDjD,KAAAA;EAAS;EAAAyC,WAGbmD,cAAsB;GACtB,OAAArF,gBACGzB,MAAMuD,MAAI;IAAA,IACTC,OAAI;KAAA,OAAE5B,QAAQ,MAAM3B;IAAW;IAAA,IAC/ByD,WAAQ;KAAA,OAAAjC,gBAAGC,OAAK,EAAA,IAACE,UAAO;MAAA,OAAE8E,aAAa;KAAE,EAAA,CAAA;IAAA;IAAA,IAAA/C,WAAA;KAAA,OAAAlC,gBAExCzB,MAAM+D,UAAQ;MAAA,IACbL,WAAQ;OAAA,OAAAjC,gBACLtB,SAAO,EAAA,IAAC6C,YAAS;QAAA,OAAE7B,OAAOI,QAAQiB;OAAuB,EAAA,CAAA;MAAA;MAAA,IAAAmB,WAAA;OAAA,OAAAlC,gBAG3DC,OAAK,EAAA,IAACE,UAAO;QAAA,OAAE8E,aAAa;OAAE,EAAA,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA;EAIvC;CAAC,CAAA;AAGP"}
{"version":3,"file":"Match.js","names":["Solid","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","ClientOnly","nonRouteComponentContext","renderInNonRouteComponentContext","AnyRoute","AnyRouter","RootRouteOptions","renderScrollRestoration","undefined","router","route","parentRoute","id","options","scrollRestoration","_$createComponent","Match","props","routeId","currentMatch","createMemo","stores","byRoute","get","nearestMatch","const","routesById","routeOptions","resolvePendingComponent","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ssr","shouldSkipSuspenseFallback","ShellComponent","shellComponent","MatchContent","Show","when","status","fallback","process","env","NODE_ENV","children","MatchInner","Provider","value","Suspense","getResetKey","onCatch","error","Error","notFoundError","console","warn","defaultOnCatch","_$mergeProps","Switch","_$memo","useContext","match","componentKey","current","remount","remountDeps","defaultRemountDeps","deps","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","RouteErrorComponent","info","componentStack","nonRouteComponent","nearestParentMatch","parentMatch","childRouteId","_notFound","ids","indexOf","_routeKey"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport { ClientOnly } from './ClientOnly'\nimport {\n nonRouteComponentContext,\n renderInNonRouteComponentContext,\n} from './nonRouteComponentContext'\nimport type {\n AnyRoute,\n AnyRouter,\n RootRouteOptions,\n} from '@tanstack/router-core'\n\n// Keep the client constant undefined so the server-only script can be dropped.\nconst renderScrollRestoration =\n isServer === false\n ? undefined\n : (router: AnyRouter, route: AnyRoute) =>\n (isServer ?? router.isServer) &&\n route.parentRoute?.id === rootRouteId &&\n router.options.scrollRestoration ? (\n <ScrollRestoration />\n ) : null\n\nexport const Match = (props: { routeId: string }) => {\n const router = useRouter()\n\n const currentMatch = Solid.createMemo(\n () => router.stores.byRoute.get(props.routeId)!.get()!,\n )\n\n const nearestMatch = [() => props.routeId, currentMatch] as const\n\n const route: AnyRoute = router.routesById[props.routeId]\n\n // Lazy route option mutations become observable with the next client match\n // publication. Server stores are non-reactive and options load before render.\n const routeOptions =\n (isServer ?? router.isServer)\n ? () => route.options\n : () => {\n currentMatch()\n return route.options\n }\n\n const resolvePendingComponent = () =>\n routeOptions().pendingComponent ?? router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n routeOptions().errorComponent ?? router.options.defaultErrorComponent\n\n const routeNotFoundComponent = () =>\n route.isRoot\n ? // If it's the root route, use the _notFound option, with fallback to the notFoundRoute's component\n (routeOptions().notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : routeOptions().notFoundComponent\n\n const resolvedNoSsr = () =>\n currentMatch().ssr === false || currentMatch().ssr === 'data-only'\n\n const shouldSkipSuspenseFallback = () =>\n (isServer ?? router.isServer)\n ? resolvedNoSsr()\n : currentMatch().ssr === 'data-only'\n\n const ShellComponent = route.isRoot\n ? ((route.options as RootRouteOptions).shellComponent ?? SafeFragment)\n : SafeFragment\n\n const MatchContent = () => (\n <Solid.Show\n when={currentMatch().status !== 'pending'}\n fallback={(() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => <Dynamic component={resolvePendingComponent()} />,\n 'pendingComponent',\n )\n }\n return <Dynamic component={resolvePendingComponent()} />\n })()}\n >\n <MatchInner />\n </Solid.Show>\n )\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Solid.Suspense\n fallback={(() => {\n // Data-only SSR renders the inner fallback on the server, so\n // avoid adding an extra suspense fallback on the client.\n if (shouldSkipSuspenseFallback()) {\n return undefined\n }\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => <Dynamic component={resolvePendingComponent()} />,\n 'pendingComponent',\n )\n }\n return <Dynamic component={resolvePendingComponent()} />\n })()}\n >\n <Dynamic\n component={routeErrorComponent() ? CatchBoundary : SafeFragment}\n getResetKey={currentMatch}\n errorComponent={routeErrorComponent() as any}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatch().routeId\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatch().routeId}`,\n )\n }\n ;(route.options.onCatch ?? router.options.defaultOnCatch)?.(error)\n }}\n >\n <Dynamic\n component={\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n }\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatch().routeId\n\n if (notFoundError.routeId !== currentMatch().routeId) {\n throw notFoundError\n }\n\n return process.env.NODE_ENV !== 'production' ? (\n renderInNonRouteComponentContext(\n () => (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n ),\n 'notFoundComponent',\n )\n ) : (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr()}>\n <ClientOnly\n fallback={(() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => (\n <Dynamic component={resolvePendingComponent()} />\n ),\n 'pendingComponent',\n )\n }\n return <Dynamic component={resolvePendingComponent()} />\n })()}\n >\n <MatchContent />\n </ClientOnly>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr()}>\n <MatchContent />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Solid.Suspense>\n </nearestMatchContext.Provider>\n\n {renderScrollRestoration?.(router, route)}\n </ShellComponent>\n )\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const nearestMatch = Solid.useContext(nearestMatchContext)\n const match = nearestMatch[1 /* match */]\n const routeId = nearestMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n const currentMatch = () => match()!\n\n const componentKey = () => {\n const current = currentMatch()\n const remount =\n route.options.remountDeps ?? router.options.defaultRemountDeps\n const deps = remount?.({\n routeId: routeId()!,\n loaderDeps: current.loaderDeps,\n params: current._strictParams,\n search: current._strictSearch,\n })\n return deps ? JSON.stringify(deps) : current.id\n }\n\n const out = () => {\n const Comp = route.options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => renderRouteNotFound(router, route, currentMatch().error)}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route.options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return process.env.NODE_ENV !== 'production' ? (\n renderInNonRouteComponentContext(\n () => (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n ),\n 'errorComponent',\n )\n ) : (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n}\n\nexport const Outlet = () => {\n if (process.env.NODE_ENV !== 'production') {\n const nonRouteComponent = Solid.useContext(nonRouteComponentContext!)\n if (nonRouteComponent) {\n console.warn(\n `Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`,\n )\n }\n }\n\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch[1 /* match */]\n const routeId = nearestParentMatch[0 /* route id */]\n const route = router.routesById[routeId()!]!\n\n const childRouteId = () => {\n if (parentMatch()!._notFound) {\n return\n }\n const ids = router.stores.ids.get()\n return ids[ids.indexOf(routeId()!) + 1]\n }\n\n return (\n <Solid.Show\n when={childRouteId()}\n keyed\n fallback={\n parentMatch()!._notFound\n ? renderRouteNotFound(router, route, parentMatch()!.error)\n : undefined\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match routeId={childRouteId()!} />}\n >\n <Solid.Suspense\n fallback={(() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => (\n <Dynamic\n component={router.options.defaultPendingComponent}\n />\n ),\n 'pendingComponent',\n )\n }\n return (\n <Dynamic component={router.options.defaultPendingComponent} />\n )\n })()}\n >\n <Match routeId={childRouteId()!} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAuBA,IAAMmB,0BACJjB,aAAa,QACTkB,KAAAA,KACCC,QAAmBC,WACjBpB,YAAYmB,OAAOnB,aACpBoB,MAAMC,aAAaC,OAAOvB,eAC1BoB,OAAOI,QAAQC,oBAAiBC,gBAC7Bf,mBAAiB,CAAA,CAAA,IAChB;AAEZ,IAAagB,SAASC,UAA+B;CACnD,MAAMR,SAASf,UAAU;CAEzB,MAAMyB,eAAe/B,MAAMgC,iBACnBX,OAAOY,OAAOC,QAAQC,IAAIN,MAAMC,OAAO,EAAGK,IAAI,CACtD;CAEA,MAAMC,eAAe,OAAOP,MAAMC,SAASC,YAAY;CAEvD,MAAMT,QAAkBD,OAAOiB,WAAWT,MAAMC;CAIhD,MAAMS,eACHrC,YAAYmB,OAAOnB,iBACVoB,MAAMG,gBACN;EACJM,aAAa;EACb,OAAOT,MAAMG;CACf;CAEN,MAAMe,gCACJD,aAAa,EAAEE,oBAAoBpB,OAAOI,QAAQiB;CAEpD,MAAMC,4BACJJ,aAA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6B,cAC3B,OAAO7C,uCACLY,gBACGxB,SAAO,EAAA,IACN+C,YAAS;QAAA,OAAE7B,OAAOI,QAAQiB;OAAuB,EAAA,CAAA,GAGrD,kBACF;OAEF,OAAAf,gBACGxB,SAAO,EAAA,IAAC+C,YAAS;QAAA,OAAE7B,OAAOI,QAAQiB;OAAuB,EAAA,CAAA;MAE9D;MAAC,IAAAsB,WAAA;OAAA,OAAArC,gBAEAC,OAAK,EAAA,IAACE,UAAO;QAAA,OAAE+E,aAAa;OAAE,EAAA,CAAA;MAAA;KAAA,CAAA;IAAA;GAAA,CAAA;EAIvC;CAAC,CAAA;AAGP"}

@@ -0,1 +1,2 @@

import { renderInNonRouteComponentContext } from "./nonRouteComponentContext.js";
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";

@@ -20,3 +21,6 @@ import { useRouter } from "./useRouter.js";

get fallback() {
return PendingComponent ? createComponent(PendingComponent, {}) : null;
return PendingComponent ? (() => {
if (process.env.NODE_ENV !== "production") return renderInNonRouteComponentContext(() => createComponent(PendingComponent, {}), "pendingComponent");
return createComponent(PendingComponent, {});
})() : null;
},

@@ -23,0 +27,0 @@ get children() {

@@ -1,1 +0,1 @@

{"version":3,"file":"Matches.js","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Rendered","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","MatchesInner","routeId","stores","ids","get","match","byRoute","undefined","nearestMatch","const","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","location","resolvedLocation","status","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","res","useParentMatches","contextRouteId","useContext","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Rendered, Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n <Rendered />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const routeId = () => router.stores.ids.get()[0]\n const match = () =>\n routeId() ? router.stores.byRoute.get(routeId()!)?.get() : undefined\n const nearestMatch = [routeId, match] as const\n\n const matchComponent = () => {\n return (\n <Solid.Show when={routeId()}>\n <Match routeId={routeId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={match}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.location.get()\n router.stores.resolvedLocation.get()\n router.stores.status.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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":";;;;;;;;;;;AAkCA,SAAgBiC,UAAU;CACxB,MAAMC,SAAS5B,UAAU;CAEzB,MAAM6B,oBACHhC,YAAY+B,OAAO/B,aACnB,OAAOiC,aAAa,eAAeF,OAAOG,MACvC3B,eACAV,MAAMsC;CAEZ,MAAMC,kBAAkCL,OAAOM,WAAWtC;CAC1D,MAAMuC,mBACJF,UAAU,EAAEG,QAAQC,oBACpBT,OAAOQ,QAAQE;CAIjB,OAAAG,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AAWC,MAAMA,EAAEnE,YAAY+D,eAAe,CAAC,CACzD;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV;AAEA,SAAgBY,gBAIdlC,MACsD;CACtD,MAAM6B,iBAAiBlH,MAAMmH,WAAW1G,mBAAmB,EAAE;CAE7D,OAAOqG,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChBT,QAAQU,WAAWC,MAAMA,EAAEnE,YAAY+D,eAAe,CAAC,IAAI,CAC7D;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"}
{"version":3,"file":"Matches.js","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Rendered","Transitioner","nearestMatchContext","SafeFragment","Match","renderInNonRouteComponentContext","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","process","env","NODE_ENV","MatchesInner","routeId","stores","ids","get","match","byRoute","undefined","nearestMatch","const","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","location","resolvedLocation","status","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","res","useParentMatches","contextRouteId","useContext","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Rendered, Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport { renderInNonRouteComponentContext } from './nonRouteComponentContext'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={\n PendingComponent\n ? (() => {\n if (process.env.NODE_ENV !== 'production') {\n return renderInNonRouteComponentContext(\n () => <PendingComponent />,\n 'pendingComponent',\n )\n }\n return <PendingComponent />\n })()\n : null\n }\n >\n <Transitioner />\n <MatchesInner />\n <Rendered />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const routeId = () => router.stores.ids.get()[0]\n const match = () =>\n routeId() ? router.stores.byRoute.get(routeId()!)?.get() : undefined\n const nearestMatch = [routeId, match] as const\n\n const matchComponent = () => {\n return (\n <Solid.Show when={routeId()}>\n <Match routeId={routeId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={match}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.location.get()\n router.stores.resolvedLocation.get()\n router.stores.status.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextRouteId = Solid.useContext(nearestMatchContext)[0 /* route id */]\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,SAAgBkC,UAAU;CACxB,MAAMC,SAAS7B,UAAU;CAEzB,MAAM8B,oBACHjC,YAAYgC,OAAOhC,aACnB,OAAOkC,aAAa,eAAeF,OAAOG,MACvC5B,eACAV,MAAMuC;CAEZ,MAAMC,kBAAkCL,OAAOM,WAAWvC;CAC1D,MAAMwC,mBACJF,UAAU,EAAEG,QAAQC,oBACpBT,OAAOQ,QAAQE;CAIjB,OAAAG,gBAFwBb,OAAOQ,QAAQI,aAAarC,cAGlC,EAAA,IAAAuC,WAAA;EAAA,OAAAD,gBACbZ,kBAAgB;GAAA,IACfc,WAAQ;IAAA,OACNR,0BACW;KACL,IAAA,Q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E,YAAY4D,eAAe,CAAC,CACzD;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV;AAEA,SAAgBY,gBAIdlC,MACsD;CACtD,MAAM6B,iBAAiBnH,MAAMoH,WAAW3G,mBAAmB,EAAE;CAE7D,OAAOsG,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChBT,QAAQU,WAAWC,MAAMA,EAAEhE,YAAY4D,eAAe,CAAC,IAAI,CAC7D;EACA,OAAO7B,MAAMqB,SAASrB,KAAKqB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"}

@@ -0,1 +1,2 @@

import { renderInNonRouteComponentContext } from "./nonRouteComponentContext.js";
import { DefaultGlobalNotFound } from "./not-found.js";

@@ -13,7 +14,16 @@ import { createComponent } from "solid-js/web";

function renderRouteNotFound(router, route, data) {
if (process.env.NODE_ENV !== "production") {
if (!route.options.notFoundComponent) {
if (router.options.defaultNotFoundComponent) {
const DefaultNotFoundComponent = router.options.defaultNotFoundComponent;
return renderInNonRouteComponentContext(() => createComponent(DefaultNotFoundComponent, data), "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 createComponent(DefaultGlobalNotFound, {});
}
const NotFoundComponent = route.options.notFoundComponent;
return renderInNonRouteComponentContext(() => createComponent(NotFoundComponent, data), "notFoundComponent");
}
if (!route.options.notFoundComponent) {
if (router.options.defaultNotFoundComponent) return createComponent(router.options.defaultNotFoundComponent, data);
if (process.env.NODE_ENV !== "production") {
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 createComponent(DefaultGlobalNotFound, {});

@@ -20,0 +30,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouteNotFound.js","names":["DefaultGlobalNotFound","AnyRoute","AnyRouter","renderRouteNotFound","router","route","data","options","notFoundComponent","defaultNotFoundComponent","_$createComponent","process","env","NODE_ENV","console","warn","id"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { 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) {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <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 <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgBG,oBACdC,QACAC,OACAC,MACA;CACA,IAAI,CAACD,MAAME,QAAQC,mBAAmB;EACpC,IAAIJ,OAAOG,QAAQE,0BACjB,OAAAC,gBAAQN,OAAOG,QAAQE,0BAA6BH,IAAI;EAG1D,IAAA,QAAA,IAAA,aAA6B;OACvB,CAACD,MAAME,QAAQC,mBACjBM,QAAQC,KACN,kEAAkEV,MAAMW,GAAE,mPAC5E;EAAA;EAIJ,OAAAN,gBAAQV,uBAAqB,CAAA,CAAA;CAC/B;CAEA,OAAAU,gBAAQL,MAAME,QAAQC,mBAAsBF,IAAI;AAClD"}
{"version":3,"file":"renderRouteNotFound.js","names":["DefaultGlobalNotFound","renderInNonRouteComponentContext","AnyRoute","AnyRouter","renderRouteNotFound","router","route","data","process","env","NODE_ENV","options","notFoundComponent","defaultNotFoundComponent","DefaultNotFoundComponent","_$createComponent","console","warn","id","NotFoundComponent"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { 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) {\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n const DefaultNotFoundComponent = router.options.defaultNotFoundComponent\n return renderInNonRouteComponentContext(\n () => <DefaultNotFoundComponent {...data} />,\n 'notFoundComponent',\n )\n }\n\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 return <DefaultGlobalNotFound />\n }\n\n const NotFoundComponent = route.options.notFoundComponent\n return renderInNonRouteComponentContext(\n () => <NotFoundComponent {...data} />,\n 'notFoundComponent',\n )\n }\n\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <router.options.defaultNotFoundComponent {...data} />\n }\n\n return <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgBI,oBACdC,QACAC,OACAC,MACA;CACA,IAAA,QAAA,IAAA,aAA6B,cAAc;EACzC,IAAI,CAACD,MAAMK,QAAQC,mBAAmB;GACpC,IAAIP,OAAOM,QAAQE,0BAA0B;IAC3C,MAAMC,2BAA2BT,OAAOM,QAAQE;IAChD,OAAOZ,uCACLc,gBAAOD,0BAA6BP,IAAI,GACxC,mBACF;GACF;GAEAS,QAAQC,KACN,kEAAkEX,MAAMY,GAAE,mPAC5E;GAEA,OAAAH,gBAAQf,uBAAqB,CAAA,CAAA;EAC/B;EAEA,MAAMmB,oBAAoBb,MAAMK,QAAQC;EACxC,OAAOX,uCACLc,gBAAOI,mBAAsBZ,IAAI,GACjC,mBACF;CACF;CAEA,IAAI,CAACD,MAAMK,QAAQC,mBAAmB;EACpC,IAAIP,OAAOM,QAAQE,0BACjB,OAAAE,gBAAQV,OAAOM,QAAQE,0BAA6BN,IAAI;EAG1D,OAAAQ,gBAAQf,uBAAqB,CAAA,CAAA;CAC/B;CAEA,OAAAe,gBAAQT,MAAMK,QAAQC,mBAAsBL,IAAI;AAClD"}

@@ -10,5 +10,4 @@ import * as Solid from 'solid-js';

* @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

@@ -22,3 +21,2 @@ * @example

* (entry) => { doSomething(entry) },
* { rootMargin: '10px' },
* false

@@ -29,2 +27,2 @@ * )

*/
export declare function useIntersectionObserver<T extends Element>(ref: Solid.Accessor<T | null>, callback: (entry: IntersectionObserverEntry | undefined) => void, intersectionObserverOptions?: IntersectionObserverInit, disabled?: boolean): Solid.Accessor<IntersectionObserver | null>;
export declare function useIntersectionObserver<T extends Element>(ref: Solid.Accessor<T | null>, callback: (entry?: IntersectionObserverEntry) => void, disabled: Solid.Accessor<boolean>): Solid.Accessor<IntersectionObserver | null>;

@@ -11,5 +11,4 @@ import * as Solid from "solid-js";

* @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,9 +34,13 @@ let observerRef = null;

const r = ref();
if (!r || !isIntersectionObserverAvailable || disabled) return;
observerRef = new IntersectionObserver(([entry]) => {
callback(entry);
}, intersectionObserverOptions);
if (disabled() || !r || !isIntersectionObserverAvailable) {
Solid.onCleanup(() => callback());
return;
}
observerRef = new IntersectionObserver((entries) => {
callback(entries.pop());
}, { rootMargin: "100px" });
observerRef.observe(r);
Solid.onCleanup(() => {
observerRef?.disconnect();
callback();
});

@@ -45,0 +47,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.js","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import * as Solid from 'solid-js'\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: Solid.Accessor<T | null>,\n callback: (entry: IntersectionObserverEntry | undefined) => void,\n intersectionObserverOptions: IntersectionObserverInit = {},\n disabled?: boolean,\n): Solid.Accessor<IntersectionObserver | null> {\n const isIntersectionObserverAvailable =\n typeof IntersectionObserver === 'function'\n let observerRef: IntersectionObserver | null = null\n\n Solid.createEffect(() => {\n const r = ref()\n if (!r || !isIntersectionObserverAvailable || disabled) {\n return\n }\n\n observerRef = new IntersectionObserver(([entry]) => {\n callback(entry)\n }, intersectionObserverOptions)\n\n observerRef.observe(r)\n\n Solid.onCleanup(() => {\n observerRef?.disconnect()\n })\n })\n\n return () => observerRef\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,wBACd,KACA,UACA,8BAAwD,CAAC,GACzD,UAC6C;CAC7C,MAAM,kCACJ,OAAO,yBAAyB;CAClC,IAAI,cAA2C;CAE/C,MAAM,mBAAmB;EACvB,MAAM,IAAI,IAAI;EACd,IAAI,CAAC,KAAK,CAAC,mCAAmC,UAC5C;EAGF,cAAc,IAAI,sBAAsB,CAAC,WAAW;GAClD,SAAS,KAAK;EAChB,GAAG,2BAA2B;EAE9B,YAAY,QAAQ,CAAC;EAErB,MAAM,gBAAgB;GACpB,aAAa,WAAW;EAC1B,CAAC;CACH,CAAC;CAED,aAAa;AACf"}
{"version":3,"file":"utils.js","names":[],"sources":["../../src/utils.ts"],"sourcesContent":["import * as Solid from 'solid-js'\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: Solid.Accessor<T | null>,\n callback: (entry?: IntersectionObserverEntry) => void,\n disabled: Solid.Accessor<boolean>,\n): Solid.Accessor<IntersectionObserver | null> {\n const isIntersectionObserverAvailable =\n typeof IntersectionObserver === 'function'\n let observerRef: IntersectionObserver | null = null\n\n Solid.createEffect(() => {\n const r = ref()\n if (disabled() || !r || !isIntersectionObserverAvailable) {\n Solid.onCleanup(() => callback())\n return\n }\n\n observerRef = new IntersectionObserver(\n (entries) => {\n callback(entries.pop())\n },\n { rootMargin: '100px' },\n )\n\n observerRef.observe(r)\n\n Solid.onCleanup(() => {\n observerRef?.disconnect()\n callback()\n })\n })\n\n return () => observerRef\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,wBACd,KACA,UACA,UAC6C;CAC7C,MAAM,kCACJ,OAAO,yBAAyB;CAClC,IAAI,cAA2C;CAE/C,MAAM,mBAAmB;EACvB,MAAM,IAAI,IAAI;EACd,IAAI,SAAS,KAAK,CAAC,KAAK,CAAC,iCAAiC;GACxD,MAAM,gBAAgB,SAAS,CAAC;GAChC;EACF;EAEA,cAAc,IAAI,sBACf,YAAY;GACX,SAAS,QAAQ,IAAI,CAAC;EACxB,GACA,EAAE,YAAY,QAAQ,CACxB;EAEA,YAAY,QAAQ,CAAC;EAErB,MAAM,gBAAgB;GACpB,aAAa,WAAW;GACxB,SAAS;EACX,CAAC;CACH,CAAC;CAED,aAAa;AACf"}
import * as Solid from 'solid-js';
import { Dynamic } from 'solid-js/web';
import { renderInNonRouteComponentContext } from './nonRouteComponentContext';
export function CatchBoundary(props) {

@@ -7,3 +8,3 @@ return (<Solid.ErrorBoundary fallback={(error, reset) => {

Solid.createEffect(Solid.on(props.getResetKey, () => reset(), { defer: true }));
return (<Dynamic component={props.errorComponent ?? ErrorComponent} error={error} reset={reset}/>);
return process.env.NODE_ENV !== 'production' ? (renderInNonRouteComponentContext(() => (<Dynamic component={props.errorComponent ?? ErrorComponent} error={error} reset={reset}/>), 'errorComponent')) : (<Dynamic component={props.errorComponent ?? ErrorComponent} error={error} reset={reset}/>);
}}>

@@ -10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,KAAK;gBACZ,QAAQ,EAAE,MAAM;aACjB,CAAC,CAEF;YAAA,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CACtD;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;AACH,CAAC"}

@@ -28,3 +28,2 @@ import * as Solid from 'solid-js';

isActive: boolean;
isTransitioning: boolean;
}) => Solid.JSX.Element);

@@ -31,0 +30,0 @@ }

@@ -10,5 +10,8 @@ import * as Solid from 'solid-js';

const timeoutMap = new WeakMap();
const cancelPreload = (eventTarget) => {
clearTimeout(timeoutMap.get(eventTarget));
timeoutMap.delete(eventTarget);
};
export function useLinkProps(options) {
const router = useRouter();
const [isTransitioning, setIsTransitioning] = Solid.createSignal(false);
const shouldHydrateHash = !isServer && !!router.options.ssr;

@@ -143,3 +146,3 @@ const hasHydrated = useHydrated();

const preload = Solid.createMemo(() => {
if (options.reloadDocument || externalLink()) {
if (options.reloadDocument || externalLink() || local.disabled) {
return false;

@@ -193,9 +196,27 @@ }

});
const preloadViewportIoCallback = (entry) => {
if (entry?.isIntersecting) {
const [ref, setRef] = Solid.createSignal(null);
const enqueuePreload = (e) => {
if (!e) {
cancelPreload(ref);
return;
}
if (!(e.isIntersecting ??
preload() === 'intent')) {
if (e.isIntersecting === false) {
cancelPreload(ref);
}
return;
}
if (!preloadDelay()) {
doPreload();
return;
}
if (!timeoutMap.has(ref)) {
timeoutMap.set(ref, setTimeout(() => {
timeoutMap.delete(ref);
doPreload();
}, preloadDelay()));
}
};
const [ref, setRef] = Solid.createSignal(null);
useIntersectionObserver(ref, preloadViewportIoCallback, { rootMargin: '100px' }, !!local.disabled || preload() !== 'viewport');
useIntersectionObserver(ref, enqueuePreload, () => preload() !== 'viewport');
Solid.createEffect(() => {

@@ -205,3 +226,3 @@ if (hasRenderFetched) {

}
if (!local.disabled && preload() === 'render') {
if (preload() === 'render') {
doPreload();

@@ -241,7 +262,2 @@ hasRenderFetched = true;

e.preventDefault();
setIsTransitioning(true);
const unsub = router.subscribe('onResolved', () => {
unsub();
setIsTransitioning(false);
});
// All is well? Navigate!

@@ -260,30 +276,10 @@ // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing

};
const enqueueIntentPreload = (e) => {
if (local.disabled || preload() !== 'intent')
const handleTouchStart = () => {
if (preload() !== 'intent')
return;
if (!preloadDelay()) {
doPreload();
return;
}
const eventTarget = e.currentTarget || e.target;
if (!eventTarget || timeoutMap.has(eventTarget))
return;
timeoutMap.set(eventTarget, setTimeout(() => {
timeoutMap.delete(eventTarget);
doPreload();
}, preloadDelay()));
};
const handleTouchStart = (_) => {
if (local.disabled || preload() !== 'intent')
return;
doPreload();
};
const handleLeave = (e) => {
if (local.disabled)
return;
const eventTarget = e.currentTarget || e.target;
if (eventTarget) {
const id = timeoutMap.get(eventTarget);
clearTimeout(id);
timeoutMap.delete(eventTarget);
const handleLeave = () => {
if (preload() === 'intent') {
cancelPreload(ref);
}

@@ -297,5 +293,5 @@ };

const onBlur = createComposedHandler(() => local.onBlur, handleLeave);
const onFocus = createComposedHandler(() => local.onFocus, enqueueIntentPreload);
const onMouseEnter = createComposedHandler(() => local.onMouseEnter, enqueueIntentPreload);
const onMouseOver = createComposedHandler(() => local.onMouseOver, enqueueIntentPreload);
const onFocus = createComposedHandler(() => local.onFocus, enqueuePreload);
const onMouseEnter = createComposedHandler(() => local.onMouseEnter, enqueuePreload);
const onMouseOver = createComposedHandler(() => local.onMouseOver, enqueuePreload);
const onMouseLeave = createComposedHandler(() => local.onMouseLeave, handleLeave);

@@ -320,3 +316,2 @@ const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave);

...(local.disabled && STATIC_DISABLED_PROPS),
...(isTransitioning() && STATIC_TRANSITIONING_ATTRIBUTES),
};

@@ -371,5 +366,2 @@ if (simpleStyling()) {

};
const STATIC_TRANSITIONING_ATTRIBUTES = {
'data-transitioning': 'transitioning',
};
/** Call a JSX.EventHandlerUnion with the event. */

@@ -405,5 +397,2 @@ function callHandler(event, handler) {

},
get isTransitioning() {
return linkProps['data-transitioning'] === 'transitioning';
},
});

@@ -410,0 +399,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"link.jsx","sourceRoot":"","sources":["../../src/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,mBAAmB,GACpB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAa1C,MAAM,UAAU,GAAG,IAAI,OAAO,EAA8C,CAAA;AAE5E,MAAM,UAAU,YAAY,CAO1B,OAAqE;IAErE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IACvE,MAAM,iBAAiB,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAA;IAC3D,MAAM,WAAW,GAAG,WAAW,EAAE,CAAA;IAEjC,IAAI,gBAAgB,GAAG,KAAK,CAAA;IAE5B,MAAM,CAAC,KAAK,EAAE,IAAI,CAA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AAQ,EAAE,CACb;IAAA,EAAE,OAAO,CAAC,CACX,CAAA;AACH,CAAC,CAAA;AAED,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;AAED,SAAS,cAAc,CAAC,EAAW;IACjC,IAAI,OAAO,EAAE,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IACxC,MAAM,IAAI,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IAC7B,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA,CAAC,mBAAmB;IACnE,OAAO,IAAI,KAAK,EAAE,CAAA,CAAC,yBAAyB;AAC9C,CAAC;AAkBD,MAAM,CAAC,MAAM,WAAW,GAAuB,CAAC,OAAO,EAAE,EAAE;IACzD,OAAO,OAAc,CAAA;AACvB,CAAC,CAAA"}

@@ -13,2 +13,3 @@ import * as Solid from 'solid-js';

import { ClientOnly } from './ClientOnly';
import { nonRouteComponentContext, renderInNonRouteComponentContext, } from './nonRouteComponentContext';
// Keep the client constant undefined so the server-only script can be dropped.

@@ -47,3 +48,8 @@ const renderScrollRestoration = isServer === false

: SafeFragment;
const MatchContent = () => (<Solid.Show when={currentMatch().status !== 'pending'} fallback={<Dynamic component={resolvePendingComponent()}/>}>
const MatchContent = () => (<Solid.Show when={currentMatch().status !== 'pending'} fallback={(() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(() => <Dynamic component={resolvePendingComponent()}/>, 'pendingComponent');
}
return <Dynamic component={resolvePendingComponent()}/>;
})()}>
<MatchInner />

@@ -53,6 +59,13 @@ </Solid.Show>);

<nearestMatchContext.Provider value={nearestMatch}>
<Solid.Suspense fallback={
// Data-only SSR renders the inner fallback on the server, so
// avoid adding an extra suspense fallback on the client.
shouldSkipSuspenseFallback() ? undefined : (<Dynamic component={resolvePendingComponent()}/>)}>
<Solid.Suspense fallback={(() => {
// Data-only SSR renders the inner fallback on the server, so
// avoid adding an extra suspense fallback on the client.
if (shouldSkipSuspenseFallback()) {
return undefined;
}
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(() => <Dynamic component={resolvePendingComponent()}/>, 'pendingComponent');
}
return <Dynamic component={resolvePendingComponent()}/>;
})()}>
<Dynamic component={routeErrorComponent() ? CatchBoundary : SafeFragment} getResetKey={currentMatch} errorComponent={routeErrorComponent()} onCatch={(error) => {

@@ -77,7 +90,12 @@ // Forward not found errors (we don't want to show the error component for these)

}
return (<Dynamic component={routeNotFoundComponent()} {...notFoundError}/>);
return process.env.NODE_ENV !== 'production' ? (renderInNonRouteComponentContext(() => (<Dynamic component={routeNotFoundComponent()} {...notFoundError}/>), 'notFoundComponent')) : (<Dynamic component={routeNotFoundComponent()} {...notFoundError}/>);
}}>
<Solid.Switch>
<Solid.Match when={resolvedNoSsr()}>
<ClientOnly fallback={<Dynamic component={resolvePendingComponent()}/>}>
<ClientOnly fallback={(() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(() => (<Dynamic component={resolvePendingComponent()}/>), 'pendingComponent');
}
return <Dynamic component={resolvePendingComponent()}/>;
})()}>
<MatchContent />

@@ -136,4 +154,6 @@ </ClientOnly>

ErrorComponent;
return (<RouteErrorComponent error={currentMatch().error} info={{
return process.env.NODE_ENV !== 'production' ? (renderInNonRouteComponentContext(() => (<RouteErrorComponent error={currentMatch().error} info={{
componentStack: '',
}}/>), 'errorComponent')) : (<RouteErrorComponent error={currentMatch().error} info={{
componentStack: '',
}}/>);

@@ -150,2 +170,8 @@ }

export const Outlet = () => {
if (process.env.NODE_ENV !== 'production') {
const nonRouteComponent = Solid.useContext(nonRouteComponentContext);
if (nonRouteComponent) {
console.warn(`Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`);
}
}
const router = useRouter();

@@ -168,3 +194,8 @@ const nearestParentMatch = Solid.useContext(nearestMatchContext);

return (<Solid.Show when={routeId() === rootRouteId} fallback={<Match routeId={childRouteId()}/>}>
<Solid.Suspense fallback={<Dynamic component={router.options.defaultPendingComponent}/>}>
<Solid.Suspense fallback={(() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(() => (<Dynamic component={router.options.defaultPendingComponent}/>), 'pendingComponent');
}
return (<Dynamic component={router.options.defaultPendingComponent}/>);
})()}>
<Match routeId={childRouteId()}/>

@@ -171,0 +202,0 @@ </Solid.Suspense>

@@ -1,1 +0,1 @@

{"version":3,"file":"Match.jsx","sourceRoot":"","sources":["../../src/Match.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAOzC,+EAA+E;AAC/E,MAAM,uBAAuB,GAC3B,QAAQ,KAAK,KAAK;IAChB,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,CAAC,MA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AAC,CAAC,GAAG,EAAE;oBACd,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;wBAC1C,OAAO,gCAAgC,CACrC,GAAG,EAAE,CAAC,CACJ,CAAC,OAAO,CACN,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAClD,CACH,EACD,kBAAkB,CACnB,CAAA;oBACH,CAAC;oBACD,OAAO,CACL,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAAG,CAC/D,CAAA;gBACH,CAAC,CAAC,EAAE,CAAC,CAEL;cAAA,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,YAAY,EAAG,CAAC,EAClC;YAAA,EAAE,KAAK,CAAC,QAAQ,CAClB;UAAA,EAAE,KAAK,CAAC,IAAI,CAAC,CACd,CAAA;QACH,CAAC,CACH;IAAA,EAAE,KAAK,CAAC,IAAI,CAAC,CACd,CAAA;AACH,CAAC,CAAA"}

@@ -10,2 +10,3 @@ import * as Solid from 'solid-js';

import { Match } from './Match';
import { renderInNonRouteComponentContext } from './nonRouteComponentContext';
export function Matches() {

@@ -22,3 +23,10 @@ const router = useRouter();

return (<OptionalWrapper>
<ResolvedSuspense fallback={PendingComponent ? <PendingComponent /> : null}>
<ResolvedSuspense fallback={PendingComponent
? (() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(() => <PendingComponent />, 'pendingComponent');
}
return <PendingComponent />;
})()
: null}>
<Transitioner />

@@ -25,0 +33,0 @@ <MatchesInner />

@@ -1,1 +0,1 @@

{"version":3,"file":"Matches.jsx","sourceRoot":"","sources":["../../src/Matches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC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CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,CAAC;KACK,CAAC,CAAA;AACX,CAAC"}
import { DefaultGlobalNotFound } from './not-found';
import { renderInNonRouteComponentContext } from './nonRouteComponentContext';
/**

@@ -11,2 +12,14 @@ * Renders a not found component for a route when no matching route is found.

export function renderRouteNotFound(router, route, data) {
if (process.env.NODE_ENV !== 'production') {
if (!route.options.notFoundComponent) {
if (router.options.defaultNotFoundComponent) {
const DefaultNotFoundComponent = router.options.defaultNotFoundComponent;
return renderInNonRouteComponentContext(() => <DefaultNotFoundComponent {...data}/>, '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 <DefaultGlobalNotFound />;
}
const NotFoundComponent = route.options.notFoundComponent;
return renderInNonRouteComponentContext(() => <NotFoundComponent {...data}/>, 'notFoundComponent');
}
if (!route.options.notFoundComponent) {

@@ -16,7 +29,2 @@ if (router.options.defaultNotFoundComponent) {

}
if (process.env.NODE_ENV !== 'production') {
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 <DefaultGlobalNotFound />;

@@ -23,0 +31,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouteNotFound.jsx","sourceRoot":"","sources":["../../src/renderRouteNotFound.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAGnD;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,KAAe,EACf,IAAS;IAET,IAAI,CAAC,KA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,CAAC;YAED,OAAO,CAAC,IAAI,CACV,kEAAkE,KAAK,CAAC,EAAE,oPAAoP,CAC/T,CAAA;YAED,OAAO,CAAC,qBAAqB,CAAC,AAAD,EAAG,CAAA;QAClC,CAAC;QAED,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAA;QACzD,OAAO,gCAAgC,CACrC,GAAG,EAAE,CAAC,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,EAAG,EACrC,mBAAmB,CACpB,CAAA;IACH,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;QACrC,IAAI,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;YAC5C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC,IAAI,IAAI,CAAC,EAAG,CAAA;QAC9D,CAAC;QAED,OAAO,CAAC,qBAAqB,CAAC,AAAD,EAAG,CAAA;IAClC,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,EAAG,CAAA;AACtD,CAAC"}

@@ -10,5 +10,4 @@ import * as Solid from 'solid-js';

* @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

@@ -22,3 +21,2 @@ * @example

* (entry) => { doSomething(entry) },
* { rootMargin: '10px' },
* false

@@ -29,2 +27,2 @@ * )

*/
export declare function useIntersectionObserver<T extends Element>(ref: Solid.Accessor<T | null>, callback: (entry: IntersectionObserverEntry | undefined) => void, intersectionObserverOptions?: IntersectionObserverInit, disabled?: boolean): Solid.Accessor<IntersectionObserver | null>;
export declare function useIntersectionObserver<T extends Element>(ref: Solid.Accessor<T | null>, callback: (entry?: IntersectionObserverEntry) => void, disabled: Solid.Accessor<boolean>): Solid.Accessor<IntersectionObserver | null>;

@@ -10,5 +10,4 @@ import * as Solid from 'solid-js';

* @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

@@ -22,3 +21,2 @@ * @example

* (entry) => { doSomething(entry) },
* { rootMargin: '10px' },
* false

@@ -29,3 +27,3 @@ * )

*/
export function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, disabled) {
export function useIntersectionObserver(ref, callback, disabled) {
const isIntersectionObserverAvailable = typeof IntersectionObserver === 'function';

@@ -35,11 +33,13 @@ let observerRef = null;

const r = ref();
if (!r || !isIntersectionObserverAvailable || disabled) {
if (disabled() || !r || !isIntersectionObserverAvailable) {
Solid.onCleanup(() => callback());
return;
}
observerRef = new IntersectionObserver(([entry]) => {
callback(entry);
}, intersectionObserverOptions);
observerRef = new IntersectionObserver((entries) => {
callback(entries.pop());
}, { rootMargin: '100px' });
observerRef.observe(r);
Solid.onCleanup(() => {
observerRef?.disconnect();
callback();
});

@@ -46,0 +46,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,uBAAuB,CACrC,GAA6B,EAC7B,QAAgE,EAChE,2BAA2B,GAA6B,EAAE,EAC1D,QAAkB;IAElB,MAAM,+BAA+B,GACnC,OAAO,oBAAoB,KAAK,UAAU,CAAA;IAC5C,IAAI,WAAW,GAAgC,IAAI,CAAA;IAEnD,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE;QACtB,MAAM,CAAC,GAAG,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,CAAC,IAAI,CAAC,+BAA+B,IAAI,QAAQ,EAAE,CAAC;YACvD,OAAM;QACR,CAAC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UAAU,EAAE,CAAA;YACzB,QAAQ,EAAE,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,EAAE,CAAC,WAAW,CAAA;AAC1B,CAAC"}
{
"name": "@tanstack/solid-router",
"version": "1.170.24",
"version": "1.170.25",
"description": "Modern and scalable routing for Solid applications",

@@ -94,3 +94,3 @@ "author": "Tanner Linsley",

"@tanstack/history": "1.162.1",
"@tanstack/router-core": "1.171.21"
"@tanstack/router-core": "1.171.22"
},

@@ -97,0 +97,0 @@ "devDependencies": {

import * as Solid from 'solid-js'
import { Dynamic } from 'solid-js/web'
import { renderInNonRouteComponentContext } from './nonRouteComponentContext'
import type { ErrorRouteComponent } from './route'

@@ -22,3 +23,14 @@

return (
return process.env.NODE_ENV !== 'production' ? (
renderInNonRouteComponentContext(
() => (
<Dynamic
component={props.errorComponent ?? ErrorComponent}
error={error}
reset={reset}
/>
),
'errorComponent',
)
) : (
<Dynamic

@@ -25,0 +37,0 @@ component={props.errorComponent ?? ErrorComponent}

@@ -34,3 +34,7 @@ import * as Solid from 'solid-js'

const timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()
const timeoutMap = new WeakMap<object, ReturnType<typeof setTimeout>>()
const cancelPreload = (eventTarget: object) => {
clearTimeout(timeoutMap.get(eventTarget))
timeoutMap.delete(eventTarget)
}

@@ -47,3 +51,2 @@ export function useLinkProps<

const router = useRouter()
const [isTransitioning, setIsTransitioning] = Solid.createSignal(false)
const shouldHydrateHash = !isServer && !!router.options.ssr

@@ -195,3 +198,3 @@ const hasHydrated = useHydrated()

const preload = Solid.createMemo(() => {
if (options.reloadDocument || externalLink()) {
if (options.reloadDocument || externalLink() || local.disabled) {
return false

@@ -261,19 +264,42 @@ }

const preloadViewportIoCallback = (
entry: IntersectionObserverEntry | undefined,
const [ref, setRef] = Solid.createSignal<Element | null>(null)
const enqueuePreload = (
e?: MouseEvent | FocusEvent | IntersectionObserverEntry,
) => {
if (entry?.isIntersecting) {
if (!e) {
cancelPreload(ref)
return
}
if (
!(
(e as IntersectionObserverEntry).isIntersecting ??
preload() === 'intent'
)
) {
if ((e as IntersectionObserverEntry).isIntersecting === false) {
cancelPreload(ref)
}
return
}
if (!preloadDelay()) {
doPreload()
return
}
if (!timeoutMap.has(ref)) {
timeoutMap.set(
ref,
setTimeout(() => {
timeoutMap.delete(ref)
doPreload()
}, preloadDelay()),
)
}
}
const [ref, setRef] = Solid.createSignal<Element | null>(null)
useIntersectionObserver(ref, enqueuePreload, () => preload() !== 'viewport')
useIntersectionObserver(
ref,
preloadViewportIoCallback,
{ rootMargin: '100px' },
!!local.disabled || preload() !== 'viewport',
)
Solid.createEffect(() => {

@@ -283,3 +309,3 @@ if (hasRenderFetched) {

}
if (!local.disabled && preload() === 'render') {
if (preload() === 'render') {
doPreload()

@@ -332,9 +358,2 @@ hasRenderFetched = true

setIsTransitioning(true)
const unsub = router.subscribe('onResolved', () => {
unsub()
setIsTransitioning(false)
})
// All is well? Navigate!

@@ -354,36 +373,10 @@ // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing

const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {
if (local.disabled || preload() !== 'intent') return
if (!preloadDelay()) {
doPreload()
return
}
const eventTarget = e.currentTarget || e.target
if (!eventTarget || timeoutMap.has(eventTarget)) return
timeoutMap.set(
eventTarget,
setTimeout(() => {
timeoutMap.delete(eventTarget)
doPreload()
}, preloadDelay()),
)
}
const handleTouchStart = (_: TouchEvent) => {
if (local.disabled || preload() !== 'intent') return
const handleTouchStart = () => {
if (preload() !== 'intent') return
doPreload()
}
const handleLeave = (e: MouseEvent | FocusEvent) => {
if (local.disabled) return
const eventTarget = e.currentTarget || e.target
if (eventTarget) {
const id = timeoutMap.get(eventTarget)
clearTimeout(id)
timeoutMap.delete(eventTarget)
const handleLeave = () => {
if (preload() === 'intent') {
cancelPreload(ref)
}

@@ -402,13 +395,10 @@ }

const onBlur = createComposedHandler(() => local.onBlur, handleLeave)
const onFocus = createComposedHandler(
() => local.onFocus,
enqueueIntentPreload,
)
const onFocus = createComposedHandler(() => local.onFocus, enqueuePreload)
const onMouseEnter = createComposedHandler(
() => local.onMouseEnter,
enqueueIntentPreload,
enqueuePreload,
)
const onMouseOver = createComposedHandler(
() => local.onMouseOver,
enqueueIntentPreload,
enqueuePreload,
)

@@ -446,3 +436,2 @@ const onMouseLeave = createComposedHandler(

...(local.disabled && STATIC_DISABLED_PROPS),
...(isTransitioning() && STATIC_TRANSITIONING_ATTRIBUTES),
}

@@ -502,5 +491,2 @@

}
const STATIC_TRANSITIONING_ATTRIBUTES = {
'data-transitioning': 'transitioning',
}

@@ -582,6 +568,3 @@ /** Call a JSX.EventHandlerUnion with the event. */

| Solid.JSX.Element
| ((state: {
isActive: boolean
isTransitioning: boolean
}) => Solid.JSX.Element)
| ((state: { isActive: boolean }) => Solid.JSX.Element)
}

@@ -669,5 +652,2 @@

},
get isTransitioning() {
return (linkProps as any)['data-transitioning'] === 'transitioning'
},
})

@@ -674,0 +654,0 @@ }

@@ -13,2 +13,6 @@ import * as Solid from 'solid-js'

import { ClientOnly } from './ClientOnly'
import {
nonRouteComponentContext,
renderInNonRouteComponentContext,
} from './nonRouteComponentContext'
import type {

@@ -80,3 +84,11 @@ AnyRoute,

when={currentMatch().status !== 'pending'}
fallback={<Dynamic component={resolvePendingComponent()} />}
fallback={(() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(
() => <Dynamic component={resolvePendingComponent()} />,
'pendingComponent',
)
}
return <Dynamic component={resolvePendingComponent()} />
})()}
>

@@ -91,9 +103,16 @@ <MatchInner />

<Solid.Suspense
fallback={
fallback={(() => {
// Data-only SSR renders the inner fallback on the server, so
// avoid adding an extra suspense fallback on the client.
shouldSkipSuspenseFallback() ? undefined : (
<Dynamic component={resolvePendingComponent()} />
)
}
if (shouldSkipSuspenseFallback()) {
return undefined
}
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(
() => <Dynamic component={resolvePendingComponent()} />,
'pendingComponent',
)
}
return <Dynamic component={resolvePendingComponent()} />
})()}
>

@@ -132,3 +151,13 @@ <Dynamic

return (
return process.env.NODE_ENV !== 'production' ? (
renderInNonRouteComponentContext(
() => (
<Dynamic
component={routeNotFoundComponent()}
{...notFoundError}
/>
),
'notFoundComponent',
)
) : (
<Dynamic

@@ -144,3 +173,13 @@ component={routeNotFoundComponent()}

<ClientOnly
fallback={<Dynamic component={resolvePendingComponent()} />}
fallback={(() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(
() => (
<Dynamic component={resolvePendingComponent()} />
),
'pendingComponent',
)
}
return <Dynamic component={resolvePendingComponent()} />
})()}
>

@@ -212,3 +251,15 @@ <MatchContent />

return (
return process.env.NODE_ENV !== 'production' ? (
renderInNonRouteComponentContext(
() => (
<RouteErrorComponent
error={currentMatch().error}
info={{
componentStack: '',
}}
/>
),
'errorComponent',
)
) : (
<RouteErrorComponent

@@ -234,2 +285,11 @@ error={currentMatch().error}

export const Outlet = () => {
if (process.env.NODE_ENV !== 'production') {
const nonRouteComponent = Solid.useContext(nonRouteComponentContext!)
if (nonRouteComponent) {
console.warn(
`Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`,
)
}
}
const router = useRouter()

@@ -266,5 +326,17 @@ const nearestParentMatch = Solid.useContext(nearestMatchContext)

<Solid.Suspense
fallback={
<Dynamic component={router.options.defaultPendingComponent} />
}
fallback={(() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(
() => (
<Dynamic
component={router.options.defaultPendingComponent}
/>
),
'pendingComponent',
)
}
return (
<Dynamic component={router.options.defaultPendingComponent} />
)
})()}
>

@@ -271,0 +343,0 @@ <Match routeId={childRouteId()!} />

@@ -10,2 +10,3 @@ import * as Solid from 'solid-js'

import { Match } from './Match'
import { renderInNonRouteComponentContext } from './nonRouteComponentContext'
import type {

@@ -55,3 +56,15 @@ AnyRoute,

<ResolvedSuspense
fallback={PendingComponent ? <PendingComponent /> : null}
fallback={
PendingComponent
? (() => {
if (process.env.NODE_ENV !== 'production') {
return renderInNonRouteComponentContext(
() => <PendingComponent />,
'pendingComponent',
)
}
return <PendingComponent />
})()
: null
}
>

@@ -58,0 +71,0 @@ <Transitioner />

import { DefaultGlobalNotFound } from './not-found'
import { renderInNonRouteComponentContext } from './nonRouteComponentContext'
import type { AnyRoute, AnyRouter } from '@tanstack/router-core'

@@ -17,2 +18,26 @@

) {
if (process.env.NODE_ENV !== 'production') {
if (!route.options.notFoundComponent) {
if (router.options.defaultNotFoundComponent) {
const DefaultNotFoundComponent = router.options.defaultNotFoundComponent
return renderInNonRouteComponentContext(
() => <DefaultNotFoundComponent {...data} />,
'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 <DefaultGlobalNotFound />
}
const NotFoundComponent = route.options.notFoundComponent
return renderInNonRouteComponentContext(
() => <NotFoundComponent {...data} />,
'notFoundComponent',
)
}
if (!route.options.notFoundComponent) {

@@ -23,10 +48,2 @@ if (router.options.defaultNotFoundComponent) {

if (process.env.NODE_ENV !== 'production') {
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 <DefaultGlobalNotFound />

@@ -33,0 +50,0 @@ }

@@ -11,5 +11,4 @@ import * as Solid from 'solid-js'

* @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

@@ -32,5 +30,4 @@ * )

ref: Solid.Accessor<T | null>,
callback: (entry: IntersectionObserverEntry | undefined) => void,
intersectionObserverOptions: IntersectionObserverInit = {},
disabled?: boolean,
callback: (entry?: IntersectionObserverEntry) => void,
disabled: Solid.Accessor<boolean>,
): Solid.Accessor<IntersectionObserver | null> {

@@ -43,9 +40,13 @@ const isIntersectionObserverAvailable =

const r = ref()
if (!r || !isIntersectionObserverAvailable || disabled) {
if (disabled() || !r || !isIntersectionObserverAvailable) {
Solid.onCleanup(() => callback())
return
}
observerRef = new IntersectionObserver(([entry]) => {
callback(entry)
}, intersectionObserverOptions)
observerRef = new IntersectionObserver(
(entries) => {
callback(entries.pop())
},
{ rootMargin: '100px' },
)

@@ -56,2 +57,3 @@ observerRef.observe(r)

observerRef?.disconnect()
callback()
})

@@ -58,0 +60,0 @@ })