one 1.1.309 → 1.1.311

Sign up to get free protection for your applications and to get access to all the features.
Files changed (401) hide show
  1. package/dist/cjs/Root.cjs +213 -0
  2. package/dist/cjs/Root.cjs.map +6 -0
  3. package/dist/cjs/Root.native.js +2 -2
  4. package/dist/cjs/Root.native.js.map +2 -2
  5. package/dist/cjs/{Route.js → Route.cjs} +34 -19
  6. package/dist/cjs/{cleanUrl.js → cleanUrl.cjs} +27 -18
  7. package/dist/cjs/cli/label-process.cjs +31 -0
  8. package/dist/cjs/cli/{main.js → main.cjs} +28 -16
  9. package/dist/cjs/cli/{prebuild.js → prebuild.cjs} +25 -15
  10. package/dist/cjs/cli/run.cjs +70 -0
  11. package/dist/cjs/cli/{runAndroid.js → runAndroid.cjs} +25 -15
  12. package/dist/cjs/cli/{runIos.js → runIos.cjs} +25 -15
  13. package/dist/cjs/cli.cjs +258 -0
  14. package/dist/cjs/clientLoaderResolver.cjs +35 -0
  15. package/dist/cjs/config.cjs +32 -0
  16. package/dist/cjs/constants.cjs +30 -0
  17. package/dist/cjs/{createApp.js → createApp.cjs} +33 -17
  18. package/dist/cjs/createApp.native.cjs +38 -0
  19. package/dist/cjs/createApp.native.cjs.map +6 -0
  20. package/dist/cjs/{createHandleRequest.js → createHandleRequest.cjs} +61 -49
  21. package/dist/cjs/createHandleRequest.cjs.map +6 -0
  22. package/dist/cjs/createHandleRequest.native.js +1 -0
  23. package/dist/cjs/createHandleRequest.native.js.map +2 -2
  24. package/dist/cjs/createRoute.cjs +42 -0
  25. package/dist/cjs/fallbackViews/{Sitemap.js → Sitemap.cjs} +35 -16
  26. package/dist/cjs/fallbackViews/{Unmatched.js → Unmatched.cjs} +32 -17
  27. package/dist/cjs/fork/NavigationContainer.cjs +105 -0
  28. package/dist/cjs/fork/NavigationContainer.native.cjs +103 -0
  29. package/dist/cjs/fork/NavigationContainer.native.cjs.map +6 -0
  30. package/dist/cjs/fork/createMemoryHistory.cjs +136 -0
  31. package/dist/cjs/fork/{extractPathFromURL.js → extractPathFromURL.cjs} +30 -21
  32. package/dist/cjs/fork/findFocusedRoute.cjs +30 -0
  33. package/dist/cjs/fork/{getPathFromState.js → getPathFromState.cjs} +120 -113
  34. package/dist/cjs/fork/getStateFromPath.cjs +366 -0
  35. package/dist/cjs/fork/useLinking.cjs +215 -0
  36. package/dist/cjs/fork/useLinking.native.cjs +126 -0
  37. package/dist/cjs/fork/useLinking.native.cjs.map +6 -0
  38. package/dist/cjs/fork/validatePathConfig.cjs +44 -0
  39. package/dist/cjs/{getLinkingConfig.js → getLinkingConfig.cjs} +21 -15
  40. package/dist/cjs/{getReactNavigationConfig.js → getReactNavigationConfig.cjs} +33 -32
  41. package/dist/cjs/getRoutes.cjs +276 -0
  42. package/dist/cjs/getURL.cjs +29 -0
  43. package/dist/cjs/getURL.native.cjs +48 -0
  44. package/dist/cjs/getURL.native.cjs.map +6 -0
  45. package/dist/cjs/head/Head.android.cjs +28 -0
  46. package/dist/cjs/head/Head.android.cjs.map +6 -0
  47. package/dist/cjs/head/Head.cjs +30 -0
  48. package/dist/cjs/head/Head.ios.cjs +210 -0
  49. package/dist/cjs/head/Head.ios.cjs.map +6 -0
  50. package/dist/cjs/head/HeadModule.cjs +27 -0
  51. package/dist/cjs/head/index.cjs +18 -0
  52. package/dist/cjs/head/types.cjs +16 -0
  53. package/dist/cjs/head/url.cjs +50 -0
  54. package/dist/cjs/{hooks.js → hooks.cjs} +52 -40
  55. package/dist/cjs/{imperative-api.js → imperative-api.cjs} +26 -19
  56. package/dist/cjs/import-mode/index.android.cjs +26 -0
  57. package/dist/cjs/import-mode/index.android.cjs.map +6 -0
  58. package/dist/cjs/import-mode/index.cjs +26 -0
  59. package/dist/cjs/import-mode/index.ios.cjs +26 -0
  60. package/dist/cjs/import-mode/index.ios.cjs.map +6 -0
  61. package/dist/cjs/import-mode/index.native.cjs +26 -0
  62. package/dist/cjs/import-mode/index.native.cjs.map +6 -0
  63. package/dist/cjs/import-mode/index.web.cjs +26 -0
  64. package/dist/cjs/{index.js → index.cjs} +50 -14
  65. package/dist/cjs/interfaces/router.cjs +27 -0
  66. package/dist/cjs/layouts/Drawer.cjs +31 -0
  67. package/dist/cjs/layouts/Stack.cjs +31 -0
  68. package/dist/cjs/layouts/Tabs.cjs +64 -0
  69. package/dist/cjs/layouts/withLayoutContext.cjs +91 -0
  70. package/dist/cjs/link/Link.cjs +120 -0
  71. package/dist/cjs/link/Redirect.cjs +39 -0
  72. package/dist/cjs/link/href.cjs +58 -0
  73. package/dist/cjs/link/linking.cjs +89 -0
  74. package/dist/cjs/link/path.cjs +69 -0
  75. package/dist/cjs/link/useLinkTo.cjs +54 -0
  76. package/dist/cjs/link/useLoadedNavigation.cjs +60 -0
  77. package/dist/cjs/{matchers.js → matchers.cjs} +16 -11
  78. package/dist/cjs/platform.cjs +26 -0
  79. package/dist/cjs/polyfills-mobile.cjs +33 -0
  80. package/dist/cjs/polyfills-server.cjs +25 -0
  81. package/dist/cjs/render.cjs +47 -0
  82. package/dist/cjs/render.native.cjs +28 -0
  83. package/dist/cjs/render.native.cjs.map +6 -0
  84. package/dist/cjs/router/RouterStore.cjs +16 -0
  85. package/dist/cjs/router/constants.cjs +26 -0
  86. package/dist/cjs/router/{getNormalizedStatePath.js → getNormalizedStatePath.cjs} +25 -23
  87. package/dist/cjs/router/lastAction.cjs +31 -0
  88. package/dist/cjs/router/{router.js → router.cjs} +104 -78
  89. package/dist/cjs/router/serverLocationContext.cjs +27 -0
  90. package/dist/cjs/router/{useInitializeOneRouter.js → useInitializeOneRouter.cjs} +26 -16
  91. package/dist/cjs/serve.cjs +185 -0
  92. package/dist/cjs/server/{createRoutesManifest.js → createRoutesManifest.cjs} +22 -16
  93. package/dist/cjs/server/{getServerManifest.js → getServerManifest.cjs} +58 -31
  94. package/dist/cjs/{server-render.js → server-render.cjs} +28 -17
  95. package/dist/cjs/sortRoutes.cjs +62 -0
  96. package/dist/cjs/typed-routes/generateRouteTypes.cjs +48 -0
  97. package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.js → getTypedRoutesDeclarationFile.cjs} +37 -40
  98. package/dist/cjs/types.cjs +16 -0
  99. package/dist/cjs/{useFocusEffect.js → useFocusEffect.cjs} +33 -24
  100. package/dist/cjs/useLoader.cjs +114 -0
  101. package/dist/cjs/useNavigation.cjs +68 -0
  102. package/dist/cjs/useScreens.cjs +233 -0
  103. package/dist/cjs/{useViteRoutes.js → useViteRoutes.cjs} +36 -24
  104. package/dist/cjs/utils/assertIsReady.cjs +28 -0
  105. package/dist/cjs/utils/dynamicImport.cjs +27 -0
  106. package/dist/cjs/utils/existsAsync.cjs +33 -0
  107. package/dist/cjs/utils/getPageExport.cjs +32 -0
  108. package/dist/cjs/utils/{globDir.js → globDir.cjs} +23 -15
  109. package/dist/cjs/utils/{hashString.js → hashString.cjs} +22 -14
  110. package/dist/cjs/utils/isResponse.cjs +28 -0
  111. package/dist/cjs/utils/isStatus.cjs +28 -0
  112. package/dist/cjs/utils/promiseWithResolvers.cjs +37 -0
  113. package/dist/cjs/utils/rand.cjs +26 -0
  114. package/dist/cjs/utils/redirect.cjs +34 -0
  115. package/dist/cjs/utils/removeSearch.cjs +28 -0
  116. package/dist/cjs/utils/removeUndefined.cjs +30 -0
  117. package/dist/cjs/utils/{url.js → url.cjs} +16 -11
  118. package/dist/cjs/utils/weakKey.cjs +30 -0
  119. package/dist/cjs/utils/weakMemo.cjs +34 -0
  120. package/dist/cjs/views/EmptyRoute.cjs +30 -0
  121. package/dist/cjs/views/{ErrorBoundary.js → ErrorBoundary.cjs} +30 -16
  122. package/dist/cjs/views/LoadProgressBar.cjs +90 -0
  123. package/dist/cjs/views/Navigator.cjs +149 -0
  124. package/dist/cjs/views/{PreloadLinks.js → PreloadLinks.cjs} +20 -13
  125. package/dist/cjs/views/PreloadLinks.native.cjs +28 -0
  126. package/dist/cjs/views/PreloadLinks.native.cjs.map +6 -0
  127. package/dist/cjs/views/{RootErrorBoundary.js → RootErrorBoundary.cjs} +28 -16
  128. package/dist/cjs/views/Screen.cjs +39 -0
  129. package/dist/cjs/views/ScrollRestoration.cjs +74 -0
  130. package/dist/cjs/views/Try.cjs +68 -0
  131. package/dist/cjs/vite/build.cjs +425 -0
  132. package/dist/cjs/vite/{clientTreeShakePlugin.js → clientTreeShakePlugin.cjs} +53 -35
  133. package/dist/cjs/vite/constants.cjs +28 -0
  134. package/dist/cjs/vite/{createFileSystemRouter.js → createFileSystemRouter.cjs} +117 -84
  135. package/dist/cjs/vite/{customNodeExternals.js → customNodeExternals.cjs} +32 -20
  136. package/dist/cjs/vite/ensureTsConfig.cjs +68 -0
  137. package/dist/cjs/vite/findDepsToOptimize.cjs +74 -0
  138. package/dist/cjs/vite/{fixDependenciesPlugin.js → fixDependenciesPlugin.cjs} +17 -12
  139. package/dist/cjs/vite/generateTypesForRoutes.cjs +45 -0
  140. package/dist/cjs/vite/{getManifest.js → getManifest.cjs} +18 -12
  141. package/dist/cjs/vite/{headers.js → headers.cjs} +19 -14
  142. package/dist/cjs/vite/headers.native.cjs +32 -0
  143. package/dist/cjs/vite/headers.native.cjs.map +6 -0
  144. package/dist/cjs/vite/{loadEnv.js → loadEnv.cjs} +27 -16
  145. package/dist/cjs/vite/makePluginWebOnly.cjs +31 -0
  146. package/dist/cjs/vite/one.cjs +256 -0
  147. package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.js → removeReactNativeWebAnimatedPlugin.cjs} +32 -25
  148. package/dist/cjs/vite/replaceLoader.cjs +37 -0
  149. package/dist/cjs/vite/resolveAPIRequest.cjs +90 -0
  150. package/dist/cjs/vite/server.cjs +13 -0
  151. package/dist/cjs/vite/types.cjs +16 -0
  152. package/dist/cjs/vite/{virtualEntryPlugin.js → virtualEntryPlugin.cjs} +28 -20
  153. package/dist/cjs/vite/{vitePluginSsrCss.js → vitePluginSsrCss.cjs} +56 -50
  154. package/dist/cjs/vite.cjs +40 -0
  155. package/dist/cjs/zero/getQueryKey.cjs +29 -0
  156. package/dist/cjs/zero/isZeroQuery.cjs +28 -0
  157. package/dist/cjs/zero/resolveQuery.cjs +41 -0
  158. package/dist/cjs/zero/{subscribeToQuery.js → subscribeToQuery.cjs} +16 -11
  159. package/dist/cjs/zero/types.cjs +16 -0
  160. package/dist/cjs/zero/useQuery.cjs +58 -0
  161. package/dist/cjs/zero/{useQueryZero.js → useQueryZero.cjs} +21 -15
  162. package/dist/cjs/zero.cjs +30 -0
  163. package/dist/esm/Root.js +2 -1
  164. package/dist/esm/Root.js.map +1 -1
  165. package/dist/esm/Root.mjs +2 -1
  166. package/dist/esm/Root.mjs.map +1 -1
  167. package/dist/esm/Root.native.js +2 -1
  168. package/dist/esm/Root.native.js.map +2 -2
  169. package/dist/esm/createHandleRequest.js +1 -0
  170. package/dist/esm/createHandleRequest.js.map +1 -1
  171. package/dist/esm/createHandleRequest.mjs +1 -0
  172. package/dist/esm/createHandleRequest.mjs.map +1 -1
  173. package/dist/esm/createHandleRequest.native.js +1 -0
  174. package/dist/esm/createHandleRequest.native.js.map +2 -2
  175. package/dist/esm/getURL.js +1 -1
  176. package/dist/esm/getURL.mjs +1 -1
  177. package/package.json +10 -10
  178. package/src/Root.tsx +2 -1
  179. package/src/createHandleRequest.ts +5 -0
  180. package/src/getURL.ts +1 -1
  181. package/types/Root.d.ts.map +1 -1
  182. package/types/createHandleRequest.d.ts.map +1 -1
  183. package/dist/cjs/Root.js +0 -182
  184. package/dist/cjs/Root.js.map +0 -6
  185. package/dist/cjs/cli/label-process.js +0 -25
  186. package/dist/cjs/cli/run.js +0 -52
  187. package/dist/cjs/cli.js +0 -209
  188. package/dist/cjs/clientLoaderResolver.js +0 -32
  189. package/dist/cjs/config.js +0 -27
  190. package/dist/cjs/constants.js +0 -23
  191. package/dist/cjs/createHandleRequest.js.map +0 -6
  192. package/dist/cjs/createRoute.js +0 -37
  193. package/dist/cjs/fork/NavigationContainer.js +0 -85
  194. package/dist/cjs/fork/createMemoryHistory.js +0 -100
  195. package/dist/cjs/fork/findFocusedRoute.js +0 -26
  196. package/dist/cjs/fork/getStateFromPath.js +0 -381
  197. package/dist/cjs/fork/useLinking.js +0 -182
  198. package/dist/cjs/fork/validatePathConfig.js +0 -46
  199. package/dist/cjs/getRoutes.js +0 -294
  200. package/dist/cjs/getURL.js +0 -24
  201. package/dist/cjs/head/Head.js +0 -23
  202. package/dist/cjs/head/HeadModule.js +0 -22
  203. package/dist/cjs/head/index.js +0 -15
  204. package/dist/cjs/head/types.js +0 -14
  205. package/dist/cjs/head/url.js +0 -52
  206. package/dist/cjs/import-mode/index.js +0 -21
  207. package/dist/cjs/import-mode/index.web.js +0 -21
  208. package/dist/cjs/interfaces/router.js +0 -23
  209. package/dist/cjs/layouts/Drawer.js +0 -24
  210. package/dist/cjs/layouts/Stack.js +0 -24
  211. package/dist/cjs/layouts/Tabs.js +0 -52
  212. package/dist/cjs/layouts/withLayoutContext.js +0 -77
  213. package/dist/cjs/link/Link.js +0 -98
  214. package/dist/cjs/link/Redirect.js +0 -31
  215. package/dist/cjs/link/href.js +0 -50
  216. package/dist/cjs/link/linking.js +0 -82
  217. package/dist/cjs/link/path.js +0 -65
  218. package/dist/cjs/link/useLinkTo.js +0 -42
  219. package/dist/cjs/link/useLoadedNavigation.js +0 -50
  220. package/dist/cjs/platform.js +0 -21
  221. package/dist/cjs/polyfills-mobile.js +0 -26
  222. package/dist/cjs/polyfills-server.js +0 -23
  223. package/dist/cjs/render.js +0 -44
  224. package/dist/cjs/router/RouterStore.js +0 -14
  225. package/dist/cjs/router/constants.js +0 -21
  226. package/dist/cjs/router/lastAction.js +0 -25
  227. package/dist/cjs/router/serverLocationContext.js +0 -22
  228. package/dist/cjs/serve.js +0 -175
  229. package/dist/cjs/sortRoutes.js +0 -64
  230. package/dist/cjs/typed-routes/generateRouteTypes.js +0 -33
  231. package/dist/cjs/types.js +0 -14
  232. package/dist/cjs/useLoader.js +0 -97
  233. package/dist/cjs/useNavigation.js +0 -60
  234. package/dist/cjs/useScreens.js +0 -176
  235. package/dist/cjs/utils/assertIsReady.js +0 -26
  236. package/dist/cjs/utils/dynamicImport.js +0 -24
  237. package/dist/cjs/utils/existsAsync.js +0 -28
  238. package/dist/cjs/utils/getPageExport.js +0 -27
  239. package/dist/cjs/utils/isResponse.js +0 -23
  240. package/dist/cjs/utils/isStatus.js +0 -23
  241. package/dist/cjs/utils/promiseWithResolvers.js +0 -26
  242. package/dist/cjs/utils/rand.js +0 -21
  243. package/dist/cjs/utils/redirect.js +0 -28
  244. package/dist/cjs/utils/removeSearch.js +0 -23
  245. package/dist/cjs/utils/removeUndefined.js +0 -26
  246. package/dist/cjs/utils/weakKey.js +0 -24
  247. package/dist/cjs/utils/weakMemo.js +0 -30
  248. package/dist/cjs/views/EmptyRoute.js +0 -25
  249. package/dist/cjs/views/LoadProgressBar.js +0 -83
  250. package/dist/cjs/views/Navigator.js +0 -101
  251. package/dist/cjs/views/Screen.js +0 -29
  252. package/dist/cjs/views/ScrollRestoration.js +0 -70
  253. package/dist/cjs/views/Try.js +0 -44
  254. package/dist/cjs/vite/build.js +0 -376
  255. package/dist/cjs/vite/constants.js +0 -22
  256. package/dist/cjs/vite/ensureTsConfig.js +0 -66
  257. package/dist/cjs/vite/findDepsToOptimize.js +0 -66
  258. package/dist/cjs/vite/generateTypesForRoutes.js +0 -36
  259. package/dist/cjs/vite/makePluginWebOnly.js +0 -27
  260. package/dist/cjs/vite/one.js +0 -255
  261. package/dist/cjs/vite/replaceLoader.js +0 -34
  262. package/dist/cjs/vite/resolveAPIRequest.js +0 -71
  263. package/dist/cjs/vite/server.js +0 -16
  264. package/dist/cjs/vite/types.js +0 -14
  265. package/dist/cjs/vite.js +0 -28
  266. package/dist/cjs/zero/getQueryKey.js +0 -24
  267. package/dist/cjs/zero/isZeroQuery.js +0 -23
  268. package/dist/cjs/zero/resolveQuery.js +0 -38
  269. package/dist/cjs/zero/types.js +0 -14
  270. package/dist/cjs/zero/useQuery.js +0 -47
  271. package/dist/cjs/zero.js +0 -23
  272. /package/dist/cjs/{Route.js.map → Route.cjs.map} +0 -0
  273. /package/dist/cjs/{cleanUrl.js.map → cleanUrl.cjs.map} +0 -0
  274. /package/dist/cjs/cli/{label-process.js.map → label-process.cjs.map} +0 -0
  275. /package/dist/cjs/cli/{main.js.map → main.cjs.map} +0 -0
  276. /package/dist/cjs/cli/{prebuild.js.map → prebuild.cjs.map} +0 -0
  277. /package/dist/cjs/cli/{run.js.map → run.cjs.map} +0 -0
  278. /package/dist/cjs/cli/{runAndroid.js.map → runAndroid.cjs.map} +0 -0
  279. /package/dist/cjs/cli/{runIos.js.map → runIos.cjs.map} +0 -0
  280. /package/dist/cjs/{cli.js.map → cli.cjs.map} +0 -0
  281. /package/dist/cjs/{clientLoaderResolver.js.map → clientLoaderResolver.cjs.map} +0 -0
  282. /package/dist/cjs/{config.js.map → config.cjs.map} +0 -0
  283. /package/dist/cjs/{constants.js.map → constants.cjs.map} +0 -0
  284. /package/dist/cjs/{createApp.js.map → createApp.cjs.map} +0 -0
  285. /package/dist/cjs/{createRoute.js.map → createRoute.cjs.map} +0 -0
  286. /package/dist/cjs/fallbackViews/{Sitemap.js.map → Sitemap.cjs.map} +0 -0
  287. /package/dist/cjs/fallbackViews/{Unmatched.js.map → Unmatched.cjs.map} +0 -0
  288. /package/dist/cjs/fork/{NavigationContainer.js.map → NavigationContainer.cjs.map} +0 -0
  289. /package/dist/cjs/fork/{createMemoryHistory.js.map → createMemoryHistory.cjs.map} +0 -0
  290. /package/dist/cjs/fork/{extractPathFromURL.js.map → extractPathFromURL.cjs.map} +0 -0
  291. /package/dist/cjs/fork/{findFocusedRoute.js.map → findFocusedRoute.cjs.map} +0 -0
  292. /package/dist/cjs/fork/{getPathFromState.js.map → getPathFromState.cjs.map} +0 -0
  293. /package/dist/cjs/fork/{getStateFromPath.js.map → getStateFromPath.cjs.map} +0 -0
  294. /package/dist/cjs/fork/{useLinking.js.map → useLinking.cjs.map} +0 -0
  295. /package/dist/cjs/fork/{validatePathConfig.js.map → validatePathConfig.cjs.map} +0 -0
  296. /package/dist/cjs/{getLinkingConfig.js.map → getLinkingConfig.cjs.map} +0 -0
  297. /package/dist/cjs/{getReactNavigationConfig.js.map → getReactNavigationConfig.cjs.map} +0 -0
  298. /package/dist/cjs/{getRoutes.js.map → getRoutes.cjs.map} +0 -0
  299. /package/dist/cjs/{getURL.js.map → getURL.cjs.map} +0 -0
  300. /package/dist/cjs/head/{Head.js.map → Head.cjs.map} +0 -0
  301. /package/dist/cjs/head/{HeadModule.js.map → HeadModule.cjs.map} +0 -0
  302. /package/dist/cjs/head/{index.js.map → index.cjs.map} +0 -0
  303. /package/dist/cjs/head/{types.js.map → types.cjs.map} +0 -0
  304. /package/dist/cjs/head/{url.js.map → url.cjs.map} +0 -0
  305. /package/dist/cjs/{hooks.js.map → hooks.cjs.map} +0 -0
  306. /package/dist/cjs/{imperative-api.js.map → imperative-api.cjs.map} +0 -0
  307. /package/dist/cjs/import-mode/{index.js.map → index.cjs.map} +0 -0
  308. /package/dist/cjs/import-mode/{index.web.js.map → index.web.cjs.map} +0 -0
  309. /package/dist/cjs/{index.js.map → index.cjs.map} +0 -0
  310. /package/dist/cjs/interfaces/{router.js.map → router.cjs.map} +0 -0
  311. /package/dist/cjs/layouts/{Drawer.js.map → Drawer.cjs.map} +0 -0
  312. /package/dist/cjs/layouts/{Stack.js.map → Stack.cjs.map} +0 -0
  313. /package/dist/cjs/layouts/{Tabs.js.map → Tabs.cjs.map} +0 -0
  314. /package/dist/cjs/layouts/{withLayoutContext.js.map → withLayoutContext.cjs.map} +0 -0
  315. /package/dist/cjs/link/{Link.js.map → Link.cjs.map} +0 -0
  316. /package/dist/cjs/link/{Redirect.js.map → Redirect.cjs.map} +0 -0
  317. /package/dist/cjs/link/{href.js.map → href.cjs.map} +0 -0
  318. /package/dist/cjs/link/{linking.js.map → linking.cjs.map} +0 -0
  319. /package/dist/cjs/link/{path.js.map → path.cjs.map} +0 -0
  320. /package/dist/cjs/link/{useLinkTo.js.map → useLinkTo.cjs.map} +0 -0
  321. /package/dist/cjs/link/{useLoadedNavigation.js.map → useLoadedNavigation.cjs.map} +0 -0
  322. /package/dist/cjs/{matchers.js.map → matchers.cjs.map} +0 -0
  323. /package/dist/cjs/{platform.js.map → platform.cjs.map} +0 -0
  324. /package/dist/cjs/{polyfills-mobile.js.map → polyfills-mobile.cjs.map} +0 -0
  325. /package/dist/cjs/{polyfills-server.js.map → polyfills-server.cjs.map} +0 -0
  326. /package/dist/cjs/{render.js.map → render.cjs.map} +0 -0
  327. /package/dist/cjs/router/{RouterStore.js.map → RouterStore.cjs.map} +0 -0
  328. /package/dist/cjs/router/{constants.js.map → constants.cjs.map} +0 -0
  329. /package/dist/cjs/router/{getNormalizedStatePath.js.map → getNormalizedStatePath.cjs.map} +0 -0
  330. /package/dist/cjs/router/{lastAction.js.map → lastAction.cjs.map} +0 -0
  331. /package/dist/cjs/router/{router.js.map → router.cjs.map} +0 -0
  332. /package/dist/cjs/router/{serverLocationContext.js.map → serverLocationContext.cjs.map} +0 -0
  333. /package/dist/cjs/router/{useInitializeOneRouter.js.map → useInitializeOneRouter.cjs.map} +0 -0
  334. /package/dist/cjs/{serve.js.map → serve.cjs.map} +0 -0
  335. /package/dist/cjs/server/{createRoutesManifest.js.map → createRoutesManifest.cjs.map} +0 -0
  336. /package/dist/cjs/server/{getServerManifest.js.map → getServerManifest.cjs.map} +0 -0
  337. /package/dist/cjs/{server-render.js.map → server-render.cjs.map} +0 -0
  338. /package/dist/cjs/{sortRoutes.js.map → sortRoutes.cjs.map} +0 -0
  339. /package/dist/cjs/typed-routes/{generateRouteTypes.js.map → generateRouteTypes.cjs.map} +0 -0
  340. /package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.js.map → getTypedRoutesDeclarationFile.cjs.map} +0 -0
  341. /package/dist/cjs/{types.js.map → types.cjs.map} +0 -0
  342. /package/dist/cjs/{useFocusEffect.js.map → useFocusEffect.cjs.map} +0 -0
  343. /package/dist/cjs/{useLoader.js.map → useLoader.cjs.map} +0 -0
  344. /package/dist/cjs/{useNavigation.js.map → useNavigation.cjs.map} +0 -0
  345. /package/dist/cjs/{useScreens.js.map → useScreens.cjs.map} +0 -0
  346. /package/dist/cjs/{useViteRoutes.js.map → useViteRoutes.cjs.map} +0 -0
  347. /package/dist/cjs/utils/{assertIsReady.js.map → assertIsReady.cjs.map} +0 -0
  348. /package/dist/cjs/utils/{dynamicImport.js.map → dynamicImport.cjs.map} +0 -0
  349. /package/dist/cjs/utils/{existsAsync.js.map → existsAsync.cjs.map} +0 -0
  350. /package/dist/cjs/utils/{getPageExport.js.map → getPageExport.cjs.map} +0 -0
  351. /package/dist/cjs/utils/{globDir.js.map → globDir.cjs.map} +0 -0
  352. /package/dist/cjs/utils/{hashString.js.map → hashString.cjs.map} +0 -0
  353. /package/dist/cjs/utils/{isResponse.js.map → isResponse.cjs.map} +0 -0
  354. /package/dist/cjs/utils/{isStatus.js.map → isStatus.cjs.map} +0 -0
  355. /package/dist/cjs/utils/{promiseWithResolvers.js.map → promiseWithResolvers.cjs.map} +0 -0
  356. /package/dist/cjs/utils/{rand.js.map → rand.cjs.map} +0 -0
  357. /package/dist/cjs/utils/{redirect.js.map → redirect.cjs.map} +0 -0
  358. /package/dist/cjs/utils/{removeSearch.js.map → removeSearch.cjs.map} +0 -0
  359. /package/dist/cjs/utils/{removeUndefined.js.map → removeUndefined.cjs.map} +0 -0
  360. /package/dist/cjs/utils/{url.js.map → url.cjs.map} +0 -0
  361. /package/dist/cjs/utils/{weakKey.js.map → weakKey.cjs.map} +0 -0
  362. /package/dist/cjs/utils/{weakMemo.js.map → weakMemo.cjs.map} +0 -0
  363. /package/dist/cjs/views/{EmptyRoute.js.map → EmptyRoute.cjs.map} +0 -0
  364. /package/dist/cjs/views/{ErrorBoundary.js.map → ErrorBoundary.cjs.map} +0 -0
  365. /package/dist/cjs/views/{LoadProgressBar.js.map → LoadProgressBar.cjs.map} +0 -0
  366. /package/dist/cjs/views/{Navigator.js.map → Navigator.cjs.map} +0 -0
  367. /package/dist/cjs/views/{PreloadLinks.js.map → PreloadLinks.cjs.map} +0 -0
  368. /package/dist/cjs/views/{RootErrorBoundary.js.map → RootErrorBoundary.cjs.map} +0 -0
  369. /package/dist/cjs/views/{Screen.js.map → Screen.cjs.map} +0 -0
  370. /package/dist/cjs/views/{ScrollRestoration.js.map → ScrollRestoration.cjs.map} +0 -0
  371. /package/dist/cjs/views/{Try.js.map → Try.cjs.map} +0 -0
  372. /package/dist/cjs/vite/{build.js.map → build.cjs.map} +0 -0
  373. /package/dist/cjs/vite/{clientTreeShakePlugin.js.map → clientTreeShakePlugin.cjs.map} +0 -0
  374. /package/dist/cjs/vite/{constants.js.map → constants.cjs.map} +0 -0
  375. /package/dist/cjs/vite/{createFileSystemRouter.js.map → createFileSystemRouter.cjs.map} +0 -0
  376. /package/dist/cjs/vite/{customNodeExternals.js.map → customNodeExternals.cjs.map} +0 -0
  377. /package/dist/cjs/vite/{ensureTsConfig.js.map → ensureTsConfig.cjs.map} +0 -0
  378. /package/dist/cjs/vite/{findDepsToOptimize.js.map → findDepsToOptimize.cjs.map} +0 -0
  379. /package/dist/cjs/vite/{fixDependenciesPlugin.js.map → fixDependenciesPlugin.cjs.map} +0 -0
  380. /package/dist/cjs/vite/{generateTypesForRoutes.js.map → generateTypesForRoutes.cjs.map} +0 -0
  381. /package/dist/cjs/vite/{getManifest.js.map → getManifest.cjs.map} +0 -0
  382. /package/dist/cjs/vite/{headers.js.map → headers.cjs.map} +0 -0
  383. /package/dist/cjs/vite/{loadEnv.js.map → loadEnv.cjs.map} +0 -0
  384. /package/dist/cjs/vite/{makePluginWebOnly.js.map → makePluginWebOnly.cjs.map} +0 -0
  385. /package/dist/cjs/vite/{one.js.map → one.cjs.map} +0 -0
  386. /package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.js.map → removeReactNativeWebAnimatedPlugin.cjs.map} +0 -0
  387. /package/dist/cjs/vite/{replaceLoader.js.map → replaceLoader.cjs.map} +0 -0
  388. /package/dist/cjs/vite/{resolveAPIRequest.js.map → resolveAPIRequest.cjs.map} +0 -0
  389. /package/dist/cjs/vite/{server.js.map → server.cjs.map} +0 -0
  390. /package/dist/cjs/vite/{types.js.map → types.cjs.map} +0 -0
  391. /package/dist/cjs/vite/{virtualEntryPlugin.js.map → virtualEntryPlugin.cjs.map} +0 -0
  392. /package/dist/cjs/vite/{vitePluginSsrCss.js.map → vitePluginSsrCss.cjs.map} +0 -0
  393. /package/dist/cjs/{vite.js.map → vite.cjs.map} +0 -0
  394. /package/dist/cjs/zero/{getQueryKey.js.map → getQueryKey.cjs.map} +0 -0
  395. /package/dist/cjs/zero/{isZeroQuery.js.map → isZeroQuery.cjs.map} +0 -0
  396. /package/dist/cjs/zero/{resolveQuery.js.map → resolveQuery.cjs.map} +0 -0
  397. /package/dist/cjs/zero/{subscribeToQuery.js.map → subscribeToQuery.cjs.map} +0 -0
  398. /package/dist/cjs/zero/{types.js.map → types.cjs.map} +0 -0
  399. /package/dist/cjs/zero/{useQuery.js.map → useQuery.cjs.map} +0 -0
  400. /package/dist/cjs/zero/{useQueryZero.js.map → useQueryZero.cjs.map} +0 -0
  401. /package/dist/cjs/{zero.js.map → zero.cjs.map} +0 -0
@@ -1,85 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var NavigationContainer_exports = {};
24
- __export(NavigationContainer_exports, {
25
- default: () => NavigationContainer_default
26
- });
27
- module.exports = __toCommonJS(NavigationContainer_exports);
28
- var import_core = require("@react-navigation/core"), import_native = require("@react-navigation/native"), React = __toESM(require("react"), 1), import_useLinking = __toESM(require("./useLinking"), 1), import_jsx_runtime = require("react/jsx-runtime");
29
- global.REACT_NAVIGATION_DEVTOOLS = /* @__PURE__ */ new WeakMap();
30
- function NavigationContainerInner({
31
- theme = import_native.DefaultTheme,
32
- linking,
33
- fallback = null,
34
- documentTitle,
35
- onReady,
36
- ...rest
37
- }, ref) {
38
- const isLinkingEnabled = linking ? linking.enabled !== !1 : !1;
39
- linking?.config && (0, import_core.validatePathConfig)(linking.config);
40
- const refContainer = React.useRef(null), { getInitialState } = (0, import_useLinking.default)(refContainer, {
41
- independent: rest.independent,
42
- enabled: isLinkingEnabled,
43
- prefixes: [],
44
- ...linking
45
- });
46
- if (React.useEffect(() => {
47
- refContainer.current && REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {
48
- get linking() {
49
- return {
50
- ...linking,
51
- enabled: isLinkingEnabled,
52
- prefixes: linking?.prefixes ?? [],
53
- getStateFromPath: linking?.getStateFromPath ?? import_core.getStateFromPath,
54
- getPathFromState: linking?.getPathFromState ?? import_core.getPathFromState,
55
- getActionFromState: linking?.getActionFromState ?? import_core.getActionFromState
56
- };
57
- }
58
- });
59
- }), cache.val === 0 && (cache.promise = new Promise((res) => {
60
- getInitialState().then((val) => {
61
- cache.val = val, cache.done = !0, res();
62
- });
63
- })), !cache.done)
64
- throw cache.promise;
65
- const initialState = cache.val;
66
- React.useImperativeHandle(ref, () => refContainer.current);
67
- const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);
68
- return React.useEffect(() => {
69
- onReady?.();
70
- }, [onReady]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_native.LinkingContext.Provider, { value: linkingContext, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_native.ThemeProvider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
- import_core.BaseNavigationContainer,
72
- {
73
- ...rest,
74
- initialState: rest.initialState == null ? initialState : rest.initialState,
75
- ref: refContainer
76
- }
77
- ) }) });
78
- }
79
- const cache = {
80
- done: !1,
81
- promise: null,
82
- val: 0
83
- }, NavigationContainer = React.forwardRef(NavigationContainerInner);
84
- var NavigationContainer_default = NavigationContainer;
85
- //# sourceMappingURL=NavigationContainer.js.map
@@ -1,100 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var createMemoryHistory_exports = {};
16
- __export(createMemoryHistory_exports, {
17
- default: () => createMemoryHistory
18
- });
19
- module.exports = __toCommonJS(createMemoryHistory_exports);
20
- var import_non_secure = require("nanoid/non-secure");
21
- function createMemoryHistory() {
22
- let index = 0, items = [];
23
- const pending = [], interrupt = () => {
24
- pending.forEach((it) => {
25
- const cb = it.cb;
26
- it.cb = () => cb(!0);
27
- });
28
- };
29
- return {
30
- get index() {
31
- const id = window.history.state?.id;
32
- if (id) {
33
- const index2 = items.findIndex((item) => item.id === id);
34
- return index2 > -1 ? index2 : 0;
35
- }
36
- return 0;
37
- },
38
- get(index2) {
39
- return items[index2];
40
- },
41
- backIndex({ path }) {
42
- for (let i = index - 1; i >= 0; i--)
43
- if (items[i].path === path)
44
- return i;
45
- return -1;
46
- },
47
- push({ path, state }) {
48
- interrupt();
49
- const id = (0, import_non_secure.nanoid)();
50
- items = items.slice(0, index + 1), items.push({ path, state, id }), index = items.length - 1, window.history.pushState({ id }, "", path);
51
- },
52
- replace({ path, state }) {
53
- interrupt();
54
- const id = window.history.state?.id ?? (0, import_non_secure.nanoid)();
55
- let pathWithHash = path;
56
- !items.length || items.findIndex((item) => item.id === id) < 0 ? (pathWithHash = pathWithHash + location.hash, items = [{ path: pathWithHash, state, id }], index = 0) : (items[index].path === path && (pathWithHash = pathWithHash + location.hash), items[index] = { path, state, id }), window.history.replaceState({ id }, "", pathWithHash);
57
- },
58
- // `history.go(n)` is asynchronous, there are couple of things to keep in mind:
59
- // - it won't do anything if we can't go `n` steps, the `popstate` event won't fire.
60
- // - each `history.go(n)` call will trigger a separate `popstate` event with correct location.
61
- // - the `popstate` event fires before the next frame after calling `history.go(n)`.
62
- // This method differs from `history.go(n)` in the sense that it'll go back as many steps it can.
63
- go(n) {
64
- interrupt();
65
- const nextIndex = index + n, lastItemIndex = items.length - 1;
66
- if (n < 0 && !items[nextIndex] ? (n = -index, index = 0) : n > 0 && nextIndex > lastItemIndex ? (n = lastItemIndex - index, index = lastItemIndex) : index = nextIndex, n !== 0)
67
- return new Promise((resolve, reject) => {
68
- const done = (interrupted) => {
69
- if (clearTimeout(timer), interrupted) {
70
- reject(new Error("History was changed during navigation."));
71
- return;
72
- }
73
- const { title } = window.document;
74
- window.document.title = "", window.document.title = title, resolve();
75
- };
76
- pending.push({ ref: done, cb: done });
77
- const timer = setTimeout(() => {
78
- const index2 = pending.findIndex((it) => it.ref === done);
79
- index2 > -1 && (pending[index2].cb(), pending.splice(index2, 1));
80
- }, 100), onPopState = () => {
81
- const id = window.history.state?.id, currentIndex = items.findIndex((item) => item.id === id);
82
- index = Math.max(currentIndex, 0);
83
- const last = pending.pop();
84
- window.removeEventListener("popstate", onPopState), last?.cb();
85
- };
86
- window.addEventListener("popstate", onPopState), window.history.go(n);
87
- });
88
- },
89
- // The `popstate` event is triggered when history changes, except `pushState` and `replaceState`
90
- // If we call `history.go(n)` ourselves, we don't want it to trigger the listener
91
- // Here we normalize it so that only external changes (e.g. user pressing back/forward) trigger the listener
92
- listen(listener) {
93
- const onPopState = () => {
94
- pending.length || listener();
95
- };
96
- return window.addEventListener("popstate", onPopState), () => window.removeEventListener("popstate", onPopState);
97
- }
98
- };
99
- }
100
- //# sourceMappingURL=createMemoryHistory.js.map
@@ -1,26 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var findFocusedRoute_exports = {};
16
- __export(findFocusedRoute_exports, {
17
- findFocusedRoute: () => findFocusedRoute
18
- });
19
- module.exports = __toCommonJS(findFocusedRoute_exports);
20
- function findFocusedRoute(state) {
21
- let current = state;
22
- for (; current?.routes[current.index ?? 0].state != null; )
23
- current = current.routes[current.index ?? 0].state;
24
- return current?.routes[current?.index ?? 0];
25
- }
26
- //# sourceMappingURL=findFocusedRoute.js.map
@@ -1,381 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
- // If the importer is in node compatibility mode or this is not an ESM
17
- // file that has been converted to a CommonJS file using a Babel-
18
- // compatible transform (i.e. "__esModule" has not been set), then set
19
- // "default" to the CommonJS "module.exports" for node compatibility.
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
- mod
22
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
- var getStateFromPath_exports = {};
24
- __export(getStateFromPath_exports, {
25
- default: () => getStateFromPath,
26
- getMatchableRouteConfigs: () => getMatchableRouteConfigs,
27
- getUrlWithReactNavigationConcessions: () => getUrlWithReactNavigationConcessions,
28
- stripBaseUrl: () => stripBaseUrl
29
- });
30
- module.exports = __toCommonJS(getStateFromPath_exports);
31
- var import_escape_string_regexp = __toESM(require("escape-string-regexp"), 1), import_matchers = require("../matchers"), import_findFocusedRoute = require("./findFocusedRoute"), import_validatePathConfig = __toESM(require("./validatePathConfig"), 1);
32
- function getUrlWithReactNavigationConcessions(path, baseUrl = process.env.EXPO_BASE_URL) {
33
- let parsed;
34
- try {
35
- parsed = new URL(path, baseUrl || "http://phony.example");
36
- } catch (err) {
37
- return console.warn(`Error parsing url ${path}: ${err?.message}`), {
38
- nonstandardPathname: path,
39
- inputPathnameWithoutHash: path.replace(/#.*$/g, ""),
40
- url: null
41
- };
42
- }
43
- const pathname = parsed.pathname;
44
- return {
45
- // The slashes are at the end, not the beginning
46
- nonstandardPathname: stripBaseUrl(pathname, baseUrl).replace(/^\/+/g, "").replace(/\/+$/g, "") + "/",
47
- url: parsed
48
- };
49
- }
50
- function getStateFromPath(path, options) {
51
- const { initialRoutes, configs } = getMatchableRouteConfigs(options);
52
- return getStateFromPathWithConfigs(path, configs, initialRoutes);
53
- }
54
- function getMatchableRouteConfigs(options) {
55
- options && (0, import_validatePathConfig.default)(options);
56
- const screens = options?.screens;
57
- if (!screens)
58
- throw Error("You must pass a 'screens' object to 'getStateFromPath' to generate a path.");
59
- const initialRoutes = [];
60
- options?.initialRouteName && initialRoutes.push({
61
- initialRouteName: options.initialRouteName,
62
- parentScreens: []
63
- });
64
- const converted = Object.keys(screens).flatMap((key) => createNormalizedConfigs(key, screens, [], initialRoutes)).flat(), resolvedInitialPatterns = initialRoutes.map(
65
- (route) => joinPaths(...route.parentScreens, route.initialRouteName)
66
- ), configs = converted.map((config) => ({
67
- ...config,
68
- // TODO: Probably a safer way to do this
69
- // Mark initial routes to give them potential priority over other routes that match.
70
- isInitial: resolvedInitialPatterns.includes(config.routeNames.join("/"))
71
- })).sort(sortConfigs);
72
- return assertConfigDuplicates(configs), { configs, initialRoutes };
73
- }
74
- function assertConfigDuplicates(configs) {
75
- configs.reduce((acc, config) => {
76
- const indexedKey = config.regex?.toString() ?? config.pattern, alpha = acc[indexedKey];
77
- if (alpha && !alpha.hasChildren && !config.hasChildren) {
78
- const a = alpha.routeNames, b = config.routeNames;
79
- if (!(a.length > b.length ? b.every((it, i) => a[i] === it) : a.every((it, i) => b[i] === it))) {
80
- const last = config.pattern.split("/").pop();
81
- if (!last?.match(/^\*not-found$/)) {
82
- const routeType = last?.startsWith(":") ? "dynamic route" : last?.startsWith("*") ? "dynamic-rest route" : "route";
83
- throw new Error(
84
- `The ${routeType} pattern '${config.pattern || "/"}' resolves to both '${alpha.userReadableName}' and '${config.userReadableName}'. Patterns must be unique and cannot resolve to more than one route.`
85
- );
86
- }
87
- }
88
- }
89
- return Object.assign(acc, {
90
- [indexedKey]: config
91
- });
92
- }, {});
93
- }
94
- function sortConfigs(a, b) {
95
- if (a.pattern === b.pattern)
96
- return b.routeNames.join(">").localeCompare(a.routeNames.join(">"));
97
- if (a.pattern.startsWith(b.pattern) && // NOTE: This is a hack to make sure that `*` is always at the end
98
- b.screen !== "index")
99
- return -1;
100
- if (b.pattern.startsWith(a.pattern) && a.screen !== "index")
101
- return 1;
102
- const aParts = a.pattern.split("/").filter((part) => (0, import_matchers.matchGroupName)(part) == null);
103
- (a.screen === "index" || a.screen.match(/\/index$/)) && aParts.push("index");
104
- const bParts = b.pattern.split("/").filter((part) => (0, import_matchers.matchGroupName)(part) == null);
105
- (b.screen === "index" || b.screen.match(/\/index$/)) && bParts.push("index");
106
- for (let i = 0; i < Math.max(aParts.length, bParts.length); i++) {
107
- if (aParts[i] == null)
108
- return 1;
109
- if (bParts[i] == null)
110
- return -1;
111
- const aWildCard = aParts[i].startsWith("*"), bWildCard = bParts[i].startsWith("*");
112
- if (aWildCard && bWildCard) {
113
- const aNotFound = aParts[i].match(/^[*]not-found$/), bNotFound = bParts[i].match(/^[*]not-found$/);
114
- if (aNotFound && bNotFound)
115
- continue;
116
- if (aNotFound)
117
- return 1;
118
- if (bNotFound)
119
- return -1;
120
- continue;
121
- }
122
- if (aWildCard)
123
- return 1;
124
- if (bWildCard)
125
- return -1;
126
- const aSlug = aParts[i].startsWith(":"), bSlug = bParts[i].startsWith(":");
127
- if (aSlug && bSlug) {
128
- const aNotFound = aParts[i].match(/^[*]not-found$/), bNotFound = bParts[i].match(/^[*]not-found$/);
129
- if (aNotFound && bNotFound)
130
- continue;
131
- if (aNotFound)
132
- return 1;
133
- if (bNotFound)
134
- return -1;
135
- continue;
136
- }
137
- if (aSlug)
138
- return 1;
139
- if (bSlug)
140
- return -1;
141
- }
142
- return a.isInitial && !b.isInitial ? -1 : !a.isInitial && b.isInitial ? 1 : bParts.length - aParts.length;
143
- }
144
- function getStateFromEmptyPathWithConfigs(path, hash, configs, initialRoutes) {
145
- const leafNodes = configs.filter((config) => !config.hasChildren).map((value) => ({
146
- ...value,
147
- // Collapse all levels of group segments before testing.
148
- // This enables `app/(one)/(two)/index.js` to be matched.
149
- path: (0, import_matchers.stripGroupSegmentsFromPath)(value.path)
150
- })), match = leafNodes.find(
151
- (config) => (
152
- // NOTE: Test leaf node index routes that either don't have a regex or match an empty string.
153
- config.path === "" && (!config.regex || config.regex.test(""))
154
- )
155
- ) ?? leafNodes.find(
156
- (config) => (
157
- // NOTE: Test leaf node dynamic routes that match an empty string.
158
- config.path.startsWith(":") && config.regex.test("")
159
- )
160
- ) ?? // NOTE: Test leaf node deep dynamic routes that match a slash.
161
- // This should be done last to enable dynamic routes having a higher priority.
162
- leafNodes.find((config) => config.path.startsWith("*") && config.regex.test("/"));
163
- if (!match)
164
- return;
165
- const routes = match.routeNames.map((name) => match._route ? {
166
- name,
167
- _route: match._route
168
- } : { name });
169
- return createNestedStateObject(path, hash, routes, configs, initialRoutes);
170
- }
171
- function getStateFromPathWithConfigs(path, configs, initialRoutes, baseUrl = process.env.EXPO_BASE_URL) {
172
- const formattedPaths = getUrlWithReactNavigationConcessions(path);
173
- if (!formattedPaths.url) {
174
- console.warn(`No url found for ${path}`);
175
- return;
176
- }
177
- let cleanPath = stripBaseUrl((0, import_matchers.stripGroupSegmentsFromPath)(formattedPaths.url.pathname), baseUrl) + formattedPaths.url.search;
178
- if (path.startsWith("/") || (cleanPath = cleanPath.slice(1)), formattedPaths.nonstandardPathname === "/")
179
- return getStateFromEmptyPathWithConfigs(
180
- cleanPath,
181
- formattedPaths.url.hash.slice(1),
182
- configs,
183
- initialRoutes
184
- );
185
- const routes = matchAgainstConfigs(formattedPaths.nonstandardPathname, configs);
186
- if (routes != null)
187
- return createNestedStateObject(
188
- cleanPath,
189
- formattedPaths.url.hash.slice(1),
190
- routes,
191
- configs,
192
- initialRoutes
193
- );
194
- }
195
- const joinPaths = (...paths) => [].concat(...paths.map((p) => p.split("/"))).filter(Boolean).join("/");
196
- function matchAgainstConfigs(remaining, configs) {
197
- let routes, remainingPath = remaining;
198
- for (const config of configs) {
199
- if (!config.regex)
200
- continue;
201
- const match = remainingPath.match(config.regex);
202
- if (!match)
203
- continue;
204
- const matchedParams = config.pattern?.split("/").filter((p) => p.match(/^[:*]/)).reduce((acc, p, i) => p.match(/^\*/) ? {
205
- ...acc,
206
- [p]: match[(i + 1) * 2]
207
- //?.replace(/\//, ""),
208
- } : Object.assign(acc, {
209
- // The param segments appear every second item starting from 2 in the regex match result.
210
- // This will only work if we ensure groups aren't included in the match.
211
- [p]: match[(i + 1) * 2]?.replace(/\//, "")
212
- }), {}), routeFromName = (name) => {
213
- const config2 = configs.find((c) => c.screen === name);
214
- if (!config2?.path)
215
- return { name };
216
- const segments = config2.path.split("/"), params = {};
217
- return segments.filter((p) => p.match(/^[:*]/)).forEach((p) => {
218
- let value = matchedParams[p];
219
- if (value) {
220
- p.match(/^\*/) && (value = value?.split("/").filter(Boolean));
221
- const key = p.replace(/^[:*]/, "").replace(/\?$/, "");
222
- params[key] = config2.parse?.[key] ? config2.parse[key](value) : value;
223
- }
224
- }), params && Object.keys(params).length ? { name, params } : { name };
225
- };
226
- routes = config.routeNames.map((name) => config._route ? {
227
- ...routeFromName(name),
228
- _route: config._route
229
- } : { ...routeFromName(name) });
230
- const combinedParams = routes.reduce(
231
- (acc, r) => Object.assign(acc, r.params),
232
- {}
233
- ), hasCombinedParams = Object.keys(combinedParams).length > 0;
234
- routes = routes.map((r) => (hasCombinedParams && (r.params = combinedParams), r)), remainingPath = remainingPath.replace(match[1], "");
235
- break;
236
- }
237
- return routes;
238
- }
239
- function equalHeritage(a, b) {
240
- if (a.length !== b.length)
241
- return !1;
242
- for (let i = 0; i < a.length; i++)
243
- if (a[i].localeCompare(b[i]) !== 0)
244
- return !1;
245
- return !0;
246
- }
247
- const createNormalizedConfigs = (screen, routeConfig, routeNames = [], initials = [], parentScreens = [], parentPattern) => {
248
- const configs = [];
249
- routeNames.push(screen), parentScreens.push(screen);
250
- const config = routeConfig[screen];
251
- if (typeof config == "string") {
252
- const pattern = parentPattern ? joinPaths(parentPattern, config) : config;
253
- configs.push(createConfigItem(screen, routeNames, pattern, config, !1));
254
- } else if (typeof config == "object") {
255
- let pattern;
256
- const { _route } = config;
257
- if (typeof config.path == "string") {
258
- if (config.exact && config.path === void 0)
259
- throw new Error(
260
- "A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`."
261
- );
262
- pattern = config.exact !== !0 ? joinPaths(parentPattern || "", config.path || "") : config.path || "", configs.push(
263
- createConfigItem(
264
- screen,
265
- routeNames,
266
- pattern,
267
- config.path,
268
- config.screens ? !!Object.keys(config.screens)?.length : !1,
269
- config.parse,
270
- _route
271
- )
272
- );
273
- }
274
- config.screens && (config.initialRouteName && initials.push({
275
- initialRouteName: config.initialRouteName,
276
- parentScreens
277
- }), Object.keys(config.screens).forEach((nestedConfig) => {
278
- const result = createNormalizedConfigs(
279
- nestedConfig,
280
- config.screens,
281
- routeNames,
282
- initials,
283
- [...parentScreens],
284
- pattern ?? parentPattern
285
- );
286
- configs.push(...result);
287
- }));
288
- }
289
- return routeNames.pop(), configs;
290
- };
291
- function formatRegexPattern(it) {
292
- return it = it.replace(" ", "%20"), it.startsWith(":") ? `(([^/]+\\/)${it.endsWith("?") ? "?" : ""})` : it.startsWith("*") ? `((.*\\/)${it.endsWith("?") ? "?" : ""})` : (0, import_matchers.matchGroupName)(it) != null ? `(?:${(0, import_escape_string_regexp.default)(it)}\\/)?` : (0, import_escape_string_regexp.default)(it) + "\\/";
293
- }
294
- const createConfigItem = (screen, routeNames, pattern, path, hasChildren, parse, _route) => {
295
- pattern = pattern.split("/").filter(Boolean).join("/");
296
- const regex = pattern ? new RegExp(`^(${pattern.split("/").map(formatRegexPattern).join("")})$`) : void 0;
297
- return {
298
- screen,
299
- regex,
300
- pattern,
301
- path,
302
- // The routeNames array is mutated, so copy it to keep the current state
303
- routeNames: [...routeNames],
304
- parse,
305
- userReadableName: [...routeNames.slice(0, -1), path || screen].join("/"),
306
- hasChildren: !!hasChildren,
307
- _route
308
- };
309
- }, findParseConfigForRoute = (routeName, routeConfigs) => {
310
- for (const config of routeConfigs)
311
- if (routeName === config.routeNames[config.routeNames.length - 1])
312
- return config.parse;
313
- }, findInitialRoute = (routeName, parentScreens, initialRoutes) => {
314
- for (const config of initialRoutes)
315
- if (equalHeritage(parentScreens, config.parentScreens))
316
- return routeName !== config.initialRouteName ? config.initialRouteName : void 0;
317
- }, createStateObject = (route, isEmpty, initialRoute) => isEmpty ? initialRoute ? {
318
- index: 1,
319
- routes: [{ name: initialRoute }, route]
320
- } : {
321
- routes: [route]
322
- } : initialRoute ? {
323
- index: 1,
324
- routes: [{ name: initialRoute }, { ...route, state: { routes: [] } }]
325
- } : {
326
- routes: [{ ...route, state: { routes: [] } }]
327
- }, createNestedStateObject = (path, hash, routes, routeConfigs, initialRoutes) => {
328
- let route = routes.shift();
329
- const parentScreens = [];
330
- let initialRoute = findInitialRoute(route.name, parentScreens, initialRoutes);
331
- parentScreens.push(route.name);
332
- const state = createStateObject(route, routes.length === 0, initialRoute);
333
- if (routes.length > 0) {
334
- let nestedState = state;
335
- for (; route = routes.shift(); ) {
336
- initialRoute = findInitialRoute(route.name, parentScreens, initialRoutes);
337
- const nestedStateIndex = nestedState.index || nestedState.routes.length - 1;
338
- nestedState.routes[nestedStateIndex].state = createStateObject(
339
- route,
340
- routes.length === 0,
341
- initialRoute
342
- ), routes.length > 0 && (nestedState = nestedState.routes[nestedStateIndex].state), parentScreens.push(route.name);
343
- }
344
- }
345
- route = (0, import_findFocusedRoute.findFocusedRoute)(state), route.path = path;
346
- const params = parseQueryParams(route.path, findParseConfigForRoute(route.name, routeConfigs));
347
- if (params) {
348
- route.params = Object.assign(/* @__PURE__ */ Object.create(null), route.params);
349
- for (const [name, value] of Object.entries(params))
350
- if (route.params?.[name] && process.env.NODE_ENV !== "production" && console.warn(
351
- `Route '/${route.name}' with param '${name}' was specified both in the path and as a param, removing from path`
352
- ), !route.params?.[name]) {
353
- route.params[name] = value;
354
- continue;
355
- }
356
- Object.keys(route.params).length === 0 && delete route.params;
357
- }
358
- return hash && (route.params = Object.assign(/* @__PURE__ */ Object.create(null), route.params), route.params["#"] = hash), state;
359
- }, parseQueryParams = (path, parseConfig) => {
360
- const query = path.split("?")[1], searchParams = new URLSearchParams(query), params = Object.fromEntries(
361
- // @ts-ignore: [Symbol.iterator] is indeed, available on every platform.
362
- searchParams
363
- );
364
- return parseConfig && Object.keys(params).forEach((name) => {
365
- Object.hasOwnProperty.call(parseConfig, name) && typeof params[name] == "string" && (params[name] = parseConfig[name](params[name]));
366
- }), Object.keys(params).length ? params : void 0;
367
- }, baseUrlCache = /* @__PURE__ */ new Map();
368
- function getBaseUrlRegex(baseUrl) {
369
- if (baseUrlCache.has(baseUrl))
370
- return baseUrlCache.get(baseUrl);
371
- const regex = new RegExp(`^\\/?${(0, import_escape_string_regexp.default)(baseUrl)}`, "g");
372
- return baseUrlCache.set(baseUrl, regex), regex;
373
- }
374
- function stripBaseUrl(path, baseUrl = process.env.EXPO_BASE_URL) {
375
- if (process.env.NODE_ENV !== "development" && baseUrl) {
376
- const reg = getBaseUrlRegex(baseUrl);
377
- return path.replace(/^\/+/g, "/").replace(reg, "");
378
- }
379
- return path;
380
- }
381
- //# sourceMappingURL=getStateFromPath.js.map