one 1.1.308 → 1.1.310

Sign up to get free protection for your applications and to get access to all the features.
Files changed (375) hide show
  1. package/dist/cjs/Root.cjs +212 -0
  2. package/dist/cjs/{Route.js → Route.cjs} +34 -19
  3. package/dist/cjs/{cleanUrl.js → cleanUrl.cjs} +27 -18
  4. package/dist/cjs/cli/label-process.cjs +31 -0
  5. package/dist/cjs/cli/{main.js → main.cjs} +28 -16
  6. package/dist/cjs/cli/{prebuild.js → prebuild.cjs} +25 -15
  7. package/dist/cjs/cli/run.cjs +70 -0
  8. package/dist/cjs/cli/{runAndroid.js → runAndroid.cjs} +25 -15
  9. package/dist/cjs/cli/{runIos.js → runIos.cjs} +25 -15
  10. package/dist/cjs/cli.cjs +258 -0
  11. package/dist/cjs/clientLoaderResolver.cjs +35 -0
  12. package/dist/cjs/config.cjs +32 -0
  13. package/dist/cjs/constants.cjs +30 -0
  14. package/dist/cjs/{createApp.js → createApp.cjs} +33 -17
  15. package/dist/cjs/createApp.native.cjs +38 -0
  16. package/dist/cjs/createApp.native.cjs.map +6 -0
  17. package/dist/cjs/{createHandleRequest.js → createHandleRequest.cjs} +60 -49
  18. package/dist/cjs/createRoute.cjs +42 -0
  19. package/dist/cjs/fallbackViews/{Sitemap.js → Sitemap.cjs} +35 -16
  20. package/dist/cjs/fallbackViews/{Unmatched.js → Unmatched.cjs} +32 -17
  21. package/dist/cjs/fork/NavigationContainer.cjs +105 -0
  22. package/dist/cjs/fork/NavigationContainer.native.cjs +103 -0
  23. package/dist/cjs/fork/NavigationContainer.native.cjs.map +6 -0
  24. package/dist/cjs/fork/createMemoryHistory.cjs +136 -0
  25. package/dist/cjs/fork/{extractPathFromURL.js → extractPathFromURL.cjs} +30 -21
  26. package/dist/cjs/fork/findFocusedRoute.cjs +30 -0
  27. package/dist/cjs/fork/{getPathFromState.js → getPathFromState.cjs} +120 -113
  28. package/dist/cjs/fork/getStateFromPath.cjs +366 -0
  29. package/dist/cjs/fork/useLinking.cjs +215 -0
  30. package/dist/cjs/fork/useLinking.native.cjs +126 -0
  31. package/dist/cjs/fork/useLinking.native.cjs.map +6 -0
  32. package/dist/cjs/fork/validatePathConfig.cjs +44 -0
  33. package/dist/cjs/{getLinkingConfig.js → getLinkingConfig.cjs} +21 -15
  34. package/dist/cjs/{getReactNavigationConfig.js → getReactNavigationConfig.cjs} +33 -32
  35. package/dist/cjs/getRoutes.cjs +276 -0
  36. package/dist/cjs/{getURL.js → getURL.cjs} +16 -11
  37. package/dist/cjs/getURL.native.cjs +48 -0
  38. package/dist/cjs/getURL.native.cjs.map +6 -0
  39. package/dist/cjs/head/Head.android.cjs +28 -0
  40. package/dist/cjs/head/Head.android.cjs.map +6 -0
  41. package/dist/cjs/head/Head.cjs +30 -0
  42. package/dist/cjs/head/Head.ios.cjs +210 -0
  43. package/dist/cjs/head/Head.ios.cjs.map +6 -0
  44. package/dist/cjs/head/HeadModule.cjs +27 -0
  45. package/dist/cjs/head/index.cjs +18 -0
  46. package/dist/cjs/head/types.cjs +16 -0
  47. package/dist/cjs/head/url.cjs +50 -0
  48. package/dist/cjs/{hooks.js → hooks.cjs} +52 -40
  49. package/dist/cjs/{imperative-api.js → imperative-api.cjs} +26 -19
  50. package/dist/cjs/import-mode/index.android.cjs +26 -0
  51. package/dist/cjs/import-mode/index.android.cjs.map +6 -0
  52. package/dist/cjs/import-mode/index.cjs +26 -0
  53. package/dist/cjs/import-mode/index.ios.cjs +26 -0
  54. package/dist/cjs/import-mode/index.ios.cjs.map +6 -0
  55. package/dist/cjs/import-mode/index.native.cjs +26 -0
  56. package/dist/cjs/import-mode/index.native.cjs.map +6 -0
  57. package/dist/cjs/import-mode/index.web.cjs +26 -0
  58. package/dist/cjs/{index.js → index.cjs} +50 -14
  59. package/dist/cjs/interfaces/router.cjs +27 -0
  60. package/dist/cjs/layouts/Drawer.cjs +31 -0
  61. package/dist/cjs/layouts/Stack.cjs +31 -0
  62. package/dist/cjs/layouts/Tabs.cjs +64 -0
  63. package/dist/cjs/layouts/withLayoutContext.cjs +91 -0
  64. package/dist/cjs/link/Link.cjs +120 -0
  65. package/dist/cjs/link/Redirect.cjs +39 -0
  66. package/dist/cjs/link/href.cjs +58 -0
  67. package/dist/cjs/link/linking.cjs +89 -0
  68. package/dist/cjs/link/path.cjs +69 -0
  69. package/dist/cjs/link/useLinkTo.cjs +54 -0
  70. package/dist/cjs/link/useLoadedNavigation.cjs +60 -0
  71. package/dist/cjs/{matchers.js → matchers.cjs} +16 -11
  72. package/dist/cjs/platform.cjs +26 -0
  73. package/dist/cjs/polyfills-mobile.cjs +33 -0
  74. package/dist/cjs/polyfills-server.cjs +25 -0
  75. package/dist/cjs/render.cjs +47 -0
  76. package/dist/cjs/render.native.cjs +28 -0
  77. package/dist/cjs/render.native.cjs.map +6 -0
  78. package/dist/cjs/router/RouterStore.cjs +16 -0
  79. package/dist/cjs/router/constants.cjs +26 -0
  80. package/dist/cjs/router/{getNormalizedStatePath.js → getNormalizedStatePath.cjs} +25 -23
  81. package/dist/cjs/router/lastAction.cjs +31 -0
  82. package/dist/cjs/router/{router.js → router.cjs} +104 -78
  83. package/dist/cjs/router/serverLocationContext.cjs +27 -0
  84. package/dist/cjs/router/{useInitializeOneRouter.js → useInitializeOneRouter.cjs} +26 -16
  85. package/dist/cjs/serve.cjs +185 -0
  86. package/dist/cjs/server/{createRoutesManifest.js → createRoutesManifest.cjs} +22 -16
  87. package/dist/cjs/server/{getServerManifest.js → getServerManifest.cjs} +58 -31
  88. package/dist/cjs/{server-render.js → server-render.cjs} +28 -17
  89. package/dist/cjs/sortRoutes.cjs +62 -0
  90. package/dist/cjs/typed-routes/generateRouteTypes.cjs +48 -0
  91. package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.js → getTypedRoutesDeclarationFile.cjs} +37 -40
  92. package/dist/cjs/types.cjs +16 -0
  93. package/dist/cjs/{useFocusEffect.js → useFocusEffect.cjs} +33 -24
  94. package/dist/cjs/useLoader.cjs +114 -0
  95. package/dist/cjs/useNavigation.cjs +68 -0
  96. package/dist/cjs/useScreens.cjs +233 -0
  97. package/dist/cjs/{useViteRoutes.js → useViteRoutes.cjs} +36 -24
  98. package/dist/cjs/utils/assertIsReady.cjs +28 -0
  99. package/dist/cjs/utils/dynamicImport.cjs +27 -0
  100. package/dist/cjs/utils/existsAsync.cjs +33 -0
  101. package/dist/cjs/utils/getPageExport.cjs +32 -0
  102. package/dist/cjs/utils/{globDir.js → globDir.cjs} +23 -15
  103. package/dist/cjs/utils/{hashString.js → hashString.cjs} +22 -14
  104. package/dist/cjs/utils/isResponse.cjs +28 -0
  105. package/dist/cjs/utils/isStatus.cjs +28 -0
  106. package/dist/cjs/utils/promiseWithResolvers.cjs +37 -0
  107. package/dist/cjs/utils/rand.cjs +26 -0
  108. package/dist/cjs/utils/redirect.cjs +34 -0
  109. package/dist/cjs/utils/removeSearch.cjs +28 -0
  110. package/dist/cjs/utils/removeUndefined.cjs +30 -0
  111. package/dist/cjs/utils/{url.js → url.cjs} +16 -11
  112. package/dist/cjs/utils/weakKey.cjs +30 -0
  113. package/dist/cjs/utils/weakMemo.cjs +34 -0
  114. package/dist/cjs/views/EmptyRoute.cjs +30 -0
  115. package/dist/cjs/views/{ErrorBoundary.js → ErrorBoundary.cjs} +30 -16
  116. package/dist/cjs/views/LoadProgressBar.cjs +90 -0
  117. package/dist/cjs/views/Navigator.cjs +149 -0
  118. package/dist/cjs/views/{PreloadLinks.js → PreloadLinks.cjs} +20 -13
  119. package/dist/cjs/views/PreloadLinks.native.cjs +28 -0
  120. package/dist/cjs/views/PreloadLinks.native.cjs.map +6 -0
  121. package/dist/cjs/views/{RootErrorBoundary.js → RootErrorBoundary.cjs} +28 -16
  122. package/dist/cjs/views/Screen.cjs +39 -0
  123. package/dist/cjs/views/ScrollRestoration.cjs +74 -0
  124. package/dist/cjs/views/Try.cjs +68 -0
  125. package/dist/cjs/vite/build.cjs +425 -0
  126. package/dist/cjs/vite/{clientTreeShakePlugin.js → clientTreeShakePlugin.cjs} +53 -35
  127. package/dist/cjs/vite/constants.cjs +28 -0
  128. package/dist/cjs/vite/{createFileSystemRouter.js → createFileSystemRouter.cjs} +117 -84
  129. package/dist/cjs/vite/{customNodeExternals.js → customNodeExternals.cjs} +32 -20
  130. package/dist/cjs/vite/ensureTsConfig.cjs +68 -0
  131. package/dist/cjs/vite/findDepsToOptimize.cjs +74 -0
  132. package/dist/cjs/vite/{fixDependenciesPlugin.js → fixDependenciesPlugin.cjs} +17 -12
  133. package/dist/cjs/vite/generateTypesForRoutes.cjs +45 -0
  134. package/dist/cjs/vite/{getManifest.js → getManifest.cjs} +18 -12
  135. package/dist/cjs/vite/{headers.js → headers.cjs} +19 -14
  136. package/dist/cjs/vite/headers.native.cjs +32 -0
  137. package/dist/cjs/vite/headers.native.cjs.map +6 -0
  138. package/dist/cjs/vite/{loadEnv.js → loadEnv.cjs} +27 -16
  139. package/dist/cjs/vite/makePluginWebOnly.cjs +31 -0
  140. package/dist/cjs/vite/one.cjs +256 -0
  141. package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.js → removeReactNativeWebAnimatedPlugin.cjs} +32 -25
  142. package/dist/cjs/vite/replaceLoader.cjs +37 -0
  143. package/dist/cjs/vite/resolveAPIRequest.cjs +90 -0
  144. package/dist/cjs/vite/server.cjs +13 -0
  145. package/dist/cjs/vite/types.cjs +16 -0
  146. package/dist/cjs/vite/{virtualEntryPlugin.js → virtualEntryPlugin.cjs} +28 -20
  147. package/dist/cjs/vite/{vitePluginSsrCss.js → vitePluginSsrCss.cjs} +56 -50
  148. package/dist/cjs/vite.cjs +40 -0
  149. package/dist/cjs/zero/getQueryKey.cjs +29 -0
  150. package/dist/cjs/zero/isZeroQuery.cjs +28 -0
  151. package/dist/cjs/zero/resolveQuery.cjs +41 -0
  152. package/dist/cjs/zero/{subscribeToQuery.js → subscribeToQuery.cjs} +16 -11
  153. package/dist/cjs/zero/types.cjs +16 -0
  154. package/dist/cjs/zero/useQuery.cjs +58 -0
  155. package/dist/cjs/zero/{useQueryZero.js → useQueryZero.cjs} +21 -15
  156. package/dist/cjs/zero.cjs +30 -0
  157. package/package.json +10 -10
  158. package/dist/cjs/Root.js +0 -182
  159. package/dist/cjs/cli/label-process.js +0 -25
  160. package/dist/cjs/cli/run.js +0 -52
  161. package/dist/cjs/cli.js +0 -209
  162. package/dist/cjs/clientLoaderResolver.js +0 -32
  163. package/dist/cjs/config.js +0 -27
  164. package/dist/cjs/constants.js +0 -23
  165. package/dist/cjs/createRoute.js +0 -37
  166. package/dist/cjs/fork/NavigationContainer.js +0 -85
  167. package/dist/cjs/fork/createMemoryHistory.js +0 -100
  168. package/dist/cjs/fork/findFocusedRoute.js +0 -26
  169. package/dist/cjs/fork/getStateFromPath.js +0 -381
  170. package/dist/cjs/fork/useLinking.js +0 -182
  171. package/dist/cjs/fork/validatePathConfig.js +0 -46
  172. package/dist/cjs/getRoutes.js +0 -294
  173. package/dist/cjs/head/Head.js +0 -23
  174. package/dist/cjs/head/HeadModule.js +0 -22
  175. package/dist/cjs/head/index.js +0 -15
  176. package/dist/cjs/head/types.js +0 -14
  177. package/dist/cjs/head/url.js +0 -52
  178. package/dist/cjs/import-mode/index.js +0 -21
  179. package/dist/cjs/import-mode/index.web.js +0 -21
  180. package/dist/cjs/interfaces/router.js +0 -23
  181. package/dist/cjs/layouts/Drawer.js +0 -24
  182. package/dist/cjs/layouts/Stack.js +0 -24
  183. package/dist/cjs/layouts/Tabs.js +0 -52
  184. package/dist/cjs/layouts/withLayoutContext.js +0 -77
  185. package/dist/cjs/link/Link.js +0 -98
  186. package/dist/cjs/link/Redirect.js +0 -31
  187. package/dist/cjs/link/href.js +0 -50
  188. package/dist/cjs/link/linking.js +0 -82
  189. package/dist/cjs/link/path.js +0 -65
  190. package/dist/cjs/link/useLinkTo.js +0 -42
  191. package/dist/cjs/link/useLoadedNavigation.js +0 -50
  192. package/dist/cjs/platform.js +0 -21
  193. package/dist/cjs/polyfills-mobile.js +0 -26
  194. package/dist/cjs/polyfills-server.js +0 -23
  195. package/dist/cjs/render.js +0 -44
  196. package/dist/cjs/router/RouterStore.js +0 -14
  197. package/dist/cjs/router/constants.js +0 -21
  198. package/dist/cjs/router/lastAction.js +0 -25
  199. package/dist/cjs/router/serverLocationContext.js +0 -22
  200. package/dist/cjs/serve.js +0 -175
  201. package/dist/cjs/sortRoutes.js +0 -64
  202. package/dist/cjs/typed-routes/generateRouteTypes.js +0 -33
  203. package/dist/cjs/types.js +0 -14
  204. package/dist/cjs/useLoader.js +0 -97
  205. package/dist/cjs/useNavigation.js +0 -60
  206. package/dist/cjs/useScreens.js +0 -176
  207. package/dist/cjs/utils/assertIsReady.js +0 -26
  208. package/dist/cjs/utils/dynamicImport.js +0 -24
  209. package/dist/cjs/utils/existsAsync.js +0 -28
  210. package/dist/cjs/utils/getPageExport.js +0 -27
  211. package/dist/cjs/utils/isResponse.js +0 -23
  212. package/dist/cjs/utils/isStatus.js +0 -23
  213. package/dist/cjs/utils/promiseWithResolvers.js +0 -26
  214. package/dist/cjs/utils/rand.js +0 -21
  215. package/dist/cjs/utils/redirect.js +0 -28
  216. package/dist/cjs/utils/removeSearch.js +0 -23
  217. package/dist/cjs/utils/removeUndefined.js +0 -26
  218. package/dist/cjs/utils/weakKey.js +0 -24
  219. package/dist/cjs/utils/weakMemo.js +0 -30
  220. package/dist/cjs/views/EmptyRoute.js +0 -25
  221. package/dist/cjs/views/LoadProgressBar.js +0 -83
  222. package/dist/cjs/views/Navigator.js +0 -101
  223. package/dist/cjs/views/Screen.js +0 -29
  224. package/dist/cjs/views/ScrollRestoration.js +0 -70
  225. package/dist/cjs/views/Try.js +0 -44
  226. package/dist/cjs/vite/build.js +0 -376
  227. package/dist/cjs/vite/constants.js +0 -22
  228. package/dist/cjs/vite/ensureTsConfig.js +0 -66
  229. package/dist/cjs/vite/findDepsToOptimize.js +0 -66
  230. package/dist/cjs/vite/generateTypesForRoutes.js +0 -36
  231. package/dist/cjs/vite/makePluginWebOnly.js +0 -27
  232. package/dist/cjs/vite/one.js +0 -255
  233. package/dist/cjs/vite/replaceLoader.js +0 -34
  234. package/dist/cjs/vite/resolveAPIRequest.js +0 -71
  235. package/dist/cjs/vite/server.js +0 -16
  236. package/dist/cjs/vite/types.js +0 -14
  237. package/dist/cjs/vite.js +0 -28
  238. package/dist/cjs/zero/getQueryKey.js +0 -24
  239. package/dist/cjs/zero/isZeroQuery.js +0 -23
  240. package/dist/cjs/zero/resolveQuery.js +0 -38
  241. package/dist/cjs/zero/types.js +0 -14
  242. package/dist/cjs/zero/useQuery.js +0 -47
  243. package/dist/cjs/zero.js +0 -23
  244. /package/dist/cjs/{Root.js.map → Root.cjs.map} +0 -0
  245. /package/dist/cjs/{Route.js.map → Route.cjs.map} +0 -0
  246. /package/dist/cjs/{cleanUrl.js.map → cleanUrl.cjs.map} +0 -0
  247. /package/dist/cjs/cli/{label-process.js.map → label-process.cjs.map} +0 -0
  248. /package/dist/cjs/cli/{main.js.map → main.cjs.map} +0 -0
  249. /package/dist/cjs/cli/{prebuild.js.map → prebuild.cjs.map} +0 -0
  250. /package/dist/cjs/cli/{run.js.map → run.cjs.map} +0 -0
  251. /package/dist/cjs/cli/{runAndroid.js.map → runAndroid.cjs.map} +0 -0
  252. /package/dist/cjs/cli/{runIos.js.map → runIos.cjs.map} +0 -0
  253. /package/dist/cjs/{cli.js.map → cli.cjs.map} +0 -0
  254. /package/dist/cjs/{clientLoaderResolver.js.map → clientLoaderResolver.cjs.map} +0 -0
  255. /package/dist/cjs/{config.js.map → config.cjs.map} +0 -0
  256. /package/dist/cjs/{constants.js.map → constants.cjs.map} +0 -0
  257. /package/dist/cjs/{createApp.js.map → createApp.cjs.map} +0 -0
  258. /package/dist/cjs/{createHandleRequest.js.map → createHandleRequest.cjs.map} +0 -0
  259. /package/dist/cjs/{createRoute.js.map → createRoute.cjs.map} +0 -0
  260. /package/dist/cjs/fallbackViews/{Sitemap.js.map → Sitemap.cjs.map} +0 -0
  261. /package/dist/cjs/fallbackViews/{Unmatched.js.map → Unmatched.cjs.map} +0 -0
  262. /package/dist/cjs/fork/{NavigationContainer.js.map → NavigationContainer.cjs.map} +0 -0
  263. /package/dist/cjs/fork/{createMemoryHistory.js.map → createMemoryHistory.cjs.map} +0 -0
  264. /package/dist/cjs/fork/{extractPathFromURL.js.map → extractPathFromURL.cjs.map} +0 -0
  265. /package/dist/cjs/fork/{findFocusedRoute.js.map → findFocusedRoute.cjs.map} +0 -0
  266. /package/dist/cjs/fork/{getPathFromState.js.map → getPathFromState.cjs.map} +0 -0
  267. /package/dist/cjs/fork/{getStateFromPath.js.map → getStateFromPath.cjs.map} +0 -0
  268. /package/dist/cjs/fork/{useLinking.js.map → useLinking.cjs.map} +0 -0
  269. /package/dist/cjs/fork/{validatePathConfig.js.map → validatePathConfig.cjs.map} +0 -0
  270. /package/dist/cjs/{getLinkingConfig.js.map → getLinkingConfig.cjs.map} +0 -0
  271. /package/dist/cjs/{getReactNavigationConfig.js.map → getReactNavigationConfig.cjs.map} +0 -0
  272. /package/dist/cjs/{getRoutes.js.map → getRoutes.cjs.map} +0 -0
  273. /package/dist/cjs/{getURL.js.map → getURL.cjs.map} +0 -0
  274. /package/dist/cjs/head/{Head.js.map → Head.cjs.map} +0 -0
  275. /package/dist/cjs/head/{HeadModule.js.map → HeadModule.cjs.map} +0 -0
  276. /package/dist/cjs/head/{index.js.map → index.cjs.map} +0 -0
  277. /package/dist/cjs/head/{types.js.map → types.cjs.map} +0 -0
  278. /package/dist/cjs/head/{url.js.map → url.cjs.map} +0 -0
  279. /package/dist/cjs/{hooks.js.map → hooks.cjs.map} +0 -0
  280. /package/dist/cjs/{imperative-api.js.map → imperative-api.cjs.map} +0 -0
  281. /package/dist/cjs/import-mode/{index.js.map → index.cjs.map} +0 -0
  282. /package/dist/cjs/import-mode/{index.web.js.map → index.web.cjs.map} +0 -0
  283. /package/dist/cjs/{index.js.map → index.cjs.map} +0 -0
  284. /package/dist/cjs/interfaces/{router.js.map → router.cjs.map} +0 -0
  285. /package/dist/cjs/layouts/{Drawer.js.map → Drawer.cjs.map} +0 -0
  286. /package/dist/cjs/layouts/{Stack.js.map → Stack.cjs.map} +0 -0
  287. /package/dist/cjs/layouts/{Tabs.js.map → Tabs.cjs.map} +0 -0
  288. /package/dist/cjs/layouts/{withLayoutContext.js.map → withLayoutContext.cjs.map} +0 -0
  289. /package/dist/cjs/link/{Link.js.map → Link.cjs.map} +0 -0
  290. /package/dist/cjs/link/{Redirect.js.map → Redirect.cjs.map} +0 -0
  291. /package/dist/cjs/link/{href.js.map → href.cjs.map} +0 -0
  292. /package/dist/cjs/link/{linking.js.map → linking.cjs.map} +0 -0
  293. /package/dist/cjs/link/{path.js.map → path.cjs.map} +0 -0
  294. /package/dist/cjs/link/{useLinkTo.js.map → useLinkTo.cjs.map} +0 -0
  295. /package/dist/cjs/link/{useLoadedNavigation.js.map → useLoadedNavigation.cjs.map} +0 -0
  296. /package/dist/cjs/{matchers.js.map → matchers.cjs.map} +0 -0
  297. /package/dist/cjs/{platform.js.map → platform.cjs.map} +0 -0
  298. /package/dist/cjs/{polyfills-mobile.js.map → polyfills-mobile.cjs.map} +0 -0
  299. /package/dist/cjs/{polyfills-server.js.map → polyfills-server.cjs.map} +0 -0
  300. /package/dist/cjs/{render.js.map → render.cjs.map} +0 -0
  301. /package/dist/cjs/router/{RouterStore.js.map → RouterStore.cjs.map} +0 -0
  302. /package/dist/cjs/router/{constants.js.map → constants.cjs.map} +0 -0
  303. /package/dist/cjs/router/{getNormalizedStatePath.js.map → getNormalizedStatePath.cjs.map} +0 -0
  304. /package/dist/cjs/router/{lastAction.js.map → lastAction.cjs.map} +0 -0
  305. /package/dist/cjs/router/{router.js.map → router.cjs.map} +0 -0
  306. /package/dist/cjs/router/{serverLocationContext.js.map → serverLocationContext.cjs.map} +0 -0
  307. /package/dist/cjs/router/{useInitializeOneRouter.js.map → useInitializeOneRouter.cjs.map} +0 -0
  308. /package/dist/cjs/{serve.js.map → serve.cjs.map} +0 -0
  309. /package/dist/cjs/server/{createRoutesManifest.js.map → createRoutesManifest.cjs.map} +0 -0
  310. /package/dist/cjs/server/{getServerManifest.js.map → getServerManifest.cjs.map} +0 -0
  311. /package/dist/cjs/{server-render.js.map → server-render.cjs.map} +0 -0
  312. /package/dist/cjs/{sortRoutes.js.map → sortRoutes.cjs.map} +0 -0
  313. /package/dist/cjs/typed-routes/{generateRouteTypes.js.map → generateRouteTypes.cjs.map} +0 -0
  314. /package/dist/cjs/typed-routes/{getTypedRoutesDeclarationFile.js.map → getTypedRoutesDeclarationFile.cjs.map} +0 -0
  315. /package/dist/cjs/{types.js.map → types.cjs.map} +0 -0
  316. /package/dist/cjs/{useFocusEffect.js.map → useFocusEffect.cjs.map} +0 -0
  317. /package/dist/cjs/{useLoader.js.map → useLoader.cjs.map} +0 -0
  318. /package/dist/cjs/{useNavigation.js.map → useNavigation.cjs.map} +0 -0
  319. /package/dist/cjs/{useScreens.js.map → useScreens.cjs.map} +0 -0
  320. /package/dist/cjs/{useViteRoutes.js.map → useViteRoutes.cjs.map} +0 -0
  321. /package/dist/cjs/utils/{assertIsReady.js.map → assertIsReady.cjs.map} +0 -0
  322. /package/dist/cjs/utils/{dynamicImport.js.map → dynamicImport.cjs.map} +0 -0
  323. /package/dist/cjs/utils/{existsAsync.js.map → existsAsync.cjs.map} +0 -0
  324. /package/dist/cjs/utils/{getPageExport.js.map → getPageExport.cjs.map} +0 -0
  325. /package/dist/cjs/utils/{globDir.js.map → globDir.cjs.map} +0 -0
  326. /package/dist/cjs/utils/{hashString.js.map → hashString.cjs.map} +0 -0
  327. /package/dist/cjs/utils/{isResponse.js.map → isResponse.cjs.map} +0 -0
  328. /package/dist/cjs/utils/{isStatus.js.map → isStatus.cjs.map} +0 -0
  329. /package/dist/cjs/utils/{promiseWithResolvers.js.map → promiseWithResolvers.cjs.map} +0 -0
  330. /package/dist/cjs/utils/{rand.js.map → rand.cjs.map} +0 -0
  331. /package/dist/cjs/utils/{redirect.js.map → redirect.cjs.map} +0 -0
  332. /package/dist/cjs/utils/{removeSearch.js.map → removeSearch.cjs.map} +0 -0
  333. /package/dist/cjs/utils/{removeUndefined.js.map → removeUndefined.cjs.map} +0 -0
  334. /package/dist/cjs/utils/{url.js.map → url.cjs.map} +0 -0
  335. /package/dist/cjs/utils/{weakKey.js.map → weakKey.cjs.map} +0 -0
  336. /package/dist/cjs/utils/{weakMemo.js.map → weakMemo.cjs.map} +0 -0
  337. /package/dist/cjs/views/{EmptyRoute.js.map → EmptyRoute.cjs.map} +0 -0
  338. /package/dist/cjs/views/{ErrorBoundary.js.map → ErrorBoundary.cjs.map} +0 -0
  339. /package/dist/cjs/views/{LoadProgressBar.js.map → LoadProgressBar.cjs.map} +0 -0
  340. /package/dist/cjs/views/{Navigator.js.map → Navigator.cjs.map} +0 -0
  341. /package/dist/cjs/views/{PreloadLinks.js.map → PreloadLinks.cjs.map} +0 -0
  342. /package/dist/cjs/views/{RootErrorBoundary.js.map → RootErrorBoundary.cjs.map} +0 -0
  343. /package/dist/cjs/views/{Screen.js.map → Screen.cjs.map} +0 -0
  344. /package/dist/cjs/views/{ScrollRestoration.js.map → ScrollRestoration.cjs.map} +0 -0
  345. /package/dist/cjs/views/{Try.js.map → Try.cjs.map} +0 -0
  346. /package/dist/cjs/vite/{build.js.map → build.cjs.map} +0 -0
  347. /package/dist/cjs/vite/{clientTreeShakePlugin.js.map → clientTreeShakePlugin.cjs.map} +0 -0
  348. /package/dist/cjs/vite/{constants.js.map → constants.cjs.map} +0 -0
  349. /package/dist/cjs/vite/{createFileSystemRouter.js.map → createFileSystemRouter.cjs.map} +0 -0
  350. /package/dist/cjs/vite/{customNodeExternals.js.map → customNodeExternals.cjs.map} +0 -0
  351. /package/dist/cjs/vite/{ensureTsConfig.js.map → ensureTsConfig.cjs.map} +0 -0
  352. /package/dist/cjs/vite/{findDepsToOptimize.js.map → findDepsToOptimize.cjs.map} +0 -0
  353. /package/dist/cjs/vite/{fixDependenciesPlugin.js.map → fixDependenciesPlugin.cjs.map} +0 -0
  354. /package/dist/cjs/vite/{generateTypesForRoutes.js.map → generateTypesForRoutes.cjs.map} +0 -0
  355. /package/dist/cjs/vite/{getManifest.js.map → getManifest.cjs.map} +0 -0
  356. /package/dist/cjs/vite/{headers.js.map → headers.cjs.map} +0 -0
  357. /package/dist/cjs/vite/{loadEnv.js.map → loadEnv.cjs.map} +0 -0
  358. /package/dist/cjs/vite/{makePluginWebOnly.js.map → makePluginWebOnly.cjs.map} +0 -0
  359. /package/dist/cjs/vite/{one.js.map → one.cjs.map} +0 -0
  360. /package/dist/cjs/vite/{removeReactNativeWebAnimatedPlugin.js.map → removeReactNativeWebAnimatedPlugin.cjs.map} +0 -0
  361. /package/dist/cjs/vite/{replaceLoader.js.map → replaceLoader.cjs.map} +0 -0
  362. /package/dist/cjs/vite/{resolveAPIRequest.js.map → resolveAPIRequest.cjs.map} +0 -0
  363. /package/dist/cjs/vite/{server.js.map → server.cjs.map} +0 -0
  364. /package/dist/cjs/vite/{types.js.map → types.cjs.map} +0 -0
  365. /package/dist/cjs/vite/{virtualEntryPlugin.js.map → virtualEntryPlugin.cjs.map} +0 -0
  366. /package/dist/cjs/vite/{vitePluginSsrCss.js.map → vitePluginSsrCss.cjs.map} +0 -0
  367. /package/dist/cjs/{vite.js.map → vite.cjs.map} +0 -0
  368. /package/dist/cjs/zero/{getQueryKey.js.map → getQueryKey.cjs.map} +0 -0
  369. /package/dist/cjs/zero/{isZeroQuery.js.map → isZeroQuery.cjs.map} +0 -0
  370. /package/dist/cjs/zero/{resolveQuery.js.map → resolveQuery.cjs.map} +0 -0
  371. /package/dist/cjs/zero/{subscribeToQuery.js.map → subscribeToQuery.cjs.map} +0 -0
  372. /package/dist/cjs/zero/{types.js.map → types.cjs.map} +0 -0
  373. /package/dist/cjs/zero/{useQuery.js.map → useQuery.cjs.map} +0 -0
  374. /package/dist/cjs/zero/{useQueryZero.js.map → useQueryZero.cjs.map} +0 -0
  375. /package/dist/cjs/{zero.js.map → zero.cjs.map} +0 -0
@@ -0,0 +1,126 @@
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,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var useLinking_native_exports = {};
33
+ __export(useLinking_native_exports, {
34
+ default: () => useLinking
35
+ });
36
+ module.exports = __toCommonJS(useLinking_native_exports);
37
+ var import_core = require("@react-navigation/core"),
38
+ React = __toESM(require("react"), 1),
39
+ import_react_native = require("react-native-web"),
40
+ import_extractPathFromURL = require("./extractPathFromURL.cjs");
41
+ const linkingHandlers = [];
42
+ function useLinking(ref, {
43
+ // enabled = true,
44
+ // prefixes,
45
+ filter,
46
+ config,
47
+ getInitialURL = () => Promise.race([import_react_native.Linking.getInitialURL(), new Promise(resolve =>
48
+ // Timeout in 150ms if `getInitialState` doesn't resolve
49
+ // Workaround for https://github.com/facebook/react-native/issues/25675
50
+ setTimeout(resolve, 150))]),
51
+ subscribe = listener => {
52
+ const callback = ({
53
+ url
54
+ }) => listener(url),
55
+ subscription = import_react_native.Linking.addEventListener("url", callback);
56
+ return () => {
57
+ subscription?.remove();
58
+ };
59
+ },
60
+ getStateFromPath = import_core.getStateFromPath,
61
+ getActionFromState = import_core.getActionFromState
62
+ }) {
63
+ React.useEffect(() => {
64
+ if (process.env.NODE_ENV === "production") return;
65
+ // enabled !== false &&
66
+ linkingHandlers.length && console.error(["Looks like you have configured linking in multiple places. This is likely an error since deep links should only be handled in one place to avoid conflicts. Make sure that:", "- You don't have multiple NavigationContainers in the app each with 'linking' enabled", "- Only a single instance of the root component is rendered", import_react_native.Platform.OS === "android" ? "- You have set 'android:launchMode=singleTask' in the '<activity />' section of the 'AndroidManifest.xml' file to avoid launching multiple instances" : ""].join(`
67
+ `).trim());
68
+ const handler = Symbol();
69
+ return linkingHandlers.push(handler), () => {
70
+ const index = linkingHandlers.indexOf(handler);
71
+ index > -1 && linkingHandlers.splice(index, 1);
72
+ };
73
+ }, [
74
+ // enabled,
75
+ // independent
76
+ ]);
77
+ const filterRef = React.useRef(filter),
78
+ configRef = React.useRef(config),
79
+ getInitialURLRef = React.useRef(getInitialURL),
80
+ getStateFromPathRef = React.useRef(getStateFromPath),
81
+ getActionFromStateRef = React.useRef(getActionFromState);
82
+ React.useEffect(() => {
83
+ filterRef.current = filter, configRef.current = config, getInitialURLRef.current = getInitialURL, getStateFromPathRef.current = getStateFromPath, getActionFromStateRef.current = getActionFromState;
84
+ });
85
+ const getStateFromURL = React.useCallback(url => {
86
+ if (!url || filterRef.current && !filterRef.current(url)) return;
87
+ const path = (0, import_extractPathFromURL.extractExpoPathFromURL)(url);
88
+ return path !== void 0 ? getStateFromPathRef.current(path, configRef.current) : void 0;
89
+ }, []),
90
+ getInitialState = React.useCallback(() => {
91
+ const url = getInitialURLRef.current();
92
+ if (url != null && typeof url != "string") return url.then(url2 => getStateFromURL(url2));
93
+ const state = getStateFromURL(url),
94
+ thenable = {
95
+ // biome-ignore lint/suspicious/noThenProperty: <explanation>
96
+ then(onfulfilled) {
97
+ return onfulfilled?.(state), thenable;
98
+ },
99
+ catch() {
100
+ return thenable;
101
+ }
102
+ };
103
+ return thenable;
104
+ }, [getStateFromURL]);
105
+ return React.useEffect(() => subscribe(url => {
106
+ const navigation = ref.current,
107
+ state = navigation ? getStateFromURL(url) : void 0;
108
+ if (navigation && state) {
109
+ const rootState = navigation.getRootState();
110
+ if (state.routes.some(r => !rootState?.routeNames.includes(r.name))) {
111
+ console.warn("The navigation state parsed from the URL contains routes not present in the root navigator. This usually means that the linking configuration doesn't match the navigation structure. See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.");
112
+ return;
113
+ }
114
+ const action = getActionFromStateRef.current(state, configRef.current);
115
+ if (action !== void 0) try {
116
+ navigation.dispatch(action);
117
+ } catch (e) {
118
+ console.warn(`An error occurred when trying to handle the link '${url}': ${typeof e == "object" && e != null && "message" in e ? e.message : e}`);
119
+ } else navigation.resetRoot(state);
120
+ }
121
+ }), [
122
+ // enabled,
123
+ getStateFromURL, ref, subscribe]), {
124
+ getInitialState
125
+ };
126
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/fork/useLinking.native.ts"],
4
+ "mappings": "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",
5
+ "names": ["getStateFromPathDefault", "getActionFromStateDefault", "url"]
6
+ }
@@ -0,0 +1,44 @@
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) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var validatePathConfig_exports = {};
22
+ __export(validatePathConfig_exports, {
23
+ default: () => validatePathConfig
24
+ });
25
+ module.exports = __toCommonJS(validatePathConfig_exports);
26
+ const formatToList = items => items.map(key => `- ${key}`).join(`
27
+ `);
28
+ function validatePathConfig(config, root = !0) {
29
+ const validKeys = ["initialRouteName", "screens", "_route"];
30
+ root || validKeys.push("path", "exact", "stringify", "parse");
31
+ const invalidKeys = Object.keys(config).filter(key => !validKeys.includes(key));
32
+ if (invalidKeys.length) throw new Error(`Found invalid properties in the configuration:
33
+ ${formatToList(invalidKeys)}
34
+
35
+ Did you forget to specify them under a 'screens' property?
36
+
37
+ You can only specify the following properties:
38
+ ${formatToList(validKeys)}
39
+
40
+ See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.`);
41
+ config.screens && Object.entries(config.screens).forEach(([_, value]) => {
42
+ typeof value != "string" && validatePathConfig(value, !1);
43
+ });
44
+ }
@@ -3,15 +3,21 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
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);
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
15
21
  var getLinkingConfig_exports = {};
16
22
  __export(getLinkingConfig_exports, {
17
23
  getLinkingConfig: () => getLinkingConfig,
@@ -19,7 +25,9 @@ __export(getLinkingConfig_exports, {
19
25
  stateCache: () => stateCache
20
26
  });
21
27
  module.exports = __toCommonJS(getLinkingConfig_exports);
22
- var import_native = require("@react-navigation/native"), import_getReactNavigationConfig = require("./getReactNavigationConfig"), import_linking = require("./link/linking");
28
+ var import_native = require("@react-navigation/native"),
29
+ import_getReactNavigationConfig = require("./getReactNavigationConfig.cjs"),
30
+ import_linking = require("./link/linking.cjs");
23
31
  function getNavigationConfig(routes, metaOnly = !0) {
24
32
  return (0, import_getReactNavigationConfig.getReactNavigationConfig)(routes, metaOnly);
25
33
  }
@@ -48,12 +56,10 @@ function getLinkingConfig(routes, metaOnly = !0) {
48
56
  getActionFromState: import_native.getActionFromState
49
57
  };
50
58
  }
51
- const stateCache = /* @__PURE__ */ new Map();
59
+ const stateCache = /* @__PURE__ */new Map();
52
60
  function getStateFromPathMemoized(path, options) {
53
61
  const cached = stateCache.get(path);
54
- if (cached)
55
- return cached;
62
+ if (cached) return cached;
56
63
  const result = (0, import_linking.getStateFromPath)(path, options);
57
64
  return stateCache.set(path, result), result;
58
- }
59
- //# sourceMappingURL=getLinkingConfig.js.map
65
+ }
@@ -3,28 +3,32 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
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);
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
15
21
  var getReactNavigationConfig_exports = {};
16
22
  __export(getReactNavigationConfig_exports, {
17
23
  getReactNavigationConfig: () => getReactNavigationConfig,
18
24
  getReactNavigationScreensConfig: () => getReactNavigationScreensConfig
19
25
  });
20
26
  module.exports = __toCommonJS(getReactNavigationConfig_exports);
21
- var import_matchers = require("./matchers");
27
+ var import_matchers = require("./matchers.cjs");
22
28
  function convertDynamicRouteToReactNavigation(segment) {
23
- if (segment === "index")
24
- return "";
29
+ if (segment === "index") return "";
25
30
  const rest = (0, import_matchers.matchDeepDynamicRouteName)(segment);
26
- if (rest != null)
27
- return "*" + rest;
31
+ if (rest != null) return "*" + rest;
28
32
  const dynamicName = (0, import_matchers.matchDynamicName)(segment);
29
33
  return dynamicName != null ? `:${dynamicName}` : segment;
30
34
  }
@@ -38,32 +42,29 @@ function parseRouteSegments(segments) {
38
42
  }
39
43
  function convertRouteNodeToScreen(node, metaOnly) {
40
44
  const path = parseRouteSegments(node.route);
41
- if (!node.children.length)
42
- return metaOnly ? path : {
43
- path,
44
- screens: {},
45
- _route: node
46
- };
47
- const screens = getReactNavigationScreensConfig(node.children, metaOnly), screen = {
45
+ if (!node.children.length) return metaOnly ? path : {
48
46
  path,
49
- screens,
50
- // NOTE: This is bad because it forces all Layout Routes
51
- // to be loaded into memory. We should move towards a system where
52
- // the initial route name is either loaded asynchronously in the Layout Route
53
- // or defined via a file system convention.
54
- initialRouteName: node.initialRouteName
47
+ screens: {},
48
+ _route: node
55
49
  };
50
+ const screens = getReactNavigationScreensConfig(node.children, metaOnly),
51
+ screen = {
52
+ path,
53
+ screens,
54
+ // NOTE: This is bad because it forces all Layout Routes
55
+ // to be loaded into memory. We should move towards a system where
56
+ // the initial route name is either loaded asynchronously in the Layout Route
57
+ // or defined via a file system convention.
58
+ initialRouteName: node.initialRouteName
59
+ };
56
60
  return metaOnly || (screen._route = node), screen;
57
61
  }
58
62
  function getReactNavigationScreensConfig(nodes, metaOnly) {
59
- return Object.fromEntries(
60
- nodes.map((node) => [node.route, convertRouteNodeToScreen(node, metaOnly)])
61
- );
63
+ return Object.fromEntries(nodes.map(node => [node.route, convertRouteNodeToScreen(node, metaOnly)]));
62
64
  }
63
65
  function getReactNavigationConfig(routes, metaOnly) {
64
66
  return {
65
67
  initialRouteName: routes.initialRouteName,
66
68
  screens: getReactNavigationScreensConfig(routes.children, metaOnly)
67
69
  };
68
- }
69
- //# sourceMappingURL=getReactNavigationConfig.js.map
70
+ }
@@ -0,0 +1,276 @@
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) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var getRoutes_exports = {};
22
+ __export(getRoutes_exports, {
23
+ extrapolateGroups: () => extrapolateGroups,
24
+ generateDynamic: () => generateDynamic,
25
+ getExactRoutes: () => getExactRoutes,
26
+ getIgnoreList: () => getIgnoreList,
27
+ getRoutes: () => getRoutes
28
+ });
29
+ module.exports = __toCommonJS(getRoutes_exports);
30
+ var import_config = require("./config.cjs"),
31
+ import_matchers = require("./matchers.cjs"),
32
+ import_getPageExport = require("./utils/getPageExport.cjs");
33
+ const validPlatforms = /* @__PURE__ */new Set(["android", "ios", "native", "web"]);
34
+ function getRoutes(contextModule, options = {}) {
35
+ const directoryTree = getDirectoryTree(contextModule, options);
36
+ if (!directoryTree) return null;
37
+ const rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
38
+ return options.ignoreEntryPoints || crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options), rootNode;
39
+ }
40
+ function getExactRoutes(contextModule, options = {}) {
41
+ return getRoutes(contextModule, {
42
+ ...options,
43
+ skipGenerated: !0
44
+ });
45
+ }
46
+ function getDirectoryTree(contextModule, options) {
47
+ const importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE,
48
+ ignoreList = [/^\.\/\+html\.[tj]sx?$/];
49
+ options.ignore && ignoreList.push(...options.ignore), options.preserveApiRoutes || ignoreList.push(/\+api\.[tj]sx?$/);
50
+ const rootDirectory = {
51
+ files: /* @__PURE__ */new Map(),
52
+ subdirectories: /* @__PURE__ */new Map()
53
+ };
54
+ let hasRoutes = !1,
55
+ isValid = !1;
56
+ for (const filePath of contextModule.keys()) {
57
+ if (ignoreList.some(regex => regex.test(filePath))) continue;
58
+ isValid = !0;
59
+ const meta = getFileMeta(filePath, options);
60
+ if (meta.specificity < 0) continue;
61
+ const type = meta.isLayout ? "layout" : meta.renderMode || (0, import_config.getDefaultRenderMode)();
62
+ let node = {
63
+ type,
64
+ loadRoute() {
65
+ if (options.ignoreRequireErrors) try {
66
+ return contextModule(filePath);
67
+ } catch {
68
+ return {};
69
+ } else return contextModule(filePath);
70
+ },
71
+ contextKey: filePath,
72
+ route: "",
73
+ // This is overwritten during hoisting based upon the _layout
74
+ dynamic: null,
75
+ children: []
76
+ // While we are building the directory tree, we don't know the node's children just yet. This is added during hoisting
77
+ };
78
+ if (!(process.env.NODE_ENV === "development" && node.type !== "api" && importMode === "sync" && !(0, import_getPageExport.getPageExport)(node.loadRoute()))) for (const route of extrapolateGroups(meta.route)) {
79
+ const subdirectoryParts = route.split("/").slice(0, -1);
80
+ let directory = rootDirectory;
81
+ for (const part of subdirectoryParts) {
82
+ let subDirectory = directory.subdirectories.get(part);
83
+ subDirectory || (subDirectory = {
84
+ files: /* @__PURE__ */new Map(),
85
+ subdirectories: /* @__PURE__ */new Map()
86
+ }, directory.subdirectories.set(part, subDirectory)), directory = subDirectory;
87
+ }
88
+ if (node = {
89
+ ...node,
90
+ route
91
+ }, meta.isLayout) {
92
+ directory.layout ??= [];
93
+ const existing = directory.layout[meta.specificity];
94
+ if (existing) {
95
+ if (process.env.NODE_ENV !== "production") throw new Error(`The layouts "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
96
+ } else node = getLayoutNode(node, options), directory.layout[meta.specificity] = node;
97
+ } else if (type === "api") {
98
+ const fileKey = `${route}+api`;
99
+ let nodes = directory.files.get(fileKey);
100
+ nodes || (nodes = [], directory.files.set(fileKey, nodes));
101
+ const existing = nodes[0];
102
+ if (existing) {
103
+ if (process.env.NODE_ENV !== "production") throw new Error(`The API route file "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
104
+ } else nodes[0] = node;
105
+ } else {
106
+ let nodes = directory.files.get(route);
107
+ nodes || (nodes = [], directory.files.set(route, nodes));
108
+ const existing = nodes[meta.specificity];
109
+ if (existing) {
110
+ if (process.env.NODE_ENV !== "production") throw new Error(`The route files "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
111
+ } else hasRoutes ||= !0, nodes[meta.specificity] = node;
112
+ }
113
+ }
114
+ }
115
+ return isValid ? (rootDirectory.layout || (rootDirectory.layout = [{
116
+ type: "layout",
117
+ loadRoute: () => ({
118
+ default: require("./views/Navigator.cjs").DefaultNavigator
119
+ }),
120
+ // Generate a fake file name for the directory
121
+ contextKey: "router/build/views/Navigator.js",
122
+ route: "",
123
+ generated: !0,
124
+ dynamic: null,
125
+ children: []
126
+ }]), options.skipGenerated || (hasRoutes && appendSitemapRoute(rootDirectory), appendNotFoundRoute(rootDirectory)), rootDirectory) : null;
127
+ }
128
+ function flattenDirectoryTreeToRoutes(directory, options, layout, pathToRemove = "") {
129
+ if (directory.layout) {
130
+ const previousLayout = layout;
131
+ layout = getMostSpecific(directory.layout), previousLayout && previousLayout.children.push(layout), options.internal_stripLoadRoute && delete layout.loadRoute;
132
+ const newRoute = layout.route.replace(pathToRemove, "");
133
+ pathToRemove = layout.route ? `${layout.route}/` : "", layout.route = newRoute, layout.dynamic = generateDynamic(layout.route);
134
+ }
135
+ if (!layout) throw new Error("One Internal Error: No nearest layout");
136
+ for (const routes of directory.files.values()) {
137
+ const routeNode = getMostSpecific(routes);
138
+ routeNode.route = routeNode.route.replace(pathToRemove, ""), routeNode.dynamic = generateDynamic(routeNode.route), options.internal_stripLoadRoute && delete routeNode.loadRoute, layout.children.push(routeNode);
139
+ }
140
+ for (const child of directory.subdirectories.values()) flattenDirectoryTreeToRoutes(child, options, layout, pathToRemove);
141
+ return layout;
142
+ }
143
+ function getFileMeta(key, options) {
144
+ key = key.replace(/^\.\//, "");
145
+ const parts = key.split("/");
146
+ let route = (0, import_matchers.removeSupportedExtensions)(key);
147
+ const filename = parts[parts.length - 1],
148
+ filenameWithoutExtensions = (0, import_matchers.removeSupportedExtensions)(filename),
149
+ isLayout = filenameWithoutExtensions.startsWith("_layout"),
150
+ [_fullname, renderModeFound] = filename.match(/\+(api|ssg|ssr|spa)\.(\w+\.)?[jt]sx?$/) || [],
151
+ renderMode = renderModeFound;
152
+ if (filenameWithoutExtensions.startsWith("(") && filenameWithoutExtensions.endsWith(")")) throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);
153
+ if (renderMode !== "api" && filename.startsWith("+") && filenameWithoutExtensions !== "+not-found") {
154
+ const renamedRoute = [...parts.slice(0, -1), filename.slice(1)].join("/");
155
+ throw new Error(`Invalid route ./${key}. Route nodes cannot start with the '+' character. "Please rename to ${renamedRoute}"`);
156
+ }
157
+ let specificity = 0;
158
+ const platformExtension = filenameWithoutExtensions.split(".")[1],
159
+ hasPlatformExtension = validPlatforms.has(platformExtension),
160
+ usePlatformRoutes = options.platformRoutes ?? !0;
161
+ if (hasPlatformExtension) {
162
+ if (usePlatformRoutes && options.platform ? platformExtension === options.platform ? specificity = 2 : platformExtension === "native" && options.platform !== "web" ? specificity = 1 : platformExtension !== options.platform && (specificity = -1) : specificity = -1, renderMode === "api" && specificity !== 0) throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);
163
+ route = route.replace(new RegExp(`.${platformExtension}$`), "");
164
+ }
165
+ return {
166
+ route,
167
+ specificity,
168
+ isLayout,
169
+ renderMode
170
+ };
171
+ }
172
+ function getMostSpecific(routes) {
173
+ const route = routes[routes.length - 1];
174
+ if (!routes[0]) throw new Error(` [one] The file ${route.contextKey} does not have a fallback sibling file without a platform extension in routes (${routes[0]}, ${routes.length}):
175
+ ${routes.map(r => r.contextKey || "NONE").join(`
176
+ `)}.`);
177
+ return routes[routes.length - 1];
178
+ }
179
+ function getIgnoreList(options) {
180
+ const ignore = [/^\.\/\+html\.[tj]sx?$/, ...(options?.ignore ?? [])];
181
+ return options?.preserveApiRoutes !== !0 && ignore.push(/\+api\.[tj]sx?$/), ignore;
182
+ }
183
+ function extrapolateGroups(key, keys = /* @__PURE__ */new Set()) {
184
+ const match = (0, import_matchers.matchArrayGroupName)(key);
185
+ if (!match) return keys.add(key), keys;
186
+ const groups = match.split(",");
187
+ if (new Set(groups).size !== groups.length) throw new Error(`Array syntax cannot contain duplicate group name "${groups}" in "${key}".`);
188
+ if (groups.length === 1) return keys.add(key), keys;
189
+ for (const group of groups) extrapolateGroups(key.replace(match, group.trim()), keys);
190
+ return keys;
191
+ }
192
+ function generateDynamic(path) {
193
+ const dynamic = path.split("/").map(part => {
194
+ if (part === "+not-found") return {
195
+ name: "+not-found",
196
+ deep: !0,
197
+ notFound: !0
198
+ };
199
+ const deepDynamicName = (0, import_matchers.matchDeepDynamicRouteName)(part),
200
+ dynamicName = deepDynamicName ?? (0, import_matchers.matchDynamicName)(part);
201
+ return dynamicName ? {
202
+ name: dynamicName,
203
+ deep: !!deepDynamicName
204
+ } : null;
205
+ }).filter(part => !!part);
206
+ return dynamic.length === 0 ? null : dynamic;
207
+ }
208
+ function appendSitemapRoute(directory) {
209
+ directory.files.has("_sitemap") || directory.files.set("_sitemap", [{
210
+ loadRoute() {
211
+ return {
212
+ default: () => null,
213
+ getNavOptions: () => {}
214
+ };
215
+ },
216
+ route: "_sitemap",
217
+ type: "ssg",
218
+ contextKey: "",
219
+ generated: !0,
220
+ internal: !0,
221
+ dynamic: null,
222
+ children: []
223
+ }]);
224
+ }
225
+ function appendNotFoundRoute(directory) {
226
+ directory.files.has("+not-found") || directory.files.set("+not-found", [{
227
+ loadRoute() {
228
+ return {
229
+ default: () => null
230
+ };
231
+ },
232
+ type: "spa",
233
+ route: "+not-found",
234
+ contextKey: "",
235
+ generated: !0,
236
+ internal: !0,
237
+ dynamic: [{
238
+ name: "+not-found",
239
+ deep: !0,
240
+ notFound: !0
241
+ }],
242
+ children: []
243
+ }]);
244
+ }
245
+ function getLayoutNode(node, options) {
246
+ const groupName = (0, import_matchers.matchGroupName)(node.route);
247
+ let initialRouteName = node.children.find(child => child.route.replace(/\/index$/, "") === groupName)?.route;
248
+ return {
249
+ ...node,
250
+ route: node.route.replace(/\/?_layout$/, ""),
251
+ children: [],
252
+ // Each layout should have its own children
253
+ initialRouteName
254
+ };
255
+ }
256
+ function crawlAndAppendInitialRoutesAndEntryFiles(node, options, entryPoints = []) {
257
+ if (node.type === "spa" || node.type === "ssg" || node.type === "ssr") node.entryPoints = [... /* @__PURE__ */new Set([...entryPoints, node.contextKey])];else if (node.type === "layout") {
258
+ if (!node.children) throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
259
+ entryPoints = [...entryPoints, node.contextKey];
260
+ const groupName = (0, import_matchers.matchGroupName)(node.route);
261
+ let initialRouteName = node.children.find(child => child.route.replace(/\/index$/, "") === groupName)?.route;
262
+ if (!options.internal_stripLoadRoute) {
263
+ const loaded = node.loadRoute();
264
+ loaded?.unstable_settings && (initialRouteName = loaded.unstable_settings.initialRouteName ?? initialRouteName, groupName && (initialRouteName = loaded.unstable_settings?.[groupName]?.initialRouteName ?? initialRouteName));
265
+ }
266
+ if (initialRouteName) {
267
+ const initialRoute = node.children.find(child => child.route === initialRouteName);
268
+ if (!initialRoute) {
269
+ const validInitialRoutes = node.children.filter(child => !child.generated).map(child => `'${child.route}'`).join(", ");
270
+ throw groupName ? new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`) : new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`);
271
+ }
272
+ node.initialRouteName = initialRouteName, entryPoints.push(initialRoute.contextKey);
273
+ }
274
+ for (const child of node.children) crawlAndAppendInitialRoutesAndEntryFiles(child, options, entryPoints);
275
+ }
276
+ }
@@ -3,15 +3,21 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
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);
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
15
21
  var getURL_exports = {};
16
22
  __export(getURL_exports, {
17
23
  getURL: () => getURL
@@ -20,5 +26,4 @@ module.exports = __toCommonJS(getURL_exports);
20
26
  const CLIENT_BASE_URL = typeof window < "u" && window.location ? `${window.location.protocol}//${window.location.host}` : "";
21
27
  function getURL() {
22
28
  return CLIENT_BASE_URL || process.env.ONE_SERVER_URL || "";
23
- }
24
- //# sourceMappingURL=getURL.js.map
29
+ }