one 1.1.297 → 1.1.299

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) hide show
  1. package/dist/cjs/Root.js.map +1 -1
  2. package/dist/cjs/Root.native.js.map +1 -1
  3. package/dist/cjs/cleanUrl.js +9 -2
  4. package/dist/cjs/cleanUrl.js.map +1 -1
  5. package/dist/cjs/cleanUrl.native.js +5 -2
  6. package/dist/cjs/cleanUrl.native.js.map +2 -2
  7. package/dist/cjs/vite/replaceLoader.js +7 -1
  8. package/dist/cjs/vite/replaceLoader.js.map +1 -1
  9. package/dist/cjs/vite/replaceLoader.native.js +7 -1
  10. package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
  11. package/dist/esm/Root.js.map +1 -1
  12. package/dist/esm/Root.mjs.map +1 -1
  13. package/dist/esm/Root.native.js +110 -104
  14. package/dist/esm/Root.native.js.map +6 -1
  15. package/dist/esm/Route.native.js +12 -10
  16. package/dist/esm/Route.native.js.map +6 -1
  17. package/dist/esm/cleanUrl.js +9 -2
  18. package/dist/esm/cleanUrl.js.map +1 -1
  19. package/dist/esm/cleanUrl.mjs +7 -2
  20. package/dist/esm/cleanUrl.mjs.map +1 -1
  21. package/dist/esm/cleanUrl.native.js +16 -13
  22. package/dist/esm/cleanUrl.native.js.map +6 -1
  23. package/dist/esm/cli/label-process.native.js +5 -4
  24. package/dist/esm/cli/label-process.native.js.map +6 -1
  25. package/dist/esm/cli/main.native.js +8 -13
  26. package/dist/esm/cli/main.native.js.map +6 -1
  27. package/dist/esm/cli/prebuild.native.js +5 -5
  28. package/dist/esm/cli/prebuild.native.js.map +6 -1
  29. package/dist/esm/cli/run.native.js +21 -28
  30. package/dist/esm/cli/run.native.js.map +6 -1
  31. package/dist/esm/cli.native.js +119 -148
  32. package/dist/esm/cli.native.js.map +6 -1
  33. package/dist/esm/clientLoaderResolver.native.js +9 -6
  34. package/dist/esm/clientLoaderResolver.native.js.map +6 -1
  35. package/dist/esm/config.native.js +12 -11
  36. package/dist/esm/config.native.js.map +6 -1
  37. package/dist/esm/constants.native.js +7 -5
  38. package/dist/esm/constants.native.js.map +6 -1
  39. package/dist/esm/createApp.native.js +13 -9
  40. package/dist/esm/createApp.native.js.map +6 -1
  41. package/dist/esm/createHandleRequest.native.js +55 -64
  42. package/dist/esm/createHandleRequest.native.js.map +6 -1
  43. package/dist/esm/createRoute.native.js +16 -16
  44. package/dist/esm/createRoute.native.js.map +6 -1
  45. package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
  46. package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
  47. package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
  48. package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
  49. package/dist/esm/fork/NavigationContainer.native.js +24 -31
  50. package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
  51. package/dist/esm/fork/createMemoryHistory.native.js +99 -115
  52. package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
  53. package/dist/esm/fork/extractPathFromURL.native.js +16 -15
  54. package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
  55. package/dist/esm/fork/findFocusedRoute.native.js +6 -5
  56. package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
  57. package/dist/esm/fork/getPathFromState.native.js +127 -140
  58. package/dist/esm/fork/getPathFromState.native.js.map +6 -1
  59. package/dist/esm/fork/getStateFromPath.native.js +292 -288
  60. package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
  61. package/dist/esm/fork/useLinking.native.js +70 -61
  62. package/dist/esm/fork/useLinking.native.js.map +6 -1
  63. package/dist/esm/fork/validatePathConfig.native.js +15 -9
  64. package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
  65. package/dist/esm/getLinkingConfig.native.js +11 -6
  66. package/dist/esm/getLinkingConfig.native.js.map +6 -1
  67. package/dist/esm/getReactNavigationConfig.native.js +28 -20
  68. package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
  69. package/dist/esm/getRoutes.native.js +249 -229
  70. package/dist/esm/getRoutes.native.js.map +6 -1
  71. package/dist/esm/getURL.native.js +4 -4
  72. package/dist/esm/getURL.native.js.map +6 -1
  73. package/dist/esm/head/Head.android.js +5 -3
  74. package/dist/esm/head/Head.android.js.map +6 -1
  75. package/dist/esm/head/Head.ios.js +144 -132
  76. package/dist/esm/head/Head.ios.js.map +6 -1
  77. package/dist/esm/head/Head.native.js +7 -7
  78. package/dist/esm/head/Head.native.js.map +6 -1
  79. package/dist/esm/head/HeadModule.native.js +6 -6
  80. package/dist/esm/head/HeadModule.native.js.map +6 -1
  81. package/dist/esm/head/index.native.js +2 -2
  82. package/dist/esm/head/index.native.js.map +6 -1
  83. package/dist/esm/head/types.native.js +1 -2
  84. package/dist/esm/head/types.native.js.map +6 -1
  85. package/dist/esm/head/url.native.js +10 -8
  86. package/dist/esm/head/url.native.js.map +6 -1
  87. package/dist/esm/hooks.native.js +53 -34
  88. package/dist/esm/hooks.native.js.map +6 -1
  89. package/dist/esm/imperative-api.native.js +9 -6
  90. package/dist/esm/imperative-api.native.js.map +6 -1
  91. package/dist/esm/import-mode/index.android.js +4 -3
  92. package/dist/esm/import-mode/index.android.js.map +6 -1
  93. package/dist/esm/import-mode/index.ios.js +4 -3
  94. package/dist/esm/import-mode/index.ios.js.map +6 -1
  95. package/dist/esm/import-mode/index.native.js +3 -1
  96. package/dist/esm/import-mode/index.native.js.map +6 -1
  97. package/dist/esm/index.native.js +65 -27
  98. package/dist/esm/index.native.js.map +6 -1
  99. package/dist/esm/interfaces/router.native.js +4 -2
  100. package/dist/esm/interfaces/router.native.js.map +6 -1
  101. package/dist/esm/layouts/Drawer.native.js +7 -6
  102. package/dist/esm/layouts/Drawer.native.js.map +6 -1
  103. package/dist/esm/layouts/Stack.native.js +7 -6
  104. package/dist/esm/layouts/Stack.native.js.map +6 -1
  105. package/dist/esm/layouts/Tabs.native.js +42 -39
  106. package/dist/esm/layouts/Tabs.native.js.map +6 -1
  107. package/dist/esm/layouts/withLayoutContext.native.js +51 -48
  108. package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
  109. package/dist/esm/link/Link.native.js +62 -53
  110. package/dist/esm/link/Link.native.js.map +6 -1
  111. package/dist/esm/link/Redirect.native.js +8 -9
  112. package/dist/esm/link/Redirect.native.js.map +6 -1
  113. package/dist/esm/link/href.native.js +28 -27
  114. package/dist/esm/link/href.native.js.map +6 -1
  115. package/dist/esm/link/linking.native.js +51 -40
  116. package/dist/esm/link/linking.native.js.map +6 -1
  117. package/dist/esm/link/path.native.js +28 -19
  118. package/dist/esm/link/path.native.js.map +6 -1
  119. package/dist/esm/link/useLinkTo.native.js +22 -20
  120. package/dist/esm/link/useLinkTo.native.js.map +6 -1
  121. package/dist/esm/link/useLoadedNavigation.native.js +30 -23
  122. package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
  123. package/dist/esm/matchers.native.js +16 -3
  124. package/dist/esm/matchers.native.js.map +6 -1
  125. package/dist/esm/platform.native.js +4 -2
  126. package/dist/esm/platform.native.js.map +6 -1
  127. package/dist/esm/polyfills-mobile.native.js +4 -5
  128. package/dist/esm/polyfills-mobile.native.js.map +6 -1
  129. package/dist/esm/polyfills-server.native.js +1 -1
  130. package/dist/esm/polyfills-server.native.js.map +6 -1
  131. package/dist/esm/render.native.js +3 -1
  132. package/dist/esm/render.native.js.map +6 -1
  133. package/dist/esm/router/RouterStore.native.js +1 -2
  134. package/dist/esm/router/RouterStore.native.js.map +6 -1
  135. package/dist/esm/router/constants.native.js +4 -2
  136. package/dist/esm/router/constants.native.js.map +6 -1
  137. package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
  138. package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
  139. package/dist/esm/router/lastAction.native.js +10 -9
  140. package/dist/esm/router/lastAction.native.js.map +6 -1
  141. package/dist/esm/router/router.native.js +135 -114
  142. package/dist/esm/router/router.native.js.map +6 -1
  143. package/dist/esm/router/serverLocationContext.native.js +4 -2
  144. package/dist/esm/router/serverLocationContext.native.js.map +6 -1
  145. package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
  146. package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
  147. package/dist/esm/serve.native.js +77 -104
  148. package/dist/esm/serve.native.js.map +6 -1
  149. package/dist/esm/server/createRoutesManifest.native.js +14 -11
  150. package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
  151. package/dist/esm/server/getServerManifest.native.js +61 -67
  152. package/dist/esm/server/getServerManifest.native.js.map +6 -1
  153. package/dist/esm/server-render.native.js +9 -10
  154. package/dist/esm/server-render.native.js.map +6 -1
  155. package/dist/esm/sortRoutes.native.js +27 -17
  156. package/dist/esm/sortRoutes.native.js.map +6 -1
  157. package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
  158. package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
  159. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
  160. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
  161. package/dist/esm/types.native.js +1 -2
  162. package/dist/esm/types.native.js.map +6 -1
  163. package/dist/esm/useFocusEffect.native.js +25 -22
  164. package/dist/esm/useFocusEffect.native.js.map +6 -1
  165. package/dist/esm/useLoader.native.js +50 -50
  166. package/dist/esm/useLoader.native.js.map +6 -1
  167. package/dist/esm/useNavigation.native.js +23 -19
  168. package/dist/esm/useNavigation.native.js.map +6 -1
  169. package/dist/esm/useScreens.native.js +143 -160
  170. package/dist/esm/useScreens.native.js.map +6 -1
  171. package/dist/esm/useViteRoutes.native.js +25 -28
  172. package/dist/esm/useViteRoutes.native.js.map +6 -1
  173. package/dist/esm/utils/assertIsReady.native.js +6 -3
  174. package/dist/esm/utils/assertIsReady.native.js.map +6 -1
  175. package/dist/esm/utils/dynamicImport.native.js +5 -3
  176. package/dist/esm/utils/dynamicImport.native.js.map +6 -1
  177. package/dist/esm/utils/existsAsync.native.js +6 -4
  178. package/dist/esm/utils/existsAsync.native.js.map +6 -1
  179. package/dist/esm/utils/getPageExport.native.js +12 -11
  180. package/dist/esm/utils/getPageExport.native.js.map +6 -1
  181. package/dist/esm/utils/globDir.native.js +5 -3
  182. package/dist/esm/utils/globDir.native.js.map +6 -1
  183. package/dist/esm/utils/hashString.native.js +4 -2
  184. package/dist/esm/utils/hashString.native.js.map +6 -1
  185. package/dist/esm/utils/isResponse.native.js +4 -2
  186. package/dist/esm/utils/isResponse.native.js.map +6 -1
  187. package/dist/esm/utils/isStatus.native.js +4 -2
  188. package/dist/esm/utils/isStatus.native.js.map +6 -1
  189. package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
  190. package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
  191. package/dist/esm/utils/rand.native.js +5 -3
  192. package/dist/esm/utils/rand.native.js.map +6 -1
  193. package/dist/esm/utils/redirect.native.js +7 -5
  194. package/dist/esm/utils/redirect.native.js.map +6 -1
  195. package/dist/esm/utils/removeSearch.native.js +4 -2
  196. package/dist/esm/utils/removeSearch.native.js.map +6 -1
  197. package/dist/esm/utils/removeUndefined.native.js +6 -3
  198. package/dist/esm/utils/removeUndefined.native.js.map +6 -1
  199. package/dist/esm/utils/requireResolve.native.js +4 -2
  200. package/dist/esm/utils/requireResolve.native.js.map +6 -1
  201. package/dist/esm/utils/url.native.js +6 -2
  202. package/dist/esm/utils/url.native.js.map +6 -1
  203. package/dist/esm/utils/weakKey.native.js +11 -10
  204. package/dist/esm/utils/weakKey.native.js.map +6 -1
  205. package/dist/esm/utils/weakMemo.native.js +8 -8
  206. package/dist/esm/utils/weakMemo.native.js.map +6 -1
  207. package/dist/esm/views/EmptyRoute.native.js +5 -3
  208. package/dist/esm/views/EmptyRoute.native.js.map +6 -1
  209. package/dist/esm/views/ErrorBoundary.native.js +5 -8
  210. package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
  211. package/dist/esm/views/LoadProgressBar.native.js +58 -57
  212. package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
  213. package/dist/esm/views/Navigator.native.js +54 -71
  214. package/dist/esm/views/Navigator.native.js.map +6 -1
  215. package/dist/esm/views/PreloadLinks.native.js +3 -1
  216. package/dist/esm/views/PreloadLinks.native.js.map +6 -1
  217. package/dist/esm/views/RootErrorBoundary.native.js +39 -29
  218. package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
  219. package/dist/esm/views/Screen.native.js +12 -12
  220. package/dist/esm/views/Screen.native.js.map +6 -1
  221. package/dist/esm/views/ScrollRestoration.native.js +27 -27
  222. package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
  223. package/dist/esm/views/Try.native.js +40 -37
  224. package/dist/esm/views/Try.native.js.map +6 -1
  225. package/dist/esm/vite/build.native.js +260 -295
  226. package/dist/esm/vite/build.native.js.map +6 -1
  227. package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
  228. package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
  229. package/dist/esm/vite/constants.native.js +6 -4
  230. package/dist/esm/vite/constants.native.js.map +6 -1
  231. package/dist/esm/vite/createFileSystemRouter.native.js +99 -130
  232. package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
  233. package/dist/esm/vite/customNodeExternals.native.js +9 -10
  234. package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
  235. package/dist/esm/vite/ensureTsConfig.native.js +7 -5
  236. package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
  237. package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
  238. package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
  239. package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
  240. package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
  241. package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
  242. package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
  243. package/dist/esm/vite/getManifest.native.js +6 -4
  244. package/dist/esm/vite/getManifest.native.js.map +6 -1
  245. package/dist/esm/vite/headers.native.js +11 -5
  246. package/dist/esm/vite/headers.native.js.map +6 -1
  247. package/dist/esm/vite/loadEnv.native.js +7 -6
  248. package/dist/esm/vite/loadEnv.native.js.map +6 -1
  249. package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
  250. package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
  251. package/dist/esm/vite/one.native.js +142 -127
  252. package/dist/esm/vite/one.native.js.map +6 -1
  253. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
  254. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
  255. package/dist/esm/vite/replaceLoader.js +7 -1
  256. package/dist/esm/vite/replaceLoader.js.map +1 -1
  257. package/dist/esm/vite/replaceLoader.mjs +5 -1
  258. package/dist/esm/vite/replaceLoader.mjs.map +1 -1
  259. package/dist/esm/vite/replaceLoader.native.js +13 -10
  260. package/dist/esm/vite/replaceLoader.native.js.map +6 -1
  261. package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
  262. package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
  263. package/dist/esm/vite/server.native.js +5 -4
  264. package/dist/esm/vite/server.native.js.map +6 -1
  265. package/dist/esm/vite/types.native.js +1 -2
  266. package/dist/esm/vite/types.native.js.map +6 -1
  267. package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
  268. package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
  269. package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
  270. package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
  271. package/dist/esm/vite.native.js +19 -10
  272. package/dist/esm/vite.native.js.map +6 -1
  273. package/dist/esm/zero/getQueryKey.native.js +5 -3
  274. package/dist/esm/zero/getQueryKey.native.js.map +6 -1
  275. package/dist/esm/zero/isZeroQuery.native.js +4 -2
  276. package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
  277. package/dist/esm/zero/resolveQuery.native.js +9 -8
  278. package/dist/esm/zero/resolveQuery.native.js.map +6 -1
  279. package/dist/esm/zero/subscribeToQuery.native.js +5 -3
  280. package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
  281. package/dist/esm/zero/types.native.js +1 -2
  282. package/dist/esm/zero/types.native.js.map +6 -1
  283. package/dist/esm/zero/useQuery.native.js +12 -12
  284. package/dist/esm/zero/useQuery.native.js.map +6 -1
  285. package/dist/esm/zero/useQueryZero.native.js +24 -20
  286. package/dist/esm/zero/useQueryZero.native.js.map +6 -1
  287. package/dist/esm/zero.native.js +9 -5
  288. package/dist/esm/zero.native.js.map +6 -1
  289. package/package.json +7 -7
  290. package/src/Root.tsx +20 -16
  291. package/src/cleanUrl.ts +15 -1
  292. package/src/vite/replaceLoader.ts +7 -1
  293. package/types/cleanUrl.d.ts.map +1 -1
  294. package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -1,64 +1,67 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { useContextKey } from "../Route.native.js";
4
- import { useSortedScreens } from "../useScreens.native.js";
5
- import { Screen } from "../views/Screen.native.js";
3
+ import { useContextKey } from "../Route";
4
+ import { useSortedScreens } from "../useScreens";
5
+ import { Screen } from "../views/Screen";
6
6
  function useFilterScreenChildren(children) {
7
- var {
8
- isCustomNavigator,
9
- contextKey
10
- } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (/** Used for sending developer hints */
11
- {});
12
- return React.useMemo(function () {
13
- var customChildren = [],
14
- screens = React.Children.map(children, function (child) {
15
- if (/* @__PURE__ */React.isValidElement(child) && child && child.type === Screen) {
16
- if (!child.props.name) throw new Error(`<Screen /> component in \`default export\` at \`app${contextKey}/_layout\` must have a \`name\` prop when used as a child of a Layout Route.`);
17
- if (process.env.NODE_ENV !== "production" && ["children", "component", "getComponent"].some(function (key) {
18
- return key in child.props;
19
- })) throw new Error(`<Screen /> component in \`default export\` at \`app${contextKey}/_layout\` must not have a \`children\`, \`component\`, or \`getComponent\` prop when used as a child of a Layout Route`);
20
- return child.props;
21
- }
22
- isCustomNavigator ? customChildren.push(child) : console.warn(`Layout children must be of type Screen, all other children are ignored. To use custom children, create a custom <Layout />. Update Layout Route at: "app${contextKey}/_layout"`);
23
- });
7
+ var { isCustomNavigator, contextKey } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (
8
+ /** Used for sending developer hints */
9
+ {}
10
+ );
11
+ return React.useMemo(function() {
12
+ var customChildren = [], screens = React.Children.map(children, function(child) {
13
+ if (/* @__PURE__ */ React.isValidElement(child) && child && child.type === Screen) {
14
+ if (!child.props.name)
15
+ throw new Error(`<Screen /> component in \`default export\` at \`app${contextKey}/_layout\` must have a \`name\` prop when used as a child of a Layout Route.`);
16
+ if (process.env.NODE_ENV !== "production" && [
17
+ "children",
18
+ "component",
19
+ "getComponent"
20
+ ].some(function(key) {
21
+ return key in child.props;
22
+ }))
23
+ throw new Error(`<Screen /> component in \`default export\` at \`app${contextKey}/_layout\` must not have a \`children\`, \`component\`, or \`getComponent\` prop when used as a child of a Layout Route`);
24
+ return child.props;
25
+ }
26
+ isCustomNavigator ? customChildren.push(child) : console.warn(`Layout children must be of type Screen, all other children are ignored. To use custom children, create a custom <Layout />. Update Layout Route at: "app${contextKey}/_layout"`);
27
+ });
24
28
  if (process.env.NODE_ENV !== "production") {
25
- var names = screens?.map(function (screen) {
29
+ var names = screens?.map(function(screen) {
26
30
  return screen.name;
27
31
  });
28
- if (names && new Set(names).size !== names.length) throw new Error("Screen names must be unique: " + names);
32
+ if (names && new Set(names).size !== names.length)
33
+ throw new Error("Screen names must be unique: " + names);
29
34
  }
30
35
  return {
31
36
  screens,
32
37
  children: customChildren
33
38
  };
34
- }, [children, contextKey, isCustomNavigator]);
39
+ }, [
40
+ children,
41
+ contextKey,
42
+ isCustomNavigator
43
+ ]);
35
44
  }
36
45
  function withLayoutContext(Nav, processor) {
37
- var Navigator = /* @__PURE__ */React.forwardRef(function (param, ref) {
38
- var {
39
- children: userDefinedChildren,
40
- ...props
41
- } = param,
42
- contextKey = useContextKey(),
43
- {
44
- screens
45
- } = useFilterScreenChildren(userDefinedChildren, {
46
- contextKey
47
- }),
48
- processed = processor ? processor(screens ?? []) : screens,
49
- sorted = useSortedScreens(processed ?? []);
50
- return sorted.length ?
51
- // @ts-expect-error
52
- // biome-ignore lint/correctness/noChildrenProp: <explanation>
53
- /* @__PURE__ */
54
- _jsx(Nav, {
55
- ...props,
56
- id: contextKey,
57
- ref,
58
- children: sorted
59
- }) : null;
46
+ var Navigator = /* @__PURE__ */ React.forwardRef(function(param, ref) {
47
+ var { children: userDefinedChildren, ...props } = param, contextKey = useContextKey(), { screens } = useFilterScreenChildren(userDefinedChildren, {
48
+ contextKey
49
+ }), processed = processor ? processor(screens ?? []) : screens, sorted = useSortedScreens(processed ?? []);
50
+ return sorted.length ? (
51
+ // @ts-expect-error
52
+ // biome-ignore lint/correctness/noChildrenProp: <explanation>
53
+ /* @__PURE__ */ _jsx(Nav, {
54
+ ...props,
55
+ id: contextKey,
56
+ ref,
57
+ children: sorted
58
+ })
59
+ ) : null;
60
60
  });
61
61
  return Navigator.Screen = Screen, Navigator;
62
62
  }
63
- export { useFilterScreenChildren, withLayoutContext };
64
- //# sourceMappingURL=withLayoutContext.native.js.map
63
+ export {
64
+ useFilterScreenChildren,
65
+ withLayoutContext
66
+ };
67
+ //# sourceMappingURL=withLayoutContext.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["jsx","_jsx","React","useContextKey","useSortedScreens","Screen","useFilterScreenChildren","children","isCustomNavigator","contextKey","arguments","length","useMemo","customChildren","screens","Children","map","child","isValidElement","type","props","name","Error","process","env","NODE_ENV","some","key","push","console","warn","names","screen","Set","size","withLayoutContext","Nav","processor","Navigator","forwardRef","param","ref","userDefinedChildren","processed","sorted"],"sources":["../../../src/layouts/withLayoutContext.tsx"],"sourcesContent":[null],"mappings":"AACA,SAAOA,GAAA,IAAAC,IAAW;AAElB,OAAAC,KAAS;AAET,SAASC,aAAA,4BAA0C;AACnD,SAASC,gBAAc;AA8Ff,SAAAC,MAAA;AA5FD,SAASC,wBACdC,QAAA,EACA;EACE;IAAA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,QAAIY,QAAQC,IAAIC,aAAa,cAAc;AAEzC,UAAMM,QAAQjB,SAASE,IAAI,SAACgB,QAAAA;eAAWA,OAAOX;;AAC9C,UAAIU,SAAS,IAAIE,IAAIF,KAAAA,EAAOG,SAASH,MAAMI;AACzC,cAAM,IAAIb,MAAM,kCAAkCS,KAAAA;IAEtD;AAEA,WAAO;MACLjB;MACAL,UAAUI;IACZ;EACF,GAAG;IAACJ;IAAUE;IAAYD;GAAkB;AAC9C;AAGO,SAAS0B,kBAMdC,KACAC,WAE6C;AAO7C,MAAMC,YAAYnC,sBAAMoC,WACtB,SAAA,OAA8CC,KAAAA;QAA7C,EAAEhC,UAAUiC,qBAAqB,GAAGtB,MAAAA,IAAO,OACpCT,aAAaN,cAAAA,GAEb,EAAES,QAAO,IAAKN,wBAAwBkC,qBAAqB;MAC/D/B;IACF,CAAA,GAEMgC,YAAYL,YAAYA,UAAUxB,WAAW,CAAA,CAAE,IAAIA,SAEnD8B,SAAStC,iBAAiBqC,aAAa,CAAA,CAAE;AAG/C,WAAKC,OAAOT;;;MAOV,qBAACE,KAAAA;QAAK,GAAGjB;QAAOyB,IAAIlC;QAAY8B;QAAUhC,UAAUmC;;QAN7C;EAQX,CAAA;AAIFL,mBAAUhC,SAASA,QAEZgC;AACT;",
5
+ "names": ["React", "useContextKey", "useSortedScreens", "Screen", "useFilterScreenChildren", "children", "isCustomNavigator", "contextKey", "useMemo", "customChildren", "screens", "Children", "map", "child", "isValidElement", "type", "props", "name", "Error", "process", "env", "NODE_ENV", "some", "key", "push", "console", "warn", "names", "screen", "Set", "size", "length", "withLayoutContext", "Nav", "processor", "Navigator", "forwardRef", "ref", "userDefinedChildren", "processed", "sorted", "id"]
6
+ }
@@ -2,44 +2,41 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Slot } from "@radix-ui/react-slot";
3
3
  import * as React from "react";
4
4
  import { Platform, Text } from "react-native";
5
- import { resolveHref } from "./href.native.js";
6
- import { useLinkTo } from "./useLinkTo.native.js";
7
- var Link = /* @__PURE__ */React.forwardRef(function (param, ref) {
5
+ import { resolveHref } from "./href";
6
+ import { useLinkTo } from "./useLinkTo";
7
+ var Link = /* @__PURE__ */ React.forwardRef(function(param, ref) {
8
8
  var {
9
- href,
10
- replace,
11
- push,
12
- // TODO: This does not prevent default on the anchor tag.
13
- asChild,
14
- rel,
15
- target,
16
- download,
17
- ...rest
18
- } = param,
19
- style = useInteropClassName(rest),
20
- hrefAttrs = useHrefAttrs({
21
- asChild,
22
- rel,
23
- target,
24
- download
25
- }),
26
- resolvedHref = React.useMemo(function () {
27
- if (href == null) throw new Error("Link: href is required");
28
- return resolveHref(href);
29
- }, [href]),
30
- props = useLinkTo({
31
- href: resolvedHref,
32
- replace
33
- }),
34
- onPress = function (e) {
35
- if ("onPress" in rest) {
36
- var _rest_onPress;
37
- (_rest_onPress = rest.onPress) === null || _rest_onPress === void 0 || _rest_onPress.call(rest, e);
38
- }
39
- props.onPress(e);
40
- },
41
- Element = asChild ? Slot : Text;
42
- return /* @__PURE__ */_jsx(Element, {
9
+ href,
10
+ replace,
11
+ push,
12
+ // TODO: This does not prevent default on the anchor tag.
13
+ asChild,
14
+ rel,
15
+ target,
16
+ download,
17
+ ...rest
18
+ } = param, style = useInteropClassName(rest), hrefAttrs = useHrefAttrs({
19
+ asChild,
20
+ rel,
21
+ target,
22
+ download
23
+ }), resolvedHref = React.useMemo(function() {
24
+ if (href == null)
25
+ throw new Error("Link: href is required");
26
+ return resolveHref(href);
27
+ }, [
28
+ href
29
+ ]), props = useLinkTo({
30
+ href: resolvedHref,
31
+ replace
32
+ }), onPress = function(e) {
33
+ if ("onPress" in rest) {
34
+ var _rest_onPress;
35
+ (_rest_onPress = rest.onPress) === null || _rest_onPress === void 0 || _rest_onPress.call(rest, e);
36
+ }
37
+ props.onPress(e);
38
+ }, Element = asChild ? Slot : Text;
39
+ return /* @__PURE__ */ _jsx(Element, {
43
40
  ref,
44
41
  ...props,
45
42
  ...hrefAttrs,
@@ -57,24 +54,29 @@ var Link = /* @__PURE__ */React.forwardRef(function (param, ref) {
57
54
  });
58
55
  Link.resolveHref = resolveHref;
59
56
  function useInteropClassName(props) {
60
- return Platform.OS !== "web" ? props.style : React.useMemo(function () {
61
- if (props.className == null) return props.style;
57
+ return Platform.OS !== "web" ? props.style : React.useMemo(function() {
58
+ if (props.className == null)
59
+ return props.style;
62
60
  var cssStyle = {
63
61
  $$css: !0,
64
62
  __routerLinkClassName: props.className
65
63
  };
66
- return Array.isArray(props.style) ? [...props.style, cssStyle] : [props.style, cssStyle];
67
- }, [props.style, props.className]);
64
+ return Array.isArray(props.style) ? [
65
+ ...props.style,
66
+ cssStyle
67
+ ] : [
68
+ props.style,
69
+ cssStyle
70
+ ];
71
+ }, [
72
+ props.style,
73
+ props.className
74
+ ]);
68
75
  }
69
76
  var useHrefAttrs = Platform.select({
70
- web: function (param) {
71
- var {
72
- asChild,
73
- rel,
74
- target,
75
- download
76
- } = param;
77
- return React.useMemo(function () {
77
+ web: function(param) {
78
+ var { asChild, rel, target, download } = param;
79
+ return React.useMemo(function() {
78
80
  var hrefAttrs = {
79
81
  rel,
80
82
  target,
@@ -83,11 +85,18 @@ var useHrefAttrs = Platform.select({
83
85
  return asChild ? hrefAttrs : {
84
86
  hrefAttrs
85
87
  };
86
- }, [asChild, rel, target, download]);
88
+ }, [
89
+ asChild,
90
+ rel,
91
+ target,
92
+ download
93
+ ]);
87
94
  },
88
- default: function () {
95
+ default: function() {
89
96
  return {};
90
97
  }
91
98
  });
92
- export { Link };
93
- //# sourceMappingURL=Link.native.js.map
99
+ export {
100
+ Link
101
+ };
102
+ //# sourceMappingURL=Link.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["jsx","_jsx","Slot","React","Platform","Text","resolveHref","useLinkTo","Link","forwardRef","param","ref","href","replace","push","asChild","rel","target","download","rest","style","useInteropClassName","hrefAttrs","useHrefAttrs","resolvedHref","useMemo","Error","props","onPress","e","_rest_onPress","call","Element","select","web","onClick","default","OS","className","cssStyle","$$css","__routerLinkClassName","Array","isArray"],"sources":["../../../src/link/Link.tsx"],"sourcesContent":[null],"mappings":"AAEA,SAASA,GAAA,IAAAC,IAAA,QAAY;AACrB,SAAAC,IAAY,8BAAW;AACvB,YAASC,KAAA,MAAU;AAGnB,SAASC,QAAA,EAAAC,IAAA,QAAmB;AAC5B,SAASC,WAAA,QAAiB;AAqDtB,SAAAC,SAAA;AAxCG,IAAAC,IAAM,kBAAaL,KAAW,CAAAM,UACnC,WAAAC,KAAA,EAAAC,GAAA;EACE;MACAC,IAAA;MACAC,OAAA;MAAAC,IAAA;MAEA;MACAC,OAAA;MACAC,GAAA;MACAC,MAAA;MACAC,QAAG;MAEL,GAAAC;IAGA,IAAAT,KAAM;IAAAU,KAAQ,GAAAC,mBAAwB,CAAAF,IAGhC;IAAAG,SAAY,GAAAC,YAAe;MAG/BR,OAAI;MACFC,GAAA;MAEFC,MAAA;MACFC;IAKE,EAAI;IAAAM,YAAa,GAAArB,KACf,CAAAsB,OAAK,aAEP;MACF,IAAAb,IAAA,UAKA,MACE,IAAAc,KAAA;MAJc,OAAApB,WAAiB,CAAAM,IAAA;IAAA,GAI9B,CAAAA,IACC;IACCe,KAAG,GAAApB,SAAA;MAAAK,IACH,EAAGY,YAAA;MAAAX;IACA;IACJe,OAAO,YAAAA,CAAUC,CAAA;MAAO,IACvB,SAAG,IAASV,IAAO;QAAA,IAClBW,aAAK;QAAA,CAAAA,aACM,GAAAX,IAAA,CAAAS,OAAA,cAAAE,aAAA,eAAAA,aAAA,CAAAC,IAAA,CAAAZ,IAAA,EAAAU,CAAA;MAAA;MACXF,KACA,CAAAC,OAAS,CAAAC,CAAE;IAAQ;IAAAG,OACpB,GAAAjB,OAAA,GAAAb,IAAA,GAAAG,IAAA;EAAA,sBAAAJ,IAAA,CAAA+B,OAAA;IACHrB,GAAA;IAEH,GAAAgB,KAAA;IAED,GAAKL,SAAA;IAGL,GAAAH,IAAS;IACPC,KAAI,EAAAL,OAAS,OAAO,GAAAK,KACX;IAKP,GAAAhB,QAAU,CAAA6B,MAAA;MACRC,GAAA;QAEFC,OAAM,EAAAP;MACJ;MACAQ,OAAA;QACFR;MAEA;IAIF,CAAG;EACL;AAEA;AAIEpB,IACA,CAAAF,WAA2B,GAAAA,WAAA;AAAA,SACzBe,oBAAAM,KAAA;EAAA,OACAvB,QAAA,CAAAiC,EAAA,aAAAV,KAAA,CAAAP,KAAA,GAAAjB,KAAA,CAAAsB,OAAA;IACA,IAAAE,KAAA,CAAAW,SAAA,UACA,OAAAX,KAAA,CAAAP,KAAA;IACF,IAAsCmB,QAAA;MACpCC,KAAO;MACLC,qBAAkB,EAAAd,KAAA,CAAAW;IAAA;IAChB,OACAI,KAAA,CAAAC,OAAA,CAAAhB,KAAA,CAAAP,KAAA,QACAO,KAAA,CAAAP,KAAA,EACFmB,QAAA,CACA,IAGOZ,KACL,CAAAP,KAAA,EACFmB,QAAA,CACF;EACF,IACAZ,KAAA,CAAAP,KAAS,EACPO,KAAA,CAAAW,SAAQ,CACV;AACF","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/link/Users/n8/one/packages/one/src/link/Link.tsx"],
4
+ "mappings": ";AAEA,SAASA,YAAY;AACrB,YAAYC,WAAW;AACvB,SAASC,UAAUC,YAAwD;AAG3E,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAanB,IAAMC,OAAOL,sBAAMM,WAAW,SACnC,OAWAC,KAA6B;MAX7B;IACEC;IACAC;IACAC;;IAEAC;IACAC;IACAC;IACAC;IACA,GAAGC;EAAAA,IATL,OAcMC,QAAQC,oBAAoBF,IAAAA,GAG5BG,YAAYC,aAAa;IAAER;IAASC;IAAKC;IAAQC;EAAS,CAAA,GAE1DM,eAAepB,MAAMqB,QAAQ,WAAA;AACjC,QAAIb,QAAQ;AACV,YAAM,IAAIc,MAAM,wBAAA;AAElB,WAAOnB,YAAYK,IAAAA;EACrB,GAAG;IAACA;GAAK,GAEHe,QAA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Ref", "ref", "href", "replace", "push", "asChild", "rel", "target", "download", "rest", "style", "useInteropClassName", "hrefAttrs", "useHrefAttrs", "resolvedHref", "useMemo", "Error", "props", "onPress", "e", "Element", "select", "web", "onClick", "default", "OS", "className", "cssStyle", "$$css", "__routerLinkClassName", "Array", "isArray"]
6
+ }
@@ -1,11 +1,8 @@
1
- import { useRouter } from "../hooks.native.js";
2
- import { useFocusEffect } from "../useFocusEffect.native.js";
1
+ import { useRouter } from "../hooks";
2
+ import { useFocusEffect } from "../useFocusEffect";
3
3
  function Redirect(param) {
4
- var {
5
- href
6
- } = param,
7
- router = useRouter();
8
- return useFocusEffect(function () {
4
+ var { href } = param, router = useRouter();
5
+ return useFocusEffect(function() {
9
6
  try {
10
7
  router.replace(href);
11
8
  } catch (error) {
@@ -13,5 +10,7 @@ function Redirect(param) {
13
10
  }
14
11
  }), null;
15
12
  }
16
- export { Redirect };
17
- //# sourceMappingURL=Redirect.native.js.map
13
+ export {
14
+ Redirect
15
+ };
16
+ //# sourceMappingURL=Redirect.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["useRouter","useFocusEffect","Redirect","param","href","router","replace","error","console"],"sources":["../../../src/link/Redirect.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,QAAiB;AAE1B,SAASC,cAAA,QAAsB;AAGxB,SAASC,SAASC,KAAE,EAAK;EAC9B;MAAMC;IAAA,IAASD,KAAA;IAAAE,MAAU,GAAAL,SAAA;EACzB,OAAAC,cAAA,CAAe,YAAM;IACnB,IAAI;MACFI,MAAA,CAAOC,OAAA,CAAQF,IAAI;IACrB,SAASG,KAAA,EAAO;MACdC,OAAA,CAAQD,KAAA,CAAMA,KAAK;IACrB;EACF,CAAC,GACM;AACT","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/link/Users/n8/one/packages/one/src/link/Redirect.tsx"],
4
+ "mappings": "AAAA,SAASA,iBAAiB;AAE1B,SAASC,sBAAsB;AAGxB,SAASC,SAAS,OAAkC;MAAlC,EAAEC,KAAI,IAAN,OACjBC,SAASJ,UAAAA;AACfC,wBAAe,WAAA;AACb,QAAI;AACFG,aAAOC,QAAQF,IAAAA;IACjB,SAASG,OAAO;AACdC,cAAQD,MAAMA,KAAAA;IAChB;EACF,CAAA,GACO;AACT;",
5
+ "names": ["useRouter", "useFocusEffect", "Redirect", "href", "router", "replace", "error", "console"]
6
+ }
@@ -1,29 +1,27 @@
1
- var resolveHref = function (href) {
2
- if (typeof href == "string") return resolveHref({
3
- pathname: href
4
- });
5
- var _href_pathname,
6
- path = (_href_pathname = href.pathname) !== null && _href_pathname !== void 0 ? _href_pathname : "";
7
- if (!href?.params) return path;
8
- var {
9
- pathname,
10
- params
11
- } = createQualifiedPathname(path, {
12
- ...href.params
13
- }),
14
- paramsString = createQueryParams(params);
1
+ var resolveHref = function(href) {
2
+ if (typeof href == "string")
3
+ return resolveHref({
4
+ pathname: href
5
+ });
6
+ var _href_pathname, path = (_href_pathname = href.pathname) !== null && _href_pathname !== void 0 ? _href_pathname : "";
7
+ if (!href?.params)
8
+ return path;
9
+ var { pathname, params } = createQualifiedPathname(path, {
10
+ ...href.params
11
+ }), paramsString = createQueryParams(params);
15
12
  return pathname + (paramsString ? `?${paramsString}` : "");
16
13
  };
17
14
  function createQualifiedPathname(pathname, params) {
18
- var _iteratorNormalCompletion = !0,
19
- _didIteratorError = !1,
20
- _iteratorError = void 0;
15
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
21
16
  try {
22
17
  for (var _iterator = Object.entries(params)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
23
- var [key, value = ""] = _step.value,
24
- dynamicKey = `[${key}]`,
25
- deepDynamicKey = `[...${key}]`;
26
- if (pathname.includes(dynamicKey)) pathname = pathname.replace(dynamicKey, encodeParam(value));else if (pathname.includes(deepDynamicKey)) pathname = pathname.replace(deepDynamicKey, encodeParam(value));else continue;
18
+ var [key, value = ""] = _step.value, dynamicKey = `[${key}]`, deepDynamicKey = `[...${key}]`;
19
+ if (pathname.includes(dynamicKey))
20
+ pathname = pathname.replace(dynamicKey, encodeParam(value));
21
+ else if (pathname.includes(deepDynamicKey))
22
+ pathname = pathname.replace(deepDynamicKey, encodeParam(value));
23
+ else
24
+ continue;
27
25
  delete params[key];
28
26
  }
29
27
  } catch (err) {
@@ -32,7 +30,8 @@ function createQualifiedPathname(pathname, params) {
32
30
  try {
33
31
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
34
32
  } finally {
35
- if (_didIteratorError) throw _iteratorError;
33
+ if (_didIteratorError)
34
+ throw _iteratorError;
36
35
  }
37
36
  }
38
37
  return {
@@ -41,18 +40,20 @@ function createQualifiedPathname(pathname, params) {
41
40
  };
42
41
  }
43
42
  function encodeParam(param) {
44
- return Array.isArray(param) ? param.map(function (p) {
43
+ return Array.isArray(param) ? param.map(function(p) {
45
44
  return encodeParam(p);
46
45
  }).join("/") : encodeURIComponent(`${param}`);
47
46
  }
48
47
  function createQueryParams(params) {
49
- return Object.entries(params).filter(function (param) {
48
+ return Object.entries(params).filter(function(param) {
50
49
  var [, value] = param;
51
50
  return value != null;
52
- }).map(function (param) {
51
+ }).map(function(param) {
53
52
  var [key, value] = param;
54
53
  return `${key}=${encodeURIComponent(value.toString())}`;
55
54
  }).join("&");
56
55
  }
57
- export { resolveHref };
58
- //# sourceMappingURL=href.native.js.map
56
+ export {
57
+ resolveHref
58
+ };
59
+ //# sourceMappingURL=href.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["resolveHref","href","pathname","_href_pathname","path","params","createQualifiedPathname","paramsString","createQueryParams","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","Symbol","iterator","_step","next","done","key","value","dynamicKey","deepDynamicKey","includes","replace","encodeParam","err"],"sources":["../../../src/link/href.ts"],"sourcesContent":[null],"mappings":"AAGO,IAAAA,WAAM,YAAAA,CAAeC,IAAiC;EA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AAI,SAACC,GAAAA;WAAML,YAAYK,CAAAA;KAAIC,KAAK,GAAA,IACtCC,mBAAmB,GAAGN,KAAAA,EAAO;AACnC;AAEA,SAASV,kBAAkBH,QAA2B;AACpD,SACEI,OAAOC,QAAQL,MAAAA,EAEZoB,OAAO,SAAA,OAAA;QAAC,CAAA,EAAGb,KAAAA,IAAM;WAAKA,SAAS;KAC/BS,IAAI,SAAA,OAAA;QAAC,CAACV,KAAKC,KAAAA,IAAM;WAAK,GAAGD,GAAAA,IAAOa,mBAAmBZ,MAAMc,SAAQ,CAAA,CAAA;KACjEH,KAAK,GAAA;AAEZ;",
5
+ "names": ["resolveHref", "href", "pathname", "path", "params", "createQualifiedPathname", "paramsString", "createQueryParams", "Object", "entries", "key", "value", "dynamicKey", "deepDynamicKey", "includes", "replace", "encodeParam", "param", "Array", "isArray", "map", "p", "join", "encodeURIComponent", "filter", "toString"]
6
+ }
@@ -1,11 +1,9 @@
1
1
  import * as Linking from "expo-linking";
2
2
  import { Platform } from "react-native";
3
- import { adjustPathname } from "../fork/extractPathFromURL.native.js";
4
- import getPathFromState from "../fork/getPathFromState.native.js";
5
- import getStateFromPath from "../fork/getStateFromPath.native.js";
6
- var _globalThis_expo_modules,
7
- _globalThis_expo,
8
- isExpoGo = typeof expo < "u" && ((_globalThis_expo = globalThis.expo) === null || _globalThis_expo === void 0 || (_globalThis_expo_modules = _globalThis_expo.modules) === null || _globalThis_expo_modules === void 0 ? void 0 : _globalThis_expo_modules.ExpoGo);
3
+ import { adjustPathname } from "../fork/extractPathFromURL";
4
+ import getPathFromState from "../fork/getPathFromState";
5
+ import getStateFromPath from "../fork/getStateFromPath";
6
+ var _globalThis_expo_modules, _globalThis_expo, isExpoGo = typeof expo < "u" && ((_globalThis_expo = globalThis.expo) === null || _globalThis_expo === void 0 || (_globalThis_expo_modules = _globalThis_expo.modules) === null || _globalThis_expo_modules === void 0 ? void 0 : _globalThis_expo_modules.ExpoGo);
9
7
  function getInitialURL() {
10
8
  if (process.env.NODE_ENV === "test") {
11
9
  var _Linking_getInitialURL;
@@ -13,28 +11,37 @@ function getInitialURL() {
13
11
  }
14
12
  if (Platform.OS === "web") {
15
13
  var _window_location;
16
- if (typeof window > "u") return "";
17
- if (!((_window_location = window.location) === null || _window_location === void 0) && _window_location.href) return window.location.href;
14
+ if (typeof window > "u")
15
+ return "";
16
+ if (!((_window_location = window.location) === null || _window_location === void 0) && _window_location.href)
17
+ return window.location.href;
18
18
  }
19
- return Promise.race([async function () {
20
- var url = await Linking.getInitialURL();
21
- if (url && isExpoGo) {
22
- var parsed = Linking.parse(url);
23
- if (parsed.path === null || ["", "/"].includes(adjustPathname({
24
- hostname: parsed.hostname,
25
- pathname: parsed.path
26
- }))) return getRootURL();
27
- }
28
- return url ?? getRootURL();
29
- }(), new Promise(function (resolve) {
30
- return (
31
- // Timeout in 150ms if `getInitialState` doesn't resolve
32
- // Workaround for https://github.com/facebook/react-native/issues/25675
33
- setTimeout(function () {
34
- return resolve(getRootURL());
35
- }, 150)
36
- );
37
- })]);
19
+ return Promise.race([
20
+ async function() {
21
+ var url = await Linking.getInitialURL();
22
+ if (url && isExpoGo) {
23
+ var parsed = Linking.parse(url);
24
+ if (parsed.path === null || [
25
+ "",
26
+ "/"
27
+ ].includes(adjustPathname({
28
+ hostname: parsed.hostname,
29
+ pathname: parsed.path
30
+ })))
31
+ return getRootURL();
32
+ }
33
+ return url ?? getRootURL();
34
+ }(),
35
+ new Promise(function(resolve) {
36
+ return (
37
+ // Timeout in 150ms if `getInitialState` doesn't resolve
38
+ // Workaround for https://github.com/facebook/react-native/issues/25675
39
+ setTimeout(function() {
40
+ return resolve(getRootURL());
41
+ }, 150)
42
+ );
43
+ })
44
+ ]);
38
45
  }
39
46
  var _rootURL;
40
47
  function getRootURL() {
@@ -42,26 +49,30 @@ function getRootURL() {
42
49
  }
43
50
  function addEventListener(listener) {
44
51
  var callback;
45
- isExpoGo ? callback = function (param) {
46
- var {
47
- url
48
- } = param,
49
- parsed = Linking.parse(url);
50
- parsed.path === null || ["", "/"].includes(adjustPathname({
52
+ isExpoGo ? callback = function(param) {
53
+ var { url } = param, parsed = Linking.parse(url);
54
+ parsed.path === null || [
55
+ "",
56
+ "/"
57
+ ].includes(adjustPathname({
51
58
  hostname: parsed.hostname,
52
59
  pathname: parsed.path
53
60
  })) ? listener(getRootURL()) : listener(url);
54
- } : callback = function (param) {
55
- var {
56
- url
57
- } = param;
61
+ } : callback = function(param) {
62
+ var { url } = param;
58
63
  return listener(url);
59
64
  };
60
65
  var subscription = Linking.addEventListener("url", callback);
61
- return function () {
66
+ return function() {
62
67
  var _subscription_remove;
63
68
  subscription == null || (_subscription_remove = subscription.remove) === null || _subscription_remove === void 0 || _subscription_remove.call(subscription);
64
69
  };
65
70
  }
66
- export { addEventListener, getInitialURL, getPathFromState, getRootURL, getStateFromPath };
67
- //# sourceMappingURL=linking.native.js.map
71
+ export {
72
+ addEventListener,
73
+ getInitialURL,
74
+ getPathFromState,
75
+ getRootURL,
76
+ getStateFromPath
77
+ };
78
+ //# sourceMappingURL=linking.js.map
@@ -1 +1,6 @@
1
- {"version":3,"names":["Linking","Platform","adjustPathname","getPathFromState","getStateFromPath","_globalThis_expo_modules","_globalThis_expo","isExpoGo","expo","globalThis","modules","ExpoGo","getInitialURL","process","env","NODE_ENV","_Linking_getInitialURL","getRootURL","OS","_window_location","window","location","href","Promise","race","url","parsed","parse","path","includes","hostname","pathname","resolve","setTimeout","_rootURL","createURL","addEventListener","listener","callback","param"],"sources":["../../../src/link/linking.ts"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,OAAA,MAAa;AACzB,SAASC,QAAA,QAAgB;AAEzB,SAASC,cAAA,QAAsB;AAC/B,OAAOC,gBAAA,MAAsB;AAC7B,OAAOC,gBAAA,MAAsB;AAG7B,IAAAC,wBAAwB;EAAAC,gBAAwB;EAAAC,QAAiB,UAASC,IAAA,YAAAF,gBAAA,GAAAG,UAAA,CAAAD,IAAA,cAAAF,gBAAA,gBAAA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OO,OAAOP,WAAAA;IAChB,EAAA;IACA,IAAIK,QAAgB,SAACS,SAAAA;;;;QAGnBC,WAAW,WAAA;iBAAMD,QAAQd,WAAAA,CAAAA;WAAe,GAAA;;;GAE3C;AACH;AAEA,IAAIgB;AAEG,SAAShB,aAAAA;AACd,SAAIgB,aAAaC,WACfD,WAAW9B,QAAQgC,UAAU,GAAA,IAExBF;AACT;AAEO,SAASG,iBAAiBC,UAA+B;AAC9D,MAAIC;AAEJ,EAAI7B,WAEF6B,WAAW,SAAA,OAAA;QAAC,EAAEd,IAAG,IAAmB,OAC5BC,SAAStB,QAAQuB,MAAMF,GAAAA;AAI7B,IACEC,OAAOE,SAAS,QAChB;MAAC;MAAI;MAAKC,SAASvB,eAAe;MAAEwB,UAAUJ,OAAOI;MAAUC,UAAUL,OAAOE;IAAK,CAAA,CAAA,IAErFU,SAASpB,WAAAA,CAAAA,IAEToB,SAASb,GAAAA;EAEb,IAEAc,WAAW,SAAA,OAAA;QAAC,EAAEd,IAAG,IAAmB;WAAKa,SAASb,GAAAA;;AAEpD,MAAMe,eAAepC,QAAQiC,iBAAiB,OAAOE,QAAAA;AAErD,SAAO,WAAA;QAELC;AAAAA,oBAAAA,SAAAA,uBAAAA,aAAcC,YAAM,QAApBD,yBAAAA,UAAAA,qBAAAA,KAAAA,YAAAA;EACF;AACF;",
5
+ "names": ["Linking", "Platform", "adjustPathname", "getPathFromState", "getStateFromPath", "globalThis", "isExpoGo", "expo", "modules", "ExpoGo", "getInitialURL", "process", "env", "NODE_ENV", "getRootURL", "OS", "window", "location", "href", "Promise", "race", "url", "parsed", "parse", "path", "includes", "hostname", "pathname", "resolve", "setTimeout", "_rootURL", "undefined", "createURL", "addEventListener", "listener", "callback", "subscription", "remove"]
6
+ }
@@ -1,29 +1,35 @@
1
1
  function assertPath(path) {
2
- if (typeof path != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
2
+ if (typeof path != "string")
3
+ throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
3
4
  }
4
5
  function normalizeStringPosix(path, allowAboveRoot) {
5
6
  for (var res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code, i = 0; i <= path.length; ++i) {
6
- if (i < path.length) code = path.charCodeAt(i);else {
7
- if (code === 47) break;
7
+ if (i < path.length)
8
+ code = path.charCodeAt(i);
9
+ else {
10
+ if (code === 47)
11
+ break;
8
12
  code = 47;
9
13
  }
10
14
  if (code === 47) {
11
- if (!(lastSlash === i - 1 || dots === 1)) if (lastSlash !== i - 1 && dots === 2) {
12
- if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || /*.*/
13
- res.charCodeAt(res.length - 2) !== 46) {
14
- if (res.length > 2) {
15
- var lastSlashIndex = res.lastIndexOf("/");
16
- if (lastSlashIndex !== res.length - 1) {
17
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = i, dots = 0;
15
+ if (!(lastSlash === i - 1 || dots === 1))
16
+ if (lastSlash !== i - 1 && dots === 2) {
17
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || /*.*/
18
+ res.charCodeAt(res.length - 2) !== 46) {
19
+ if (res.length > 2) {
20
+ var lastSlashIndex = res.lastIndexOf("/");
21
+ if (lastSlashIndex !== res.length - 1) {
22
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = i, dots = 0;
23
+ continue;
24
+ }
25
+ } else if (res.length === 2 || res.length === 1) {
26
+ res = "", lastSegmentLength = 0, lastSlash = i, dots = 0;
18
27
  continue;
19
28
  }
20
- } else if (res.length === 2 || res.length === 1) {
21
- res = "", lastSegmentLength = 0, lastSlash = i, dots = 0;
22
- continue;
23
29
  }
24
- }
25
- allowAboveRoot && (res.length > 0 ? res += "/.." : res = "..", lastSegmentLength = 2);
26
- } else res.length > 0 ? res += "/" + path.slice(lastSlash + 1, i) : res = path.slice(lastSlash + 1, i), lastSegmentLength = i - lastSlash - 1;
30
+ allowAboveRoot && (res.length > 0 ? res += "/.." : res = "..", lastSegmentLength = 2);
31
+ } else
32
+ res.length > 0 ? res += "/" + path.slice(lastSlash + 1, i) : res = path.slice(lastSlash + 1, i), lastSegmentLength = i - lastSlash - 1;
27
33
  lastSlash = i, dots = 0;
28
34
  } else code === 46 && /*.*/
29
35
  dots !== -1 ? ++dots : dots = -1;
@@ -31,12 +37,15 @@ function normalizeStringPosix(path, allowAboveRoot) {
31
37
  return res;
32
38
  }
33
39
  function resolve() {
34
- for (var _len = arguments.length, segments = new Array(_len), _key = 0; _key < _len; _key++) segments[_key] = arguments[_key];
40
+ for (var _len = arguments.length, segments = new Array(_len), _key = 0; _key < _len; _key++)
41
+ segments[_key] = arguments[_key];
35
42
  for (var resolvedPath = "", resolvedAbsolute = !1, i = segments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
36
43
  var path = void 0;
37
44
  i >= 0 ? path = segments[i] : path = "/", assertPath(path), path.length !== 0 && (resolvedPath = path + "/" + resolvedPath, resolvedAbsolute = path.charCodeAt(0) === 47);
38
45
  }
39
46
  return resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute), resolvedAbsolute ? resolvedPath.length > 0 ? "/" + resolvedPath : "/" : resolvedPath.length > 0 ? resolvedPath : ".";
40
47
  }
41
- export { resolve };
42
- //# sourceMappingURL=path.native.js.map
48
+ export {
49
+ resolve
50
+ };
51
+ //# sourceMappingURL=path.js.map