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,31 @@
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 lastAction_exports = {};
22
+ __export(lastAction_exports, {
23
+ getLastAction: () => getLastAction,
24
+ setLastAction: () => setLastAction
25
+ });
26
+ module.exports = __toCommonJS(lastAction_exports);
27
+ let lastUserRouteAction = Date.now();
28
+ const getLastAction = () => lastUserRouteAction,
29
+ setLastAction = () => {
30
+ lastUserRouteAction = Date.now();
31
+ };
@@ -2,24 +2,33 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
6
7
  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
- };
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
+ };
15
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
21
  // If the importer is in node compatibility mode or this is not an ESM
17
22
  // file that has been converted to a CommonJS file using a Babel-
18
23
  // compatible transform (i.e. "__esModule" has not been set), then set
19
24
  // "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);
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);
23
32
  var router_exports = {};
24
33
  __export(router_exports, {
25
34
  canDismiss: () => canDismiss,
@@ -59,25 +68,53 @@ __export(router_exports, {
59
68
  useStoreRouteInfo: () => useStoreRouteInfo
60
69
  });
61
70
  module.exports = __toCommonJS(router_exports);
62
- var import_native = require("@react-navigation/native"), Linking = __toESM(require("expo-linking"), 1), import_non_secure = require("nanoid/non-secure"), import_react = require("react"), import_react_native = require("react-native-web"), import_cleanUrl = require("../cleanUrl"), import_getPathFromState = require("../fork/getPathFromState"), import_getStateFromPath = require("../fork/getStateFromPath"), import_getLinkingConfig = require("../getLinkingConfig"), import_getRoutes = require("../getRoutes"), import_href = require("../link/href"), import_path = require("../link/path"), import_matchers = require("../matchers"), import_sortRoutes = require("../sortRoutes"), import_useScreens = require("../useScreens"), import_assertIsReady = require("../utils/assertIsReady"), import_dynamicImport = require("../utils/dynamicImport"), import_removeSearch = require("../utils/removeSearch"), import_url = require("../utils/url"), import_getNormalizedStatePath = require("./getNormalizedStatePath"), import_lastAction = require("./lastAction");
63
- let routeNode = null, rootComponent, linking, hasAttemptedToHideSplash = !1, initialState, rootState, nextState, routeInfo, splashScreenAnimationFrame, navigationRef = null, navigationRefSubscription;
64
- const rootStateSubscribers = /* @__PURE__ */ new Set(), loadingStateSubscribers = /* @__PURE__ */ new Set(), storeSubscribers = /* @__PURE__ */ new Set();
71
+ var import_native = require("@react-navigation/native"),
72
+ Linking = __toESM(require("expo-linking"), 1),
73
+ import_non_secure = require("nanoid/non-secure"),
74
+ import_react = require("react"),
75
+ import_react_native = require("react-native-web"),
76
+ import_cleanUrl = require("../cleanUrl.cjs"),
77
+ import_getPathFromState = require("../fork/getPathFromState.cjs"),
78
+ import_getStateFromPath = require("../fork/getStateFromPath.cjs"),
79
+ import_getLinkingConfig = require("../getLinkingConfig.cjs"),
80
+ import_getRoutes = require("../getRoutes.cjs"),
81
+ import_href = require("../link/href.cjs"),
82
+ import_path = require("../link/path.cjs"),
83
+ import_matchers = require("../matchers.cjs"),
84
+ import_sortRoutes = require("../sortRoutes.cjs"),
85
+ import_useScreens = require("../useScreens.cjs"),
86
+ import_assertIsReady = require("../utils/assertIsReady.cjs"),
87
+ import_dynamicImport = require("../utils/dynamicImport.cjs"),
88
+ import_removeSearch = require("../utils/removeSearch.cjs"),
89
+ import_url = require("../utils/url.cjs"),
90
+ import_getNormalizedStatePath = require("./getNormalizedStatePath.cjs"),
91
+ import_lastAction = require("./lastAction.cjs");
92
+ let routeNode = null,
93
+ rootComponent,
94
+ linking,
95
+ hasAttemptedToHideSplash = !1,
96
+ initialState,
97
+ rootState,
98
+ nextState,
99
+ routeInfo,
100
+ splashScreenAnimationFrame,
101
+ navigationRef = null,
102
+ navigationRefSubscription;
103
+ const rootStateSubscribers = /* @__PURE__ */new Set(),
104
+ loadingStateSubscribers = /* @__PURE__ */new Set(),
105
+ storeSubscribers = /* @__PURE__ */new Set();
65
106
  function initialize(context, ref, initialLocation) {
66
107
  if (cleanUpState(), routeNode = (0, import_getRoutes.getRoutes)(context, {
67
108
  ignoreEntryPoints: !0,
68
109
  platform: import_react_native.Platform.OS
69
- }), rootComponent = routeNode ? (0, import_useScreens.getQualifiedRouteComponent)(routeNode) : import_react.Fragment, !routeNode && process.env.NODE_ENV === "production")
70
- throw new Error("No routes found");
110
+ }), rootComponent = routeNode ? (0, import_useScreens.getQualifiedRouteComponent)(routeNode) : import_react.Fragment, !routeNode && process.env.NODE_ENV === "production") throw new Error("No routes found");
71
111
  navigationRef = ref, setupLinking(initialLocation), subscribeToNavigationChanges();
72
112
  }
73
113
  function cleanUpState() {
74
114
  initialState = void 0, rootState = void 0, nextState = void 0, routeInfo = void 0, linking = void 0, navigationRefSubscription?.(), rootStateSubscribers.clear(), storeSubscribers.clear();
75
115
  }
76
116
  function setupLinking(initialLocation) {
77
- routeNode && (linking = (0, import_getLinkingConfig.getLinkingConfig)(routeNode), initialLocation && (linking.getInitialURL = () => initialLocation.toString(), initialState = linking.getStateFromPath?.(
78
- initialLocation.pathname + (initialLocation.search || ""),
79
- linking.config
80
- ))), initialState ? (rootState = initialState, routeInfo = getRouteInfo(initialState)) : routeInfo = {
117
+ routeNode && (linking = (0, import_getLinkingConfig.getLinkingConfig)(routeNode), initialLocation && (linking.getInitialURL = () => initialLocation.toString(), initialState = linking.getStateFromPath?.(initialLocation.pathname + (initialLocation.search || ""), linking.config))), initialState ? (rootState = initialState, routeInfo = getRouteInfo(initialState)) : routeInfo = {
81
118
  unstable_globalHref: "",
82
119
  pathname: "",
83
120
  isIndex: !1,
@@ -86,17 +123,13 @@ function setupLinking(initialLocation) {
86
123
  };
87
124
  }
88
125
  function subscribeToNavigationChanges() {
89
- navigationRefSubscription = navigationRef.addListener("state", (data) => {
126
+ navigationRefSubscription = navigationRef.addListener("state", data => {
90
127
  const state = data.data.state;
91
- hasAttemptedToHideSplash || (hasAttemptedToHideSplash = !0, splashScreenAnimationFrame = requestAnimationFrame(() => {
92
- })), nextOptions && (state.linkOptions = nextOptions, nextOptions = null);
128
+ hasAttemptedToHideSplash || (hasAttemptedToHideSplash = !0, splashScreenAnimationFrame = requestAnimationFrame(() => {})), nextOptions && (state.linkOptions = nextOptions, nextOptions = null);
93
129
  let shouldUpdateSubscribers = nextState === state;
94
- if (nextState = void 0, state && state !== rootState && (updateState(state, void 0), shouldUpdateSubscribers = !0), shouldUpdateSubscribers)
95
- for (const subscriber of rootStateSubscribers)
96
- subscriber(state);
130
+ if (nextState = void 0, state && state !== rootState && (updateState(state, void 0), shouldUpdateSubscribers = !0), shouldUpdateSubscribers) for (const subscriber of rootStateSubscribers) subscriber(state);
97
131
  }), updateSnapshot();
98
- for (const subscriber of storeSubscribers)
99
- subscriber();
132
+ for (const subscriber of storeSubscribers) subscriber();
100
133
  }
101
134
  function navigate(url, options) {
102
135
  return linkTo((0, import_href.resolveHref)(url), "NAVIGATE", options);
@@ -112,9 +145,8 @@ function replace(url, options) {
112
145
  }
113
146
  function setParams(params = {}) {
114
147
  return (0, import_assertIsReady.assertIsReady)(navigationRef), navigationRef?.current?.setParams(
115
- // @ts-expect-error
116
- params
117
- );
148
+ // @ts-expect-error
149
+ params);
118
150
  }
119
151
  function dismissAll() {
120
152
  navigationRef?.dispatch(import_native.StackActions.popToTop());
@@ -127,19 +159,16 @@ function canGoBack() {
127
159
  }
128
160
  function canDismiss() {
129
161
  let state = rootState;
130
- for (; state; ) {
131
- if (state.type === "stack" && state.routes.length > 1)
132
- return !0;
133
- if (state.index === void 0)
134
- return !1;
162
+ for (; state;) {
163
+ if (state.type === "stack" && state.routes.length > 1) return !0;
164
+ if (state.index === void 0) return !1;
135
165
  state = state.routes?.[state.index]?.state;
136
166
  }
137
167
  return !1;
138
168
  }
139
169
  function getSortedRoutes() {
140
- if (!routeNode)
141
- throw new Error("No routes");
142
- return routeNode.children.filter((route) => !route.internal).sort(import_sortRoutes.sortRoutes);
170
+ if (!routeNode) throw new Error("No routes");
171
+ return routeNode.children.filter(route => !route.internal).sort(import_sortRoutes.sortRoutes);
143
172
  }
144
173
  function updateState(state, nextStateParam = state) {
145
174
  rootState = state, nextState = nextStateParam;
@@ -147,18 +176,18 @@ function updateState(state, nextStateParam = state) {
147
176
  (0, import_getPathFromState.deepEqual)(routeInfo, nextRouteInfo) || (routeInfo = nextRouteInfo);
148
177
  }
149
178
  function getRouteInfo(state) {
150
- return getRouteInfoFromState(
151
- (state2, asPath) => (0, import_getPathFromState.getPathDataFromState)(state2, {
152
- screens: [],
153
- ...linking?.config,
154
- preserveDynamicRoutes: asPath,
155
- preserveGroups: asPath
156
- }),
157
- state
158
- );
179
+ return getRouteInfoFromState((state2, asPath) => (0, import_getPathFromState.getPathDataFromState)(state2, {
180
+ screens: [],
181
+ ...linking?.config,
182
+ preserveDynamicRoutes: asPath,
183
+ preserveGroups: asPath
184
+ }), state);
159
185
  }
160
186
  function getRouteInfoFromState(getPathFromState, state, baseUrl) {
161
- const { path } = getPathFromState(state, !1), qualified = getPathFromState(state, !0);
187
+ const {
188
+ path
189
+ } = getPathFromState(state, !1),
190
+ qualified = getPathFromState(state, !0);
162
191
  return {
163
192
  unstable_globalHref: path,
164
193
  pathname: (0, import_getStateFromPath.stripBaseUrl)(path, baseUrl).split("?")[0],
@@ -182,8 +211,7 @@ function subscribeToLoadingState(subscriber) {
182
211
  };
183
212
  }
184
213
  function setLoadingState(state) {
185
- for (const listener of loadingStateSubscribers)
186
- listener(state);
214
+ for (const listener of loadingStateSubscribers) listener(state);
187
215
  }
188
216
  let currentSnapshot = null;
189
217
  function updateSnapshot() {
@@ -220,8 +248,7 @@ function useOneRouter() {
220
248
  return (0, import_react.useSyncExternalStore)(subscribeToStore, snapshot, snapshot);
221
249
  }
222
250
  function syncStoreRootState() {
223
- if (!navigationRef)
224
- throw new Error("No navigationRef, possible duplicate One dep");
251
+ if (!navigationRef) throw new Error("No navigationRef, possible duplicate One dep");
225
252
  if (navigationRef.isReady()) {
226
253
  const currentState = navigationRef.getRootState();
227
254
  rootState !== currentState && updateState(currentState);
@@ -250,10 +277,7 @@ function cleanup() {
250
277
  const preloadingLoader = {};
251
278
  function setupPreload(href) {
252
279
  preloadingLoader[href] || (preloadingLoader[href] = async () => {
253
- const [_preload, loader] = await Promise.all([
254
- (0, import_dynamicImport.dynamicImport)((0, import_cleanUrl.getPreloadPath)(href)),
255
- (0, import_dynamicImport.dynamicImport)((0, import_cleanUrl.getLoaderPath)(href))
256
- ]);
280
+ const [_preload, loader] = await Promise.all([(0, import_dynamicImport.dynamicImport)((0, import_cleanUrl.getPreloadPath)(href)), (0, import_dynamicImport.dynamicImport)((0, import_cleanUrl.getLoaderPath)(href))]);
257
281
  try {
258
282
  return await (await loader).loader?.();
259
283
  } catch (err) {
@@ -265,26 +289,21 @@ function preloadRoute(href) {
265
289
  process.env.NODE_ENV !== "development" && (setupPreload(href), typeof preloadingLoader[href] == "function" && preloadingLoader[href]());
266
290
  }
267
291
  async function linkTo(href, event, options) {
268
- if (href[0] === "#")
269
- return;
292
+ if (href[0] === "#") return;
270
293
  if ((0, import_url.shouldLinkExternally)(href)) {
271
294
  Linking.openURL(href);
272
295
  return;
273
296
  }
274
297
  (0, import_assertIsReady.assertIsReady)(navigationRef);
275
298
  const current = navigationRef.current;
276
- if (current == null)
277
- throw new Error(
278
- "Couldn't find a navigation object. Is your component inside NavigationContainer?"
279
- );
280
- if (!linking)
281
- throw new Error("Attempted to link to route when no routes are present");
299
+ if (current == null) throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");
300
+ if (!linking) throw new Error("Attempted to link to route when no routes are present");
282
301
  if ((0, import_lastAction.setLastAction)(), href === ".." || href === "../") {
283
302
  current.goBack();
284
303
  return;
285
304
  }
286
305
  if (href.startsWith(".")) {
287
- let base = routeInfo?.segments?.map((segment) => {
306
+ let base = routeInfo?.segments?.map(segment => {
288
307
  if (!segment.startsWith("[")) return segment;
289
308
  if (segment.startsWith("[...")) {
290
309
  segment = segment.slice(4, -1);
@@ -301,7 +320,8 @@ async function linkTo(href, event, options) {
301
320
  return;
302
321
  }
303
322
  setLoadingState("loading"), globalThis.__vxrntodopath = (0, import_removeSearch.removeSearch)(href), preloadRoute(href);
304
- const rootState2 = navigationRef.getRootState(), action = getNavigateAction(state, rootState2, event);
323
+ const rootState2 = navigationRef.getRootState(),
324
+ action = getNavigateAction(state, rootState2, event);
305
325
  nextOptions = options ?? null, (0, import_react.startTransition)(() => {
306
326
  const current2 = navigationRef.getCurrentRoute();
307
327
  navigationRef.dispatch(action);
@@ -320,18 +340,25 @@ async function linkTo(href, event, options) {
320
340
  let nextOptions = null;
321
341
  function getNavigateAction(actionState, navigationState, type = "NAVIGATE") {
322
342
  let actionStateRoute;
323
- for (; actionState && navigationState; ) {
343
+ for (; actionState && navigationState;) {
324
344
  const stateRoute = navigationState.routes[navigationState.index];
325
345
  actionStateRoute = actionState.routes[actionState.routes.length - 1];
326
- const childState = actionStateRoute.state, nextNavigationState = stateRoute.state, dynamicName = (0, import_matchers.matchDynamicName)(actionStateRoute.name);
327
- if (actionStateRoute.name !== stateRoute.name || !childState || !nextNavigationState || dynamicName && actionStateRoute.params?.[dynamicName] !== stateRoute.params?.[dynamicName])
328
- break;
346
+ const childState = actionStateRoute.state,
347
+ nextNavigationState = stateRoute.state,
348
+ dynamicName = (0, import_matchers.matchDynamicName)(actionStateRoute.name);
349
+ if (actionStateRoute.name !== stateRoute.name || !childState || !nextNavigationState || dynamicName && actionStateRoute.params?.[dynamicName] !== stateRoute.params?.[dynamicName]) break;
329
350
  actionState = childState, navigationState = nextNavigationState;
330
351
  }
331
- const rootPayload = { params: {} };
332
- let payload = rootPayload, params = payload.params;
333
- for (; actionStateRoute; )
334
- Object.assign(params, { ...actionStateRoute.params }), payload.screen = actionStateRoute.name, payload.params = { ...actionStateRoute.params }, actionStateRoute = actionStateRoute.state?.routes[actionStateRoute.state?.routes.length - 1], payload.params ??= {}, payload = payload.params, params = payload;
352
+ const rootPayload = {
353
+ params: {}
354
+ };
355
+ let payload = rootPayload,
356
+ params = payload.params;
357
+ for (; actionStateRoute;) Object.assign(params, {
358
+ ...actionStateRoute.params
359
+ }), payload.screen = actionStateRoute.name, payload.params = {
360
+ ...actionStateRoute.params
361
+ }, actionStateRoute = actionStateRoute.state?.routes[actionStateRoute.state?.routes.length - 1], payload.params ??= {}, payload = payload.params, params = payload;
335
362
  return type === "PUSH" && ((0, import_lastAction.setLastAction)(), type = "NAVIGATE", navigationState.type === "stack" && (rootPayload.key = `${rootPayload.name}-${(0, import_non_secure.nanoid)()}`)), type === "REPLACE" && navigationState.type === "tab" && (type = "JUMP_TO"), {
336
363
  type,
337
364
  target: navigationState.key,
@@ -341,5 +368,4 @@ function getNavigateAction(actionState, navigationState, type = "NAVIGATE") {
341
368
  params: rootPayload.params
342
369
  }
343
370
  };
344
- }
345
- //# sourceMappingURL=router.js.map
371
+ }
@@ -0,0 +1,27 @@
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 serverLocationContext_exports = {};
22
+ __export(serverLocationContext_exports, {
23
+ ServerLocationContext: () => ServerLocationContext
24
+ });
25
+ module.exports = __toCommonJS(serverLocationContext_exports);
26
+ var import_react = require("react");
27
+ const ServerLocationContext = (0, import_react.createContext)(void 0);
@@ -2,31 +2,42 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
6
7
  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
- };
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
+ };
15
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
21
  // If the importer is in node compatibility mode or this is not an ESM
17
22
  // file that has been converted to a CommonJS file using a Babel-
18
23
  // compatible transform (i.e. "__esModule" has not been set), then set
19
24
  // "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);
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);
23
32
  var useInitializeOneRouter_exports = {};
24
33
  __export(useInitializeOneRouter_exports, {
25
34
  resetState: () => resetState,
26
35
  useInitializeOneRouter: () => useInitializeOneRouter
27
36
  });
28
37
  module.exports = __toCommonJS(useInitializeOneRouter_exports);
29
- var import_native = require("@react-navigation/native"), import_router = require("./router"), routerStore = __toESM(require("./router"), 1);
38
+ var import_native = require("@react-navigation/native"),
39
+ import_router = require("./router.cjs"),
40
+ routerStore = __toESM(require("./router.cjs"), 1);
30
41
  let initialized = !1;
31
42
  function useInitializeOneRouter(context, initialLocation) {
32
43
  const navigationRef = (0, import_native.useNavigationContainerRef)();
@@ -38,6 +49,5 @@ function resetState() {
38
49
  globalThis.__vxrnresetState = resetState;
39
50
  function resetReactNavigationContexts() {
40
51
  const contexts = "__react_navigation__elements_contexts";
41
- globalThis[contexts] = /* @__PURE__ */ new Map();
42
- }
43
- //# sourceMappingURL=useInitializeOneRouter.js.map
52
+ globalThis[contexts] = /* @__PURE__ */new Map();
53
+ }
@@ -0,0 +1,185 @@
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 serve_exports = {};
33
+ __export(serve_exports, {
34
+ serve: () => serve
35
+ });
36
+ module.exports = __toCommonJS(serve_exports);
37
+ var import_polyfills_server = require("./polyfills-server.cjs"),
38
+ import_fs_extra = __toESM(require("fs-extra"), 1),
39
+ import_node_path = __toESM(require("node:path"), 1),
40
+ import_vxrn = require("vxrn"),
41
+ import_createHandleRequest = require("./createHandleRequest.cjs"),
42
+ import_isResponse = require("./utils/isResponse.cjs"),
43
+ import_isStatus = require("./utils/isStatus.cjs"),
44
+ import_removeUndefined = require("./utils/removeUndefined.cjs"),
45
+ import_resolveAPIRequest = require("./vite/resolveAPIRequest.cjs"),
46
+ import_one = require("./vite/one.cjs"),
47
+ import_label_process = require("./cli/label-process.cjs");
48
+ process.on("uncaughtException", err => {
49
+ console.error("[one] Uncaught exception", err?.stack || err);
50
+ });
51
+ async function serve(args = {}) {
52
+ (0, import_label_process.labelProcess)("serve");
53
+ const oneOptions = await (0, import_one.loadUserOneOptions)("serve");
54
+ return process.env.VXRN_REACT_19 = "1", await (0, import_vxrn.serve)({
55
+ server: {
56
+ // fallback to one plugin
57
+ ...oneOptions.server,
58
+ // override with any flags given to cli
59
+ ...(0, import_removeUndefined.removeUndefined)({
60
+ port: args.port ? +args.port : void 0,
61
+ host: args.host,
62
+ compress: args.compress,
63
+ platform: args.platform,
64
+ cacheHeaders: args.cacheHeaders
65
+ }),
66
+ async beforeStart(options, app) {
67
+ await oneOptions.server?.beforeStart?.(options, app), await oneServe(oneOptions, options, app);
68
+ }
69
+ }
70
+ });
71
+ }
72
+ async function oneServe(options, vxrnOptions, app) {
73
+ const root = options.root || vxrnOptions.root || ".",
74
+ isAPIRequest = /* @__PURE__ */new WeakMap(),
75
+ toAbsolute = p => import_node_path.default.resolve(root, p),
76
+ redirects = options.web?.redirects;
77
+ if (redirects) for (const redirect of redirects) app.get(redirect.source, context => {
78
+ const destinationUrl = redirect.destination.replace(/:\w+/g, param => {
79
+ const paramName = param.substring(1);
80
+ return context.req.param(paramName) || "";
81
+ });
82
+ return context.redirect(destinationUrl, redirect.permanent ? 301 : 302);
83
+ });
84
+ const buildInfo = await import_fs_extra.default.readJSON(toAbsolute("dist/buildInfo.json"));
85
+ if (!buildInfo) throw new Error("No build info found, have you run build?");
86
+ const {
87
+ routeMap,
88
+ builtRoutes
89
+ } = buildInfo,
90
+ routeToBuildInfo = {};
91
+ for (const route of builtRoutes) routeToBuildInfo[route.cleanPath] = route;
92
+ const serverOptions = {
93
+ ...options,
94
+ root
95
+ },
96
+ render = (await import((0, import_vxrn.getServerEntry)(serverOptions))).default.render,
97
+ apiCJS = options.build?.api?.outputFormat === "cjs",
98
+ handleRequest = (0, import_createHandleRequest.createHandleRequest)({}, {
99
+ async handleAPI({
100
+ route,
101
+ request,
102
+ loaderProps
103
+ }) {
104
+ const apiFile = (0, import_node_path.join)(process.cwd(), "dist", "api", route.page.replace("[", "_").replace("]", "_") + (apiCJS ? ".cjs" : ".js"));
105
+ return isAPIRequest.set(request, !0), (0, import_resolveAPIRequest.resolveAPIRequest)(async () => {
106
+ try {
107
+ return await import(apiFile);
108
+ } catch (err) {
109
+ return console.error(`
110
+ [one] Error importing API route at ${apiFile}:
111
+
112
+ ${err}
113
+
114
+ If this is an import error, you can likely fix this by adding this dependency to
115
+ the "optimizeDeps.include" array in your vite.config.ts.
116
+
117
+ \u{1F41E} For a better error message run "node" and enter:
118
+
119
+ import('${apiFile}')
120
+
121
+ `), {};
122
+ }
123
+ }, request, loaderProps?.params || {});
124
+ },
125
+ async handleSSR({
126
+ route,
127
+ url,
128
+ loaderProps
129
+ }) {
130
+ if (route.type === "ssr") {
131
+ const buildInfo2 = routeToBuildInfo[route.page];
132
+ if (!buildInfo2) throw new Error(`No buildinfo found for ${url}, route: ${route.page}`);
133
+ try {
134
+ const loaderData = await (await import(buildInfo2.serverJsPath)).loader?.(loaderProps),
135
+ preloads = buildInfo2.preloads,
136
+ headers = new Headers();
137
+ return headers.set("content-type", "text/html"), new Response(await render({
138
+ loaderData,
139
+ loaderProps,
140
+ path: loaderProps?.path || "/",
141
+ preloads
142
+ }), {
143
+ headers
144
+ });
145
+ } catch (err) {
146
+ console.error(`[one] Error rendering SSR route ${route.page}
147
+
148
+ ${err?.stack ?? err}
149
+
150
+ url: ${url}`);
151
+ }
152
+ }
153
+ }
154
+ }),
155
+ htmlFiles = {};
156
+ for (const key in routeMap) routeToBuildInfo[key]?.type !== "ssr" && (htmlFiles[key] = await import_fs_extra.default.readFile((0, import_node_path.join)("dist/client", routeMap[key]), "utf-8"));
157
+ app.use(async (context, next) => {
158
+ const html = htmlFiles[context.req.path];
159
+ if (html) return context.html(html);
160
+ try {
161
+ const request = context.req.raw,
162
+ response = await handleRequest.handler(request);
163
+ if (response) {
164
+ if ((0, import_isResponse.isResponse)(response)) {
165
+ if ((0, import_isStatus.isStatusRedirect)(response.status)) {
166
+ const location = `${response.headers.get("location") || ""}`;
167
+ return context.redirect(location, response.status);
168
+ }
169
+ if (isAPIRequest.get(request)) try {
170
+ response.headers.set("Cache-Control", "no-store");
171
+ } catch (err) {
172
+ console.info(`Error udpating cache header on api route "${context.req.path}" to no-store, it is ${response.headers.get("cache-control")}, continue`, err);
173
+ }
174
+ return response;
175
+ }
176
+ return context.json(response, 200, isAPIRequest.get(request) ? {
177
+ "Cache-Control": "no-store"
178
+ } : void 0);
179
+ }
180
+ } catch (err) {
181
+ console.error(` [one] Error handling request: ${err.stack}`);
182
+ }
183
+ await next();
184
+ });
185
+ }