@tanstack/react-router 0.0.1-beta.57 → 0.0.1-beta.58
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.
- package/build/cjs/index.js +5 -4
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +5 -4
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +49 -49
- package/build/types/index.d.ts +22 -22
- package/build/umd/index.development.js +132 -81
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +3 -3
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/index.tsx +48 -56
package/build/cjs/index.js
CHANGED
|
@@ -307,6 +307,11 @@ function SubOutlet({
|
|
|
307
307
|
match: match
|
|
308
308
|
}))));
|
|
309
309
|
}
|
|
310
|
+
|
|
311
|
+
// This is the messiest thing ever... I'm either seriously tired (likely) or
|
|
312
|
+
// there has to be a better way to reset error boundaries when the
|
|
313
|
+
// router's location key changes.
|
|
314
|
+
|
|
310
315
|
class CatchBoundary extends React__namespace.Component {
|
|
311
316
|
state = {
|
|
312
317
|
error: false,
|
|
@@ -327,10 +332,6 @@ class CatchBoundary extends React__namespace.Component {
|
|
|
327
332
|
}));
|
|
328
333
|
}
|
|
329
334
|
}
|
|
330
|
-
|
|
331
|
-
// This is the messiest thing ever... I'm either seriously tired (likely) or
|
|
332
|
-
// there has to be a better way to reset error boundaries when the
|
|
333
|
-
// router's location key changes.
|
|
334
335
|
function CatchBoundaryInner(props) {
|
|
335
336
|
const [activeErrorState, setActiveErrorState] = React__namespace.useState(props.errorState);
|
|
336
337
|
const router = useRouter();
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["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} 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 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' {\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.currentMatches,\n undefined,\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 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 === '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 <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.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\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 const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.store.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.store.state.currentLocation.key\n }, [activeErrorState, router.store.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","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","_extends","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","value","useContext","warning","useRouterStore","selector","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","track","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","navigate","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","defaultPending","useCallback","Inner","status","error","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA;;AAUO,SAASA,IAAI,CAClBC,QAAwD,EACxC;AAChB,EAAA,MAAMC,QAAQ,gBAAGC,gBAAK,CAACH,IAAI,CAACC,QAAQ,CAAQ,CAAA;EA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AA,KAAA,EAAA,IAAA,EACGyH,KAAK,CAAC+B,OAAO,gBACZxJ,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACLsJ,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;GAEClC,EAAAA,KAAK,CAAC+B,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 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} 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, 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<RegisteredRoutesInfo> = '/',\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 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\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 AnyRoute = Route,\n TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>,\n TRouterContext = unknown,\n> extends Router<TRouteConfig, TRoutesInfo, 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 AnyRoute = Route,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n TRouterContext = unknown,\n> = RouterOptions<TRouteConfig, TRouterContext> & {\n router: Router<TRouteConfig, TRoutesInfo, TRouterContext>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRoute = Route,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n TRouterContext = unknown,\n>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo, TRouterContext>) {\n router.update(rest)\n\n const currentMatches = useStore(\n router.store,\n (s) => s.currentMatches,\n undefined,\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 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 = 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 RegisteredRoutesInfo['routesById'] = '/',\n>(routeId: TId): RegisteredRoutesInfo['routesById'][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 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 )\n\n return (match as unknown as RouteMatch).store.state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n TDefaultSelected = Expand<\n RegisteredRoutesInfo['allParams'] &\n RegisteredRoutesInfo['routesById'][TFrom]['__types']['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 RegisteredRoutesInfo['routesById'] = '/',\n>(defaultOpts?: { from?: TDefaultFrom }) {\n const router = useRouter()\n return <\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\nexport function useMatchRoute() {\n const router = useRouter()\n\n return <\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\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 = 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 === '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 <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.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 = useRouter()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.store.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.store.state.currentLocation.key\n }, [activeErrorState, router.store.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","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","_extends","matchesContext","createContext","routerContext","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","value","useContext","warning","useRouterStore","selector","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","track","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","navigate","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","defaultPending","useCallback","Inner","status","error","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;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;AAwEA;;AAEO,SAASE,YAAY,CAI1BC,OAAyC,EACM;EAC/C,MAAMC,QAAM,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,QAAQ;AACR;IACAC,IAAI;IACJC,MAAM;IACNC,MAAM;AACNC,IAAAA,EAAE,GAAG,GAAG;IACRhB,OAAO;IACPiB,YAAY;IACZC,aAAa;IACbC,OAAO;AACP;IACAC,KAAK;IACLX,SAAS;IACTY,OAAO;IACPC,OAAO;IACPC,YAAY;IACZC,YAAY;IAC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,EAAE;EAC9D,oBACEzH,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,KAAK,EAAE;AAAEoJ,MAAAA,OAAO,EAAE,OAAO;AAAEC,MAAAA,QAAQ,EAAE,MAAA;AAAO,KAAA;GAC/C,eAAArJ,gBAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAQ,IAAA,KAAK,EAAE;AAAEsJ,MAAAA,QAAQ,EAAE,QAAA;AAAS,KAAA;AAAE,GAAA,EAAA,uBAAA,CAA+B,eACrEtJ,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,KAAK,EAAE;AAAEuJ,MAAAA,MAAM,EAAE,OAAA;AAAQ,KAAA;AAAE,GAAA,CAAG,eACnCvJ,gBACE,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,eAAAA,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EACGyH,KAAK,CAAC+B,OAAO,gBACZxJ,gBAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AACE,IAAA,KAAK,EAAE;AACLsJ,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;GAEClC,EAAAA,KAAK,CAAC+B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/esm/index.js
CHANGED
|
@@ -299,6 +299,11 @@ function SubOutlet({
|
|
|
299
299
|
match: match
|
|
300
300
|
}))));
|
|
301
301
|
}
|
|
302
|
+
|
|
303
|
+
// This is the messiest thing ever... I'm either seriously tired (likely) or
|
|
304
|
+
// there has to be a better way to reset error boundaries when the
|
|
305
|
+
// router's location key changes.
|
|
306
|
+
|
|
302
307
|
class CatchBoundary extends React.Component {
|
|
303
308
|
state = {
|
|
304
309
|
error: false,
|
|
@@ -319,10 +324,6 @@ class CatchBoundary extends React.Component {
|
|
|
319
324
|
}));
|
|
320
325
|
}
|
|
321
326
|
}
|
|
322
|
-
|
|
323
|
-
// This is the messiest thing ever... I'm either seriously tired (likely) or
|
|
324
|
-
// there has to be a better way to reset error boundaries when the
|
|
325
|
-
// router's location key changes.
|
|
326
327
|
function CatchBoundaryInner(props) {
|
|
327
328
|
const [activeErrorState, setActiveErrorState] = React.useState(props.errorState);
|
|
328
329
|
const router = useRouter();
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["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} 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 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' {\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.currentMatches,\n undefined,\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 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 === '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 <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.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\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 const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.store.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.store.state.currentLocation.key\n }, [activeErrorState, router.store.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","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","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","value","useContext","warning","useRouterStore","selector","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","track","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","navigate","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","defaultPending","useCallback","Inner","status","error","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA;;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;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,QAAQ;AACR;IACAC,IAAI;IACJC,MAAM;IACNC,MAAM;AACNC,IAAAA,EAAE,GAAG,GAAG;IACRhB,OAAO;IACPiB,YAAY;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ErB,EAAAA,KAAAA;AAAsB,CAAC,EAAE;EAC9D,oBACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,KAAK,EAAE;AAAE2B,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,EACG9B,KAAK,CAAC+B,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;GAEClC,EAAAA,KAAK,CAAC+B,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 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} 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, 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<RegisteredRoutesInfo> = '/',\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 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\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 AnyRoute = Route,\n TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>,\n TRouterContext = unknown,\n> extends Router<TRouteConfig, TRoutesInfo, 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 AnyRoute = Route,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n TRouterContext = unknown,\n> = RouterOptions<TRouteConfig, TRouterContext> & {\n router: Router<TRouteConfig, TRoutesInfo, TRouterContext>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRoute = Route,\n TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo,\n TRouterContext = unknown,\n>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo, TRouterContext>) {\n router.update(rest)\n\n const currentMatches = useStore(\n router.store,\n (s) => s.currentMatches,\n undefined,\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 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 = 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 RegisteredRoutesInfo['routesById'] = '/',\n>(routeId: TId): RegisteredRoutesInfo['routesById'][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 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 )\n\n return (match as unknown as RouteMatch).store.state.search as any\n}\n\nexport function useParams<\n TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/',\n TDefaultSelected = Expand<\n RegisteredRoutesInfo['allParams'] &\n RegisteredRoutesInfo['routesById'][TFrom]['__types']['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 RegisteredRoutesInfo['routesById'] = '/',\n>(defaultOpts?: { from?: TDefaultFrom }) {\n const router = useRouter()\n return <\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\nexport function useMatchRoute() {\n const router = useRouter()\n\n return <\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\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 = 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 === '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 <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.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 = useRouter()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n const prevKeyRef = React.useRef('' as any)\n\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.store.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({} as any)\n }\n }\n\n prevKeyRef.current = router.store.state.currentLocation.key\n }, [activeErrorState, router.store.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","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","ReactRouter","Router","constructor","opts","loadComponent","component","RouterProvider","update","currentMatches","useStore","store","s","useEffect","mount","value","useContext","warning","useRouterStore","selector","shallow","useMatches","useMatch","nearestMatch","match","from","state","find","d","route","id","invariant","strict","track","useRoute","routeId","resolvedRoute","getRoute","useSearch","useParams","last","useNavigate","defaultOpts","navigate","useMatchRoute","pending","caseSensitive","matchRoute","MatchRoute","Outlet","matches","slice","SubOutlet","defaultPending","useCallback","Inner","status","error","createElement","defaultComponent","__loadPromise","PendingComponent","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;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;AAwEA;;AAEO,S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C,EAAAA,KAAK,CAAC+B,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;;;;"}
|
package/build/stats-html.html
CHANGED
|
@@ -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":"
|
|
4027
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"uid":"c2ff-85","name":"\u0000rollupPluginBabelHelpers.js"},{"name":"node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","uid":"c2ff-87"},{"name":"packages","children":[{"name":"store/build/esm/index.js","uid":"c2ff-89"},{"name":"router/build/esm/index.js","uid":"c2ff-91"},{"name":"react-store/build/esm/index.js","uid":"c2ff-93"},{"name":"react-router/src/index.tsx","uid":"c2ff-95"}]}]}],"isRoot":true},"nodeParts":{"c2ff-85":{"renderedLength":429,"gzipLength":238,"brotliLength":0,"mainUid":"c2ff-84"},"c2ff-87":{"renderedLength":181,"gzipLength":129,"brotliLength":0,"mainUid":"c2ff-86"},"c2ff-89":{"renderedLength":1290,"gzipLength":496,"brotliLength":0,"mainUid":"c2ff-88"},"c2ff-91":{"renderedLength":44621,"gzipLength":10817,"brotliLength":0,"mainUid":"c2ff-90"},"c2ff-93":{"renderedLength":1571,"gzipLength":594,"brotliLength":0,"mainUid":"c2ff-92"},"c2ff-95":{"renderedLength":11729,"gzipLength":3116,"brotliLength":0,"mainUid":"c2ff-94"}},"nodeMetas":{"c2ff-84":{"id":"\u0000rollupPluginBabelHelpers.js","moduleParts":{"index.production.js":"c2ff-85"},"imported":[],"importedBy":[{"uid":"c2ff-94"}]},"c2ff-86":{"id":"/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","moduleParts":{"index.production.js":"c2ff-87"},"imported":[],"importedBy":[{"uid":"c2ff-90"}]},"c2ff-88":{"id":"/packages/store/build/esm/index.js","moduleParts":{"index.production.js":"c2ff-89"},"imported":[],"importedBy":[{"uid":"c2ff-90"}]},"c2ff-90":{"id":"/packages/router/build/esm/index.js","moduleParts":{"index.production.js":"c2ff-91"},"imported":[{"uid":"c2ff-86"},{"uid":"c2ff-88"}],"importedBy":[{"uid":"c2ff-94"}]},"c2ff-92":{"id":"/packages/react-store/build/esm/index.js","moduleParts":{"index.production.js":"c2ff-93"},"imported":[{"uid":"c2ff-97"}],"importedBy":[{"uid":"c2ff-94"}]},"c2ff-94":{"id":"/packages/react-router/src/index.tsx","moduleParts":{"index.production.js":"c2ff-95"},"imported":[{"uid":"c2ff-84"},{"uid":"c2ff-96"},{"uid":"c2ff-90"},{"uid":"c2ff-92"}],"importedBy":[],"isEntry":true},"c2ff-96":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"c2ff-94"}],"isExternal":true},"c2ff-97":{"id":"use-sync-external-store/shim/with-selector","moduleParts":{},"imported":[],"importedBy":[{"uid":"c2ff-92"}],"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;
|