expo-router 6.1.0-canary-20251015-a6a1272 → 7.0.0-canary-20251031-b135dff

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/_error.js +36 -3
  2. package/build/ExpoRoot.js +1 -1
  3. package/build/ExpoRoot.js.map +1 -1
  4. package/build/global-state/router-store.d.ts +2 -0
  5. package/build/global-state/router-store.d.ts.map +1 -1
  6. package/build/global-state/router-store.js +16 -12
  7. package/build/global-state/router-store.js.map +1 -1
  8. package/build/global-state/routing.d.ts +12 -4
  9. package/build/global-state/routing.d.ts.map +1 -1
  10. package/build/global-state/routing.js +35 -10
  11. package/build/global-state/routing.js.map +1 -1
  12. package/build/global-state/storeContext.d.ts +2 -0
  13. package/build/global-state/storeContext.d.ts.map +1 -1
  14. package/build/internal/routing.d.ts +7 -0
  15. package/build/internal/routing.d.ts.map +1 -0
  16. package/build/internal/routing.js +21 -0
  17. package/build/internal/routing.js.map +1 -0
  18. package/build/internal/rsc.d.ts +5 -0
  19. package/build/internal/rsc.d.ts.map +1 -0
  20. package/build/internal/rsc.js +18 -0
  21. package/build/internal/rsc.js.map +1 -0
  22. package/build/internal/static.d.ts +3 -0
  23. package/build/internal/static.d.ts.map +1 -0
  24. package/build/internal/static.js +8 -0
  25. package/build/internal/static.js.map +1 -0
  26. package/build/internal/testing.d.ts +3 -0
  27. package/build/internal/testing.d.ts.map +1 -0
  28. package/build/internal/testing.js +11 -0
  29. package/build/internal/testing.js.map +1 -0
  30. package/build/internal/utils.d.ts +2 -0
  31. package/build/internal/utils.d.ts.map +1 -0
  32. package/build/internal/utils.js +6 -0
  33. package/build/internal/utils.js.map +1 -0
  34. package/build/layouts/BaseStack.d.ts +3 -0
  35. package/build/layouts/BaseStack.d.ts.map +1 -0
  36. package/build/layouts/BaseStack.js +8 -0
  37. package/build/layouts/BaseStack.js.map +1 -0
  38. package/build/layouts/ExperimentalModalStack.d.ts +9 -0
  39. package/build/layouts/ExperimentalModalStack.d.ts.map +1 -0
  40. package/build/layouts/ExperimentalModalStack.js +15 -0
  41. package/build/layouts/ExperimentalModalStack.js.map +1 -0
  42. package/build/layouts/IsWithinLayoutContext.d.ts +2 -0
  43. package/build/layouts/IsWithinLayoutContext.d.ts.map +1 -0
  44. package/build/layouts/IsWithinLayoutContext.js +7 -0
  45. package/build/layouts/IsWithinLayoutContext.js.map +1 -0
  46. package/build/layouts/Stack.web.d.ts +1 -14
  47. package/build/layouts/Stack.web.d.ts.map +1 -1
  48. package/build/layouts/Stack.web.js +10 -13
  49. package/build/layouts/Stack.web.js.map +1 -1
  50. package/build/layouts/_web-modal.d.ts +3 -0
  51. package/build/layouts/_web-modal.d.ts.map +1 -0
  52. package/build/layouts/_web-modal.js +8 -0
  53. package/build/layouts/_web-modal.js.map +1 -0
  54. package/build/layouts/withLayoutContext.d.ts.map +1 -1
  55. package/build/layouts/withLayoutContext.js +5 -2
  56. package/build/layouts/withLayoutContext.js.map +1 -1
  57. package/build/loaders/ServerDataLoaderContext.d.ts +2 -1
  58. package/build/loaders/ServerDataLoaderContext.d.ts.map +1 -1
  59. package/build/loaders/ServerDataLoaderContext.js.map +1 -1
  60. package/build/modal/web/ModalStack.d.ts.map +1 -1
  61. package/build/modal/web/ModalStack.js +7 -2
  62. package/build/modal/web/ModalStack.js.map +1 -1
  63. package/build/native-tabs/{NativeBottomTabs/NativeBottomTabsNavigator.d.ts → NativeBottomTabsNavigator.d.ts} +3 -3
  64. package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -0
  65. package/build/native-tabs/{NativeBottomTabs/NativeBottomTabsNavigator.js → NativeBottomTabsNavigator.js} +49 -14
  66. package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -0
  67. package/build/native-tabs/NativeBottomTabsRouter.d.ts.map +1 -0
  68. package/build/native-tabs/{NativeBottomTabs/NativeBottomTabsRouter.js → NativeBottomTabsRouter.js} +1 -1
  69. package/build/native-tabs/NativeBottomTabsRouter.js.map +1 -0
  70. package/build/native-tabs/{NativeBottomTabs/NativeTabTrigger.d.ts → NativeTabTrigger.d.ts} +1 -1
  71. package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -0
  72. package/build/native-tabs/{NativeBottomTabs/NativeTabTrigger.js → NativeTabTrigger.js} +9 -5
  73. package/build/native-tabs/NativeTabTrigger.js.map +1 -0
  74. package/build/native-tabs/NativeTabs.d.ts.map +1 -0
  75. package/build/native-tabs/{NativeBottomTabs/NativeTabs.js → NativeTabs.js} +2 -0
  76. package/build/native-tabs/NativeTabs.js.map +1 -0
  77. package/build/native-tabs/NativeTabsTriggerTabBar.d.ts.map +1 -0
  78. package/build/native-tabs/NativeTabsTriggerTabBar.js.map +1 -0
  79. package/build/native-tabs/NativeTabsView.d.ts.map +1 -0
  80. package/build/native-tabs/NativeTabsView.js +103 -0
  81. package/build/native-tabs/NativeTabsView.js.map +1 -0
  82. package/build/native-tabs/NativeTabsView.web.d.ts.map +1 -0
  83. package/build/native-tabs/{NativeBottomTabs/NativeTabsView.web.js → NativeTabsView.web.js} +18 -57
  84. package/build/native-tabs/NativeTabsView.web.js.map +1 -0
  85. package/build/native-tabs/{NativeBottomTabs/appearance.d.ts → appearance.d.ts} +2 -2
  86. package/build/native-tabs/appearance.d.ts.map +1 -0
  87. package/build/native-tabs/{NativeBottomTabs/appearance.js → appearance.js} +18 -6
  88. package/build/native-tabs/appearance.js.map +1 -0
  89. package/build/native-tabs/common/elements.d.ts +1 -1
  90. package/build/native-tabs/common/elements.d.ts.map +1 -1
  91. package/build/native-tabs/common/elements.js.map +1 -1
  92. package/build/native-tabs/index.d.ts +4 -4
  93. package/build/native-tabs/index.d.ts.map +1 -1
  94. package/build/native-tabs/index.js +3 -3
  95. package/build/native-tabs/index.js.map +1 -1
  96. package/build/native-tabs/{NativeBottomTabs/types.d.ts → types.d.ts} +19 -6
  97. package/build/native-tabs/types.d.ts.map +1 -0
  98. package/build/native-tabs/types.js.map +1 -0
  99. package/build/native-tabs/{NativeBottomTabs/utils.d.ts → utils/children.d.ts} +1 -3
  100. package/build/native-tabs/utils/children.d.ts.map +1 -0
  101. package/build/native-tabs/{NativeBottomTabs/utils.js → utils/children.js} +1 -7
  102. package/build/native-tabs/utils/children.js.map +1 -0
  103. package/build/native-tabs/utils/icon.d.ts +25 -0
  104. package/build/native-tabs/utils/icon.d.ts.map +1 -0
  105. package/build/native-tabs/utils/icon.js +68 -0
  106. package/build/native-tabs/utils/icon.js.map +1 -0
  107. package/build/native-tabs/utils/index.d.ts +4 -0
  108. package/build/native-tabs/utils/index.d.ts.map +1 -0
  109. package/build/native-tabs/utils/index.js +11 -0
  110. package/build/native-tabs/utils/index.js.map +1 -0
  111. package/build/native-tabs/utils/label.d.ts +6 -0
  112. package/build/native-tabs/utils/label.d.ts.map +1 -0
  113. package/build/native-tabs/utils/label.js +15 -0
  114. package/build/native-tabs/utils/label.js.map +1 -0
  115. package/build/renderRootComponent.d.ts.map +1 -1
  116. package/build/renderRootComponent.js +4 -7
  117. package/build/renderRootComponent.js.map +1 -1
  118. package/build/split-view/elements.d.ts +10 -0
  119. package/build/split-view/elements.d.ts.map +1 -0
  120. package/build/split-view/elements.js +15 -0
  121. package/build/split-view/elements.js.map +1 -0
  122. package/build/split-view/index.d.ts +2 -0
  123. package/build/split-view/index.d.ts.map +1 -0
  124. package/build/split-view/index.js +6 -0
  125. package/build/split-view/index.js.map +1 -0
  126. package/build/split-view/split-view.d.ts +13 -0
  127. package/build/split-view/split-view.d.ts.map +1 -0
  128. package/build/split-view/split-view.js +93 -0
  129. package/build/split-view/split-view.js.map +1 -0
  130. package/build/static/html.d.ts +5 -15
  131. package/build/static/html.d.ts.map +1 -1
  132. package/build/static/html.js +9 -25
  133. package/build/static/html.js.map +1 -1
  134. package/build/static/registerRootComponent.d.ts +11 -0
  135. package/build/static/registerRootComponent.d.ts.map +1 -0
  136. package/build/static/registerRootComponent.js +11 -0
  137. package/build/static/registerRootComponent.js.map +1 -0
  138. package/build/types.d.ts +4 -2
  139. package/build/types.d.ts.map +1 -1
  140. package/build/types.js.map +1 -1
  141. package/build/ui/TabRouter.d.ts +3 -4
  142. package/build/ui/TabRouter.d.ts.map +1 -1
  143. package/build/ui/TabRouter.js +14 -67
  144. package/build/ui/TabRouter.js.map +1 -1
  145. package/build/ui/TabTrigger.d.ts +4 -5
  146. package/build/ui/TabTrigger.d.ts.map +1 -1
  147. package/build/ui/TabTrigger.js +9 -8
  148. package/build/ui/TabTrigger.js.map +1 -1
  149. package/build/ui/Tabs.d.ts +0 -1
  150. package/build/ui/Tabs.d.ts.map +1 -1
  151. package/build/ui/Tabs.js.map +1 -1
  152. package/html.js +1 -1
  153. package/internal/routing.d.ts +1 -0
  154. package/internal/routing.js +1 -0
  155. package/internal/rsc.d.ts +1 -0
  156. package/internal/rsc.js +1 -0
  157. package/internal/static.d.ts +1 -0
  158. package/internal/static.js +1 -0
  159. package/internal/testing.d.ts +1 -0
  160. package/internal/testing.js +1 -0
  161. package/internal/utils.d.ts +1 -0
  162. package/internal/utils.js +1 -0
  163. package/package.json +13 -11
  164. package/plugin/build/index.js +10 -0
  165. package/plugin/options.json +5 -0
  166. package/plugin/src/index.ts +17 -1
  167. package/rsc/headers.d.ts +1 -1
  168. package/rsc/headers.js +1 -1
  169. package/unstable-split-view.d.ts +1 -0
  170. package/unstable-split-view.js +1 -0
  171. package/build/getRoutesSSR.d.ts +0 -20
  172. package/build/getRoutesSSR.d.ts.map +0 -1
  173. package/build/getRoutesSSR.js +0 -97
  174. package/build/getRoutesSSR.js.map +0 -1
  175. package/build/getServerManifest.d.ts +0 -88
  176. package/build/getServerManifest.d.ts.map +0 -1
  177. package/build/getServerManifest.js +0 -238
  178. package/build/getServerManifest.js.map +0 -1
  179. package/build/loadStaticParamsAsync.d.ts +0 -9
  180. package/build/loadStaticParamsAsync.d.ts.map +0 -1
  181. package/build/loadStaticParamsAsync.js +0 -163
  182. package/build/loadStaticParamsAsync.js.map +0 -1
  183. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +0 -1
  184. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +0 -1
  185. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.d.ts.map +0 -1
  186. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js.map +0 -1
  187. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +0 -1
  188. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +0 -1
  189. package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts.map +0 -1
  190. package/build/native-tabs/NativeBottomTabs/NativeTabs.js.map +0 -1
  191. package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts.map +0 -1
  192. package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js.map +0 -1
  193. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +0 -1
  194. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +0 -187
  195. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +0 -1
  196. package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.d.ts.map +0 -1
  197. package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js.map +0 -1
  198. package/build/native-tabs/NativeBottomTabs/appearance.d.ts.map +0 -1
  199. package/build/native-tabs/NativeBottomTabs/appearance.js.map +0 -1
  200. package/build/native-tabs/NativeBottomTabs/types.d.ts.map +0 -1
  201. package/build/native-tabs/NativeBottomTabs/types.js.map +0 -1
  202. package/build/native-tabs/NativeBottomTabs/utils.d.ts.map +0 -1
  203. package/build/native-tabs/NativeBottomTabs/utils.js.map +0 -1
  204. package/build/routes-manifest.d.ts +0 -28
  205. package/build/routes-manifest.d.ts.map +0 -1
  206. package/build/routes-manifest.js +0 -30
  207. package/build/routes-manifest.js.map +0 -1
  208. package/build/rsc/middleware.d.ts +0 -8
  209. package/build/rsc/middleware.d.ts.map +0 -1
  210. package/build/rsc/middleware.js +0 -105
  211. package/build/rsc/middleware.js.map +0 -1
  212. package/build/rsc/path.d.ts +0 -34
  213. package/build/rsc/path.d.ts.map +0 -1
  214. package/build/rsc/path.js +0 -174
  215. package/build/rsc/path.js.map +0 -1
  216. package/build/rsc/router/create-expo-pages.d.ts +0 -20
  217. package/build/rsc/router/create-expo-pages.d.ts.map +0 -1
  218. package/build/rsc/router/create-expo-pages.js +0 -21
  219. package/build/rsc/router/create-expo-pages.js.map +0 -1
  220. package/build/rsc/router/create-pages.d.ts +0 -80
  221. package/build/rsc/router/create-pages.d.ts.map +0 -1
  222. package/build/rsc/router/create-pages.js +0 -232
  223. package/build/rsc/router/create-pages.js.map +0 -1
  224. package/build/rsc/router/defineRouter.d.ts +0 -30
  225. package/build/rsc/router/defineRouter.d.ts.map +0 -1
  226. package/build/rsc/router/defineRouter.js +0 -171
  227. package/build/rsc/router/defineRouter.js.map +0 -1
  228. package/build/rsc/router/expo-definedRouter.d.ts +0 -3
  229. package/build/rsc/router/expo-definedRouter.d.ts.map +0 -1
  230. package/build/rsc/router/expo-definedRouter.js +0 -112
  231. package/build/rsc/router/expo-definedRouter.js.map +0 -1
  232. package/build/rsc/router/noopRouter.d.ts +0 -3
  233. package/build/rsc/router/noopRouter.d.ts.map +0 -1
  234. package/build/rsc/router/noopRouter.js +0 -7
  235. package/build/rsc/router/noopRouter.js.map +0 -1
  236. package/build/rsc/rsc-renderer.d.ts +0 -44
  237. package/build/rsc/rsc-renderer.d.ts.map +0 -1
  238. package/build/rsc/rsc-renderer.js +0 -200
  239. package/build/rsc/rsc-renderer.js.map +0 -1
  240. package/build/rsc/server.d.ts +0 -65
  241. package/build/rsc/server.d.ts.map +0 -1
  242. package/build/rsc/server.js +0 -89
  243. package/build/rsc/server.js.map +0 -1
  244. package/build/static/getRootComponent.d.ts +0 -2
  245. package/build/static/getRootComponent.d.ts.map +0 -1
  246. package/build/static/getRootComponent.js +0 -25
  247. package/build/static/getRootComponent.js.map +0 -1
  248. package/build/static/getServerManifest.d.ts +0 -22
  249. package/build/static/getServerManifest.d.ts.map +0 -1
  250. package/build/static/getServerManifest.js +0 -50
  251. package/build/static/getServerManifest.js.map +0 -1
  252. package/build/static/renderStaticContent.d.ts +0 -15
  253. package/build/static/renderStaticContent.d.ts.map +0 -1
  254. package/build/static/renderStaticContent.js +0 -130
  255. package/build/static/renderStaticContent.js.map +0 -1
  256. package/build/typed-routes/generate.d.ts +0 -8
  257. package/build/typed-routes/generate.d.ts.map +0 -1
  258. package/build/typed-routes/generate.js +0 -186
  259. package/build/typed-routes/generate.js.map +0 -1
  260. package/build/typed-routes/index.d.ts +0 -35
  261. package/build/typed-routes/index.d.ts.map +0 -1
  262. package/build/typed-routes/index.js +0 -99
  263. package/build/typed-routes/index.js.map +0 -1
  264. package/build/typed-routes/testSetup.d.ts +0 -2
  265. package/build/typed-routes/testSetup.d.ts.map +0 -1
  266. package/build/typed-routes/testSetup.js +0 -42
  267. package/build/typed-routes/testSetup.js.map +0 -1
  268. package/build/utils/html.d.ts +0 -12
  269. package/build/utils/html.d.ts.map +0 -1
  270. package/build/utils/html.js +0 -29
  271. package/build/utils/html.js.map +0 -1
  272. package/node/render.js +0 -3
  273. /package/build/native-tabs/{NativeBottomTabs/NativeBottomTabsRouter.d.ts → NativeBottomTabsRouter.d.ts} +0 -0
  274. /package/build/native-tabs/{NativeBottomTabs/NativeTabs.d.ts → NativeTabs.d.ts} +0 -0
  275. /package/build/native-tabs/{NativeBottomTabs/NativeTabsTriggerTabBar.d.ts → NativeTabsTriggerTabBar.d.ts} +0 -0
  276. /package/build/native-tabs/{NativeBottomTabs/NativeTabsTriggerTabBar.js → NativeTabsTriggerTabBar.js} +0 -0
  277. /package/build/native-tabs/{NativeBottomTabs/NativeTabsView.d.ts → NativeTabsView.d.ts} +0 -0
  278. /package/build/native-tabs/{NativeBottomTabs/NativeTabsView.web.d.ts → NativeTabsView.web.d.ts} +0 -0
  279. /package/build/native-tabs/{NativeBottomTabs/types.js → types.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAA3C,sGAAA,YAAY,OAAA;AACrB,+CAS8B;AAR5B,yGAAA,eAAe,OAAA;AACf,wGAAA,cAAc,OAAA;AACd,0GAAA,gBAAgB,OAAA;AAChB,wGAAA,cAAc,OAAA;AACd,wGAAA,cAAc,OAAA;AACd,qGAAA,WAAW,OAAA;AAIb,2CAAoD;AAA3C,gGAAA,QAAQ,OAAA;AAAE,4FAAA,IAAI,OAAA;AACvB,6CAAqD;AAA5C,uGAAA,cAAc,OAAA","sourcesContent":["export { ServerRouter } from '../rsc/router/client';\nexport {\n getComponentIds,\n getInputString,\n parseInputString,\n PARAM_KEY_SKIP,\n SHOULD_SKIP_ID,\n LOCATION_ID,\n type RouteProps,\n type ShouldSkip,\n} from '../rsc/router/common';\nexport { Children, Slot } from '../rsc/router/host';\nexport { decodeActionId } from '../rsc/router/utils';\n"]}
@@ -0,0 +1,3 @@
1
+ export { InnerRoot } from '../static/html';
2
+ export { registerStaticRootComponent } from '../static/registerRootComponent';
3
+ //# sourceMappingURL=static.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/internal/static.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerStaticRootComponent = exports.InnerRoot = void 0;
4
+ var html_1 = require("../static/html");
5
+ Object.defineProperty(exports, "InnerRoot", { enumerable: true, get: function () { return html_1.InnerRoot; } });
6
+ var registerRootComponent_1 = require("../static/registerRootComponent");
7
+ Object.defineProperty(exports, "registerStaticRootComponent", { enumerable: true, get: function () { return registerRootComponent_1.registerStaticRootComponent; } });
8
+ //# sourceMappingURL=static.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.js","sourceRoot":"","sources":["../../src/internal/static.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAAlC,iGAAA,SAAS,OAAA;AAClB,yEAA8E;AAArE,oIAAA,2BAA2B,OAAA","sourcesContent":["export { InnerRoot } from '../static/html';\nexport { registerStaticRootComponent } from '../static/registerRootComponent';\n"]}
@@ -0,0 +1,3 @@
1
+ export { inMemoryContext, type MemoryContext } from '../testing-library/context-stubs';
2
+ export { default as requireContext, type RequireContextPonyFill, } from '../testing-library/require-context-ponyfill';
3
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/internal/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,OAAO,IAAI,cAAc,EACzB,KAAK,sBAAsB,GAC5B,MAAM,6CAA6C,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.requireContext = exports.inMemoryContext = void 0;
7
+ var context_stubs_1 = require("../testing-library/context-stubs");
8
+ Object.defineProperty(exports, "inMemoryContext", { enumerable: true, get: function () { return context_stubs_1.inMemoryContext; } });
9
+ var require_context_ponyfill_1 = require("../testing-library/require-context-ponyfill");
10
+ Object.defineProperty(exports, "requireContext", { enumerable: true, get: function () { return __importDefault(require_context_ponyfill_1).default; } });
11
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/internal/testing.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAuF;AAA9E,gHAAA,eAAe,OAAA;AACxB,wFAGqD;AAFnD,2IAAA,OAAO,OAAkB","sourcesContent":["export { inMemoryContext, type MemoryContext } from '../testing-library/context-stubs';\nexport {\n default as requireContext,\n type RequireContextPonyFill,\n} from '../testing-library/require-context-ponyfill';\n"]}
@@ -0,0 +1,2 @@
1
+ export { shouldLinkExternally } from '../utils/url';
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shouldLinkExternally = void 0;
4
+ var url_1 = require("../utils/url");
5
+ Object.defineProperty(exports, "shouldLinkExternally", { enumerable: true, get: function () { return url_1.shouldLinkExternally; } });
6
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":";;;AAAA,oCAAoD;AAA3C,2GAAA,oBAAoB,OAAA","sourcesContent":["export { shouldLinkExternally } from '../utils/url';\n"]}
@@ -0,0 +1,3 @@
1
+ import Stack from './StackClient';
2
+ export default Stack;
3
+ //# sourceMappingURL=BaseStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseStack.d.ts","sourceRoot":"","sources":["../../src/layouts/BaseStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const StackClient_1 = __importDefault(require("./StackClient"));
7
+ exports.default = StackClient_1.default;
8
+ //# sourceMappingURL=BaseStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseStack.js","sourceRoot":"","sources":["../../src/layouts/BaseStack.tsx"],"names":[],"mappings":";;;;;AAAA,gEAAkC;AAElC,kBAAe,qBAAK,CAAC","sourcesContent":["import Stack from './StackClient';\n\nexport default Stack;\n"]}
@@ -0,0 +1,9 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { RouterModal } from '../modal/web/ModalStack';
3
+ import { Screen } from '../views/Screen';
4
+ declare const _default: ((props: ComponentProps<typeof RouterModal>) => import("react").JSX.Element) & {
5
+ Screen: typeof Screen;
6
+ Protected: import("react").FunctionComponent<import("../views/Protected").ProtectedProps>;
7
+ };
8
+ export default _default;
9
+ //# sourceMappingURL=ExperimentalModalStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExperimentalModalStack.d.ts","sourceRoot":"","sources":["../../src/layouts/ExperimentalModalStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;iCAK/B,cAAc,CAAC,OAAO,WAAW,CAAC;;;;AAD5C,wBAQE"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const StackClient_1 = require("./StackClient");
4
+ const ModalStack_1 = require("../modal/web/ModalStack");
5
+ const Protected_1 = require("../views/Protected");
6
+ const Screen_1 = require("../views/Screen");
7
+ // The RouterModal already includes Screen and Protected via withLayoutContext
8
+ // but we need to ensure we forward the stackRouterOverride for singular routes etc.
9
+ exports.default = Object.assign((props) => {
10
+ return <ModalStack_1.RouterModal {...props} UNSTABLE_router={StackClient_1.stackRouterOverride}/>;
11
+ }, {
12
+ Screen: Screen_1.Screen,
13
+ Protected: Protected_1.Protected,
14
+ });
15
+ //# sourceMappingURL=ExperimentalModalStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExperimentalModalStack.js","sourceRoot":"","sources":["../../src/layouts/ExperimentalModalStack.tsx"],"names":[],"mappings":";;AAEA,+CAAoD;AACpD,wDAAsD;AACtD,kDAA+C;AAC/C,4CAAyC;AAEzC,8EAA8E;AAC9E,oFAAoF;AACpF,kBAAe,MAAM,CAAC,MAAM,CAC1B,CAAC,KAAyC,EAAE,EAAE;IAC5C,OAAO,CAAC,wBAAW,CAAC,IAAI,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,iCAAmB,CAAC,EAAG,CAAC;AAC1E,CAAC,EACD;IACE,MAAM,EAAN,eAAM;IACN,SAAS,EAAT,qBAAS;CACV,CACF,CAAC","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { stackRouterOverride } from './StackClient';\nimport { RouterModal } from '../modal/web/ModalStack';\nimport { Protected } from '../views/Protected';\nimport { Screen } from '../views/Screen';\n\n// The RouterModal already includes Screen and Protected via withLayoutContext\n// but we need to ensure we forward the stackRouterOverride for singular routes etc.\nexport default Object.assign(\n (props: ComponentProps<typeof RouterModal>) => {\n return <RouterModal {...props} UNSTABLE_router={stackRouterOverride} />;\n },\n {\n Screen,\n Protected,\n }\n);\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const IsWithinLayoutContext: import("react").Context<boolean>;
2
+ //# sourceMappingURL=IsWithinLayoutContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IsWithinLayoutContext.d.ts","sourceRoot":"","sources":["../../src/layouts/IsWithinLayoutContext.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,kCAAuB,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.IsWithinLayoutContext = void 0;
5
+ const react_1 = require("react");
6
+ exports.IsWithinLayoutContext = (0, react_1.createContext)(false);
7
+ //# sourceMappingURL=IsWithinLayoutContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IsWithinLayoutContext.js","sourceRoot":"","sources":["../../src/layouts/IsWithinLayoutContext.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,iCAAsC;AAEzB,QAAA,qBAAqB,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC","sourcesContent":["'use client';\n\nimport { createContext } from 'react';\n\nexport const IsWithinLayoutContext = createContext(false);\n"]}
@@ -1,17 +1,4 @@
1
- import { ComponentProps } from 'react';
2
- import { RouterModal } from '../modal/web/ModalStack';
3
- declare const Stack: ((props: ComponentProps<typeof RouterModal>) => import("react").JSX.Element) & {
4
- Screen: (props: import("..").ScreenProps<object, Readonly<{
5
- key: string;
6
- index: number;
7
- routeNames: string[];
8
- history?: unknown[];
9
- routes: import("@react-navigation/routers").NavigationRoute<import("@react-navigation/routers").ParamListBase, string>[];
10
- type: string;
11
- stale: false;
12
- }>, import("@react-navigation/core").EventMapBase>) => null;
13
- Protected: import("react").FunctionComponent<import("../views/Protected").ProtectedProps>;
14
- };
1
+ import Stack from './_web-modal';
15
2
  export { Stack };
16
3
  export default Stack;
17
4
  //# sourceMappingURL=Stack.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.web.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAqB,MAAM,yBAAyB,CAAC;AAMzE,QAAA,MAAM,KAAK,WACD,cAAc,CAAC,OAAO,WAAW,CAAC;;;;;;;;;;;CAO3C,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Stack.web.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,cAAc,CAAC;AAKjC,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAe,KAAK,CAAC"}
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.Stack = void 0;
4
- const StackClient_1 = require("./StackClient");
5
- const ModalStack_1 = require("../modal/web/ModalStack");
6
- const Protected_1 = require("../views/Protected");
7
- // The RouterModal already includes Screen and Protected via withLayoutContext
8
- // but we need to ensure we forward the stackRouterOverride for singular routes etc.
9
- const Stack = Object.assign((props) => {
10
- return <ModalStack_1.RouterModal {...props} UNSTABLE_router={StackClient_1.stackRouterOverride}/>;
11
- }, {
12
- Screen: ModalStack_1.RouterModalScreen,
13
- Protected: Protected_1.Protected,
14
- });
15
- exports.Stack = Stack;
16
- exports.default = Stack;
7
+ // This will be changed to `ExperimentalModalStack` in @expo/cli/src/start/server/metro/withMetroMultiPlatform.ts
8
+ // When the `EXPO_UNSTABLE_WEB_MODAL` env variable is truthy.
9
+ const _web_modal_1 = __importDefault(require("./_web-modal"));
10
+ exports.Stack = _web_modal_1.default;
11
+ const Screen_1 = require("../views/Screen");
12
+ _web_modal_1.default.Screen = Screen_1.Screen;
13
+ exports.default = _web_modal_1.default;
17
14
  //# sourceMappingURL=Stack.web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.web.js","sourceRoot":"","sources":["../../src/layouts/Stack.web.tsx"],"names":[],"mappings":";;;AAEA,+CAAoD;AACpD,wDAAyE;AACzE,kDAA+C;AAE/C,8EAA8E;AAC9E,oFAAoF;AAEpF,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CACzB,CAAC,KAAyC,EAAE,EAAE;IAC5C,OAAO,CAAC,wBAAW,CAAC,IAAI,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,iCAAmB,CAAC,EAAG,CAAC;AAC1E,CAAC,EACD;IACE,MAAM,EAAE,8BAAiB;IACzB,SAAS,EAAT,qBAAS;CACV,CACF,CAAC;AAEO,sBAAK;AAEd,kBAAe,KAAK,CAAC","sourcesContent":["import { ComponentProps } from 'react';\n\nimport { stackRouterOverride } from './StackClient';\nimport { RouterModal, RouterModalScreen } from '../modal/web/ModalStack';\nimport { Protected } from '../views/Protected';\n\n// The RouterModal already includes Screen and Protected via withLayoutContext\n// but we need to ensure we forward the stackRouterOverride for singular routes etc.\n\nconst Stack = Object.assign(\n (props: ComponentProps<typeof RouterModal>) => {\n return <RouterModal {...props} UNSTABLE_router={stackRouterOverride} />;\n },\n {\n Screen: RouterModalScreen,\n Protected,\n }\n);\n\nexport { Stack };\n\nexport default Stack;\n"]}
1
+ {"version":3,"file":"Stack.web.js","sourceRoot":"","sources":["../../src/layouts/Stack.web.tsx"],"names":[],"mappings":";;;;;;AAAA,iHAAiH;AACjH,6DAA6D;AAC7D,8DAAiC;AAKxB,gBALF,oBAAK,CAKE;AAJd,4CAAyC;AAEzC,oBAAK,CAAC,MAAM,GAAG,eAAM,CAAC;AAItB,kBAAe,oBAAK,CAAC","sourcesContent":["// This will be changed to `ExperimentalModalStack` in @expo/cli/src/start/server/metro/withMetroMultiPlatform.ts\n// When the `EXPO_UNSTABLE_WEB_MODAL` env variable is truthy.\nimport Stack from './_web-modal';\nimport { Screen } from '../views/Screen';\n\nStack.Screen = Screen;\n\nexport { Stack };\n\nexport default Stack;\n"]}
@@ -0,0 +1,3 @@
1
+ import BaseStack from './BaseStack';
2
+ export default BaseStack;
3
+ //# sourceMappingURL=_web-modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_web-modal.d.ts","sourceRoot":"","sources":["../../src/layouts/_web-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseStack_1 = __importDefault(require("./BaseStack"));
7
+ exports.default = BaseStack_1.default;
8
+ //# sourceMappingURL=_web-modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_web-modal.js","sourceRoot":"","sources":["../../src/layouts/_web-modal.tsx"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AACpC,kBAAe,mBAAS,CAAC","sourcesContent":["import BaseStack from './BaseStack';\nexport default BaseStack;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"withLayoutContext.d.ts","sourceRoot":"","sources":["../../src/layouts/withLayoutContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAc,EAGZ,cAAc,EACd,aAAa,EACb,yBAAyB,EACzB,eAAe,EACf,SAAS,EACT,aAAa,EAEd,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAoB,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGxE,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,SAAS,EACnB,EACE,iBAAiB,EACjB,UAAU,GACX,GAAE;IACD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB;;cAKkC,MAAM;;;;EAwE/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,SAAS,MAAM,EACvB,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EAC5B,MAAM,SAAS,eAAe,EAC9B,SAAS,SAAS,YAAY,EAE9B,GAAG,EAAE,CAAC,EACN,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,EACrD,yBAA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E,OAAe,GA6BrC,yBAAyB,CAC5B,eAAe,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CACrF,GAAG;IACF,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;IAClE,SAAS,EAAE,OAAO,SAAS,CAAC;CAC7B,CACF"}
@@ -37,8 +37,9 @@ exports.useFilterScreenChildren = useFilterScreenChildren;
37
37
  exports.withLayoutContext = withLayoutContext;
38
38
  const react_1 = __importStar(require("react"));
39
39
  const Route_1 = require("../Route");
40
- const NativeTabTrigger_1 = require("../native-tabs/NativeBottomTabs/NativeTabTrigger");
40
+ const NativeTabTrigger_1 = require("../native-tabs/NativeTabTrigger");
41
41
  const useScreens_1 = require("../useScreens");
42
+ const IsWithinLayoutContext_1 = require("./IsWithinLayoutContext");
42
43
  const Protected_1 = require("../views/Protected");
43
44
  const Screen_1 = require("../views/Screen");
44
45
  function useFilterScreenChildren(children, { isCustomNavigator, contextKey, } = {}) {
@@ -153,7 +154,9 @@ function withLayoutContext(Nav, processor, useOnlyUserDefinedScreens = false) {
153
154
  if (!sorted.length) {
154
155
  return null;
155
156
  }
156
- return <Nav {...props} id={contextKey} ref={ref} children={sorted}/>;
157
+ return (<IsWithinLayoutContext_1.IsWithinLayoutContext value>
158
+ <Nav {...props} id={contextKey} ref={ref} children={sorted}/>
159
+ </IsWithinLayoutContext_1.IsWithinLayoutContext>);
157
160
  }), {
158
161
  Screen: Screen_1.Screen,
159
162
  Protected: Protected_1.Protected,
@@ -1 +1 @@
1
- {"version":3,"file":"withLayoutContext.js","sourceRoot":"","sources":["../../src/layouts/withLayoutContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,0DAsFC;AAoCD,8CAuCC;AAvLD,+CAUe;AAEf,oCAAyC;AACz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AAO;YACP,QAAQ,EAAE,cAAc;YACxB,gBAAgB;SACjB,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,iBAAiB,CAM/B,GAAM,EACN,SAAqD,EACrD,4BAAqC,KAAK;IAE1C,OAAO,MAAM,CAAC,MAAM,CAClB,IAAA,kBAAU,EAAC,CAAC,EAAE,QAAQ,EAAE,mBAAmB,EAAE,GAAG,KAAK,EAAO,EAAE,GAAG,EAAE,EAAE;QACnE,MAAM,UAAU,GAAG,IAAA,qBAAa,GAAE,CAAC;QAEnC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,uBAAuB,CAAC,mBAAmB,EAAE;YACjF,UAAU;SACX,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAEjE,MAAM,MAAM,GAAG,IAAA,6BAAgB,EAAC,SAAS,IAAI,EAAE,EAAE,gBAAgB,EAAE,yBAAyB,CAAC,CAAC;QAE9F,uDAAuD;QACvD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAG,CAAC;IACxE,CAAC,CAAC,EACF;QACE,MAAM,EAAN,eAAM;QACN,SAAS,EAAT,qBAAS;KACV,CAMF,CAAC;AACJ,CAAC","sourcesContent":["import { EventMapBase, NavigationState } from '@react-navigation/native';\nimport React, {\n Children,\n forwardRef,\n ComponentProps,\n ComponentType,\n ForwardRefExoticComponent,\n PropsWithoutRef,\n ReactNode,\n RefAttributes,\n useMemo,\n} from 'react';\n\nimport { useContextKey } from '../Route';\nimport {\n isNativeTabTrigger,\n convertTabPropsToOptions,\n} from '../native-tabs/NativeBottomTabs/NativeTabTrigger';\nimport { PickPartial } from '../types';\nimport { useSortedScreens, ScreenProps } from '../useScreens';\nimport { isProtectedReactElement, Protected } from '../views/Protected';\nimport { isScreen, Screen } from '../views/Screen';\n\nexport function useFilterScreenChildren(\n children: ReactNode,\n {\n isCustomNavigator,\n contextKey,\n }: {\n isCustomNavigator?: boolean;\n /** Used for sending developer hints */\n contextKey?: string;\n } = {}\n) {\n return useMemo(() => {\n const customChildren: any[] = [];\n\n const screens: (ScreenProps & { name: string })[] = [];\n const protectedScreens = new Set<string>();\n\n function flattenChild(child: ReactNode, exclude = false) {\n if (isScreen(child, contextKey)) {\n if (exclude) {\n protectedScreens.add(child.props.name);\n } else {\n screens.push(child.props);\n }\n return;\n }\n\n if (isNativeTabTrigger(child, contextKey)) {\n if (exclude) {\n protectedScreens.add(child.props.name);\n } else {\n const options = convertTabPropsToOptions(child.props);\n if (options.hidden === false) {\n screens.push({\n ...child.props,\n options: convertTabPropsToOptions(child.props),\n });\n } else {\n // - hidden = undefined -> then the route was not specified in navigator\n // - hidden = true -> then the route is hidden\n // In this cases we should treat the tab as protected\n protectedScreens.add(child.props.name);\n }\n }\n return;\n }\n\n if (isProtectedReactElement(child)) {\n const excludeChildren = exclude || !child.props.guard;\n Children.forEach(child.props.children, (protectedChild) => {\n flattenChild(protectedChild, excludeChildren);\n });\n return;\n }\n\n if (isCustomNavigator) {\n customChildren.push(child);\n return null;\n }\n\n console.warn(\n `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\"`\n );\n\n return null;\n }\n\n Children.forEach(children, (child) => flattenChild(child));\n\n // Add an assertion for development\n if (process.env.NODE_ENV !== 'production') {\n // Assert if names are not unique\n const names = screens?.map(\n (screen) => screen && typeof screen === 'object' && 'name' in screen && screen.name\n );\n if (names && new Set(names).size !== names.length) {\n throw new Error('Screen names must be unique: ' + names);\n }\n }\n\n return {\n screens,\n children: customChildren,\n protectedScreens,\n };\n }, [children]);\n}\n\n/**\n * Returns a navigator that automatically injects matched routes and renders nothing when there are no children.\n * Return type with `children` prop optional.\n * \n * Enables use of other built-in React Navigation navigators and other navigators built with the React Navigation custom navigator API.\n *\n * @param Nav - The navigator component to wrap.\n * @param processor - A function that processes the screens before passing them to the navigator.\n * @param useOnlyUserDefinedScreens - If true, all screens not specified as navigator's children will be ignored.\n *\n * @example\n * ```tsx app/_layout.tsx\n * import { ParamListBase, TabNavigationState } from \"@react-navigation/native\";\n * import {\n * createMaterialTopTabNavigator,\n * MaterialTopTabNavigationOptions,\n * MaterialTopTabNavigationEventMap,\n * } from \"@react-navigation/material-top-tabs\";\n * import { withLayoutContext } from \"expo-router\";\n * \n * const MaterialTopTabs = createMaterialTopTabNavigator();\n * \n * const ExpoRouterMaterialTopTabs = withLayoutContext<\n * MaterialTopTabNavigationOptions,\n * typeof MaterialTopTabs.Navigator,\n * TabNavigationState<ParamListBase>,\n * MaterialTopTabNavigationEventMap\n * >(MaterialTopTabs.Navigator);\n\n * export default function TabLayout() {\n * return <ExpoRouterMaterialTopTabs />;\n * }\n * ```\n */\nexport function withLayoutContext<\n TOptions extends object,\n T extends ComponentType<any>,\n TState extends NavigationState,\n TEventMap extends EventMapBase,\n>(\n Nav: T,\n processor?: (options: ScreenProps[]) => ScreenProps[],\n useOnlyUserDefinedScreens: boolean = false\n) {\n return Object.assign(\n forwardRef(({ children: userDefinedChildren, ...props }: any, ref) => {\n const contextKey = useContextKey();\n\n const { screens, protectedScreens } = useFilterScreenChildren(userDefinedChildren, {\n contextKey,\n });\n\n const processed = processor ? processor(screens ?? []) : screens;\n\n const sorted = useSortedScreens(processed ?? [], protectedScreens, useOnlyUserDefinedScreens);\n\n // Prevent throwing an error when there are no screens.\n if (!sorted.length) {\n return null;\n }\n\n return <Nav {...props} id={contextKey} ref={ref} children={sorted} />;\n }),\n {\n Screen,\n Protected,\n }\n ) as ForwardRefExoticComponent<\n PropsWithoutRef<PickPartial<ComponentProps<T>, 'children'>> & RefAttributes<unknown>\n > & {\n Screen: (props: ScreenProps<TOptions, TState, TEventMap>) => null;\n Protected: typeof Protected;\n };\n}\n"]}
1
+ {"version":3,"file":"withLayoutContext.js","sourceRoot":"","sources":["../../src/layouts/withLayoutContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,0DAsFC;AAoCD,8CA2CC;AAzLD,+CAUe;AAEf,oCAAyC;AACzC,sEAA+F;AAE/F,8CAA8D;AAC9D,mEAAgE;AAChE,kDAAwE;AACxE,4CAAmD;AAEnD,SAAgB,uBAAuB,CACrC,QAAmB,EACnB,EACE,iBAAiB,EACjB,UAAU,MAKR,EAAE;IAEN,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,MAAM,cAAc,GAAU,EAAE,CAAC;QAEjC,MAAM,OAAO,GAAuC,EAAE,CAAC;QACvD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QAE3C,SAAS,YAAY,CAAC,KAAgB,EAAE,OAAO,GAAG,KAAK;YACrD,IAAI,IAAA,iBAAQ,EAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;gBAChC,IAAI,OAAO,EAAE,CAAC;oBACZ,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACzC,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC5B,CAAC;gBACD,OAAO;YACT,CAAC;YAED,IAAI,IAAA,qCAAkB,EAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;gBAC1C,IAAI,OAAO,EAAE,CAAC;oBACZ,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI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AO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CACL,CAAC,6CAAqB,CAAC,KAAK,CAC1B;UAAA,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAC7D;QAAA,EAAE,6CAAqB,CAAC,CACzB,CAAC;IACJ,CAAC,CAAC,EACF;QACE,MAAM,EAAN,eAAM;QACN,SAAS,EAAT,qBAAS;KACV,CAMF,CAAC;AACJ,CAAC","sourcesContent":["import { EventMapBase, NavigationState } from '@react-navigation/native';\nimport React, {\n Children,\n forwardRef,\n ComponentProps,\n ComponentType,\n ForwardRefExoticComponent,\n PropsWithoutRef,\n ReactNode,\n RefAttributes,\n useMemo,\n} from 'react';\n\nimport { useContextKey } from '../Route';\nimport { isNativeTabTrigger, convertTabPropsToOptions } from '../native-tabs/NativeTabTrigger';\nimport { PickPartial } from '../types';\nimport { useSortedScreens, ScreenProps } from '../useScreens';\nimport { IsWithinLayoutContext } from './IsWithinLayoutContext';\nimport { isProtectedReactElement, Protected } from '../views/Protected';\nimport { isScreen, Screen } from '../views/Screen';\n\nexport function useFilterScreenChildren(\n children: ReactNode,\n {\n isCustomNavigator,\n contextKey,\n }: {\n isCustomNavigator?: boolean;\n /** Used for sending developer hints */\n contextKey?: string;\n } = {}\n) {\n return useMemo(() => {\n const customChildren: any[] = [];\n\n const screens: (ScreenProps & { name: string })[] = [];\n const protectedScreens = new Set<string>();\n\n function flattenChild(child: ReactNode, exclude = false) {\n if (isScreen(child, contextKey)) {\n if (exclude) {\n protectedScreens.add(child.props.name);\n } else {\n screens.push(child.props);\n }\n return;\n }\n\n if (isNativeTabTrigger(child, contextKey)) {\n if (exclude) {\n protectedScreens.add(child.props.name);\n } else {\n const options = convertTabPropsToOptions(child.props);\n if (options.hidden === false) {\n screens.push({\n ...child.props,\n options: convertTabPropsToOptions(child.props),\n });\n } else {\n // - hidden = undefined -> then the route was not specified in navigator\n // - hidden = true -> then the route is hidden\n // In this cases we should treat the tab as protected\n protectedScreens.add(child.props.name);\n }\n }\n return;\n }\n\n if (isProtectedReactElement(child)) {\n const excludeChildren = exclude || !child.props.guard;\n Children.forEach(child.props.children, (protectedChild) => {\n flattenChild(protectedChild, excludeChildren);\n });\n return;\n }\n\n if (isCustomNavigator) {\n customChildren.push(child);\n return null;\n }\n\n console.warn(\n `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\"`\n );\n\n return null;\n }\n\n Children.forEach(children, (child) => flattenChild(child));\n\n // Add an assertion for development\n if (process.env.NODE_ENV !== 'production') {\n // Assert if names are not unique\n const names = screens?.map(\n (screen) => screen && typeof screen === 'object' && 'name' in screen && screen.name\n );\n if (names && new Set(names).size !== names.length) {\n throw new Error('Screen names must be unique: ' + names);\n }\n }\n\n return {\n screens,\n children: customChildren,\n protectedScreens,\n };\n }, [children]);\n}\n\n/**\n * Returns a navigator that automatically injects matched routes and renders nothing when there are no children.\n * Return type with `children` prop optional.\n * \n * Enables use of other built-in React Navigation navigators and other navigators built with the React Navigation custom navigator API.\n *\n * @param Nav - The navigator component to wrap.\n * @param processor - A function that processes the screens before passing them to the navigator.\n * @param useOnlyUserDefinedScreens - If true, all screens not specified as navigator's children will be ignored.\n *\n * @example\n * ```tsx app/_layout.tsx\n * import { ParamListBase, TabNavigationState } from \"@react-navigation/native\";\n * import {\n * createMaterialTopTabNavigator,\n * MaterialTopTabNavigationOptions,\n * MaterialTopTabNavigationEventMap,\n * } from \"@react-navigation/material-top-tabs\";\n * import { withLayoutContext } from \"expo-router\";\n * \n * const MaterialTopTabs = createMaterialTopTabNavigator();\n * \n * const ExpoRouterMaterialTopTabs = withLayoutContext<\n * MaterialTopTabNavigationOptions,\n * typeof MaterialTopTabs.Navigator,\n * TabNavigationState<ParamListBase>,\n * MaterialTopTabNavigationEventMap\n * >(MaterialTopTabs.Navigator);\n\n * export default function TabLayout() {\n * return <ExpoRouterMaterialTopTabs />;\n * }\n * ```\n */\nexport function withLayoutContext<\n TOptions extends object,\n T extends ComponentType<any>,\n TState extends NavigationState,\n TEventMap extends EventMapBase,\n>(\n Nav: T,\n processor?: (options: ScreenProps[]) => ScreenProps[],\n useOnlyUserDefinedScreens: boolean = false\n) {\n return Object.assign(\n forwardRef(({ children: userDefinedChildren, ...props }: any, ref) => {\n const contextKey = useContextKey();\n\n const { screens, protectedScreens } = useFilterScreenChildren(userDefinedChildren, {\n contextKey,\n });\n\n const processed = processor ? processor(screens ?? []) : screens;\n\n const sorted = useSortedScreens(processed ?? [], protectedScreens, useOnlyUserDefinedScreens);\n\n // Prevent throwing an error when there are no screens.\n if (!sorted.length) {\n return null;\n }\n\n return (\n <IsWithinLayoutContext value>\n <Nav {...props} id={contextKey} ref={ref} children={sorted} />\n </IsWithinLayoutContext>\n );\n }),\n {\n Screen,\n Protected,\n }\n ) as ForwardRefExoticComponent<\n PropsWithoutRef<PickPartial<ComponentProps<T>, 'children'>> & RefAttributes<unknown>\n > & {\n Screen: (props: ScreenProps<TOptions, TState, TEventMap>) => null;\n Protected: typeof Protected;\n };\n}\n"]}
@@ -5,5 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- export declare const ServerDataLoaderContext: import("react").Context<Record<string, any> | null>;
8
+ export type ServerDataLoaderData = Record<string, any> | null;
9
+ export declare const ServerDataLoaderContext: import("react").Context<ServerDataLoaderData>;
9
10
  //# sourceMappingURL=ServerDataLoaderContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDataLoaderContext.d.ts","sourceRoot":"","sources":["../../src/loaders/ServerDataLoaderContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,uBAAuB,qDAAkD,CAAC"}
1
+ {"version":3,"file":"ServerDataLoaderContext.d.ts","sourceRoot":"","sources":["../../src/loaders/ServerDataLoaderContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AAE9D,eAAO,MAAM,uBAAuB,+CAA4C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ServerDataLoaderContext.js","sourceRoot":"","sources":["../../src/loaders/ServerDataLoaderContext.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,iCAAsC;AAEzB,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAA6B,IAAI,CAAC,CAAC","sourcesContent":["/**\n * Copyright © 2025 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { createContext } from 'react';\n\nexport const ServerDataLoaderContext = createContext<Record<string, any> | null>(null);\n"]}
1
+ {"version":3,"file":"ServerDataLoaderContext.js","sourceRoot":"","sources":["../../src/loaders/ServerDataLoaderContext.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,iCAAsC;AAIzB,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAAuB,IAAI,CAAC,CAAC","sourcesContent":["/**\n * Copyright © 2025 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { createContext } from 'react';\n\nexport type ServerDataLoaderData = Record<string, any> | null;\n\nexport const ServerDataLoaderContext = createContext<ServerDataLoaderData>(null);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalStack.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EASd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAiC,MAAM,OAAO,CAAC;AAwHtD,QAAA,MAAM,WAAW;;;;;;;;;;;CAAkD,CAAC;AACpE,QAAA,MAAM,iBAAiB;;;;;;;;6DAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"ModalStack.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EASd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAiC,MAAM,OAAO,CAAC;AA8HtD,QAAA,MAAM,WAAW;;;;;;;;;;;CAAkD,CAAC;AACpE,QAAA,MAAM,iBAAiB;;;;;;;;6DAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
@@ -51,15 +51,20 @@ function ModalStackNavigator({ initialRouteName, children, screenOptions, }) {
51
51
  (0, react_1.useEffect)(() =>
52
52
  // @ts-expect-error: there may not be a tab navigator in parent
53
53
  navigation?.addListener?.('tabPress', (e) => {
54
+ const isFocused = navigation.isFocused();
55
+ // Run the operation in the next frame so we're sure all listeners have been run
56
+ // This is necessary to know if preventDefault() has been called
54
57
  requestAnimationFrame(() => {
55
- if (navigation.isFocused() && !e.defaultPrevented) {
58
+ if (state.index > 0 && isFocused && !e.defaultPrevented) {
59
+ // When user taps on already focused tab and we're inside the tab,
60
+ // reset the stack to replicate native behaviour
56
61
  navigation.dispatch({
57
62
  ...native_1.StackActions.popToTop(),
58
63
  target: state.key,
59
64
  });
60
65
  }
61
66
  });
62
- }), [navigation, state.key]);
67
+ }), [navigation, state.index, state.key]);
63
68
  return (<NavigationContent>
64
69
  <ModalStackView state={state} navigation={navigation} descriptors={descriptors} describe={describe}/>
65
70
  </NavigationContent>);
@@ -1 +1 @@
1
- {"version":3,"file":"ModalStack.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,qDAYkC;AAClC,iEAIwC;AACxC,+CAAsD;AAEtD,mEAAgE;AAChE,yFAAsF;AAEtF,mCAIiB;AAEjB,uEAAoE;AAEpE,S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MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC;gBAEpE,MAAM,cAAc,GAAG,kBAAkB;oBACvC,CAAC,CAAC,mEAAgC;oBAClC,CAAC,CAAC,6CAAqB,CAAC;gBAE1B,OAAO,CACL,CAAC,cAAc,CACb,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACf,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACpB,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAyC,CAAC,CAC1E,YAAY,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAC5C,SAAS,CAAC,CAAC,OAAO,CAAC,CACnB,WAAW,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CACnD,WAAW,CAAC,CAAC,MAAM,CAAC,EACpB,CACH,CAAC;YACJ,CAAC,CAAC,CACN;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAC;AACrE,MAAM,WAAW,GAAG,IAAA,qCAAiB,EAAC,gBAAgB,EAAE,CAAC,SAAS,CAAC,CAAC;AAG3D,kCAAW;AAFpB,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC;AAEvB,8CAAiB","sourcesContent":["'use client';\nimport {\n createNavigatorFactory,\n EventArg,\n ParamListBase,\n StackActionHelpers,\n StackActions,\n StackNavigationState,\n StackRouter,\n StackRouterOptions,\n useNavigationBuilder,\n usePreventRemoveContext,\n useTheme,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n NativeStackView,\n} from '@react-navigation/native-stack';\nimport React, { useCallback, useEffect } from 'react';\n\nimport { ModalStackRouteDrawer } from './ModalStackRouteDrawer';\nimport { TransparentModalStackRouteDrawer } from './TransparentModalStackRouteDrawer';\nimport { ModalStackNavigatorProps, ModalStackViewProps } from './types';\nimport {\n convertStackStateToNonModalState,\n findLastNonModalIndex,\n isTransparentModalPresentation,\n} from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\nimport { withLayoutContext } from '../../layouts/withLayoutContext';\n\nfunction ModalStackNavigator({\n initialRouteName,\n children,\n screenOptions,\n}: ModalStackNavigatorProps) {\n const { state, navigation, descriptors, NavigationContent, describe } = useNavigationBuilder<\n StackNavigationState<ParamListBase>,\n StackRouterOptions,\n StackActionHelpers<ParamListBase>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap\n >(StackRouter, {\n children,\n screenOptions,\n initialRouteName,\n });\n\n useEffect(\n () =>\n // @ts-expect-error: there may not be a tab navigator in parent\n navigation?.addListener?.('tabPress', (e: EventArg<'tabPress', true>) => {\n requestAnimationFrame(() => {\n if (navigation.isFocused() && !e.defaultPrevented) {\n navigation.dispatch({\n ...StackActions.popToTop(),\n target: state.key,\n });\n }\n });\n }),\n [navigation, state.key]\n );\n\n return (\n <NavigationContent>\n <ModalStackView\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n </NavigationContent>\n );\n}\n\nconst ModalStackView = ({ state, navigation, descriptors, describe }: ModalStackViewProps) => {\n const isWeb = process.env.EXPO_OS === 'web';\n const { colors } = useTheme();\n const { preventedRoutes } = usePreventRemoveContext();\n\n const { routes: filteredRoutes, index: nonModalIndex } = convertStackStateToNonModalState(\n state,\n descriptors,\n isWeb\n );\n\n const newStackState = {\n ...state,\n routes: filteredRoutes,\n index: nonModalIndex,\n };\n\n const dismiss = useCallback(() => {\n navigation.goBack();\n }, [navigation]);\n\n const overlayRoutes = React.useMemo(() => {\n if (!isWeb) return [];\n const idx = findLastNonModalIndex(state, descriptors);\n return state.routes.slice(idx + 1);\n }, [isWeb, state, descriptors]);\n\n return (\n <div style={{ flex: 1, display: 'flex' }}>\n <NativeStackView\n state={newStackState}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n {isWeb &&\n overlayRoutes.map((route) => {\n const isTransparentModal = isTransparentModalPresentation(descriptors[route.key].options);\n\n const isRemovePrevented = preventedRoutes[route.key]?.preventRemove;\n\n const ModalComponent = isTransparentModal\n ? TransparentModalStackRouteDrawer\n : ModalStackRouteDrawer;\n\n return (\n <ModalComponent\n key={route.key}\n routeKey={route.key}\n options={descriptors[route.key].options as ExtendedStackNavigationOptions}\n renderScreen={descriptors[route.key].render}\n onDismiss={dismiss}\n dismissible={isRemovePrevented ? false : undefined}\n themeColors={colors}\n />\n );\n })}\n </div>\n );\n};\n\nconst createModalStack = createNavigatorFactory(ModalStackNavigator);\nconst RouterModal = withLayoutContext(createModalStack().Navigator);\nconst RouterModalScreen = RouterModal.Screen;\n\nexport { RouterModal, RouterModalScreen };\n"]}
1
+ {"version":3,"file":"ModalStack.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,qDAYkC;AAClC,iEAIwC;AACxC,+CAAsD;AAEtD,mEAAgE;AAChE,yFAAsF;AAEtF,mCAIiB;AAEjB,uEAAoE;AAEpE,SAAS,mBAAmB,CAAC,EAC3B,gBAAgB,EAChB,QAAQ,EACR,aAAa,GACY;IACzB,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,GAAG,IAAA,6BAAoB,EAM1F,oBAAW,EAAE;QACb,QAAQ;QACR,aAAa;QACb,gBAAgB;KACjB,CAAC,CAAC;IAEH,IAAA,iBAAS,EACP,GAAG,EAAE;IACH,+DAA+D;IAC/D,UAAU,EAAE,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC,CAA6B,EAAE,EAAE;QACtE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,E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ACf,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACpB,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAyC,CAAC,CAC1E,YAAY,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAC5C,SAAS,CAAC,CAAC,OAAO,CAAC,CACnB,WAAW,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CACnD,WAAW,CAAC,CAAC,MAAM,CAAC,EACpB,CACH,CAAC;YACJ,CAAC,CAAC,CACN;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAC;AACrE,MAAM,WAAW,GAAG,IAAA,qCAAiB,EAAC,gBAAgB,EAAE,CAAC,SAAS,CAAC,CAAC;AAG3D,kCAAW;AAFpB,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,CAAC;AAEvB,8CAAiB","sourcesContent":["'use client';\nimport {\n createNavigatorFactory,\n EventArg,\n ParamListBase,\n StackActionHelpers,\n StackActions,\n StackNavigationState,\n StackRouter,\n StackRouterOptions,\n useNavigationBuilder,\n usePreventRemoveContext,\n useTheme,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n NativeStackView,\n} from '@react-navigation/native-stack';\nimport React, { useCallback, useEffect } from 'react';\n\nimport { ModalStackRouteDrawer } from './ModalStackRouteDrawer';\nimport { TransparentModalStackRouteDrawer } from './TransparentModalStackRouteDrawer';\nimport { ModalStackNavigatorProps, ModalStackViewProps } from './types';\nimport {\n convertStackStateToNonModalState,\n findLastNonModalIndex,\n isTransparentModalPresentation,\n} from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\nimport { withLayoutContext } from '../../layouts/withLayoutContext';\n\nfunction ModalStackNavigator({\n initialRouteName,\n children,\n screenOptions,\n}: ModalStackNavigatorProps) {\n const { state, navigation, descriptors, NavigationContent, describe } = useNavigationBuilder<\n StackNavigationState<ParamListBase>,\n StackRouterOptions,\n StackActionHelpers<ParamListBase>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap\n >(StackRouter, {\n children,\n screenOptions,\n initialRouteName,\n });\n\n useEffect(\n () =>\n // @ts-expect-error: there may not be a tab navigator in parent\n navigation?.addListener?.('tabPress', (e: EventArg<'tabPress', true>) => {\n const isFocused = navigation.isFocused();\n\n // Run the operation in the next frame so we're sure all listeners have been run\n // This is necessary to know if preventDefault() has been called\n requestAnimationFrame(() => {\n if (state.index > 0 && isFocused && !e.defaultPrevented) {\n // When user taps on already focused tab and we're inside the tab,\n // reset the stack to replicate native behaviour\n navigation.dispatch({\n ...StackActions.popToTop(),\n target: state.key,\n });\n }\n });\n }),\n [navigation, state.index, state.key]\n );\n\n return (\n <NavigationContent>\n <ModalStackView\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n </NavigationContent>\n );\n}\n\nconst ModalStackView = ({ state, navigation, descriptors, describe }: ModalStackViewProps) => {\n const isWeb = process.env.EXPO_OS === 'web';\n const { colors } = useTheme();\n const { preventedRoutes } = usePreventRemoveContext();\n\n const { routes: filteredRoutes, index: nonModalIndex } = convertStackStateToNonModalState(\n state,\n descriptors,\n isWeb\n );\n\n const newStackState = {\n ...state,\n routes: filteredRoutes,\n index: nonModalIndex,\n };\n\n const dismiss = useCallback(() => {\n navigation.goBack();\n }, [navigation]);\n\n const overlayRoutes = React.useMemo(() => {\n if (!isWeb) return [];\n const idx = findLastNonModalIndex(state, descriptors);\n return state.routes.slice(idx + 1);\n }, [isWeb, state, descriptors]);\n\n return (\n <div style={{ flex: 1, display: 'flex' }}>\n <NativeStackView\n state={newStackState}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n {isWeb &&\n overlayRoutes.map((route) => {\n const isTransparentModal = isTransparentModalPresentation(descriptors[route.key].options);\n\n const isRemovePrevented = preventedRoutes[route.key]?.preventRemove;\n\n const ModalComponent = isTransparentModal\n ? TransparentModalStackRouteDrawer\n : ModalStackRouteDrawer;\n\n return (\n <ModalComponent\n key={route.key}\n routeKey={route.key}\n options={descriptors[route.key].options as ExtendedStackNavigationOptions}\n renderScreen={descriptors[route.key].render}\n onDismiss={dismiss}\n dismissible={isRemovePrevented ? false : undefined}\n themeColors={colors}\n />\n );\n })}\n </div>\n );\n};\n\nconst createModalStack = createNavigatorFactory(ModalStackNavigator);\nconst RouterModal = withLayoutContext(createModalStack().Navigator);\nconst RouterModalScreen = RouterModal.Screen;\n\nexport { RouterModal, RouterModalScreen };\n"]}
@@ -2,9 +2,9 @@ import { ParamListBase, type EventMapBase } from '@react-navigation/native';
2
2
  import React from 'react';
3
3
  import type { NativeTabOptions, NativeTabsProps } from './types';
4
4
  export declare const NativeTabsContext: React.Context<boolean>;
5
- export declare function NativeTabsNavigator({ children, backBehavior, ...rest }: NativeTabsProps): React.JSX.Element;
5
+ export declare function NativeTabsNavigator({ children, backBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, ...rest }: NativeTabsProps): React.JSX.Element;
6
6
  export declare const NativeTabsNavigatorWithContext: React.ForwardRefExoticComponent<Omit<NativeTabsProps, "children"> & Partial<Pick<NativeTabsProps, "children">> & React.RefAttributes<unknown>> & {
7
- Screen: (props: import("../..").ScreenProps<NativeTabOptions, Readonly<{
7
+ Screen: (props: import("..").ScreenProps<NativeTabOptions, Readonly<{
8
8
  key: string;
9
9
  index: number;
10
10
  routeNames: string[];
@@ -13,6 +13,6 @@ export declare const NativeTabsNavigatorWithContext: React.ForwardRefExoticCompo
13
13
  type: string;
14
14
  stale: false;
15
15
  }>, EventMapBase>) => null;
16
- Protected: typeof import("../../views/Protected").Protected;
16
+ Protected: typeof import("../views/Protected").Protected;
17
17
  };
18
18
  //# sourceMappingURL=NativeBottomTabsNavigator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,aAAa,EAIb,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAoC,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAEV,gBAAgB,EAChB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAOjB,eAAO,MAAM,iBAAiB,wBAAsC,CAAC;AAErE,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAkC,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,GAAG,IAAI,EACR,EAAE,eAAe,qBAqGjB;AAID,eAAO,MAAM,8BAA8B;;;;;;;;;;;CAKa,CAAC"}
@@ -40,42 +40,77 @@ const native_1 = require("@react-navigation/native");
40
40
  const react_1 = __importStar(require("react"));
41
41
  const NativeBottomTabsRouter_1 = require("./NativeBottomTabsRouter");
42
42
  const NativeTabsView_1 = require("./NativeTabsView");
43
- const __1 = require("../..");
44
43
  const utils_1 = require("./utils");
45
- const linking_1 = require("../../link/linking");
44
+ const withLayoutContext_1 = require("../layouts/withLayoutContext");
45
+ const linking_1 = require("../link/linking");
46
46
  // In Jetpack Compose, the default back behavior is to go back to the initial route.
47
47
  const defaultBackBehavior = 'initialRoute';
48
48
  exports.NativeTabsContext = react_1.default.createContext(false);
49
- function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, ...rest }) {
49
+ function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, ...rest }) {
50
50
  if ((0, react_1.use)(exports.NativeTabsContext)) {
51
51
  throw new Error('Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.');
52
52
  }
53
- const builder = (0, native_1.useNavigationBuilder)(NativeBottomTabsRouter_1.NativeBottomTabsRouter, {
53
+ const processedLabelStyle = (0, utils_1.convertLabelStylePropToObject)(labelStyle);
54
+ const processedIconColor = (0, utils_1.convertIconColorPropToObject)(iconColor);
55
+ const selectedLabelStyle = processedLabelStyle.selected
56
+ ? {
57
+ ...processedLabelStyle.selected,
58
+ color: processedLabelStyle.selected.color ?? rest.tintColor,
59
+ }
60
+ : rest.tintColor
61
+ ? { color: rest.tintColor }
62
+ : undefined;
63
+ const { state, descriptors, navigation, NavigationContent } = (0, native_1.useNavigationBuilder)(NativeBottomTabsRouter_1.NativeBottomTabsRouter, {
54
64
  children,
55
65
  backBehavior,
56
66
  screenOptions: {
57
67
  disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,
68
+ labelStyle: processedLabelStyle.default,
69
+ selectedLabelStyle,
70
+ iconColor: processedIconColor.default,
71
+ selectedIconColor: processedIconColor.selected ?? rest.tintColor,
72
+ blurEffect,
73
+ backgroundColor,
74
+ badgeBackgroundColor,
75
+ indicatorColor,
76
+ badgeTextColor,
58
77
  },
59
78
  });
60
- const { state, descriptors, NavigationContent } = builder;
61
79
  const { routes } = state;
62
- let focusedIndex = state.index;
63
- const isAnyRouteFocused = routes[focusedIndex].key &&
64
- descriptors[routes[focusedIndex].key] &&
65
- (0, utils_1.shouldTabBeVisible)(descriptors[routes[focusedIndex].key].options);
66
- if (!isAnyRouteFocused) {
80
+ const visibleTabs = (0, react_1.useMemo)(() => routes
81
+ // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.
82
+ // If it is not defined, then it was not specified, and we should hide the tab.
83
+ .filter((route) => descriptors[route.key].options?.hidden !== true)
84
+ .map((route) => ({
85
+ options: descriptors[route.key].options,
86
+ routeKey: route.key,
87
+ name: route.name,
88
+ contentRenderer: () => descriptors[route.key].render(),
89
+ })), [routes, descriptors]);
90
+ const visibleFocusedTabIndex = (0, react_1.useMemo)(() => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index].key), [visibleTabs, routes, state.index]);
91
+ if (visibleFocusedTabIndex < 0) {
67
92
  if (process.env.NODE_ENV !== 'production') {
68
93
  throw new Error(`The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: "${(0, linking_1.getPathFromState)(state)}"`);
69
94
  }
70
- // Set focusedIndex to the first visible tab
71
- focusedIndex = routes.findIndex((route) => (0, utils_1.shouldTabBeVisible)(descriptors[route.key].options));
72
95
  }
96
+ const focusedIndex = visibleFocusedTabIndex >= 0 ? visibleFocusedTabIndex : 0;
97
+ const onTabChange = (0, react_1.useCallback)((tabKey) => {
98
+ const descriptor = descriptors[tabKey];
99
+ const route = descriptor.route;
100
+ navigation.dispatch({
101
+ type: 'JUMP_TO',
102
+ target: state.key,
103
+ payload: {
104
+ name: route.name,
105
+ },
106
+ });
107
+ }, [descriptors, navigation, state.key]);
73
108
  return (<NavigationContent>
74
109
  <exports.NativeTabsContext value>
75
- <NativeTabsView_1.NativeTabsView builder={builder} {...rest} focusedIndex={focusedIndex}/>
110
+ <NativeTabsView_1.NativeTabsView {...rest} focusedIndex={focusedIndex} tabs={visibleTabs} onTabChange={onTabChange}/>
76
111
  </exports.NativeTabsContext>
77
112
  </NavigationContent>);
78
113
  }
79
114
  const createNativeTabNavigator = (0, native_1.createNavigatorFactory)(NativeTabsNavigator);
80
- exports.NativeTabsNavigatorWithContext = (0, __1.withLayoutContext)(createNativeTabNavigator().Navigator, undefined, true);
115
+ exports.NativeTabsNavigatorWithContext = (0, withLayoutContext_1.withLayoutContext)(createNativeTabNavigator().Navigator, undefined, true);
81
116
  //# sourceMappingURL=NativeBottomTabsNavigator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6Bb,kD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AAG,CACnJ,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,YAAY,GAAG,sBAAsB,IAAI,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9E,MAAM,WAAW,GAAG,IAAA,mBAAW,EAC7B,CAAC,MAAc,EAAE,EAAE;QACjB,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC/B,UAAU,CAAC,QAAQ,CAAC;YAClB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,KAAK,CAAC,GAAG;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB;SACF,CAAC,CAAC;IACL,CAAC,EACD,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CACrC,CAAC;IAEF,OAAO,CACL,CAAC,iBAAiB,CAChB;MAAA,CAAC,yBAAiB,CAAC,KAAK,CACtB;QAAA,CAAC,+BAAc,CACb,IAAI,IAAI,CAAC,CACT,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,IAAI,CAAC,CAAC,WAAW,CAAC,CAClB,WAAW,CAAC,CAAC,WAAW,CAAC,EAE7B;MAAA,EAAE,yBAAiB,CACrB;IAAA,EAAE,iBAAiB,CAAC,CACrB,CAAC;AACJ,CAAC;AAED,MAAM,wBAAwB,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAC;AAEhE,QAAA,8BAA8B,GAAG,IAAA,qCAAiB,EAK7D,wBAAwB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC","sourcesContent":["'use client';\n\nimport {\n createNavigatorFactory,\n NavigationState,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n type EventMapBase,\n} from '@react-navigation/native';\nimport React, { use, useCallback, useMemo } from 'react';\n\nimport { NativeBottomTabsRouter } from './NativeBottomTabsRouter';\nimport { NativeTabsView } from './NativeTabsView';\nimport type {\n ExtendedNativeTabOptions,\n NativeTabOptions,\n NativeTabsProps,\n NativeTabsViewTabItem,\n} from './types';\nimport { convertIconColorPropToObject, convertLabelStylePropToObject } from './utils';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport { getPathFromState } from '../link/linking';\n\n// In Jetpack Compose, the default back behavior is to go back to the initial route.\nconst defaultBackBehavior = 'initialRoute';\nexport const NativeTabsContext = React.createContext<boolean>(false);\n\nexport function NativeTabsNavigator({\n children,\n backBehavior = defaultBackBehavior,\n labelStyle,\n iconColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n ...rest\n}: NativeTabsProps) {\n if (use(NativeTabsContext)) {\n throw new Error(\n 'Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.'\n );\n }\n\n const processedLabelStyle = convertLabelStylePropToObject(labelStyle);\n const processedIconColor = convertIconColorPropToObject(iconColor);\n\n const selectedLabelStyle = processedLabelStyle.selected\n ? {\n ...processedLabelStyle.selected,\n color: processedLabelStyle.selected.color ?? rest.tintColor,\n }\n : rest.tintColor\n ? { color: rest.tintColor }\n : undefined;\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n ExtendedNativeTabOptions,\n Record<string, any>\n >(NativeBottomTabsRouter, {\n children,\n backBehavior,\n screenOptions: {\n disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,\n labelStyle: processedLabelStyle.default,\n selectedLabelStyle,\n iconColor: processedIconColor.default,\n selectedIconColor: processedIconColor.selected ?? rest.tintColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n },\n });\n\n const { routes } = state;\n\n const visibleTabs = useMemo(\n () =>\n routes\n // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.\n // If it is not defined, then it was not specified, and we should hide the tab.\n .filter((route) => descriptors[route.key].options?.hidden !== true)\n .map(\n (route): NativeTabsViewTabItem => ({\n options: descriptors[route.key].options,\n routeKey: route.key,\n name: route.name,\n contentRenderer: () => descriptors[route.key].render(),\n })\n ),\n [routes, descriptors]\n );\n const visibleFocusedTabIndex = useMemo(\n () => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index].key),\n [visibleTabs, routes, state.index]\n );\n\n if (visibleFocusedTabIndex < 0) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: \"${getPathFromState(state)}\"`\n );\n }\n }\n const focusedIndex = visibleFocusedTabIndex >= 0 ? visibleFocusedTabIndex : 0;\n\n const onTabChange = useCallback(\n (tabKey: string) => {\n const descriptor = descriptors[tabKey];\n const route = descriptor.route;\n navigation.dispatch({\n type: 'JUMP_TO',\n target: state.key,\n payload: {\n name: route.name,\n },\n });\n },\n [descriptors, navigation, state.key]\n );\n\n return (\n <NavigationContent>\n <NativeTabsContext value>\n <NativeTabsView\n {...rest}\n focusedIndex={focusedIndex}\n tabs={visibleTabs}\n onTabChange={onTabChange}\n />\n </NativeTabsContext>\n </NavigationContent>\n );\n}\n\nconst createNativeTabNavigator = createNavigatorFactory(NativeTabsNavigator);\n\nexport const NativeTabsNavigatorWithContext = withLayoutContext<\n NativeTabOptions,\n typeof NativeTabsNavigator,\n NavigationState,\n EventMapBase\n>(createNativeTabNavigator().Navigator, undefined, true);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeBottomTabsRouter.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,MAAM,EACN,aAAa,EACb,kBAAkB,EAElB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAQlC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,0IAiD/D"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NativeBottomTabsRouter = NativeBottomTabsRouter;
4
4
  const native_1 = require("@react-navigation/native");
5
- const navigationParams_1 = require("../../navigationParams");
5
+ const navigationParams_1 = require("../navigationParams");
6
6
  function NativeBottomTabsRouter(options) {
7
7
  const tabRouter = (0, native_1.TabRouter)({ ...options });
8
8
  const nativeTabRouter = {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeBottomTabsRouter.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsRouter.tsx"],"names":[],"mappings":";;AAgBA,wDAiDC;AAjED,qDAQkC;AAElC,0DAI6B;AAE7B,SAAgB,sBAAsB,CAAC,OAAyB;IAC9D,MAAM,SAAS,GAAG,IAAA,kBAAS,EAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAE5C,MAAM,eAAe,GAGjB;QACF,GAAG,SAAS;QACZ,qEAAqE;QACrE,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAA8C,EAAE,OAAO,EAAE,EAAE;YACpF,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,UAAU,CAAC,CAAC,CAAC;oBAChB,MAAM,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;oBACnF,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBAEpF,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;wBAC5C,OAAO,sBAAsB,CAAC;oBAChC,CAAC;oBAED,MAAM,QAAQ,GAAG;wBACf,GAAG,sBAAsB;wBACzB,MAAM,EAAE,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;4BAClD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gCACvC,OAAO,KAAK,CAAC;4BACf,CAAC;4BAED,MAAM,UAAU,GAA6B,IAAA,8CAA2B,EACtE,MAAM,CAAC,OAAO,CAAC,MAAM,CACtB,CAAC;4BAEF,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gCAC7C,UAAU,CAAC,qCAAqC,CAAC,GAAG,IAAI,CAAC;4BAC3D,CAAC;4BAED,MAAM,MAAM,GAAG,IAAA,iDAA8B,EAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;4BACxE,OAAO;gCACL,GAAG,KAAK;gCACR,MAAM;6BACP,CAAC;wBACJ,CAAC,CAAC;qBACH,CAAC;oBACF,OAAO,QAAQ,CAAC;gBAClB,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7D,CAAC;KACF,CAAC;IAEF,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import {\n CommonNavigationAction,\n ParamListBase,\n Router,\n TabActionType,\n TabNavigationState,\n TabRouter,\n type TabRouterOptions,\n} from '@react-navigation/native';\n\nimport {\n appendInternalExpoRouterParams,\n getInternalExpoRouterParams,\n type InternalExpoRouterParams,\n} from '../navigationParams';\n\nexport function NativeBottomTabsRouter(options: TabRouterOptions) {\n const tabRouter = TabRouter({ ...options });\n\n const nativeTabRouter: Router<\n TabNavigationState<ParamListBase>,\n TabActionType | CommonNavigationAction\n > = {\n ...tabRouter,\n // @ts-expect-error TODO: For some reason this is not typed correctly\n getStateForAction: (state, action: TabActionType | CommonNavigationAction, options) => {\n switch (action.type) {\n case 'NAVIGATE': {\n const newStateFromNavigation = tabRouter.getStateForAction(state, action, options);\n const index = state.routes.findIndex((route) => route.name === action.payload.name);\n\n if (index === -1 || !newStateFromNavigation) {\n return newStateFromNavigation;\n }\n\n const newState = {\n ...newStateFromNavigation,\n routes: newStateFromNavigation.routes.map((route) => {\n if (route.name !== action.payload.name) {\n return route;\n }\n\n const expoParams: InternalExpoRouterParams = getInternalExpoRouterParams(\n action.payload.params\n );\n\n if (route.params && 'screen' in route.params) {\n expoParams['__internal_expo_router_no_animation'] = true;\n }\n\n const params = appendInternalExpoRouterParams(route.params, expoParams);\n return {\n ...route,\n params,\n };\n }),\n };\n return newState;\n }\n }\n return tabRouter.getStateForAction(state, action, options);\n },\n };\n\n return nativeTabRouter;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
2
  import { NativeTabsTriggerTabBar } from './NativeTabsTriggerTabBar';
3
3
  import type { ExtendedNativeTabOptions, NativeTabTriggerProps } from './types';
4
- import { type IconProps } from '../common/elements';
4
+ import { type IconProps } from './common/elements';
5
5
  /**
6
6
  * The component used to customize the native tab options both in the _layout file and from the tab screen.
7
7
  *