@tanstack/react-router 0.0.1-beta.69 → 0.0.1-beta.70

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.
@@ -180,18 +180,23 @@ class ReactRouter extends router.Router {
180
180
  }
181
181
  }
182
182
  function RouterProvider({
183
- router,
183
+ router: router$1,
184
184
  ...rest
185
185
  }) {
186
- router.update(rest);
187
- const currentMatches = reactStore.useStore(router.store, s => s.currentMatches);
188
- React__namespace.useEffect(router.mount, [router]);
189
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
186
+ router$1.update(rest);
187
+ const currentMatches = reactStore.useStore(router$1.store, s => s.currentMatches);
188
+ React__namespace.useEffect(router$1.mount, [router$1]);
189
+ return /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
190
190
  value: {
191
- router: router
191
+ router: router$1
192
192
  }
193
193
  }, /*#__PURE__*/React__namespace.createElement(matchesContext.Provider, {
194
194
  value: [undefined, ...currentMatches]
195
+ }, /*#__PURE__*/React__namespace.createElement(CatchBoundary, {
196
+ errorComponent: ErrorComponent,
197
+ onCatch: () => {
198
+ router.warning(false, `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`);
199
+ }
195
200
  }, /*#__PURE__*/React__namespace.createElement(Outlet, null))));
196
201
  }
197
202
  function useRouterContext() {
@@ -304,23 +309,24 @@ function SubOutlet({
304
309
  }, []);
305
310
  const PendingComponent = match.pendingComponent ?? router$1.options.defaultPendingComponent ?? defaultPending;
306
311
  const errorComponent = match.errorComponent ?? router$1.options.defaultErrorComponent;
312
+ const ResolvedSuspenseBoundary = match.route.options.wrapInSuspense ?? true ? React__namespace.Suspense : SafeFragment;
313
+ const ResolvedCatchBoundary = errorComponent ? CatchBoundary : SafeFragment;
307
314
  return /*#__PURE__*/React__namespace.createElement(matchesContext.Provider, {
308
315
  value: matches
309
- }, match.route.options.wrapInSuspense ?? true ? /*#__PURE__*/React__namespace.createElement(React__namespace.Suspense, {
316
+ }, /*#__PURE__*/React__namespace.createElement(ResolvedSuspenseBoundary, {
310
317
  fallback: /*#__PURE__*/React__namespace.createElement(PendingComponent, null)
311
- }, /*#__PURE__*/React__namespace.createElement(CatchBoundary, {
318
+ }, /*#__PURE__*/React__namespace.createElement(ResolvedCatchBoundary, {
312
319
  key: match.route.id,
313
320
  errorComponent: errorComponent,
314
- match: match
315
- }, /*#__PURE__*/React__namespace.createElement(Inner, {
316
- match: match
317
- }))) : /*#__PURE__*/React__namespace.createElement(CatchBoundary, {
318
- key: match.route.id,
319
- errorComponent: errorComponent,
320
- match: match
321
+ onCatch: () => {
322
+ router.warning(false, `Error in route match: ${match.id}`);
323
+ }
321
324
  }, /*#__PURE__*/React__namespace.createElement(Inner, {
322
325
  match: match
323
- })));
326
+ }))));
327
+ }
328
+ function SafeFragment(props) {
329
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, props.children);
324
330
  }
325
331
 
326
332
  // This is the messiest thing ever... I'm either seriously tired (likely) or
@@ -333,7 +339,7 @@ class CatchBoundary extends React__namespace.Component {
333
339
  info: undefined
334
340
  };
335
341
  componentDidCatch(error, info) {
336
- console.error(`Error in route match: ${this.props.match.id}`);
342
+ this.props.onCatch(error, info);
337
343
  console.error(error);
338
344
  this.setState({
339
345
  error,
@@ -350,7 +356,7 @@ class CatchBoundary extends React__namespace.Component {
350
356
  function CatchBoundaryInner(props) {
351
357
  const [activeErrorState, setActiveErrorState] = React__namespace.useState(props.errorState);
352
358
  const router = useRouterContext();
353
- const errorComponent = props.errorComponent ?? DefaultErrorBoundary;
359
+ const errorComponent = props.errorComponent ?? ErrorComponent;
354
360
  const prevKeyRef = React__namespace.useRef('');
355
361
  React__namespace.useEffect(() => {
356
362
  if (activeErrorState) {
@@ -371,7 +377,7 @@ function CatchBoundaryInner(props) {
371
377
  }
372
378
  return props.children;
373
379
  }
374
- function DefaultErrorBoundary({
380
+ function ErrorComponent({
375
381
  error
376
382
  }) {
377
383
  return /*#__PURE__*/React__namespace.createElement("div", {
@@ -429,7 +435,7 @@ Object.defineProperty(exports, 'useStore', {
429
435
  enumerable: true,
430
436
  get: function () { return reactStore.useStore; }
431
437
  });
432
- exports.DefaultErrorBoundary = DefaultErrorBoundary;
438
+ exports.ErrorComponent = ErrorComponent;
433
439
  exports.Link = Link;
434
440
  exports.MatchRoute = MatchRoute;
435
441
  exports.Navigate = Navigate;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n Route,\n RegisteredRoutesInfo,\n RegisteredRouter,\n RouterStore,\n last,\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n AnyRoute,\n AnyRoutesInfo,\n DefaultRoutesInfo,\n functionalUpdate,\n RoutesInfo,\n ValidFromPath,\n LinkOptions,\n RouteByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n Expand,\n AnyContext,\n AnyRootRoute,\n RootRoute,\n AnySearchSchema,\n AnyPathParams,\n AnyRouteMatch,\n NavigateOptions,\n RouterConstructorOptions,\n} from '@tanstack/router'\nimport { useStore } from '@tanstack/react-store'\n\n//\n\nexport * from '@tanstack/router'\n\nexport { useStore }\n\n//\n\ntype ReactNode = any\n\nexport type SyncRouteComponent<TProps = {}> = (props: TProps) => ReactNode\n\nexport type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {\n preload?: () => Promise<void>\n}\n\nexport function lazy(\n importer: () => Promise<{ default: SyncRouteComponent }>,\n): RouteComponent {\n const lazyComp = React.lazy(importer as any)\n let preloaded: Promise<SyncRouteComponent>\n\n const finalComp = lazyComp as unknown as RouteComponent\n\n finalComp.preload = async () => {\n if (!preloaded) {\n await importer()\n }\n }\n\n return finalComp\n}\n\nexport type LinkPropsOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkOptions<RegisteredRoutesInfo, TFrom, TTo> & {\n // A function that returns additional props for the `active` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n activeProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n // A function that returns additional props for the `inactive` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n inactiveProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n}\n\nexport type MakeUseMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions\n\nexport type MakeMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> &\n MatchRouteOptions & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ReactNode\n | ((\n params: RouteByPath<\n RegisteredRoutesInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['__types']['allParams'],\n ) => ReactNode)\n }\n\nexport type MakeLinkPropsOptions<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>\n\nexport type MakeLinkOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement> &\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?: ReactNode | ((state: { isActive: boolean }) => ReactNode)\n }\n\ndeclare module '@tanstack/router' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: unknown\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteTree> {\n // ssrFooter?: () => JSX.Element | Node\n }\n\n interface FrameworkRouteOptions {\n wrapInSuspense?: boolean\n }\n}\n\nexport type PromptProps = {\n message: string\n when?: boolean | any\n children?: ReactNode\n}\n\n//\n\nexport function useLinkProps<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(\n options: MakeLinkPropsOptions<TFrom, TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouterContext()\n\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({ className: 'active' }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to = '.',\n preload,\n preloadDelay,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options\n\n const linkInfo = router.buildLink(options as any)\n\n if (linkInfo.type === 'external') {\n const { href } = linkInfo\n return { href }\n }\n\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n next,\n } = linkInfo\n\n const reactHandleClick = (e: Event) => {\n if (React.startTransition) {\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e)\n })\n } else {\n handleClick(e)\n }\n }\n\n const composeHandlers =\n (handlers: (undefined | ((e: any) => void))[]) =>\n (e: React.SyntheticEvent) => {\n if (e.persist) e.persist()\n handlers.filter(Boolean).forEach((handler) => {\n if (e.defaultPrevented) return\n handler!(e)\n })\n }\n\n // Get the active props\n const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> = isActive\n ? functionalUpdate(activeProps as any, {}) ?? {}\n : {}\n\n // Get the inactive props\n const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {}\n\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([onClick, reactHandleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style,\n },\n className:\n [\n className,\n resolvedActiveProps.className,\n resolvedInactiveProps.className,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n ...(disabled\n ? {\n role: 'link',\n 'aria-disabled': true,\n }\n : undefined),\n ['data-status']: isActive ? 'active' : undefined,\n }\n}\n\nexport interface LinkFn<\n TDefaultFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TDefaultTo extends string = '',\n> {\n <\n TFrom extends RegisteredRoutesInfo['routePaths'] = TDefaultFrom,\n TTo extends string = TDefaultTo,\n >(\n props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>,\n ): ReactNode\n}\n\nexport const Link: LinkFn = React.forwardRef((props: any, ref) => {\n const linkProps = useLinkProps(props)\n\n return (\n <a\n {...{\n ref: ref as any,\n ...linkProps,\n children:\n typeof props.children === 'function'\n ? props.children({\n isActive: (linkProps as any)['data-status'] === 'active',\n })\n : props.children,\n }}\n />\n )\n}) as any\n\nexport function Navigate<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n>(props: NavigateOptions<RegisteredRoutesInfo, TFrom, TTo>): null {\n const router = useRouterContext()\n\n React.useLayoutEffect(() => {\n router.navigate(props as any)\n }, [])\n\n return null\n}\n\ntype MatchesContextValue = AnyRouteMatch[]\n\nexport const matchesContext = React.createContext<MatchesContextValue>(null!)\nexport const routerContext = React.createContext<{ router: RegisteredRouter }>(\n null!,\n)\n\nexport type MatchesProviderProps = {\n value: MatchesContextValue\n children: ReactNode\n}\n\nexport class ReactRouter<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>,\n> extends Router<TRouteConfig, TRoutesInfo> {\n constructor(opts: RouterConstructorOptions<TRouteConfig>) {\n super({\n ...opts,\n loadComponent: async (component) => {\n if (component.preload) {\n await component.preload()\n }\n\n return component as any\n },\n })\n }\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n> = RouterOptions<TRouteConfig> & {\n router: Router<TRouteConfig, TRoutesInfo>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo>) {\n router.update(rest)\n\n const currentMatches = useStore(router.store, (s) => s.currentMatches)\n\n React.useEffect(router.mount, [router])\n\n return (\n <>\n <routerContext.Provider value={{ router: router as any }}>\n <matchesContext.Provider value={[undefined!, ...currentMatches]}>\n <Outlet />\n </matchesContext.Provider>\n </routerContext.Provider>\n </>\n )\n}\n\nexport function useRouterContext(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n\n useStore(value.router.store)\n\n return value.router\n}\n\nexport function useRouter<T = RouterStore>(\n track?: (state: Router['store']) => T,\n shallow?: boolean,\n): RegisteredRouter {\n const router = useRouterContext()\n useStore(router.store, track as any, shallow)\n return router\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TRouteMatch = RouteMatch<\n RegisteredRoutesInfo,\n RegisteredRoutesInfo['routesById'][TFrom]\n >,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (match: TRouteMatch) => any\n shallow?: boolean\n}): TStrict extends true ? TRouteMatch : TRouteMatch | undefined {\n const router = useRouterContext()\n const nearestMatch = useMatches()[0]!\n const match = opts?.from\n ? router.state.currentMatches.find((d) => d.route.id === opts?.from)\n : nearestMatch\n\n invariant(\n match,\n `Could not find ${\n opts?.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'\n }`,\n )\n\n if (opts?.strict ?? true) {\n invariant(\n nearestMatch.route.id == match?.route.id,\n `useMatch(\"${\n match?.route.id as string\n }\") is being called in a component that is meant to render the '${\n nearestMatch.route.id\n }' route. Did you mean to 'useMatch(\"${\n match?.route.id as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.route.id as string\n }\")' instead?`,\n )\n }\n\n useStore(\n match!.store as any,\n (d) => opts?.track?.(match as any) ?? match,\n opts?.shallow,\n )\n\n return match as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(routeId: TId): RegisteredRoutesInfo['routesById'][TId] {\n const router = useRouterContext()\n const resolvedRoute = router.getRoute(routeId as any)\n\n invariant(\n resolvedRoute,\n `Could not find a route for route \"${\n routeId as string\n }\"! Did you forget to add it to your route?`,\n )\n\n return resolvedRoute as any\n}\n\nexport function useSearch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TSearch = RegisteredRoutesInfo['routesById'][TFrom]['__types']['fullSearchSchema'],\n TSelected = TSearch,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (search: TSearch) => TSelected\n}): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch(opts)\n useStore(\n (match as any).store,\n (d: any) => opts?.track?.(d.search) ?? d.search,\n true,\n )\n\n return (match as unknown as RouteMatch).state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n TDefaultSelected = RegisteredRoutesInfo['allParams'] &\n RegisteredRoutesInfo['routesById'][TFrom]['__types']['allParams'],\n TSelected = TDefaultSelected,\n>(opts?: {\n from: TFrom\n track?: (search: TDefaultSelected) => TSelected\n}): TSelected {\n const router = useRouterContext()\n useStore(\n router.store,\n (d) => {\n const params = last(d.currentMatches)?.params as any\n return opts?.track?.(params) ?? params\n },\n true,\n )\n\n return last(router.state.currentMatches)?.params as any\n}\n\nexport function useNavigate<\n TDefaultFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(defaultOpts?: { from?: TDefaultFrom }) {\n const router = useRouterContext()\n return React.useCallback(\n <\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = TDefaultFrom,\n TTo extends string = '',\n >(\n opts?: MakeLinkOptions<TFrom, TTo>,\n ) => {\n return router.navigate({ ...defaultOpts, ...(opts as any) })\n },\n [],\n )\n}\n\nexport function useMatchRoute() {\n const router = useRouterContext()\n\n return React.useCallback(\n <\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n >(\n opts: MakeUseMatchRouteOptions<TFrom, TTo>,\n ) => {\n const { pending, caseSensitive, ...rest } = opts\n\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n },\n [],\n )\n}\n\nexport function MatchRoute<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(props: MakeMatchRouteOptions<TFrom, TTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props)\n\n if (!params) {\n return null\n }\n\n if (typeof props.children === 'function') {\n return (props.children as any)(params)\n }\n\n return params ? props.children : null\n}\n\nexport function Outlet() {\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n if (!match) {\n return null\n }\n\n return <SubOutlet matches={matches} match={match} />\n}\n\nfunction SubOutlet({\n matches,\n match,\n}: {\n matches: RouteMatch[]\n match: RouteMatch\n}) {\n const router = useRouterContext()\n useStore(match!.store, (store) => [store.status, store.error], true)\n\n const defaultPending = React.useCallback(() => null, [])\n\n const Inner = React.useCallback((props: { match: RouteMatch }): any => {\n if (props.match.state.status === 'error') {\n throw props.match.state.error\n }\n\n if (props.match.state.status === 'success') {\n return React.createElement(\n (props.match.component as any) ??\n router.options.defaultComponent ??\n Outlet,\n )\n }\n\n if (props.match.state.status === 'pending') {\n throw props.match.__loadPromise\n }\n\n invariant(\n false,\n 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!',\n )\n }, [])\n\n const PendingComponent = (match.pendingComponent ??\n router.options.defaultPendingComponent ??\n defaultPending) as any\n\n const errorComponent =\n match.errorComponent ?? router.options.defaultErrorComponent\n\n return (\n <matchesContext.Provider value={matches}>\n {match.route.options.wrapInSuspense ?? true ? (\n <React.Suspense fallback={<PendingComponent />}>\n <CatchBoundary\n key={match.route.id}\n errorComponent={errorComponent}\n match={match as any}\n >\n <Inner match={match} />\n </CatchBoundary>\n </React.Suspense>\n ) : (\n <CatchBoundary\n key={match.route.id}\n errorComponent={errorComponent}\n match={match as any}\n >\n <Inner match={match} />\n </CatchBoundary>\n )}\n {/* Provide a suffix suspense boundary to make sure the router is\n ready to be dehydrated on the server */}\n {/* {router.options.ssrFooter && match.id === rootRouteId ? (\n <React.Suspense fallback={null}>\n {(() => {\n if (router.store.pending) {\n throw router.navigationPromise\n }\n\n return router.options.ssrFooter()\n })()}\n </React.Suspense>\n ) : null} */}\n </matchesContext.Provider>\n )\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\n\nclass CatchBoundary extends React.Component<{\n children: any\n errorComponent: any\n match: RouteMatch\n}> {\n state = {\n error: false,\n info: undefined,\n }\n componentDidCatch(error: any, info: any) {\n console.error(`Error in route match: ${this.props.match.id}`)\n console.error(error)\n this.setState({\n error,\n info,\n })\n }\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\n }\n}\n\nfunction CatchBoundaryInner(props: {\n children: any\n errorComponent: any\n errorState: { error: unknown; info: any }\n reset: () => void\n}) {\n const [activeErrorState, setActiveErrorState] = React.useState(\n props.errorState,\n )\n const router = useRouterContext()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.state.currentLocation.key\n }, [activeErrorState, router.state.currentLocation.key])\n\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState)\n }\n // props.reset()\n }, [props.errorState.error])\n\n if (props.errorState.error && activeErrorState.error) {\n return React.createElement(errorComponent, activeErrorState)\n }\n\n return props.children\n}\n\nexport function DefaultErrorBoundary({ error }: { error: any }) {\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <strong style={{ fontSize: '1.2rem' }}>Something went wrong!</strong>\n <div style={{ height: '.5rem' }} />\n <div>\n <pre>\n {error.message ? (\n <code\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n }}\n >\n {error.message}\n </code>\n ) : null}\n </pre>\n </div>\n </div>\n )\n}\n\n// TODO: While we migrate away from the history package, these need to be disabled\n// export function usePrompt(message: string, when: boolean | any): void {\n// const router = useRouter()\n\n// React.useEffect(() => {\n// if (!when) return\n\n// let unblock = router.getHistory().block((transition) => {\n// if (window.confirm(message)) {\n// unblock()\n// transition.retry()\n// } else {\n// router.setStore((s) => {\n// s.currentLocation.pathname = window.location.pathname\n// })\n// }\n// })\n\n// return unblock\n// }, [when, message])\n// }\n\n// export function Prompt({ message, when, children }: PromptProps) {\n// usePrompt(message, when ?? true)\n// return (children ?? null) as ReactNode\n// }\n"],"names":["lazy","importer","lazyComp","React","finalComp","preload","useLinkProps","options","router","useRouterContext","type","children","target","activeProps","className","inactiveProps","activeOptions","disabled","hash","search","params","to","preloadDelay","replace","style","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","rest","linkInfo","buildLink","href","handleClick","handleFocus","handleEnter","handleLeave","handleTouchStart","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","filter","Boolean","forEach","handler","defaultPrevented","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","undefined","join","role","Link","forwardRef","props","ref","linkProps","_extends","Navigate","useLayoutEffect","navigate","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","value","useContext","warning","useRouter","track","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","useCallback","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","status","error","defaultPending","Inner","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","wrapInSuspense","CatchBoundary","Component","info","componentDidCatch","console","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","useState","errorState","DefaultErrorBoundary","prevKeyRef","useRef","currentLocation","key","current","padding","maxWidth","fontSize","height","message","border","borderRadius","color"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA;;AAUO,SAASA,IAAI,CAClBC,QAAwD,EACxC;AAChB,EAAA,MAAMC,QAAQ,gBAAGC,gBAAK,CAACH,IAAI,CAACC,QAAQ,CAAQ,CAAA;EAG5C,MAAMG,SAAS,GAAGF,QAAqC,CAAA;EAEvDE,SAAS,CAACC,OAAO,GAAG,YAAY;IACd;AACd,MAAA,MAAMJ,QAAQ,EAAE,CAAA;AAClB,KAAA;GACD,CAAA;AAED,EAAA,OAAOG,SAAS,CAAA;AAClB,CAAA;AA4EA;;AAEO,SAASE,YAAY,CAI1BC,OAAyC,EACM;EAC/C,MAAMC,QAAM,GAAGC,gBAAgB,EAAE,CAAA;EAEjC,MAAM;AACJ;IACAC,IAAI;IACJC,QAAQ;IACRC,MAAM;AACNC,IAAAA,WAAW,GAAG,OAAO;AAAEC,MAAAA,SAAS,EAAE,QAAA;AAAS,KAAC,CAAC;AAC7CC,IAAAA,aAAa,GAAG,OAAO,E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AAO,KAAA;GAC/C,eAAAtJ,gBAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,IAAA,KAAK,EAAE;AAAEuJ,MAAAA,QAAQ,EAAE,QAAA;AAAS,KAAA;AAAE,GAAA,EAAA,uBAAA,CAA+B,eACrEvJ,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,KAAK,EAAE;AAAEwJ,MAAAA,MAAM,EAAE,OAAA;AAAQ,KAAA;AAAE,GAAA,CAAG,eACnCxJ,gBACE,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,eAAAA,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EACGuH,KAAK,CAACkC,OAAO,gBACZzJ,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACLuJ,MAAAA,QAAQ,EAAE,MAAM;AAChBG,MAAAA,MAAM,EAAE,eAAe;AACvBC,MAAAA,YAAY,EAAE,QAAQ;AACtBN,MAAAA,OAAO,EAAE,OAAO;AAChBO,MAAAA,KAAK,EAAE,KAAA;AACT,KAAA;GAECrC,EAAAA,KAAK,CAACkC,OAAO,CACT,GACL,IAAI,CACJ,CACF,CACF,CAAA;AAEV,CAAA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n Route,\n RegisteredRoutesInfo,\n RegisteredRouter,\n RouterStore,\n last,\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n AnyRoutesInfo,\n DefaultRoutesInfo,\n functionalUpdate,\n RoutesInfo,\n ValidFromPath,\n LinkOptions,\n RouteByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n AnyRootRoute,\n RootRoute,\n AnyRouteMatch,\n NavigateOptions,\n RouterConstructorOptions,\n} from '@tanstack/router'\nimport { useStore } from '@tanstack/react-store'\n\n//\n\nexport * from '@tanstack/router'\n\nexport { useStore }\n\n//\n\ntype ReactNode = any\n\nexport type SyncRouteComponent<TProps = {}> = (props: TProps) => ReactNode\n\nexport type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {\n preload?: () => Promise<void>\n}\n\nexport function lazy(\n importer: () => Promise<{ default: SyncRouteComponent }>,\n): RouteComponent {\n const lazyComp = React.lazy(importer as any)\n let preloaded: Promise<SyncRouteComponent>\n\n const finalComp = lazyComp as unknown as RouteComponent\n\n finalComp.preload = async () => {\n if (!preloaded) {\n await importer()\n }\n }\n\n return finalComp\n}\n\nexport type LinkPropsOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkOptions<RegisteredRoutesInfo, TFrom, TTo> & {\n // A function that returns additional props for the `active` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n activeProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n // A function that returns additional props for the `inactive` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n inactiveProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n}\n\nexport type MakeUseMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions\n\nexport type MakeMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> &\n MatchRouteOptions & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ReactNode\n | ((\n params: RouteByPath<\n RegisteredRoutesInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['__types']['allParams'],\n ) => ReactNode)\n }\n\nexport type MakeLinkPropsOptions<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>\n\nexport type MakeLinkOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement> &\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?: ReactNode | ((state: { isActive: boolean }) => ReactNode)\n }\n\ndeclare module '@tanstack/router' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: Error\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteTree> {\n // ssrFooter?: () => JSX.Element | Node\n }\n\n interface FrameworkRouteOptions {\n wrapInSuspense?: boolean\n }\n}\n\nexport type PromptProps = {\n message: string\n when?: boolean | any\n children?: ReactNode\n}\n\n//\n\nexport function useLinkProps<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(\n options: MakeLinkPropsOptions<TFrom, TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouterContext()\n\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({ className: 'active' }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to = '.',\n preload,\n preloadDelay,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options\n\n const linkInfo = router.buildLink(options as any)\n\n if (linkInfo.type === 'external') {\n const { href } = linkInfo\n return { href }\n }\n\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n next,\n } = linkInfo\n\n const reactHandleClick = (e: Event) => {\n if (React.startTransition) {\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e)\n })\n } else {\n handleClick(e)\n }\n }\n\n const composeHandlers =\n (handlers: (undefined | ((e: any) => void))[]) =>\n (e: React.SyntheticEvent) => {\n if (e.persist) e.persist()\n handlers.filter(Boolean).forEach((handler) => {\n if (e.defaultPrevented) return\n handler!(e)\n })\n }\n\n // Get the active props\n const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> = isActive\n ? functionalUpdate(activeProps as any, {}) ?? {}\n : {}\n\n // Get the inactive props\n const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {}\n\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([onClick, reactHandleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style,\n },\n className:\n [\n className,\n resolvedActiveProps.className,\n resolvedInactiveProps.className,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n ...(disabled\n ? {\n role: 'link',\n 'aria-disabled': true,\n }\n : undefined),\n ['data-status']: isActive ? 'active' : undefined,\n }\n}\n\nexport interface LinkFn<\n TDefaultFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TDefaultTo extends string = '',\n> {\n <\n TFrom extends RegisteredRoutesInfo['routePaths'] = TDefaultFrom,\n TTo extends string = TDefaultTo,\n >(\n props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>,\n ): ReactNode\n}\n\nexport const Link: LinkFn = React.forwardRef((props: any, ref) => {\n const linkProps = useLinkProps(props)\n\n return (\n <a\n {...{\n ref: ref as any,\n ...linkProps,\n children:\n typeof props.children === 'function'\n ? props.children({\n isActive: (linkProps as any)['data-status'] === 'active',\n })\n : props.children,\n }}\n />\n )\n}) as any\n\nexport function Navigate<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n>(props: NavigateOptions<RegisteredRoutesInfo, TFrom, TTo>): null {\n const router = useRouterContext()\n\n React.useLayoutEffect(() => {\n router.navigate(props as any)\n }, [])\n\n return null\n}\n\ntype MatchesContextValue = AnyRouteMatch[]\n\nexport const matchesContext = React.createContext<MatchesContextValue>(null!)\nexport const routerContext = React.createContext<{ router: RegisteredRouter }>(\n null!,\n)\n\nexport type MatchesProviderProps = {\n value: MatchesContextValue\n children: ReactNode\n}\n\nexport class ReactRouter<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>,\n> extends Router<TRouteConfig, TRoutesInfo> {\n constructor(opts: RouterConstructorOptions<TRouteConfig>) {\n super({\n ...opts,\n loadComponent: async (component) => {\n if (component.preload) {\n await component.preload()\n }\n\n return component as any\n },\n })\n }\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n> = RouterOptions<TRouteConfig> & {\n router: Router<TRouteConfig, TRoutesInfo>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo>) {\n router.update(rest)\n\n const currentMatches = useStore(router.store, (s) => s.currentMatches)\n\n React.useEffect(router.mount, [router])\n\n return (\n <routerContext.Provider value={{ router: router as any }}>\n <matchesContext.Provider value={[undefined!, ...currentMatches]}>\n <CatchBoundary\n errorComponent={ErrorComponent}\n onCatch={() => {\n warning(\n false,\n `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`,\n )\n }}\n >\n <Outlet />\n </CatchBoundary>\n </matchesContext.Provider>\n </routerContext.Provider>\n )\n}\n\nexport function useRouterContext(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n\n useStore(value.router.store)\n\n return value.router\n}\n\nexport function useRouter<T = RouterStore>(\n track?: (state: Router['store']) => T,\n shallow?: boolean,\n): RegisteredRouter {\n const router = useRouterContext()\n useStore(router.store, track as any, shallow)\n return router\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TRouteMatch = RouteMatch<\n RegisteredRoutesInfo,\n RegisteredRoutesInfo['routesById'][TFrom]\n >,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (match: TRouteMatch) => any\n shallow?: boolean\n}): TStrict extends true ? TRouteMatch : TRouteMatch | undefined {\n const router = useRouterContext()\n const nearestMatch = useMatches()[0]!\n const match = opts?.from\n ? router.state.currentMatches.find((d) => d.route.id === opts?.from)\n : nearestMatch\n\n invariant(\n match,\n `Could not find ${\n opts?.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'\n }`,\n )\n\n if (opts?.strict ?? true) {\n invariant(\n nearestMatch.route.id == match?.route.id,\n `useMatch(\"${\n match?.route.id as string\n }\") is being called in a component that is meant to render the '${\n nearestMatch.route.id\n }' route. Did you mean to 'useMatch(\"${\n match?.route.id as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.route.id as string\n }\")' instead?`,\n )\n }\n\n useStore(\n match!.store as any,\n (d) => opts?.track?.(match as any) ?? match,\n opts?.shallow,\n )\n\n return match as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(routeId: TId): RegisteredRoutesInfo['routesById'][TId] {\n const router = useRouterContext()\n const resolvedRoute = router.getRoute(routeId as any)\n\n invariant(\n resolvedRoute,\n `Could not find a route for route \"${\n routeId as string\n }\"! Did you forget to add it to your route?`,\n )\n\n return resolvedRoute as any\n}\n\nexport function useSearch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TSearch = RegisteredRoutesInfo['routesById'][TFrom]['__types']['fullSearchSchema'],\n TSelected = TSearch,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (search: TSearch) => TSelected\n}): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch(opts)\n useStore(\n (match as any).store,\n (d: any) => opts?.track?.(d.search) ?? d.search,\n true,\n )\n\n return (match as unknown as RouteMatch).state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n TDefaultSelected = RegisteredRoutesInfo['allParams'] &\n RegisteredRoutesInfo['routesById'][TFrom]['__types']['allParams'],\n TSelected = TDefaultSelected,\n>(opts?: {\n from: TFrom\n track?: (search: TDefaultSelected) => TSelected\n}): TSelected {\n const router = useRouterContext()\n useStore(\n router.store,\n (d) => {\n const params = last(d.currentMatches)?.params as any\n return opts?.track?.(params) ?? params\n },\n true,\n )\n\n return last(router.state.currentMatches)?.params as any\n}\n\nexport function useNavigate<\n TDefaultFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(defaultOpts?: { from?: TDefaultFrom }) {\n const router = useRouterContext()\n return React.useCallback(\n <\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = TDefaultFrom,\n TTo extends string = '',\n >(\n opts?: MakeLinkOptions<TFrom, TTo>,\n ) => {\n return router.navigate({ ...defaultOpts, ...(opts as any) })\n },\n [],\n )\n}\n\nexport function useMatchRoute() {\n const router = useRouterContext()\n\n return React.useCallback(\n <\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n >(\n opts: MakeUseMatchRouteOptions<TFrom, TTo>,\n ) => {\n const { pending, caseSensitive, ...rest } = opts\n\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n },\n [],\n )\n}\n\nexport function MatchRoute<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(props: MakeMatchRouteOptions<TFrom, TTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props)\n\n if (!params) {\n return null\n }\n\n if (typeof props.children === 'function') {\n return (props.children as any)(params)\n }\n\n return params ? props.children : null\n}\n\nexport function Outlet() {\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n if (!match) {\n return null\n }\n\n return <SubOutlet matches={matches} match={match} />\n}\n\nfunction SubOutlet({\n matches,\n match,\n}: {\n matches: RouteMatch[]\n match: RouteMatch\n}) {\n const router = useRouterContext()\n useStore(match!.store, (store) => [store.status, store.error], true)\n\n const defaultPending = React.useCallback(() => null, [])\n\n const Inner = React.useCallback((props: { match: RouteMatch }): any => {\n if (props.match.state.status === 'error') {\n throw props.match.state.error\n }\n\n if (props.match.state.status === 'success') {\n return React.createElement(\n (props.match.component as any) ??\n router.options.defaultComponent ??\n Outlet,\n )\n }\n\n if (props.match.state.status === 'pending') {\n throw props.match.__loadPromise\n }\n\n invariant(\n false,\n 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!',\n )\n }, [])\n\n const PendingComponent = (match.pendingComponent ??\n router.options.defaultPendingComponent ??\n defaultPending) as any\n\n const errorComponent =\n match.errorComponent ?? router.options.defaultErrorComponent\n\n const ResolvedSuspenseBoundary =\n match.route.options.wrapInSuspense ?? true ? React.Suspense : SafeFragment\n const ResolvedCatchBoundary = errorComponent ? CatchBoundary : SafeFragment\n\n return (\n <matchesContext.Provider value={matches}>\n <ResolvedSuspenseBoundary fallback={<PendingComponent />}>\n <ResolvedCatchBoundary\n key={match.route.id}\n errorComponent={errorComponent}\n onCatch={() => {\n warning(false, `Error in route match: ${match.id}`)\n }}\n >\n <Inner match={match} />\n </ResolvedCatchBoundary>\n </ResolvedSuspenseBoundary>\n </matchesContext.Provider>\n )\n}\n\nfunction SafeFragment(props: any) {\n return <>{props.children}</>\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\n\nclass CatchBoundary extends React.Component<{\n children: any\n errorComponent: any\n onCatch: (error: any, info: any) => void\n}> {\n state = {\n error: false,\n info: undefined,\n }\n componentDidCatch(error: any, info: any) {\n this.props.onCatch(error, info)\n console.error(error)\n this.setState({\n error,\n info,\n })\n }\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\n }\n}\n\nfunction CatchBoundaryInner(props: {\n children: any\n errorComponent: any\n errorState: { error: unknown; info: any }\n reset: () => void\n}) {\n const [activeErrorState, setActiveErrorState] = React.useState(\n props.errorState,\n )\n const router = useRouterContext()\n const errorComponent = props.errorComponent ?? ErrorComponent\n const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.state.currentLocation.key\n }, [activeErrorState, router.state.currentLocation.key])\n\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState)\n }\n // props.reset()\n }, [props.errorState.error])\n\n if (props.errorState.error && activeErrorState.error) {\n return React.createElement(errorComponent, activeErrorState)\n }\n\n return props.children\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <strong style={{ fontSize: '1.2rem' }}>Something went wrong!</strong>\n <div style={{ height: '.5rem' }} />\n <div>\n <pre>\n {error.message ? (\n <code\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n }}\n >\n {error.message}\n </code>\n ) : null}\n </pre>\n </div>\n </div>\n )\n}\n\n// TODO: While we migrate away from the history package, these need to be disabled\n// export function usePrompt(message: string, when: boolean | any): void {\n// const router = useRouter()\n\n// React.useEffect(() => {\n// if (!when) return\n\n// let unblock = router.getHistory().block((transition) => {\n// if (window.confirm(message)) {\n// unblock()\n// transition.retry()\n// } else {\n// router.setStore((s) => {\n// s.currentLocation.pathname = window.location.pathname\n// })\n// }\n// })\n\n// return unblock\n// }, [when, message])\n// }\n\n// export function Prompt({ message, when, children }: PromptProps) {\n// usePrompt(message, when ?? true)\n// return (children ?? null) as ReactNode\n// }\n"],"names":["lazy","importer","lazyComp","React","finalComp","preload","useLinkProps","options","router","useRouterContext","type","children","target","activeProps","className","inactiveProps","activeOptions","disabled","hash","search","params","to","preloadDelay","replace","style","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","rest","linkInfo","buildLink","href","handleClick","handleFocus","handleEnter","handleLeave","handleTouchStart","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","filter","Boolean","forEach","handler","defaultPrevented","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","undefined","join","role","Link","forwardRef","props","ref","linkProps","_extends","Navigate","useLayoutEffect","navigate","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","ErrorComponent","warning","value","useContext","useRouter","track","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","useCallback","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","status","error","defaultPending","Inner","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","ResolvedSuspenseBoundary","wrapInSuspense","Suspense","SafeFragment","ResolvedCatchBoundary","CatchBoundary","Component","info","componentDidCatch","onCatch","console","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","useState","errorState","prevKeyRef","useRef","currentLocation","key","current","padding","maxWidth","fontSize","height","message","border","borderRadius","color"],"mappings":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,IAAA,EACGwH,KAAK,CAACsC,OAAO,gBACZ9J,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACL4J,MAAAA,QAAQ,EAAE,MAAM;AAChBG,MAAAA,MAAM,EAAE,eAAe;AACvBC,MAAAA,YAAY,EAAE,QAAQ;AACtBN,MAAAA,OAAO,EAAE,OAAO;AAChBO,MAAAA,KAAK,EAAE,KAAA;AACT,KAAA;GAECzC,EAAAA,KAAK,CAACsC,OAAO,CACT,GACL,IAAI,CACJ,CACF,CACF,CAAA;AAEV,CAAA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -178,12 +178,17 @@ function RouterProvider({
178
178
  router.update(rest);
179
179
  const currentMatches = useStore(router.store, s => s.currentMatches);
180
180
  React.useEffect(router.mount, [router]);
181
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(routerContext.Provider, {
181
+ return /*#__PURE__*/React.createElement(routerContext.Provider, {
182
182
  value: {
183
183
  router: router
184
184
  }
185
185
  }, /*#__PURE__*/React.createElement(matchesContext.Provider, {
186
186
  value: [undefined, ...currentMatches]
187
+ }, /*#__PURE__*/React.createElement(CatchBoundary, {
188
+ errorComponent: ErrorComponent,
189
+ onCatch: () => {
190
+ warning(false, `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`);
191
+ }
187
192
  }, /*#__PURE__*/React.createElement(Outlet, null))));
188
193
  }
189
194
  function useRouterContext() {
@@ -296,23 +301,24 @@ function SubOutlet({
296
301
  }, []);
297
302
  const PendingComponent = match.pendingComponent ?? router.options.defaultPendingComponent ?? defaultPending;
298
303
  const errorComponent = match.errorComponent ?? router.options.defaultErrorComponent;
304
+ const ResolvedSuspenseBoundary = match.route.options.wrapInSuspense ?? true ? React.Suspense : SafeFragment;
305
+ const ResolvedCatchBoundary = errorComponent ? CatchBoundary : SafeFragment;
299
306
  return /*#__PURE__*/React.createElement(matchesContext.Provider, {
300
307
  value: matches
301
- }, match.route.options.wrapInSuspense ?? true ? /*#__PURE__*/React.createElement(React.Suspense, {
308
+ }, /*#__PURE__*/React.createElement(ResolvedSuspenseBoundary, {
302
309
  fallback: /*#__PURE__*/React.createElement(PendingComponent, null)
303
- }, /*#__PURE__*/React.createElement(CatchBoundary, {
310
+ }, /*#__PURE__*/React.createElement(ResolvedCatchBoundary, {
304
311
  key: match.route.id,
305
312
  errorComponent: errorComponent,
306
- match: match
307
- }, /*#__PURE__*/React.createElement(Inner, {
308
- match: match
309
- }))) : /*#__PURE__*/React.createElement(CatchBoundary, {
310
- key: match.route.id,
311
- errorComponent: errorComponent,
312
- match: match
313
+ onCatch: () => {
314
+ warning(false, `Error in route match: ${match.id}`);
315
+ }
313
316
  }, /*#__PURE__*/React.createElement(Inner, {
314
317
  match: match
315
- })));
318
+ }))));
319
+ }
320
+ function SafeFragment(props) {
321
+ return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
316
322
  }
317
323
 
318
324
  // This is the messiest thing ever... I'm either seriously tired (likely) or
@@ -325,7 +331,7 @@ class CatchBoundary extends React.Component {
325
331
  info: undefined
326
332
  };
327
333
  componentDidCatch(error, info) {
328
- console.error(`Error in route match: ${this.props.match.id}`);
334
+ this.props.onCatch(error, info);
329
335
  console.error(error);
330
336
  this.setState({
331
337
  error,
@@ -342,7 +348,7 @@ class CatchBoundary extends React.Component {
342
348
  function CatchBoundaryInner(props) {
343
349
  const [activeErrorState, setActiveErrorState] = React.useState(props.errorState);
344
350
  const router = useRouterContext();
345
- const errorComponent = props.errorComponent ?? DefaultErrorBoundary;
351
+ const errorComponent = props.errorComponent ?? ErrorComponent;
346
352
  const prevKeyRef = React.useRef('');
347
353
  React.useEffect(() => {
348
354
  if (activeErrorState) {
@@ -363,7 +369,7 @@ function CatchBoundaryInner(props) {
363
369
  }
364
370
  return props.children;
365
371
  }
366
- function DefaultErrorBoundary({
372
+ function ErrorComponent({
367
373
  error
368
374
  }) {
369
375
  return /*#__PURE__*/React.createElement("div", {
@@ -417,5 +423,5 @@ function DefaultErrorBoundary({
417
423
  // return (children ?? null) as ReactNode
418
424
  // }
419
425
 
420
- export { DefaultErrorBoundary, Link, MatchRoute, Navigate, Outlet, ReactRouter, RouterProvider, lazy, matchesContext, routerContext, useLinkProps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterContext, useSearch };
426
+ export { ErrorComponent, Link, MatchRoute, Navigate, Outlet, ReactRouter, RouterProvider, lazy, matchesContext, routerContext, useLinkProps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterContext, useSearch };
421
427
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n Route,\n RegisteredRoutesInfo,\n RegisteredRouter,\n RouterStore,\n last,\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n AnyRoute,\n AnyRoutesInfo,\n DefaultRoutesInfo,\n functionalUpdate,\n RoutesInfo,\n ValidFromPath,\n LinkOptions,\n RouteByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n Expand,\n AnyContext,\n AnyRootRoute,\n RootRoute,\n AnySearchSchema,\n AnyPathParams,\n AnyRouteMatch,\n NavigateOptions,\n RouterConstructorOptions,\n} from '@tanstack/router'\nimport { useStore } from '@tanstack/react-store'\n\n//\n\nexport * from '@tanstack/router'\n\nexport { useStore }\n\n//\n\ntype ReactNode = any\n\nexport type SyncRouteComponent<TProps = {}> = (props: TProps) => ReactNode\n\nexport type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {\n preload?: () => Promise<void>\n}\n\nexport function lazy(\n importer: () => Promise<{ default: SyncRouteComponent }>,\n): RouteComponent {\n const lazyComp = React.lazy(importer as any)\n let preloaded: Promise<SyncRouteComponent>\n\n const finalComp = lazyComp as unknown as RouteComponent\n\n finalComp.preload = async () => {\n if (!preloaded) {\n await importer()\n }\n }\n\n return finalComp\n}\n\nexport type LinkPropsOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkOptions<RegisteredRoutesInfo, TFrom, TTo> & {\n // A function that returns additional props for the `active` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n activeProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n // A function that returns additional props for the `inactive` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n inactiveProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n}\n\nexport type MakeUseMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions\n\nexport type MakeMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> &\n MatchRouteOptions & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ReactNode\n | ((\n params: RouteByPath<\n RegisteredRoutesInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['__types']['allParams'],\n ) => ReactNode)\n }\n\nexport type MakeLinkPropsOptions<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>\n\nexport type MakeLinkOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement> &\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?: ReactNode | ((state: { isActive: boolean }) => ReactNode)\n }\n\ndeclare module '@tanstack/router' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: unknown\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteTree> {\n // ssrFooter?: () => JSX.Element | Node\n }\n\n interface FrameworkRouteOptions {\n wrapInSuspense?: boolean\n }\n}\n\nexport type PromptProps = {\n message: string\n when?: boolean | any\n children?: ReactNode\n}\n\n//\n\nexport function useLinkProps<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(\n options: MakeLinkPropsOptions<TFrom, TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouterContext()\n\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({ className: 'active' }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to = '.',\n preload,\n preloadDelay,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options\n\n const linkInfo = router.buildLink(options as any)\n\n if (linkInfo.type === 'external') {\n const { href } = linkInfo\n return { href }\n }\n\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n next,\n } = linkInfo\n\n const reactHandleClick = (e: Event) => {\n if (React.startTransition) {\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e)\n })\n } else {\n handleClick(e)\n }\n }\n\n const composeHandlers =\n (handlers: (undefined | ((e: any) => void))[]) =>\n (e: React.SyntheticEvent) => {\n if (e.persist) e.persist()\n handlers.filter(Boolean).forEach((handler) => {\n if (e.defaultPrevented) return\n handler!(e)\n })\n }\n\n // Get the active props\n const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> = isActive\n ? functionalUpdate(activeProps as any, {}) ?? {}\n : {}\n\n // Get the inactive props\n const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {}\n\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([onClick, reactHandleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style,\n },\n className:\n [\n className,\n resolvedActiveProps.className,\n resolvedInactiveProps.className,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n ...(disabled\n ? {\n role: 'link',\n 'aria-disabled': true,\n }\n : undefined),\n ['data-status']: isActive ? 'active' : undefined,\n }\n}\n\nexport interface LinkFn<\n TDefaultFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TDefaultTo extends string = '',\n> {\n <\n TFrom extends RegisteredRoutesInfo['routePaths'] = TDefaultFrom,\n TTo extends string = TDefaultTo,\n >(\n props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>,\n ): ReactNode\n}\n\nexport const Link: LinkFn = React.forwardRef((props: any, ref) => {\n const linkProps = useLinkProps(props)\n\n return (\n <a\n {...{\n ref: ref as any,\n ...linkProps,\n children:\n typeof props.children === 'function'\n ? props.children({\n isActive: (linkProps as any)['data-status'] === 'active',\n })\n : props.children,\n }}\n />\n )\n}) as any\n\nexport function Navigate<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n>(props: NavigateOptions<RegisteredRoutesInfo, TFrom, TTo>): null {\n const router = useRouterContext()\n\n React.useLayoutEffect(() => {\n router.navigate(props as any)\n }, [])\n\n return null\n}\n\ntype MatchesContextValue = AnyRouteMatch[]\n\nexport const matchesContext = React.createContext<MatchesContextValue>(null!)\nexport const routerContext = React.createContext<{ router: RegisteredRouter }>(\n null!,\n)\n\nexport type MatchesProviderProps = {\n value: MatchesContextValue\n children: ReactNode\n}\n\nexport class ReactRouter<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>,\n> extends Router<TRouteConfig, TRoutesInfo> {\n constructor(opts: RouterConstructorOptions<TRouteConfig>) {\n super({\n ...opts,\n loadComponent: async (component) => {\n if (component.preload) {\n await component.preload()\n }\n\n return component as any\n },\n })\n }\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n> = RouterOptions<TRouteConfig> & {\n router: Router<TRouteConfig, TRoutesInfo>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo>) {\n router.update(rest)\n\n const currentMatches = useStore(router.store, (s) => s.currentMatches)\n\n React.useEffect(router.mount, [router])\n\n return (\n <>\n <routerContext.Provider value={{ router: router as any }}>\n <matchesContext.Provider value={[undefined!, ...currentMatches]}>\n <Outlet />\n </matchesContext.Provider>\n </routerContext.Provider>\n </>\n )\n}\n\nexport function useRouterContext(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n\n useStore(value.router.store)\n\n return value.router\n}\n\nexport function useRouter<T = RouterStore>(\n track?: (state: Router['store']) => T,\n shallow?: boolean,\n): RegisteredRouter {\n const router = useRouterContext()\n useStore(router.store, track as any, shallow)\n return router\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TRouteMatch = RouteMatch<\n RegisteredRoutesInfo,\n RegisteredRoutesInfo['routesById'][TFrom]\n >,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (match: TRouteMatch) => any\n shallow?: boolean\n}): TStrict extends true ? TRouteMatch : TRouteMatch | undefined {\n const router = useRouterContext()\n const nearestMatch = useMatches()[0]!\n const match = opts?.from\n ? router.state.currentMatches.find((d) => d.route.id === opts?.from)\n : nearestMatch\n\n invariant(\n match,\n `Could not find ${\n opts?.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'\n }`,\n )\n\n if (opts?.strict ?? true) {\n invariant(\n nearestMatch.route.id == match?.route.id,\n `useMatch(\"${\n match?.route.id as string\n }\") is being called in a component that is meant to render the '${\n nearestMatch.route.id\n }' route. Did you mean to 'useMatch(\"${\n match?.route.id as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.route.id as string\n }\")' instead?`,\n )\n }\n\n useStore(\n match!.store as any,\n (d) => opts?.track?.(match as any) ?? match,\n opts?.shallow,\n )\n\n return match as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(routeId: TId): RegisteredRoutesInfo['routesById'][TId] {\n const router = useRouterContext()\n const resolvedRoute = router.getRoute(routeId as any)\n\n invariant(\n resolvedRoute,\n `Could not find a route for route \"${\n routeId as string\n }\"! Did you forget to add it to your route?`,\n )\n\n return resolvedRoute as any\n}\n\nexport function useSearch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TSearch = RegisteredRoutesInfo['routesById'][TFrom]['__types']['fullSearchSchema'],\n TSelected = TSearch,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (search: TSearch) => TSelected\n}): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch(opts)\n useStore(\n (match as any).store,\n (d: any) => opts?.track?.(d.search) ?? d.search,\n true,\n )\n\n return (match as unknown as RouteMatch).state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n TDefaultSelected = RegisteredRoutesInfo['allParams'] &\n RegisteredRoutesInfo['routesById'][TFrom]['__types']['allParams'],\n TSelected = TDefaultSelected,\n>(opts?: {\n from: TFrom\n track?: (search: TDefaultSelected) => TSelected\n}): TSelected {\n const router = useRouterContext()\n useStore(\n router.store,\n (d) => {\n const params = last(d.currentMatches)?.params as any\n return opts?.track?.(params) ?? params\n },\n true,\n )\n\n return last(router.state.currentMatches)?.params as any\n}\n\nexport function useNavigate<\n TDefaultFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(defaultOpts?: { from?: TDefaultFrom }) {\n const router = useRouterContext()\n return React.useCallback(\n <\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = TDefaultFrom,\n TTo extends string = '',\n >(\n opts?: MakeLinkOptions<TFrom, TTo>,\n ) => {\n return router.navigate({ ...defaultOpts, ...(opts as any) })\n },\n [],\n )\n}\n\nexport function useMatchRoute() {\n const router = useRouterContext()\n\n return React.useCallback(\n <\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n >(\n opts: MakeUseMatchRouteOptions<TFrom, TTo>,\n ) => {\n const { pending, caseSensitive, ...rest } = opts\n\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n },\n [],\n )\n}\n\nexport function MatchRoute<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(props: MakeMatchRouteOptions<TFrom, TTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props)\n\n if (!params) {\n return null\n }\n\n if (typeof props.children === 'function') {\n return (props.children as any)(params)\n }\n\n return params ? props.children : null\n}\n\nexport function Outlet() {\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n if (!match) {\n return null\n }\n\n return <SubOutlet matches={matches} match={match} />\n}\n\nfunction SubOutlet({\n matches,\n match,\n}: {\n matches: RouteMatch[]\n match: RouteMatch\n}) {\n const router = useRouterContext()\n useStore(match!.store, (store) => [store.status, store.error], true)\n\n const defaultPending = React.useCallback(() => null, [])\n\n const Inner = React.useCallback((props: { match: RouteMatch }): any => {\n if (props.match.state.status === 'error') {\n throw props.match.state.error\n }\n\n if (props.match.state.status === 'success') {\n return React.createElement(\n (props.match.component as any) ??\n router.options.defaultComponent ??\n Outlet,\n )\n }\n\n if (props.match.state.status === 'pending') {\n throw props.match.__loadPromise\n }\n\n invariant(\n false,\n 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!',\n )\n }, [])\n\n const PendingComponent = (match.pendingComponent ??\n router.options.defaultPendingComponent ??\n defaultPending) as any\n\n const errorComponent =\n match.errorComponent ?? router.options.defaultErrorComponent\n\n return (\n <matchesContext.Provider value={matches}>\n {match.route.options.wrapInSuspense ?? true ? (\n <React.Suspense fallback={<PendingComponent />}>\n <CatchBoundary\n key={match.route.id}\n errorComponent={errorComponent}\n match={match as any}\n >\n <Inner match={match} />\n </CatchBoundary>\n </React.Suspense>\n ) : (\n <CatchBoundary\n key={match.route.id}\n errorComponent={errorComponent}\n match={match as any}\n >\n <Inner match={match} />\n </CatchBoundary>\n )}\n {/* Provide a suffix suspense boundary to make sure the router is\n ready to be dehydrated on the server */}\n {/* {router.options.ssrFooter && match.id === rootRouteId ? (\n <React.Suspense fallback={null}>\n {(() => {\n if (router.store.pending) {\n throw router.navigationPromise\n }\n\n return router.options.ssrFooter()\n })()}\n </React.Suspense>\n ) : null} */}\n </matchesContext.Provider>\n )\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\n\nclass CatchBoundary extends React.Component<{\n children: any\n errorComponent: any\n match: RouteMatch\n}> {\n state = {\n error: false,\n info: undefined,\n }\n componentDidCatch(error: any, info: any) {\n console.error(`Error in route match: ${this.props.match.id}`)\n console.error(error)\n this.setState({\n error,\n info,\n })\n }\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\n }\n}\n\nfunction CatchBoundaryInner(props: {\n children: any\n errorComponent: any\n errorState: { error: unknown; info: any }\n reset: () => void\n}) {\n const [activeErrorState, setActiveErrorState] = React.useState(\n props.errorState,\n )\n const router = useRouterContext()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.state.currentLocation.key\n }, [activeErrorState, router.state.currentLocation.key])\n\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState)\n }\n // props.reset()\n }, [props.errorState.error])\n\n if (props.errorState.error && activeErrorState.error) {\n return React.createElement(errorComponent, activeErrorState)\n }\n\n return props.children\n}\n\nexport function DefaultErrorBoundary({ error }: { error: any }) {\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <strong style={{ fontSize: '1.2rem' }}>Something went wrong!</strong>\n <div style={{ height: '.5rem' }} />\n <div>\n <pre>\n {error.message ? (\n <code\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n }}\n >\n {error.message}\n </code>\n ) : null}\n </pre>\n </div>\n </div>\n )\n}\n\n// TODO: While we migrate away from the history package, these need to be disabled\n// export function usePrompt(message: string, when: boolean | any): void {\n// const router = useRouter()\n\n// React.useEffect(() => {\n// if (!when) return\n\n// let unblock = router.getHistory().block((transition) => {\n// if (window.confirm(message)) {\n// unblock()\n// transition.retry()\n// } else {\n// router.setStore((s) => {\n// s.currentLocation.pathname = window.location.pathname\n// })\n// }\n// })\n\n// return unblock\n// }, [when, message])\n// }\n\n// export function Prompt({ message, when, children }: PromptProps) {\n// usePrompt(message, when ?? true)\n// return (children ?? null) as ReactNode\n// }\n"],"names":["lazy","importer","lazyComp","React","finalComp","preload","useLinkProps","options","router","useRouterContext","type","children","target","activeProps","className","inactiveProps","activeOptions","disabled","hash","search","params","to","preloadDelay","replace","style","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","rest","linkInfo","buildLink","href","handleClick","handleFocus","handleEnter","handleLeave","handleTouchStart","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","filter","Boolean","forEach","handler","defaultPrevented","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","undefined","join","role","Link","forwardRef","props","ref","linkProps","Navigate","useLayoutEffect","navigate","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","value","useContext","warning","useRouter","track","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","useCallback","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","status","error","defaultPending","Inner","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","wrapInSuspense","CatchBoundary","Component","info","componentDidCatch","console","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","useState","errorState","DefaultErrorBoundary","prevKeyRef","useRef","currentLocation","key","current","padding","maxWidth","fontSize","height","message","border","borderRadius","color"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA;;AAUO,SAASA,IAAI,CAClBC,QAAwD,EACxC;AAChB,EAAA,MAAMC,QAAQ,gBAAGC,KAAK,CAACH,IAAI,CAACC,QAAQ,CAAQ,CAAA;EAG5C,MAAMG,SAAS,GAAGF,QAAqC,CAAA;EAEvDE,SAAS,CAACC,OAAO,GAAG,YAAY;IACd;AACd,MAAA,MAAMJ,QAAQ,EAAE,CAAA;AAClB,KAAA;GACD,CAAA;AAED,EAAA,OAAOG,SAAS,CAAA;AAClB,CAAA;AA4EA;;AAEO,SAASE,YAAY,CAI1BC,OAAyC,E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AAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,KAAK,EAAE;AAAE8B,MAAAA,OAAO,EAAE,OAAO;AAAEC,MAAAA,QAAQ,EAAE,MAAA;AAAO,KAAA;GAC/C,eAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,IAAA,KAAK,EAAE;AAAEC,MAAAA,QAAQ,EAAE,QAAA;AAAS,KAAA;AAAE,GAAA,EAAA,uBAAA,CAA+B,eACrE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,KAAK,EAAE;AAAEC,MAAAA,MAAM,EAAE,OAAA;AAAQ,KAAA;AAAE,GAAA,CAAG,eACnC,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,eAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EACGjC,KAAK,CAACkC,OAAO,gBACZ,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACLF,MAAAA,QAAQ,EAAE,MAAM;AAChBG,MAAAA,MAAM,EAAE,eAAe;AACvBC,MAAAA,YAAY,EAAE,QAAQ;AACtBN,MAAAA,OAAO,EAAE,OAAO;AAChBO,MAAAA,KAAK,EAAE,KAAA;AACT,KAAA;GAECrC,EAAAA,KAAK,CAACkC,OAAO,CACT,GACL,IAAI,CACJ,CACF,CACF,CAAA;AAEV,CAAA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n Route,\n RegisteredRoutesInfo,\n RegisteredRouter,\n RouterStore,\n last,\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n AnyRoutesInfo,\n DefaultRoutesInfo,\n functionalUpdate,\n RoutesInfo,\n ValidFromPath,\n LinkOptions,\n RouteByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n AnyRootRoute,\n RootRoute,\n AnyRouteMatch,\n NavigateOptions,\n RouterConstructorOptions,\n} from '@tanstack/router'\nimport { useStore } from '@tanstack/react-store'\n\n//\n\nexport * from '@tanstack/router'\n\nexport { useStore }\n\n//\n\ntype ReactNode = any\n\nexport type SyncRouteComponent<TProps = {}> = (props: TProps) => ReactNode\n\nexport type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {\n preload?: () => Promise<void>\n}\n\nexport function lazy(\n importer: () => Promise<{ default: SyncRouteComponent }>,\n): RouteComponent {\n const lazyComp = React.lazy(importer as any)\n let preloaded: Promise<SyncRouteComponent>\n\n const finalComp = lazyComp as unknown as RouteComponent\n\n finalComp.preload = async () => {\n if (!preloaded) {\n await importer()\n }\n }\n\n return finalComp\n}\n\nexport type LinkPropsOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkOptions<RegisteredRoutesInfo, TFrom, TTo> & {\n // A function that returns additional props for the `active` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n activeProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n // A function that returns additional props for the `inactive` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n inactiveProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n}\n\nexport type MakeUseMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions\n\nexport type MakeMatchRouteOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> &\n MatchRouteOptions & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ReactNode\n | ((\n params: RouteByPath<\n RegisteredRoutesInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['__types']['allParams'],\n ) => ReactNode)\n }\n\nexport type MakeLinkPropsOptions<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>\n\nexport type MakeLinkOptions<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n> = LinkPropsOptions<TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement> &\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?: ReactNode | ((state: { isActive: boolean }) => ReactNode)\n }\n\ndeclare module '@tanstack/router' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: Error\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteTree> {\n // ssrFooter?: () => JSX.Element | Node\n }\n\n interface FrameworkRouteOptions {\n wrapInSuspense?: boolean\n }\n}\n\nexport type PromptProps = {\n message: string\n when?: boolean | any\n children?: ReactNode\n}\n\n//\n\nexport function useLinkProps<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(\n options: MakeLinkPropsOptions<TFrom, TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouterContext()\n\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({ className: 'active' }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to = '.',\n preload,\n preloadDelay,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options\n\n const linkInfo = router.buildLink(options as any)\n\n if (linkInfo.type === 'external') {\n const { href } = linkInfo\n return { href }\n }\n\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n next,\n } = linkInfo\n\n const reactHandleClick = (e: Event) => {\n if (React.startTransition) {\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e)\n })\n } else {\n handleClick(e)\n }\n }\n\n const composeHandlers =\n (handlers: (undefined | ((e: any) => void))[]) =>\n (e: React.SyntheticEvent) => {\n if (e.persist) e.persist()\n handlers.filter(Boolean).forEach((handler) => {\n if (e.defaultPrevented) return\n handler!(e)\n })\n }\n\n // Get the active props\n const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> = isActive\n ? functionalUpdate(activeProps as any, {}) ?? {}\n : {}\n\n // Get the inactive props\n const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {}\n\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([onClick, reactHandleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style,\n },\n className:\n [\n className,\n resolvedActiveProps.className,\n resolvedInactiveProps.className,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n ...(disabled\n ? {\n role: 'link',\n 'aria-disabled': true,\n }\n : undefined),\n ['data-status']: isActive ? 'active' : undefined,\n }\n}\n\nexport interface LinkFn<\n TDefaultFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TDefaultTo extends string = '',\n> {\n <\n TFrom extends RegisteredRoutesInfo['routePaths'] = TDefaultFrom,\n TTo extends string = TDefaultTo,\n >(\n props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>,\n ): ReactNode\n}\n\nexport const Link: LinkFn = React.forwardRef((props: any, ref) => {\n const linkProps = useLinkProps(props)\n\n return (\n <a\n {...{\n ref: ref as any,\n ...linkProps,\n children:\n typeof props.children === 'function'\n ? props.children({\n isActive: (linkProps as any)['data-status'] === 'active',\n })\n : props.children,\n }}\n />\n )\n}) as any\n\nexport function Navigate<\n TFrom extends RegisteredRoutesInfo['routePaths'] = '/',\n TTo extends string = '',\n>(props: NavigateOptions<RegisteredRoutesInfo, TFrom, TTo>): null {\n const router = useRouterContext()\n\n React.useLayoutEffect(() => {\n router.navigate(props as any)\n }, [])\n\n return null\n}\n\ntype MatchesContextValue = AnyRouteMatch[]\n\nexport const matchesContext = React.createContext<MatchesContextValue>(null!)\nexport const routerContext = React.createContext<{ router: RegisteredRouter }>(\n null!,\n)\n\nexport type MatchesProviderProps = {\n value: MatchesContextValue\n children: ReactNode\n}\n\nexport class ReactRouter<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>,\n> extends Router<TRouteConfig, TRoutesInfo> {\n constructor(opts: RouterConstructorOptions<TRouteConfig>) {\n super({\n ...opts,\n loadComponent: async (component) => {\n if (component.preload) {\n await component.preload()\n }\n\n return component as any\n },\n })\n }\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n> = RouterOptions<TRouteConfig> & {\n router: Router<TRouteConfig, TRoutesInfo>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRootRoute = RootRoute,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo>) {\n router.update(rest)\n\n const currentMatches = useStore(router.store, (s) => s.currentMatches)\n\n React.useEffect(router.mount, [router])\n\n return (\n <routerContext.Provider value={{ router: router as any }}>\n <matchesContext.Provider value={[undefined!, ...currentMatches]}>\n <CatchBoundary\n errorComponent={ErrorComponent}\n onCatch={() => {\n warning(\n false,\n `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`,\n )\n }}\n >\n <Outlet />\n </CatchBoundary>\n </matchesContext.Provider>\n </routerContext.Provider>\n )\n}\n\nexport function useRouterContext(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n\n useStore(value.router.store)\n\n return value.router\n}\n\nexport function useRouter<T = RouterStore>(\n track?: (state: Router['store']) => T,\n shallow?: boolean,\n): RegisteredRouter {\n const router = useRouterContext()\n useStore(router.store, track as any, shallow)\n return router\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TRouteMatch = RouteMatch<\n RegisteredRoutesInfo,\n RegisteredRoutesInfo['routesById'][TFrom]\n >,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (match: TRouteMatch) => any\n shallow?: boolean\n}): TStrict extends true ? TRouteMatch : TRouteMatch | undefined {\n const router = useRouterContext()\n const nearestMatch = useMatches()[0]!\n const match = opts?.from\n ? router.state.currentMatches.find((d) => d.route.id === opts?.from)\n : nearestMatch\n\n invariant(\n match,\n `Could not find ${\n opts?.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'\n }`,\n )\n\n if (opts?.strict ?? true) {\n invariant(\n nearestMatch.route.id == match?.route.id,\n `useMatch(\"${\n match?.route.id as string\n }\") is being called in a component that is meant to render the '${\n nearestMatch.route.id\n }' route. Did you mean to 'useMatch(\"${\n match?.route.id as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.route.id as string\n }\")' instead?`,\n )\n }\n\n useStore(\n match!.store as any,\n (d) => opts?.track?.(match as any) ?? match,\n opts?.shallow,\n )\n\n return match as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(routeId: TId): RegisteredRoutesInfo['routesById'][TId] {\n const router = useRouterContext()\n const resolvedRoute = router.getRoute(routeId as any)\n\n invariant(\n resolvedRoute,\n `Could not find a route for route \"${\n routeId as string\n }\"! Did you forget to add it to your route?`,\n )\n\n return resolvedRoute as any\n}\n\nexport function useSearch<\n TFrom extends keyof RegisteredRoutesInfo['routesById'],\n TStrict extends boolean = true,\n TSearch = RegisteredRoutesInfo['routesById'][TFrom]['__types']['fullSearchSchema'],\n TSelected = TSearch,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (search: TSearch) => TSelected\n}): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch(opts)\n useStore(\n (match as any).store,\n (d: any) => opts?.track?.(d.search) ?? d.search,\n true,\n )\n\n return (match as unknown as RouteMatch).state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n TDefaultSelected = RegisteredRoutesInfo['allParams'] &\n RegisteredRoutesInfo['routesById'][TFrom]['__types']['allParams'],\n TSelected = TDefaultSelected,\n>(opts?: {\n from: TFrom\n track?: (search: TDefaultSelected) => TSelected\n}): TSelected {\n const router = useRouterContext()\n useStore(\n router.store,\n (d) => {\n const params = last(d.currentMatches)?.params as any\n return opts?.track?.(params) ?? params\n },\n true,\n )\n\n return last(router.state.currentMatches)?.params as any\n}\n\nexport function useNavigate<\n TDefaultFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n>(defaultOpts?: { from?: TDefaultFrom }) {\n const router = useRouterContext()\n return React.useCallback(\n <\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = TDefaultFrom,\n TTo extends string = '',\n >(\n opts?: MakeLinkOptions<TFrom, TTo>,\n ) => {\n return router.navigate({ ...defaultOpts, ...(opts as any) })\n },\n [],\n )\n}\n\nexport function useMatchRoute() {\n const router = useRouterContext()\n\n return React.useCallback(\n <\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n >(\n opts: MakeUseMatchRouteOptions<TFrom, TTo>,\n ) => {\n const { pending, caseSensitive, ...rest } = opts\n\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n },\n [],\n )\n}\n\nexport function MatchRoute<\n TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/',\n TTo extends string = '',\n>(props: MakeMatchRouteOptions<TFrom, TTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props)\n\n if (!params) {\n return null\n }\n\n if (typeof props.children === 'function') {\n return (props.children as any)(params)\n }\n\n return params ? props.children : null\n}\n\nexport function Outlet() {\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n if (!match) {\n return null\n }\n\n return <SubOutlet matches={matches} match={match} />\n}\n\nfunction SubOutlet({\n matches,\n match,\n}: {\n matches: RouteMatch[]\n match: RouteMatch\n}) {\n const router = useRouterContext()\n useStore(match!.store, (store) => [store.status, store.error], true)\n\n const defaultPending = React.useCallback(() => null, [])\n\n const Inner = React.useCallback((props: { match: RouteMatch }): any => {\n if (props.match.state.status === 'error') {\n throw props.match.state.error\n }\n\n if (props.match.state.status === 'success') {\n return React.createElement(\n (props.match.component as any) ??\n router.options.defaultComponent ??\n Outlet,\n )\n }\n\n if (props.match.state.status === 'pending') {\n throw props.match.__loadPromise\n }\n\n invariant(\n false,\n 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!',\n )\n }, [])\n\n const PendingComponent = (match.pendingComponent ??\n router.options.defaultPendingComponent ??\n defaultPending) as any\n\n const errorComponent =\n match.errorComponent ?? router.options.defaultErrorComponent\n\n const ResolvedSuspenseBoundary =\n match.route.options.wrapInSuspense ?? true ? React.Suspense : SafeFragment\n const ResolvedCatchBoundary = errorComponent ? CatchBoundary : SafeFragment\n\n return (\n <matchesContext.Provider value={matches}>\n <ResolvedSuspenseBoundary fallback={<PendingComponent />}>\n <ResolvedCatchBoundary\n key={match.route.id}\n errorComponent={errorComponent}\n onCatch={() => {\n warning(false, `Error in route match: ${match.id}`)\n }}\n >\n <Inner match={match} />\n </ResolvedCatchBoundary>\n </ResolvedSuspenseBoundary>\n </matchesContext.Provider>\n )\n}\n\nfunction SafeFragment(props: any) {\n return <>{props.children}</>\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\n\nclass CatchBoundary extends React.Component<{\n children: any\n errorComponent: any\n onCatch: (error: any, info: any) => void\n}> {\n state = {\n error: false,\n info: undefined,\n }\n componentDidCatch(error: any, info: any) {\n this.props.onCatch(error, info)\n console.error(error)\n this.setState({\n error,\n info,\n })\n }\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\n }\n}\n\nfunction CatchBoundaryInner(props: {\n children: any\n errorComponent: any\n errorState: { error: unknown; info: any }\n reset: () => void\n}) {\n const [activeErrorState, setActiveErrorState] = React.useState(\n props.errorState,\n )\n const router = useRouterContext()\n const errorComponent = props.errorComponent ?? ErrorComponent\n const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.state.currentLocation.key\n }, [activeErrorState, router.state.currentLocation.key])\n\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState)\n }\n // props.reset()\n }, [props.errorState.error])\n\n if (props.errorState.error && activeErrorState.error) {\n return React.createElement(errorComponent, activeErrorState)\n }\n\n return props.children\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <strong style={{ fontSize: '1.2rem' }}>Something went wrong!</strong>\n <div style={{ height: '.5rem' }} />\n <div>\n <pre>\n {error.message ? (\n <code\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n }}\n >\n {error.message}\n </code>\n ) : null}\n </pre>\n </div>\n </div>\n )\n}\n\n// TODO: While we migrate away from the history package, these need to be disabled\n// export function usePrompt(message: string, when: boolean | any): void {\n// const router = useRouter()\n\n// React.useEffect(() => {\n// if (!when) return\n\n// let unblock = router.getHistory().block((transition) => {\n// if (window.confirm(message)) {\n// unblock()\n// transition.retry()\n// } else {\n// router.setStore((s) => {\n// s.currentLocation.pathname = window.location.pathname\n// })\n// }\n// })\n\n// return unblock\n// }, [when, message])\n// }\n\n// export function Prompt({ message, when, children }: PromptProps) {\n// usePrompt(message, when ?? true)\n// return (children ?? null) as ReactNode\n// }\n"],"names":["lazy","importer","lazyComp","React","finalComp","preload","useLinkProps","options","router","useRouterContext","type","children","target","activeProps","className","inactiveProps","activeOptions","disabled","hash","search","params","to","preloadDelay","replace","style","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","rest","linkInfo","buildLink","href","handleClick","handleFocus","handleEnter","handleLeave","handleTouchStart","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","filter","Boolean","forEach","handler","defaultPrevented","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","undefined","join","role","Link","forwardRef","props","ref","linkProps","Navigate","useLayoutEffect","navigate","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","ErrorComponent","warning","value","useContext","useRouter","track","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","useCallback","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","status","error","defaultPending","Inner","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","ResolvedSuspenseBoundary","wrapInSuspense","Suspense","SafeFragment","ResolvedCatchBoundary","CatchBoundary","Component","info","componentDidCatch","onCatch","console","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","useState","errorState","prevKeyRef","useRef","currentLocation","key","current","padding","maxWidth","fontSize","height","message","border","borderRadius","color"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;;AAUO,SAASA,IAAI,CAClBC,QAAwD,EACxC;AAChB,EAAA,MAAMC,QAAQ,gBAAGC,KAAK,CAACH,IAAI,CAACC,QAAQ,CAAQ,CAAA;EAG5C,MAAMG,SAAS,GAAGF,QAAqC,CAAA;EAEvDE,SAAS,CAACC,OAAO,GAAG,YAAY;IACd;AACd,MAAA,MAAMJ,QAAQ,EAAE,CAAA;AAClB,KAAA;GACD,CAAA;AAED,EAAA,OAAOG,SAAS,CAAA;AAClB,CAAA;AA4EA;;AAEO,SAASE,YAAY,CAI1BC,OAAyC,EACM;EAC/C,MAAMC,MAAM,GAAGC,gBAAgB,EAAE,CAAA;EAEjC,MAAM;AACJ;IACAC,IAAI;IACJC,QAAQ;IACRC,MAAM;AACNC,IAAAA,WAAW,GAAG,OAAO;AAAEC,MAAAA,SAAS,EAAE,QAAA;AAAS,KAAC,CAAC;AAC7CC,IAAAA,aAAa,GAAG,OAAO,EAAE,CAAC;IAC1BC,aAAa;IACbC,QAAQ;AACR;IACAC,IAAI;IACJC,MAAM;IACNC,MAAM;AACNC,IAAAA,EAAE,GAAG,GAAG;IACRhB,OAAO;IACPiB,YAAY;IACZC,OAAO;AACP;IACAC,KAAK;IACLV,SAAS;IACTW,OAAO;IACPC,OAAO;IACPC,YAAY;IACZC,YAAY;IACZC,YAAY;IACZ,GAAGC,IAAAA;AACL,GAAC,GAAGvB,OAAO,CAAA;AAEX,EAAA,MAAMwB,QAAQ,GAAGvB,MAAM,CAACwB,SAAS,CAACzB,OAAO,CAAQ,CAAA;AAEjD,EAAA,IAAIwB,QAAQ,CAACrB,IAAI,KAAK,UAAU,EAAE;IAChC,MAAM;AAAEuB,MAAAA,IAAAA;AAAK,KAAC,GAAGF,QAAQ,CAAA;IACzB,OAAO;AAAEE,MAAAA,IAAAA;KAAM,CAAA;AACjB,GAAA;E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AAA,MAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACLF,MAAAA,QAAQ,EAAE,MAAM;AAChBG,MAAAA,MAAM,EAAE,eAAe;AACvBC,MAAAA,YAAY,EAAE,QAAQ;AACtBN,MAAAA,OAAO,EAAE,OAAO;AAChBO,MAAAA,KAAK,EAAE,KAAA;AACT,KAAA;GAECzC,EAAAA,KAAK,CAACsC,OAAO,CACT,GACL,IAAI,CACJ,CACF,CACF,CAAA;AAEV,CAAA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;"}
@@ -4024,7 +4024,7 @@ var drawChart = (function (exports) {
4024
4024
  </script>
4025
4025
  <script>
4026
4026
  /*<!--*/
4027
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"61e0-89","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"61e0-91"},{"name":"packages","children":[{"name":"store/build/esm/index.js","uid":"61e0-93"},{"name":"router/build/esm/index.js","uid":"61e0-95"},{"name":"react-store/build/esm/index.js","uid":"61e0-97"},{"name":"react-router/src/index.tsx","uid":"61e0-99"}]}]}],"isRoot":true},"nodeParts":{"61e0-89":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"61e0-88"},"61e0-91":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"61e0-90"},"61e0-93":{"renderedLength":1288,"gzipLength":497,"brotliLength":0,"mainUid":"61e0-92"},"61e0-95":{"renderedLength":45882,"gzipLength":10946,"brotliLength":0,"mainUid":"61e0-94"},"61e0-97":{"renderedLength":1571,"gzipLength":594,"brotliLength":0,"mainUid":"61e0-96"},"61e0-99":{"renderedLength":12398,"gzipLength":3201,"brotliLength":0,"mainUid":"61e0-98"}},"nodeMetas":{"61e0-88":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"61e0-89"},"imported":[],"importedBy":[{"uid":"61e0-98"}]},"61e0-90":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"61e0-91"},"imported":[],"importedBy":[{"uid":"61e0-94"}]},"61e0-92":{"id":"/packages/store/build/esm/index.js","moduleParts":{"index.production.js":"61e0-93"},"imported":[],"importedBy":[{"uid":"61e0-94"}]},"61e0-94":{"id":"/packages/router/build/esm/index.js","moduleParts":{"index.production.js":"61e0-95"},"imported":[{"uid":"61e0-90"},{"uid":"61e0-92"}],"importedBy":[{"uid":"61e0-98"}]},"61e0-96":{"id":"/packages/react-store/build/esm/index.js","moduleParts":{"index.production.js":"61e0-97"},"imported":[{"uid":"61e0-101"}],"importedBy":[{"uid":"61e0-98"}]},"61e0-98":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"61e0-99"},"imported":[{"uid":"61e0-88"},{"uid":"61e0-100"},{"uid":"61e0-94"},{"uid":"61e0-96"}],"importedBy":[],"isEntry":true},"61e0-100":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"61e0-98"}],"isExternal":true},"61e0-101":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"61e0-96"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4027
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"d36d-93","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm","children":[{"name":"tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"d36d-95"},{"name":"tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","uid":"d36d-97"}]},{"name":"packages","children":[{"name":"store/build/esm/index.js","uid":"d36d-99"},{"name":"router/build/esm/index.js","uid":"d36d-101"},{"name":"react-store/build/esm/index.js","uid":"d36d-103"},{"name":"react-router/src/index.tsx","uid":"d36d-105"}]}]}],"isRoot":true},"nodeParts":{"d36d-93":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"d36d-92"},"d36d-95":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"d36d-94"},"d36d-97":{"renderedLength":44,"gzipLength":62,"brotliLength":0,"mainUid":"d36d-96"},"d36d-99":{"renderedLength":1288,"gzipLength":497,"brotliLength":0,"mainUid":"d36d-98"},"d36d-101":{"renderedLength":46138,"gzipLength":10996,"brotliLength":0,"mainUid":"d36d-100"},"d36d-103":{"renderedLength":1571,"gzipLength":594,"brotliLength":0,"mainUid":"d36d-102"},"d36d-105":{"renderedLength":12488,"gzipLength":3230,"brotliLength":0,"mainUid":"d36d-104"}},"nodeMetas":{"d36d-92":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"d36d-93"},"imported":[],"importedBy":[{"uid":"d36d-104"}]},"d36d-94":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"d36d-95"},"imported":[],"importedBy":[{"uid":"d36d-100"}]},"d36d-96":{"id":"/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","moduleParts":{"index.production.js":"d36d-97"},"imported":[],"importedBy":[{"uid":"d36d-100"}]},"d36d-98":{"id":"/packages/store/build/esm/index.js","moduleParts":{"index.production.js":"d36d-99"},"imported":[],"importedBy":[{"uid":"d36d-100"}]},"d36d-100":{"id":"/packages/router/build/esm/index.js","moduleParts":{"index.production.js":"d36d-101"},"imported":[{"uid":"d36d-94"},{"uid":"d36d-96"},{"uid":"d36d-98"}],"importedBy":[{"uid":"d36d-104"}]},"d36d-102":{"id":"/packages/react-store/build/esm/index.js","moduleParts":{"index.production.js":"d36d-103"},"imported":[{"uid":"d36d-107"}],"importedBy":[{"uid":"d36d-104"}]},"d36d-104":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"d36d-105"},"imported":[{"uid":"d36d-92"},{"uid":"d36d-106"},{"uid":"d36d-100"},{"uid":"d36d-102"}],"importedBy":[],"isEntry":true},"d36d-106":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"d36d-104"}],"isExternal":true},"d36d-107":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"d36d-102"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4028
4028
 
4029
4029
  const run = () => {
4030
4030
  const width = window.innerWidth;