@depup/tanstack__react-router 1.166.4-depup.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 (363) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -0
  3. package/dist/cjs/Asset.cjs +177 -0
  4. package/dist/cjs/Asset.cjs.map +1 -0
  5. package/dist/cjs/Asset.d.cts +5 -0
  6. package/dist/cjs/CatchBoundary.cjs +114 -0
  7. package/dist/cjs/CatchBoundary.cjs.map +1 -0
  8. package/dist/cjs/CatchBoundary.d.cts +12 -0
  9. package/dist/cjs/ClientOnly.cjs +21 -0
  10. package/dist/cjs/ClientOnly.cjs.map +1 -0
  11. package/dist/cjs/ClientOnly.d.cts +49 -0
  12. package/dist/cjs/HeadContent.cjs +15 -0
  13. package/dist/cjs/HeadContent.cjs.map +1 -0
  14. package/dist/cjs/HeadContent.d.cts +6 -0
  15. package/dist/cjs/HeadContent.dev.cjs +41 -0
  16. package/dist/cjs/HeadContent.dev.cjs.map +1 -0
  17. package/dist/cjs/HeadContent.dev.d.cts +10 -0
  18. package/dist/cjs/Match.cjs +255 -0
  19. package/dist/cjs/Match.cjs.map +1 -0
  20. package/dist/cjs/Match.d.cts +14 -0
  21. package/dist/cjs/Matches.cjs +138 -0
  22. package/dist/cjs/Matches.cjs.map +1 -0
  23. package/dist/cjs/Matches.d.cts +68 -0
  24. package/dist/cjs/RouterProvider.cjs +32 -0
  25. package/dist/cjs/RouterProvider.cjs.map +1 -0
  26. package/dist/cjs/RouterProvider.d.cts +23 -0
  27. package/dist/cjs/SafeFragment.cjs +8 -0
  28. package/dist/cjs/SafeFragment.cjs.map +1 -0
  29. package/dist/cjs/SafeFragment.d.cts +1 -0
  30. package/dist/cjs/ScriptOnce.cjs +22 -0
  31. package/dist/cjs/ScriptOnce.cjs.map +1 -0
  32. package/dist/cjs/ScriptOnce.d.cts +6 -0
  33. package/dist/cjs/Scripts.cjs +56 -0
  34. package/dist/cjs/Scripts.cjs.map +1 -0
  35. package/dist/cjs/Scripts.d.cts +5 -0
  36. package/dist/cjs/ScrollRestoration.cjs +38 -0
  37. package/dist/cjs/ScrollRestoration.cjs.map +1 -0
  38. package/dist/cjs/ScrollRestoration.d.cts +14 -0
  39. package/dist/cjs/Transitioner.cjs +119 -0
  40. package/dist/cjs/Transitioner.cjs.map +1 -0
  41. package/dist/cjs/Transitioner.d.cts +1 -0
  42. package/dist/cjs/awaited.cjs +51 -0
  43. package/dist/cjs/awaited.cjs.map +1 -0
  44. package/dist/cjs/awaited.d.cts +14 -0
  45. package/dist/cjs/fileRoute.cjs +109 -0
  46. package/dist/cjs/fileRoute.cjs.map +1 -0
  47. package/dist/cjs/fileRoute.d.cts +87 -0
  48. package/dist/cjs/headContentUtils.cjs +185 -0
  49. package/dist/cjs/headContentUtils.cjs.map +1 -0
  50. package/dist/cjs/headContentUtils.d.cts +7 -0
  51. package/dist/cjs/history.d.cts +8 -0
  52. package/dist/cjs/index.cjs +241 -0
  53. package/dist/cjs/index.cjs.map +1 -0
  54. package/dist/cjs/index.d.cts +51 -0
  55. package/dist/cjs/index.dev.cjs +241 -0
  56. package/dist/cjs/index.dev.cjs.map +1 -0
  57. package/dist/cjs/index.dev.d.cts +2 -0
  58. package/dist/cjs/lazyRouteComponent.cjs +70 -0
  59. package/dist/cjs/lazyRouteComponent.cjs.map +1 -0
  60. package/dist/cjs/lazyRouteComponent.d.cts +11 -0
  61. package/dist/cjs/link.cjs +573 -0
  62. package/dist/cjs/link.cjs.map +1 -0
  63. package/dist/cjs/link.d.cts +98 -0
  64. package/dist/cjs/matchContext.cjs +27 -0
  65. package/dist/cjs/matchContext.cjs.map +1 -0
  66. package/dist/cjs/matchContext.d.cts +3 -0
  67. package/dist/cjs/not-found.cjs +38 -0
  68. package/dist/cjs/not-found.cjs.map +1 -0
  69. package/dist/cjs/not-found.d.cts +9 -0
  70. package/dist/cjs/renderRouteNotFound.cjs +22 -0
  71. package/dist/cjs/renderRouteNotFound.cjs.map +1 -0
  72. package/dist/cjs/renderRouteNotFound.d.cts +10 -0
  73. package/dist/cjs/route.cjs +198 -0
  74. package/dist/cjs/route.cjs.map +1 -0
  75. package/dist/cjs/route.d.cts +142 -0
  76. package/dist/cjs/router.cjs +22 -0
  77. package/dist/cjs/router.cjs.map +1 -0
  78. package/dist/cjs/router.d.cts +83 -0
  79. package/dist/cjs/routerContext.cjs +23 -0
  80. package/dist/cjs/routerContext.cjs.map +1 -0
  81. package/dist/cjs/routerContext.d.cts +3 -0
  82. package/dist/cjs/scroll-restoration.cjs +39 -0
  83. package/dist/cjs/scroll-restoration.cjs.map +1 -0
  84. package/dist/cjs/scroll-restoration.d.cts +1 -0
  85. package/dist/cjs/ssr/RouterClient.cjs +25 -0
  86. package/dist/cjs/ssr/RouterClient.cjs.map +1 -0
  87. package/dist/cjs/ssr/RouterClient.d.cts +4 -0
  88. package/dist/cjs/ssr/RouterServer.cjs +9 -0
  89. package/dist/cjs/ssr/RouterServer.cjs.map +1 -0
  90. package/dist/cjs/ssr/RouterServer.d.cts +4 -0
  91. package/dist/cjs/ssr/client.cjs +12 -0
  92. package/dist/cjs/ssr/client.cjs.map +1 -0
  93. package/dist/cjs/ssr/client.d.cts +2 -0
  94. package/dist/cjs/ssr/defaultRenderHandler.cjs +15 -0
  95. package/dist/cjs/ssr/defaultRenderHandler.cjs.map +1 -0
  96. package/dist/cjs/ssr/defaultRenderHandler.d.cts +1 -0
  97. package/dist/cjs/ssr/defaultStreamHandler.cjs +16 -0
  98. package/dist/cjs/ssr/defaultStreamHandler.cjs.map +1 -0
  99. package/dist/cjs/ssr/defaultStreamHandler.d.cts +1 -0
  100. package/dist/cjs/ssr/renderRouterToStream.cjs +73 -0
  101. package/dist/cjs/ssr/renderRouterToStream.cjs.map +1 -0
  102. package/dist/cjs/ssr/renderRouterToStream.d.cts +8 -0
  103. package/dist/cjs/ssr/renderRouterToString.cjs +31 -0
  104. package/dist/cjs/ssr/renderRouterToString.cjs.map +1 -0
  105. package/dist/cjs/ssr/renderRouterToString.d.cts +7 -0
  106. package/dist/cjs/ssr/serializer.d.cts +6 -0
  107. package/dist/cjs/ssr/server.cjs +20 -0
  108. package/dist/cjs/ssr/server.cjs.map +1 -0
  109. package/dist/cjs/ssr/server.d.cts +6 -0
  110. package/dist/cjs/structuralSharing.d.cts +8 -0
  111. package/dist/cjs/typePrimitives.d.cts +16 -0
  112. package/dist/cjs/useBlocker.cjs +171 -0
  113. package/dist/cjs/useBlocker.cjs.map +1 -0
  114. package/dist/cjs/useBlocker.d.cts +66 -0
  115. package/dist/cjs/useCanGoBack.cjs +8 -0
  116. package/dist/cjs/useCanGoBack.cjs.map +1 -0
  117. package/dist/cjs/useCanGoBack.d.cts +1 -0
  118. package/dist/cjs/useLoaderData.cjs +15 -0
  119. package/dist/cjs/useLoaderData.cjs.map +1 -0
  120. package/dist/cjs/useLoaderData.d.cts +19 -0
  121. package/dist/cjs/useLoaderDeps.cjs +14 -0
  122. package/dist/cjs/useLoaderDeps.cjs.map +1 -0
  123. package/dist/cjs/useLoaderDeps.d.cts +19 -0
  124. package/dist/cjs/useLocation.cjs +10 -0
  125. package/dist/cjs/useLocation.cjs.map +1 -0
  126. package/dist/cjs/useLocation.d.cts +18 -0
  127. package/dist/cjs/useMatch.cjs +47 -0
  128. package/dist/cjs/useMatch.cjs.map +1 -0
  129. package/dist/cjs/useMatch.d.cts +14 -0
  130. package/dist/cjs/useNavigate.cjs +49 -0
  131. package/dist/cjs/useNavigate.cjs.map +1 -0
  132. package/dist/cjs/useNavigate.d.cts +28 -0
  133. package/dist/cjs/useParams.cjs +17 -0
  134. package/dist/cjs/useParams.cjs.map +1 -0
  135. package/dist/cjs/useParams.d.cts +21 -0
  136. package/dist/cjs/useRouteContext.cjs +11 -0
  137. package/dist/cjs/useRouteContext.cjs.map +1 -0
  138. package/dist/cjs/useRouteContext.d.cts +3 -0
  139. package/dist/cjs/useRouter.cjs +32 -0
  140. package/dist/cjs/useRouter.cjs.map +1 -0
  141. package/dist/cjs/useRouter.d.cts +14 -0
  142. package/dist/cjs/useRouterState.cjs +38 -0
  143. package/dist/cjs/useRouterState.cjs.map +1 -0
  144. package/dist/cjs/useRouterState.d.cts +20 -0
  145. package/dist/cjs/useSearch.cjs +16 -0
  146. package/dist/cjs/useSearch.cjs.map +1 -0
  147. package/dist/cjs/useSearch.d.cts +21 -0
  148. package/dist/cjs/utils.cjs +62 -0
  149. package/dist/cjs/utils.cjs.map +1 -0
  150. package/dist/cjs/utils.d.cts +54 -0
  151. package/dist/esm/Asset.d.ts +5 -0
  152. package/dist/esm/Asset.js +160 -0
  153. package/dist/esm/Asset.js.map +1 -0
  154. package/dist/esm/CatchBoundary.d.ts +12 -0
  155. package/dist/esm/CatchBoundary.js +97 -0
  156. package/dist/esm/CatchBoundary.js.map +1 -0
  157. package/dist/esm/ClientOnly.d.ts +49 -0
  158. package/dist/esm/ClientOnly.js +21 -0
  159. package/dist/esm/ClientOnly.js.map +1 -0
  160. package/dist/esm/HeadContent.d.ts +6 -0
  161. package/dist/esm/HeadContent.dev.d.ts +10 -0
  162. package/dist/esm/HeadContent.dev.js +25 -0
  163. package/dist/esm/HeadContent.dev.js.map +1 -0
  164. package/dist/esm/HeadContent.js +15 -0
  165. package/dist/esm/HeadContent.js.map +1 -0
  166. package/dist/esm/Match.d.ts +14 -0
  167. package/dist/esm/Match.js +238 -0
  168. package/dist/esm/Match.js.map +1 -0
  169. package/dist/esm/Matches.d.ts +68 -0
  170. package/dist/esm/Matches.js +121 -0
  171. package/dist/esm/Matches.js.map +1 -0
  172. package/dist/esm/RouterProvider.d.ts +23 -0
  173. package/dist/esm/RouterProvider.js +32 -0
  174. package/dist/esm/RouterProvider.js.map +1 -0
  175. package/dist/esm/SafeFragment.d.ts +1 -0
  176. package/dist/esm/SafeFragment.js +8 -0
  177. package/dist/esm/SafeFragment.js.map +1 -0
  178. package/dist/esm/ScriptOnce.d.ts +6 -0
  179. package/dist/esm/ScriptOnce.js +22 -0
  180. package/dist/esm/ScriptOnce.js.map +1 -0
  181. package/dist/esm/Scripts.d.ts +5 -0
  182. package/dist/esm/Scripts.js +56 -0
  183. package/dist/esm/Scripts.js.map +1 -0
  184. package/dist/esm/ScrollRestoration.d.ts +14 -0
  185. package/dist/esm/ScrollRestoration.js +38 -0
  186. package/dist/esm/ScrollRestoration.js.map +1 -0
  187. package/dist/esm/Transitioner.d.ts +1 -0
  188. package/dist/esm/Transitioner.js +102 -0
  189. package/dist/esm/Transitioner.js.map +1 -0
  190. package/dist/esm/awaited.d.ts +14 -0
  191. package/dist/esm/awaited.js +34 -0
  192. package/dist/esm/awaited.js.map +1 -0
  193. package/dist/esm/fileRoute.d.ts +87 -0
  194. package/dist/esm/fileRoute.js +109 -0
  195. package/dist/esm/fileRoute.js.map +1 -0
  196. package/dist/esm/headContentUtils.d.ts +7 -0
  197. package/dist/esm/headContentUtils.js +168 -0
  198. package/dist/esm/headContentUtils.js.map +1 -0
  199. package/dist/esm/history.d.ts +8 -0
  200. package/dist/esm/index.d.ts +51 -0
  201. package/dist/esm/index.dev.d.ts +2 -0
  202. package/dist/esm/index.dev.js +133 -0
  203. package/dist/esm/index.dev.js.map +1 -0
  204. package/dist/esm/index.js +133 -0
  205. package/dist/esm/index.js.map +1 -0
  206. package/dist/esm/lazyRouteComponent.d.ts +11 -0
  207. package/dist/esm/lazyRouteComponent.js +53 -0
  208. package/dist/esm/lazyRouteComponent.js.map +1 -0
  209. package/dist/esm/link.d.ts +98 -0
  210. package/dist/esm/link.js +556 -0
  211. package/dist/esm/link.js.map +1 -0
  212. package/dist/esm/matchContext.d.ts +3 -0
  213. package/dist/esm/matchContext.js +10 -0
  214. package/dist/esm/matchContext.js.map +1 -0
  215. package/dist/esm/not-found.d.ts +9 -0
  216. package/dist/esm/not-found.js +38 -0
  217. package/dist/esm/not-found.js.map +1 -0
  218. package/dist/esm/renderRouteNotFound.d.ts +10 -0
  219. package/dist/esm/renderRouteNotFound.js +22 -0
  220. package/dist/esm/renderRouteNotFound.js.map +1 -0
  221. package/dist/esm/route.d.ts +142 -0
  222. package/dist/esm/route.js +198 -0
  223. package/dist/esm/route.js.map +1 -0
  224. package/dist/esm/router.d.ts +83 -0
  225. package/dist/esm/router.js +22 -0
  226. package/dist/esm/router.js.map +1 -0
  227. package/dist/esm/routerContext.d.ts +3 -0
  228. package/dist/esm/routerContext.js +6 -0
  229. package/dist/esm/routerContext.js.map +1 -0
  230. package/dist/esm/scroll-restoration.d.ts +1 -0
  231. package/dist/esm/scroll-restoration.js +39 -0
  232. package/dist/esm/scroll-restoration.js.map +1 -0
  233. package/dist/esm/ssr/RouterClient.d.ts +4 -0
  234. package/dist/esm/ssr/RouterClient.js +25 -0
  235. package/dist/esm/ssr/RouterClient.js.map +1 -0
  236. package/dist/esm/ssr/RouterServer.d.ts +4 -0
  237. package/dist/esm/ssr/RouterServer.js +9 -0
  238. package/dist/esm/ssr/RouterServer.js.map +1 -0
  239. package/dist/esm/ssr/client.d.ts +2 -0
  240. package/dist/esm/ssr/client.js +6 -0
  241. package/dist/esm/ssr/client.js.map +1 -0
  242. package/dist/esm/ssr/defaultRenderHandler.d.ts +1 -0
  243. package/dist/esm/ssr/defaultRenderHandler.js +15 -0
  244. package/dist/esm/ssr/defaultRenderHandler.js.map +1 -0
  245. package/dist/esm/ssr/defaultStreamHandler.d.ts +1 -0
  246. package/dist/esm/ssr/defaultStreamHandler.js +16 -0
  247. package/dist/esm/ssr/defaultStreamHandler.js.map +1 -0
  248. package/dist/esm/ssr/renderRouterToStream.d.ts +8 -0
  249. package/dist/esm/ssr/renderRouterToStream.js +73 -0
  250. package/dist/esm/ssr/renderRouterToStream.js.map +1 -0
  251. package/dist/esm/ssr/renderRouterToString.d.ts +7 -0
  252. package/dist/esm/ssr/renderRouterToString.js +31 -0
  253. package/dist/esm/ssr/renderRouterToString.js.map +1 -0
  254. package/dist/esm/ssr/serializer.d.ts +6 -0
  255. package/dist/esm/ssr/server.d.ts +6 -0
  256. package/dist/esm/ssr/server.js +14 -0
  257. package/dist/esm/ssr/server.js.map +1 -0
  258. package/dist/esm/structuralSharing.d.ts +8 -0
  259. package/dist/esm/typePrimitives.d.ts +16 -0
  260. package/dist/esm/useBlocker.d.ts +66 -0
  261. package/dist/esm/useBlocker.js +154 -0
  262. package/dist/esm/useBlocker.js.map +1 -0
  263. package/dist/esm/useCanGoBack.d.ts +1 -0
  264. package/dist/esm/useCanGoBack.js +8 -0
  265. package/dist/esm/useCanGoBack.js.map +1 -0
  266. package/dist/esm/useLoaderData.d.ts +19 -0
  267. package/dist/esm/useLoaderData.js +15 -0
  268. package/dist/esm/useLoaderData.js.map +1 -0
  269. package/dist/esm/useLoaderDeps.d.ts +19 -0
  270. package/dist/esm/useLoaderDeps.js +14 -0
  271. package/dist/esm/useLoaderDeps.js.map +1 -0
  272. package/dist/esm/useLocation.d.ts +18 -0
  273. package/dist/esm/useLocation.js +10 -0
  274. package/dist/esm/useLocation.js.map +1 -0
  275. package/dist/esm/useMatch.d.ts +14 -0
  276. package/dist/esm/useMatch.js +30 -0
  277. package/dist/esm/useMatch.js.map +1 -0
  278. package/dist/esm/useNavigate.d.ts +28 -0
  279. package/dist/esm/useNavigate.js +32 -0
  280. package/dist/esm/useNavigate.js.map +1 -0
  281. package/dist/esm/useParams.d.ts +21 -0
  282. package/dist/esm/useParams.js +17 -0
  283. package/dist/esm/useParams.js.map +1 -0
  284. package/dist/esm/useRouteContext.d.ts +3 -0
  285. package/dist/esm/useRouteContext.js +11 -0
  286. package/dist/esm/useRouteContext.js.map +1 -0
  287. package/dist/esm/useRouter.d.ts +14 -0
  288. package/dist/esm/useRouter.js +15 -0
  289. package/dist/esm/useRouter.js.map +1 -0
  290. package/dist/esm/useRouterState.d.ts +20 -0
  291. package/dist/esm/useRouterState.js +38 -0
  292. package/dist/esm/useRouterState.js.map +1 -0
  293. package/dist/esm/useSearch.d.ts +21 -0
  294. package/dist/esm/useSearch.js +16 -0
  295. package/dist/esm/useSearch.js.map +1 -0
  296. package/dist/esm/utils.d.ts +54 -0
  297. package/dist/esm/utils.js +45 -0
  298. package/dist/esm/utils.js.map +1 -0
  299. package/dist/llms/index.d.ts +3 -0
  300. package/dist/llms/index.js +43 -0
  301. package/dist/llms/rules/api.d.ts +2 -0
  302. package/dist/llms/rules/api.js +4612 -0
  303. package/dist/llms/rules/guide.d.ts +2 -0
  304. package/dist/llms/rules/guide.js +10690 -0
  305. package/dist/llms/rules/installation.d.ts +2 -0
  306. package/dist/llms/rules/installation.js +1285 -0
  307. package/dist/llms/rules/routing.d.ts +2 -0
  308. package/dist/llms/rules/routing.js +1984 -0
  309. package/dist/llms/rules/setup-and-architecture.d.ts +2 -0
  310. package/dist/llms/rules/setup-and-architecture.js +920 -0
  311. package/package.json +142 -0
  312. package/src/Asset.tsx +219 -0
  313. package/src/CatchBoundary.tsx +120 -0
  314. package/src/ClientOnly.tsx +68 -0
  315. package/src/HeadContent.dev.tsx +46 -0
  316. package/src/HeadContent.tsx +22 -0
  317. package/src/Match.tsx +360 -0
  318. package/src/Matches.tsx +313 -0
  319. package/src/RouterProvider.tsx +92 -0
  320. package/src/SafeFragment.tsx +5 -0
  321. package/src/ScriptOnce.tsx +21 -0
  322. package/src/Scripts.tsx +80 -0
  323. package/src/ScrollRestoration.tsx +69 -0
  324. package/src/Transitioner.tsx +134 -0
  325. package/src/awaited.tsx +55 -0
  326. package/src/fileRoute.ts +313 -0
  327. package/src/headContentUtils.tsx +217 -0
  328. package/src/history.ts +9 -0
  329. package/src/index.dev.tsx +6 -0
  330. package/src/index.tsx +341 -0
  331. package/src/lazyRouteComponent.tsx +96 -0
  332. package/src/link.tsx +984 -0
  333. package/src/matchContext.tsx +8 -0
  334. package/src/not-found.tsx +43 -0
  335. package/src/renderRouteNotFound.tsx +35 -0
  336. package/src/route.tsx +740 -0
  337. package/src/router.ts +127 -0
  338. package/src/routerContext.tsx +4 -0
  339. package/src/scroll-restoration.tsx +45 -0
  340. package/src/ssr/RouterClient.tsx +22 -0
  341. package/src/ssr/RouterServer.tsx +9 -0
  342. package/src/ssr/client.ts +2 -0
  343. package/src/ssr/defaultRenderHandler.tsx +12 -0
  344. package/src/ssr/defaultStreamHandler.tsx +13 -0
  345. package/src/ssr/renderRouterToStream.tsx +90 -0
  346. package/src/ssr/renderRouterToString.tsx +36 -0
  347. package/src/ssr/serializer.ts +7 -0
  348. package/src/ssr/server.ts +6 -0
  349. package/src/structuralSharing.ts +47 -0
  350. package/src/typePrimitives.ts +84 -0
  351. package/src/useBlocker.tsx +320 -0
  352. package/src/useCanGoBack.ts +5 -0
  353. package/src/useLoaderData.tsx +91 -0
  354. package/src/useLoaderDeps.tsx +69 -0
  355. package/src/useLocation.tsx +52 -0
  356. package/src/useMatch.tsx +123 -0
  357. package/src/useNavigate.tsx +78 -0
  358. package/src/useParams.tsx +107 -0
  359. package/src/useRouteContext.ts +30 -0
  360. package/src/useRouter.tsx +25 -0
  361. package/src/useRouterState.tsx +86 -0
  362. package/src/useSearch.tsx +105 -0
  363. package/src/utils.ts +125 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-present Tanner Linsley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @depup/tanstack__react-router
2
+
3
+ > Dependency-bumped version of [@tanstack/react-router](https://www.npmjs.com/package/@tanstack/react-router)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/tanstack__react-router
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [@tanstack/react-router](https://www.npmjs.com/package/@tanstack/react-router) @ 1.166.4 |
17
+ | Processed | 2026-03-09 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 2 |
20
+
21
+ ## Dependency Changes
22
+
23
+ | Dependency | From | To |
24
+ |------------|------|-----|
25
+ | @tanstack/react-store | ^0.9.1 | ^0.9.2 |
26
+ | isbot | ^5.1.22 | ^5.1.35 |
27
+
28
+ ---
29
+
30
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@tanstack/react-router
31
+
32
+ License inherited from the original package.
@@ -0,0 +1,177 @@
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 isServer = require("@tanstack/router-core/isServer");
6
+ const useRouter = require("./useRouter.cjs");
7
+ const ClientOnly = require("./ClientOnly.cjs");
8
+ function _interopNamespaceDefault(e) {
9
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
+ if (e) {
11
+ for (const k in e) {
12
+ if (k !== "default") {
13
+ const d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: () => e[k]
17
+ });
18
+ }
19
+ }
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
25
+ function Asset({
26
+ tag,
27
+ attrs,
28
+ children,
29
+ nonce
30
+ }) {
31
+ switch (tag) {
32
+ case "title":
33
+ return /* @__PURE__ */ jsxRuntime.jsx("title", { ...attrs, suppressHydrationWarning: true, children });
34
+ case "meta":
35
+ return /* @__PURE__ */ jsxRuntime.jsx("meta", { ...attrs, suppressHydrationWarning: true });
36
+ case "link":
37
+ return /* @__PURE__ */ jsxRuntime.jsx("link", { ...attrs, nonce, suppressHydrationWarning: true });
38
+ case "style":
39
+ return /* @__PURE__ */ jsxRuntime.jsx(
40
+ "style",
41
+ {
42
+ ...attrs,
43
+ dangerouslySetInnerHTML: { __html: children },
44
+ nonce
45
+ }
46
+ );
47
+ case "script":
48
+ return /* @__PURE__ */ jsxRuntime.jsx(Script, { attrs, children });
49
+ default:
50
+ return null;
51
+ }
52
+ }
53
+ function Script({
54
+ attrs,
55
+ children
56
+ }) {
57
+ const router = useRouter.useRouter();
58
+ const hydrated = ClientOnly.useHydrated();
59
+ const dataScript = typeof attrs?.type === "string" && attrs.type !== "" && attrs.type !== "text/javascript" && attrs.type !== "module";
60
+ if (process.env.NODE_ENV !== "production" && attrs?.src && typeof children === "string" && children.trim().length) {
61
+ console.warn(
62
+ "[TanStack Router] <Script> received both `src` and `children`. The `children` content will be ignored. Remove `children` or remove `src`."
63
+ );
64
+ }
65
+ React__namespace.useEffect(() => {
66
+ if (dataScript) return;
67
+ if (attrs?.src) {
68
+ const normSrc = (() => {
69
+ try {
70
+ const base = document.baseURI || window.location.href;
71
+ return new URL(attrs.src, base).href;
72
+ } catch {
73
+ return attrs.src;
74
+ }
75
+ })();
76
+ const existingScript = Array.from(
77
+ document.querySelectorAll("script[src]")
78
+ ).find((el) => el.src === normSrc);
79
+ if (existingScript) {
80
+ return;
81
+ }
82
+ const script = document.createElement("script");
83
+ for (const [key, value] of Object.entries(attrs)) {
84
+ if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) {
85
+ script.setAttribute(
86
+ key,
87
+ typeof value === "boolean" ? "" : String(value)
88
+ );
89
+ }
90
+ }
91
+ document.head.appendChild(script);
92
+ return () => {
93
+ if (script.parentNode) {
94
+ script.parentNode.removeChild(script);
95
+ }
96
+ };
97
+ }
98
+ if (typeof children === "string") {
99
+ const typeAttr = typeof attrs?.type === "string" ? attrs.type : "text/javascript";
100
+ const nonceAttr = typeof attrs?.nonce === "string" ? attrs.nonce : void 0;
101
+ const existingScript = Array.from(
102
+ document.querySelectorAll("script:not([src])")
103
+ ).find((el) => {
104
+ if (!(el instanceof HTMLScriptElement)) return false;
105
+ const sType = el.getAttribute("type") ?? "text/javascript";
106
+ const sNonce = el.getAttribute("nonce") ?? void 0;
107
+ return el.textContent === children && sType === typeAttr && sNonce === nonceAttr;
108
+ });
109
+ if (existingScript) {
110
+ return;
111
+ }
112
+ const script = document.createElement("script");
113
+ script.textContent = children;
114
+ if (attrs) {
115
+ for (const [key, value] of Object.entries(attrs)) {
116
+ if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) {
117
+ script.setAttribute(
118
+ key,
119
+ typeof value === "boolean" ? "" : String(value)
120
+ );
121
+ }
122
+ }
123
+ }
124
+ document.head.appendChild(script);
125
+ return () => {
126
+ if (script.parentNode) {
127
+ script.parentNode.removeChild(script);
128
+ }
129
+ };
130
+ }
131
+ return void 0;
132
+ }, [attrs, children, dataScript]);
133
+ if (isServer.isServer ?? router.isServer) {
134
+ if (attrs?.src) {
135
+ return /* @__PURE__ */ jsxRuntime.jsx("script", { ...attrs, suppressHydrationWarning: true });
136
+ }
137
+ if (typeof children === "string") {
138
+ return /* @__PURE__ */ jsxRuntime.jsx(
139
+ "script",
140
+ {
141
+ ...attrs,
142
+ dangerouslySetInnerHTML: { __html: children },
143
+ suppressHydrationWarning: true
144
+ }
145
+ );
146
+ }
147
+ return null;
148
+ }
149
+ if (dataScript && typeof children === "string") {
150
+ return /* @__PURE__ */ jsxRuntime.jsx(
151
+ "script",
152
+ {
153
+ ...attrs,
154
+ suppressHydrationWarning: true,
155
+ dangerouslySetInnerHTML: { __html: children }
156
+ }
157
+ );
158
+ }
159
+ if (!hydrated) {
160
+ if (attrs?.src) {
161
+ return /* @__PURE__ */ jsxRuntime.jsx("script", { ...attrs, suppressHydrationWarning: true });
162
+ }
163
+ if (typeof children === "string") {
164
+ return /* @__PURE__ */ jsxRuntime.jsx(
165
+ "script",
166
+ {
167
+ ...attrs,
168
+ dangerouslySetInnerHTML: { __html: children },
169
+ suppressHydrationWarning: true
170
+ }
171
+ );
172
+ }
173
+ }
174
+ return null;
175
+ }
176
+ exports.Asset = Asset;
177
+ //# sourceMappingURL=Asset.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Asset.cjs","sources":["../../src/Asset.tsx"],"sourcesContent":["import * as React from 'react'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\nimport { useHydrated } from './ClientOnly'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\ninterface ScriptAttrs {\n [key: string]: string | boolean | undefined\n src?: string\n suppressHydrationWarning?: boolean\n}\n\nexport function Asset({\n tag,\n attrs,\n children,\n nonce,\n}: RouterManagedTag & { nonce?: string }): React.ReactElement | null {\n switch (tag) {\n case 'title':\n return (\n <title {...attrs} suppressHydrationWarning>\n {children}\n </title>\n )\n case 'meta':\n return <meta {...attrs} suppressHydrationWarning />\n case 'link':\n return <link {...attrs} nonce={nonce} suppressHydrationWarning />\n case 'style':\n return (\n <style\n {...attrs}\n dangerouslySetInnerHTML={{ __html: children as string }}\n nonce={nonce}\n />\n )\n case 'script':\n return <Script attrs={attrs}>{children}</Script>\n default:\n return null\n }\n}\n\nfunction Script({\n attrs,\n children,\n}: {\n attrs?: ScriptAttrs\n children?: string\n}) {\n const router = useRouter()\n const hydrated = useHydrated()\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n if (\n process.env.NODE_ENV !== 'production' &&\n attrs?.src &&\n typeof children === 'string' &&\n children.trim().length\n ) {\n console.warn(\n '[TanStack Router] <Script> received both `src` and `children`. The `children` content will be ignored. Remove `children` or remove `src`.',\n )\n }\n\n React.useEffect(() => {\n if (dataScript) return\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n const script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (\n key !== 'suppressHydrationWarning' &&\n value !== undefined &&\n value !== false\n ) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n\n return () => {\n if (script.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n }\n\n if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n const script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (\n key !== 'suppressHydrationWarning' &&\n value !== undefined &&\n value !== false\n ) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n\n return () => {\n if (script.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n }\n\n return undefined\n }, [attrs, children, dataScript])\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} suppressHydrationWarning />\n }\n\n if (typeof children === 'string') {\n return (\n <script\n {...attrs}\n dangerouslySetInnerHTML={{ __html: children }}\n suppressHydrationWarning\n />\n )\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // the useEffect intentionally skips them.\n if (dataScript && typeof children === 'string') {\n return (\n <script\n {...attrs}\n suppressHydrationWarning\n dangerouslySetInnerHTML={{ __html: children }}\n />\n )\n }\n\n // During hydration (before useEffect has fired), render the script element\n // to match the server-rendered HTML and avoid structural hydration mismatches.\n // After hydration, return null — the useEffect handles imperative injection.\n if (!hydrated) {\n if (attrs?.src) {\n return <script {...attrs} suppressHydrationWarning />\n }\n if (typeof children === 'string') {\n return (\n <script\n {...attrs}\n dangerouslySetInnerHTML={{ __html: children }}\n suppressHydrationWarning\n />\n )\n }\n }\n\n return null\n}\n"],"names":["jsx","useRouter","useHydrated","React","isServer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqE;AACnE,UAAQ,KAAA;AAAA,IACN,KAAK;AACH,4CACG,SAAA,EAAO,GAAG,OAAO,0BAAwB,MACvC,UACH;AAAA,IAEJ,KAAK;AACH,aAAOA,2BAAAA,IAAC,QAAA,EAAM,GAAG,OAAO,0BAAwB,MAAC;AAAA,IACnD,KAAK;AACH,4CAAQ,QAAA,EAAM,GAAG,OAAO,OAAc,0BAAwB,MAAC;AAAA,IACjE,KAAK;AACH,aACEA,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ,yBAAyB,EAAE,QAAQ,SAAA;AAAA,UACnC;AAAA,QAAA;AAAA,MAAA;AAAA,IAGN,KAAK;AACH,aAAOA,2BAAAA,IAAC,QAAA,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B;AAAA,QAAA;AAAA,MAAA;AAAA,IAG9B;AAEA,WAAO;AAAA,EACT;AAMA,MAAI,cAAc,OAAO,aAAa,UAAU;AAC9C,WACEA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAG;AAAA,QACJ,0BAAwB;AAAA,QACxB,yBAAyB,EAAE,QAAQ,SAAA;AAAA,MAAS;AAAA,IAAA;AAAA,EAGlD;AAKA,MAAI,CAAC,UAAU;AACb,QAAI,OAAO,KAAK;AACd,aAAOA,2BAAAA,IAAC,UAAA,EAAQ,GAAG,OAAO,0BAAwB,MAAC;AAAA,IACrD;AACA,QAAI,OAAO,aAAa,UAAU;AAChC,aACEA,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAG;AAAA,UACJ,yBAAyB,EAAE,QAAQ,SAAA;AAAA,UACnC,0BAAwB;AAAA,QAAA;AAAA,MAAA;AAAA,IAG9B;AAAA,EACF;AAEA,SAAO;AACT;;"}
@@ -0,0 +1,5 @@
1
+ import { RouterManagedTag } from '@tanstack/router-core';
2
+ import * as React from 'react';
3
+ export declare function Asset({ tag, attrs, children, nonce, }: RouterManagedTag & {
4
+ nonce?: string;
5
+ }): React.ReactElement | null;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ function _interopNamespaceDefault(e) {
6
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
7
+ if (e) {
8
+ for (const k in e) {
9
+ if (k !== "default") {
10
+ const d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: () => e[k]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
+ }
21
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
22
+ function CatchBoundary(props) {
23
+ const errorComponent = props.errorComponent ?? ErrorComponent;
24
+ return /* @__PURE__ */ jsxRuntime.jsx(
25
+ CatchBoundaryImpl,
26
+ {
27
+ getResetKey: props.getResetKey,
28
+ onCatch: props.onCatch,
29
+ children: ({ error, reset }) => {
30
+ if (error) {
31
+ return React__namespace.createElement(errorComponent, {
32
+ error,
33
+ reset
34
+ });
35
+ }
36
+ return props.children;
37
+ }
38
+ }
39
+ );
40
+ }
41
+ class CatchBoundaryImpl extends React__namespace.Component {
42
+ constructor() {
43
+ super(...arguments);
44
+ this.state = { error: null };
45
+ }
46
+ static getDerivedStateFromProps(props) {
47
+ return { resetKey: props.getResetKey() };
48
+ }
49
+ static getDerivedStateFromError(error) {
50
+ return { error };
51
+ }
52
+ reset() {
53
+ this.setState({ error: null });
54
+ }
55
+ componentDidUpdate(prevProps, prevState) {
56
+ if (prevState.error && prevState.resetKey !== this.state.resetKey) {
57
+ this.reset();
58
+ }
59
+ }
60
+ componentDidCatch(error, errorInfo) {
61
+ if (this.props.onCatch) {
62
+ this.props.onCatch(error, errorInfo);
63
+ }
64
+ }
65
+ render() {
66
+ return this.props.children({
67
+ error: this.state.resetKey !== this.props.getResetKey() ? null : this.state.error,
68
+ reset: () => {
69
+ this.reset();
70
+ }
71
+ });
72
+ }
73
+ }
74
+ function ErrorComponent({ error }) {
75
+ const [show, setShow] = React__namespace.useState(process.env.NODE_ENV !== "production");
76
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [
77
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [
78
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }),
79
+ /* @__PURE__ */ jsxRuntime.jsx(
80
+ "button",
81
+ {
82
+ style: {
83
+ appearance: "none",
84
+ fontSize: ".6em",
85
+ border: "1px solid currentColor",
86
+ padding: ".1rem .2rem",
87
+ fontWeight: "bold",
88
+ borderRadius: ".25rem"
89
+ },
90
+ onClick: () => setShow((d) => !d),
91
+ children: show ? "Hide Error" : "Show Error"
92
+ }
93
+ )
94
+ ] }),
95
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: ".25rem" } }),
96
+ show ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
97
+ "pre",
98
+ {
99
+ style: {
100
+ fontSize: ".7em",
101
+ border: "1px solid red",
102
+ borderRadius: ".25rem",
103
+ padding: ".3rem",
104
+ color: "red",
105
+ overflow: "auto"
106
+ },
107
+ children: error.message ? /* @__PURE__ */ jsxRuntime.jsx("code", { children: error.message }) : null
108
+ }
109
+ ) }) : null
110
+ ] });
111
+ }
112
+ exports.CatchBoundary = CatchBoundary;
113
+ exports.ErrorComponent = ErrorComponent;
114
+ //# sourceMappingURL=CatchBoundary.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CatchBoundary.cjs","sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { ErrorRouteComponent } from './route'\nimport type { ErrorInfo } from 'react'\n\nexport function CatchBoundary(props: {\n getResetKey: () => number | string\n children: React.ReactNode\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n}) {\n const errorComponent = props.errorComponent ?? ErrorComponent\n\n return (\n <CatchBoundaryImpl\n getResetKey={props.getResetKey}\n onCatch={props.onCatch}\n children={({ error, reset }) => {\n if (error) {\n return React.createElement(errorComponent, {\n error,\n reset,\n })\n }\n\n return props.children\n }}\n />\n )\n}\n\nclass CatchBoundaryImpl extends React.Component<{\n getResetKey: () => number | string\n children: (props: {\n error: Error | null\n reset: () => void\n }) => React.ReactNode\n onCatch?: (error: Error, errorInfo: ErrorInfo) => void\n}> {\n state = { error: null } as { error: Error | null; resetKey: string }\n static getDerivedStateFromProps(props: any) {\n return { resetKey: props.getResetKey() }\n }\n static getDerivedStateFromError(error: Error) {\n return { error }\n }\n reset() {\n this.setState({ error: null })\n }\n componentDidUpdate(\n prevProps: Readonly<{\n getResetKey: () => string\n children: (props: { error: any; reset: () => void }) => any\n onCatch?: ((error: any, info: any) => void) | undefined\n }>,\n prevState: any,\n ): void {\n if (prevState.error && prevState.resetKey !== this.state.resetKey) {\n this.reset()\n }\n }\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n if (this.props.onCatch) {\n this.props.onCatch(error, errorInfo)\n }\n }\n render() {\n // If the resetKey has changed, don't render the error\n return this.props.children({\n error:\n this.state.resetKey !== this.props.getResetKey()\n ? null\n : this.state.error,\n reset: () => {\n this.reset()\n },\n })\n }\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = React.useState(process.env.NODE_ENV !== 'production')\n\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '.5rem' }}>\n <strong style={{ fontSize: '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n fontSize: '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show ? (\n <div>\n <pre\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"names":["jsx","React","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,cAAc,OAK3B;AACD,QAAM,iBAAiB,MAAM,kBAAkB;AAE/C,SACEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAa,MAAM;AAAA,MACnB,SAAS,MAAM;AAAA,MACf,UAAU,CAAC,EAAE,OAAO,YAAY;AA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D,UAAA;AAAA,MAAAF,+BAAC,YAAO,OAAO,EAAE,UAAU,OAAA,GAAU,UAAA,yBAAqB;AAAA,MAC1DA,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAO;AAAA,YACL,YAAY;AAAA,YACZ,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,YAAY;AAAA,YACZ,cAAc;AAAA,UAAA;AAAA,UAEhB,SAAS,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,UAE/B,iBAAO,eAAe;AAAA,QAAA;AAAA,MAAA;AAAA,IACzB,GACF;AAAA,mCACC,OAAA,EAAI,OAAO,EAAE,QAAQ,YAAY;AAAA,IACjC,sCACE,OAAA,EACC,UAAAA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,cAAc;AAAA,UACd,SAAS;AAAA,UACT,OAAO;AAAA,UACP,UAAU;AAAA,QAAA;AAAA,QAGX,gBAAM,UAAUA,+BAAC,QAAA,EAAM,UAAA,MAAM,SAAQ,IAAU;AAAA,MAAA;AAAA,IAAA,GAEpD,IACE;AAAA,EAAA,GACN;AAEJ;;;"}
@@ -0,0 +1,12 @@
1
+ import { ErrorRouteComponent } from './route.cjs';
2
+ import { ErrorInfo } from 'react';
3
+ import * as React from 'react';
4
+ export declare function CatchBoundary(props: {
5
+ getResetKey: () => number | string;
6
+ children: React.ReactNode;
7
+ errorComponent?: ErrorRouteComponent;
8
+ onCatch?: (error: Error, errorInfo: ErrorInfo) => void;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ErrorComponent({ error }: {
11
+ error: any;
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ function ClientOnly({ children, fallback = null }) {
6
+ return useHydrated() ? /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children }) : /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: fallback });
7
+ }
8
+ function useHydrated() {
9
+ return React.useSyncExternalStore(
10
+ subscribe,
11
+ () => true,
12
+ () => false
13
+ );
14
+ }
15
+ function subscribe() {
16
+ return () => {
17
+ };
18
+ }
19
+ exports.ClientOnly = ClientOnly;
20
+ exports.useHydrated = useHydrated;
21
+ //# sourceMappingURL=ClientOnly.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientOnly.cjs","sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: React.ReactNode\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: React.ReactNode\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly({ children, fallback = null }: ClientOnlyProps) {\n return useHydrated() ? (\n <React.Fragment>{children}</React.Fragment>\n ) : (\n <React.Fragment>{fallback}</React.Fragment>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * let hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nexport function useHydrated(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n )\n}\n\nfunction subscribe() {\n return () => {}\n}\n"],"names":["jsx"],"mappings":";;;;AA8BO,SAAS,WAAW,EAAE,UAAU,WAAW,QAAyB;AACzE,SAAO,YAAA,IACLA,2BAAAA,IAAC,MAAM,UAAN,EAAgB,SAAA,CAAS,IAE1BA,2BAAAA,IAAC,MAAM,UAAN,EAAgB,UAAA,SAAA,CAAS;AAE9B;AAqBO,SAAS,cAAuB;AACrC,SAAO,MAAM;AAAA,IACX;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EAAA;AAEV;AAEA,SAAS,YAAY;AACnB,SAAO,MAAM;AAAA,EAAC;AAChB;;;"}
@@ -0,0 +1,49 @@
1
+ import { default as React } from 'react';
2
+ export interface ClientOnlyProps {
3
+ /**
4
+ * The children to render when the JS is loaded.
5
+ */
6
+ children: React.ReactNode;
7
+ /**
8
+ * The fallback component to render if the JS is not yet loaded.
9
+ */
10
+ fallback?: React.ReactNode;
11
+ }
12
+ /**
13
+ * Render the children only after the JS has loaded client-side. Use an optional
14
+ * fallback component if the JS is not yet loaded.
15
+ *
16
+ * @example
17
+ * Render a Chart component if JS loads, renders a simple FakeChart
18
+ * component server-side or if there is no JS. The FakeChart can have only the
19
+ * UI without the behavior or be a loading spinner or skeleton.
20
+ *
21
+ * ```tsx
22
+ * return (
23
+ * <ClientOnly fallback={<FakeChart />}>
24
+ * <Chart />
25
+ * </ClientOnly>
26
+ * )
27
+ * ```
28
+ */
29
+ export declare function ClientOnly({ children, fallback }: ClientOnlyProps): import("react/jsx-runtime").JSX.Element;
30
+ /**
31
+ * Return a boolean indicating if the JS has been hydrated already.
32
+ * When doing Server-Side Rendering, the result will always be false.
33
+ * When doing Client-Side Rendering, the result will always be false on the
34
+ * first render and true from then on. Even if a new component renders it will
35
+ * always start with true.
36
+ *
37
+ * @example
38
+ * ```tsx
39
+ * // Disable a button that needs JS to work.
40
+ * let hydrated = useHydrated()
41
+ * return (
42
+ * <button type="button" disabled={!hydrated} onClick={doSomethingCustom}>
43
+ * Click me
44
+ * </button>
45
+ * )
46
+ * ```
47
+ * @returns True if the JS has been hydrated already, false otherwise.
48
+ */
49
+ export declare function useHydrated(): boolean;
@@ -0,0 +1,15 @@
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 Asset = require("./Asset.cjs");
6
+ const useRouter = require("./useRouter.cjs");
7
+ const headContentUtils = require("./headContentUtils.cjs");
8
+ function HeadContent() {
9
+ const tags = headContentUtils.useTags();
10
+ const router = useRouter.useRouter();
11
+ const nonce = router.options.ssr?.nonce;
12
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: tags.map((tag) => /* @__PURE__ */ React.createElement(Asset.Asset, { ...tag, key: `tsr-meta-${JSON.stringify(tag)}`, nonce })) });
13
+ }
14
+ exports.HeadContent = HeadContent;
15
+ //# sourceMappingURL=HeadContent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeadContent.cjs","sources":["../../src/HeadContent.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\n\n/**\n * Render route-managed head tags (title, meta, links, styles, head scripts).\n * Place inside the document head of your app shell.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management\n */\nexport function HeadContent() {\n const tags = useTags()\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n return (\n <>\n {tags.map((tag) => (\n <Asset {...tag} key={`tsr-meta-${JSON.stringify(tag)}`} nonce={nonce} />\n ))}\n </>\n )\n}\n"],"names":["useTags","useRouter","createElement","Asset"],"mappings":";;;;;;;AAUO,SAAS,cAAc;AAC5B,QAAM,OAAOA,iBAAAA,QAAA;AACb,QAAM,SAASC,UAAAA,UAAA;AACf,QAAM,QAAQ,OAAO,QAAQ,KAAK;AAClC,+DAEK,UAAA,KAAK,IAAI,CAAC,QACTC,oCAACC,MAAAA,SAAO,GAAG,KAAK,KAAK,YAAY,KAAK,UAAU,GAAG,CAAC,IAAI,OAAc,CACvE,GACH;AAEJ;;"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Render route-managed head tags (title, meta, links, styles, head scripts).
3
+ * Place inside the document head of your app shell.
4
+ * @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management
5
+ */
6
+ export declare function HeadContent(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
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 Asset = require("./Asset.cjs");
6
+ const useRouter = require("./useRouter.cjs");
7
+ const ClientOnly = require("./ClientOnly.cjs");
8
+ const headContentUtils = require("./headContentUtils.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 DEV_STYLES_ATTR = "data-tanstack-router-dev-styles";
27
+ function HeadContent() {
28
+ const tags = headContentUtils.useTags();
29
+ const router = useRouter.useRouter();
30
+ const nonce = router.options.ssr?.nonce;
31
+ const hydrated = ClientOnly.useHydrated();
32
+ React__namespace.useEffect(() => {
33
+ if (hydrated) {
34
+ document.querySelectorAll(`link[${DEV_STYLES_ATTR}]`).forEach((el) => el.remove());
35
+ }
36
+ }, [hydrated]);
37
+ const filteredTags = hydrated ? tags.filter((tag) => !tag.attrs?.[DEV_STYLES_ATTR]) : tags;
38
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: filteredTags.map((tag) => /* @__PURE__ */ React.createElement(Asset.Asset, { ...tag, key: `tsr-meta-${JSON.stringify(tag)}`, nonce })) });
39
+ }
40
+ exports.HeadContent = HeadContent;
41
+ //# sourceMappingURL=HeadContent.dev.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeadContent.dev.cjs","sources":["../../src/HeadContent.dev.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useHydrated } from './ClientOnly'\nimport { useTags } from './headContentUtils'\n\nconst DEV_STYLES_ATTR = 'data-tanstack-router-dev-styles'\n\n/**\n * Render route-managed head tags (title, meta, links, styles, head scripts).\n * Place inside the document head of your app shell.\n *\n * Development version: filters out dev styles link after hydration and\n * includes a fallback cleanup effect for hydration mismatch cases.\n *\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management\n */\nexport function HeadContent() {\n const tags = useTags()\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n const hydrated = useHydrated()\n\n // Fallback cleanup for hydration mismatch cases\n // Runs when hydration completes to remove any orphaned dev styles links from DOM\n React.useEffect(() => {\n if (hydrated) {\n document\n .querySelectorAll(`link[${DEV_STYLES_ATTR}]`)\n .forEach((el) => el.remove())\n }\n }, [hydrated])\n\n // Filter out dev styles after hydration\n const filteredTags = hydrated\n ? tags.filter((tag) => !tag.attrs?.[DEV_STYLES_ATTR])\n : tags\n\n return (\n <>\n {filteredTags.map((tag) => (\n <Asset {...tag} key={`tsr-meta-${JSON.stringify(tag)}`} nonce={nonce} />\n ))}\n </>\n )\n}\n"],"names":["useTags","useRouter","useHydrated","React","createElement","Asset"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,kBAAkB;AAWjB,SAAS,cAAc;AAC5B,QAAM,OAAOA,iBAAAA,QAAA;AACb,QAAM,SAASC,UAAAA,UAAA;AACf,QAAM,QAAQ,OAAO,QAAQ,KAAK;AAClC,QAAM,WAAWC,WAAAA,YAAA;AAIjBC,mBAAM,UAAU,MAAM;AACpB,QAAI,UAAU;AACZ,eACG,iBAAiB,QAAQ,eAAe,GAAG,EAC3C,QAAQ,CAAC,OAAO,GAAG,OAAA,CAAQ;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAGb,QAAM,eAAe,WACjB,KAAK,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,eAAe,CAAC,IAClD;AAEJ,+DAEK,UAAA,aAAa,IAAI,CAAC,QACjBC,oCAACC,MAAAA,SAAO,GAAG,KAAK,KAAK,YAAY,KAAK,UAAU,GAAG,CAAC,IAAI,OAAc,CACvE,GACH;AAEJ;;"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Render route-managed head tags (title, meta, links, styles, head scripts).
3
+ * Place inside the document head of your app shell.
4
+ *
5
+ * Development version: filters out dev styles link after hydration and
6
+ * includes a fallback cleanup effect for hydration mismatch cases.
7
+ *
8
+ * @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management
9
+ */
10
+ export declare function HeadContent(): import("react/jsx-runtime").JSX.Element;