@tanstack/react-router 1.7.1 → 1.8.0

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 (200) hide show
  1. package/dist/cjs/CatchBoundary.cjs +106 -0
  2. package/dist/cjs/CatchBoundary.cjs.map +1 -0
  3. package/dist/cjs/Matches.cjs +278 -0
  4. package/dist/cjs/Matches.cjs.map +1 -0
  5. package/{build/cjs/RouterProvider.js → dist/cjs/RouterProvider.cjs} +55 -58
  6. package/dist/cjs/RouterProvider.cjs.map +1 -0
  7. package/dist/cjs/awaited.cjs +51 -0
  8. package/dist/cjs/awaited.cjs.map +1 -0
  9. package/dist/cjs/defer.cjs +30 -0
  10. package/dist/cjs/defer.cjs.map +1 -0
  11. package/dist/cjs/fileRoute.cjs +19 -0
  12. package/dist/cjs/fileRoute.cjs.map +1 -0
  13. package/dist/cjs/history.d.cts +7 -0
  14. package/{build/cjs/index.js → dist/cjs/index.cjs} +39 -51
  15. package/dist/cjs/index.cjs.map +1 -0
  16. package/dist/cjs/lazyRouteComponent.cjs +40 -0
  17. package/dist/cjs/lazyRouteComponent.cjs.map +1 -0
  18. package/dist/cjs/link.cjs +196 -0
  19. package/dist/cjs/link.cjs.map +1 -0
  20. package/dist/cjs/link.d.cts +85 -0
  21. package/{build/cjs/path.js → dist/cjs/path.cjs} +77 -94
  22. package/dist/cjs/path.cjs.map +1 -0
  23. package/dist/cjs/qss.cjs +45 -0
  24. package/dist/cjs/qss.cjs.map +1 -0
  25. package/dist/cjs/redirects.cjs +15 -0
  26. package/dist/cjs/redirects.cjs.map +1 -0
  27. package/dist/cjs/route.cjs +143 -0
  28. package/dist/cjs/route.cjs.map +1 -0
  29. package/dist/cjs/router.cjs +1070 -0
  30. package/dist/cjs/router.cjs.map +1 -0
  31. package/dist/cjs/routerContext.cjs +29 -0
  32. package/dist/cjs/routerContext.cjs.map +1 -0
  33. package/{build/cjs/scroll-restoration.js → dist/cjs/scroll-restoration.cjs} +58 -75
  34. package/dist/cjs/scroll-restoration.cjs.map +1 -0
  35. package/{build/cjs/searchParams.js → dist/cjs/searchParams.cjs} +18 -36
  36. package/dist/cjs/searchParams.cjs.map +1 -0
  37. package/dist/cjs/useBlocker.cjs +36 -0
  38. package/dist/cjs/useBlocker.cjs.map +1 -0
  39. package/dist/cjs/useNavigate.cjs +55 -0
  40. package/dist/cjs/useNavigate.cjs.map +1 -0
  41. package/dist/cjs/useParams.cjs +16 -0
  42. package/dist/cjs/useParams.cjs.map +1 -0
  43. package/dist/cjs/useRouteContext.cjs +11 -0
  44. package/dist/cjs/useRouteContext.cjs.map +1 -0
  45. package/dist/cjs/useRouter.cjs +33 -0
  46. package/dist/cjs/useRouter.cjs.map +1 -0
  47. package/dist/cjs/useRouterState.cjs +12 -0
  48. package/dist/cjs/useRouterState.cjs.map +1 -0
  49. package/dist/cjs/useSearch.cjs +13 -0
  50. package/dist/cjs/useSearch.cjs.map +1 -0
  51. package/{build/cjs/utils.js → dist/cjs/utils.cjs} +25 -116
  52. package/dist/cjs/utils.cjs.map +1 -0
  53. package/dist/esm/CatchBoundary.d.ts +36 -0
  54. package/dist/esm/CatchBoundary.js +89 -0
  55. package/dist/esm/CatchBoundary.js.map +1 -0
  56. package/dist/esm/Matches.d.ts +71 -0
  57. package/dist/esm/Matches.js +261 -0
  58. package/{build/cjs → dist/esm}/Matches.js.map +1 -1
  59. package/dist/esm/RouterProvider.d.ts +27 -0
  60. package/dist/esm/RouterProvider.js +136 -0
  61. package/{build/cjs → dist/esm}/RouterProvider.js.map +1 -1
  62. package/dist/esm/awaited.d.ts +9 -0
  63. package/dist/esm/awaited.js +51 -0
  64. package/dist/esm/awaited.js.map +1 -0
  65. package/dist/esm/defer.d.ts +22 -0
  66. package/dist/esm/defer.js +30 -0
  67. package/{build/cjs → dist/esm}/defer.js.map +1 -1
  68. package/dist/esm/fileRoute.d.ts +21 -0
  69. package/dist/esm/fileRoute.js +19 -0
  70. package/dist/esm/fileRoute.js.map +1 -0
  71. package/{build/types → dist/esm}/history.d.ts +1 -1
  72. package/dist/esm/index.d.ts +30 -0
  73. package/dist/esm/index.js +118 -0
  74. package/dist/esm/index.js.map +1 -0
  75. package/dist/esm/lazyRouteComponent.d.ts +2 -0
  76. package/dist/esm/lazyRouteComponent.js +23 -0
  77. package/{build/cjs → dist/esm}/lazyRouteComponent.js.map +1 -1
  78. package/{build/types → dist/esm}/link.d.ts +3 -1
  79. package/dist/esm/link.js +179 -0
  80. package/dist/esm/link.js.map +1 -0
  81. package/dist/esm/location.d.ts +12 -0
  82. package/dist/esm/path.d.ts +17 -0
  83. package/dist/esm/path.js +200 -0
  84. package/dist/esm/path.js.map +1 -0
  85. package/dist/esm/qss.d.ts +2 -0
  86. package/dist/esm/qss.js +45 -0
  87. package/dist/esm/qss.js.map +1 -0
  88. package/dist/esm/redirects.d.ts +11 -0
  89. package/dist/esm/redirects.js +15 -0
  90. package/{build/cjs → dist/esm}/redirects.js.map +1 -1
  91. package/dist/esm/route.d.ts +300 -0
  92. package/dist/esm/route.js +143 -0
  93. package/dist/esm/route.js.map +1 -0
  94. package/dist/esm/routeInfo.d.ts +31 -0
  95. package/dist/esm/router.d.ts +201 -0
  96. package/dist/esm/router.js +1070 -0
  97. package/{build/cjs → dist/esm}/router.js.map +1 -1
  98. package/dist/esm/routerContext.d.ts +3 -0
  99. package/dist/esm/routerContext.js +13 -0
  100. package/{build/cjs → dist/esm}/routerContext.js.map +1 -1
  101. package/dist/esm/scroll-restoration.d.ts +18 -0
  102. package/dist/esm/scroll-restoration.js +168 -0
  103. package/dist/esm/scroll-restoration.js.map +1 -0
  104. package/dist/esm/searchParams.d.ts +7 -0
  105. package/dist/esm/searchParams.js +63 -0
  106. package/{build/cjs → dist/esm}/searchParams.js.map +1 -1
  107. package/dist/esm/useBlocker.d.ts +9 -0
  108. package/dist/esm/useBlocker.js +19 -0
  109. package/{build/cjs → dist/esm}/useBlocker.js.map +1 -1
  110. package/dist/esm/useNavigate.d.ts +20 -0
  111. package/dist/esm/useNavigate.js +38 -0
  112. package/{build/cjs → dist/esm}/useNavigate.js.map +1 -1
  113. package/dist/esm/useParams.d.ts +7 -0
  114. package/dist/esm/useParams.js +16 -0
  115. package/{build/cjs → dist/esm}/useParams.js.map +1 -1
  116. package/dist/esm/useRouteContext.d.ts +7 -0
  117. package/dist/esm/useRouteContext.js +11 -0
  118. package/{build/cjs → dist/esm}/useRouteContext.js.map +1 -1
  119. package/dist/esm/useRouter.d.ts +5 -0
  120. package/dist/esm/useRouter.js +16 -0
  121. package/{build/cjs → dist/esm}/useRouter.js.map +1 -1
  122. package/dist/esm/useRouterState.d.ts +6 -0
  123. package/dist/esm/useRouterState.js +12 -0
  124. package/{build/cjs → dist/esm}/useRouterState.js.map +1 -1
  125. package/dist/esm/useSearch.d.ts +7 -0
  126. package/dist/esm/useSearch.js +13 -0
  127. package/dist/esm/useSearch.js.map +1 -0
  128. package/dist/esm/utils.d.ts +46 -0
  129. package/dist/esm/utils.js +137 -0
  130. package/{build/cjs → dist/esm}/utils.js.map +1 -1
  131. package/package.json +43 -22
  132. package/src/fileRoute.ts +4 -5
  133. package/src/link.tsx +5 -4
  134. package/src/route.ts +5 -6
  135. package/src/useSearch.tsx +5 -2
  136. package/build/cjs/CatchBoundary.js +0 -128
  137. package/build/cjs/CatchBoundary.js.map +0 -1
  138. package/build/cjs/Matches.js +0 -260
  139. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -29
  140. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  141. package/build/cjs/awaited.js +0 -60
  142. package/build/cjs/awaited.js.map +0 -1
  143. package/build/cjs/defer.js +0 -42
  144. package/build/cjs/fileRoute.js +0 -31
  145. package/build/cjs/fileRoute.js.map +0 -1
  146. package/build/cjs/index.js.map +0 -1
  147. package/build/cjs/lazyRouteComponent.js +0 -54
  148. package/build/cjs/link.js +0 -224
  149. package/build/cjs/link.js.map +0 -1
  150. package/build/cjs/path.js.map +0 -1
  151. package/build/cjs/qss.js +0 -63
  152. package/build/cjs/qss.js.map +0 -1
  153. package/build/cjs/redirects.js +0 -28
  154. package/build/cjs/route.js +0 -292
  155. package/build/cjs/route.js.map +0 -1
  156. package/build/cjs/router.js +0 -1116
  157. package/build/cjs/routerContext.js +0 -42
  158. package/build/cjs/scroll-restoration.js.map +0 -1
  159. package/build/cjs/useBlocker.js +0 -55
  160. package/build/cjs/useNavigate.js +0 -88
  161. package/build/cjs/useParams.js +0 -27
  162. package/build/cjs/useRouteContext.js +0 -23
  163. package/build/cjs/useRouter.js +0 -44
  164. package/build/cjs/useRouterState.js +0 -24
  165. package/build/cjs/useSearch.js +0 -25
  166. package/build/cjs/useSearch.js.map +0 -1
  167. package/build/esm/index.js +0 -2874
  168. package/build/esm/index.js.map +0 -1
  169. package/build/stats-html.html +0 -4838
  170. package/build/stats-react.json +0 -1471
  171. package/build/umd/index.development.js +0 -3573
  172. package/build/umd/index.development.js.map +0 -1
  173. package/build/umd/index.production.js +0 -22
  174. package/build/umd/index.production.js.map +0 -1
  175. /package/{build/types/CatchBoundary.d.ts → dist/cjs/CatchBoundary.d.cts} +0 -0
  176. /package/{build/types/Matches.d.ts → dist/cjs/Matches.d.cts} +0 -0
  177. /package/{build/types/RouterProvider.d.ts → dist/cjs/RouterProvider.d.cts} +0 -0
  178. /package/{build/types/awaited.d.ts → dist/cjs/awaited.d.cts} +0 -0
  179. /package/{build/types/defer.d.ts → dist/cjs/defer.d.cts} +0 -0
  180. /package/{build/types/fileRoute.d.ts → dist/cjs/fileRoute.d.cts} +0 -0
  181. /package/{build/types/index.d.ts → dist/cjs/index.d.cts} +0 -0
  182. /package/{build/types/lazyRouteComponent.d.ts → dist/cjs/lazyRouteComponent.d.cts} +0 -0
  183. /package/{build/types/location.d.ts → dist/cjs/location.d.cts} +0 -0
  184. /package/{build/types/path.d.ts → dist/cjs/path.d.cts} +0 -0
  185. /package/{build/types/qss.d.ts → dist/cjs/qss.d.cts} +0 -0
  186. /package/{build/types/redirects.d.ts → dist/cjs/redirects.d.cts} +0 -0
  187. /package/{build/types/route.d.ts → dist/cjs/route.d.cts} +0 -0
  188. /package/{build/types/routeInfo.d.ts → dist/cjs/routeInfo.d.cts} +0 -0
  189. /package/{build/types/router.d.ts → dist/cjs/router.d.cts} +0 -0
  190. /package/{build/types/routerContext.d.ts → dist/cjs/routerContext.d.cts} +0 -0
  191. /package/{build/types/scroll-restoration.d.ts → dist/cjs/scroll-restoration.d.cts} +0 -0
  192. /package/{build/types/searchParams.d.ts → dist/cjs/searchParams.d.cts} +0 -0
  193. /package/{build/types/useBlocker.d.ts → dist/cjs/useBlocker.d.cts} +0 -0
  194. /package/{build/types/useNavigate.d.ts → dist/cjs/useNavigate.d.cts} +0 -0
  195. /package/{build/types/useParams.d.ts → dist/cjs/useParams.d.cts} +0 -0
  196. /package/{build/types/useRouteContext.d.ts → dist/cjs/useRouteContext.d.cts} +0 -0
  197. /package/{build/types/useRouter.d.ts → dist/cjs/useRouter.d.cts} +0 -0
  198. /package/{build/types/useRouterState.d.ts → dist/cjs/useRouterState.d.cts} +0 -0
  199. /package/{build/types/useSearch.d.ts → dist/cjs/useSearch.d.cts} +0 -0
  200. /package/{build/types/utils.d.ts → dist/cjs/utils.d.cts} +0 -0
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const warning = require("tiny-warning");
4
+ const Matches = require("./Matches.cjs");
5
+ const useRouter = require("./useRouter.cjs");
6
+ const defer = require("./defer.cjs");
7
+ const router = require("./router.cjs");
8
+ function useAwaited({ promise }) {
9
+ var _a, _b;
10
+ const router$1 = useRouter.useRouter();
11
+ let state = promise.__deferredState;
12
+ const key = `__TSR__DEFERRED__${state.uid}`;
13
+ if (defer.isDehydratedDeferred(promise)) {
14
+ state = router$1.hydrateData(key);
15
+ if (!state)
16
+ throw new Error("Could not find dehydrated data");
17
+ promise = Promise.resolve(state.data);
18
+ promise.__deferredState = state;
19
+ }
20
+ if (state.status === "pending") {
21
+ throw promise;
22
+ }
23
+ if (state.status === "error") {
24
+ if (typeof document !== "undefined") {
25
+ if (Matches.isServerSideError(state.error)) {
26
+ throw (((_a = router$1.options.errorSerializer) == null ? void 0 : _a.deserialize) ?? Matches.defaultDeserializeError)(state.error.data);
27
+ } else {
28
+ warning(
29
+ false,
30
+ "Encountered a server-side error that doesn't fit the expected shape"
31
+ );
32
+ throw state.error;
33
+ }
34
+ } else {
35
+ router$1.dehydrateData(key, state);
36
+ throw {
37
+ data: (((_b = router$1.options.errorSerializer) == null ? void 0 : _b.serialize) ?? router.defaultSerializeError)(state.error),
38
+ __isServerError: true
39
+ };
40
+ }
41
+ }
42
+ router$1.dehydrateData(key, state);
43
+ return [state.data];
44
+ }
45
+ function Await(props) {
46
+ const awaited = useAwaited(props);
47
+ return props.children(...awaited);
48
+ }
49
+ exports.Await = Await;
50
+ exports.useAwaited = useAwaited;
51
+ //# sourceMappingURL=awaited.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"awaited.cjs","sources":["../../src/awaited.tsx"],"sourcesContent":["import warning from 'tiny-warning'\nimport { defaultDeserializeError, isServerSideError } from './Matches'\nimport { useRouter } from './useRouter'\nimport { DeferredPromise, isDehydratedDeferred } from './defer'\nimport { defaultSerializeError } from './router'\n\nexport type AwaitOptions<T> = {\n promise: DeferredPromise<T>\n}\n\nexport function useAwaited<T>({ promise }: AwaitOptions<T>): [T] {\n const router = useRouter()\n\n let state = promise.__deferredState\n const key = `__TSR__DEFERRED__${state.uid}`\n\n if (isDehydratedDeferred(promise)) {\n state = router.hydrateData(key)!\n if (!state) throw new Error('Could not find dehydrated data')\n promise = Promise.resolve(state.data) as DeferredPromise<any>\n promise.__deferredState = state\n }\n\n if (state.status === 'pending') {\n throw promise\n }\n\n if (state.status === 'error') {\n if (typeof document !== 'undefined') {\n if (isServerSideError(state.error)) {\n throw (\n router.options.errorSerializer?.deserialize ?? defaultDeserializeError\n )(state.error.data as any)\n } else {\n warning(\n false,\n \"Encountered a server-side error that doesn't fit the expected shape\",\n )\n throw state.error\n }\n } else {\n router.dehydrateData(key, state)\n throw {\n data: (\n router.options.errorSerializer?.serialize ?? defaultSerializeError\n )(state.error),\n __isServerError: true,\n }\n }\n }\n\n router.dehydrateData(key, state)\n\n return [state.data]\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n children: (result: T) => JSX.Element\n },\n) {\n const awaited = useAwaited(props)\n return props.children(...awaited)\n}\n"],"names":["router","useRouter","isDehydratedDeferred","isServerSideError","defaultDeserializeError","defaultSerializeError"],"mappings":";;;;;;;AAUgB,SAAA,WAAc,EAAE,WAAiC;;AAC/D,QAAMA,WAASC,UAAAA;AAEf,MAAI,QAAQ,QAAQ;AACd,QAAA,MAAM,oBAAoB,MAAM,GAAG;AAErC,MAAAC,MAAAA,qBAAqB,OAAO,GAAG;AACzB,YAAAF,SAAO,YAAY,GAAG;AAC9B,QAAI,CAAC;AAAa,YAAA,IAAI,MAAM,gCAAgC;AAClD,cAAA,QAAQ,QAAQ,MAAM,IAAI;AACpC,YAAQ,kBAAkB;AAAA,EAC5B;AAEI,MAAA,MAAM,WAAW,WAAW;AACxB,UAAA;AAAA,EACR;AAEI,MAAA,MAAM,WAAW,SAAS;AACxB,QAAA,OAAO,aAAa,aAAa;AAC/B,UAAAG,QAAA,kBAAkB,MAAM,KAAK,GAAG;AAClC,iBACEH,cAAO,QAAQ,oBAAfA,mBAAgC,gBAAeI,QAAAA,yBAC/C,MAAM,MAAM,IAAW;AAAA,MAAA,OACpB;AACL;AAAA,UACE;AAAA,UACA;AAAA,QAAA;AAEF,cAAM,MAAM;AAAA,MACd;AAAA,IAAA,OACK;AACEJ,eAAA,cAAc,KAAK,KAAK;AACzB,YAAA;AAAA,QACJ,SACEA,cAAO,QAAQ,oBAAfA,mBAAgC,cAAaK,OAAA,uBAC7C,MAAM,KAAK;AAAA,QACb,iBAAiB;AAAA,MAAA;AAAA,IAErB;AAAA,EACF;AAEOL,WAAA,cAAc,KAAK,KAAK;AAExB,SAAA,CAAC,MAAM,IAAI;AACpB;AAEO,SAAS,MACd,OAGA;AACM,QAAA,UAAU,WAAW,KAAK;AACzB,SAAA,MAAM,SAAS,GAAG,OAAO;AAClC;;;"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const router = require("./router.cjs");
4
+ function defer(_promise, options) {
5
+ const promise = _promise;
6
+ if (!promise.__deferredState) {
7
+ promise.__deferredState = {
8
+ uid: Math.random().toString(36).slice(2),
9
+ status: "pending"
10
+ };
11
+ const state = promise.__deferredState;
12
+ promise.then((data) => {
13
+ state.status = "success";
14
+ state.data = data;
15
+ }).catch((error) => {
16
+ state.status = "error";
17
+ state.error = {
18
+ data: ((options == null ? void 0 : options.serializeError) ?? router.defaultSerializeError)(error),
19
+ __isServerError: true
20
+ };
21
+ });
22
+ }
23
+ return promise;
24
+ }
25
+ function isDehydratedDeferred(obj) {
26
+ return typeof obj === "object" && obj !== null && !(obj instanceof Promise) && !obj.then && "__deferredState" in obj;
27
+ }
28
+ exports.defer = defer;
29
+ exports.isDehydratedDeferred = isDehydratedDeferred;
30
+ //# sourceMappingURL=defer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defer.cjs","sources":["../../src/defer.ts"],"sourcesContent":["import { defaultSerializeError } from './router'\n\nexport type DeferredPromiseState<T> = { uid: string } & (\n | {\n status: 'pending'\n data?: T\n error?: unknown\n }\n | {\n status: 'success'\n data: T\n }\n | {\n status: 'error'\n data?: T\n error: unknown\n }\n)\n\nexport type DeferredPromise<T> = Promise<T> & {\n __deferredState: DeferredPromiseState<T>\n}\n\nexport function defer<T>(\n _promise: Promise<T>,\n options?: {\n serializeError?: typeof defaultSerializeError\n },\n) {\n const promise = _promise as DeferredPromise<T>\n\n if (!promise.__deferredState) {\n promise.__deferredState = {\n uid: Math.random().toString(36).slice(2),\n status: 'pending',\n }\n\n const state = promise.__deferredState\n\n promise\n .then((data) => {\n state.status = 'success' as any\n state.data = data\n })\n .catch((error) => {\n state.status = 'error' as any\n state.error = {\n data: (options?.serializeError ?? defaultSerializeError)(error),\n __isServerError: true,\n }\n })\n }\n\n return promise\n}\n\nexport function isDehydratedDeferred(obj: any): boolean {\n return (\n typeof obj === 'object' &&\n obj !== null &&\n !(obj instanceof Promise) &&\n !obj.then &&\n '__deferredState' in obj\n )\n}\n"],"names":["defaultSerializeError"],"mappings":";;;AAuBgB,SAAA,MACd,UACA,SAGA;AACA,QAAM,UAAU;AAEZ,MAAA,CAAC,QAAQ,iBAAiB;AAC5B,YAAQ,kBAAkB;AAAA,MACxB,KAAK,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC;AAAA,MACvC,QAAQ;AAAA,IAAA;AAGV,UAAM,QAAQ,QAAQ;AAGnB,YAAA,KAAK,CAAC,SAAS;AACd,YAAM,SAAS;AACf,YAAM,OAAO;AAAA,IAAA,CACd,EACA,MAAM,CAAC,UAAU;AAChB,YAAM,SAAS;AACf,YAAM,QAAQ;AAAA,QACZ,QAAO,mCAAS,mBAAkBA,OAAAA,uBAAuB,KAAK;AAAA,QAC9D,iBAAiB;AAAA,MAAA;AAAA,IACnB,CACD;AAAA,EACL;AAEO,SAAA;AACT;AAEO,SAAS,qBAAqB,KAAmB;AAEpD,SAAA,OAAO,QAAQ,YACf,QAAQ,QACR,EAAE,eAAe,YACjB,CAAC,IAAI,QACL,qBAAqB;AAEzB;;;"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const route = require("./route.cjs");
4
+ class FileRoute {
5
+ constructor(path) {
6
+ this.path = path;
7
+ this.createRoute = (options) => {
8
+ const route$1 = new route.Route(options);
9
+ route$1.isRoot = false;
10
+ return route$1;
11
+ };
12
+ }
13
+ }
14
+ function FileRouteLoader(_path) {
15
+ return (loaderFn) => loaderFn;
16
+ }
17
+ exports.FileRoute = FileRoute;
18
+ exports.FileRouteLoader = FileRouteLoader;
19
+ //# sourceMappingURL=fileRoute.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileRoute.cjs","sources":["../../src/fileRoute.ts"],"sourcesContent":["import { NoInfer } from '@tanstack/react-store'\nimport { ParsePathParams } from './link'\nimport {\n AnyRoute,\n ResolveFullPath,\n ResolveFullSearchSchema,\n MergeFromFromParent,\n RouteContext,\n AnyContext,\n RouteOptions,\n UpdatableRouteOptions,\n Route,\n RootRouteId,\n TrimPathLeft,\n RouteConstraints,\n ResolveFullSearchSchemaInput,\n SearchSchemaInput,\n LoaderFnContext,\n RouteLoaderFn,\n} from './route'\nimport { Assign, Expand, IsAny } from './utils'\n\nexport interface FileRoutesByPath {\n // '/': {\n // parentRoute: typeof rootRoute\n // }\n}\n\ntype Replace<\n S extends string,\n From extends string,\n To extends string,\n> = S extends `${infer Start}${From}${infer Rest}`\n ? `${Start}${To}${Replace<Rest, From, To>}`\n : S\n\nexport type TrimLeft<\n T extends string,\n S extends string,\n> = T extends `${S}${infer U}` ? U : T\n\nexport type TrimRight<\n T extends string,\n S extends string,\n> = T extends `${infer U}${S}` ? U : T\n\nexport type Trim<T extends string, S extends string> = TrimLeft<\n TrimRight<T, S>,\n S\n>\n\nexport type RemoveUnderScores<T extends string> = Replace<\n Replace<TrimRight<TrimLeft<T, '/_'>, '_'>, '_/', '/'>,\n '/_',\n '/'\n>\n\ntype ReplaceFirstOccurrence<\n T extends string,\n Search extends string,\n Replacement extends string,\n> = T extends `${infer Prefix}${Search}${infer Suffix}`\n ? `${Prefix}${Replacement}${Suffix}`\n : T\n\nexport type ResolveFilePath<\n TParentRoute extends AnyRoute,\n TFilePath extends string,\n> = TParentRoute['id'] extends RootRouteId\n ? TrimPathLeft<TFilePath>\n : ReplaceFirstOccurrence<\n TrimPathLeft<TFilePath>,\n TrimPathLeft<TParentRoute['types']['customId']>,\n ''\n >\n\nexport type FileRoutePath<\n TParentRoute extends AnyRoute,\n TFilePath extends string,\n> = ResolveFilePath<TParentRoute, TFilePath> extends `_${infer _}`\n ? ''\n : ResolveFilePath<TParentRoute, TFilePath> extends `/_${infer _}`\n ? ''\n : ResolveFilePath<TParentRoute, TFilePath>\n\nexport class FileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n TId extends RouteConstraints['TId'] = TFilePath,\n TPath extends RouteConstraints['TPath'] = FileRoutePath<\n TParentRoute,\n TFilePath\n >,\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n RemoveUnderScores<TPath>\n >,\n> {\n constructor(public path: TFilePath) {}\n\n createRoute = <\n TSearchSchemaInput extends RouteConstraints['TSearchSchema'] = {},\n TSearchSchema extends RouteConstraints['TSearchSchema'] = {},\n TSearchSchemaUsed extends Record<\n string,\n any\n > = TSearchSchemaInput extends SearchSchemaInput\n ? Omit<TSearchSchemaInput, keyof SearchSchemaInput>\n : TSearchSchema,\n TFullSearchSchemaInput extends\n RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchemaInput<\n TParentRoute,\n TSearchSchemaUsed\n >,\n TFullSearchSchema extends\n RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<\n TParentRoute,\n TSearchSchema\n >,\n TParams extends RouteConstraints['TParams'] = Expand<\n Record<ParsePathParams<TPath>, string>\n >,\n TAllParams extends RouteConstraints['TAllParams'] = MergeFromFromParent<\n TParentRoute['types']['allParams'],\n TParams\n >,\n TRouteContextReturn extends\n RouteConstraints['TRouteContext'] = RouteContext,\n TRouteContext extends RouteConstraints['TRouteContext'] = [\n TRouteContextReturn,\n ] extends [never]\n ? RouteContext\n : TRouteContextReturn,\n TAllContext extends Expand<\n Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>\n > = Expand<\n Assign<IsAny<TParentRoute['types']['allContext'], {}>, TRouteContext>\n >,\n TRouterContext extends RouteConstraints['TRouterContext'] = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderData extends any = unknown,\n TChildren extends RouteConstraints['TChildren'] = unknown,\n TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute,\n >(\n options?: Omit<\n RouteOptions<\n TParentRoute,\n string,\n TPath,\n TSearchSchemaInput,\n TSearchSchema,\n TSearchSchemaUsed,\n TFullSearchSchemaInput,\n TFullSearchSchema,\n TParams,\n TAllParams,\n TRouteContextReturn,\n TRouteContext,\n TRouterContext,\n TAllContext,\n TLoaderDeps,\n TLoaderData\n >,\n 'getParentRoute' | 'path' | 'id'\n > &\n UpdatableRouteOptions<TFullSearchSchema>,\n ): Route<\n TParentRoute,\n TPath,\n TFullPath,\n TFilePath,\n TId,\n TSearchSchemaInput,\n TSearchSchema,\n TSearchSchemaUsed,\n TFullSearchSchemaInput,\n TFullSearchSchema,\n TParams,\n TAllParams,\n TRouteContextReturn,\n TRouteContext,\n TAllContext,\n TRouterContext,\n TLoaderDeps,\n TLoaderData,\n TChildren,\n TRouteTree\n > => {\n const route = new Route(options as any)\n ;(route as any).isRoot = false\n return route as any\n }\n}\n\nexport function FileRouteLoader<\n TFilePath extends keyof FileRoutesByPath,\n TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(\n _path: TFilePath,\n): <TLoaderData extends any>(\n loaderFn: RouteLoaderFn<\n TRoute['types']['allParams'],\n TRoute['types']['loaderDeps'],\n TRoute['types']['allContext'],\n TRoute['types']['routeContext'],\n TLoaderData\n >,\n) => RouteLoaderFn<\n TRoute['types']['allParams'],\n TRoute['types']['loaderDeps'],\n TRoute['types']['allContext'],\n TRoute['types']['routeContext'],\n NoInfer<TLoaderData>\n> {\n return (loaderFn) => loaderFn\n}\n"],"names":["route","Route"],"mappings":";;;AAqFO,MAAM,UAYX;AAAA,EACA,YAAmB,MAAiB;AAAjB,SAAA,OAAA;AAEnB,SAAA,cAAc,CA4CZ,YA2CG;AACG,YAAAA,UAAQ,IAAIC,YAAM,OAAc;AACpCD,cAAc,SAAS;AAClB,aAAAA;AAAAA,IAAA;AAAA,EA5F4B;AA8FvC;AAEO,SAAS,gBAId,OAeA;AACA,SAAO,CAAC,aAAa;AACvB;;;"}
@@ -0,0 +1,7 @@
1
+ declare module '@tanstack/history' {
2
+ interface HistoryState {
3
+ __tempLocation?: HistoryLocation;
4
+ __tempKey?: string;
5
+ }
6
+ }
7
+ export {};
@@ -1,45 +1,32 @@
1
- /**
2
- * @tanstack/react-router/src/index.tsx
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- 'use strict';
12
-
13
- var history = require('@tanstack/history');
14
- var invariant = require('tiny-invariant');
15
- var warning = require('tiny-warning');
16
- var awaited = require('./awaited.js');
17
- var defer = require('./defer.js');
18
- var CatchBoundary = require('./CatchBoundary.js');
19
- var fileRoute = require('./fileRoute.js');
20
- var lazyRouteComponent = require('./lazyRouteComponent.js');
21
- var link = require('./link.js');
22
- var Matches = require('./Matches.js');
23
- var path = require('./path.js');
24
- var qss = require('./qss.js');
25
- var redirects = require('./redirects.js');
26
- var route = require('./route.js');
27
- var router = require('./router.js');
28
- var RouterProvider = require('./RouterProvider.js');
29
- var scrollRestoration = require('./scroll-restoration.js');
30
- var searchParams = require('./searchParams.js');
31
- var useBlocker = require('./useBlocker.js');
32
- var useNavigate = require('./useNavigate.js');
33
- var useParams = require('./useParams.js');
34
- var useSearch = require('./useSearch.js');
35
- var routerContext = require('./routerContext.js');
36
- var useRouteContext = require('./useRouteContext.js');
37
- var useRouter = require('./useRouter.js');
38
- var useRouterState = require('./useRouterState.js');
39
- var utils = require('./utils.js');
40
-
41
-
42
-
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const history = require("@tanstack/history");
4
+ const invariant = require("tiny-invariant");
5
+ const warning = require("tiny-warning");
6
+ const awaited = require("./awaited.cjs");
7
+ const defer = require("./defer.cjs");
8
+ const CatchBoundary = require("./CatchBoundary.cjs");
9
+ const fileRoute = require("./fileRoute.cjs");
10
+ const lazyRouteComponent = require("./lazyRouteComponent.cjs");
11
+ const link = require("./link.cjs");
12
+ const Matches = require("./Matches.cjs");
13
+ const path = require("./path.cjs");
14
+ const qss = require("./qss.cjs");
15
+ const redirects = require("./redirects.cjs");
16
+ const route = require("./route.cjs");
17
+ const router = require("./router.cjs");
18
+ const RouterProvider = require("./RouterProvider.cjs");
19
+ const scrollRestoration = require("./scroll-restoration.cjs");
20
+ const searchParams = require("./searchParams.cjs");
21
+ const useBlocker = require("./useBlocker.cjs");
22
+ const useNavigate = require("./useNavigate.cjs");
23
+ const useParams = require("./useParams.cjs");
24
+ const useSearch = require("./useSearch.cjs");
25
+ const routerContext = require("./routerContext.cjs");
26
+ const useRouteContext = require("./useRouteContext.cjs");
27
+ const useRouter = require("./useRouter.cjs");
28
+ const useRouterState = require("./useRouterState.cjs");
29
+ const utils = require("./utils.cjs");
43
30
  exports.invariant = invariant;
44
31
  exports.warning = warning;
45
32
  exports.Await = awaited.Await;
@@ -112,9 +99,9 @@ exports.Navigate = useNavigate.Navigate;
112
99
  exports.useNavigate = useNavigate.useNavigate;
113
100
  exports.useParams = useParams.useParams;
114
101
  exports.useSearch = useSearch.useSearch;
115
- Object.defineProperty(exports, 'routerContext', {
116
- enumerable: true,
117
- get: function () { return routerContext.routerContext; }
102
+ Object.defineProperty(exports, "routerContext", {
103
+ enumerable: true,
104
+ get: () => routerContext.routerContext
118
105
  });
119
106
  exports.useRouteContext = useRouteContext.useRouteContext;
120
107
  exports.useRouter = useRouter.useRouter;
@@ -131,10 +118,11 @@ exports.replaceEqualDeep = utils.replaceEqualDeep;
131
118
  exports.shallow = utils.shallow;
132
119
  exports.useLayoutEffect = utils.useLayoutEffect;
133
120
  exports.useStableCallback = utils.useStableCallback;
134
- Object.keys(history).forEach(function (k) {
135
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
136
- enumerable: true,
137
- get: function () { return history[k]; }
138
- });
121
+ Object.keys(history).forEach((k) => {
122
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
123
+ Object.defineProperty(exports, k, {
124
+ enumerable: true,
125
+ get: () => history[k]
126
+ });
139
127
  });
140
- //# sourceMappingURL=index.js.map
128
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ function _interopNamespaceDefault(e) {
5
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
6
+ if (e) {
7
+ for (const k in e) {
8
+ if (k !== "default") {
9
+ const d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: () => e[k]
13
+ });
14
+ }
15
+ }
16
+ }
17
+ n.default = e;
18
+ return Object.freeze(n);
19
+ }
20
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
21
+ function lazyRouteComponent(importer, exportName) {
22
+ let loadPromise;
23
+ const load = () => {
24
+ if (!loadPromise) {
25
+ loadPromise = importer();
26
+ }
27
+ return loadPromise;
28
+ };
29
+ const lazyComp = React__namespace.lazy(async () => {
30
+ const moduleExports = await load();
31
+ const comp = moduleExports[exportName ?? "default"];
32
+ return {
33
+ default: comp
34
+ };
35
+ });
36
+ lazyComp.preload = load;
37
+ return lazyComp;
38
+ }
39
+ exports.lazyRouteComponent = lazyRouteComponent;
40
+ //# sourceMappingURL=lazyRouteComponent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazyRouteComponent.cjs","sources":["../../src/lazyRouteComponent.tsx"],"sourcesContent":["import * as React from 'react'\nimport { AsyncRouteComponent } from './route'\n\nexport function lazyRouteComponent<\n T extends Record<string, any>,\n TKey extends keyof T = 'default',\n>(\n importer: () => Promise<T>,\n exportName?: TKey,\n): T[TKey] extends (props: infer TProps) => any\n ? AsyncRouteComponent<TProps>\n : never {\n let loadPromise: Promise<any>\n\n const load = () => {\n if (!loadPromise) {\n loadPromise = importer()\n }\n\n return loadPromise\n }\n\n const lazyComp = React.lazy(async () => {\n const moduleExports = await load()\n const comp = moduleExports[exportName ?? 'default']\n return {\n default: comp,\n }\n })\n ;(lazyComp as any).preload = load\n\n return lazyComp as any\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGgB,SAAA,mBAId,UACA,YAGQ;AACJ,MAAA;AAEJ,QAAM,OAAO,MAAM;AACjB,QAAI,CAAC,aAAa;AAChB,oBAAc,SAAS;AAAA,IACzB;AAEO,WAAA;AAAA,EAAA;AAGH,QAAA,WAAWA,iBAAM,KAAK,YAAY;AAChC,UAAA,gBAAgB,MAAM;AACtB,UAAA,OAAO,cAAc,cAAc,SAAS;AAC3C,WAAA;AAAA,MACL,SAAS;AAAA,IAAA;AAAA,EACX,CACD;AACC,WAAiB,UAAU;AAEtB,SAAA;AACT;;"}
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const Matches = require("./Matches.cjs");
6
+ const useRouterState = require("./useRouterState.cjs");
7
+ const useRouter = require("./useRouter.cjs");
8
+ const utils = require("./utils.cjs");
9
+ function _interopNamespaceDefault(e) {
10
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
11
+ if (e) {
12
+ for (const k in e) {
13
+ if (k !== "default") {
14
+ const d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: () => e[k]
18
+ });
19
+ }
20
+ }
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
26
+ const preloadWarning = "Error preloading route! ☝️";
27
+ function useLinkProps(options) {
28
+ const router = useRouter.useRouter();
29
+ const matchPathname = Matches.useMatch({
30
+ strict: false,
31
+ select: (s) => s.pathname
32
+ });
33
+ const {
34
+ // custom props
35
+ children,
36
+ target,
37
+ activeProps = () => ({ className: "active" }),
38
+ inactiveProps = () => ({}),
39
+ activeOptions,
40
+ disabled,
41
+ hash,
42
+ search,
43
+ params,
44
+ to,
45
+ state,
46
+ mask,
47
+ preload: userPreload,
48
+ preloadDelay: userPreloadDelay,
49
+ replace,
50
+ startTransition,
51
+ resetScroll,
52
+ // element props
53
+ style,
54
+ className,
55
+ onClick,
56
+ onFocus,
57
+ onMouseEnter,
58
+ onMouseLeave,
59
+ onTouchStart,
60
+ ...rest
61
+ } = options;
62
+ const dest = {
63
+ from: options.to ? matchPathname : void 0,
64
+ ...options
65
+ };
66
+ let type = "internal";
67
+ try {
68
+ new URL(`${to}`);
69
+ type = "external";
70
+ } catch {
71
+ }
72
+ if (type === "external") {
73
+ return {
74
+ href: to
75
+ };
76
+ }
77
+ const next = router.buildLocation(dest);
78
+ const preload = userPreload ?? router.options.defaultPreload;
79
+ const preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0;
80
+ const isActive = useRouterState.useRouterState({
81
+ select: (s) => {
82
+ const currentPathSplit = s.location.pathname.split("/");
83
+ const nextPathSplit = next.pathname.split("/");
84
+ const pathIsFuzzyEqual = nextPathSplit.every(
85
+ (d, i) => d === currentPathSplit[i]
86
+ );
87
+ const pathTest = (activeOptions == null ? void 0 : activeOptions.exact) ? s.location.pathname === next.pathname : pathIsFuzzyEqual;
88
+ const hashTest = (activeOptions == null ? void 0 : activeOptions.includeHash) ? s.location.hash === next.hash : true;
89
+ const searchTest = (activeOptions == null ? void 0 : activeOptions.includeSearch) ?? true ? utils.deepEqual(s.location.search, next.search, !(activeOptions == null ? void 0 : activeOptions.exact)) : true;
90
+ return pathTest && hashTest && searchTest;
91
+ }
92
+ });
93
+ const handleClick = (e) => {
94
+ if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!target || target === "_self") && e.button === 0) {
95
+ e.preventDefault();
96
+ router.commitLocation({ ...next, replace, resetScroll, startTransition });
97
+ }
98
+ };
99
+ const handleFocus = (e) => {
100
+ if (preload) {
101
+ router.preloadRoute(dest).catch((err) => {
102
+ console.warn(err);
103
+ console.warn(preloadWarning);
104
+ });
105
+ }
106
+ };
107
+ const handleTouchStart = (e) => {
108
+ if (preload) {
109
+ router.preloadRoute(dest).catch((err) => {
110
+ console.warn(err);
111
+ console.warn(preloadWarning);
112
+ });
113
+ }
114
+ };
115
+ const handleEnter = (e) => {
116
+ const target2 = e.target || {};
117
+ if (preload) {
118
+ if (target2.preloadTimeout) {
119
+ return;
120
+ }
121
+ target2.preloadTimeout = setTimeout(() => {
122
+ target2.preloadTimeout = null;
123
+ router.preloadRoute(dest).catch((err) => {
124
+ console.warn(err);
125
+ console.warn(preloadWarning);
126
+ });
127
+ }, preloadDelay);
128
+ }
129
+ };
130
+ const handleLeave = (e) => {
131
+ const target2 = e.target || {};
132
+ if (target2.preloadTimeout) {
133
+ clearTimeout(target2.preloadTimeout);
134
+ target2.preloadTimeout = null;
135
+ }
136
+ };
137
+ const composeHandlers = (handlers) => (e) => {
138
+ if (e.persist)
139
+ e.persist();
140
+ handlers.filter(Boolean).forEach((handler) => {
141
+ if (e.defaultPrevented)
142
+ return;
143
+ handler(e);
144
+ });
145
+ };
146
+ const resolvedActiveProps = isActive ? utils.functionalUpdate(activeProps, {}) ?? {} : {};
147
+ const resolvedInactiveProps = isActive ? {} : utils.functionalUpdate(inactiveProps, {}) ?? {};
148
+ return {
149
+ ...resolvedActiveProps,
150
+ ...resolvedInactiveProps,
151
+ ...rest,
152
+ href: disabled ? void 0 : next.maskedLocation ? next.maskedLocation.href : next.href,
153
+ onClick: composeHandlers([onClick, handleClick]),
154
+ onFocus: composeHandlers([onFocus, handleFocus]),
155
+ onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),
156
+ onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
157
+ onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
158
+ target,
159
+ style: {
160
+ ...style,
161
+ ...resolvedActiveProps.style,
162
+ ...resolvedInactiveProps.style
163
+ },
164
+ className: [
165
+ className,
166
+ resolvedActiveProps.className,
167
+ resolvedInactiveProps.className
168
+ ].filter(Boolean).join(" ") || void 0,
169
+ ...disabled ? {
170
+ role: "link",
171
+ "aria-disabled": true
172
+ } : void 0,
173
+ ["data-status"]: isActive ? "active" : void 0
174
+ };
175
+ }
176
+ const Link = React__namespace.forwardRef((props, ref) => {
177
+ const linkProps = useLinkProps(props);
178
+ return /* @__PURE__ */ jsxRuntime.jsx(
179
+ "a",
180
+ {
181
+ ...{
182
+ ref,
183
+ ...linkProps,
184
+ children: typeof props.children === "function" ? props.children({
185
+ isActive: linkProps["data-status"] === "active"
186
+ }) : props.children
187
+ }
188
+ }
189
+ );
190
+ });
191
+ function isCtrlEvent(e) {
192
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
193
+ }
194
+ exports.Link = Link;
195
+ exports.useLinkProps = useLinkProps;
196
+ //# sourceMappingURL=link.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.cjs","sources":["../../src/link.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useMatch } from './Matches'\nimport { useRouterState } from './useRouterState'\nimport { useRouter } from './useRouter'\nimport { Trim } from './fileRoute'\nimport { AnyRoute, ReactNode, RootSearchSchema } from './route'\nimport { RouteByPath, RouteIds, RoutePaths } from './routeInfo'\nimport { RegisteredRouter } from './router'\nimport { LinkProps, UseLinkPropsOptions } from './useNavigate'\nimport {\n Expand,\n NoInfer,\n NonNullableUpdater,\n PickRequired,\n StringLiteral,\n Updater,\n WithoutEmpty,\n deepEqual,\n functionalUpdate,\n} from './utils'\nimport { HistoryState } from '@tanstack/history'\n\nexport type CleanPath<T extends string> = T extends `${infer L}//${infer R}`\n ? CleanPath<`${CleanPath<L>}/${CleanPath<R>}`>\n : T extends `${infer L}//`\n ? `${CleanPath<L>}/`\n : T extends `//${infer L}`\n ? `/${CleanPath<L>}`\n : T\n\nexport type Split<S, TIncludeTrailingSlash = true> = S extends unknown\n ? string extends S\n ? string[]\n : S extends string\n ? CleanPath<S> extends ''\n ? []\n : TIncludeTrailingSlash extends true\n ? CleanPath<S> extends `${infer T}/`\n ? [...Split<T>, '/']\n : CleanPath<S> extends `/${infer U}`\n ? Split<U>\n : CleanPath<S> extends `${infer T}/${infer U}`\n ? [...Split<T>, ...Split<U>]\n : [S]\n : CleanPath<S> extends `${infer T}/${infer U}`\n ? [...Split<T>, ...Split<U>]\n : S extends string\n ? [S]\n : never\n : never\n : never\n\nexport type ParsePathParams<T extends string> = keyof {\n [K in Trim<Split<T>[number], '_'> as K extends `$${infer L}`\n ? L extends ''\n ? '_splat'\n : L\n : never]: K\n}\n\nexport type Join<T, Delimiter extends string = '/'> = T extends []\n ? ''\n : T extends [infer L extends string]\n ? L\n : T extends [infer L extends string, ...infer Tail extends [...string[]]]\n ? CleanPath<`${L}${Delimiter}${Join<Tail>}`>\n : never\n\nexport type Last<T extends any[]> = T extends [...infer _, infer L] ? L : never\n\nexport type RelativeToPathAutoComplete<\n AllPaths extends string,\n TFrom extends string,\n TTo extends string,\n SplitPaths extends string[] = Split<AllPaths, false>,\n> = TTo extends `..${infer _}`\n ? SplitPaths extends [\n ...Split<ResolveRelativePath<TFrom, TTo>, false>,\n ...infer TToRest,\n ]\n ? `${CleanPath<\n Join<\n [\n ...Split<TTo, false>,\n ...(\n | TToRest\n | (Split<\n ResolveRelativePath<TFrom, TTo>,\n false\n >['length'] extends 1\n ? never\n : ['../'])\n ),\n ]\n >\n >}`\n : never\n : TTo extends `./${infer RestTTo}`\n ? SplitPaths extends [\n ...Split<TFrom, false>,\n ...Split<RestTTo, false>,\n ...infer RestPath,\n ]\n ? `${TTo}${Join<RestPath>}`\n : never\n :\n | (TFrom extends `/`\n ? never\n : SplitPaths extends [...Split<TFrom, false>, ...infer RestPath]\n ? Join<RestPath> extends { length: 0 }\n ? never\n : './'\n : never)\n | (TFrom extends `/` ? never : '../')\n | AllPaths\n\nexport type NavigateOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> | string = RoutePaths<TRouteTree>,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom,\n TMaskTo extends string = '',\n> = ToOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // `replace` is a boolean that determines whether the navigation should replace the current history entry or push a new one.\n replace?: boolean\n resetScroll?: boolean\n // If set to `true`, the link's underlying navigate() call will be wrapped in a `React.startTransition` call. Defaults to `true`.\n startTransition?: boolean\n}\n\nexport type ToOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> | string = RoutePaths<TRouteTree>,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptions<TRouteTree, TFrom, TTo> & {\n mask?: ToMaskOptions<TRouteTree, TMaskFrom, TMaskTo>\n}\n\nexport type ToMaskOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TMaskFrom extends RoutePaths<TRouteTree> | string = RoutePaths<TRouteTree>,\n TMaskTo extends string = '',\n> = ToSubOptions<TRouteTree, TMaskFrom, TMaskTo> & {\n unmaskOnReload?: boolean\n}\n\nexport type ToSubOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> | string = RoutePaths<TRouteTree>,\n TTo extends string = '',\n TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>,\n> = {\n to?: ToPathOption<TRouteTree, TFrom, TTo>\n // The new has string or a function to update it\n hash?: true | Updater<string>\n // State to pass to the history stack\n state?: true | NonNullableUpdater<HistoryState>\n // The source route path. This is automatically set when using route-level APIs, but for type-safe relative routing on the router itself, this is required\n from?: StringLiteral<TFrom>\n // // When using relative route paths, this option forces resolution from the current path, instead of the route API's path or `from` path\n} & CheckPath<TRouteTree, NoInfer<TResolved>, {}> &\n SearchParamOptions<TRouteTree, TFrom, TTo, TResolved> &\n PathParamOptions<TRouteTree, TFrom, TTo, TResolved>\n\ntype ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo)\n\ntype ParamVariant = 'PATH' | 'SEARCH'\ntype ExcludeRootSearchSchema<T, Excluded = Exclude<T, RootSearchSchema>> = [\n Excluded,\n] extends [never]\n ? {}\n : Excluded\n\ntype PostProcessParams<\n T,\n TParamVariant extends ParamVariant,\n> = TParamVariant extends 'SEARCH' ? ExcludeRootSearchSchema<T> : T\n\nexport type ParamOptions<\n TRouteTree extends AnyRoute,\n TFrom,\n TTo extends string,\n TResolved,\n TParamVariant extends ParamVariant,\n TFromRouteType extends\n | 'allParams'\n | 'fullSearchSchema' = TParamVariant extends 'PATH'\n ? 'allParams'\n : 'fullSearchSchema',\n TToRouteType extends\n | 'allParams'\n | 'fullSearchSchemaInput' = TParamVariant extends 'PATH'\n ? 'allParams'\n : 'fullSearchSchemaInput',\n TFromParams = PostProcessParams<\n RouteByPath<TRouteTree, TFrom>['types'][TFromRouteType],\n TParamVariant\n >,\n TToIndex = TTo extends ''\n ? ''\n : RouteByPath<TRouteTree, `${TTo}/`> extends never\n ? TTo\n : `${TTo}/`,\n TToParams = TToIndex extends ''\n ? TFromParams\n : never extends TResolved\n ? PostProcessParams<\n RouteByPath<TRouteTree, TToIndex>['types'][TToRouteType],\n TParamVariant\n >\n : PostProcessParams<\n RouteByPath<TRouteTree, TResolved>['types'][TToRouteType],\n TParamVariant\n >,\n TReducer = ParamsReducer<TFromParams, TToParams>,\n> = Expand<WithoutEmpty<PickRequired<TToParams>>> extends never\n ? Partial<MakeParamOption<TParamVariant, true | TReducer>>\n : TFromParams extends Expand<WithoutEmpty<PickRequired<TToParams>>>\n ? MakeParamOption<TParamVariant, true | TReducer>\n : MakeParamOption<TParamVariant, TReducer>\n\ntype MakeParamOption<\n TParamVariant extends ParamVariant,\n T,\n> = TParamVariant extends 'PATH'\n ? MakePathParamOptions<T>\n : MakeSearchParamOptions<T>\ntype MakeSearchParamOptions<T> = { search: T }\ntype MakePathParamOptions<T> = { params: T }\n\nexport type SearchParamOptions<\n TRouteTree extends AnyRoute,\n TFrom,\n TTo extends string,\n TResolved,\n> = ParamOptions<TRouteTree, TFrom, TTo, TResolved, 'SEARCH'>\n\nexport type PathParamOptions<\n TRouteTree extends AnyRoute,\n TFrom,\n TTo extends string,\n TResolved,\n> = ParamOptions<TRouteTree, TFrom, TTo, TResolved, 'PATH'>\n\nexport type ToPathOption<\n TRouteTree extends AnyRoute = AnyRoute,\n TFrom extends RoutePaths<TRouteTree> | string = string,\n TTo extends string = '',\n> =\n | TTo\n | RelativeToPathAutoComplete<\n RoutePaths<TRouteTree>,\n NoInfer<TFrom> extends string ? NoInfer<TFrom> : '',\n NoInfer<TTo> & string\n >\n\nexport interface ActiveOptions {\n exact?: boolean\n includeHash?: boolean\n includeSearch?: boolean\n}\n\nexport type LinkOptions<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom,\n TMaskTo extends string = '',\n> = NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // The standard anchor tag target attribute\n target?: HTMLAnchorElement['target']\n // Defaults to `{ exact: false, includeHash: false }`\n activeOptions?: ActiveOptions\n // If set, will preload the linked route on hover and cache it for this many milliseconds in hopes that the user will eventually navigate there.\n preload?: false | 'intent'\n // Delay intent preloading by this many milliseconds. If the intent exits before this delay, the preload will be cancelled.\n preloadDelay?: number\n // If true, will render the link without the href attribute\n disabled?: boolean\n}\n\nexport type CheckPath<TRouteTree extends AnyRoute, TPath, TPass> = Exclude<\n TPath,\n RoutePaths<TRouteTree>\n> extends never\n ? TPass\n : CheckPathError<TRouteTree, Exclude<TPath, RoutePaths<TRouteTree>>>\n\nexport type CheckPathError<TRouteTree extends AnyRoute, TInvalids> = {\n to: RoutePaths<TRouteTree>\n}\n\nexport type ResolveRelativePath<TFrom, TTo = '.'> = TFrom extends string\n ? TTo extends string\n ? TTo extends '.'\n ? TFrom\n : TTo extends `./`\n ? Join<[TFrom, '/']>\n : TTo extends `./${infer TRest}`\n ? ResolveRelativePath<TFrom, TRest>\n : TTo extends `/${infer TRest}`\n ? TTo\n : Split<TTo> extends ['..', ...infer ToRest]\n ? Split<TFrom> extends [...infer FromRest, infer FromTail]\n ? ToRest extends ['/']\n ? Join<[...FromRest, '/']>\n : ResolveRelativePath<Join<FromRest>, Join<ToRest>>\n : never\n : Split<TTo> extends ['.', ...infer ToRest]\n ? ToRest extends ['/']\n ? Join<[TFrom, '/']>\n : ResolveRelativePath<TFrom, Join<ToRest>>\n : CleanPath<Join<['/', ...Split<TFrom>, ...Split<TTo>]>>\n : never\n : never\n\ntype LinkCurrentTargetElement = {\n preloadTimeout?: null | ReturnType<typeof setTimeout>\n}\n\nconst preloadWarning = 'Error preloading route! ☝️'\n\nexport function useLinkProps<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom,\n TMaskTo extends string = '',\n>(\n options: UseLinkPropsOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouter()\n const matchPathname = useMatch({\n strict: false,\n select: (s) => s.pathname,\n })\n\n const {\n // custom props\n children,\n target,\n activeProps = () => ({ className: 'active' }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n hash,\n search,\n params,\n to,\n state,\n mask,\n preload: userPreload,\n preloadDelay: userPreloadDelay,\n replace,\n startTransition,\n resetScroll,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options\n\n // If this link simply reloads the current route,\n // make sure it has a new key so it will trigger a data refresh\n\n // If this `to` is a valid external URL, return\n // null for LinkUtils\n\n const dest = {\n from: options.to ? matchPathname : undefined,\n ...options,\n }\n\n let type: 'internal' | 'external' = 'internal'\n\n try {\n new URL(`${to}`)\n type = 'external'\n } catch {}\n\n if (type === 'external') {\n return {\n href: to,\n }\n }\n\n const next = router.buildLocation(dest as any)\n const preload = userPreload ?? router.options.defaultPreload\n const preloadDelay =\n userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = useRouterState({\n select: (s) => {\n // Compare path/hash for matches\n const currentPathSplit = s.location.pathname.split('/')\n const nextPathSplit = next.pathname.split('/')\n const pathIsFuzzyEqual = nextPathSplit.every(\n (d, i) => d === currentPathSplit[i],\n )\n // Combine the matches based on user router.options\n const pathTest = activeOptions?.exact\n ? s.location.pathname === next.pathname\n : pathIsFuzzyEqual\n const hashTest = activeOptions?.includeHash\n ? s.location.hash === next.hash\n : true\n const searchTest =\n activeOptions?.includeSearch ?? true\n ? deepEqual(s.location.search, next.search, !activeOptions?.exact)\n : true\n\n // The final \"active\" test\n return pathTest && hashTest && searchTest\n },\n })\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\n if (\n !disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!target || target === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n // All is well? Navigate!\n router.commitLocation({ ...next, replace, resetScroll, startTransition })\n }\n }\n\n // The click handler\n const handleFocus = (e: MouseEvent) => {\n if (preload) {\n router.preloadRoute(dest as any).catch((err) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n }\n }\n\n const handleTouchStart = (e: TouchEvent) => {\n if (preload) {\n router.preloadRoute(dest as any).catch((err) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n }\n }\n\n const handleEnter = (e: MouseEvent) => {\n const target = (e.target || {}) as LinkCurrentTargetElement\n\n if (preload) {\n if (target.preloadTimeout) {\n return\n }\n\n target.preloadTimeout = setTimeout(() => {\n target.preloadTimeout = null\n router.preloadRoute(dest as any).catch((err) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n }, preloadDelay)\n }\n }\n\n const handleLeave = (e: MouseEvent) => {\n const target = (e.target || {}) as LinkCurrentTargetElement\n\n if (target.preloadTimeout) {\n clearTimeout(target.preloadTimeout)\n target.preloadTimeout = null\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\n ? undefined\n : next.maskedLocation\n ? next.maskedLocation.href\n : next.href,\n onClick: composeHandlers([onClick, handleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style,\n },\n className:\n [\n className,\n resolvedActiveProps.className,\n resolvedInactiveProps.className,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n ...(disabled\n ? {\n role: 'link',\n 'aria-disabled': true,\n }\n : undefined),\n ['data-status']: isActive ? 'active' : undefined,\n }\n}\n\nexport interface LinkComponent<TProps extends Record<string, any> = {}> {\n <\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom,\n TMaskTo extends string = '',\n >(\n props: LinkProps<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> &\n TProps &\n React.RefAttributes<HTMLAnchorElement>,\n ): ReactNode\n}\n\nexport const Link: LinkComponent = 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\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n"],"names":["useRouter","useMatch","useRouterState","deepEqual","target","functionalUpdate","React","jsx"],"mappings":"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"}