one 1.1.298 → 1.1.299

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. package/dist/cjs/vite/replaceLoader.js +7 -1
  2. package/dist/cjs/vite/replaceLoader.js.map +1 -1
  3. package/dist/cjs/vite/replaceLoader.native.js +7 -1
  4. package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
  5. package/dist/esm/Root.native.js +110 -104
  6. package/dist/esm/Root.native.js.map +6 -1
  7. package/dist/esm/Route.native.js +12 -10
  8. package/dist/esm/Route.native.js.map +6 -1
  9. package/dist/esm/cleanUrl.native.js +12 -13
  10. package/dist/esm/cleanUrl.native.js.map +6 -1
  11. package/dist/esm/cli/label-process.native.js +5 -4
  12. package/dist/esm/cli/label-process.native.js.map +6 -1
  13. package/dist/esm/cli/main.native.js +8 -13
  14. package/dist/esm/cli/main.native.js.map +6 -1
  15. package/dist/esm/cli/prebuild.native.js +5 -5
  16. package/dist/esm/cli/prebuild.native.js.map +6 -1
  17. package/dist/esm/cli/run.native.js +21 -28
  18. package/dist/esm/cli/run.native.js.map +6 -1
  19. package/dist/esm/cli.native.js +119 -148
  20. package/dist/esm/cli.native.js.map +6 -1
  21. package/dist/esm/clientLoaderResolver.native.js +9 -6
  22. package/dist/esm/clientLoaderResolver.native.js.map +6 -1
  23. package/dist/esm/config.native.js +12 -11
  24. package/dist/esm/config.native.js.map +6 -1
  25. package/dist/esm/constants.native.js +7 -5
  26. package/dist/esm/constants.native.js.map +6 -1
  27. package/dist/esm/createApp.native.js +13 -9
  28. package/dist/esm/createApp.native.js.map +6 -1
  29. package/dist/esm/createHandleRequest.native.js +55 -64
  30. package/dist/esm/createHandleRequest.native.js.map +6 -1
  31. package/dist/esm/createRoute.native.js +16 -16
  32. package/dist/esm/createRoute.native.js.map +6 -1
  33. package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
  34. package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
  35. package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
  36. package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
  37. package/dist/esm/fork/NavigationContainer.native.js +24 -31
  38. package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
  39. package/dist/esm/fork/createMemoryHistory.native.js +99 -115
  40. package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
  41. package/dist/esm/fork/extractPathFromURL.native.js +16 -15
  42. package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
  43. package/dist/esm/fork/findFocusedRoute.native.js +6 -5
  44. package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
  45. package/dist/esm/fork/getPathFromState.native.js +127 -140
  46. package/dist/esm/fork/getPathFromState.native.js.map +6 -1
  47. package/dist/esm/fork/getStateFromPath.native.js +292 -288
  48. package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
  49. package/dist/esm/fork/useLinking.native.js +70 -61
  50. package/dist/esm/fork/useLinking.native.js.map +6 -1
  51. package/dist/esm/fork/validatePathConfig.native.js +15 -9
  52. package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
  53. package/dist/esm/getLinkingConfig.native.js +11 -6
  54. package/dist/esm/getLinkingConfig.native.js.map +6 -1
  55. package/dist/esm/getReactNavigationConfig.native.js +28 -20
  56. package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
  57. package/dist/esm/getRoutes.native.js +249 -229
  58. package/dist/esm/getRoutes.native.js.map +6 -1
  59. package/dist/esm/getURL.native.js +4 -4
  60. package/dist/esm/getURL.native.js.map +6 -1
  61. package/dist/esm/head/Head.android.js +5 -3
  62. package/dist/esm/head/Head.android.js.map +6 -1
  63. package/dist/esm/head/Head.ios.js +144 -132
  64. package/dist/esm/head/Head.ios.js.map +6 -1
  65. package/dist/esm/head/Head.native.js +7 -7
  66. package/dist/esm/head/Head.native.js.map +6 -1
  67. package/dist/esm/head/HeadModule.native.js +6 -6
  68. package/dist/esm/head/HeadModule.native.js.map +6 -1
  69. package/dist/esm/head/index.native.js +2 -2
  70. package/dist/esm/head/index.native.js.map +6 -1
  71. package/dist/esm/head/types.native.js +1 -2
  72. package/dist/esm/head/types.native.js.map +6 -1
  73. package/dist/esm/head/url.native.js +10 -8
  74. package/dist/esm/head/url.native.js.map +6 -1
  75. package/dist/esm/hooks.native.js +53 -34
  76. package/dist/esm/hooks.native.js.map +6 -1
  77. package/dist/esm/imperative-api.native.js +9 -6
  78. package/dist/esm/imperative-api.native.js.map +6 -1
  79. package/dist/esm/import-mode/index.android.js +4 -3
  80. package/dist/esm/import-mode/index.android.js.map +6 -1
  81. package/dist/esm/import-mode/index.ios.js +4 -3
  82. package/dist/esm/import-mode/index.ios.js.map +6 -1
  83. package/dist/esm/import-mode/index.native.js +3 -1
  84. package/dist/esm/import-mode/index.native.js.map +6 -1
  85. package/dist/esm/index.native.js +65 -27
  86. package/dist/esm/index.native.js.map +6 -1
  87. package/dist/esm/interfaces/router.native.js +4 -2
  88. package/dist/esm/interfaces/router.native.js.map +6 -1
  89. package/dist/esm/layouts/Drawer.native.js +7 -6
  90. package/dist/esm/layouts/Drawer.native.js.map +6 -1
  91. package/dist/esm/layouts/Stack.native.js +7 -6
  92. package/dist/esm/layouts/Stack.native.js.map +6 -1
  93. package/dist/esm/layouts/Tabs.native.js +42 -39
  94. package/dist/esm/layouts/Tabs.native.js.map +6 -1
  95. package/dist/esm/layouts/withLayoutContext.native.js +51 -48
  96. package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
  97. package/dist/esm/link/Link.native.js +62 -53
  98. package/dist/esm/link/Link.native.js.map +6 -1
  99. package/dist/esm/link/Redirect.native.js +8 -9
  100. package/dist/esm/link/Redirect.native.js.map +6 -1
  101. package/dist/esm/link/href.native.js +28 -27
  102. package/dist/esm/link/href.native.js.map +6 -1
  103. package/dist/esm/link/linking.native.js +51 -40
  104. package/dist/esm/link/linking.native.js.map +6 -1
  105. package/dist/esm/link/path.native.js +28 -19
  106. package/dist/esm/link/path.native.js.map +6 -1
  107. package/dist/esm/link/useLinkTo.native.js +22 -20
  108. package/dist/esm/link/useLinkTo.native.js.map +6 -1
  109. package/dist/esm/link/useLoadedNavigation.native.js +30 -23
  110. package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
  111. package/dist/esm/matchers.native.js +16 -3
  112. package/dist/esm/matchers.native.js.map +6 -1
  113. package/dist/esm/platform.native.js +4 -2
  114. package/dist/esm/platform.native.js.map +6 -1
  115. package/dist/esm/polyfills-mobile.native.js +4 -5
  116. package/dist/esm/polyfills-mobile.native.js.map +6 -1
  117. package/dist/esm/polyfills-server.native.js +1 -1
  118. package/dist/esm/polyfills-server.native.js.map +6 -1
  119. package/dist/esm/render.native.js +3 -1
  120. package/dist/esm/render.native.js.map +6 -1
  121. package/dist/esm/router/RouterStore.native.js +1 -2
  122. package/dist/esm/router/RouterStore.native.js.map +6 -1
  123. package/dist/esm/router/constants.native.js +4 -2
  124. package/dist/esm/router/constants.native.js.map +6 -1
  125. package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
  126. package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
  127. package/dist/esm/router/lastAction.native.js +10 -9
  128. package/dist/esm/router/lastAction.native.js.map +6 -1
  129. package/dist/esm/router/router.native.js +135 -114
  130. package/dist/esm/router/router.native.js.map +6 -1
  131. package/dist/esm/router/serverLocationContext.native.js +4 -2
  132. package/dist/esm/router/serverLocationContext.native.js.map +6 -1
  133. package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
  134. package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
  135. package/dist/esm/serve.native.js +77 -104
  136. package/dist/esm/serve.native.js.map +6 -1
  137. package/dist/esm/server/createRoutesManifest.native.js +14 -11
  138. package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
  139. package/dist/esm/server/getServerManifest.native.js +61 -67
  140. package/dist/esm/server/getServerManifest.native.js.map +6 -1
  141. package/dist/esm/server-render.native.js +9 -10
  142. package/dist/esm/server-render.native.js.map +6 -1
  143. package/dist/esm/sortRoutes.native.js +27 -17
  144. package/dist/esm/sortRoutes.native.js.map +6 -1
  145. package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
  146. package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
  147. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
  148. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
  149. package/dist/esm/types.native.js +1 -2
  150. package/dist/esm/types.native.js.map +6 -1
  151. package/dist/esm/useFocusEffect.native.js +25 -22
  152. package/dist/esm/useFocusEffect.native.js.map +6 -1
  153. package/dist/esm/useLoader.native.js +50 -50
  154. package/dist/esm/useLoader.native.js.map +6 -1
  155. package/dist/esm/useNavigation.native.js +23 -19
  156. package/dist/esm/useNavigation.native.js.map +6 -1
  157. package/dist/esm/useScreens.native.js +143 -160
  158. package/dist/esm/useScreens.native.js.map +6 -1
  159. package/dist/esm/useViteRoutes.native.js +25 -28
  160. package/dist/esm/useViteRoutes.native.js.map +6 -1
  161. package/dist/esm/utils/assertIsReady.native.js +6 -3
  162. package/dist/esm/utils/assertIsReady.native.js.map +6 -1
  163. package/dist/esm/utils/dynamicImport.native.js +5 -3
  164. package/dist/esm/utils/dynamicImport.native.js.map +6 -1
  165. package/dist/esm/utils/existsAsync.native.js +6 -4
  166. package/dist/esm/utils/existsAsync.native.js.map +6 -1
  167. package/dist/esm/utils/getPageExport.native.js +12 -11
  168. package/dist/esm/utils/getPageExport.native.js.map +6 -1
  169. package/dist/esm/utils/globDir.native.js +5 -3
  170. package/dist/esm/utils/globDir.native.js.map +6 -1
  171. package/dist/esm/utils/hashString.native.js +4 -2
  172. package/dist/esm/utils/hashString.native.js.map +6 -1
  173. package/dist/esm/utils/isResponse.native.js +4 -2
  174. package/dist/esm/utils/isResponse.native.js.map +6 -1
  175. package/dist/esm/utils/isStatus.native.js +4 -2
  176. package/dist/esm/utils/isStatus.native.js.map +6 -1
  177. package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
  178. package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
  179. package/dist/esm/utils/rand.native.js +5 -3
  180. package/dist/esm/utils/rand.native.js.map +6 -1
  181. package/dist/esm/utils/redirect.native.js +7 -5
  182. package/dist/esm/utils/redirect.native.js.map +6 -1
  183. package/dist/esm/utils/removeSearch.native.js +4 -2
  184. package/dist/esm/utils/removeSearch.native.js.map +6 -1
  185. package/dist/esm/utils/removeUndefined.native.js +6 -3
  186. package/dist/esm/utils/removeUndefined.native.js.map +6 -1
  187. package/dist/esm/utils/requireResolve.native.js +4 -2
  188. package/dist/esm/utils/requireResolve.native.js.map +6 -1
  189. package/dist/esm/utils/url.native.js +6 -2
  190. package/dist/esm/utils/url.native.js.map +6 -1
  191. package/dist/esm/utils/weakKey.native.js +11 -10
  192. package/dist/esm/utils/weakKey.native.js.map +6 -1
  193. package/dist/esm/utils/weakMemo.native.js +8 -8
  194. package/dist/esm/utils/weakMemo.native.js.map +6 -1
  195. package/dist/esm/views/EmptyRoute.native.js +5 -3
  196. package/dist/esm/views/EmptyRoute.native.js.map +6 -1
  197. package/dist/esm/views/ErrorBoundary.native.js +5 -8
  198. package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
  199. package/dist/esm/views/LoadProgressBar.native.js +58 -57
  200. package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
  201. package/dist/esm/views/Navigator.native.js +54 -71
  202. package/dist/esm/views/Navigator.native.js.map +6 -1
  203. package/dist/esm/views/PreloadLinks.native.js +3 -1
  204. package/dist/esm/views/PreloadLinks.native.js.map +6 -1
  205. package/dist/esm/views/RootErrorBoundary.native.js +39 -29
  206. package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
  207. package/dist/esm/views/Screen.native.js +12 -12
  208. package/dist/esm/views/Screen.native.js.map +6 -1
  209. package/dist/esm/views/ScrollRestoration.native.js +27 -27
  210. package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
  211. package/dist/esm/views/Try.native.js +40 -37
  212. package/dist/esm/views/Try.native.js.map +6 -1
  213. package/dist/esm/vite/build.native.js +260 -295
  214. package/dist/esm/vite/build.native.js.map +6 -1
  215. package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
  216. package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
  217. package/dist/esm/vite/constants.native.js +6 -4
  218. package/dist/esm/vite/constants.native.js.map +6 -1
  219. package/dist/esm/vite/createFileSystemRouter.native.js +99 -130
  220. package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
  221. package/dist/esm/vite/customNodeExternals.native.js +9 -10
  222. package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
  223. package/dist/esm/vite/ensureTsConfig.native.js +7 -5
  224. package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
  225. package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
  226. package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
  227. package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
  228. package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
  229. package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
  230. package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
  231. package/dist/esm/vite/getManifest.native.js +6 -4
  232. package/dist/esm/vite/getManifest.native.js.map +6 -1
  233. package/dist/esm/vite/headers.native.js +11 -5
  234. package/dist/esm/vite/headers.native.js.map +6 -1
  235. package/dist/esm/vite/loadEnv.native.js +7 -6
  236. package/dist/esm/vite/loadEnv.native.js.map +6 -1
  237. package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
  238. package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
  239. package/dist/esm/vite/one.native.js +142 -127
  240. package/dist/esm/vite/one.native.js.map +6 -1
  241. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
  242. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
  243. package/dist/esm/vite/replaceLoader.js +7 -1
  244. package/dist/esm/vite/replaceLoader.js.map +1 -1
  245. package/dist/esm/vite/replaceLoader.mjs +5 -1
  246. package/dist/esm/vite/replaceLoader.mjs.map +1 -1
  247. package/dist/esm/vite/replaceLoader.native.js +13 -10
  248. package/dist/esm/vite/replaceLoader.native.js.map +6 -1
  249. package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
  250. package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
  251. package/dist/esm/vite/server.native.js +5 -4
  252. package/dist/esm/vite/server.native.js.map +6 -1
  253. package/dist/esm/vite/types.native.js +1 -2
  254. package/dist/esm/vite/types.native.js.map +6 -1
  255. package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
  256. package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
  257. package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
  258. package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
  259. package/dist/esm/vite.native.js +19 -10
  260. package/dist/esm/vite.native.js.map +6 -1
  261. package/dist/esm/zero/getQueryKey.native.js +5 -3
  262. package/dist/esm/zero/getQueryKey.native.js.map +6 -1
  263. package/dist/esm/zero/isZeroQuery.native.js +4 -2
  264. package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
  265. package/dist/esm/zero/resolveQuery.native.js +9 -8
  266. package/dist/esm/zero/resolveQuery.native.js.map +6 -1
  267. package/dist/esm/zero/subscribeToQuery.native.js +5 -3
  268. package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
  269. package/dist/esm/zero/types.native.js +1 -2
  270. package/dist/esm/zero/types.native.js.map +6 -1
  271. package/dist/esm/zero/useQuery.native.js +12 -12
  272. package/dist/esm/zero/useQuery.native.js.map +6 -1
  273. package/dist/esm/zero/useQueryZero.native.js +24 -20
  274. package/dist/esm/zero/useQueryZero.native.js.map +6 -1
  275. package/dist/esm/zero.native.js +9 -5
  276. package/dist/esm/zero.native.js.map +6 -1
  277. package/package.json +7 -7
  278. package/src/vite/replaceLoader.ts +7 -1
  279. package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -1,38 +1,48 @@
1
- import { matchGroupName } from "./matchers.native.js";
1
+ import { matchGroupName } from "./matchers";
2
2
  function sortDynamicConvention(a, b) {
3
3
  return a.deep && !b.deep ? 1 : !a.deep && b.deep ? -1 : 0;
4
4
  }
5
5
  function sortRoutes(a, b) {
6
- if (a.dynamic && !b.dynamic) return 1;
7
- if (!a.dynamic && b.dynamic) return -1;
6
+ if (a.dynamic && !b.dynamic)
7
+ return 1;
8
+ if (!a.dynamic && b.dynamic)
9
+ return -1;
8
10
  if (a.dynamic && b.dynamic) {
9
- if (a.dynamic.length !== b.dynamic.length) return b.dynamic.length - a.dynamic.length;
11
+ if (a.dynamic.length !== b.dynamic.length)
12
+ return b.dynamic.length - a.dynamic.length;
10
13
  for (var i = 0; i < a.dynamic.length; i++) {
11
- var aDynamic = a.dynamic[i],
12
- bDynamic = b.dynamic[i];
14
+ var aDynamic = a.dynamic[i], bDynamic = b.dynamic[i];
13
15
  if (aDynamic.notFound && bDynamic.notFound) {
14
16
  var s = sortDynamicConvention(aDynamic, bDynamic);
15
- if (s) return s;
17
+ if (s)
18
+ return s;
16
19
  }
17
- if (aDynamic.notFound && !bDynamic.notFound) return 1;
18
- if (!aDynamic.notFound && bDynamic.notFound) return -1;
20
+ if (aDynamic.notFound && !bDynamic.notFound)
21
+ return 1;
22
+ if (!aDynamic.notFound && bDynamic.notFound)
23
+ return -1;
19
24
  var s1 = sortDynamicConvention(aDynamic, bDynamic);
20
- if (s1) return s1;
25
+ if (s1)
26
+ return s1;
21
27
  }
22
28
  return 0;
23
29
  }
24
- var aIndex = a.route === "index" || matchGroupName(a.route) != null,
25
- bIndex = b.route === "index" || matchGroupName(b.route) != null;
30
+ var aIndex = a.route === "index" || matchGroupName(a.route) != null, bIndex = b.route === "index" || matchGroupName(b.route) != null;
26
31
  return aIndex && !bIndex ? -1 : !aIndex && bIndex ? 1 : a.route.length - b.route.length;
27
32
  }
28
33
  function sortRoutesWithInitial(initialRouteName) {
29
- return function (a, b) {
34
+ return function(a, b) {
30
35
  if (initialRouteName) {
31
- if (a.route === initialRouteName) return -1;
32
- if (b.route === initialRouteName) return 1;
36
+ if (a.route === initialRouteName)
37
+ return -1;
38
+ if (b.route === initialRouteName)
39
+ return 1;
33
40
  }
34
41
  return sortRoutes(a, b);
35
42
  };
36
43
  }
37
- export { sortRoutes, sortRoutesWithInitial };
38
- //# sourceMappingURL=sortRoutes.native.js.map
44
+ export {
45
+ sortRoutes,
46
+ sortRoutesWithInitial
47
+ };
48
+ //# sourceMappingURL=sortRoutes.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["matchGroupName","sortDynamicConvention","a","b","deep","sortRoutes","dynamic","length","i","aDynamic","bDynamic","notFound","s","s1","aIndex","route","bIndex","sortRoutesWithInitial","initialRouteName"],"sources":["../../src/sortRoutes.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,cAAA,QAAsB;AAE/B,SAASC,sBAAsBC,CAAA,EAAsBC,CAAA,EAAsB;EACzE,OAAID,CAAA,CAAEE,IAAA,IAAQ,CAACD,CAAA,CAAEC,IAAA,GACR,IAEL,CAACF,CAAA,CAAEE,IAAA,IAAQD,CAAA,CAAEC,IAAA,GACR,KAEF;AACT;AAEO,SAASC,WAAWH,CAAA,EAAcC,CAAA,EAAsB;EAC7D,IAAID,CAAA,CAAEI,OAAA,IAAW,CAACH,CAAA,CAAEG,OAAA,EAClB,OAAO;EAET,IAAI,CAACJ,CAAA,CAAEI,OAAA,IAAWH,CAAA,CAAEG,OAAA,EAClB,OAAO;EAET,IAAIJ,CAAA,CAAEI,OAAA,IAAWH,CAAA,CAAEG,OAAA,EAAS;IAC1B,IAAIJ,CAAA,CAAEI,OAAA,CAAQC,MAAA,KAAWJ,CAAA,CAAEG,OAAA,CAAQC,MAAA,EACjC,OAAOJ,CAAA,CAAEG,OAAA,CAAQC,MAAA,GAASL,CAAA,CAAEI,OAAA,CAAQC,MAAA;IAGtC,SAASC,CAAA,GAAI,GAAGA,CAAA,GAAIN,CAAA,CAAEI,OAAA,C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S,sBAAsBC,kBAAyB;AAC7D,SAAO,SAACf,GAAcC,GAAAA;AACpB,QAAIc,kBAAkB;AACpB,UAAIf,EAAEY,UAAUG;AACd,eAAO;AAET,UAAId,EAAEW,UAAUG;AACd,eAAO;IAEX;AACA,WAAOZ,WAAWH,GAAGC,CAAAA;EACvB;AACF;",
5
+ "names": ["matchGroupName", "sortDynamicConvention", "a", "b", "deep", "sortRoutes", "dynamic", "length", "i", "aDynamic", "bDynamic", "notFound", "s", "aIndex", "route", "bIndex", "sortRoutesWithInitial", "initialRouteName"]
6
+ }
@@ -1,17 +1,16 @@
1
1
  import FSExtra from "fs-extra";
2
2
  import { writeFile } from "node:fs/promises";
3
3
  import { dirname } from "node:path";
4
- import { globbedRoutesToRouteContext } from "../useViteRoutes.native.js";
5
- import { globDir } from "../utils/globDir.native.js";
6
- import { getTypedRoutesDeclarationFile } from "./getTypedRoutesDeclarationFile.native.js";
4
+ import { globbedRoutesToRouteContext } from "../useViteRoutes";
5
+ import { globDir } from "../utils/globDir";
6
+ import { getTypedRoutesDeclarationFile } from "./getTypedRoutesDeclarationFile";
7
7
  async function generateRouteTypes(outFile) {
8
- var routePaths = globDir("app"),
9
- routes = routePaths.reduce(function (acc, cur) {
10
- return acc[cur] = {}, acc;
11
- }, {}),
12
- context = globbedRoutesToRouteContext(routes),
13
- declarations = getTypedRoutesDeclarationFile(context);
8
+ var routePaths = globDir("app"), routes = routePaths.reduce(function(acc, cur) {
9
+ return acc[cur] = {}, acc;
10
+ }, {}), context = globbedRoutesToRouteContext(routes), declarations = getTypedRoutesDeclarationFile(context);
14
11
  await FSExtra.ensureDir(dirname(outFile)), await writeFile(outFile, declarations);
15
12
  }
16
- export { generateRouteTypes };
17
- //# sourceMappingURL=generateRouteTypes.native.js.map
13
+ export {
14
+ generateRouteTypes
15
+ };
16
+ //# sourceMappingURL=generateRouteTypes.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["FSExtra","writeFile","dirname","globbedRoutesToRouteContext","globDir","getTypedRoutesDeclarationFile","generateRouteTypes","outFile","routePaths","routes","reduce","acc","cur","context","declarations"],"sources":["../../../src/typed-routes/generateRouteTypes.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,OAAA,MAAa;AACpB,SAASC,SAAA,QAAiB;AAC1B,SAASC,OAAA,QAAe;AACxB,SAASC,2BAAA,QAAmC;AAC5C,SAASC,OAAA,QAAe;AACxB,SAASC,6BAAA,QAAqC;AAE9C,eAAsBC,mBAAmBC,OAAA,EAAiB;EAExD,IAAAC,UAAM,GADaJ,OAAQ,MACD;IAAAK,MAAQ,GAAAD,UAChC,CAAAE,MAAO,WACAC,GAAA,EACLC,GAAC,EACC;MAEN,OAAMD,GAAA,CAAAC,GAAQ,QAAUD,GAAA;IAE1B;IAAAE,OAAA,GAAAV,2BAAA,CAAAM,MAAA;IAAAK,YAAA,GAAAT,6BAAA,CAAAQ,OAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/typed-routes/Users/n8/one/packages/one/src/typed-routes/generateRouteTypes.ts"],
4
+ "mappings": "AAAA,OAAOA,aAAa;AACpB,SAASC,iBAAiB;AAC1B,SAASC,eAAe;AACxB,SAASC,mCAAmC;AAC5C,SAASC,eAAe;AACxB,SAASC,qCAAqC;AAE9C,eAAsBC,mBAAmBC,SAAe;AACtD,MAAMC,aAAaJ,QAAQ,KAAA,GACrBK,SAASD,WAAWE,OAAO,SAACC,KAAKC,KAAAA;AACrCD,eAAIC,GAAAA,IAAO,CAAC,GACLD;EACT,GAAG,CAAC,CAAA,GACEE,UAAUV,4BAA4BM,MAAAA,GACtCK,eAAeT,8BAA8BQ,OAAAA;AACnD,QAAMb,QAAQe,UAAUb,QAAQK,OAAAA,CAAAA,GAChC,MAAMN,UAAUM,SAASO,YAAAA;AAC3B;",
5
+ "names": ["FSExtra", "writeFile", "dirname", "globbedRoutesToRouteContext", "globDir", "getTypedRoutesDeclarationFile", "generateRouteTypes", "outFile", "routePaths", "routes", "reduce", "acc", "cur", "context", "declarations", "ensureDir"]
6
+ }
@@ -1,19 +1,21 @@
1
- import { getRoutes } from "../getRoutes.native.js";
2
- import { isTypedRoute, removeSupportedExtensions } from "../matchers.native.js";
3
- var CATCH_ALL = /\[\.\.\..+?\]/g,
4
- SLUG = /\[.+?\]/g;
1
+ import { getRoutes } from "../getRoutes";
2
+ import { isTypedRoute, removeSupportedExtensions } from "../matchers";
3
+ var CATCH_ALL = /\[\.\.\..+?\]/g, SLUG = /\[.+?\]/g;
5
4
  function getTypedRoutesDeclarationFile(ctx) {
6
- var staticRoutes = /* @__PURE__ */new Set(),
7
- dynamicRoutes = /* @__PURE__ */new Set(),
8
- dynamicRouteContextKeys = /* @__PURE__ */new Set();
9
- return walkRouteNode(getRoutes(ctx, {
10
- platformRoutes: !1,
11
- // We don't need to generate platform specific routes
12
- ignoreEntryPoints: !0,
13
- ignoreRequireErrors: !0
14
- }),
15
- // importMode: 'async',
16
- "", staticRoutes, dynamicRoutes, dynamicRouteContextKeys), `
5
+ var staticRoutes = /* @__PURE__ */ new Set(), dynamicRoutes = /* @__PURE__ */ new Set(), dynamicRouteContextKeys = /* @__PURE__ */ new Set();
6
+ return walkRouteNode(
7
+ getRoutes(ctx, {
8
+ platformRoutes: !1,
9
+ // We don't need to generate platform specific routes
10
+ ignoreEntryPoints: !0,
11
+ ignoreRequireErrors: !0
12
+ }),
13
+ // importMode: 'async',
14
+ "",
15
+ staticRoutes,
16
+ dynamicRoutes,
17
+ dynamicRouteContextKeys
18
+ ), `
17
19
  import type { OneRouter } from 'one'
18
20
 
19
21
  declare module 'one' {
@@ -31,9 +33,7 @@ declare module 'one' {
31
33
  function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys) {
32
34
  if (routeNode) {
33
35
  addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, dynamicRouteContextKeys), parentRoutePath = `${removeSupportedExtensions(`${parentRoutePath}/${routeNode.route}`).replace(/\/?index$/, "")}`;
34
- var _iteratorNormalCompletion = !0,
35
- _didIteratorError = !1,
36
- _iteratorError = void 0;
36
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
37
37
  try {
38
38
  for (var _iterator = routeNode.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
39
39
  var child = _step.value;
@@ -45,7 +45,8 @@ function walkRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes,
45
45
  try {
46
46
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
47
47
  } finally {
48
- if (_didIteratorError) throw _iteratorError;
48
+ if (_didIteratorError)
49
+ throw _iteratorError;
49
50
  }
50
51
  }
51
52
  }
@@ -54,9 +55,7 @@ function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, d
54
55
  if (routeNode?.route && isTypedRoute(routeNode.route)) {
55
56
  var routePath = `${parentRoutePath}/${removeSupportedExtensions(routeNode.route).replace(/\/?index$/, "")}`;
56
57
  if (routePath.startsWith("/") || (routePath = `/${routePath}`), routeNode.dynamic) {
57
- var _iteratorNormalCompletion = !0,
58
- _didIteratorError = !1,
59
- _iteratorError = void 0;
58
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
60
59
  try {
61
60
  for (var _iterator = generateCombinations(routePath)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
62
61
  var path = _step.value;
@@ -68,13 +67,12 @@ function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, d
68
67
  try {
69
68
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
70
69
  } finally {
71
- if (_didIteratorError) throw _iteratorError;
70
+ if (_didIteratorError)
71
+ throw _iteratorError;
72
72
  }
73
73
  }
74
74
  } else {
75
- var _iteratorNormalCompletion1 = !0,
76
- _didIteratorError1 = !1,
77
- _iteratorError1 = void 0;
75
+ var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
78
76
  try {
79
77
  for (var _iterator1 = generateCombinations(routePath)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
80
78
  var combination = _step1.value;
@@ -86,32 +84,35 @@ function addRouteNode(routeNode, parentRoutePath, staticRoutes, dynamicRoutes, d
86
84
  try {
87
85
  !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
88
86
  } finally {
89
- if (_didIteratorError1) throw _iteratorError1;
87
+ if (_didIteratorError1)
88
+ throw _iteratorError1;
90
89
  }
91
90
  }
92
91
  }
93
92
  }
94
93
  }
95
- var setToUnionType = function (set) {
96
- return set.size > 0 ? [...set].sort().map(function (s) {
94
+ var setToUnionType = function(set) {
95
+ return set.size > 0 ? [
96
+ ...set
97
+ ].sort().map(function(s) {
97
98
  return `\`${s}\``;
98
99
  }).join(" | ") : "never";
99
100
  };
100
101
  function generateCombinations(pathname) {
101
- var groups = pathname.split("/").filter(function (part) {
102
- return part.startsWith("(") && part.endsWith(")");
103
- }),
104
- combinations = [];
102
+ var groups = pathname.split("/").filter(function(part) {
103
+ return part.startsWith("(") && part.endsWith(")");
104
+ }), combinations = [];
105
105
  function generate(currentIndex, currentPath) {
106
106
  if (currentIndex === groups.length) {
107
107
  combinations.push(currentPath.replace(/\/{2,}/g, "/"));
108
108
  return;
109
109
  }
110
- var group = groups[currentIndex],
111
- withoutGroup = currentPath.replace(`/${group}`, "");
110
+ var group = groups[currentIndex], withoutGroup = currentPath.replace(`/${group}`, "");
112
111
  generate(currentIndex + 1, withoutGroup), generate(currentIndex + 1, currentPath);
113
112
  }
114
113
  return generate(0, pathname), combinations;
115
114
  }
116
- export { getTypedRoutesDeclarationFile };
117
- //# sourceMappingURL=getTypedRoutesDeclarationFile.native.js.map
115
+ export {
116
+ getTypedRoutesDeclarationFile
117
+ };
118
+ //# sourceMappingURL=getTypedRoutesDeclarationFile.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["getRoutes","isTypedRoute","removeSupportedExtensions","CATCH_ALL","SLUG","getTypedRoutesDeclarationFile","ctx","staticRoutes","Set","dynamicRoutes","dynamicRouteContextKeys","walkRouteNode","platformRoutes","ignoreEntryPoints","ignoreRequireErrors","setToUnionType","trim","routeNode","parentRoutePath","addRouteNode","route","replace","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","children","Symbol","iterator","_step","next","done","child","value","err","return","routePath","startsWith","dynamic","generateCombinations","path","add","replaceAll"],"sources":["../../../src/typed-routes/getTypedRoutesDeclarationFile.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,QAAiB;AAC1B,SAASC,YAAA,EAAcC,yBAAA,QAAiC;AAKxD,IAAAC,SAAM,mBAAY;EAAAC,IAEZ,aAAO;AAEN,SAASC,8BAA8BC,GAAA,EAAuB;EACnE,IAAAC,YAAM,kBAAe,IAAAC,GAAI;IAAYC,aAC/B,kBAAgB,IAAAD,GAAI;IAAYE,uBAChC,kBAA0B,IAAAF,GAAI;EAEpC,OAAAG,aAAA,CACEX,SAAA,CAAUM,GAAA,EAAK;IACbM,cAAA,EAAgB;IAAA;IAChBC,iBAAA,EAAmB;IACnBC,mBAAA,EAAqB;EAAA;EAEvB;EACA,IACAP,YAAA,EACAE,aAAA,EACAC,uBACF,GAEO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMaK,cAAA,CAAeR,YAAY,CAAC;AAAA,uBAC3BQ,cAAA,CAAeN,aAAa,CAAC;AAAA,8BACtBM,cAAA,CAAeL,uBAAuB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnEM,IAAA,CAAK;AACP;AAKA,SAASL,cACPM,SAAA,EACAC,eAAA,EACAX,YAAA,EACAE,aAAA,EACAC,uBAAA,EACA;EACA,IAAKO,SAAA,EAEL;IAAAE,YAAA,CAAaF,SAAA,EAAWC,eAAA,EAAiBX,YAAA,EAAc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,6BAAA,IAAA,kBAAA;;;WAAA,8BAAA,WAAA,UAAA,QAAA,WAAA,OAAA;;cAAA;kBAAA;;;IAGP;;AACF;AAKA,IAAMhB,iBAAiB,SAAIiB,KAAAA;AACzB,SAAOA,IAAIC,OAAO,IACd;OAAID;IACDE,KAAI,EACJC,IAAI,SAACC,GAAAA;WAAM,KAAKA,CAAAA;KAChBC,KAAK,KAAA,IACR;AACN;AAEA,SAASV,qBAAqBW,UAAQ;AACpC,MAAMC,SAASD,SAASE,MAAM,GAAA,EAAKC,OAAO,SAACC,MAAAA;WAASA,KAAKjB,WAAW,GAAA,KAAQiB,KAAKC,SAAS,GAAA;MACpFC,eAAyB,CAAA;AAE/B,WAASC,SAASC,cAAcC,aAAW;AACzC,QAAID,iBAAiBP,OAAOS,QAAQ;AAClCJ,mBAAaK,KAAKF,YAAY1B,QAAQ,WAAW,GAAA,CAAA;AACjD;IACF;AAEA,QAAM6B,QAAQX,OAAOO,YAAAA,GACfK,eAAeJ,YAAY1B,QAAQ,IAAI6B,KAAAA,IAAS,EAAA;AACtDL,aAASC,eAAe,GAAGK,YAAAA,GAC3BN,SAASC,eAAe,GAAGC,WAAAA;EAC7B;AAEAF,kBAAS,GAAGP,QAAAA,GACLM;AACT;",
5
+ "names": ["getRoutes", "isTypedRoute", "removeSupportedExtensions", "CATCH_ALL", "SLUG", "getTypedRoutesDeclarationFile", "ctx", "staticRoutes", "Set", "dynamicRoutes", "dynamicRouteContextKeys", "walkRouteNode", "platformRoutes", "ignoreEntryPoints", "ignoreRequireErrors", "setToUnionType", "trim", "routeNode", "parentRoutePath", "addRouteNode", "route", "replace", "children", "child", "routePath", "startsWith", "dynamic", "generateCombinations", "path", "add", "replaceAll", "combination", "set", "size", "sort", "map", "s", "join", "pathname", "groups", "split", "filter", "part", "endsWith", "combinations", "generate", "currentIndex", "currentPath", "length", "push", "group", "withoutGroup"]
6
+ }
@@ -1,2 +1 @@
1
-
2
- //# sourceMappingURL=types.native.js.map
1
+ //# sourceMappingURL=types.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "mappings": "",
5
+ "names": []
6
+ }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { useOptionalNavigation } from "./link/useLoadedNavigation.native.js";
2
+ import { useOptionalNavigation } from "./link/useLoadedNavigation";
3
3
  function useFocusEffect(effect, do_not_pass_a_second_prop) {
4
4
  var navigation = useOptionalNavigation();
5
5
  if (do_not_pass_a_second_prop !== void 0) {
@@ -14,16 +14,15 @@ useFocusEffect(
14
14
  See usage guide: https://reactnavigation.org/docs/use-focus-effect`;
15
15
  console.error(message);
16
16
  }
17
- React.useEffect(function () {
17
+ React.useEffect(function() {
18
18
  if (navigation) {
19
- var isFocused = !1,
20
- cleanup,
21
- callback = function () {
22
- var destroy = effect();
23
- if (destroy === void 0 || typeof destroy == "function") return destroy;
24
- if (process.env.NODE_ENV !== "production") {
25
- var message2 = "An effect function must not return anything besides a function, which is used for clean-up.";
26
- destroy === null ? message2 += " You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing)." : typeof destroy.then == "function" ? message2 += `
19
+ var isFocused = !1, cleanup, callback = function() {
20
+ var destroy = effect();
21
+ if (destroy === void 0 || typeof destroy == "function")
22
+ return destroy;
23
+ if (process.env.NODE_ENV !== "production") {
24
+ var message2 = "An effect function must not return anything besides a function, which is used for clean-up.";
25
+ destroy === null ? message2 += " You returned 'null'. If your effect does not require clean-up, return 'undefined' (or nothing)." : typeof destroy.then == "function" ? message2 += `
27
26
 
28
27
  It looks like you wrote 'useFocusEffect(async () => ...)' or returned a Promise. Instead, write the async function inside your effect and call it immediately:
29
28
 
@@ -40,20 +39,24 @@ useFocusEffect(
40
39
  );
41
40
 
42
41
  See usage guide: https://reactnavigation.org/docs/use-focus-effect` : message2 += ` You returned '${JSON.stringify(destroy)}'.`, console.error(message2);
43
- }
44
- };
42
+ }
43
+ };
45
44
  navigation.isFocused() && (cleanup = callback(), isFocused = !0);
46
- var unsubscribeFocus = navigation.addListener("focus", function () {
47
- isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
48
- }),
49
- unsubscribeBlur = navigation.addListener("blur", function () {
50
- cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
51
- });
52
- return function () {
45
+ var unsubscribeFocus = navigation.addListener("focus", function() {
46
+ isFocused || (cleanup !== void 0 && cleanup(), cleanup = callback(), isFocused = !0);
47
+ }), unsubscribeBlur = navigation.addListener("blur", function() {
48
+ cleanup !== void 0 && cleanup(), cleanup = void 0, isFocused = !1;
49
+ });
50
+ return function() {
53
51
  cleanup !== void 0 && cleanup(), unsubscribeFocus(), unsubscribeBlur();
54
52
  };
55
53
  }
56
- }, [effect, navigation]);
54
+ }, [
55
+ effect,
56
+ navigation
57
+ ]);
57
58
  }
58
- export { useFocusEffect };
59
- //# sourceMappingURL=useFocusEffect.native.js.map
59
+ export {
60
+ useFocusEffect
61
+ };
62
+ //# sourceMappingURL=useFocusEffect.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["React","useOptionalNavigation","useFocusEffect","effect","do_not_pass_a_second_prop","navigation","message","console","error","useEffect","isFocused","cleanup","callback","destroy","process","env","NODE_ENV","message2","then","JSON","stringify","unsubscribeFocus","addListener","unsubscribeBlur"],"sources":["../../src/useFocusEffect.ts"],"sourcesContent":[null],"mappings":"AAEA,YAAYA,KAAA,MAAW;AAEvB,SAASC,qBAAA,QAA6B;AAW/B,SAASC,eAAeC,MAAA,EAAwBC,yBAAA,EAAmC;EACxF,IAAAC,UAAM,GAAAJ,qBAAa;EAEf,IAAAG,yBAAA,KAA8B,MAWhC;IATE,IAAAE,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaF,mEAAK;IACHC,OAAA,CAAAC,KAAA,CAAAF,OAAA;EAGF;EAGAN,KAAA,CAAAS,SAAM,aAAiB;IAC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AA;EAChB;AAEAP,QAAMU,UAAU,WAAA;AACd,QAAKL,YAIL;UAAIM,YAAY,IACZC,SAEEC,WAAW,WAAA;AACf,YAAMC,UAAUX,OAAAA;AAEhB,YAAIW,YAAYR,UAAa,OAAOQ,WAAY;AAC9C,iBAAOA;AAGT,YAAIC,QAAQC,IAAIC,aAAa,cAAc;AACzC,cAAIV,WACF;AAEF,UAAIO,YAAY,OACdP,YACE,qGACO,OAAQO,QAAgBI,QAAS,aAC1CX,YACE;;;;;;;;;;;;;;;;sEAeFA,YAAW,kBAAkBY,KAAKC,UAAUN,OAAAA,CAAAA,MAG9CN,QAAQC,MAAMF,QAAAA;QAChB;MACF;AAGA,MAAIF,WAAWM,UAAS,MACtBC,UAAUC,SAAAA,GACVF,YAAY;AAGd,UAAMU,mBAAmBhB,WAAWiB,YAAY,SAAS,WAAA;AAGvD,QAAIX,cAIAC,YAAYN,UACdM,QAAAA,GAGFA,UAAUC,SAAAA,GACVF,YAAY;MACd,CAAA,GAEMY,kBAAkBlB,WAAWiB,YAAY,QAAQ,WAAA;AACrD,QAAIV,YAAYN,UACdM,QAAAA,GAGFA,UAAUN,QACVK,YAAY;MACd,CAAA;AAEA,aAAO,WAAA;AACL,QAAIC,YAAYN,UACdM,QAAAA,GAGFS,iBAAAA,GACAE,gBAAAA;MACF;;EACF,GAAG;IAACpB;IAAQE;GAAW;AACzB;",
5
+ "names": ["React", "useOptionalNavigation", "useFocusEffect", "effect", "do_not_pass_a_second_prop", "navigation", "undefined", "message", "console", "error", "useEffect", "isFocused", "cleanup", "callback", "destroy", "process", "env", "NODE_ENV", "then", "JSON", "stringify", "unsubscribeFocus", "addListener", "unsubscribeBlur"]
6
+ }
@@ -1,62 +1,60 @@
1
1
  import { useEffect, useRef } from "react";
2
- import { useActiveParams, useParams } from "./hooks.native.js";
3
- import { resolveHref } from "./link/href.native.js";
4
- import { useRouteNode } from "./Route.native.js";
5
- import { preloadingLoader } from "./router/router.native.js";
6
- import { dynamicImport } from "./utils/dynamicImport.native.js";
7
- import { weakKey } from "./utils/weakKey.native.js";
8
- import { getLoaderPath } from "./cleanUrl.native.js";
9
- var promises = {},
10
- errors = {},
11
- loadedData = {};
2
+ import { useActiveParams, useParams } from "./hooks";
3
+ import { resolveHref } from "./link/href";
4
+ import { useRouteNode } from "./Route";
5
+ import { preloadingLoader } from "./router/router";
6
+ import { dynamicImport } from "./utils/dynamicImport";
7
+ import { weakKey } from "./utils/weakKey";
8
+ import { getLoaderPath } from "./cleanUrl";
9
+ var promises = {}, errors = {}, loadedData = {};
12
10
  function useLoader(loader) {
13
- var _window_location,
14
- preloadedProps = globalThis.__vxrnLoaderProps__;
15
- if (typeof window > "u") return useAsyncFn(loader, preloadedProps || {
16
- params: useActiveParams()
17
- });
18
- var isNative = !0,
19
- routeNode = useRouteNode(),
20
- params = useParams(),
21
- pathName = "/" + resolveHref({
22
- pathname: routeNode?.route || "",
23
- params
24
- }).replace(/index$/, ""),
25
- currentPath = (isNative ? null : globalThis.__vxrntodopath) || (
26
- // @zetavg: not sure why we're using `globalThis['__vxrntodopath']` here, but this breaks native when switching between tabs where the value stays with the previous path, so ignoring this on native
27
- // TODO likely either not needed or needs proper path from server side
28
- typeof window < "u" ? ((_window_location = window.location) === null || _window_location === void 0 ? void 0 : _window_location.pathname) || pathName : "/"),
29
- preloadedData = preloadedProps?.path === currentPath ? globalThis.__vxrnLoaderData__ : void 0,
30
- currentData = useRef(preloadedData);
31
- if (useEffect(function () {
32
- preloadedData && (loadedData[currentPath] = preloadedData, delete globalThis.__vxrnLoaderData__);
33
- },
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
- [preloadedData]), errors[currentPath]) throw errors[currentPath];
11
+ var _window_location, preloadedProps = globalThis.__vxrnLoaderProps__;
12
+ if (typeof window > "u")
13
+ return useAsyncFn(loader, preloadedProps || {
14
+ params: useActiveParams()
15
+ });
16
+ var isNative = !0, routeNode = useRouteNode(), params = useParams(), pathName = "/" + resolveHref({
17
+ pathname: routeNode?.route || "",
18
+ params
19
+ }).replace(/index$/, ""), currentPath = (isNative ? null : globalThis.__vxrntodopath) || // @zetavg: not sure why we're using `globalThis['__vxrntodopath']` here, but this breaks native when switching between tabs where the value stays with the previous path, so ignoring this on native
20
+ // TODO likely either not needed or needs proper path from server side
21
+ (typeof window < "u" ? ((_window_location = window.location) === null || _window_location === void 0 ? void 0 : _window_location.pathname) || pathName : "/"), preloadedData = preloadedProps?.path === currentPath ? globalThis.__vxrnLoaderData__ : void 0, currentData = useRef(preloadedData);
22
+ if (useEffect(
23
+ function() {
24
+ preloadedData && (loadedData[currentPath] = preloadedData, delete globalThis.__vxrnLoaderData__);
25
+ },
26
+ // eslint-disable-next-line react-hooks/exhaustive-deps
27
+ [
28
+ preloadedData
29
+ ]
30
+ ), errors[currentPath])
31
+ throw errors[currentPath];
36
32
  var loaded = loadedData[currentPath];
37
- if (typeof loaded < "u") return loaded;
33
+ if (typeof loaded < "u")
34
+ return loaded;
38
35
  if (!preloadedData) {
39
- if (preloadingLoader[currentPath] && (typeof preloadingLoader[currentPath] == "function" && (preloadingLoader[currentPath] = preloadingLoader[currentPath]()), promises[currentPath] = preloadingLoader[currentPath].then(function (val) {
36
+ if (preloadingLoader[currentPath] && (typeof preloadingLoader[currentPath] == "function" && (preloadingLoader[currentPath] = preloadingLoader[currentPath]()), promises[currentPath] = preloadingLoader[currentPath].then(function(val) {
40
37
  loadedData[currentPath] = val;
41
- }).catch(function (err) {
38
+ }).catch(function(err) {
42
39
  console.error("Error loading loader", err), errors[currentPath] = err, delete promises[currentPath], delete preloadingLoader[currentPath];
43
40
  })), !promises[currentPath]) {
44
- var getData = async function () {
41
+ var getData = async function() {
45
42
  var loaderJSUrl = getLoaderPath(currentPath, !0);
46
43
  try {
47
- var response = await async function () {
44
+ var response = await async function() {
48
45
  if (isNative) {
49
46
  var nativeLoaderJSUrl = `${loaderJSUrl}&platform=ios`;
50
47
  try {
51
48
  var loaderJsCodeResp = await fetch(nativeLoaderJSUrl);
52
- if (!loaderJsCodeResp.ok) throw new Error(`Response not ok: ${loaderJsCodeResp.status}`);
53
- var loaderJsCode = await loaderJsCodeResp.text(),
54
- result = eval(`() => { var exports = {}; ${loaderJsCode}; return exports; }`)();
55
- if (typeof result.loader != "function") throw new Error("Loader code isn't exporting a `loader` function");
49
+ if (!loaderJsCodeResp.ok)
50
+ throw new Error(`Response not ok: ${loaderJsCodeResp.status}`);
51
+ var loaderJsCode = await loaderJsCodeResp.text(), result = eval(`() => { var exports = {}; ${loaderJsCode}; return exports; }`)();
52
+ if (typeof result.loader != "function")
53
+ throw new Error("Loader code isn't exporting a `loader` function");
56
54
  return result;
57
55
  } catch (e) {
58
56
  return console.error(`Error fetching loader from URL: ${nativeLoaderJSUrl}, ${e}`), {
59
- loader: function () {
57
+ loader: function() {
60
58
  return {};
61
59
  }
62
60
  };
@@ -75,22 +73,24 @@ function useLoader(loader) {
75
73
  }
76
74
  return currentData.current;
77
75
  }
78
- var results = /* @__PURE__ */new Map(),
79
- started = /* @__PURE__ */new Map();
76
+ var results = /* @__PURE__ */ new Map(), started = /* @__PURE__ */ new Map();
80
77
  function useAsyncFn(val, props) {
81
78
  var key = (val ? weakKey(val) : "") + JSON.stringify(props);
82
79
  if (val && !started.get(key)) {
83
80
  started.set(key, !0);
84
81
  var next = val(props);
85
- next instanceof Promise && (next = next.then(function (final) {
82
+ next instanceof Promise && (next = next.then(function(final) {
86
83
  results.set(key, final);
87
- }).catch(function (err) {
84
+ }).catch(function(err) {
88
85
  console.error("Error running loader()", err), results.set(key, void 0);
89
86
  })), results.set(key, next);
90
87
  }
91
88
  var current = results.get(key);
92
- if (current instanceof Promise) throw current;
89
+ if (current instanceof Promise)
90
+ throw current;
93
91
  return current;
94
92
  }
95
- export { useLoader };
96
- //# sourceMappingURL=useLoader.native.js.map
93
+ export {
94
+ useLoader
95
+ };
96
+ //# sourceMappingURL=useLoader.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["useEffect","useRef","useActiveParams","useParams","resolveHref","useRouteNode","preloadingLoader","dynamicImport","weakKey","getLoaderPath","promises","errors","loadedData","useLoader","loader","_window_location","preloadedProps","globalThis","__vxrnLoaderProps__","window","useAsyncFn","params","isNative","routeNode","pathName","pathname","route","replace","currentPath","__vxrntodopath","location","preloadedData","path","__vxrnLoaderData__","currentData","loaded","then","val","catch","err","console","error","getData","loaderJSUrl","response","nativeLoaderJSUrl","loaderJsCodeResp","fetch","ok","Error","status","loaderJsCode","text","result","eval","e","current","results","Map","started","props","key","JSON","stringify","get","set","next","Promise","final"],"sources":["../../src/useLoader.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,SAAA,EAAWC,MAAA,QAAc;AAElC,SAASC,eAAA,EAAiBC,SAAA,QAAiB;AAC3C,SAASC,WAAA,QAAmB;AAC5B,SAASC,YAAA,QAAoB;AAE7B,SAASC,gBAAA,QAAwB;AAEjC,SAASC,aAAA,QAAqB;AAC9B,SAASC,OAAA,QAAe;AACxB,SAASC,aAAA,QAAqB;AAE9B,IAAAC,QAAM,KAAsD;EAACC,MACvD,KAAS;EAACC,UACV,KAAkC;AAEjC,SAASC,UAGdC,MAAA,EAA8E;EAC9E,IAAAC,gBAAM;IAAAC,cAA4B,GAAAC,UAAA,CAAAC,mBAAA;EAGlC,IAAI,OAAOC,MAAA,GAAW,KACpB,OAAOC,UAAA,CAAAN,MAAA,EAAAE,cAAA;IACLK,MAAA,EAAAnB,eAAA;EAAA,EACA;EAAkB,IAAAoB,QAChB,GAAQ;IAAAC,SAAA,GAAgBlB,YAAA;IAAAgB,MAAA,GAAAlB,SAAA;IAAAqB,QAAA,SAAApB,WAAA;MAAAqB,QAC1B,EAAAF,SAAA,EAAAG,KAAA;MACFL;IAGF,GAAAM,OAAM,SAAW,EACX;IAAAC,WAAY,IAAAN,QACZ,UAASL,UAAU,CAAAY,cAKvB;IAAM;IAGwB;IAE7B,OAAOV,MAAA,GAAW,MAAc,EAAAJ,gBAAiB,GAAAI,MAAA,CAAAW,QAAY,MAAW,IA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BAAO,MAAMP,cAAckC,WAAAA;UAC7B,EAAA;AAEA7B,4BAAWe,WAAAA,IAAee,SAAS5B,OAAM,GAClCF,WAAWe,WAAAA;QACpB,SAASU,KAAK;AACZC,yBAAQC,MAAM,yBAAyBF,GAAAA,EAAK,GAC5C1B,OAAOgB,WAAAA,IAAeU,KACtB,OAAO3B,SAASiB,WAAAA,GACT;QACT;MACF;AACAjB,eAASiB,WAAAA,IAAea,QAAAA;IAC1B;AAEA,UAAM9B,SAASiB,WAAAA;EACjB;AAEA,SAAOK,YAAYsB;AACrB;AAEA,IAAMC,UAAU,oBAAIC,IAAAA,GACdC,UAAU,oBAAID,IAAAA;AAEpB,SAAStC,WAAWiB,KAAUuB,OAAW;AACvC,MAAMC,OAAOxB,MAAM3B,QAAQ2B,GAAAA,IAAO,MAAMyB,KAAKC,UAAUH,KAAAA;AAEvD,MAAIvB,OACE,CAACsB,QAAQK,IAAIH,GAAAA,GAAM;AACrBF,YAAQM,IAAIJ,KAAK,EAAA;AAEjB,QAAIK,OAAO7B,IAAIuB,KAAAA;AACf,IAAIM,gBAAgBC,YAClBD,OAAOA,KACJ9B,KAAK,SAACgC,OAAAA;AACLX,cAAQQ,IAAIJ,KAAKO,KAAAA;IACnB,CAAA,EACC9B,MAAM,SAACC,KAAAA;AACNC,cAAQC,MAAM,0BAA0BF,GAAAA,GACxCkB,QAAQQ,IAAIJ,KAAK5B,MAAAA;IACnB,CAAA,IAEJwB,QAAQQ,IAAIJ,KAAKK,IAAAA;EACnB;AAGF,MAAMV,UAAUC,QAAQO,IAAIH,GAAAA;AAE5B,MAAIL,mBAAmBW;AACrB,UAAMX;AAGR,SAAOA;AACT;",
5
+ "names": ["useEffect", "useRef", "useActiveParams", "useParams", "resolveHref", "useRouteNode", "preloadingLoader", "dynamicImport", "weakKey", "getLoaderPath", "promises", "errors", "loadedData", "useLoader", "loader", "window", "preloadedProps", "globalThis", "useAsyncFn", "params", "isNative", "process", "routeNode", "pathName", "pathname", "route", "replace", "currentPath", "location", "preloadedData", "path", "undefined", "currentData", "loaded", "then", "val", "catch", "err", "console", "error", "getData", "loaderJSUrl", "response", "nativeLoaderJSUrl", "loaderJsCodeResp", "fetch", "ok", "Error", "status", "loaderJsCode", "text", "result", "eval", "e", "current", "results", "Map", "started", "props", "key", "JSON", "stringify", "get", "set", "next", "Promise", "final"]
6
+ }
@@ -1,18 +1,21 @@
1
1
  import { useNavigation as useUpstreamNavigation } from "@react-navigation/native";
2
2
  import React from "react";
3
- import { getNameFromFilePath } from "./matchers.native.js";
4
- import { useContextKey } from "./Route.native.js";
3
+ import { getNameFromFilePath } from "./matchers";
4
+ import { useContextKey } from "./Route";
5
5
  function useNavigation(parent) {
6
- var navigation = useUpstreamNavigation(),
7
- contextKey = useContextKey(),
8
- normalizedParent = React.useMemo(function () {
9
- if (!parent) return null;
10
- var normalized = getNameFromFilePath(parent);
11
- return parent.startsWith(".") ? relativePaths(contextKey, parent) : normalized;
12
- }, [contextKey, parent]);
6
+ var navigation = useUpstreamNavigation(), contextKey = useContextKey(), normalizedParent = React.useMemo(function() {
7
+ if (!parent)
8
+ return null;
9
+ var normalized = getNameFromFilePath(parent);
10
+ return parent.startsWith(".") ? relativePaths(contextKey, parent) : normalized;
11
+ }, [
12
+ contextKey,
13
+ parent
14
+ ]);
13
15
  if (normalizedParent != null) {
14
16
  var parentNavigation = navigation.getParent(normalizedParent);
15
- if (!parentNavigation) throw new Error(`Could not find parent navigation with route "${parent}".` + (normalizedParent !== parent ? ` (normalized: ${normalizedParent})` : ""));
17
+ if (!parentNavigation)
18
+ throw new Error(`Could not find parent navigation with route "${parent}".` + (normalizedParent !== parent ? ` (normalized: ${normalizedParent})` : ""));
16
19
  return parentNavigation;
17
20
  }
18
21
  return navigation;
@@ -21,16 +24,13 @@ function resolveParentId(contextKey, parentId) {
21
24
  return parentId ? parentId.startsWith(".") ? getNameFromFilePath(relativePaths(contextKey, parentId)) : getNameFromFilePath(parentId) : null;
22
25
  }
23
26
  function relativePaths(from, to) {
24
- var fromParts = from.split("/").filter(Boolean),
25
- toParts = to.split("/").filter(Boolean),
26
- _iteratorNormalCompletion = !0,
27
- _didIteratorError = !1,
28
- _iteratorError = void 0;
27
+ var fromParts = from.split("/").filter(Boolean), toParts = to.split("/").filter(Boolean), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
29
28
  try {
30
29
  for (var _iterator = toParts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
31
30
  var part = _step.value;
32
31
  if (part === "..") {
33
- if (fromParts.length === 0) throw new Error(`Cannot resolve path "${to}" relative to "${from}"`);
32
+ if (fromParts.length === 0)
33
+ throw new Error(`Cannot resolve path "${to}" relative to "${from}"`);
34
34
  fromParts.pop();
35
35
  } else part === "." || fromParts.push(part);
36
36
  }
@@ -40,10 +40,14 @@ function relativePaths(from, to) {
40
40
  try {
41
41
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
42
42
  } finally {
43
- if (_didIteratorError) throw _iteratorError;
43
+ if (_didIteratorError)
44
+ throw _iteratorError;
44
45
  }
45
46
  }
46
47
  return "/" + fromParts.join("/");
47
48
  }
48
- export { resolveParentId, useNavigation };
49
- //# sourceMappingURL=useNavigation.native.js.map
49
+ export {
50
+ resolveParentId,
51
+ useNavigation
52
+ };
53
+ //# sourceMappingURL=useNavigation.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["useNavigation","useUpstreamNavigation","React","getNameFromFilePath","useContextKey","parent","navigation","contextKey","normalizedParent","useMemo","normalized","startsWith","relativePaths","parentNavigation","getParent","Error","resolveParentId","parentId","from","to","fromParts","split","filter","Boolean","toParts","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","part","value","length","pop","push"],"sources":["../../src/useNavigation.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,aAAA,IAAAC,qBAAA;AAAA,OAEEC,KAAA,aAAiB;AAAA,SACZC,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;;AAAL,aAAK,YAAcC,QAAAA,OAAAA,QAAAA,EAAAA,GAAd,OAAA,EAAA,6BAAA,QAAA,UAAA,KAAA,GAAA,OAAA,4BAAA,IAAuB;AAAvB,UAAMC,OAAN,MAAA;AACH,UAAIA,SAAS,MAAM;AACjB,YAAIL,UAAUM,WAAW;AACvB,gBAAM,IAAIX,MAAM,wBAAwBI,EAAAA,kBAAoBD,IAAAA,GAAO;AAErEE,kBAAUO,IAAG;MACf,MAAO,CAAIF,SAAS,OAGlBL,UAAUQ,KAAKH,IAAAA;IAEnB;;AAXK,wBAAA,IAAA,iBAAA;;;OAAA,6BAAA,UAAA,UAAA,QAAA,UAAA,OAAA;;UAAA;cAAA;;;AAaL,SAAO,MAAML,UAAUS,KAAK,GAAA;AAC9B;",
5
+ "names": ["useNavigation", "useUpstreamNavigation", "React", "getNameFromFilePath", "useContextKey", "parent", "navigation", "contextKey", "normalizedParent", "useMemo", "normalized", "startsWith", "relativePaths", "parentNavigation", "getParent", "Error", "resolveParentId", "parentId", "from", "to", "fromParts", "split", "filter", "Boolean", "toParts", "part", "length", "pop", "push", "join"]
6
+ }