@tanstack/solid-router 2.0.0-beta.15 → 2.0.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/cjs/Asset.cjs.map +1 -1
  2. package/dist/cjs/Asset.d.cts +1 -1
  3. package/dist/cjs/CatchBoundary.cjs.map +1 -1
  4. package/dist/cjs/CatchBoundary.d.cts +4 -3
  5. package/dist/cjs/ClientOnly.cjs.map +1 -1
  6. package/dist/cjs/ClientOnly.d.cts +4 -3
  7. package/dist/cjs/HeadContent.cjs +4 -4
  8. package/dist/cjs/HeadContent.cjs.map +1 -1
  9. package/dist/cjs/HeadContent.d.cts +1 -1
  10. package/dist/cjs/HeadContent.dev.d.cts +1 -1
  11. package/dist/cjs/Match.d.cts +2 -3
  12. package/dist/cjs/Matches.cjs.map +1 -1
  13. package/dist/cjs/Matches.d.cts +8 -7
  14. package/dist/cjs/RouterProvider.cjs.map +1 -1
  15. package/dist/cjs/RouterProvider.d.cts +4 -4
  16. package/dist/cjs/SafeFragment.d.cts +1 -1
  17. package/dist/cjs/ScriptOnce.d.cts +1 -1
  18. package/dist/cjs/Scripts.d.cts +1 -2
  19. package/dist/cjs/awaited.d.cts +1 -2
  20. package/dist/cjs/link.cjs.map +1 -1
  21. package/dist/cjs/link.d.cts +10 -10
  22. package/dist/cjs/not-found.cjs.map +1 -1
  23. package/dist/cjs/not-found.d.cts +5 -5
  24. package/dist/cjs/renderRouteNotFound.d.cts +1 -1
  25. package/dist/cjs/route.cjs.map +1 -1
  26. package/dist/cjs/route.d.cts +5 -5
  27. package/dist/cjs/router.cjs.map +1 -1
  28. package/dist/cjs/router.d.cts +1 -1
  29. package/dist/cjs/scroll-restoration.d.cts +1 -1
  30. package/dist/cjs/ssr/RouterClient.d.cts +1 -1
  31. package/dist/cjs/ssr/RouterServer.d.cts +1 -1
  32. package/dist/cjs/ssr/renderRouterToStream.cjs.map +1 -1
  33. package/dist/cjs/ssr/renderRouterToStream.d.cts +2 -2
  34. package/dist/cjs/ssr/renderRouterToString.cjs.map +1 -1
  35. package/dist/cjs/ssr/renderRouterToString.d.cts +2 -2
  36. package/dist/esm/Asset.d.ts +1 -1
  37. package/dist/esm/Asset.js.map +1 -1
  38. package/dist/esm/CatchBoundary.d.ts +4 -3
  39. package/dist/esm/CatchBoundary.js.map +1 -1
  40. package/dist/esm/ClientOnly.d.ts +4 -3
  41. package/dist/esm/ClientOnly.js.map +1 -1
  42. package/dist/esm/HeadContent.d.ts +1 -1
  43. package/dist/esm/HeadContent.dev.d.ts +1 -1
  44. package/dist/esm/HeadContent.js +5 -5
  45. package/dist/esm/HeadContent.js.map +1 -1
  46. package/dist/esm/Match.d.ts +2 -3
  47. package/dist/esm/Matches.d.ts +8 -7
  48. package/dist/esm/Matches.js.map +1 -1
  49. package/dist/esm/RouterProvider.d.ts +4 -4
  50. package/dist/esm/RouterProvider.js.map +1 -1
  51. package/dist/esm/SafeFragment.d.ts +1 -1
  52. package/dist/esm/ScriptOnce.d.ts +1 -1
  53. package/dist/esm/Scripts.d.ts +1 -2
  54. package/dist/esm/awaited.d.ts +1 -2
  55. package/dist/esm/link.d.ts +10 -10
  56. package/dist/esm/link.js.map +1 -1
  57. package/dist/esm/not-found.d.ts +5 -5
  58. package/dist/esm/not-found.js.map +1 -1
  59. package/dist/esm/renderRouteNotFound.d.ts +1 -1
  60. package/dist/esm/route.d.ts +5 -5
  61. package/dist/esm/route.js.map +1 -1
  62. package/dist/esm/router.d.ts +1 -1
  63. package/dist/esm/router.js.map +1 -1
  64. package/dist/esm/scroll-restoration.d.ts +1 -1
  65. package/dist/esm/ssr/RouterClient.d.ts +1 -1
  66. package/dist/esm/ssr/RouterServer.d.ts +1 -1
  67. package/dist/esm/ssr/renderRouterToStream.d.ts +2 -2
  68. package/dist/esm/ssr/renderRouterToStream.js.map +1 -1
  69. package/dist/esm/ssr/renderRouterToString.d.ts +2 -2
  70. package/dist/esm/ssr/renderRouterToString.js.map +1 -1
  71. package/dist/source/Asset.d.ts +1 -1
  72. package/dist/source/CatchBoundary.d.ts +4 -3
  73. package/dist/source/CatchBoundary.jsx.map +1 -1
  74. package/dist/source/ClientOnly.d.ts +4 -3
  75. package/dist/source/ClientOnly.jsx.map +1 -1
  76. package/dist/source/HeadContent.d.ts +1 -1
  77. package/dist/source/HeadContent.dev.d.ts +1 -1
  78. package/dist/source/HeadContent.jsx +11 -5
  79. package/dist/source/HeadContent.jsx.map +1 -1
  80. package/dist/source/Match.d.ts +2 -3
  81. package/dist/source/Matches.d.ts +8 -7
  82. package/dist/source/Matches.jsx.map +1 -1
  83. package/dist/source/RouterProvider.d.ts +4 -4
  84. package/dist/source/RouterProvider.jsx.map +1 -1
  85. package/dist/source/SafeFragment.d.ts +1 -1
  86. package/dist/source/ScriptOnce.d.ts +1 -1
  87. package/dist/source/Scripts.d.ts +1 -2
  88. package/dist/source/awaited.d.ts +1 -2
  89. package/dist/source/link.d.ts +10 -10
  90. package/dist/source/link.jsx.map +1 -1
  91. package/dist/source/not-found.d.ts +5 -5
  92. package/dist/source/not-found.jsx.map +1 -1
  93. package/dist/source/renderRouteNotFound.d.ts +1 -1
  94. package/dist/source/route.d.ts +5 -5
  95. package/dist/source/route.jsx.map +1 -1
  96. package/dist/source/router.d.ts +1 -1
  97. package/dist/source/scroll-restoration.d.ts +1 -1
  98. package/dist/source/ssr/RouterClient.d.ts +1 -1
  99. package/dist/source/ssr/RouterServer.d.ts +1 -1
  100. package/dist/source/ssr/renderRouterToStream.d.ts +2 -2
  101. package/dist/source/ssr/renderRouterToString.d.ts +2 -2
  102. package/package.json +8 -8
  103. package/src/Asset.tsx +1 -1
  104. package/src/CatchBoundary.tsx +2 -1
  105. package/src/ClientOnly.tsx +3 -2
  106. package/src/HeadContent.tsx +14 -8
  107. package/src/Matches.tsx +8 -7
  108. package/src/RouterProvider.tsx +2 -1
  109. package/src/link.tsx +16 -20
  110. package/src/not-found.tsx +3 -2
  111. package/src/route.tsx +3 -7
  112. package/src/router.ts +1 -1
  113. package/src/ssr/renderRouterToStream.tsx +2 -2
  114. package/src/ssr/renderRouterToString.tsx +2 -2
@@ -1,9 +1,9 @@
1
1
  import { AnyRouter, Constrain, LinkOptions, RegisteredRouter, RoutePaths } from '@tanstack/router-core';
2
2
  import { ValidateLinkOptions, ValidateLinkOptionsArray } from './typePrimitives.cjs';
3
- import * as Solid from 'solid-js';
4
- export declare function useLinkProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string = '', TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = ''>(options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): Solid.ComponentProps<'a'>;
5
- export type UseLinkPropsOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string | undefined = '.', TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = '.'> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & Omit<Solid.ComponentProps<'a'>, 'style'> & {
6
- style?: Solid.JSX.CSSProperties;
3
+ import { ComponentProps, JSX, ValidComponent } from '@solidjs/web';
4
+ export declare function useLinkProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string = '', TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = ''>(options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): ComponentProps<'a'>;
5
+ export type UseLinkPropsOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string | undefined = '.', TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = '.'> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & Omit<ComponentProps<'a'>, 'style'> & {
6
+ style?: JSX.CSSProperties;
7
7
  };
8
8
  export type ActiveLinkOptions<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & ActiveLinkOptionProps<TComp>;
9
9
  type ActiveLinkProps<TComp> = Partial<LinkComponentSolidProps<TComp> & {
@@ -23,20 +23,20 @@ export interface ActiveLinkOptionProps<TComp = 'a'> {
23
23
  }
24
24
  export type LinkProps<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & LinkPropsChildren;
25
25
  export interface LinkPropsChildren {
26
- children?: Solid.JSX.Element | ((state: {
26
+ children?: JSX.Element | ((state: {
27
27
  isActive: boolean;
28
28
  isTransitioning: boolean;
29
- }) => Solid.JSX.Element);
29
+ }) => JSX.Element);
30
30
  }
31
- type LinkComponentSolidProps<TComp> = TComp extends Solid.ValidComponent ? Omit<Solid.ComponentProps<TComp>, keyof CreateLinkProps> : never;
31
+ type LinkComponentSolidProps<TComp> = TComp extends ValidComponent ? Omit<ComponentProps<TComp>, keyof CreateLinkProps> : never;
32
32
  export type LinkComponentProps<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkComponentSolidProps<TComp> & LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
33
33
  export type CreateLinkProps = LinkProps<any, any, string, string, string, string>;
34
- export type LinkComponent<in out TComp, in out TDefaultFrom extends string = string> = <TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = TDefaultFrom, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Solid.JSX.Element;
34
+ export type LinkComponent<in out TComp, in out TDefaultFrom extends string = string> = <TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = TDefaultFrom, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => JSX.Element;
35
35
  export interface LinkComponentRoute<in out TDefaultFrom extends string = string> {
36
36
  defaultFrom: TDefaultFrom;
37
- <TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, const TMaskTo extends string = ''>(props: LinkComponentProps<'a', TRouter, this['defaultFrom'], TTo, this['defaultFrom'], TMaskTo>): Solid.JSX.Element;
37
+ <TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, const TMaskTo extends string = ''>(props: LinkComponentProps<'a', TRouter, this['defaultFrom'], TTo, this['defaultFrom'], TMaskTo>): JSX.Element;
38
38
  }
39
- export declare function createLink<const TComp>(Comp: Constrain<TComp, any, (props: CreateLinkProps) => Solid.JSX.Element>): LinkComponent<TComp>;
39
+ export declare function createLink<const TComp>(Comp: Constrain<TComp, any, (props: CreateLinkProps) => JSX.Element>): LinkComponent<TComp>;
40
40
  export declare const Link: LinkComponent<'a'>;
41
41
  export type LinkOptionsFnOptions<TOptions, TComp, TRouter extends AnyRouter = RegisteredRouter> = TOptions extends ReadonlyArray<any> ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp> : ValidateLinkOptions<TRouter, TOptions, string, TComp>;
42
42
  export type LinkOptionsFn<TComp> = <const TOptions, TRouter extends AnyRouter = RegisteredRouter>(options: LinkOptionsFnOptions<TOptions, TComp, TRouter>) => TOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"not-found.cjs","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","JSX","Element","onCatch","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => Solid.JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: Solid.JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgBK,YACdC,OACoD;AACpD,MAAA,GAAA,sBAAA,YAAeA,MAAM,CACnB,QAAOA;AAGT,MAAA,GAAA,sBAAA,YAAgBA,OAAeC,MAAM,CACnC,QAAQD,MAAcC;;AAM1B,SAAgBE,cAAcC,OAI3B;CACD,MAAMM,SAASb,kBAAAA,WAAW;CAE1B,MAAMc,WAAWhB,SAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASrB,SAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,SAAA,GAAA,aAAA,iBACGnB,sBAAAA,eAAa;EACZsB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDR,UAAUR,UAAU;GAClB,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACFf,OAAMI,UAAUW,cAAc;OAE9B,OAAMnB;;EAGVoB,iBAAiB,EAAEpB,YAAY;GAC7B,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACF,QAAOf,MAAMC,WAAWc,cAAc;OAEtC,OAAMnB;;EAET,IAAAS,WAAA;AAAA,UAEAL,MAAMK;;EAAQ,CAAA;;AAKrB,SAAgBY,wBAAwB;AACtC,QAAAC,QAAA"}
1
+ {"version":3,"file":"not-found.cjs","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","JSX","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","Element","onCatch","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AASA,SAAgBM,YACdC,OACoD;AACpD,MAAA,GAAA,sBAAA,YAAeA,MAAM,CACnB,QAAOA;AAGT,MAAA,GAAA,sBAAA,YAAgBA,OAAeC,MAAM,CACnC,QAAQD,MAAcC;;AAM1B,SAAgBE,cAAcC,OAI3B;CACD,MAAMK,SAASb,kBAAAA,WAAW;CAE1B,MAAMc,WAAWhB,SAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASrB,SAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,SAAA,GAAA,aAAA,iBACGnB,sBAAAA,eAAa;EACZsB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDR,UAAUP,UAAU;GAClB,MAAMkB,gBAAgBnB,YAAYC,MAAM;AAExC,OAAIkB,cACFd,OAAMG,UAAUW,cAAc;OAE9B,OAAMlB;;EAGVmB,iBAAiB,EAAEnB,YAAY;GAC7B,MAAMkB,gBAAgBnB,YAAYC,MAAM;AAExC,OAAIkB,cACF,QAAOd,MAAMC,WAAWa,cAAc;OAEtC,OAAMlB;;EAET,IAAAQ,WAAA;AAAA,UAEAJ,MAAMI;;EAAQ,CAAA;;AAKrB,SAAgBY,wBAAwB;AACtC,QAAAC,QAAA"}
@@ -1,11 +1,11 @@
1
1
  import { NotFoundError } from '@tanstack/router-core';
2
- import * as Solid from 'solid-js';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare function getNotFound(error: unknown): (NotFoundError & {
4
4
  isNotFound: true;
5
5
  }) | undefined;
6
6
  export declare function CatchNotFound(props: {
7
- fallback?: (error: NotFoundError) => Solid.JSX.Element;
7
+ fallback?: (error: NotFoundError) => JSX.Element;
8
8
  onCatch?: (error: NotFoundError) => void;
9
- children: Solid.JSX.Element;
10
- }): Solid.JSX.Element;
11
- export declare function DefaultGlobalNotFound(): Solid.JSX.Element;
9
+ children: JSX.Element;
10
+ }): JSX.Element;
11
+ export declare function DefaultGlobalNotFound(): JSX.Element;
@@ -7,4 +7,4 @@ import { AnyRoute, AnyRouter } from '@tanstack/router-core';
7
7
  * @param data - Additional data to pass to the not found component
8
8
  * @returns The rendered not found component or a default fallback component
9
9
  */
10
- export declare function renderRouteNotFound(router: AnyRouter, route: AnyRoute, data: any): import("solid-js").JSX.Element;
10
+ export declare function renderRouteNotFound(router: AnyRouter, route: AnyRoute, data: any): import("solid-js/web").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"route.cjs","names":["BaseRootRoute","BaseRoute","BaseRouteApi","notFound","Link","useLoaderData","useLoaderDeps","useParams","useSearch","useNavigate","useMatch","useRouteContext","useRouter","AnyContext","AnyRoute","AnyRouter","ConstrainLiteral","ErrorComponentProps","NotFoundError","NotFoundRouteProps","Register","RegisteredRouter","ResolveFullPath","ResolveId","ResolveParams","RootRoute","RootRouteCore","RootRouteId","RootRouteOptions","RouteConstraints","Route","RouteCore","RouteIds","RouteMask","RouteOptions","RouteTypesById","RouterCore","ToMaskOptions","UseNavigateResult","UseLoaderDataRoute","UseMatchRoute","UseLoaderDepsRoute","UseParamsRoute","UseSearchRoute","Solid","UseRouteContextRoute","LinkComponentRoute","UpdatableRouteOptionsExtensions","component","RouteComponent","errorComponent","ErrorRouteComponent","notFoundComponent","NotFoundRouteComponent","pendingComponent","RootRouteOptionsExtensions","shellComponent","children","JSX","Element","RouteExtensions","TId","TFullPath","getRouteApi","id","TRouter","RouteApi","constructor","opts","select","from","strict","router","routesById","fullPath","routeId","props","_$createComponent","_$mergeProps","TParentRoute","TPath","TCustomId","Record","TRegister","TSearchValidator","TParams","TRouterContext","TRouteContextFn","TBeforeLoadFn","TLoaderDeps","TLoaderFn","TChildren","TFileRouteTypes","TSSR","TMiddlewares","THandlers","options","_self$","createRoute","AnyRootRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","_self$2","createRouteMask","routeTree","TRouteTree","TFrom","TTo","SolidNode","DefaultRouteTypes","TProps","RouteTypes","AsyncRouteComponent","preload","Promise","NotFoundRoute","Omit"],"sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type * as Solid from 'solid-js'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | undefined | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({\n children,\n }: {\n children: Solid.JSX.Element\n }) => Solid.JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id as any }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TRegister = unknown,\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n TMiddlewares,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TRegister = unknown,\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = Solid.JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TRegister,\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;;AAiFA,SAAgB+D,YAGdC,IAA2D;AAC3D,QAAO,IAAIE,SAAuB,EAAEF,IAAI,CAAC;;AAG3C,IAAaE,WAAb,cAGUhE,sBAAAA,aAA2B;;;;CAInCiE,YAAY,EAAEH,MAAmB;AAC/B,QAAM,EAAEA,IAAI,CAAC;mBAGiBI,SAAS;AACvC,UAAO1D,iBAAAA,SAAS;IACd2D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;0BAGmCI,SAAS;AACrD,UAAOzD,wBAAAA,gBAAgB;IAAE,GAAIyD;IAAcE,MAAM,KAAKN;IAAW,CAA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AKN;IAAI,CAAQ;;wBAGPI,SAAS;AACzD,UAAO/D,sBAAAA,cAAc;IAAE,GAAG+D;IAAME,MAAM,KAAKN;IAAI,CAAQ;;2BAGb;AAC1C,UAAOvD,oBAAAA,YAAY,EAAE6D,MAAM,KAAKI,UAAU,CAAC;;gBAGXE,UAAU;GAAA,MAAA2B,UAAA;AAC1C,WAAA,GAAA,aAAA,iBAAQnG,aAAAA,OAAAA,GAAAA,aAAAA,YAAI,EAAA,IAACkE,OAAI;AAAA,WAAEiC,QAAK7B;MAAQ,EAAOE,MAAY,CAAA;;;;AAIvD,SAAgB4B,gBAKdpC,MAGuB;AACvB,QAAOA;;AAoBT,IAAagD,gBAAb,cAYUtF,MAiBR;CACAqC,YACE6B,SAyBA;AACA,QAAM;GACJ,GAAIA;GACJhC,IAAI;GACL,CAAC;;;AAIN,SAAgBqC,gBAWdL,SAuBA;AACA,QAAO,IAAIvE,UAYTuE,QAAQ"}
1
+ {"version":3,"file":"route.cjs","names":["BaseRootRoute","BaseRoute","BaseRouteApi","notFound","Link","useLoaderData","useLoaderDeps","useParams","useSearch","useNavigate","useMatch","useRouteContext","useRouter","AnyContext","AnyRoute","AnyRouter","ConstrainLiteral","ErrorComponentProps","NotFoundError","NotFoundRouteProps","Register","RegisteredRouter","ResolveFullPath","ResolveId","ResolveParams","RootRoute","RootRouteCore","RootRouteId","RootRouteOptions","RouteConstraints","Route","RouteCore","RouteIds","RouteMask","RouteOptions","RouteTypesById","RouterCore","ToMaskOptions","UseNavigateResult","UseLoaderDataRoute","UseMatchRoute","UseLoaderDepsRoute","UseParamsRoute","UseSearchRoute","UseRouteContextRoute","LinkComponentRoute","JSX","UpdatableRouteOptionsExtensions","component","RouteComponent","errorComponent","ErrorRouteComponent","notFoundComponent","NotFoundRouteComponent","pendingComponent","RootRouteOptionsExtensions","shellComponent","children","Element","RouteExtensions","TId","TFullPath","getRouteApi","id","TRouter","RouteApi","constructor","opts","select","from","strict","router","routesById","fullPath","routeId","props","_$createComponent","_$mergeProps","TParentRoute","TPath","TCustomId","Record","TRegister","TSearchValidator","TParams","TRouterContext","TRouteContextFn","TBeforeLoadFn","TLoaderDeps","TLoaderFn","TChildren","TFileRouteTypes","TSSR","TMiddlewares","THandlers","options","_self$","createRoute","AnyRootRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","_self$2","createRouteMask","routeTree","TRouteTree","TFrom","TTo","SolidNode","DefaultRouteTypes","TProps","RouteTypes","AsyncRouteComponent","preload","Promise","NotFoundRoute","Omit"],"sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\nimport type { JSX } from '@solidjs/web'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | undefined | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({ children }: { children: JSX.Element }) => JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id as any }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TRegister = unknown,\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n TMiddlewares,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TRegister = unknown,\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TRegister,\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;;AA6EA,SAAgB8D,YAGdC,IAA2D;AAC3D,QAAO,IAAIE,SAAuB,EAAEF,IAAI,CAAC;;AAG3C,IAAaE,WAAb,cAGU/D,sBAAAA,aAA2B;;;;CAInCgE,YAAY,EAAEH,MAAmB;AAC/B,QAAM,EAAEA,IAAI,CAAC;mBAGiBI,SAAS;AACvC,UAAOzD,iBAAAA,SAAS;IACd0D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;0BAGmCI,SAAS;AACrD,UAAOxD,wBAAAA,gBAAgB;IAAE,GAAIwD;IAAcE,MAAM,KAAKN;IAAW,CAAC;;oBAGlCI,SAAS;AACzC,UAAO3D,kBAAAA,UAAU;IACf4D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;oBAGuBI,SAAS;AACzC,UAAO5D,kBAAAA,UAAU;IACf6D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;IACZ,CAAQ;;wBAG+BI,SAAS;AACjD,UAAO7D,sBAAAA,cAAc;IAAE,GAAG6D;IAAME,MAAM,KAAKN;IAAIO,QAAQ;IAAO,CA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I;AAAA,WAAEiC,QAAK7B;MAAQ,EAAOE,MAAY,CAAA;;;;AAIvD,SAAgB4B,gBAKdpC,MAGuB;AACvB,QAAOA;;AAoBT,IAAagD,gBAAb,cAYUrF,MAiBR;CACAoC,YACE6B,SAyBA;AACA,QAAM;GACJ,GAAIA;GACJhC,IAAI;GACL,CAAC;;;AAIN,SAAgBqC,gBAWdL,SAuBA;AACA,QAAO,IAAItE,UAYTsE,QAAQ"}
@@ -6,7 +6,7 @@ import { UseParamsRoute } from './useParams.cjs';
6
6
  import { UseSearchRoute } from './useSearch.cjs';
7
7
  import { UseRouteContextRoute } from './useRouteContext.cjs';
8
8
  import { LinkComponentRoute } from './link.cjs';
9
- import type * as Solid from 'solid-js';
9
+ import { JSX } from '@solidjs/web';
10
10
  declare module '@tanstack/router-core' {
11
11
  interface UpdatableRouteOptionsExtensions {
12
12
  component?: RouteComponent;
@@ -15,9 +15,9 @@ declare module '@tanstack/router-core' {
15
15
  pendingComponent?: RouteComponent;
16
16
  }
17
17
  interface RootRouteOptionsExtensions {
18
- shellComponent?: ({ children, }: {
19
- children: Solid.JSX.Element;
20
- }) => Solid.JSX.Element;
18
+ shellComponent?: ({ children }: {
19
+ children: JSX.Element;
20
+ }) => JSX.Element;
21
21
  }
22
22
  interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
23
23
  useMatch: UseMatchRoute<TId>;
@@ -86,7 +86,7 @@ export declare class RootRoute<in out TRegister = Register, in out TSearchValida
86
86
  export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends string, TTo extends string>(opts: {
87
87
  routeTree: TRouteTree;
88
88
  } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>): RouteMask<TRouteTree>;
89
- export type SolidNode = Solid.JSX.Element;
89
+ export type SolidNode = JSX.Element;
90
90
  export interface DefaultRouteTypes<TProps> {
91
91
  component: (props: TProps) => any;
92
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs","names":[],"sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { getStoreFactory } from './routerStores'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from 'solid-js'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n >,\n ) {\n super(options, getStoreFactory)\n }\n}\n"],"mappings":";;;;AA2EA,IAAa,gBAAgC,YAAY;AACvD,QAAO,IAAI,OAAO,QAAQ;;AAG5B,IAAa,SAAb,cAMU,sBAAA,WAMR;CACA,YACE,SAOA;AACA,QAAM,SAAS,qBAAA,gBAAgB"}
1
+ {"version":3,"file":"router.cjs","names":[],"sources":["../../src/router.ts"],"sourcesContent":["import { RouterCore } from '@tanstack/router-core'\nimport { getStoreFactory } from './routerStores'\nimport type { RouterHistory } from '@tanstack/history'\nimport type {\n AnyRoute,\n CreateRouterFn,\n RouterConstructorOptions,\n TrailingSlashOption,\n} from '@tanstack/router-core'\nimport type {\n ErrorRouteComponent,\n NotFoundRouteComponent,\n RouteComponent,\n} from './route'\nimport type { JSX } from '@solidjs/web'\n\ndeclare module '@tanstack/router-core' {\n export interface RouterOptionsExtensions {\n /**\n * The default `component` a route should use if no component is provided.\n *\n * @default Outlet\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultcomponent-property)\n */\n defaultComponent?: RouteComponent\n /**\n * The default `errorComponent` a route should use if no error component is provided.\n *\n * @default ErrorComponent\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaulterrorcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)\n */\n defaultErrorComponent?: ErrorRouteComponent\n /**\n * The default `pendingComponent` a route should use if no pending component is provided.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultpendingcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/data-loading#showing-a-pending-component)\n */\n defaultPendingComponent?: RouteComponent\n /**\n * The default `notFoundComponent` a route should use if no notFound component is provided.\n *\n * @default NotFound\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#defaultnotfoundcomponent-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/solid/guide/not-found-errors#default-router-wide-not-found-handling)\n */\n defaultNotFoundComponent?: NotFoundRouteComponent\n /**\n * A component that will be used to wrap the entire router.\n *\n * This is useful for providing a context to the entire router.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#wrap-property)\n */\n Wrap?: (props: { children: any }) => JSX.Element\n /**\n * A component that will be used to wrap the inner contents of the router.\n *\n * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/solid/api/router/RouterOptionsType#innerwrap-property)\n */\n InnerWrap?: (props: { children: any }) => JSX.Element\n\n /**\n * The default `onCatch` handler for errors caught by the Router ErrorBoundary\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)\n * @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)\n */\n defaultOnCatch?: (error: Error) => void\n }\n}\n\nexport const createRouter: CreateRouterFn = (options) => {\n return new Router(options)\n}\n\nexport class Router<\n in out TRouteTree extends AnyRoute,\n in out TTrailingSlashOption extends TrailingSlashOption = 'never',\n in out TDefaultStructuralSharingOption extends boolean = false,\n in out TRouterHistory extends RouterHistory = RouterHistory,\n in out TDehydrated extends Record<string, any> = Record<string, any>,\n> extends RouterCore<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n> {\n constructor(\n options: RouterConstructorOptions<\n TRouteTree,\n TTrailingSlashOption,\n TDefaultStructuralSharingOption,\n TRouterHistory,\n TDehydrated\n >,\n ) {\n super(options, getStoreFactory)\n }\n}\n"],"mappings":";;;;AA2EA,IAAa,gBAAgC,YAAY;AACvD,QAAO,IAAI,OAAO,QAAQ;;AAG5B,IAAa,SAAb,cAMU,sBAAA,WAMR;CACA,YACE,SAOA;AACA,QAAM,SAAS,qBAAA,gBAAgB"}
@@ -1,7 +1,7 @@
1
1
  import { RouterCore, AnyRoute, CreateRouterFn, RouterConstructorOptions, TrailingSlashOption } from '@tanstack/router-core';
2
2
  import { RouterHistory } from '@tanstack/history';
3
3
  import { ErrorRouteComponent, NotFoundRouteComponent, RouteComponent } from './route.cjs';
4
- import { JSX } from 'solid-js';
4
+ import { JSX } from '@solidjs/web';
5
5
  declare module '@tanstack/router-core' {
6
6
  interface RouterOptionsExtensions {
7
7
  /**
@@ -1 +1 @@
1
- export declare function ScrollRestoration(): import("solid-js").JSX.Element;
1
+ export declare function ScrollRestoration(): import("solid-js/web").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { AnyRouter } from '@tanstack/router-core';
2
2
  export declare function RouterClient(props: {
3
3
  router: AnyRouter;
4
- }): import("solid-js").JSX.Element;
4
+ }): import("solid-js/web").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { AnyRouter } from '@tanstack/router-core';
2
2
  export declare function RouterServer<TRouter extends AnyRouter>(props: {
3
3
  router: TRouter;
4
- }): import("solid-js").JSX.Element;
4
+ }): import("solid-js/web").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"renderRouterToStream.cjs","names":["Solid","isbot","transformReadableStreamWithRouter","makeSsrSerovalPlugin","JSXElement","ReadableStream","AnyRouter","renderRouterToStream","request","router","responseHeaders","children","Request","Headers","writable","readable","TransformStream","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","stream","renderToStream","nonce","plugins","headers","get","pipeTo","responseStream","Response","status","stores","statusCode","state"],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { JSXElement } from 'solid-js'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSXElement\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n\n if (isbot(request.headers.get('User-Agent'))) {\n await stream\n }\n stream.pipeTo(writable)\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n )\n return new Response(responseStream as any, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n}\n"],"mappings":";;;;;;;AAQA,IAAaO,uBAAuB,OAAO,EACzCC,SACAC,QACAC,iBACAC,eAMI;CACJ,MAAM,EAAEG,UAAUC,aAAa,IAAIC,iBAAiB;CAKpD,MAAMI,kBAFHX,OAAOS,SAAiBD,yBACxBR,OAAOS,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,UAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;GAE/D;CAEF,MAAMC,SAASzB,aAAM0B,qBAAqBf,UAAU;EAClDgB,OAAOlB,OAAOS,QAAQC,KAAKQ;EAC3BC,SAASR;EACV,CAAQ;AAET,MAAA,GAAA,MAAA,OAAUZ,QAAQqB,QAAQC,IAAI,aAAa,CAAC,CAC1C,OAAML;AAERA,QAAOM,OAAOjB,SAAS;CAEvB,MAAMkB,kBAAAA,GAAAA,iCAAAA,mCACJvB,QACAM,SACD;AACD,QAAO,IAAIkB,SAASD,gBAAuB;EACzCE,QAAQzB,OAAO0B,OAAOC,WAAWC;EACjCR,SAASnB;EACV,CAAC"}
1
+ {"version":3,"file":"renderRouterToStream.cjs","names":["Solid","isbot","transformReadableStreamWithRouter","makeSsrSerovalPlugin","ReadableStream","AnyRouter","JSX","renderRouterToStream","request","router","responseHeaders","children","Request","Headers","Element","writable","readable","TransformStream","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","stream","renderToStream","nonce","plugins","headers","get","pipeTo","responseStream","Response","status","stores","statusCode","state"],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n\n if (isbot(request.headers.get('User-Agent'))) {\n await stream\n }\n stream.pipeTo(writable)\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n )\n return new Response(responseStream as any, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n}\n"],"mappings":";;;;;;;AAQA,IAAaO,uBAAuB,OAAO,EACzCC,SACAC,QACAC,iBACAC,eAMI;CACJ,MAAM,EAAEI,UAAUC,aAAa,IAAIC,iBAAiB;CAKpD,MAAMI,kBAFHZ,OAAOU,SAAiBD,yBACxBT,OAAOU,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,UAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;GAE/D;CAEF,MAAMC,SAAS1B,aAAM2B,qBAAqBhB,UAAU;EAClDiB,OAAOnB,OAAOU,QAAQC,KAAKQ;EAC3BC,SAASR;EACV,CAAQ;AAET,MAAA,GAAA,MAAA,OAAUb,QAAQsB,QAAQC,IAAI,aAAa,CAAC,CAC1C,OAAML;AAERA,QAAOM,OAAOjB,SAAS;CAEvB,MAAMkB,kBAAAA,GAAAA,iCAAAA,mCACJxB,QACAO,SACD;AACD,QAAO,IAAIkB,SAASD,gBAAuB;EACzCE,QAAQ1B,OAAO2B,OAAOC,WAAWC;EACjCR,SAASpB;EACV,CAAC"}
@@ -1,8 +1,8 @@
1
- import { JSXElement } from 'solid-js';
2
1
  import { AnyRouter } from '@tanstack/router-core';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare const renderRouterToStream: ({ request, router, responseHeaders, children, }: {
4
4
  request: Request;
5
5
  router: AnyRouter;
6
6
  responseHeaders: Headers;
7
- children: () => JSXElement;
7
+ children: () => JSX.Element;
8
8
  }) => Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"renderRouterToString.cjs","names":["Solid","makeSsrSerovalPlugin","AnyRouter","JSXElement","renderRouterToString","router","responseHeaders","children","Headers","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","html","renderToString","nonce","plugins","serverSsr","setRenderFinished","injectedHtml","takeBufferedHtml","replace","Response","status","stores","statusCode","state","headers","error","console","cleanup"],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSXElement } from 'solid-js'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSXElement\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;;;AAKA,IAAaI,wBAAwB,EACnCC,QACAC,iBACAC,eAKI;AACJ,KAAI;EAIF,MAAMK,kBAFHP,OAAOK,SAAiBD,yBACxBJ,OAAOK,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,WAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;IAE/D;EAEF,IAAIC,OAAOjB,aAAMkB,eAAeX,UAAU;GACxCY,OAAOd,OAAOK,QAAQC,KAAKQ;GAC3BC,SAASR;GACV,CAAQ;AACTP,SAAOgB,UAAWC,mBAAmB;EAErC,MAAMC,eAAelB,OAAOgB,UAAWG,kBAAkB;AACzD,MAAID,aACFN,QAAOA,KAAKQ,QAAQ,iBAAiB,GAAGF,aAAY,SAAU;AAEhE,SAAO,IAAIG,SAAS,kBAAkBT,QAAQ;GAC5CU,QAAQtB,OAAOuB,OAAOC,WAAWC;GACjCC,SAASzB;GACV,CAAC;UACK0B,OAAO;AACdC,UAAQD,MAAM,2BAA2BA,MAAM;AAC/C,SAAO,IAAIN,SAAS,yBAAyB;GAC3CC,QAAQ;GACRI,SAASzB;GACV,CAAC;WACM;AACRD,SAAOgB,WAAWa,SAAS"}
1
+ {"version":3,"file":"renderRouterToString.cjs","names":["Solid","makeSsrSerovalPlugin","AnyRouter","JSX","renderRouterToString","router","responseHeaders","children","Headers","Element","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","html","renderToString","nonce","plugins","serverSsr","setRenderFinished","injectedHtml","takeBufferedHtml","replace","Response","status","stores","statusCode","state","headers","error","console","cleanup"],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.state,\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;;;AAKA,IAAaI,wBAAwB,EACnCC,QACAC,iBACAC,eAKI;AACJ,KAAI;EAIF,MAAMM,kBAFHR,OAAOM,SAAiBD,yBACxBL,OAAOM,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;AAElE,WAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,OAAO,CAAC;IAE/D;EAEF,IAAIC,OAAOlB,aAAMmB,eAAeZ,UAAU;GACxCa,OAAOf,OAAOM,QAAQC,KAAKQ;GAC3BC,SAASR;GACV,CAAQ;AACTR,SAAOiB,UAAWC,mBAAmB;EAErC,MAAMC,eAAenB,OAAOiB,UAAWG,kBAAkB;AACzD,MAAID,aACFN,QAAOA,KAAKQ,QAAQ,iBAAiB,GAAGF,aAAY,SAAU;AAEhE,SAAO,IAAIG,SAAS,kBAAkBT,QAAQ;GAC5CU,QAAQvB,OAAOwB,OAAOC,WAAWC;GACjCC,SAAS1B;GACV,CAAC;UACK2B,OAAO;AACdC,UAAQD,MAAM,2BAA2BA,MAAM;AAC/C,SAAO,IAAIN,SAAS,yBAAyB;GAC3CC,QAAQ;GACRI,SAAS1B;GACV,CAAC;WACM;AACRD,SAAOiB,WAAWa,SAAS"}
@@ -1,7 +1,7 @@
1
1
  import { AnyRouter } from '@tanstack/router-core';
2
- import { JSXElement } from 'solid-js';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare const renderRouterToString: ({ router, responseHeaders, children, }: {
4
4
  router: AnyRouter;
5
5
  responseHeaders: Headers;
6
- children: () => JSXElement;
6
+ children: () => JSX.Element;
7
7
  }) => Response;
@@ -1,3 +1,3 @@
1
1
  import { RouterManagedTag } from '@tanstack/router-core';
2
- import { JSX } from 'solid-js';
2
+ import { JSX } from '@solidjs/web';
3
3
  export declare function Asset({ tag, attrs, children, }: RouterManagedTag): JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"Asset.js","names":["isServer","createEffect","useRouter","RouterManagedTag","JSX","Asset","tag","attrs","children","Element","_$createComponent","Title","_el$","_tmpl$","_$spread","_el$2","_tmpl$2","_el$3","_tmpl$3","_$mergeProps","_el$4","Script","props","Record","router","_el$5","_tmpl$4","_$insert","titleText","document","title","_el$6","dataScript","type","src","_el$7","_tmpl$5","_el$8","_el$9","const","script","HTMLScriptElement","normSrc","base","baseURI","window","location","href","URL","existingScript","Array","from","querySelectorAll","find","el","createElement","key","value","Object","entries","undefined","setAttribute","String","head","appendChild","typeAttr","nonceAttr","nonce","sType","getAttribute","sNonce","textContent","parentNode","removeChild"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from 'solid-js'\n\nexport function Asset({\n tag,\n attrs,\n children,\n}: RouterManagedTag): JSX.Element | null {\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <meta {...attrs} />\n case 'link':\n return <link {...attrs} />\n case 'style':\n if (typeof children === 'string') {\n return <style {...attrs} innerHTML={children} />\n }\n return <style {...attrs} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n // Server: render <title> normally\n if (isServer ?? router.isServer) {\n return <title {...attrs}>{children as string}</title>\n }\n\n // Client: imperatively set document.title so it updates during\n // client-side navigation (JSX <title> in <head> doesn't reliably\n // update the browser's document.title).\n createEffect(\n () => children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n // Still render the <title> element in the DOM for consistency,\n // but the imperative assignment above is what actually drives the update.\n return <title {...attrs}>{children as string}</title>\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;AAMA,SAAgBK,MAAM,EACpBC,KACAC,OACAC,YACuC;AACvC,SAAQF,KAAR;EACE,KAAK,QACH,QAAAI,gBAAQC,OAAK;GAAQJ;GAAiBC;GAAQ,CAAA;EAChD,KAAK,OACH,eAAA;GAAA,IAAAI,OAAAC,QAAA;AAAAC,UAAAF,MAAiBL,OAAK,MAAA;AAAA,UAAAK;MAAA;EACxB,KAAK,OACH,eAAA;GAAA,IAAAG,QAAAC,SAAA;AAAAF,UAAAC,OAAiBR,OAAK,MAAA;AAAA,UAAAQ;MAAA;EACxB,KAAK;AACH,OAAI,OAAOP,aAAa,SACtB,eAAA;IAAA,IAAAS,QAAAC,SAAA;AAAAJ,WAAAG,OAAAE,WAAkBZ,OAAK,EAAA,aAAaC,UAAQ,CAAA,EAAA,MAAA;AAAA,WAAAS;O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AAIT,KAAAA;AAC3C,WACEN,GAAGiB,gBAAgB/D,YACnB4D,UAAUH,YACVK,WAAWJ;KAEb,CAGA;AAGF1B,YAASX,SAAS0B,cAAc,SAAS;AACzCf,UAAO+B,cAAc/D;AAErB,OAAID;SACG,MAAM,CAACiD,KAAKC,UAAUC,OAAOC,QAAQpD,MAAM,CAC9C,KAAIkD,UAAUG,KAAAA,KAAaH,UAAU,MACnCjB,QAAOqB,aACLL,KACA,OAAOC,UAAU,YAAY,KAAKK,OAAOL,MAC3C,CAAC;;AAKP5B,YAASkC,KAAKC,YAAYxB,OAAO;;AAGnC,eAAa;AACX,OAAIA,QAAQgC,WACVhC,QAAOgC,WAAWC,YAAYjC,OAAO;;GAI5C;AAED,QAAO"}
1
+ {"version":3,"file":"Asset.js","names":["isServer","createEffect","useRouter","RouterManagedTag","JSX","Asset","tag","attrs","children","Element","_$createComponent","Title","_el$","_tmpl$","_$spread","_el$2","_tmpl$2","_el$3","_tmpl$3","_$mergeProps","_el$4","Script","props","Record","router","_el$5","_tmpl$4","_$insert","titleText","document","title","_el$6","dataScript","type","src","_el$7","_tmpl$5","_el$8","_el$9","const","script","HTMLScriptElement","normSrc","base","baseURI","window","location","href","URL","existingScript","Array","from","querySelectorAll","find","el","createElement","key","value","Object","entries","undefined","setAttribute","String","head","appendChild","typeAttr","nonceAttr","nonce","sType","getAttribute","sNonce","textContent","parentNode","removeChild"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport function Asset({\n tag,\n attrs,\n children,\n}: RouterManagedTag): JSX.Element | null {\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <meta {...attrs} />\n case 'link':\n return <link {...attrs} />\n case 'style':\n if (typeof children === 'string') {\n return <style {...attrs} innerHTML={children} />\n }\n return <style {...attrs} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n // Server: render <title> normally\n if (isServer ?? router.isServer) {\n return <title {...attrs}>{children as string}</title>\n }\n\n // Client: imperatively set document.title so it updates during\n // client-side navigation (JSX <title> in <head> doesn't reliably\n // update the browser's document.title).\n createEffect(\n () => children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n // Still render the <title> element in the DOM for consistency,\n // but the imperative assignment above is what actually drives the update.\n return <title {...attrs}>{children as string}</title>\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;AAMA,SAAgBK,MAAM,EACpBC,KACAC,OACAC,YACuC;AACvC,SAAQF,KAAR;EACE,KAAK,QACH,QAAAI,gBAAQC,OAAK;GAAQJ;GAAiBC;GAAQ,CAAA;EAChD,KAAK,OACH,eAAA;GAAA,IAAAI,OAAAC,QAAA;AAAAC,UAAAF,MAAiBL,OAAK,MAAA;AAAA,UAAAK;MAAA;EACxB,KAAK,OACH,eAAA;GAAA,IAAAG,QAAAC,SAAA;AAAAF,UAAAC,OAAiBR,OAAK,MAAA;AAAA,UAAAQ;MAAA;EACxB,KAAK;AACH,OAAI,OAAOP,aAAa,SACtB,eAAA;IAAA,IAAAS,QAAAC,SAAA;AAAAJ,WAAAG,OAAAE,WAAkBZ,OAAK,EAAA,aAAaC,UAAQ,CAAA,EAAA,MAAA;AAAA,WAAAS;OAAA;AAE9C,iBAAA;I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WACEN,GAAGiB,gBAAgB/D,YACnB4D,UAAUH,YACVK,WAAWJ;KAEb,CAGA;AAGF1B,YAASX,SAAS0B,cAAc,SAAS;AACzCf,UAAO+B,cAAc/D;AAErB,OAAID;SACG,MAAM,CAACiD,KAAKC,UAAUC,OAAOC,QAAQpD,MAAM,CAC9C,KAAIkD,UAAUG,KAAAA,KAAaH,UAAU,MACnCjB,QAAOqB,aACLL,KACA,OAAOC,UAAU,YAAY,KAAKK,OAAOL,MAC3C,CAAC;;AAKP5B,YAASkC,KAAKC,YAAYxB,OAAO;;AAGnC,eAAa;AACX,OAAIA,QAAQgC,WACVhC,QAAOgC,WAAWC,YAAYjC,OAAO;;GAI5C;AAED,QAAO"}
@@ -1,11 +1,12 @@
1
1
  import { ErrorRouteComponent } from './route.js';
2
+ import { JSX } from '@solidjs/web';
2
3
  import * as Solid from 'solid-js';
3
4
  export declare function CatchBoundary(props: {
4
5
  getResetKey: () => number | string;
5
- children: Solid.JSX.Element;
6
+ children: JSX.Element;
6
7
  errorComponent?: ErrorRouteComponent;
7
8
  onCatch?: (error: Error) => void;
8
- } & Solid.ParentProps): Solid.JSX.Element;
9
+ } & Solid.ParentProps): JSX.Element;
9
10
  export declare function ErrorComponent({ error }: {
10
11
  error: any;
11
- }): Solid.JSX.Element;
12
+ }): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"CatchBoundary.js","names":["Solid","Dynamic","ErrorRouteComponent","CatchBoundary","props","getResetKey","children","JSX","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","Errored","fallback","reset","createEffect","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","$$click","d","_$insert","_c$","_$memo","_el$7","_tmpl$2","_el$8","_c$2","message","_el$9","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: Solid.JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\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.Errored>\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;AACA,QAAAU,gBACGd,MAAMe,SAAO;EACZC,WAAWL,OAAOM,UAAU;AAC1Bb,SAAMM,UAAUC,MAAM;AAEtBX,SAAMkB,aAAad,MAAMC,mBAAmB;AAG1CY,WAAO;KACP;AAEF,UAAAH,gBACGb,SAAO;IAAA,IACNkB,YAAS;AAAA,YAAEf,MAAMK,kBAAkBW;;IAC5BT;IACAM;IAAK,CAAA;;EAGjB,IAAAX,WAAA;AAAA,UAEAF,MAAME;;EAAQ,CAAA;;AAKrB,SAAgBc,eAAe,EAAET,SAAyB;CACxD,MAAM,CAACU,MAAMC,WAAWtB,MAAMuB,aAAAA,QAAAA,IAAAA,aACH,aAC1B;AAED,eAAA;EAAA,IAAAI,OAAAC,QAAA,EAAAC,QAAAF,KAAAG,YAAAI,QAAAL,MAAAC,WAAAG,YAAAA;AAAAJ,QAAAI;AAAAC,QAAAE,gBAauBd,SAASe,MAAM,CAACA,EAAE;AAAAC,SAAAJ,aAEhCb,MAAM,GAAG,eAAe,aAAY;AAAAiB,SAAAX,aAAA;GAAA,IAAAY,MAAAC,WAAA,CAAA,CAIxCnB,MAAM,CAAA;AAAA,gBAANkB,KAAA,UAAA;IAAA,IAAAE,QAAAC,SAAA,EAAAC,QAAAF,MAAAX;AAAAQ,WAAAK,cAAA;KAAA,IAAAC,OAAAJ,WAAA,CAAA,CAYM7B,MAAMkC,QAAO;AAAA,kBAAbD,MAAA,UAAA;MAAA,IAAAE,QAAAC,SAAA;AAAAT,aAAAQ,aAAuBnC,MAAMkC,QAAO;AAAA,aAAAC;SAAA,GAAW;QAAI,CAAA;AAAA,WAAAL;OAAA,GAGtD;MAAI,EAAA,KAAA;AAAA,SAAAd;KAAA;;AAGbqB,eAAA,CAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"CatchBoundary.js","names":["Solid","Dynamic","ErrorRouteComponent","JSX","CatchBoundary","props","getResetKey","children","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","Errored","fallback","reset","createEffect","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","$$click","d","_$insert","_c$","_$memo","_el$7","_tmpl$2","_el$8","_c$2","message","_el$9","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\nimport type { JSX } from '@solidjs/web'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n props.onCatch?.(error)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\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.Errored>\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;AACA,QAAAS,gBACGd,MAAMe,SAAO;EACZC,WAAWL,OAAOM,UAAU;AAC1BZ,SAAMK,UAAUC,MAAM;AAEtBX,SAAMkB,aAAab,MAAMC,mBAAmB;AAG1CW,WAAO;KACP;AAEF,UAAAH,gBACGb,SAAO;IAAA,IACNkB,YAAS;AAAA,YAAEd,MAAMI,kBAAkBW;;IAC5BT;IACAM;IAAK,CAAA;;EAGjB,IAAAV,WAAA;AAAA,UAEAF,MAAME;;EAAQ,CAAA;;AAKrB,SAAgBa,eAAe,EAAET,SAAyB;CACxD,MAAM,CAACU,MAAMC,WAAWtB,MAAMuB,aAAAA,QAAAA,IAAAA,aACH,aAC1B;AAED,eAAA;EAAA,IAAAI,OAAAC,QAAA,EAAAC,QAAAF,KAAAG,YAAAI,QAAAL,MAAAC,WAAAG,YAAAA;AAAAJ,QAAAI;AAAAC,QAAAE,gBAauBd,SAASe,MAAM,CAACA,EAAE;AAAAC,SAAAJ,aAEhCb,MAAM,GAAG,eAAe,aAAY;AAAAiB,SAAAX,aAAA;GAAA,IAAAY,MAAAC,WAAA,CAAA,CAIxCnB,MAAM,CAAA;AAAA,gBAANkB,KAAA,UAAA;IAAA,IAAAE,QAAAC,SAAA,EAAAC,QAAAF,MAAAX;AAAAQ,WAAAK,cAAA;KAAA,IAAAC,OAAAJ,WAAA,CAAA,CAYM7B,MAAMkC,QAAO;AAAA,kBAAbD,MAAA,UAAA;MAAA,IAAAE,QAAAC,SAAA;AAAAT,aAAAQ,aAAuBnC,MAAMkC,QAAO;AAAA,aAAAC;SAAA,GAAW;QAAI,CAAA;AAAA,WAAAL;OAAA,GAGtD;MAAI,EAAA,KAAA;AAAA,SAAAd;KAAA;;AAGbqB,eAAA,CAAA,QAAA,CAAA"}
@@ -1,13 +1,14 @@
1
+ import { JSX } from '@solidjs/web';
1
2
  import * as Solid from 'solid-js';
2
3
  export interface ClientOnlyProps {
3
4
  /**
4
5
  * The children to render when the JS is loaded.
5
6
  */
6
- children: Solid.JSX.Element;
7
+ children: JSX.Element;
7
8
  /**
8
9
  * The fallback component to render if the JS is not yet loaded.
9
10
  */
10
- fallback?: Solid.JSX.Element;
11
+ fallback?: JSX.Element;
11
12
  }
12
13
  /**
13
14
  * Render the children only after the JS has loaded client-side. Use an optional
@@ -26,7 +27,7 @@ export interface ClientOnlyProps {
26
27
  * )
27
28
  * ```
28
29
  */
29
- export declare function ClientOnly(props: ClientOnlyProps): Solid.JSX.Element;
30
+ export declare function ClientOnly(props: ClientOnlyProps): JSX.Element;
30
31
  /**
31
32
  * Return a boolean indicating if the JS has been hydrated already.
32
33
  * When doing Server-Side Rendering, the result will always be false.
@@ -1 +1 @@
1
- {"version":3,"file":"ClientOnly.js","names":["Solid","ClientOnlyProps","children","JSX","Element","fallback","ClientOnly","props","hydrated","useHydrated","_$createComponent","Show","when","_$memo","Accessor","setHydrated","createSignal","createEffect"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: Solid.JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: Solid.JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n <>{props.children}</>\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(false)\n\n Solid.createEffect(\n () => true,\n () => {\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8BA,SAAgBM,WAAWC,OAAwB;CACjD,MAAMC,WAAWC,aAAa;AAC9B,QAAAC,gBACGV,MAAMW,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEJ,UAAU;;EAAA,IAAEH,WAAQ;AAAA,UAAEE,MAAMF,YAAY;;EAAI,IAAAH,WAAA;AAAA,UAAAW,WACzDN,MAAML,SAAQ;;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;AAwBvB,SAAgBO,cAAuC;CACrD,MAAM,CAACD,UAAUO,eAAef,MAAMgB,aAAa,MAAM;AAEzDhB,OAAMiB,mBACE,YACA;AACJF,cAAY,KAAK;GAEpB;AAED,QAAOP"}
1
+ {"version":3,"file":"ClientOnly.js","names":["Solid","JSX","ClientOnlyProps","children","Element","fallback","ClientOnly","props","hydrated","useHydrated","_$createComponent","Show","when","_$memo","Accessor","setHydrated","createSignal","createEffect"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { JSX } from '@solidjs/web'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n <>{props.children}</>\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(false)\n\n Solid.createEffect(\n () => true,\n () => {\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,SAAgBM,WAAWC,OAAwB;CACjD,MAAMC,WAAWC,aAAa;AAC9B,QAAAC,gBACGV,MAAMW,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEJ,UAAU;;EAAA,IAAEH,WAAQ;AAAA,UAAEE,MAAMF,YAAY;;EAAI,IAAAF,WAAA;AAAA,UAAAU,WACzDN,MAAMJ,SAAQ;;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;AAwBvB,SAAgBM,cAAuC;CACrD,MAAM,CAACD,UAAUO,eAAef,MAAMgB,aAAa,MAAM;AAEzDhB,OAAMiB,mBACE,YACA;AACJF,cAAY,KAAK;GAEpB;AAED,QAAOP"}
@@ -8,4 +8,4 @@ export interface HeadContentProps {
8
8
  * to ensure it's part of the reactive tree and updates correctly during client-side navigation.
9
9
  * The component uses portals internally to render content into the `<head>` element.
10
10
  */
11
- export declare function HeadContent(props: HeadContentProps): import("solid-js").JSX.Element;
11
+ export declare function HeadContent(props: HeadContentProps): import("solid-js/web").JSX.Element;
@@ -8,4 +8,4 @@ import { HeadContentProps } from './HeadContent.js';
8
8
  * Development version: filters out dev styles link after hydration and
9
9
  * includes a fallback cleanup effect for hydration mismatch cases.
10
10
  */
11
- export declare function HeadContent(props: HeadContentProps): import("solid-js").JSX.Element;
11
+ export declare function HeadContent(props: HeadContentProps): import("solid-js/web").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { useRouter } from "./useRouter.js";
2
2
  import { Asset } from "./Asset.js";
3
3
  import { useTags } from "./headContentUtils.js";
4
- import { Portal, createComponent, isServer } from "@solidjs/web";
4
+ import { HydrationScript, Portal, createComponent, isServer } from "@solidjs/web";
5
5
  import { For } from "solid-js";
6
6
  //#region src/HeadContent.tsx
7
7
  /**
@@ -13,7 +13,7 @@ import { For } from "solid-js";
13
13
  function HeadContent(props) {
14
14
  const tags = useTags(props.assetCrossOrigin);
15
15
  const router = useRouter();
16
- const content = () => createComponent(For, {
16
+ const content = () => [createComponent(HydrationScript, {}), createComponent(For, {
17
17
  get each() {
18
18
  return tags();
19
19
  },
@@ -31,15 +31,15 @@ function HeadContent(props) {
31
31
  }
32
32
  });
33
33
  }
34
- });
35
- return isServer ?? router.isServer ? content() : createComponent(Portal, {
34
+ })];
35
+ return isServer ?? router.isServer ? content() : [createComponent(HydrationScript, {}), createComponent(Portal, {
36
36
  get mount() {
37
37
  return document.head;
38
38
  },
39
39
  get children() {
40
40
  return content();
41
41
  }
42
- });
42
+ })];
43
43
  }
44
44
  //#endregion
45
45
  export { HeadContent };
@@ -1 +1 @@
1
- {"version":3,"file":"HeadContent.js","names":["For","Portal","isServer","Asset","useRouter","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","router","content","_$createComponent","each","children","tag","t","attrs","mount","document","head"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { Portal, isServer } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`\n * to ensure it's part of the reactive tree and updates correctly during client-side navigation.\n * The component uses portals internally to render content into the `<head>` element.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const router = useRouter()\n\n const content = () => (\n <For each={tags()}>\n {(tag) => {\n const t = tag() as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n )\n\n return (isServer ?? router.isServer) ? (\n content()\n ) : (\n <Portal mount={document.head}>{content()}</Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgBS,YAAYC,OAAyB;CACnD,MAAMC,OAAON,QAAQK,MAAMF,iBAAiB;CAC5C,MAAMI,SAASR,WAAW;CAE1B,MAAMS,gBAAUC,gBACbd,KAAG;EAAA,IAACe,OAAI;AAAA,UAAEJ,MAAM;;EAAAK,WACbC,QAAQ;GACR,MAAMC,IAAID,KAAK;AACf,UAAAH,gBAAQX,OAAK;IAAA,IAACc,MAAG;AAAA,YAAEC,EAAED;;IAAG,IAAEE,QAAK;AAAA,YAAED,EAAEC;;IAAK,IAAEH,WAAQ;AAAA,YAAEE,EAAEF;;IAAQ,CAAA;;EAC/D,CAEJ;AAED,QAAQd,YAAYU,OAAOV,WACzBW,SAAS,GAAAC,gBAERb,QAAM;EAAA,IAACmB,QAAK;AAAA,UAAEC,SAASC;;EAAI,IAAAN,WAAA;AAAA,UAAGH,SAAS;;EAAA,CACzC"}
1
+ {"version":3,"file":"HeadContent.js","names":["For","HydrationScript","Portal","isServer","Asset","useRouter","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","router","content","_$createComponent","each","children","tag","t","attrs","mount","document","head"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { HydrationScript, Portal, isServer } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`\n * to ensure it's part of the reactive tree and updates correctly during client-side navigation.\n * The component uses portals internally to render content into the `<head>` element.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const router = useRouter()\n\n const content = () => (\n <>\n <HydrationScript />\n <For each={tags()}>\n {(tag) => {\n const t = tag() as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n\n return (isServer ?? router.isServer) ? (\n content()\n ) : (\n <>\n <HydrationScript />\n <Portal mount={document.head}>{content()}</Portal>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgBU,YAAYC,OAAyB;CACnD,MAAMC,OAAON,QAAQK,MAAMF,iBAAiB;CAC5C,MAAMI,SAASR,WAAW;CAE1B,MAAMS,gBAAU,CAAAC,gBAEXd,iBAAe,EAAA,CAAA,EAAAc,gBACff,KAAG;EAAA,IAACgB,OAAI;AAAA,UAAEJ,MAAM;;EAAAK,WACbC,QAAQ;GACR,MAAMC,IAAID,KAAK;AACf,UAAAH,gBAAQX,OAAK;IAAA,IAACc,MAAG;AAAA,YAAEC,EAAED;;IAAG,IAAEE,QAAK;AAAA,YAAED,EAAEC;;IAAK,IAAEH,WAAQ;AAAA,YAAEE,EAAEF;;IAAQ,CAAA;;EAC/D,CAAA,CAGN;AAED,QAAQd,YAAYU,OAAOV,WACzBW,SAAS,GAAA,CAAAC,gBAGNd,iBAAe,EAAA,CAAA,EAAAc,gBACfb,QAAM;EAAA,IAACmB,QAAK;AAAA,UAAEC,SAASC;;EAAI,IAAAN,WAAA;AAAA,UAAGH,SAAS;;EAAA,CAAA,CAE3C"}
@@ -1,6 +1,5 @@
1
- import * as Solid from 'solid-js';
2
1
  export declare const Match: (props: {
3
2
  matchId: string;
4
- }) => Solid.JSX.Element;
3
+ }) => import("solid-js/web").JSX.Element;
5
4
  export declare const MatchInner: () => any;
6
- export declare const Outlet: () => Solid.JSX.Element;
5
+ export declare const Outlet: () => import("solid-js/web").JSX.Element;