@tanstack/solid-router 1.111.3 → 1.111.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/source/Asset.d.ts +2 -0
  2. package/dist/source/Asset.jsx +22 -0
  3. package/dist/source/Asset.jsx.map +1 -0
  4. package/dist/source/CatchBoundary.d.ts +11 -0
  5. package/dist/source/CatchBoundary.jsx +43 -0
  6. package/dist/source/CatchBoundary.jsx.map +1 -0
  7. package/dist/source/HeadContent.d.ts +8 -0
  8. package/dist/source/HeadContent.jsx +125 -0
  9. package/dist/source/HeadContent.jsx.map +1 -0
  10. package/dist/source/Match.d.ts +8 -0
  11. package/dist/source/Match.jsx +256 -0
  12. package/dist/source/Match.jsx.map +1 -0
  13. package/dist/source/Matches.d.ts +67 -0
  14. package/dist/source/Matches.jsx +103 -0
  15. package/dist/source/Matches.jsx.map +1 -0
  16. package/dist/source/RouterProvider.d.ts +10 -0
  17. package/dist/source/RouterProvider.jsx +27 -0
  18. package/dist/source/RouterProvider.jsx.map +1 -0
  19. package/dist/source/SafeFragment.d.ts +1 -0
  20. package/dist/source/SafeFragment.jsx +4 -0
  21. package/dist/source/SafeFragment.jsx.map +1 -0
  22. package/dist/source/ScriptOnce.d.ts +5 -0
  23. package/dist/source/ScriptOnce.jsx +17 -0
  24. package/dist/source/ScriptOnce.jsx.map +1 -0
  25. package/dist/source/Scripts.d.ts +1 -0
  26. package/dist/source/Scripts.jsx +49 -0
  27. package/dist/source/Scripts.jsx.map +1 -0
  28. package/dist/source/ScrollRestoration.d.ts +15 -0
  29. package/dist/source/ScrollRestoration.jsx +36 -0
  30. package/dist/source/ScrollRestoration.jsx.map +1 -0
  31. package/dist/source/Transitioner.d.ts +1 -0
  32. package/dist/source/Transitioner.jsx +112 -0
  33. package/dist/source/Transitioner.jsx.map +1 -0
  34. package/dist/source/awaited.d.ts +11 -0
  35. package/dist/source/awaited.jsx +24 -0
  36. package/dist/source/awaited.jsx.map +1 -0
  37. package/dist/source/fileRoute.d.ts +46 -0
  38. package/dist/source/fileRoute.js +85 -0
  39. package/dist/source/fileRoute.js.map +1 -0
  40. package/dist/source/history.d.ts +8 -0
  41. package/dist/source/history.js +2 -0
  42. package/dist/source/history.js.map +1 -0
  43. package/dist/source/index.d.ts +52 -0
  44. package/dist/source/index.jsx +41 -0
  45. package/dist/source/index.jsx.map +1 -0
  46. package/dist/source/lazyRouteComponent.d.ts +7 -0
  47. package/dist/source/lazyRouteComponent.jsx +82 -0
  48. package/dist/source/lazyRouteComponent.jsx.map +1 -0
  49. package/dist/source/link.d.ts +41 -0
  50. package/dist/source/link.jsx +339 -0
  51. package/dist/source/link.jsx.map +1 -0
  52. package/dist/source/matchContext.d.ts +3 -0
  53. package/dist/source/matchContext.jsx +5 -0
  54. package/dist/source/matchContext.jsx.map +1 -0
  55. package/dist/source/not-found.d.ts +27 -0
  56. package/dist/source/not-found.jsx +39 -0
  57. package/dist/source/not-found.jsx.map +1 -0
  58. package/dist/source/redirects.d.ts +19 -0
  59. package/dist/source/redirects.js +25 -0
  60. package/dist/source/redirects.js.map +1 -0
  61. package/dist/source/renderRouteNotFound.d.ts +3 -0
  62. package/dist/source/renderRouteNotFound.jsx +15 -0
  63. package/dist/source/renderRouteNotFound.jsx.map +1 -0
  64. package/dist/source/route.d.ts +257 -0
  65. package/dist/source/route.js +240 -0
  66. package/dist/source/route.js.map +1 -0
  67. package/dist/source/router.d.ts +550 -0
  68. package/dist/source/router.js +1802 -0
  69. package/dist/source/router.js.map +1 -0
  70. package/dist/source/routerContext.d.ts +8 -0
  71. package/dist/source/routerContext.jsx +13 -0
  72. package/dist/source/routerContext.jsx.map +1 -0
  73. package/dist/source/scroll-restoration.d.ts +29 -0
  74. package/dist/source/scroll-restoration.jsx +244 -0
  75. package/dist/source/scroll-restoration.jsx.map +1 -0
  76. package/dist/source/typePrimitives.d.ts +70 -0
  77. package/dist/source/typePrimitives.js +2 -0
  78. package/dist/source/typePrimitives.js.map +1 -0
  79. package/dist/source/useBlocker.d.ts +68 -0
  80. package/dist/source/useBlocker.jsx +136 -0
  81. package/dist/source/useBlocker.jsx.map +1 -0
  82. package/dist/source/useCanGoBack.d.ts +1 -0
  83. package/dist/source/useCanGoBack.js +5 -0
  84. package/dist/source/useCanGoBack.js.map +1 -0
  85. package/dist/source/useLoaderData.d.ts +12 -0
  86. package/dist/source/useLoaderData.jsx +11 -0
  87. package/dist/source/useLoaderData.jsx.map +1 -0
  88. package/dist/source/useLoaderDeps.d.ts +11 -0
  89. package/dist/source/useLoaderDeps.jsx +11 -0
  90. package/dist/source/useLoaderDeps.jsx.map +1 -0
  91. package/dist/source/useLocation.d.ts +7 -0
  92. package/dist/source/useLocation.jsx +7 -0
  93. package/dist/source/useLocation.jsx.map +1 -0
  94. package/dist/source/useMatch.d.ts +14 -0
  95. package/dist/source/useMatch.jsx +19 -0
  96. package/dist/source/useMatch.jsx.map +1 -0
  97. package/dist/source/useNavigate.d.ts +7 -0
  98. package/dist/source/useNavigate.jsx +32 -0
  99. package/dist/source/useNavigate.jsx.map +1 -0
  100. package/dist/source/useParams.d.ts +14 -0
  101. package/dist/source/useParams.jsx +12 -0
  102. package/dist/source/useParams.jsx.map +1 -0
  103. package/dist/source/useRouteContext.d.ts +12 -0
  104. package/dist/source/useRouteContext.js +8 -0
  105. package/dist/source/useRouteContext.js.map +1 -0
  106. package/dist/source/useRouter.d.ts +4 -0
  107. package/dist/source/useRouter.jsx +9 -0
  108. package/dist/source/useRouter.jsx.map +1 -0
  109. package/dist/source/useRouterState.d.ts +8 -0
  110. package/dist/source/useRouterState.jsx +14 -0
  111. package/dist/source/useRouterState.jsx.map +1 -0
  112. package/dist/source/useSearch.d.ts +14 -0
  113. package/dist/source/useSearch.jsx +12 -0
  114. package/dist/source/useSearch.jsx.map +1 -0
  115. package/dist/source/utils.d.ts +43 -0
  116. package/dist/source/utils.js +59 -0
  117. package/dist/source/utils.js.map +1 -0
  118. package/package.json +5 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/history.ts"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
1
+ export { default as invariant } from 'tiny-invariant';
2
+ export { default as warning } from 'tiny-warning';
3
+ export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, escapeJSON, // SSR
4
+ pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, shallow, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
5
+ export type { StartSerializer, Serializable, SerializerParse, SerializerParseBy, SerializerStringify, SerializerStringifyBy, DeferredPromiseState, DeferredPromise, ParsedLocation, ParsePathParams, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, ParseSplatParams, SplatParams, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, ExtractedEntry, ExtractedStream, ExtractedPromise, StreamState, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, } from '@tanstack/router-core';
6
+ export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
7
+ export type { BlockerFn, HistoryLocation, RouterHistory, ParsedPath, HistoryState, } from '@tanstack/history';
8
+ export { useAwaited, Await } from './awaited';
9
+ export type { AwaitOptions } from './awaited';
10
+ export { CatchBoundary, ErrorComponent } from './CatchBoundary';
11
+ export { FileRoute, createFileRoute, FileRouteLoader, LazyRoute, createLazyRoute, createLazyFileRoute, } from './fileRoute';
12
+ export type { LazyRouteOptions } from './fileRoute';
13
+ export * from './history';
14
+ export { lazyRouteComponent } from './lazyRouteComponent';
15
+ export { useLinkProps, createLink, Link, linkOptions } from './link';
16
+ export type { UseLinkPropsOptions, ActiveLinkOptions, LinkProps, LinkComponent, LinkComponentProps, CreateLinkProps, } from './link';
17
+ export { Matches, useMatchRoute, MatchRoute, useMatches, useParentMatches, useChildMatches, } from './Matches';
18
+ export type { RouteMatch, AnyRouteMatch, MatchRouteOptions, UseMatchRouteOptions, MakeMatchRouteOptions, MakeRouteMatch, MakeRouteMatchUnion, } from './Matches';
19
+ export { matchContext } from './matchContext';
20
+ export { Match, Outlet } from './Match';
21
+ export { useMatch } from './useMatch';
22
+ export { useLoaderDeps } from './useLoaderDeps';
23
+ export { useLoaderData } from './useLoaderData';
24
+ export { redirect, isRedirect } from './redirects';
25
+ export type { AnyRedirect, Redirect, ResolvedRedirect } from './redirects';
26
+ export { RouteApi, getRouteApi, Route, createRoute, RootRoute, rootRouteWithContext, createRootRoute, createRootRouteWithContext, createRouteMask, NotFoundRoute, } from './route';
27
+ export type { RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, AnyRoute, RouteConstraints, AnyRootRoute, ResolveFullPath, RouteMask, SolidNode, SyncRouteComponent, AsyncRouteComponent, RouteComponent, ErrorRouteComponent, NotFoundRouteComponent, RootRouteOptions, AnyRouteWithContext, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, } from './route';
28
+ export { componentTypes, createRouter, Router, lazyFn, SearchParamError, PathParamError, getInitialRouterState, } from './router';
29
+ export type { AnyRouter, RegisteredRouter, RouterContextOptions, RouterOptions, RouterErrorSerializer, RouterState, ListenerFn, BuildNextOptions, RouterConstructorOptions, RouterEvents, RouterEvent, RouterListener, ControllablePromise, InjectedHtmlEntry, } from './router';
30
+ export { RouterProvider, RouterContextProvider } from './RouterProvider';
31
+ export type { RouterProps } from './RouterProvider';
32
+ export { useElementScrollRestoration, ScrollRestoration, } from './ScrollRestoration';
33
+ export type { UseBlockerOpts, ShouldBlockFn } from './useBlocker';
34
+ export { useBlocker, Block } from './useBlocker';
35
+ export { useNavigate, Navigate } from './useNavigate';
36
+ export type { UseNavigateResult } from './useNavigate';
37
+ export { useParams } from './useParams';
38
+ export { useSearch } from './useSearch';
39
+ export { getRouterContext, } from './routerContext';
40
+ export { useRouteContext } from './useRouteContext';
41
+ export { useRouter } from './useRouter';
42
+ export { useRouterState } from './useRouterState';
43
+ export { useLocation } from './useLocation';
44
+ export { useCanGoBack } from './useCanGoBack';
45
+ export { useLayoutEffect } from './utils';
46
+ export { notFound, isNotFound, CatchNotFound, DefaultGlobalNotFound, } from './not-found';
47
+ export type { NotFoundError } from './not-found';
48
+ export * from './typePrimitives';
49
+ export { ScriptOnce } from './ScriptOnce';
50
+ export { Asset } from './Asset';
51
+ export { HeadContent } from './HeadContent';
52
+ export { Scripts } from './Scripts';
@@ -0,0 +1,41 @@
1
+ export { default as invariant } from 'tiny-invariant';
2
+ export { default as warning } from 'tiny-warning';
3
+ export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, escapeJSON, // SSR
4
+ pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, shallow, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
5
+ export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
6
+ export { useAwaited, Await } from './awaited';
7
+ export { CatchBoundary, ErrorComponent } from './CatchBoundary';
8
+ export { FileRoute, createFileRoute, FileRouteLoader, LazyRoute, createLazyRoute, createLazyFileRoute, } from './fileRoute';
9
+ export * from './history';
10
+ export { lazyRouteComponent } from './lazyRouteComponent';
11
+ export { useLinkProps, createLink, Link, linkOptions } from './link';
12
+ export { Matches, useMatchRoute, MatchRoute, useMatches, useParentMatches, useChildMatches, } from './Matches';
13
+ export { matchContext } from './matchContext';
14
+ export { Match, Outlet } from './Match';
15
+ export { useMatch } from './useMatch';
16
+ export { useLoaderDeps } from './useLoaderDeps';
17
+ export { useLoaderData } from './useLoaderData';
18
+ export { redirect, isRedirect } from './redirects';
19
+ export { RouteApi, getRouteApi, Route, createRoute, RootRoute, rootRouteWithContext, createRootRoute, createRootRouteWithContext, createRouteMask, NotFoundRoute, } from './route';
20
+ export { componentTypes, createRouter, Router, lazyFn, SearchParamError, PathParamError, getInitialRouterState, } from './router';
21
+ export { RouterProvider, RouterContextProvider } from './RouterProvider';
22
+ export { useElementScrollRestoration, ScrollRestoration, } from './ScrollRestoration';
23
+ export { useBlocker, Block } from './useBlocker';
24
+ export { useNavigate, Navigate } from './useNavigate';
25
+ export { useParams } from './useParams';
26
+ export { useSearch } from './useSearch';
27
+ export { getRouterContext, // SSR
28
+ } from './routerContext';
29
+ export { useRouteContext } from './useRouteContext';
30
+ export { useRouter } from './useRouter';
31
+ export { useRouterState } from './useRouterState';
32
+ export { useLocation } from './useLocation';
33
+ export { useCanGoBack } from './useCanGoBack';
34
+ export { useLayoutEffect } from './utils';
35
+ export { notFound, isNotFound, CatchNotFound, DefaultGlobalNotFound, } from './not-found';
36
+ export * from './typePrimitives';
37
+ export { ScriptOnce } from './ScriptOnce';
38
+ export { Asset } from './Asset';
39
+ export { HeadContent } from './HeadContent';
40
+ export { Scripts } from './Scripts';
41
+ //# sourceMappingURL=index.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA;AAEjD,OAAO,EACL,KAAK,EACL,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,SAAS,EACT,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,MAAM,EACN,MAAM,EACN,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,UAAU,EAAE,MAAM;AAClB,IAAI,EACJ,gBAAgB,EAChB,gBA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,EACZ,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,qBAAqB,GACtB,MAAM,UAAU,CAAA;AAmBjB,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAGxE,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EACL,gBAAgB,EAAE,MAAM;EACzB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,aAAa,CAAA;AAGpB,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type * as Solid from 'solid-js';
2
+ import type { AsyncRouteComponent } from './route';
3
+ export declare function ClientOnly(props: Solid.ParentProps<{
4
+ fallback?: Solid.JSX.Element;
5
+ }>): Solid.JSX.Element;
6
+ export declare function useHydrated(): boolean;
7
+ export declare function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(importer: () => Promise<T>, exportName?: TKey, ssr?: () => boolean): T[TKey] extends (props: infer TProps) => any ? AsyncRouteComponent<TProps> : never;
@@ -0,0 +1,82 @@
1
+ import { Dynamic, isServer } from 'solid-js/web';
2
+ import { Outlet } from './Match';
3
+ // If the load fails due to module not found, it may mean a new version of
4
+ // the build was deployed and the user's browser is still using an old version.
5
+ // If this happens, the old version in the user's browser would have an outdated
6
+ // URL to the lazy module.
7
+ // In that case, we want to attempt one window refresh to get the latest.
8
+ function isModuleNotFoundError(error) {
9
+ return (typeof error?.message === 'string' &&
10
+ /Failed to fetch dynamically imported module/.test(error.message));
11
+ }
12
+ export function ClientOnly(props) {
13
+ return useHydrated() ? <>{props.children}</> : <>{props.fallback}</>;
14
+ }
15
+ export function useHydrated() {
16
+ return isServer;
17
+ }
18
+ export function lazyRouteComponent(importer, exportName, ssr) {
19
+ let loadPromise;
20
+ let comp;
21
+ let error;
22
+ const load = () => {
23
+ if (typeof document === 'undefined' && ssr?.() === false) {
24
+ comp = (() => null);
25
+ return Promise.resolve();
26
+ }
27
+ if (!loadPromise) {
28
+ loadPromise = importer()
29
+ .then((res) => {
30
+ loadPromise = undefined;
31
+ comp = res[exportName ?? 'default'];
32
+ })
33
+ .catch((err) => {
34
+ error = err;
35
+ });
36
+ }
37
+ return loadPromise;
38
+ };
39
+ const lazyComp = function Lazy(props) {
40
+ // Now that we're out of preload and into actual render path,
41
+ // throw the error if it was a module not found error during preload
42
+ if (error) {
43
+ if (isModuleNotFoundError(error)) {
44
+ // We don't want an error thrown from preload in this case, because
45
+ // there's nothing we want to do about module not found during preload.
46
+ // Record the error, recover the promise with a null return,
47
+ // and we will attempt module not found resolution during the render path.
48
+ if (error instanceof Error &&
49
+ typeof window !== 'undefined' &&
50
+ typeof sessionStorage !== 'undefined') {
51
+ // Again, we want to reload one time on module not found error and not enter
52
+ // a reload loop if there is some other issue besides an old deploy.
53
+ // That's why we store our reload attempt in sessionStorage.
54
+ // Use error.message as key because it contains the module path that failed.
55
+ const storageKey = `tanstack_router_reload:${error.message}`;
56
+ if (!sessionStorage.getItem(storageKey)) {
57
+ sessionStorage.setItem(storageKey, '1');
58
+ window.location.reload();
59
+ // Return empty component while we wait for window to reload
60
+ return {
61
+ default: () => null,
62
+ };
63
+ }
64
+ }
65
+ }
66
+ // Otherwise, just throw the error
67
+ throw error;
68
+ }
69
+ if (!comp) {
70
+ throw load();
71
+ }
72
+ if (ssr?.() === false) {
73
+ return (<ClientOnly fallback={<Outlet />}>
74
+ <Dynamic component={comp} {...props}/>
75
+ </ClientOnly>);
76
+ }
77
+ return <Dynamic component={comp} {...props}/>;
78
+ };
79
+ lazyComp.preload = load;
80
+ return lazyComp;
81
+ }
82
+ //# sourceMappingURL=lazyRouteComponent.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazyRouteComponent.jsx","sourceRoot":"","sources":["../../src/lazyRouteComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIhC,0EAA0E;AAC1E,+EAA+E;AAC/E,gFAAgF;AAChF,0BAA0B;AAC1B,yEAAyE;AACzE,SAAS,qBAAqB,CAAC,KAAU;IACvC,OAAO,CACL,OAAO,KAAK,EAAE,OAAO,KAAK,QAAQ;QAClC,6CAA6C,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAClE,CAAA;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,KAA0D;IAE1D,OAAO,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CA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AAU,GAAG,0BAA0B,KAAK,CAAC,OAAO,EAAE,CAAA;oBAC5D,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;wBACxC,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;wBACvC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;wBAExB,4DAA4D;wBAC5D,OAAO;4BACL,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;yBACpB,CAAA;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,kCAAkC;YAClC,MAAM,KAAK,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,EAAE,CAAA;QACd,CAAC;QAED,IAAI,GAAG,EAAE,EAAE,KAAK,KAAK,EAAE,CAAC;YACtB,OAAO,CACL,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,AAAD,EAAG,CAAC,CAC/B;UAAA,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,EACtC;QAAA,EAAE,UAAU,CAAC,CACd,CAAA;QACH,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAA;IAChD,CAAC,CAEA;IAAC,QAAgB,CAAC,OAAO,GAAG,IAAI,CAAA;IAEjC,OAAO,QAAe,CAAA;AACxB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import * as Solid from 'solid-js';
2
+ import type { Constrain, LinkOptions, RoutePaths } from '@tanstack/router-core';
3
+ import type { AnyRouter, RegisteredRouter } from './router';
4
+ import type { ValidateLinkOptions, ValidateLinkOptionsArray } from './typePrimitives';
5
+ export declare function useLinkProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string = '', TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = ''>(options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): Solid.ComponentProps<'a'>;
6
+ export type UseLinkPropsOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string | undefined = '.', TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = '.'> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & Omit<Solid.ComponentProps<'a'>, 'style'> & {
7
+ style?: Solid.JSX.CSSProperties;
8
+ };
9
+ export type ActiveLinkOptions<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & ActiveLinkOptionProps<TComp>;
10
+ type ActiveLinkProps<TComp> = Partial<LinkComponentSolidProps<TComp> & {
11
+ [key: `data-${string}`]: unknown;
12
+ }>;
13
+ export interface ActiveLinkOptionProps<TComp = 'a'> {
14
+ /**
15
+ * A function that returns additional props for the `active` state of this link.
16
+ * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)
17
+ */
18
+ activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>);
19
+ /**
20
+ * A function that returns additional props for the `inactive` state of this link.
21
+ * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)
22
+ */
23
+ inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>);
24
+ }
25
+ export type LinkProps<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & LinkPropsChildren;
26
+ export interface LinkPropsChildren {
27
+ children?: Solid.JSX.Element | ((state: {
28
+ isActive: boolean;
29
+ isTransitioning: boolean;
30
+ }) => Solid.JSX.Element);
31
+ }
32
+ type LinkComponentSolidProps<TComp> = TComp extends Solid.ValidComponent ? Omit<Solid.ComponentProps<TComp>, keyof CreateLinkProps> : never;
33
+ export type LinkComponentProps<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkComponentSolidProps<TComp> & LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
34
+ export type CreateLinkProps = LinkProps<any, any, string, string, string, string>;
35
+ export type LinkComponent<TComp> = <TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Solid.JSX.Element;
36
+ export declare function createLink<const TComp>(Comp: Constrain<TComp, any, (props: CreateLinkProps) => Solid.JSX.Element>): LinkComponent<TComp>;
37
+ export declare const Link: LinkComponent<'a'>;
38
+ export type LinkOptionsFnOptions<TOptions, TComp, TRouter extends AnyRouter = RegisteredRouter> = TOptions extends ReadonlyArray<any> ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp> : ValidateLinkOptions<TRouter, TOptions, string, TComp>;
39
+ export type LinkOptionsFn<TComp> = <const TOptions, TRouter extends AnyRouter = RegisteredRouter>(options: LinkOptionsFnOptions<TOptions, TComp, TRouter>) => TOptions;
40
+ export declare const linkOptions: LinkOptionsFn<'a'>;
41
+ export {};
@@ -0,0 +1,339 @@
1
+ import * as Solid from 'solid-js';
2
+ import { mergeRefs } from '@solid-primitives/refs';
3
+ import { deepEqual, exactPathTest, functionalUpdate, preloadWarning, removeTrailingSlash, } from '@tanstack/router-core';
4
+ import { Dynamic } from 'solid-js/web';
5
+ import { useRouterState } from './useRouterState';
6
+ import { useRouter } from './useRouter';
7
+ import { useIntersectionObserver } from './utils';
8
+ import { useMatch } from './useMatch';
9
+ export function useLinkProps(options) {
10
+ const router = useRouter();
11
+ const [isTransitioning, setIsTransitioning] = Solid.createSignal(false);
12
+ let hasRenderFetched = false;
13
+ const [local, rest] = Solid.splitProps(Solid.mergeProps({
14
+ activeProps: () => ({ class: 'active' }),
15
+ inactiveProps: () => ({}),
16
+ }, options), [
17
+ 'activeProps',
18
+ 'inactiveProps',
19
+ 'activeOptions',
20
+ 'to',
21
+ 'preload',
22
+ 'preloadDelay',
23
+ 'hashScrollIntoView',
24
+ 'replace',
25
+ 'startTransition',
26
+ 'resetScroll',
27
+ 'viewTransition',
28
+ 'children',
29
+ 'target',
30
+ 'disabled',
31
+ 'style',
32
+ 'class',
33
+ 'onClick',
34
+ 'onFocus',
35
+ 'onMouseEnter',
36
+ 'onMouseLeave',
37
+ 'onMouseOver',
38
+ 'onMouseOut',
39
+ 'onTouchStart',
40
+ 'ignoreBlocker',
41
+ ]);
42
+ // const {
43
+ // // custom props
44
+ // activeProps = () => ({ class: 'active' }),
45
+ // inactiveProps = () => ({}),
46
+ // activeOptions,
47
+ // to,
48
+ // preload: userPreload,
49
+ // preloadDelay: userPreloadDelay,
50
+ // hashScrollIntoView,
51
+ // replace,
52
+ // startTransition,
53
+ // resetScroll,
54
+ // viewTransition,
55
+ // // element props
56
+ // children,
57
+ // target,
58
+ // disabled,
59
+ // style,
60
+ // class,
61
+ // onClick,
62
+ // onFocus,
63
+ // onMouseEnter,
64
+ // onMouseLeave,
65
+ // onTouchStart,
66
+ // ignoreBlocker,
67
+ // ...rest
68
+ // } = options
69
+ const [_, propsSafeToSpread] = Solid.splitProps(rest, [
70
+ 'params',
71
+ 'search',
72
+ 'hash',
73
+ 'state',
74
+ 'mask',
75
+ 'reloadDocument',
76
+ ]);
77
+ // If this link simply reloads the current route,
78
+ // make sure it has a new key so it will trigger a data refresh
79
+ // If this `to` is a valid external URL, return
80
+ // null for LinkUtils
81
+ const type = () => {
82
+ try {
83
+ new URL(`${local.to}`);
84
+ return 'external';
85
+ }
86
+ catch { }
87
+ return 'internal';
88
+ };
89
+ const currentSearch = useRouterState({
90
+ select: (s) => s.location.searchStr,
91
+ });
92
+ // In the rare event that the user bypasses type-safety and doesn't supply a `from`
93
+ // we'll use the current route as the `from` location so relative routing works as expected
94
+ const parentRouteId = useMatch({ strict: false, select: (s) => s.pathname });
95
+ // Use it as the default `from` location
96
+ options = {
97
+ from: parentRouteId(),
98
+ ...options,
99
+ };
100
+ const next = Solid.createMemo(() => {
101
+ currentSearch();
102
+ return router.buildLocation(options);
103
+ });
104
+ const preload = Solid.createMemo(() => {
105
+ if (options.reloadDocument) {
106
+ return false;
107
+ }
108
+ return local.preload ?? router.options.defaultPreload;
109
+ });
110
+ const preloadDelay = () => local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0;
111
+ const isActive = useRouterState({
112
+ select: (s) => {
113
+ if (local.activeOptions?.exact) {
114
+ const testExact = exactPathTest(s.location.pathname, next().pathname, router.basepath);
115
+ if (!testExact) {
116
+ return false;
117
+ }
118
+ }
119
+ else {
120
+ const currentPathSplit = removeTrailingSlash(s.location.pathname, router.basepath).split('/');
121
+ const nextPathSplit = removeTrailingSlash(next()?.pathname, router.basepath)?.split('/');
122
+ const pathIsFuzzyEqual = nextPathSplit?.every((d, i) => d === currentPathSplit[i]);
123
+ if (!pathIsFuzzyEqual) {
124
+ return false;
125
+ }
126
+ }
127
+ if (local.activeOptions?.includeSearch ?? true) {
128
+ const searchTest = deepEqual(s.location.search, next().search, {
129
+ partial: !local.activeOptions?.exact,
130
+ ignoreUndefined: !local.activeOptions?.explicitUndefined,
131
+ });
132
+ if (!searchTest) {
133
+ return false;
134
+ }
135
+ }
136
+ if (local.activeOptions?.includeHash) {
137
+ return s.location.hash === next().hash;
138
+ }
139
+ return true;
140
+ },
141
+ });
142
+ const doPreload = () => router.preloadRoute(options).catch((err) => {
143
+ console.warn(err);
144
+ console.warn(preloadWarning);
145
+ });
146
+ const preloadViewportIoCallback = (entry) => {
147
+ if (entry?.isIntersecting) {
148
+ doPreload();
149
+ }
150
+ };
151
+ const [ref, setRef] = Solid.createSignal(null);
152
+ useIntersectionObserver(ref, preloadViewportIoCallback, { rootMargin: '100px' }, { disabled: !!local.disabled || !(preload() === 'viewport') });
153
+ Solid.createEffect(() => {
154
+ if (hasRenderFetched) {
155
+ return;
156
+ }
157
+ if (!local.disabled && preload() === 'render') {
158
+ doPreload();
159
+ hasRenderFetched = true;
160
+ }
161
+ });
162
+ if (type() === 'external') {
163
+ return Solid.mergeProps(propsSafeToSpread, {
164
+ ref,
165
+ get type() {
166
+ return type();
167
+ },
168
+ get href() {
169
+ return local.to;
170
+ },
171
+ }, Solid.splitProps(local, [
172
+ 'children',
173
+ 'target',
174
+ 'disabled',
175
+ 'style',
176
+ 'class',
177
+ 'onClick',
178
+ 'onFocus',
179
+ 'onMouseEnter',
180
+ 'onMouseLeave',
181
+ 'onMouseOut',
182
+ 'onMouseOver',
183
+ 'onTouchStart',
184
+ ])[0]);
185
+ }
186
+ // The click handler
187
+ const handleClick = (e) => {
188
+ if (!local.disabled &&
189
+ !isCtrlEvent(e) &&
190
+ !e.defaultPrevented &&
191
+ (!local.target || local.target === '_self') &&
192
+ e.button === 0) {
193
+ e.preventDefault();
194
+ setIsTransitioning(true);
195
+ const unsub = router.subscribe('onResolved', () => {
196
+ unsub();
197
+ setIsTransitioning(false);
198
+ });
199
+ // All is well? Navigate!
200
+ // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing
201
+ return router.navigate({
202
+ ...options,
203
+ replace: local.replace,
204
+ resetScroll: local.resetScroll,
205
+ hashScrollIntoView: local.hashScrollIntoView,
206
+ startTransition: local.startTransition,
207
+ viewTransition: local.viewTransition,
208
+ ignoreBlocker: local.ignoreBlocker,
209
+ });
210
+ }
211
+ };
212
+ // The click handler
213
+ const handleFocus = (_) => {
214
+ if (local.disabled)
215
+ return;
216
+ if (preload()) {
217
+ doPreload();
218
+ }
219
+ };
220
+ const handleTouchStart = handleFocus;
221
+ const handleEnter = (e) => {
222
+ if (local.disabled)
223
+ return;
224
+ const eventTarget = (e.target || {});
225
+ if (preload()) {
226
+ if (eventTarget.preloadTimeout) {
227
+ return;
228
+ }
229
+ eventTarget.preloadTimeout = setTimeout(() => {
230
+ eventTarget.preloadTimeout = null;
231
+ doPreload();
232
+ }, preloadDelay());
233
+ }
234
+ };
235
+ const handleLeave = (e) => {
236
+ if (local.disabled)
237
+ return;
238
+ const eventTarget = (e.target || {});
239
+ if (eventTarget.preloadTimeout) {
240
+ clearTimeout(eventTarget.preloadTimeout);
241
+ eventTarget.preloadTimeout = null;
242
+ }
243
+ };
244
+ /** Call a JSX.EventHandlerUnion with the event. */
245
+ function callHandler(event, handler) {
246
+ if (handler) {
247
+ if (typeof handler === 'function') {
248
+ handler(event);
249
+ }
250
+ else {
251
+ handler[0](handler[1], event);
252
+ }
253
+ }
254
+ return event.defaultPrevented;
255
+ }
256
+ function composeEventHandlers(handlers) {
257
+ return (event) => {
258
+ for (const handler of handlers) {
259
+ callHandler(event, handler);
260
+ }
261
+ };
262
+ }
263
+ // Get the active props
264
+ const resolvedActiveProps = () => isActive() ? (functionalUpdate(local.activeProps, {}) ?? {}) : {};
265
+ // Get the inactive props
266
+ const resolvedInactiveProps = () => isActive() ? {} : functionalUpdate(local.inactiveProps, {});
267
+ const resolvedClassName = () => [local.class, resolvedActiveProps().class, resolvedInactiveProps().class]
268
+ .filter(Boolean)
269
+ .join(' ');
270
+ const resolvedStyle = () => ({
271
+ ...local.style,
272
+ ...resolvedActiveProps().style,
273
+ ...resolvedInactiveProps().style,
274
+ });
275
+ const href = Solid.createMemo(() => {
276
+ const nextLocation = next();
277
+ const maskedLocation = nextLocation?.maskedLocation;
278
+ return options.disabled
279
+ ? undefined
280
+ : maskedLocation
281
+ ? router.history.createHref(maskedLocation.href)
282
+ : router.history.createHref(nextLocation?.href);
283
+ });
284
+ return Solid.mergeProps(propsSafeToSpread, resolvedActiveProps, resolvedInactiveProps, () => {
285
+ return {
286
+ href: href(),
287
+ ref: mergeRefs(setRef, options.ref),
288
+ onClick: composeEventHandlers([local.onClick, handleClick]),
289
+ onFocus: composeEventHandlers([local.onFocus, handleFocus]),
290
+ onMouseEnter: composeEventHandlers([local.onMouseEnter, handleEnter]),
291
+ onMouseOver: composeEventHandlers([local.onMouseOver, handleEnter]),
292
+ onMouseLeave: composeEventHandlers([local.onMouseLeave, handleLeave]),
293
+ onMouseOut: composeEventHandlers([local.onMouseOut, handleLeave]),
294
+ onTouchStart: composeEventHandlers([
295
+ local.onTouchStart,
296
+ handleTouchStart,
297
+ ]),
298
+ disabled: !!local.disabled,
299
+ target: local.target,
300
+ ...(Object.keys(resolvedStyle).length && { style: resolvedStyle }),
301
+ ...(resolvedClassName() && { class: resolvedClassName() }),
302
+ ...(local.disabled && {
303
+ role: 'link',
304
+ 'aria-disabled': true,
305
+ }),
306
+ ...(isActive() && { 'data-status': 'active', 'aria-current': 'page' }),
307
+ ...(isTransitioning() && { 'data-transitioning': 'transitioning' }),
308
+ };
309
+ });
310
+ }
311
+ export function createLink(Comp) {
312
+ return (props) => <Link {...props} _asChild={Comp}/>;
313
+ }
314
+ export const Link = (props) => {
315
+ const [local, rest] = Solid.splitProps(props, ['_asChild']);
316
+ const [_, linkProps] = Solid.splitProps(useLinkProps(rest), ['type', 'children']);
317
+ const children = () => typeof rest.children === 'function'
318
+ ? rest.children({
319
+ get isActive() {
320
+ return linkProps['data-status'] === 'active';
321
+ },
322
+ })
323
+ : rest.children;
324
+ if (typeof local._asChild === 'undefined') {
325
+ // the Retlocal.urnType of useLinkProps returns the correct type for a <a> element, not a general component that has a disabled prop
326
+ // @ts-expect-error
327
+ delete linkProps.disabled;
328
+ }
329
+ return (<Dynamic component={local._asChild ? local._asChild : 'a'} {...linkProps}>
330
+ {children}
331
+ </Dynamic>);
332
+ };
333
+ function isCtrlEvent(e) {
334
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
335
+ }
336
+ export const linkOptions = (options) => {
337
+ return options;
338
+ };
339
+ //# sourceMappingURL=link.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.jsx","sourceRoot":"","sources":["../../src/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,OAAO,EACL,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,mBAAmB,GACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAarC,MAAM,UAAU,YAAY,CAO1B,OAAqE;IAErE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IACvE,IAAI,gBAAgB,GAAG,KAAK,CAAA;IAE5B,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,UAAU,CACpC,KAAK,CAAC,UAAU,CACd;QACE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QACxC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KAC1B,EACD,OAAO,CACR,EACD;QACE,aAAa;QACb,eAAe;QACf,eAAe;QACf,IAAI;QACJ,SAAS;QACT,cAAc;QACd,oBAAoB;QACpB,SAAS;QACT,iBAAiB;QACjB,aAAa;QACb,gBAAgB;QAChB,UAAU;QACV,QAAQ;QACR,U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AM,CAAC,MAAM,WAAW,GAAuB,CAAC,OAAO,EAAE,EAAE;IACzD,OAAO,OAAc,CAAA;AACvB,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import * as Solid from 'solid-js';
2
+ export declare const matchContext: Solid.Context<Solid.Accessor<string | undefined>>;
3
+ export declare const dummyMatchContext: Solid.Context<Solid.Accessor<string | undefined>>;
@@ -0,0 +1,5 @@
1
+ import * as Solid from 'solid-js';
2
+ export const matchContext = Solid.createContext(() => undefined);
3
+ // N.B. this only exists so we can conditionally call useContext on it when we are not interested in the nearest match
4
+ export const dummyMatchContext = Solid.createContext(() => undefined);
5
+ //# sourceMappingURL=matchContext.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchContext.jsx","sourceRoot":"","sources":["../../src/matchContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAE7C,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;AAElB,sHAAsH;AACtH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAElD,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA"}