@tanstack/react-router 0.0.1-beta.46 → 0.0.1-beta.49

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { useSyncExternalStore } from 'use-sync-external-store/shim'\n// @ts-ignore\n// import { useSyncExternalStore } from './uSES/useSyncExternalStoreShim'\nimport { createEffect, createRoot, untrack, unwrap } from '@solidjs/reactivity'\nimport { createStore } from '@solidjs/reactivity'\n\nimport {\n Route,\n RegisteredAllRouteInfo,\n RegisteredRouter,\n RouterStore,\n last,\n sharedClone,\n Action,\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n RouteConfig,\n AnyRouteConfig,\n AnyAllRouteInfo,\n DefaultAllRouteInfo,\n functionalUpdate,\n createRouter,\n AllRouteInfo,\n ValidFromPath,\n LinkOptions,\n RouteInfoByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n Expand,\n} from '@tanstack/router-core'\n\nexport * from '@tanstack/router-core'\n\nexport * from '@solidjs/reactivity'\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 RegisteredAllRouteInfo['routePaths'] = '/',\n TTo extends string = '.',\n> = LinkOptions<RegisteredAllRouteInfo, 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 RegisteredAllRouteInfo['routePaths'] = '/',\n TTo extends string = '.',\n> = ToOptions<RegisteredAllRouteInfo, TFrom, TTo> & MatchRouteOptions\n\nexport type MakeMatchRouteOptions<\n TFrom extends RegisteredAllRouteInfo['routePaths'] = '/',\n TTo extends string = '.',\n> = ToOptions<RegisteredAllRouteInfo, 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: RouteInfoByPath<\n RegisteredAllRouteInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['allParams'],\n ) => ReactNode)\n }\n\nexport type MakeLinkPropsOptions<\n TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/',\n TTo extends string = '.',\n> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>\n\nexport type MakeLinkOptions<\n TFrom extends RegisteredAllRouteInfo['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-core' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: unknown\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteConfig, TRouterContext> {\n // ssrFooter?: () => JSX.Element | Node\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<RegisteredAllRouteInfo> = '/',\n TTo extends string = '.',\n>(\n options: MakeLinkPropsOptions<TFrom, TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouter()\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 preloadMaxAge,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n onTouchEnd,\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 { handleClick, handleFocus, handleEnter, handleLeave, isActive, 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, {}) ?? {}\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 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 RegisteredAllRouteInfo['routePaths'] = '/',\n TDefaultTo extends string = '.',\n> {\n <\n TFrom extends RegisteredAllRouteInfo['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\ntype MatchesContextValue = RouteMatch[]\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\nconst EMPTY = {}\n\nexport const __useStoreValue = <TSeed, TReturn>(\n seed: () => TSeed,\n selector?: (seed: TSeed) => TReturn,\n): TReturn => {\n const valueRef = React.useRef<TReturn>(EMPTY as any)\n\n // If there is no selector, track the seed\n // If there is a selector, do not track the seed\n const getValue = () =>\n (!selector ? seed() : selector(untrack(() => seed()))) as TReturn\n\n // If empty, initialize the value\n if (valueRef.current === EMPTY) {\n valueRef.current = sharedClone(undefined, getValue())\n }\n\n // Snapshot should just return the current cached value\n const getSnapshot = React.useCallback(() => valueRef.current, [])\n\n const getStore = React.useCallback((cb: () => void) => {\n // A root is necessary to track effects\n return createRoot(() => {\n createEffect(() => {\n // Read and update the value\n // getValue will handle which values are accessed and\n // thus tracked.\n // sharedClone will both recursively track the end result\n // and ensure that the previous value is structurally shared\n // into the new version.\n valueRef.current = unwrap(\n // Unwrap the value to get rid of any proxy structures\n sharedClone(valueRef.current, getValue()),\n )\n cb()\n })\n })\n }, [])\n\n return useSyncExternalStore(getStore, getSnapshot, getSnapshot)\n}\n\nconst [store, setStore] = createStore({ foo: 'foo', bar: { baz: 'baz' } })\n\ncreateRoot(() => {\n let prev: any\n\n createEffect(() => {\n console.log('effect')\n const next = sharedClone(prev, store)\n console.log(next)\n prev = untrack(() => next)\n })\n})\n\nsetStore((s) => {\n s.foo = '1'\n})\n\nsetStore((s) => {\n s.bar.baz = '2'\n})\n\nexport function createReactRouter<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>,\n TRouterContext = unknown,\n>(\n opts: RouterOptions<TRouteConfig, TRouterContext>,\n): Router<TRouteConfig, TAllRouteInfo, TRouterContext> {\n const coreRouter = createRouter<TRouteConfig>({\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 return coreRouter as any\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouterContext = unknown,\n> = RouterOptions<TRouteConfig, TRouterContext> & {\n router: Router<TRouteConfig, TAllRouteInfo, TRouterContext>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouterContext = unknown,\n>({\n router,\n ...rest\n}: RouterProps<TRouteConfig, TAllRouteInfo, TRouterContext>) {\n router.update(rest)\n\n const [, , currentMatches] = __useStoreValue(\n () => router.store,\n (s) => [s.status, s.pendingMatches, s.currentMatches],\n )\n\n React.useEffect(router.mount, [router])\n\n console.log('current', currentMatches)\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 useRouter(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n return value.router\n}\n\nexport function useRouterStore<T = RouterStore>(\n selector?: (state: Router['store']) => T,\n): T {\n const router = useRouter()\n return __useStoreValue(() => router.store, selector)\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n TRouteMatch = RouteMatch<\n RegisteredAllRouteInfo,\n RegisteredAllRouteInfo['routeInfoById'][TFrom]\n >,\n // TSelected = TRouteMatch,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n // select?: (match: TRouteMatch) => TSelected\n}): TStrict extends true ? TRouteMatch : TRouteMatch | undefined {\n const router = useRouter()\n const nearestMatch = useMatches()[0]!\n const match = opts?.from\n ? router.store.currentMatches.find((d) => d.routeId === 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.routeId == match?.routeId,\n `useMatch(\"${\n match?.routeId as string\n }\") is being called in a component that is meant to render the '${\n nearestMatch.routeId\n }' route. Did you mean to 'useMatch(\"${\n match?.routeId as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.routeId as string\n }\")' instead?`,\n )\n }\n\n __useStoreValue(() => match!.store)\n\n return match as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n>(\n routeId: TId,\n): Route<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]> {\n const router = useRouter()\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 config?`,\n )\n\n return resolvedRoute as any\n}\n\nexport function useLoaderData<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n TStrict extends boolean = true,\n TLoaderData = RegisteredAllRouteInfo['routeInfoById'][TFrom]['loaderData'],\n TSelected = TLoaderData,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n select?: (loaderData: TLoaderData) => TSelected\n}): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch(opts) as any\n return __useStoreValue(() => match?.store.loaderData, opts?.select)\n}\n\nexport function useSearch<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n TSearch = RegisteredAllRouteInfo['routeInfoById'][TFrom]['fullSearchSchema'],\n TSelected = TSearch,\n>(opts?: {\n from: TFrom\n strict?: TStrict\n select?: (search: TSearch) => TSelected\n}): TStrict extends true ? TSelected : TSelected | undefined {\n const match = useMatch(opts)\n return __useStoreValue(() => match?.store.search, opts?.select) as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n TDefaultSelected = Expand<\n RegisteredAllRouteInfo['allParams'] &\n RegisteredAllRouteInfo['routeInfoById'][TFrom]['allParams']\n >,\n TSelected = TDefaultSelected,\n>(opts?: {\n from: TFrom\n select?: (search: TDefaultSelected) => TSelected\n}): TSelected {\n const router = useRouter()\n return __useStoreValue(\n () => last(router.store.currentMatches)?.params as any,\n opts?.select,\n )\n}\n\nexport function useNavigate<\n TDefaultFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n>(defaultOpts: { from?: TDefaultFrom }) {\n return <\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = TDefaultFrom,\n TTo extends string = '.',\n >(\n opts: MakeLinkOptions<TFrom, TTo>,\n ) => {\n const router = useRouter()\n return router.navigate({ ...defaultOpts, ...(opts as any) })\n }\n}\n\nexport function useAction<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n TFromRoute extends RegisteredAllRouteInfo['routeInfoById'][TFrom] = RegisteredAllRouteInfo['routeInfoById'][TFrom],\n>(opts: {\n from: TFrom\n}): Action<TFromRoute['actionPayload'], TFromRoute['actionResponse']> {\n const route = useRoute(opts.from)\n const action = route.action\n __useStoreValue(() => action)\n return action as any\n}\n\nexport function useMatchRoute() {\n const router = useRouter()\n\n return <\n TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/',\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\nexport function MatchRoute<\n TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/',\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 return React.createElement(\n typeof props.children === 'function'\n ? (props.children as any)(params)\n : props.children,\n props as any,\n )\n}\n\nexport function Outlet() {\n const router = useRouter()\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n const defaultPending = React.useCallback(() => null, [])\n\n __useStoreValue(() => match?.store)\n\n const Inner = React.useCallback((props: { match: RouteMatch }): any => {\n if (props.match.store.status === 'error') {\n throw props.match.store.error\n }\n\n if (props.match.store.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.store.status === 'loading') {\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 if (!match) {\n return null\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 <React.Suspense fallback={<PendingComponent />}>\n <CatchBoundary\n key={match.routeId}\n errorComponent={errorComponent}\n match={match as any}\n >\n <Inner match={match} />\n </CatchBoundary>\n </React.Suspense>\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.matchId === 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\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\n componentDidCatch(error: any, info: any) {\n console.error(`Error in route match: ${this.props.match.matchId}`)\n console.error(error)\n\n this.setState({\n error,\n info,\n })\n }\n\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\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.\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 = useRouter()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n\n React.useEffect(() => {\n if (activeErrorState) {\n let prevKey = router.store.currentLocation.key\n return createRoot(() =>\n createEffect(() => {\n if (router.store.currentLocation.key !== prevKey) {\n prevKey = router.store.currentLocation.key\n setActiveErrorState({} as any)\n }\n }),\n )\n }\n\n return\n }, [activeErrorState])\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) {\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\nexport 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.history.block((transition) => {\n if (window.confirm(message)) {\n unblock()\n transition.retry()\n } else {\n router.store.currentLocation.pathname = window.location.pathname\n }\n })\n\n return unblock\n }, [when, message])\n}\n\nexport function Prompt({ message, when, children }: PromptProps) {\n usePrompt(message, when ?? true)\n return (children ?? null) as ReactNode\n}\n\n// function circularStringify(obj: any) {\n// const seen = new Set()\n\n// return (\n// JSON.stringify(obj, (_, value) => {\n// if (typeof value === 'function') {\n// return undefined\n// }\n// if (typeof value === 'object' && value !== null) {\n// if (seen.has(value)) return\n// seen.add(value)\n// }\n// return value\n// }) || ''\n// )\n// }\n"],"names":["lazy","importer","lazyComp","React","finalComp","preload","useLinkProps","options","router","useRouter","type","children","target","activeProps","className","inactiveProps","activeOptions","disabled","hash","search","params","to","preloadDelay","preloadMaxAge","replace","style","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","rest","linkInfo","buildLink","href","handleClick","handleFocus","handleEnter","handleLeave","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","filter","Boolean","forEach","handler","defaultPrevented","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","undefined","join","role","Link","forwardRef","props","ref","linkProps","matchesContext","createContext","routerContext","EMPTY","__useStoreValue","seed","selector","valueRef","useRef","getValue","untrack","current","sharedClone","getSnapshot","useCallback","getStore","cb","createRoot","createEffect","unwrap","useSyncExternalStore","store","setStore","createStore","foo","bar","baz","prev","console","log","s","createReactRouter","opts","coreRouter","createRouter","loadComponent","component","RouterProvider","update","currentMatches","status","pendingMatches","useEffect","mount","value","useContext","warning","useRouterStore","useMatches","useMatch","nearestMatch","match","from","find","d","routeId","invariant","strict","useRoute","resolvedRoute","getRoute","useLoaderData","loaderData","select","useSearch","useParams","last","useNavigate","defaultOpts","navigate","useAction","route","action","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","createElement","Outlet","matches","slice","defaultPending","Inner","error","__","defaultComponent","loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","CatchBoundary","Component","state","info","componentDidCatch","matchId","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","useState","errorState","DefaultErrorBoundary","prevKey","currentLocation","key","reset","padding","maxWidth","fontSize","height","message","border","borderRadius","color","usePrompt","when","unblock","history","block","transition","window","confirm","retry","pathname","location","Prompt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDO,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;AAwEA;;AAEO,SAASE,YAAY,CAI1BC,OAAyC,EACM;EAC/C,MAAMC,MAAM,GAAGC,SAAS,EAAE,CAAA;EAE1B,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,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A;IAEX,IAAIC,OAAO,GAAGjL,MAAM,CAACkL,OAAO,CAACC,KAAK,CAAEC,UAAU,IAAK;AACjD,MAAA,IAAIC,MAAM,CAACC,OAAO,CAACX,OAAO,CAAC,EAAE;AAC3BM,QAAAA,OAAO,EAAE,CAAA;QACTG,UAAU,CAACG,KAAK,EAAE,CAAA;AACpB,OAAC,MAAM;QACLvL,MAAM,CAAC6E,KAAK,CAACuF,eAAe,CAACoB,QAAQ,GAAGH,MAAM,CAACI,QAAQ,CAACD,QAAQ,CAAA;AAClE,OAAA;AACF,KAAC,CAAC,CAAA;AAEF,IAAA,OAAOP,OAAO,CAAA;AAChB,GAAC,EAAE,CAACD,IAAI,EAAEL,OAAO,CAAC,CAAC,CAAA;AACrB,CAAA;AAEO,SAASe,MAAM,CAA2C,KAAA,EAAA;EAAA,IAA1C;IAAEf,OAAO;IAAEK,IAAI;AAAE7K,IAAAA,QAAAA;GAAuB,GAAA,KAAA,CAAA;AAC7D4K,EAAAA,SAAS,CAACJ,OAAO,EAAEK,IAAI,IAAI,IAAI,CAAC,CAAA;EAChC,OAAQ7K,QAAQ,IAAI,IAAI,CAAA;AAC1B,CAAA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/useStore.ts","../../src/index.tsx"],"sourcesContent":["import { Store } from '@tanstack/router-core'\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector'\n\nexport function useStore<TState, TSelected = TState>(\n store: Store<TState>,\n selector: (state: TState) => TSelected = (d) => d as any,\n compareShallow?: boolean,\n) {\n const slice = useSyncExternalStoreWithSelector(\n store.subscribe,\n () => store.state,\n () => store.state,\n selector,\n compareShallow ? shallow : undefined,\n )\n\n return slice\n}\n\nfunction shallow<T>(objA: T, objB: T) {\n if (Object.is(objA, objB)) {\n return true\n }\n\n if (\n typeof objA !== 'object' ||\n objA === null ||\n typeof objB !== 'object' ||\n objB === null\n ) {\n return false\n }\n\n // if (objA instanceof Map && objB instanceof Map) {\n // if (objA.size !== objB.size) return false\n\n // for (const [key, value] of objA) {\n // if (!Object.is(value, objB.get(key))) {\n // return false\n // }\n // }\n // return true\n // }\n\n // if (objA instanceof Set && objB instanceof Set) {\n // if (objA.size !== objB.size) return false\n\n // for (const value of objA) {\n // if (!objB.has(value)) {\n // return false\n // }\n // }\n // return true\n // }\n\n const keysA = Object.keys(objA)\n if (keysA.length !== Object.keys(objB).length) {\n return false\n }\n\n for (let i = 0; i < keysA.length; i++) {\n if (\n !Object.prototype.hasOwnProperty.call(objB, keysA[i] as string) ||\n !Object.is(objA[keysA[i] as keyof T], objB[keysA[i] as keyof T])\n ) {\n return false\n }\n }\n return true\n}\n","import * as React from 'react'\n\nimport {\n Route,\n RegisteredAllRouteInfo,\n RegisteredRouter,\n RouterStore,\n last,\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n RouteConfig,\n AnyRouteConfig,\n AnyAllRouteInfo,\n DefaultAllRouteInfo,\n functionalUpdate,\n AllRouteInfo,\n ValidFromPath,\n LinkOptions,\n RouteInfoByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n Expand,\n Action,\n ActionStore,\n ActionSubmission,\n} from '@tanstack/router-core'\nimport { useStore } from './useStore'\n\n//\n\nexport * from '@tanstack/router-core'\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 RegisteredAllRouteInfo['routePaths'] = '/',\n TTo extends string = '.',\n> = LinkOptions<RegisteredAllRouteInfo, 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 RegisteredAllRouteInfo['routePaths'] = '/',\n TTo extends string = '.',\n> = ToOptions<RegisteredAllRouteInfo, TFrom, TTo> & MatchRouteOptions\n\nexport type MakeMatchRouteOptions<\n TFrom extends RegisteredAllRouteInfo['routePaths'] = '/',\n TTo extends string = '.',\n> = ToOptions<RegisteredAllRouteInfo, 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: RouteInfoByPath<\n RegisteredAllRouteInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['allParams'],\n ) => ReactNode)\n }\n\nexport type MakeLinkPropsOptions<\n TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/',\n TTo extends string = '.',\n> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>\n\nexport type MakeLinkOptions<\n TFrom extends RegisteredAllRouteInfo['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-core' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: unknown\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteConfig, TRouterContext> {\n // ssrFooter?: () => JSX.Element | Node\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<RegisteredAllRouteInfo> = '/',\n TTo extends string = '.',\n>(\n options: MakeLinkPropsOptions<TFrom, TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouter()\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 preloadMaxAge,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n onTouchEnd,\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 { handleClick, handleFocus, handleEnter, handleLeave, isActive, 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 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 RegisteredAllRouteInfo['routePaths'] = '/',\n TDefaultTo extends string = '.',\n> {\n <\n TFrom extends RegisteredAllRouteInfo['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\ntype MatchesContextValue = RouteMatch[]\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 AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>,\n TRouterContext = unknown,\n> extends Router<TRouteConfig, TAllRouteInfo, TRouterContext> {\n constructor(opts: RouterOptions<TRouteConfig, TRouterContext>) {\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 AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouterContext = unknown,\n> = RouterOptions<TRouteConfig, TRouterContext> & {\n router: Router<TRouteConfig, TAllRouteInfo, TRouterContext>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouterContext = unknown,\n>({\n router,\n ...rest\n}: RouterProps<TRouteConfig, TAllRouteInfo, TRouterContext>) {\n router.update(rest)\n\n const [, , currentMatches] = useStore(\n router.store,\n (s) => [s.status, s.pendingMatches, s.currentMatches],\n true,\n )\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 useRouter(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n return value.router\n}\n\nexport function useRouterStore<T = RouterStore>(\n selector?: (state: Router['store']) => T,\n shallow?: boolean,\n): T {\n const router = useRouter()\n return useStore(router.store, selector as any, shallow)\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n TRouteMatch = RouteMatch<\n RegisteredAllRouteInfo,\n RegisteredAllRouteInfo['routeInfoById'][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 = useRouter()\n const nearestMatch = useMatches()[0]!\n const match = opts?.from\n ? router.store.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,\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 RegisteredAllRouteInfo['routeInfoById'] = '/',\n>(\n routeId: TId,\n): Route<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]> {\n const router = useRouter()\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 config?`,\n )\n\n return resolvedRoute as any\n}\n\nexport function useLoaderData<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n TStrict extends boolean = true,\n TLoaderData = RegisteredAllRouteInfo['routeInfoById'][TFrom]['loaderData'],\n>(opts?: {\n from: TFrom\n strict?: TStrict\n track?: (loaderData: TLoaderData) => any\n}): TStrict extends true ? TLoaderData : TLoaderData | undefined {\n const match = useMatch(opts)\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 useStore(\n (match as any).store,\n (d: any) => opts?.track?.(d.loaderData) ?? d.loaderData,\n )\n\n return (match as unknown as RouteMatch).store.state.loaderData as any\n}\n\nexport function useSearch<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n TSearch = RegisteredAllRouteInfo['routeInfoById'][TFrom]['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 )\n\n return (match as unknown as RouteMatch).store.state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n TDefaultSelected = Expand<\n RegisteredAllRouteInfo['allParams'] &\n RegisteredAllRouteInfo['routeInfoById'][TFrom]['allParams']\n >,\n TSelected = TDefaultSelected,\n>(opts?: {\n from: TFrom\n track?: (search: TDefaultSelected) => TSelected\n}): TSelected {\n const router = useRouter()\n useStore(router.store, (d) => {\n const params = last(d.currentMatches)?.params as any\n return opts?.track?.(params) ?? params\n })\n\n return last(router.store.state.currentMatches)?.params as any\n}\n\nexport function useNavigate<\n TDefaultFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/',\n>(defaultOpts: { from?: TDefaultFrom }) {\n const router = useRouter()\n return <\n TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = TDefaultFrom,\n TTo extends string = '.',\n >(\n opts: MakeLinkOptions<TFrom, TTo>,\n ) => {\n return router.navigate({ ...defaultOpts, ...(opts as any) })\n }\n}\n\nexport function useMatchRoute() {\n const router = useRouter()\n\n return <\n TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/',\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\nexport function MatchRoute<\n TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/',\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 = useRouter()\n useStore(match!.store)\n\n const defaultPending = React.useCallback(() => null, [])\n\n const Inner = React.useCallback((props: { match: RouteMatch }): any => {\n if (props.match.store.state.status === 'error') {\n throw props.match.store.state.error\n }\n\n if (props.match.store.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.store.state.status === 'loading') {\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 <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 {/* Provide a suffix suspense boundary to make sure the router is\n ready to be dehydrated on the server */}\n {/* {router.options.ssrFooter && match.matchId === 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\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\n componentDidCatch(error: any, info: any) {\n console.error(`Error in route match: ${this.props.match.id}`)\n console.error(error)\n\n this.setState({\n error,\n info,\n })\n }\n\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\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.\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 = useRouter()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n\n // React.useEffect(() => {\n // if (activeErrorState) {\n // let prevKey = router.store.currentLocation.key\n // return createRoot((dispose) => {\n // createEffect(() => {\n // if (router.store.currentLocation.key !== prevKey) {\n // prevKey = router.store.currentLocation.key\n // setActiveErrorState({} as any)\n // }\n // })\n\n // return dispose\n // })\n // }\n\n // return\n // }, [activeErrorState])\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) {\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\nexport function useAction<\n TKey extends string = string,\n TPayload = unknown,\n TResponse = unknown,\n TError = Error,\n>(\n action: Action<TKey, TPayload, TResponse, TError>,\n opts?: {\n track?: (actionStore: ActionStore<TPayload, TResponse, TError>) => any\n },\n): Action & {\n latestSubmission: ActionSubmission<TPayload, TResponse, TError>\n pendingSubmissions: ActionSubmission<TPayload, TResponse, TError>[]\n} {\n useStore(action.store, (d) => opts?.track?.(d) ?? d, true)\n\n const [ref] = React.useState({})\n\n Object.assign(ref, {\n ...action,\n latestSubmission:\n action.store.state.submissions[action.store.state.submissions.length - 1],\n pendingSubmissions: React.useMemo(\n () =>\n action.store.state.submissions.filter((d) => d.status === 'pending'),\n [action.store.state.submissions],\n ),\n })\n\n return ref as any\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":["useStore","store","selector","d","compareShallow","slice","useSyncExternalStoreWithSelector","subscribe","state","shallow","undefined","objA","objB","Object","is","keysA","keys","length","i","prototype","hasOwnProperty","call","lazy","importer","lazyComp","React","finalComp","preload","useLinkProps","options","router","useRouter","type","children","target","activeProps","className","inactiveProps","activeOptions","disabled","hash","search","params","to","preloadDelay","preloadMaxAge","replace","style","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","rest","linkInfo","buildLink","href","handleClick","handleFocus","handleEnter","handleLeave","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","filter","Boolean","forEach","handler","defaultPrevented","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","join","role","Link","forwardRef","props","ref","linkProps","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","s","status","pendingMatches","useEffect","mount","value","useContext","warning","useRouterStore","useMatches","useMatch","nearestMatch","match","from","find","route","id","invariant","strict","track","useRoute","routeId","resolvedRoute","getRoute","useLoaderData","loaderData","useSearch","useParams","last","useNavigate","defaultOpts","navigate","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","SubOutlet","defaultPending","useCallback","Inner","error","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","CatchBoundary","Component","info","componentDidCatch","console","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","useState","errorState","DefaultErrorBoundary","reset","padding","maxWidth","fontSize","height","message","border","borderRadius","color","useAction","action","assign","latestSubmission","submissions","pendingSubmissions","useMemo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAASA,QAAQ,CACtBC,KAAoB,EACpBC,QAAsC,GAAIC,CAAC,IAAKA,CAAQ,EACxDC,cAAwB,EACxB;EACA,MAAMC,KAAK,GAAGC,gCAAgC,CAC5CL,KAAK,CAACM,SAAS,EACf,MAAMN,KAAK,CAACO,KAAK,EACjB,MAAMP,KAAK,CAACO,KAAK,EACjBN,QAAQ,EACRE,cAAc,GAAGK,OAAO,GAAGC,SAAS,CACrC,CAAA;AAED,EAAA,OAAOL,KAAK,CAAA;AACd,CAAA;AAEA,SAASI,OAAO,CAAIE,IAAO,EAAEC,IAAO,EAAE;EACpC,IAAIC,MAAM,CAACC,EAAE,CAACH,IAAI,EAAEC,IAAI,CAAC,EAAE;AACzB,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,IACE,OAAOD,IAAI,KAAK,QAAQ,IACxBA,IAAI,KAAK,IAAI,IACb,OAAOC,IAAI,KAAK,QAAQ,IACxBA,IAAI,KAAK,IAAI,EACb;AACA,IAAA,OAAO,KAAK,CAAA;AACd,GAAA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,EAAA,MAAMG,KAAK,GAAGF,MAAM,CAACG,IAAI,CAACL,IAAI,CAAC,CAAA;AAC/B,EAAA,IAAII,KAAK,CAACE,MAAM,KAAKJ,MAAM,CAACG,IAAI,CAACJ,IAAI,CAAC,CAACK,MAAM,EAAE;AAC7C,IAAA,OAAO,KAAK,CAAA;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AA;EAE1D,MAAM,CAACgF,GAAG,CAAC,GAAG1D,KAAK,CAACsI,QAAQ,CAAC,EAAE,CAAC,CAAA;AAEhClJ,EAAAA,MAAM,CAACgK,MAAM,CAAC1F,GAAG,EAAE;AACjB,IAAA,GAAGyF,MAAM;IACTE,gBAAgB,EACdF,MAAM,CAAC3K,KAAK,CAACO,KAAK,CAACuK,WAAW,CAACH,MAAM,CAAC3K,KAAK,CAACO,KAAK,CAACuK,WAAW,CAAC9J,MAAM,GAAG,CAAC,CAAC;AAC3E+J,IAAAA,kBAAkB,EAAEvJ,KAAK,CAACwJ,OAAO,CAC/B,MACEL,MAAM,CAAC3K,KAAK,CAACO,KAAK,CAACuK,WAAW,CAACzG,MAAM,CAAEnE,CAAC,IAAKA,CAAC,CAAC+F,MAAM,KAAK,SAAS,CAAC,EACtE,CAAC0E,MAAM,CAAC3K,KAAK,CAACO,KAAK,CAACuK,WAAW,CAAC,CAAA;AAEpC,GAAC,CAAC,CAAA;AAEF,EAAA,OAAO5F,GAAG,CAAA;AACZ,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":"95b5-63","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm","children":[{"name":"@solidjs+reactivity@0.0.6/node_modules/@solidjs/reactivity/dist/index.js","uid":"95b5-65"},{"name":"@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js","uid":"95b5-67"},{"name":"history@5.3.0/node_modules/history/index.js","uid":"95b5-69"},{"name":"tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"95b5-71"}]},{"name":"packages","children":[{"name":"router-core/build/esm/index.js","uid":"95b5-73"},{"name":"react-router/src/index.tsx","uid":"95b5-75"}]}]}],"isRoot":true},"nodeParts":{"95b5-63":{"renderedLength":435,"gzipLength":241,"brotliLength":0,"mainUid":"95b5-62"},"95b5-65":{"renderedLength":11619,"gzipLength":2800,"brotliLength":0,"mainUid":"95b5-64"},"95b5-67":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"95b5-66"},"95b5-69":{"renderedLength":20618,"gzipLength":3797,"brotliLength":0,"mainUid":"95b5-68"},"95b5-71":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"95b5-70"},"95b5-73":{"renderedLength":53590,"gzipLength":12127,"brotliLength":0,"mainUid":"95b5-72"},"95b5-75":{"renderedLength":14141,"gzipLength":3743,"brotliLength":0,"mainUid":"95b5-74"}},"nodeMetas":{"95b5-62":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"95b5-63"},"imported":[],"importedBy":[{"uid":"95b5-74"}]},"95b5-64":{"id":"/node_modules/.pnpm/@solidjs+reactivity@0.0.6/node_modules/@solidjs/reactivity/dist/index.js","moduleParts":{"index.production.js":"95b5-65"},"imported":[],"importedBy":[{"uid":"95b5-74"},{"uid":"95b5-72"}]},"95b5-66":{"id":"/node_modules/.pnpm/@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js","moduleParts":{"index.production.js":"95b5-67"},"imported":[],"importedBy":[{"uid":"95b5-68"}]},"95b5-68":{"id":"/node_modules/.pnpm/history@5.3.0/node_modules/history/index.js","moduleParts":{"index.production.js":"95b5-69"},"imported":[{"uid":"95b5-66"}],"importedBy":[{"uid":"95b5-72"}]},"95b5-70":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"95b5-71"},"imported":[],"importedBy":[{"uid":"95b5-72"}]},"95b5-72":{"id":"/packages/router-core/build/esm/index.js","moduleParts":{"index.production.js":"95b5-73"},"imported":[{"uid":"95b5-68"},{"uid":"95b5-70"},{"uid":"95b5-64"}],"importedBy":[{"uid":"95b5-74"}]},"95b5-74":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"95b5-75"},"imported":[{"uid":"95b5-62"},{"uid":"95b5-76"},{"uid":"95b5-77"},{"uid":"95b5-64"},{"uid":"95b5-72"}],"importedBy":[],"isEntry":true},"95b5-76":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"95b5-74"}],"isExternal":true},"95b5-77":{"id":"use-sync-external-store/shim","moduleParts":{},"imported":[],"importedBy":[{"uid":"95b5-74"}],"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":"59bc-67","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm","children":[{"name":"tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"59bc-69"},{"name":"immer@9.0.16/node_modules/immer/dist/immer.esm.mjs","uid":"59bc-71"}]},{"name":"packages","children":[{"name":"router-core/build/esm/index.js","uid":"59bc-73"},{"name":"react-router/src","children":[{"uid":"59bc-75","name":"useStore.ts"},{"uid":"59bc-77","name":"index.tsx"}]}]}]}],"isRoot":true},"nodeParts":{"59bc-67":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"59bc-66"},"59bc-69":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"59bc-68"},"59bc-71":{"renderedLength":8203,"gzipLength":3238,"brotliLength":0,"mainUid":"59bc-70"},"59bc-73":{"renderedLength":56925,"gzipLength":13448,"brotliLength":0,"mainUid":"59bc-72"},"59bc-75":{"renderedLength":1347,"gzipLength":484,"brotliLength":0,"mainUid":"59bc-74"},"59bc-77":{"renderedLength":12620,"gzipLength":3340,"brotliLength":0,"mainUid":"59bc-76"}},"nodeMetas":{"59bc-66":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"59bc-67"},"imported":[],"importedBy":[{"uid":"59bc-76"}]},"59bc-68":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"59bc-69"},"imported":[],"importedBy":[{"uid":"59bc-72"}]},"59bc-70":{"id":"/node_modules/.pnpm/immer@9.0.16/node_modules/immer/dist/immer.esm.mjs","moduleParts":{"index.production.js":"59bc-71"},"imported":[],"importedBy":[{"uid":"59bc-72"}]},"59bc-72":{"id":"/packages/router-core/build/esm/index.js","moduleParts":{"index.production.js":"59bc-73"},"imported":[{"uid":"59bc-68"},{"uid":"59bc-70"}],"importedBy":[{"uid":"59bc-76"}]},"59bc-74":{"id":"/packages/react-router/src/useStore.ts","moduleParts":{"index.production.js":"59bc-75"},"imported":[{"uid":"59bc-79"}],"importedBy":[{"uid":"59bc-76"}]},"59bc-76":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"59bc-77"},"imported":[{"uid":"59bc-66"},{"uid":"59bc-78"},{"uid":"59bc-72"},{"uid":"59bc-74"}],"importedBy":[],"isEntry":true},"59bc-78":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"59bc-76"}],"isExternal":true},"59bc-79":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"59bc-74"}],"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;
@@ -7,27 +7,19 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "95b5-79",
10
+ "uid": "59bc-81",
11
11
  "name": "\u0000rollupPluginBabelHelpers.js"
12
12
  },
13
13
  {
14
14
  "name": "node_modules/.pnpm",
15
15
  "children": [
16
16
  {
17
- "name": "@solidjs+reactivity@0.0.6/node_modules/@solidjs/reactivity/dist/index.js",
18
- "uid": "95b5-81"
19
- },
20
- {
21
- "name": "@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js",
22
- "uid": "95b5-83"
23
- },
24
- {
25
- "name": "history@5.3.0/node_modules/history/index.js",
26
- "uid": "95b5-85"
17
+ "name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
18
+ "uid": "59bc-83"
27
19
  },
28
20
  {
29
- "name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
30
- "uid": "95b5-87"
21
+ "name": "immer@9.0.16/node_modules/immer/dist/immer.esm.mjs",
22
+ "uid": "59bc-85"
31
23
  }
32
24
  ]
33
25
  },
@@ -36,11 +28,20 @@
36
28
  "children": [
37
29
  {
38
30
  "name": "router-core/build/esm/index.js",
39
- "uid": "95b5-89"
31
+ "uid": "59bc-87"
40
32
  },
41
33
  {
42
- "name": "react-router/src/index.tsx",
43
- "uid": "95b5-91"
34
+ "name": "react-router/src",
35
+ "children": [
36
+ {
37
+ "uid": "59bc-89",
38
+ "name": "useStore.ts"
39
+ },
40
+ {
41
+ "uid": "59bc-91",
42
+ "name": "index.tsx"
43
+ }
44
+ ]
44
45
  }
45
46
  ]
46
47
  }
@@ -50,182 +51,155 @@
50
51
  "isRoot": true
51
52
  },
52
53
  "nodeParts": {
53
- "95b5-79": {
54
- "renderedLength": 435,
55
- "gzipLength": 241,
56
- "brotliLength": 0,
57
- "mainUid": "95b5-78"
58
- },
59
- "95b5-81": {
60
- "renderedLength": 11619,
61
- "gzipLength": 2800,
62
- "brotliLength": 0,
63
- "mainUid": "95b5-80"
64
- },
65
- "95b5-83": {
54
+ "59bc-81": {
66
55
  "renderedLength": 429,
67
56
  "gzipLength": 238,
68
57
  "brotliLength": 0,
69
- "mainUid": "95b5-82"
58
+ "mainUid": "59bc-80"
70
59
  },
71
- "95b5-85": {
72
- "renderedLength": 20618,
73
- "gzipLength": 3797,
74
- "brotliLength": 0,
75
- "mainUid": "95b5-84"
76
- },
77
- "95b5-87": {
60
+ "59bc-83": {
78
61
  "renderedLength": 181,
79
62
  "gzipLength": 129,
80
63
  "brotliLength": 0,
81
- "mainUid": "95b5-86"
64
+ "mainUid": "59bc-82"
82
65
  },
83
- "95b5-89": {
84
- "renderedLength": 53590,
85
- "gzipLength": 12127,
66
+ "59bc-85": {
67
+ "renderedLength": 8203,
68
+ "gzipLength": 3238,
86
69
  "brotliLength": 0,
87
- "mainUid": "95b5-88"
70
+ "mainUid": "59bc-84"
88
71
  },
89
- "95b5-91": {
90
- "renderedLength": 14141,
91
- "gzipLength": 3743,
72
+ "59bc-87": {
73
+ "renderedLength": 56925,
74
+ "gzipLength": 13448,
92
75
  "brotliLength": 0,
93
- "mainUid": "95b5-90"
76
+ "mainUid": "59bc-86"
77
+ },
78
+ "59bc-89": {
79
+ "renderedLength": 1347,
80
+ "gzipLength": 484,
81
+ "brotliLength": 0,
82
+ "mainUid": "59bc-88"
83
+ },
84
+ "59bc-91": {
85
+ "renderedLength": 12620,
86
+ "gzipLength": 3340,
87
+ "brotliLength": 0,
88
+ "mainUid": "59bc-90"
94
89
  }
95
90
  },
96
91
  "nodeMetas": {
97
- "95b5-78": {
92
+ "59bc-80": {
98
93
  "id": "\u0000rollupPluginBabelHelpers.js",
99
94
  "moduleParts": {
100
- "index.production.js": "95b5-79"
95
+ "index.production.js": "59bc-81"
101
96
  },
102
97
  "imported": [],
103
98
  "importedBy": [
104
99
  {
105
- "uid": "95b5-90"
100
+ "uid": "59bc-90"
106
101
  }
107
102
  ]
108
103
  },
109
- "95b5-80": {
110
- "id": "/node_modules/.pnpm/@solidjs+reactivity@0.0.6/node_modules/@solidjs/reactivity/dist/index.js",
104
+ "59bc-82": {
105
+ "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
111
106
  "moduleParts": {
112
- "index.production.js": "95b5-81"
107
+ "index.production.js": "59bc-83"
113
108
  },
114
109
  "imported": [],
115
110
  "importedBy": [
116
111
  {
117
- "uid": "95b5-90"
118
- },
119
- {
120
- "uid": "95b5-88"
112
+ "uid": "59bc-86"
121
113
  }
122
114
  ]
123
115
  },
124
- "95b5-82": {
125
- "id": "/node_modules/.pnpm/@babel+runtime@7.20.6/node_modules/@babel/runtime/helpers/esm/extends.js",
116
+ "59bc-84": {
117
+ "id": "/node_modules/.pnpm/immer@9.0.16/node_modules/immer/dist/immer.esm.mjs",
126
118
  "moduleParts": {
127
- "index.production.js": "95b5-83"
119
+ "index.production.js": "59bc-85"
128
120
  },
129
121
  "imported": [],
130
122
  "importedBy": [
131
123
  {
132
- "uid": "95b5-84"
124
+ "uid": "59bc-86"
133
125
  }
134
126
  ]
135
127
  },
136
- "95b5-84": {
137
- "id": "/node_modules/.pnpm/history@5.3.0/node_modules/history/index.js",
128
+ "59bc-86": {
129
+ "id": "/packages/router-core/build/esm/index.js",
138
130
  "moduleParts": {
139
- "index.production.js": "95b5-85"
131
+ "index.production.js": "59bc-87"
140
132
  },
141
133
  "imported": [
142
134
  {
143
- "uid": "95b5-82"
144
- }
145
- ],
146
- "importedBy": [
135
+ "uid": "59bc-82"
136
+ },
147
137
  {
148
- "uid": "95b5-88"
138
+ "uid": "59bc-84"
149
139
  }
150
- ]
151
- },
152
- "95b5-86": {
153
- "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
154
- "moduleParts": {
155
- "index.production.js": "95b5-87"
156
- },
157
- "imported": [],
140
+ ],
158
141
  "importedBy": [
159
142
  {
160
- "uid": "95b5-88"
143
+ "uid": "59bc-90"
161
144
  }
162
145
  ]
163
146
  },
164
- "95b5-88": {
165
- "id": "/packages/router-core/build/esm/index.js",
147
+ "59bc-88": {
148
+ "id": "/packages/react-router/src/useStore.ts",
166
149
  "moduleParts": {
167
- "index.production.js": "95b5-89"
150
+ "index.production.js": "59bc-89"
168
151
  },
169
152
  "imported": [
170
153
  {
171
- "uid": "95b5-84"
172
- },
173
- {
174
- "uid": "95b5-86"
175
- },
176
- {
177
- "uid": "95b5-80"
154
+ "uid": "59bc-93"
178
155
  }
179
156
  ],
180
157
  "importedBy": [
181
158
  {
182
- "uid": "95b5-90"
159
+ "uid": "59bc-90"
183
160
  }
184
161
  ]
185
162
  },
186
- "95b5-90": {
163
+ "59bc-90": {
187
164
  "id": "/packages/react-router/src/index.tsx",
188
165
  "moduleParts": {
189
- "index.production.js": "95b5-91"
166
+ "index.production.js": "59bc-91"
190
167
  },
191
168
  "imported": [
192
169
  {
193
- "uid": "95b5-78"
194
- },
195
- {
196
- "uid": "95b5-92"
170
+ "uid": "59bc-80"
197
171
  },
198
172
  {
199
- "uid": "95b5-93"
173
+ "uid": "59bc-92"
200
174
  },
201
175
  {
202
- "uid": "95b5-80"
176
+ "uid": "59bc-86"
203
177
  },
204
178
  {
205
- "uid": "95b5-88"
179
+ "uid": "59bc-88"
206
180
  }
207
181
  ],
208
182
  "importedBy": [],
209
183
  "isEntry": true
210
184
  },
211
- "95b5-92": {
185
+ "59bc-92": {
212
186
  "id": "react",
213
187
  "moduleParts": {},
214
188
  "imported": [],
215
189
  "importedBy": [
216
190
  {
217
- "uid": "95b5-90"
191
+ "uid": "59bc-90"
218
192
  }
219
193
  ],
220
194
  "isExternal": true
221
195
  },
222
- "95b5-93": {
223
- "id": "use-sync-external-store/shim",
196
+ "59bc-93": {
197
+ "id": "use-sync-external-store/shim/with-selector",
224
198
  "moduleParts": {},
225
199
  "imported": [],
226
200
  "importedBy": [
227
201
  {
228
- "uid": "95b5-90"
202
+ "uid": "59bc-88"
229
203
  }
230
204
  ],
231
205
  "isExternal": true
@@ -9,9 +9,10 @@
9
9
  * @license MIT
10
10
  */
11
11
  import * as React from 'react';
12
- import { RegisteredAllRouteInfo, LinkOptions, ToOptions, MatchRouteOptions, RouteInfoByPath, ResolveRelativePath, NoInfer, ValidFromPath, RegisteredRouter, AnyRouteConfig, RouteConfig, AnyAllRouteInfo, AllRouteInfo, RouterOptions, Router, DefaultAllRouteInfo, RouterStore, RouteMatch, Route, Expand, Action } from '@tanstack/router-core';
12
+ import { Store, RegisteredAllRouteInfo, LinkOptions, ToOptions, MatchRouteOptions, RouteInfoByPath, ResolveRelativePath, NoInfer, ValidFromPath, RegisteredRouter, AnyRouteConfig, RouteConfig, AnyAllRouteInfo, AllRouteInfo, Router, RouterOptions, DefaultAllRouteInfo, RouterStore, RouteMatch, Route, Expand, Action, ActionStore, ActionSubmission } from '@tanstack/router-core';
13
13
  export * from '@tanstack/router-core';
14
- export * from '@solidjs/reactivity';
14
+
15
+ declare function useStore<TState, TSelected = TState>(store: Store<TState>, selector?: (state: TState) => TSelected, compareShallow?: boolean): TSelected;
15
16
 
16
17
  type ReactNode = any;
17
18
  type SyncRouteComponent<TProps = {}> = (props: TProps) => ReactNode;
@@ -67,47 +68,51 @@ type MatchesProviderProps = {
67
68
  value: MatchesContextValue;
68
69
  children: ReactNode;
69
70
  };
70
- declare const __useStoreValue: <TSeed, TReturn>(seed: () => TSeed, selector?: ((seed: TSeed) => TReturn) | undefined) => TReturn;
71
- declare function createReactRouter<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>, TRouterContext = unknown>(opts: RouterOptions<TRouteConfig, TRouterContext>): Router<TRouteConfig, TAllRouteInfo, TRouterContext>;
71
+ declare class ReactRouter<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>, TRouterContext = unknown> extends Router<TRouteConfig, TAllRouteInfo, TRouterContext> {
72
+ constructor(opts: RouterOptions<TRouteConfig, TRouterContext>);
73
+ }
72
74
  type RouterProps<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouterContext = unknown> = RouterOptions<TRouteConfig, TRouterContext> & {
73
75
  router: Router<TRouteConfig, TAllRouteInfo, TRouterContext>;
74
76
  };
75
77
  declare function RouterProvider<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouterContext = unknown>({ router, ...rest }: RouterProps<TRouteConfig, TAllRouteInfo, TRouterContext>): JSX.Element;
76
78
  declare function useRouter(): RegisteredRouter;
77
- declare function useRouterStore<T = RouterStore>(selector?: (state: Router['store']) => T): T;
79
+ declare function useRouterStore<T = RouterStore>(selector?: (state: Router['store']) => T, shallow?: boolean): T;
78
80
  declare function useMatches(): RouteMatch[];
79
81
  declare function useMatch<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'], TStrict extends boolean = true, TRouteMatch = RouteMatch<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TFrom]>>(opts?: {
80
82
  from: TFrom;
81
83
  strict?: TStrict;
84
+ track?: (match: TRouteMatch) => any;
85
+ shallow?: boolean;
82
86
  }): TStrict extends true ? TRouteMatch : TRouteMatch | undefined;
83
87
  declare function useRoute<TId extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/'>(routeId: TId): Route<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]>;
84
- declare function useLoaderData<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/', TStrict extends boolean = true, TLoaderData = RegisteredAllRouteInfo['routeInfoById'][TFrom]['loaderData'], TSelected = TLoaderData>(opts?: {
88
+ declare function useLoaderData<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/', TStrict extends boolean = true, TLoaderData = RegisteredAllRouteInfo['routeInfoById'][TFrom]['loaderData']>(opts?: {
85
89
  from: TFrom;
86
90
  strict?: TStrict;
87
- select?: (loaderData: TLoaderData) => TSelected;
88
- }): TStrict extends true ? TSelected : TSelected | undefined;
91
+ track?: (loaderData: TLoaderData) => any;
92
+ }): TStrict extends true ? TLoaderData : TLoaderData | undefined;
89
93
  declare function useSearch<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'], TStrict extends boolean = true, TSearch = RegisteredAllRouteInfo['routeInfoById'][TFrom]['fullSearchSchema'], TSelected = TSearch>(opts?: {
90
94
  from: TFrom;
91
95
  strict?: TStrict;
92
- select?: (search: TSearch) => TSelected;
96
+ track?: (search: TSearch) => TSelected;
93
97
  }): TStrict extends true ? TSelected : TSelected | undefined;
94
98
  declare function useParams<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/', TDefaultSelected = Expand<RegisteredAllRouteInfo['allParams'] & RegisteredAllRouteInfo['routeInfoById'][TFrom]['allParams']>, TSelected = TDefaultSelected>(opts?: {
95
99
  from: TFrom;
96
- select?: (search: TDefaultSelected) => TSelected;
100
+ track?: (search: TDefaultSelected) => TSelected;
97
101
  }): TSelected;
98
102
  declare function useNavigate<TDefaultFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/'>(defaultOpts: {
99
103
  from?: TDefaultFrom;
100
104
  }): <TFrom extends string = TDefaultFrom, TTo extends string = ".">(opts: MakeLinkOptions<TFrom, TTo>) => Promise<void>;
101
- declare function useAction<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/', TFromRoute extends RegisteredAllRouteInfo['routeInfoById'][TFrom] = RegisteredAllRouteInfo['routeInfoById'][TFrom]>(opts: {
102
- from: TFrom;
103
- }): Action<TFromRoute['actionPayload'], TFromRoute['actionResponse']>;
104
105
  declare function useMatchRoute(): <TFrom extends ValidFromPath<AnyAllRouteInfo> = "/", TTo extends string = ".">(opts: MakeUseMatchRouteOptions<TFrom, TTo>) => false;
105
106
  declare function MatchRoute<TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/', TTo extends string = '.'>(props: MakeMatchRouteOptions<TFrom, TTo>): any;
106
107
  declare function Outlet(): JSX.Element | null;
107
108
  declare function DefaultErrorBoundary({ error }: {
108
109
  error: any;
109
110
  }): JSX.Element;
110
- declare function usePrompt(message: string, when: boolean | any): void;
111
- declare function Prompt({ message, when, children }: PromptProps): any;
111
+ declare function useAction<TKey extends string = string, TPayload = unknown, TResponse = unknown, TError = Error>(action: Action<TKey, TPayload, TResponse, TError>, opts?: {
112
+ track?: (actionStore: ActionStore<TPayload, TResponse, TError>) => any;
113
+ }): Action & {
114
+ latestSubmission: ActionSubmission<TPayload, TResponse, TError>;
115
+ pendingSubmissions: ActionSubmission<TPayload, TResponse, TError>[];
116
+ };
112
117
 
113
- export { DefaultErrorBoundary, Link, LinkFn, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, MatchesProviderProps, Outlet, Prompt, PromptProps, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, __useStoreValue, createReactRouter, lazy, matchesContext, routerContext, useAction, useLinkProps, useLoaderData, useMatch, useMatchRoute, useMatches, useNavigate, useParams, usePrompt, useRoute, useRouter, useRouterStore, useSearch };
118
+ export { DefaultErrorBoundary, Link, LinkFn, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, MatchesProviderProps, Outlet, PromptProps, ReactRouter, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, lazy, matchesContext, routerContext, useAction, useLinkProps, useLoaderData, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterStore, useSearch, useStore };