expo-router 7.0.0-canary-20251127-587bc53 → 7.0.0-canary-20251205-a1dedc6

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 (177) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/fork/getStateFromPath-forks.d.ts +5 -10
  3. package/build/fork/getStateFromPath-forks.d.ts.map +1 -1
  4. package/build/fork/getStateFromPath-forks.js +14 -13
  5. package/build/fork/getStateFromPath-forks.js.map +1 -1
  6. package/build/fork/getStateFromPath.js +3 -3
  7. package/build/fork/getStateFromPath.js.map +1 -1
  8. package/build/fork/native-stack/createNativeStackNavigator.d.ts.map +1 -1
  9. package/build/fork/native-stack/createNativeStackNavigator.js +12 -3
  10. package/build/fork/native-stack/createNativeStackNavigator.js.map +1 -1
  11. package/build/fork/native-stack/descriptors-context.d.ts +8 -0
  12. package/build/fork/native-stack/descriptors-context.d.ts.map +1 -0
  13. package/build/fork/native-stack/descriptors-context.js +6 -0
  14. package/build/fork/native-stack/descriptors-context.js.map +1 -0
  15. package/build/internal/utils.d.ts +1 -0
  16. package/build/internal/utils.d.ts.map +1 -1
  17. package/build/internal/utils.js +3 -1
  18. package/build/internal/utils.js.map +1 -1
  19. package/build/layouts/StackClient.d.ts.map +1 -1
  20. package/build/layouts/StackClient.js +34 -1
  21. package/build/layouts/StackClient.js.map +1 -1
  22. package/build/link/ExpoLink.d.ts.map +1 -1
  23. package/build/link/ExpoLink.js +12 -4
  24. package/build/link/ExpoLink.js.map +1 -1
  25. package/build/link/Link.d.ts +2 -0
  26. package/build/link/Link.d.ts.map +1 -1
  27. package/build/link/Link.js +2 -0
  28. package/build/link/Link.js.map +1 -1
  29. package/build/link/LinkWithPreview.d.ts +6 -1
  30. package/build/link/LinkWithPreview.d.ts.map +1 -1
  31. package/build/link/LinkWithPreview.js +6 -5
  32. package/build/link/LinkWithPreview.js.map +1 -1
  33. package/build/link/elements.d.ts +8 -0
  34. package/build/link/elements.d.ts.map +1 -1
  35. package/build/link/elements.js +7 -2
  36. package/build/link/elements.js.map +1 -1
  37. package/build/link/preview/native.d.ts +17 -0
  38. package/build/link/preview/native.d.ts.map +1 -1
  39. package/build/link/preview/native.js +22 -0
  40. package/build/link/preview/native.js.map +1 -1
  41. package/build/link/zoom/ZoomTransitionEnabler.d.ts +5 -0
  42. package/build/link/zoom/ZoomTransitionEnabler.d.ts.map +1 -0
  43. package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts +5 -0
  44. package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -0
  45. package/build/link/zoom/ZoomTransitionEnabler.ios.js +44 -0
  46. package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -0
  47. package/build/link/zoom/ZoomTransitionEnabler.js +13 -0
  48. package/build/link/zoom/ZoomTransitionEnabler.js.map +1 -0
  49. package/build/link/zoom/ZoomTransitionEnabler.types.d.ts +4 -0
  50. package/build/link/zoom/ZoomTransitionEnabler.types.d.ts.map +1 -0
  51. package/build/link/zoom/ZoomTransitionEnabler.types.js +3 -0
  52. package/build/link/zoom/ZoomTransitionEnabler.types.js.map +1 -0
  53. package/build/link/zoom/link-apple-zoom.d.ts +23 -0
  54. package/build/link/zoom/link-apple-zoom.d.ts.map +1 -0
  55. package/build/link/zoom/link-apple-zoom.js +40 -0
  56. package/build/link/zoom/link-apple-zoom.js.map +1 -0
  57. package/build/link/zoom/useZoomTransitionPrimitives.d.ts +6 -0
  58. package/build/link/zoom/useZoomTransitionPrimitives.d.ts.map +1 -0
  59. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts +11 -0
  60. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +1 -0
  61. package/build/link/zoom/useZoomTransitionPrimitives.ios.js +66 -0
  62. package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +1 -0
  63. package/build/link/zoom/useZoomTransitionPrimitives.js +9 -0
  64. package/build/link/zoom/useZoomTransitionPrimitives.js.map +1 -0
  65. package/build/link/zoom/zoom-transition-context.d.ts +7 -0
  66. package/build/link/zoom/zoom-transition-context.d.ts.map +1 -0
  67. package/build/link/zoom/zoom-transition-context.js +6 -0
  68. package/build/link/zoom/zoom-transition-context.js.map +1 -0
  69. package/build/native-tabs/NativeBottomTabsNavigator.d.ts +3 -15
  70. package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
  71. package/build/native-tabs/NativeBottomTabsNavigator.js +10 -2
  72. package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -1
  73. package/build/native-tabs/NativeBottomTabsRouter.d.ts.map +1 -1
  74. package/build/native-tabs/NativeBottomTabsRouter.js +12 -1
  75. package/build/native-tabs/NativeBottomTabsRouter.js.map +1 -1
  76. package/build/native-tabs/NativeTabTrigger.d.ts +1 -1
  77. package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
  78. package/build/native-tabs/NativeTabTrigger.js +3 -1
  79. package/build/native-tabs/NativeTabTrigger.js.map +1 -1
  80. package/build/native-tabs/NativeTabs.d.ts +6 -3
  81. package/build/native-tabs/NativeTabs.d.ts.map +1 -1
  82. package/build/native-tabs/NativeTabs.js +7 -2
  83. package/build/native-tabs/NativeTabs.js.map +1 -1
  84. package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
  85. package/build/native-tabs/NativeTabsView.js +26 -3
  86. package/build/native-tabs/NativeTabsView.js.map +1 -1
  87. package/build/native-tabs/common/elements.d.ts +25 -0
  88. package/build/native-tabs/common/elements.d.ts.map +1 -1
  89. package/build/native-tabs/common/elements.js +26 -1
  90. package/build/native-tabs/common/elements.js.map +1 -1
  91. package/build/native-tabs/hooks.d.ts +45 -0
  92. package/build/native-tabs/hooks.d.ts.map +1 -0
  93. package/build/native-tabs/hooks.js +57 -0
  94. package/build/native-tabs/hooks.js.map +1 -0
  95. package/build/native-tabs/types.d.ts +36 -2
  96. package/build/native-tabs/types.d.ts.map +1 -1
  97. package/build/native-tabs/types.js.map +1 -1
  98. package/build/native-tabs/utils/bottomAccessory.d.ts +9 -0
  99. package/build/native-tabs/utils/bottomAccessory.d.ts.map +1 -0
  100. package/build/native-tabs/utils/bottomAccessory.js +17 -0
  101. package/build/native-tabs/utils/bottomAccessory.js.map +1 -0
  102. package/build/navigationParams.d.ts +3 -1
  103. package/build/navigationParams.d.ts.map +1 -1
  104. package/build/navigationParams.js +5 -1
  105. package/build/navigationParams.js.map +1 -1
  106. package/build/toolbar/elements.d.ts +24 -0
  107. package/build/toolbar/elements.d.ts.map +1 -0
  108. package/build/toolbar/elements.js +36 -0
  109. package/build/toolbar/elements.js.map +1 -0
  110. package/build/toolbar/index.d.ts +9 -0
  111. package/build/toolbar/index.d.ts.map +1 -0
  112. package/build/toolbar/index.js +12 -0
  113. package/build/toolbar/index.js.map +1 -0
  114. package/build/toolbar/native.d.ts +4 -0
  115. package/build/toolbar/native.d.ts.map +1 -0
  116. package/build/toolbar/native.ios.d.ts +4 -0
  117. package/build/toolbar/native.ios.d.ts.map +1 -0
  118. package/build/toolbar/native.ios.js +21 -0
  119. package/build/toolbar/native.ios.js.map +1 -0
  120. package/build/toolbar/native.js +11 -0
  121. package/build/toolbar/native.js.map +1 -0
  122. package/build/toolbar/native.types.d.ts +30 -0
  123. package/build/toolbar/native.types.d.ts.map +1 -0
  124. package/build/toolbar/native.types.js +3 -0
  125. package/build/toolbar/native.types.js.map +1 -0
  126. package/build/useScreens.d.ts.map +1 -1
  127. package/build/useScreens.js +13 -5
  128. package/build/useScreens.js.map +1 -1
  129. package/build/views/Sitemap.js +3 -2
  130. package/build/views/Sitemap.js.map +1 -1
  131. package/expo-module.config.json +2 -2
  132. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +1 -0
  133. package/ios/LinkPreview/LinkPreviewNativeModule.swift +49 -1
  134. package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +132 -70
  135. package/ios/LinkPreview/LinkPreviewNativeView.swift +28 -14
  136. package/ios/LinkPreview/LinkZoomTransition.swift +227 -0
  137. package/ios/Toolbar/RouterToolbarHostView.swift +140 -0
  138. package/ios/Toolbar/RouterToolbarItemView.swift +171 -0
  139. package/ios/Toolbar/RouterToolbarModule.swift +102 -0
  140. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.module → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.module} +7 -7
  141. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.module.md5 +1 -0
  142. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.module.sha1 +1 -0
  143. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.module.sha256 +1 -0
  144. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.module.sha512 +1 -0
  145. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.pom → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.pom} +1 -1
  146. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.pom.md5 +1 -0
  147. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.pom.sha1 +1 -0
  148. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.pom.sha256 +1 -0
  149. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.pom.sha512 +1 -0
  150. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  151. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  152. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  153. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  154. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  155. package/package.json +14 -12
  156. package/unstable-toolbar.d.ts +1 -0
  157. package/unstable-toolbar.js +1 -0
  158. package/ios/LinkPreview/LinkPreviewNativeNavigation.h +0 -50
  159. package/ios/LinkPreview/LinkPreviewNativeNavigation.mm +0 -164
  160. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.module.md5 +0 -1
  161. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.module.sha1 +0 -1
  162. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.module.sha256 +0 -1
  163. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.module.sha512 +0 -1
  164. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.pom.md5 +0 -1
  165. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.pom.sha1 +0 -1
  166. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.pom.sha256 +0 -1
  167. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.pom.sha512 +0 -1
  168. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53-sources.jar → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6-sources.jar} +0 -0
  169. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53-sources.jar.md5 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6-sources.jar.md5} +0 -0
  170. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53-sources.jar.sha1 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6-sources.jar.sha1} +0 -0
  171. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53-sources.jar.sha256 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6-sources.jar.sha256} +0 -0
  172. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53-sources.jar.sha512 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6-sources.jar.sha512} +0 -0
  173. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.aar → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.aar} +0 -0
  174. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.aar.md5 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.aar.md5} +0 -0
  175. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.aar.sha1 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.aar.sha1} +0 -0
  176. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.aar.sha256 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.aar.sha256} +0 -0
  177. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251127-587bc53/expo.modules.router-7.0.0-canary-20251127-587bc53.aar.sha512 → 7.0.0-canary-20251205-a1dedc6/expo.modules.router-7.0.0-canary-20251205-a1dedc6.aar.sha512} +0 -0
@@ -47,6 +47,7 @@ const react_1 = __importStar(require("react"));
47
47
  const Route_1 = require("./Route");
48
48
  const storeContext_1 = require("./global-state/storeContext");
49
49
  const import_mode_1 = __importDefault(require("./import-mode"));
50
+ const ZoomTransitionEnabler_1 = require("./link/zoom/ZoomTransitionEnabler");
50
51
  const navigationParams_1 = require("./navigationParams");
51
52
  const primitives_1 = require("./primitives");
52
53
  const EmptyRoute_1 = require("./views/EmptyRoute");
@@ -201,11 +202,6 @@ function getQualifiedRouteComponent(value) {
201
202
  }
202
203
  (0, react_1.useEffect)(() => navigation.addListener('focus', () => {
203
204
  const state = navigation.getState();
204
- // When navigating to a screen, remove the no animation param to re-enable animations
205
- // Otherwise the navigation back would also have no animation
206
- if ((0, navigationParams_1.hasParam)(route?.params, navigationParams_1.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {
207
- navigation.replaceParams((0, navigationParams_1.removeParams)(route?.params, [navigationParams_1.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME]));
208
- }
209
205
  const isLeaf = !('state' in state.routes[state.index]);
210
206
  // Because setFocusedState caches the route info, this call will only trigger rerenders
211
207
  // if the component itself didn’t rerender and the route info changed.
@@ -214,7 +210,19 @@ function getQualifiedRouteComponent(value) {
214
210
  if (isLeaf && stateForPath)
215
211
  store.setFocusedState(stateForPath);
216
212
  }), [navigation]);
213
+ (0, react_1.useEffect)(() => {
214
+ return navigation.addListener('transitionEnd', (e) => {
215
+ if (!e?.data?.closing) {
216
+ // When navigating to a screen, remove the no animation param to re-enable animations
217
+ // Otherwise the navigation back would also have no animation
218
+ if ((0, navigationParams_1.hasParam)(route?.params, navigationParams_1.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {
219
+ navigation.replaceParams((0, navigationParams_1.removeParams)(route?.params, [navigationParams_1.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME]));
220
+ }
221
+ }
222
+ });
223
+ }, [navigation]);
217
224
  return (<Route_1.Route node={value} route={route}>
225
+ <ZoomTransitionEnabler_1.ZoomTransitionEnabler route={route}/>
218
226
  <react_1.default.Suspense fallback={<SuspenseFallback_1.SuspenseFallback route={value}/>}>
219
227
  <ScreenComponent {...props}
220
228
  // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.js","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJb,4CAwBC;AAmDD,gEAqFC;AAED,oDAwBC;AAED,sCAcC;AAED,sCAaC;AA9WD,qDAOkC;AAClC,+CAAyC;AAEzC,mCAA6F;AAC7F,8DAAiE;AACjE,gEAAoD;AACpD,yDAI4B;AAC5B,6CAAsC;AAEtC,mDAAgD;AAChD,+DAA4D;AAC5D,qCAAkC;AAmClC,SAAS,iBAAiB,CACxB,QAAqB,EACrB,QAAuB,EAAE,EACzB,gBAAyB;IAE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E,GAAG,KAAK,KAA2B,EAAE;IAEvD,OAAO,CACL,CAAC,mBAAM,CACL,IAAI,KAAK,CAAC,CACV,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAClB,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACjB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAC9C,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,EACtD,CACH,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY,EAAE,UAA+B,EAAE;IAC3E,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACf,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC;QACtE,CAAC;aAAM,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5D,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport {\n useStateForPath,\n type EventMapBase,\n type NavigationState,\n type ParamListBase,\n type RouteProp,\n type ScreenListeners,\n} from '@react-navigation/native';\nimport React, { useEffect } from 'react';\n\nimport { LoadedRoute, Route, RouteNode, sortRoutesWithInitial, useRouteNode } from './Route';\nimport { useExpoRouterStore } from './global-state/storeContext';\nimport EXPO_ROUTER_IMPORT_MODE from './import-mode';\nimport {\n hasParam,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n removeParams,\n} from './navigationParams';\nimport { Screen } from './primitives';\nimport { UnknownOutputParams } from './types';\nimport { EmptyRoute } from './views/EmptyRoute';\nimport { SuspenseFallback } from './views/SuspenseFallback';\nimport { Try } from './views/Try';\n\nexport type ScreenProps<\n TOptions extends Record<string, any> = Record<string, any>,\n TState extends NavigationState = NavigationState,\n TEventMap extends EventMapBase = EventMapBase,\n> = {\n /** Name is required when used inside a Layout component. */\n name?: string;\n /**\n * Redirect to the nearest sibling route.\n * If all children are `redirect={true}`, the layout will render `null` as there are no children to render.\n */\n redirect?: boolean;\n initialParams?: Record<string, any>;\n options?:\n | TOptions\n | ((prop: { route: RouteProp<ParamListBase, string>; navigation: any }) => TOptions);\n\n listeners?:\n | ScreenListeners<TState, TEventMap>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n navigation: any;\n }) => ScreenListeners<TState, TEventMap>);\n\n getId?: ({ params }: { params?: Record<string, any> }) => string | undefined;\n\n dangerouslySingular?: SingularOptions;\n};\n\nexport type SingularOptions =\n | boolean\n | ((name: string, params: UnknownOutputParams) => string | undefined);\n\nfunction getSortedChildren(\n children: RouteNode[],\n order: ScreenProps[] = [],\n initialRouteName?: string\n): { route: RouteNode; props: Partial<ScreenProps> }[] {\n if (!order?.length) {\n return children\n .sort(sortRoutesWithInitial(initialRouteName))\n .map((route) => ({ route, props: {} }));\n }\n const entries = [...children];\n\n const ordered = order\n .map(\n ({\n name,\n redirect,\n initialParams,\n listeners,\n options,\n getId,\n dangerouslySingular: singular,\n }) => {\n if (!entries.length) {\n console.warn(\n `[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`\n );\n return null;\n }\n const matchIndex = entries.findIndex((child) => child.route === name);\n if (matchIndex === -1) {\n console.warn(\n `[Layout children]: No route named \"${name}\" exists in nested children:`,\n children.map(({ route }) => route)\n );\n return null;\n } else {\n // Get match and remove from entries\n const match = entries[matchIndex];\n entries.splice(matchIndex, 1);\n\n // Ensure to return null after removing from entries.\n if (redirect) {\n if (typeof redirect === 'string') {\n throw new Error(`Redirecting to a specific route is not supported yet.`);\n }\n return null;\n }\n\n if (getId) {\n console.warn(\n `Deprecated: prop 'getId' on screen ${name} is deprecated. Please rename the prop to 'dangerouslySingular'`\n );\n if (singular) {\n console.warn(\n `Screen ${name} cannot use both getId and dangerouslySingular together.`\n );\n }\n } else if (singular) {\n // If singular is set, use it as the getId function.\n if (typeof singular === 'string') {\n getId = () => singular;\n } else if (typeof singular === 'function' && name) {\n getId = (options) => singular(name, options.params || {});\n } else if (singular === true && name) {\n getId = (options) => getSingularId(name, options);\n }\n }\n\n return {\n route: match,\n props: { initialParams, listeners, options, getId },\n };\n }\n }\n )\n .filter(Boolean) as {\n route: RouteNode;\n props: Partial<ScreenProps>;\n }[];\n\n // Add any remaining children\n ordered.push(\n ...entries.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({ route, props: {} }))\n );\n\n return ordered;\n}\n\n/**\n * @returns React Navigation screens sorted by the `route` property.\n */\nexport function useSortedScreens(\n order: ScreenProps[],\n protectedScreens: Set<string>,\n useOnlyUserDefinedScreens: boolean = false\n): React.ReactNode[] {\n const node = useRouteNode();\n\n const nodeChildren = node?.children ?? [];\n const children = useOnlyUserDefinedScreens\n ? nodeChildren.filter((child) =>\n order.some((userDefinedScreen) => userDefinedScreen.name === child.route)\n )\n : nodeChildren;\n\n const sorted = children.length ? getSortedChildren(children, order, node?.initialRouteName) : [];\n return React.useMemo(\n () =>\n sorted\n .filter((item) => !protectedScreens.has(item.route.route))\n .map((value) => {\n return routeToScreen(value.route, value.props);\n }),\n [sorted, protectedScreens]\n );\n}\n\nfunction fromImport(value: RouteNode, { ErrorBoundary, ...component }: LoadedRoute) {\n // If possible, add a more helpful display name for the component stack to improve debugging of React errors such as `Text strings must be rendered within a <Text> component.`.\n if (component?.default && __DEV__) {\n component.default.displayName ??= `${component.default.name ?? 'Route'}(${value.contextKey})`;\n }\n\n if (ErrorBoundary) {\n const Wrapped = React.forwardRef((props: any, ref: any) => {\n const children = React.createElement(component.default || EmptyRoute, {\n ...props,\n ref,\n });\n return <Try catch={ErrorBoundary}>{children}</Try>;\n });\n\n if (__DEV__) {\n Wrapped.displayName = `ErrorBoundary(${value.contextKey})`;\n }\n\n return {\n default: Wrapped,\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof component.default === 'object' &&\n component.default &&\n Object.keys(component.default).length === 0\n ) {\n return { default: EmptyRoute };\n }\n }\n\n return { default: component.default };\n}\n\nfunction fromLoadedRoute(value: RouteNode, res: LoadedRoute) {\n if (!(res instanceof Promise)) {\n return fromImport(value, res);\n }\n\n return res.then(fromImport.bind(null, value));\n}\n\n// TODO: Maybe there's a more React-y way to do this?\n// Without this store, the process enters a recursive loop.\nconst qualifiedStore = new WeakMap<RouteNode, React.ComponentType<any>>();\n\n/** Wrap the component with various enhancements and add access to child routes. */\nexport function getQualifiedRouteComponent(value: RouteNode) {\n if (qualifiedStore.has(value)) {\n return qualifiedStore.get(value)!;\n }\n\n let ScreenComponent:\n | React.ForwardRefExoticComponent<React.RefAttributes<unknown>>\n | React.ComponentType<any>;\n\n // TODO: This ensures sync doesn't use React.lazy, but it's not ideal.\n if (EXPO_ROUTER_IMPORT_MODE === 'lazy') {\n ScreenComponent = React.lazy(async () => {\n const res = value.loadRoute();\n return fromLoadedRoute(value, res) as Promise<{\n default: React.ComponentType<any>;\n }>;\n });\n\n if (__DEV__) {\n ScreenComponent.displayName = `AsyncRoute(${value.route})`;\n }\n } else {\n const res = value.loadRoute();\n ScreenComponent = fromImport(value, res).default!;\n }\n function BaseRoute({\n // Remove these React Navigation props to\n // enforce usage of expo-router hooks (where the query params are correct).\n route,\n navigation,\n\n // Pass all other props to the component\n ...props\n }: any) {\n const stateForPath = useStateForPath();\n const isFocused = navigation.isFocused();\n const store = useExpoRouterStore();\n\n if (isFocused) {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }\n\n useEffect(\n () =>\n navigation.addListener('focus', () => {\n const state = navigation.getState();\n // When navigating to a screen, remove the no animation param to re-enable animations\n // Otherwise the navigation back would also have no animation\n if (hasParam(route?.params, INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {\n navigation.replaceParams(\n removeParams(route?.params, [INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME])\n );\n }\n const isLeaf = !('state' in state.routes[state.index]);\n // Because setFocusedState caches the route info, this call will only trigger rerenders\n // if the component itself didn’t rerender and the route info changed.\n // Otherwise, the update from the `if` above will handle it,\n // and this won’t cause a redundant second update.\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }),\n [navigation]\n );\n\n return (\n <Route node={value} route={route}>\n <React.Suspense fallback={<SuspenseFallback route={value} />}>\n <ScreenComponent\n {...props}\n // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n // the intention is to make it possible to deduce shared routes.\n segment={value.route}\n />\n </React.Suspense>\n </Route>\n );\n }\n\n if (__DEV__) {\n BaseRoute.displayName = `Route(${value.route})`;\n }\n\n qualifiedStore.set(value, BaseRoute);\n return BaseRoute;\n}\n\nexport function screenOptionsFactory(\n route: RouteNode,\n options?: ScreenProps['options']\n): ScreenProps['options'] {\n return (args) => {\n // Only eager load generated components\n const staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n const staticResult = typeof staticOptions === 'function' ? staticOptions(args) : staticOptions;\n const dynamicResult = typeof options === 'function' ? options?.(args) : options;\n const output = {\n ...staticResult,\n ...dynamicResult,\n };\n\n // Prevent generated screens from showing up in the tab bar.\n if (route.internal) {\n output.tabBarItemStyle = { display: 'none' };\n output.tabBarButton = () => null;\n // TODO: React Navigation doesn't provide a way to prevent rendering the drawer item.\n output.drawerItemStyle = { height: 0, display: 'none' };\n }\n\n return output;\n };\n}\n\nexport function routeToScreen(\n route: RouteNode,\n { options, getId, ...props }: Partial<ScreenProps> = {}\n) {\n return (\n <Screen\n {...props}\n name={route.route}\n key={route.route}\n getId={getId}\n options={screenOptionsFactory(route, options)}\n getComponent={() => getQualifiedRouteComponent(route)}\n />\n );\n}\n\nexport function getSingularId(name: string, options: Record<string, any> = {}) {\n return name\n .split('/')\n .map((segment) => {\n if (segment.startsWith('[...')) {\n return options.params?.[segment.slice(4, -1)]?.join('/') || segment;\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n return options.params?.[segment.slice(1, -1)] || segment;\n } else {\n return segment;\n }\n })\n .join('/');\n}\n"]}
1
+ {"version":3,"file":"useScreens.js","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyJb,4CAwBC;AAmDD,gEAgGC;AAED,oDAwBC;AAED,sCAcC;AAED,sCAaC;AA3XD,qDAOkC;AAElC,+CAAyC;AAEzC,mCAA6F;AAC7F,8DAAiE;AACjE,gEAAoD;AACpD,6EAA0E;AAC1E,yDAI4B;AAC5B,6CAAsC;AAEtC,mDAAgD;AAChD,+DAA4D;AAC5D,qCAAkC;AAmClC,SAAS,iBAAiB,CACxB,QAAqB,EACrB,QAAuB,EAAE,EACzB,gBAAyB;IAEzB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,QAAQ;aACZ,IAAI,CAAC,IAAA,6BAAqB,EAAC,gBAAgB,CAAC,CAAC;aAC7C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,OAAO,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;IAE9B,MA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K,EAAE,GAAG,KAAK,KAA2B,EAAE;IAEvD,OAAO,CACL,CAAC,mBAAM,CACL,IAAI,KAAK,CAAC,CACV,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAClB,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACjB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,OAAO,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAC9C,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,EACtD,CACH,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY,EAAE,UAA+B,EAAE;IAC3E,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACf,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC;QACtE,CAAC;aAAM,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5D,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport {\n useStateForPath,\n type EventMapBase,\n type NavigationState,\n type ParamListBase,\n type RouteProp,\n type ScreenListeners,\n} from '@react-navigation/native';\nimport type { NativeStackNavigationEventMap } from '@react-navigation/native-stack';\nimport React, { useEffect } from 'react';\n\nimport { LoadedRoute, Route, RouteNode, sortRoutesWithInitial, useRouteNode } from './Route';\nimport { useExpoRouterStore } from './global-state/storeContext';\nimport EXPO_ROUTER_IMPORT_MODE from './import-mode';\nimport { ZoomTransitionEnabler } from './link/zoom/ZoomTransitionEnabler';\nimport {\n hasParam,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n removeParams,\n} from './navigationParams';\nimport { Screen } from './primitives';\nimport { UnknownOutputParams } from './types';\nimport { EmptyRoute } from './views/EmptyRoute';\nimport { SuspenseFallback } from './views/SuspenseFallback';\nimport { Try } from './views/Try';\n\nexport type ScreenProps<\n TOptions extends Record<string, any> = Record<string, any>,\n TState extends NavigationState = NavigationState,\n TEventMap extends EventMapBase = EventMapBase,\n> = {\n /** Name is required when used inside a Layout component. */\n name?: string;\n /**\n * Redirect to the nearest sibling route.\n * If all children are `redirect={true}`, the layout will render `null` as there are no children to render.\n */\n redirect?: boolean;\n initialParams?: Record<string, any>;\n options?:\n | TOptions\n | ((prop: { route: RouteProp<ParamListBase, string>; navigation: any }) => TOptions);\n\n listeners?:\n | ScreenListeners<TState, TEventMap>\n | ((prop: {\n route: RouteProp<ParamListBase, string>;\n navigation: any;\n }) => ScreenListeners<TState, TEventMap>);\n\n getId?: ({ params }: { params?: Record<string, any> }) => string | undefined;\n\n dangerouslySingular?: SingularOptions;\n};\n\nexport type SingularOptions =\n | boolean\n | ((name: string, params: UnknownOutputParams) => string | undefined);\n\nfunction getSortedChildren(\n children: RouteNode[],\n order: ScreenProps[] = [],\n initialRouteName?: string\n): { route: RouteNode; props: Partial<ScreenProps> }[] {\n if (!order?.length) {\n return children\n .sort(sortRoutesWithInitial(initialRouteName))\n .map((route) => ({ route, props: {} }));\n }\n const entries = [...children];\n\n const ordered = order\n .map(\n ({\n name,\n redirect,\n initialParams,\n listeners,\n options,\n getId,\n dangerouslySingular: singular,\n }) => {\n if (!entries.length) {\n console.warn(\n `[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`\n );\n return null;\n }\n const matchIndex = entries.findIndex((child) => child.route === name);\n if (matchIndex === -1) {\n console.warn(\n `[Layout children]: No route named \"${name}\" exists in nested children:`,\n children.map(({ route }) => route)\n );\n return null;\n } else {\n // Get match and remove from entries\n const match = entries[matchIndex];\n entries.splice(matchIndex, 1);\n\n // Ensure to return null after removing from entries.\n if (redirect) {\n if (typeof redirect === 'string') {\n throw new Error(`Redirecting to a specific route is not supported yet.`);\n }\n return null;\n }\n\n if (getId) {\n console.warn(\n `Deprecated: prop 'getId' on screen ${name} is deprecated. Please rename the prop to 'dangerouslySingular'`\n );\n if (singular) {\n console.warn(\n `Screen ${name} cannot use both getId and dangerouslySingular together.`\n );\n }\n } else if (singular) {\n // If singular is set, use it as the getId function.\n if (typeof singular === 'string') {\n getId = () => singular;\n } else if (typeof singular === 'function' && name) {\n getId = (options) => singular(name, options.params || {});\n } else if (singular === true && name) {\n getId = (options) => getSingularId(name, options);\n }\n }\n\n return {\n route: match,\n props: { initialParams, listeners, options, getId },\n };\n }\n }\n )\n .filter(Boolean) as {\n route: RouteNode;\n props: Partial<ScreenProps>;\n }[];\n\n // Add any remaining children\n ordered.push(\n ...entries.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({ route, props: {} }))\n );\n\n return ordered;\n}\n\n/**\n * @returns React Navigation screens sorted by the `route` property.\n */\nexport function useSortedScreens(\n order: ScreenProps[],\n protectedScreens: Set<string>,\n useOnlyUserDefinedScreens: boolean = false\n): React.ReactNode[] {\n const node = useRouteNode();\n\n const nodeChildren = node?.children ?? [];\n const children = useOnlyUserDefinedScreens\n ? nodeChildren.filter((child) =>\n order.some((userDefinedScreen) => userDefinedScreen.name === child.route)\n )\n : nodeChildren;\n\n const sorted = children.length ? getSortedChildren(children, order, node?.initialRouteName) : [];\n return React.useMemo(\n () =>\n sorted\n .filter((item) => !protectedScreens.has(item.route.route))\n .map((value) => {\n return routeToScreen(value.route, value.props);\n }),\n [sorted, protectedScreens]\n );\n}\n\nfunction fromImport(value: RouteNode, { ErrorBoundary, ...component }: LoadedRoute) {\n // If possible, add a more helpful display name for the component stack to improve debugging of React errors such as `Text strings must be rendered within a <Text> component.`.\n if (component?.default && __DEV__) {\n component.default.displayName ??= `${component.default.name ?? 'Route'}(${value.contextKey})`;\n }\n\n if (ErrorBoundary) {\n const Wrapped = React.forwardRef((props: any, ref: any) => {\n const children = React.createElement(component.default || EmptyRoute, {\n ...props,\n ref,\n });\n return <Try catch={ErrorBoundary}>{children}</Try>;\n });\n\n if (__DEV__) {\n Wrapped.displayName = `ErrorBoundary(${value.contextKey})`;\n }\n\n return {\n default: Wrapped,\n };\n }\n if (process.env.NODE_ENV !== 'production') {\n if (\n typeof component.default === 'object' &&\n component.default &&\n Object.keys(component.default).length === 0\n ) {\n return { default: EmptyRoute };\n }\n }\n\n return { default: component.default };\n}\n\nfunction fromLoadedRoute(value: RouteNode, res: LoadedRoute) {\n if (!(res instanceof Promise)) {\n return fromImport(value, res);\n }\n\n return res.then(fromImport.bind(null, value));\n}\n\n// TODO: Maybe there's a more React-y way to do this?\n// Without this store, the process enters a recursive loop.\nconst qualifiedStore = new WeakMap<RouteNode, React.ComponentType<any>>();\n\n/** Wrap the component with various enhancements and add access to child routes. */\nexport function getQualifiedRouteComponent(value: RouteNode) {\n if (qualifiedStore.has(value)) {\n return qualifiedStore.get(value)!;\n }\n\n let ScreenComponent:\n | React.ForwardRefExoticComponent<React.RefAttributes<unknown>>\n | React.ComponentType<any>;\n\n // TODO: This ensures sync doesn't use React.lazy, but it's not ideal.\n if (EXPO_ROUTER_IMPORT_MODE === 'lazy') {\n ScreenComponent = React.lazy(async () => {\n const res = value.loadRoute();\n return fromLoadedRoute(value, res) as Promise<{\n default: React.ComponentType<any>;\n }>;\n });\n\n if (__DEV__) {\n ScreenComponent.displayName = `AsyncRoute(${value.route})`;\n }\n } else {\n const res = value.loadRoute();\n ScreenComponent = fromImport(value, res).default!;\n }\n function BaseRoute({\n // Remove these React Navigation props to\n // enforce usage of expo-router hooks (where the query params are correct).\n route,\n navigation,\n\n // Pass all other props to the component\n ...props\n }: any) {\n const stateForPath = useStateForPath();\n const isFocused = navigation.isFocused();\n const store = useExpoRouterStore();\n\n if (isFocused) {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }\n\n useEffect(\n () =>\n navigation.addListener('focus', () => {\n const state = navigation.getState();\n const isLeaf = !('state' in state.routes[state.index]);\n // Because setFocusedState caches the route info, this call will only trigger rerenders\n // if the component itself didn’t rerender and the route info changed.\n // Otherwise, the update from the `if` above will handle it,\n // and this won’t cause a redundant second update.\n if (isLeaf && stateForPath) store.setFocusedState(stateForPath);\n }),\n [navigation]\n );\n\n useEffect(() => {\n return navigation.addListener(\n 'transitionEnd',\n (e?: NativeStackNavigationEventMap['transitionEnd']) => {\n if (!e?.data?.closing) {\n // When navigating to a screen, remove the no animation param to re-enable animations\n // Otherwise the navigation back would also have no animation\n if (hasParam(route?.params, INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME)) {\n navigation.replaceParams(\n removeParams(route?.params, [INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME])\n );\n }\n }\n }\n );\n }, [navigation]);\n\n return (\n <Route node={value} route={route}>\n <ZoomTransitionEnabler route={route} />\n <React.Suspense fallback={<SuspenseFallback route={value} />}>\n <ScreenComponent\n {...props}\n // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`\n // the intention is to make it possible to deduce shared routes.\n segment={value.route}\n />\n </React.Suspense>\n </Route>\n );\n }\n\n if (__DEV__) {\n BaseRoute.displayName = `Route(${value.route})`;\n }\n\n qualifiedStore.set(value, BaseRoute);\n return BaseRoute;\n}\n\nexport function screenOptionsFactory(\n route: RouteNode,\n options?: ScreenProps['options']\n): ScreenProps['options'] {\n return (args) => {\n // Only eager load generated components\n const staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n const staticResult = typeof staticOptions === 'function' ? staticOptions(args) : staticOptions;\n const dynamicResult = typeof options === 'function' ? options?.(args) : options;\n const output = {\n ...staticResult,\n ...dynamicResult,\n };\n\n // Prevent generated screens from showing up in the tab bar.\n if (route.internal) {\n output.tabBarItemStyle = { display: 'none' };\n output.tabBarButton = () => null;\n // TODO: React Navigation doesn't provide a way to prevent rendering the drawer item.\n output.drawerItemStyle = { height: 0, display: 'none' };\n }\n\n return output;\n };\n}\n\nexport function routeToScreen(\n route: RouteNode,\n { options, getId, ...props }: Partial<ScreenProps> = {}\n) {\n return (\n <Screen\n {...props}\n name={route.route}\n key={route.route}\n getId={getId}\n options={screenOptionsFactory(route, options)}\n getComponent={() => getQualifiedRouteComponent(route)}\n />\n );\n}\n\nexport function getSingularId(name: string, options: Record<string, any> = {}) {\n return name\n .split('/')\n .map((segment) => {\n if (segment.startsWith('[...')) {\n return options.params?.[segment.slice(4, -1)]?.join('/') || segment;\n } else if (segment.startsWith('[') && segment.endsWith(']')) {\n return options.params?.[segment.slice(1, -1)] || segment;\n } else {\n return segment;\n }\n })\n .join('/');\n}\n"]}
@@ -60,7 +60,8 @@ function Sitemap() {
60
60
  function SitemapInner() {
61
61
  const sitemap = (0, useSitemap_1.useSitemap)();
62
62
  const children = react_1.default.useMemo(() => sitemap?.children.filter(({ isInternal }) => !isInternal) ?? [], [sitemap]);
63
- return (<react_native_1.View style={styles.container} testID="expo-router-sitemap">
63
+ const Wrapper = react_native_1.Platform.OS === 'android' ? react_native_safe_area_context_1.SafeAreaView : react_native_1.View;
64
+ return (<Wrapper style={styles.container} testID="expo-router-sitemap">
64
65
  {statusbar_1.canOverrideStatusBarBehavior && <react_native_1.StatusBar barStyle="light-content"/>}
65
66
  <react_native_1.ScrollView contentContainerStyle={styles.scroll} automaticallyAdjustContentInsets contentInsetAdjustmentBehavior="automatic">
66
67
  {children.map((child) => (<react_native_1.View testID="sitemap-item-container" key={child.contextKey} style={styles.itemContainer}>
@@ -68,7 +69,7 @@ function SitemapInner() {
68
69
  </react_native_1.View>))}
69
70
  <SystemInfo />
70
71
  </react_native_1.ScrollView>
71
- </react_native_1.View>);
72
+ </Wrapper>);
72
73
  }
73
74
  function SitemapItem({ node, level = 0 }) {
74
75
  const isLayout = react_1.default.useMemo(() => node.children.length > 0 || node.contextKey.match(/_layout\.[jt]sx?$/), [node]);
@@ -1 +1 @@
1
- {"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;AAyBb,sCAkCC;AAED,0BAQC;AAlED,oEAAuC;AACvC,kDAA0B;AAC1B,+CASsB;AACtB,mFAA8D;AAE9D,mCAAgC;AAChC,2CAAwD;AACxD,6CAAuD;AACvD,uCAAoC;AACpC,kDAAkE;AAElE,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAgB,aAAa;IAC3B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,OAAO;QACrB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE;YAChB,KAAK,EAAE,OAAO;SACf;QACD,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,OAAO;QACxB,qBAAqB,EAAE;YACrB,KAAK,EAAE,OAAO;SACf;QACD,WAAW,EAAE;YACX,eAAe,EAAE,OAAO;YACxB,6BAA6B;YAC7B,iBAAiB,EAAE,SAAS;SAC7B;QACD,MAAM,EAAE,GAAG,EAAE;YACX,MAAM,cAAc,GAAG,uBAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,6CAAY,CAAC,CAAC,CAAC,mBAAI,CAAC;YACvE,OAAO,CACL,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACnC;UAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAChC;YAAA,CAAC,mBAAI,CAAC,KAAK,C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,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,GAAG;QAEZ,UAAU,EAAE,CAAC;QACb,aAAa,EAAE,GAAG;KACnB;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,CAAC,cAAc,CAAC;QAC7B,UAAU,EAAE,uBAAQ,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,sFAAsF;YAC/F,GAAG,EAAE,cAAc;YACnB,OAAO,EAAE,WAAW;SACrB,CAAC;QACF,UAAU,EAAE,KAAK;KAClB;CACF,CAAC,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport Constants from 'expo-constants';\nimport React from 'react';\nimport {\n Image,\n StyleSheet,\n Text,\n View,\n ScrollView,\n Platform,\n StatusBar,\n ViewStyle,\n} from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { NoSSR } from './NoSSR';\nimport { Pressable, PressableProps } from './Pressable';\nimport { useSitemap, SitemapType } from './useSitemap';\nimport { Link } from '../link/Link';\nimport { canOverrideStatusBarBehavior } from '../utils/statusbar';\n\nconst INDENT = 20;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n presentation: 'modal',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerShown: true,\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n header: () => {\n const WrapperElement = Platform.OS === 'android' ? SafeAreaView : View;\n return (\n <WrapperElement style={styles.header}>\n <View style={styles.headerContent}>\n <View style={styles.headerIcon}>\n <SitemapIcon />\n </View>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Sitemap\n </Text>\n </View>\n </WrapperElement>\n );\n },\n };\n}\n\nexport function Sitemap() {\n // Following the https://github.com/expo/expo/blob/ubax/router/move-404-and-sitemap-to-root/packages/expo-router/src/getRoutesSSR.ts#L38\n // we need to ensure that the Sitemap component is not rendered on the server.\n return (\n <NoSSR>\n <SitemapInner />\n </NoSSR>\n );\n}\n\nfunction SitemapInner() {\n const sitemap = useSitemap();\n const children = React.useMemo(\n () => sitemap?.children.filter(({ isInternal }) => !isInternal) ?? [],\n [sitemap]\n );\n return (\n <View style={styles.container} testID=\"expo-router-sitemap\">\n {canOverrideStatusBarBehavior && <StatusBar barStyle=\"light-content\" />}\n <ScrollView\n contentContainerStyle={styles.scroll}\n automaticallyAdjustContentInsets\n contentInsetAdjustmentBehavior=\"automatic\">\n {children.map((child) => (\n <View testID=\"sitemap-item-container\" key={child.contextKey} style={styles.itemContainer}>\n <SitemapItem node={child} />\n </View>\n ))}\n <SystemInfo />\n </ScrollView>\n </View>\n );\n}\n\ninterface SitemapItemProps {\n node: SitemapType;\n level?: number;\n info?: string;\n}\n\nfunction SitemapItem({ node, level = 0 }: SitemapItemProps) {\n const isLayout = React.useMemo(\n () => node.children.length > 0 || node.contextKey.match(/_layout\\.[jt]sx?$/),\n [node]\n );\n const info = node.isInitial ? 'Initial' : node.isGenerated ? 'Generated' : '';\n\n if (isLayout) {\n return <LayoutSitemapItem node={node} level={level} info={info} />;\n }\n return <StandardSitemapItem node={node} level={level} info={info} />;\n}\n\nfunction LayoutSitemapItem({ node, level, info }: Required<SitemapItemProps>) {\n const [isCollapsed, setIsCollapsed] = React.useState(true);\n\n return (\n <View style={styles.itemInnerContainer}>\n <SitemapItemPressable\n style={{ opacity: 0.4 }}\n leftIcon={<PkgIcon />}\n rightIcon={<ArrowIcon rotation={isCollapsed ? 0 : 180} />}\n filename={node.filename}\n level={level}\n info={info}\n onPress={() => setIsCollapsed((prev) => !prev)}\n />\n {!isCollapsed &&\n node.children.map((child) => (\n <SitemapItem\n key={child.contextKey}\n node={child}\n level={level + (node.isGenerated ? 0 : 1)}\n />\n ))}\n </View>\n );\n}\n\nfunction StandardSitemapItem({ node, info, level }: Required<SitemapItemProps>) {\n return (\n <Link accessibilityLabel={node.contextKey} href={node.href} asChild replace>\n <SitemapItemPressable\n leftIcon={<FileIcon />}\n rightIcon={<ForwardIcon />}\n filename={node.filename}\n level={level}\n info={info}\n />\n </Link>\n );\n}\n\nfunction SitemapItemPressable({\n style,\n leftIcon,\n rightIcon,\n filename,\n level,\n info,\n ...pressableProps\n}: {\n style?: ViewStyle;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n filename: string;\n level: number;\n info?: string;\n} & Omit<PressableProps, 'style' | 'children'>) {\n return (\n <Pressable {...pressableProps}>\n {({ pressed, hovered }) => (\n <View\n testID=\"sitemap-item\"\n style={[\n styles.itemInnerContainer,\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? '#202425' : '#151718',\n },\n pressed && { backgroundColor: '#26292b' },\n style,\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {leftIcon}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && <Text style={[styles.virtual, { marginRight: 8 }]}>{info}</Text>}\n {rightIcon}\n </View>\n </View>\n )}\n </Pressable>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nfunction SitemapIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/sitemap.png')} />;\n}\n\nfunction ArrowIcon({ rotation = 0 }: { rotation?: number }) {\n return (\n <Image\n style={[\n styles.image,\n {\n transform: [{ rotate: `${rotation}deg` }],\n },\n ]}\n source={require('expo-router/assets/arrow_down.png')}\n />\n );\n}\n\nfunction SystemInfo() {\n const getHermesVersion = () => {\n if (!global.HermesInternal) {\n return null;\n }\n\n const HERMES_RUNTIME = global.HermesInternal?.getRuntimeProperties?.() ?? {};\n const HERMES_VERSION = HERMES_RUNTIME['OSS Release Version'];\n const isStaticHermes = HERMES_RUNTIME['Static Hermes'];\n\n if (!HERMES_RUNTIME) {\n return null;\n }\n\n if (isStaticHermes) {\n return `${HERMES_VERSION} (shermes)`;\n }\n return HERMES_VERSION;\n };\n\n const locationOrigin = window.location.origin;\n const expoSdkVersion = Constants.expoConfig?.sdkVersion || 'Unknown';\n const hermesVersion = getHermesVersion();\n\n return (\n <View\n testID=\"sitemap-system-info\"\n style={{\n gap: 8,\n marginTop: 16,\n }}>\n <Text style={styles.systemInfoTitle}>System Information</Text>\n <View style={styles.systemInfoContainer}>\n <FormText right={process.env.NODE_ENV}>Mode</FormText>\n <FormText right={expoSdkVersion}>Expo SDK</FormText>\n {hermesVersion && <FormText right={hermesVersion}>Hermes version</FormText>}\n {locationOrigin && <FormText right={locationOrigin}>Location origin</FormText>}\n </View>\n </View>\n );\n}\n\nfunction FormText({ children, right }: { children?: React.ReactNode; right?: React.ReactNode }) {\n return (\n <View style={styles.systemInfoItem}>\n <Text style={styles.systemInfoLabel} numberOfLines={1} ellipsizeMode=\"tail\">\n {children}\n </Text>\n <View style={{ flex: 1 }} />\n\n <Text\n selectable\n style={[styles.systemInfoValue, styles.code]}\n numberOfLines={1}\n ellipsizeMode=\"tail\">\n {right}\n </Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n header: {\n backgroundColor: '#151718',\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: '#313538',\n boxShadow: '0px 3px 3px rgba(0, 0, 0, 0.33)',\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 14,\n paddingHorizontal: '5%',\n ...Platform.select({\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n },\n }),\n },\n title: {\n color: 'white',\n fontSize: 28,\n fontWeight: 'bold',\n },\n scroll: {\n gap: 12,\n paddingHorizontal: '5%',\n paddingVertical: 16,\n ...Platform.select({\n ios: {\n paddingBottom: 24,\n },\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n paddingBottom: 24,\n },\n default: {\n paddingBottom: 12,\n },\n }),\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#313538',\n backgroundColor: '#151718',\n borderRadius: 12,\n borderCurve: 'continuous',\n },\n itemInnerContainer: {\n backgroundColor: '#151718',\n borderRadius: 12,\n borderCurve: 'continuous',\n gap: 12,\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n filename: { color: 'white', fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: 'right', color: 'white' },\n image: { width: 24, height: 24, resizeMode: 'contain', opacity: 0.6 },\n headerIcon: {\n width: 40,\n height: 40,\n backgroundColor: '#202425',\n borderRadius: 8,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n systemInfoContainer: {\n borderWidth: 1,\n borderColor: '#313538',\n backgroundColor: '#151718',\n borderRadius: 12,\n gap: 8,\n borderCurve: 'continuous',\n padding: INDENT,\n },\n systemInfoTitle: {\n color: 'white',\n fontSize: 18,\n fontWeight: '600',\n marginBottom: 12,\n paddingHorizontal: INDENT,\n },\n systemInfoItem: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n flexWrap: 'wrap',\n },\n systemInfoLabel: {\n color: 'white',\n fontSize: 16,\n lineHeight: 24,\n },\n systemInfoValue: {\n color: 'white',\n fontSize: 16,\n opacity: 0.7,\n\n flexShrink: 1,\n letterSpacing: 0.5,\n },\n code: {\n fontVariant: ['tabular-nums'],\n fontFamily: Platform.select({\n default: `SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace`,\n ios: 'ui-monospace',\n android: 'monospace',\n }),\n fontWeight: '500',\n },\n});\n"]}
1
+ {"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,YAAY,CAAC;;;;;AAyBb,sCAkCC;AAED,0BAQC;AAlED,oEAAuC;AACvC,kDAA0B;AAC1B,+CASsB;AACtB,mFAA8D;AAE9D,mCAAgC;AAChC,2CAAwD;AACxD,6CAAuD;AACvD,uCAAoC;AACpC,kDAAkE;AAElE,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAgB,aAAa;IAC3B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,OAAO;QACrB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE;YAChB,KAAK,EAAE,OAAO;SACf;QACD,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,OAAO;QACxB,qBAAqB,EAAE;YACrB,KAAK,EAAE,OAAO;SACf;QACD,WAAW,EAAE;YACX,eAAe,EAAE,OAAO;YACxB,6BAA6B;YAC7B,iBAAiB,EAAE,SAAS;SAC7B;QACD,MAAM,EAAE,GAAG,EAAE;YACX,MAAM,cAAc,GAAG,uBAAQ,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,6CAAY,CAAC,CAAC,CAAC,mBAAI,CAAC;YACvE,OAAO,CACL,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACnC;UAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAChC;YAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAC7B;cAAA,CAAC,WAAW,CAAC,AAAD,EACd;YAAA,EAAE,mBAAI,CACN;YAAA,CAAC,mBAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MA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b,aAAa,EAAE,GAAG;KACnB;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,CAAC,cAAc,CAAC;QAC7B,UAAU,EAAE,uBAAQ,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,sFAAsF;YAC/F,GAAG,EAAE,cAAc;YACnB,OAAO,EAAE,WAAW;SACrB,CAAC;QACF,UAAU,EAAE,KAAK;KAClB;CACF,CAAC,CAAC","sourcesContent":["// Copyright © 2024 650 Industries.\n'use client';\n\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport Constants from 'expo-constants';\nimport React from 'react';\nimport {\n Image,\n StyleSheet,\n Text,\n View,\n ScrollView,\n Platform,\n StatusBar,\n ViewStyle,\n} from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { NoSSR } from './NoSSR';\nimport { Pressable, PressableProps } from './Pressable';\nimport { useSitemap, SitemapType } from './useSitemap';\nimport { Link } from '../link/Link';\nimport { canOverrideStatusBarBehavior } from '../utils/statusbar';\n\nconst INDENT = 20;\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: 'sitemap',\n presentation: 'modal',\n headerLargeTitle: false,\n headerTitleStyle: {\n color: 'white',\n },\n headerShown: true,\n headerTintColor: 'white',\n headerLargeTitleStyle: {\n color: 'white',\n },\n headerStyle: {\n backgroundColor: 'black',\n // @ts-expect-error: mistyped\n borderBottomColor: '#323232',\n },\n header: () => {\n const WrapperElement = Platform.OS === 'android' ? SafeAreaView : View;\n return (\n <WrapperElement style={styles.header}>\n <View style={styles.headerContent}>\n <View style={styles.headerIcon}>\n <SitemapIcon />\n </View>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Sitemap\n </Text>\n </View>\n </WrapperElement>\n );\n },\n };\n}\n\nexport function Sitemap() {\n // Following the https://github.com/expo/expo/blob/ubax/router/move-404-and-sitemap-to-root/packages/expo-router/src/getRoutesSSR.ts#L38\n // we need to ensure that the Sitemap component is not rendered on the server.\n return (\n <NoSSR>\n <SitemapInner />\n </NoSSR>\n );\n}\n\nfunction SitemapInner() {\n const sitemap = useSitemap();\n const children = React.useMemo(\n () => sitemap?.children.filter(({ isInternal }) => !isInternal) ?? [],\n [sitemap]\n );\n const Wrapper = Platform.OS === 'android' ? SafeAreaView : View;\n return (\n <Wrapper style={styles.container} testID=\"expo-router-sitemap\">\n {canOverrideStatusBarBehavior && <StatusBar barStyle=\"light-content\" />}\n <ScrollView\n contentContainerStyle={styles.scroll}\n automaticallyAdjustContentInsets\n contentInsetAdjustmentBehavior=\"automatic\">\n {children.map((child) => (\n <View testID=\"sitemap-item-container\" key={child.contextKey} style={styles.itemContainer}>\n <SitemapItem node={child} />\n </View>\n ))}\n <SystemInfo />\n </ScrollView>\n </Wrapper>\n );\n}\n\ninterface SitemapItemProps {\n node: SitemapType;\n level?: number;\n info?: string;\n}\n\nfunction SitemapItem({ node, level = 0 }: SitemapItemProps) {\n const isLayout = React.useMemo(\n () => node.children.length > 0 || node.contextKey.match(/_layout\\.[jt]sx?$/),\n [node]\n );\n const info = node.isInitial ? 'Initial' : node.isGenerated ? 'Generated' : '';\n\n if (isLayout) {\n return <LayoutSitemapItem node={node} level={level} info={info} />;\n }\n return <StandardSitemapItem node={node} level={level} info={info} />;\n}\n\nfunction LayoutSitemapItem({ node, level, info }: Required<SitemapItemProps>) {\n const [isCollapsed, setIsCollapsed] = React.useState(true);\n\n return (\n <View style={styles.itemInnerContainer}>\n <SitemapItemPressable\n style={{ opacity: 0.4 }}\n leftIcon={<PkgIcon />}\n rightIcon={<ArrowIcon rotation={isCollapsed ? 0 : 180} />}\n filename={node.filename}\n level={level}\n info={info}\n onPress={() => setIsCollapsed((prev) => !prev)}\n />\n {!isCollapsed &&\n node.children.map((child) => (\n <SitemapItem\n key={child.contextKey}\n node={child}\n level={level + (node.isGenerated ? 0 : 1)}\n />\n ))}\n </View>\n );\n}\n\nfunction StandardSitemapItem({ node, info, level }: Required<SitemapItemProps>) {\n return (\n <Link accessibilityLabel={node.contextKey} href={node.href} asChild replace>\n <SitemapItemPressable\n leftIcon={<FileIcon />}\n rightIcon={<ForwardIcon />}\n filename={node.filename}\n level={level}\n info={info}\n />\n </Link>\n );\n}\n\nfunction SitemapItemPressable({\n style,\n leftIcon,\n rightIcon,\n filename,\n level,\n info,\n ...pressableProps\n}: {\n style?: ViewStyle;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n filename: string;\n level: number;\n info?: string;\n} & Omit<PressableProps, 'style' | 'children'>) {\n return (\n <Pressable {...pressableProps}>\n {({ pressed, hovered }) => (\n <View\n testID=\"sitemap-item\"\n style={[\n styles.itemInnerContainer,\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered ? '#202425' : '#151718',\n },\n pressed && { backgroundColor: '#26292b' },\n style,\n ]}>\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {leftIcon}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: 'row', alignItems: 'center' }}>\n {!!info && <Text style={[styles.virtual, { marginRight: 8 }]}>{info}</Text>}\n {rightIcon}\n </View>\n </View>\n )}\n </Pressable>\n );\n}\n\nfunction FileIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/file.png')} />;\n}\n\nfunction PkgIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/pkg.png')} />;\n}\n\nfunction ForwardIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/forward.png')} />;\n}\n\nfunction SitemapIcon() {\n return <Image style={styles.image} source={require('expo-router/assets/sitemap.png')} />;\n}\n\nfunction ArrowIcon({ rotation = 0 }: { rotation?: number }) {\n return (\n <Image\n style={[\n styles.image,\n {\n transform: [{ rotate: `${rotation}deg` }],\n },\n ]}\n source={require('expo-router/assets/arrow_down.png')}\n />\n );\n}\n\nfunction SystemInfo() {\n const getHermesVersion = () => {\n if (!global.HermesInternal) {\n return null;\n }\n\n const HERMES_RUNTIME = global.HermesInternal?.getRuntimeProperties?.() ?? {};\n const HERMES_VERSION = HERMES_RUNTIME['OSS Release Version'];\n const isStaticHermes = HERMES_RUNTIME['Static Hermes'];\n\n if (!HERMES_RUNTIME) {\n return null;\n }\n\n if (isStaticHermes) {\n return `${HERMES_VERSION} (shermes)`;\n }\n return HERMES_VERSION;\n };\n\n const locationOrigin = window.location.origin;\n const expoSdkVersion = Constants.expoConfig?.sdkVersion || 'Unknown';\n const hermesVersion = getHermesVersion();\n\n return (\n <View\n testID=\"sitemap-system-info\"\n style={{\n gap: 8,\n marginTop: 16,\n }}>\n <Text style={styles.systemInfoTitle}>System Information</Text>\n <View style={styles.systemInfoContainer}>\n <FormText right={process.env.NODE_ENV}>Mode</FormText>\n <FormText right={expoSdkVersion}>Expo SDK</FormText>\n {hermesVersion && <FormText right={hermesVersion}>Hermes version</FormText>}\n {locationOrigin && <FormText right={locationOrigin}>Location origin</FormText>}\n </View>\n </View>\n );\n}\n\nfunction FormText({ children, right }: { children?: React.ReactNode; right?: React.ReactNode }) {\n return (\n <View style={styles.systemInfoItem}>\n <Text style={styles.systemInfoLabel} numberOfLines={1} ellipsizeMode=\"tail\">\n {children}\n </Text>\n <View style={{ flex: 1 }} />\n\n <Text\n selectable\n style={[styles.systemInfoValue, styles.code]}\n numberOfLines={1}\n ellipsizeMode=\"tail\">\n {right}\n </Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: 'black',\n flex: 1,\n alignItems: 'stretch',\n },\n header: {\n backgroundColor: '#151718',\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: '#313538',\n boxShadow: '0px 3px 3px rgba(0, 0, 0, 0.33)',\n },\n headerContent: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 14,\n paddingHorizontal: '5%',\n ...Platform.select({\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n },\n }),\n },\n title: {\n color: 'white',\n fontSize: 28,\n fontWeight: 'bold',\n },\n scroll: {\n gap: 12,\n paddingHorizontal: '5%',\n paddingVertical: 16,\n ...Platform.select({\n ios: {\n paddingBottom: 24,\n },\n web: {\n width: '100%',\n maxWidth: 960,\n marginHorizontal: 'auto',\n paddingBottom: 24,\n },\n default: {\n paddingBottom: 12,\n },\n }),\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: '#313538',\n backgroundColor: '#151718',\n borderRadius: 12,\n borderCurve: 'continuous',\n },\n itemInnerContainer: {\n backgroundColor: '#151718',\n borderRadius: 12,\n borderCurve: 'continuous',\n gap: 12,\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n ...Platform.select({\n web: {\n transitionDuration: '100ms',\n },\n }),\n },\n filename: { color: 'white', fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: 'right', color: 'white' },\n image: { width: 24, height: 24, resizeMode: 'contain', opacity: 0.6 },\n headerIcon: {\n width: 40,\n height: 40,\n backgroundColor: '#202425',\n borderRadius: 8,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n systemInfoContainer: {\n borderWidth: 1,\n borderColor: '#313538',\n backgroundColor: '#151718',\n borderRadius: 12,\n gap: 8,\n borderCurve: 'continuous',\n padding: INDENT,\n },\n systemInfoTitle: {\n color: 'white',\n fontSize: 18,\n fontWeight: '600',\n marginBottom: 12,\n paddingHorizontal: INDENT,\n },\n systemInfoItem: {\n flexDirection: 'row',\n gap: 8,\n alignItems: 'center',\n flexWrap: 'wrap',\n },\n systemInfoLabel: {\n color: 'white',\n fontSize: 16,\n lineHeight: 24,\n },\n systemInfoValue: {\n color: 'white',\n fontSize: 16,\n opacity: 0.7,\n\n flexShrink: 1,\n letterSpacing: 0.5,\n },\n code: {\n fontVariant: ['tabular-nums'],\n fontFamily: Platform.select({\n default: `SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace`,\n ios: 'ui-monospace',\n android: 'monospace',\n }),\n fontWeight: '500',\n },\n});\n"]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "platforms": ["apple", "android", "web"],
3
3
  "apple": {
4
- "modules": ["ExpoHeadModule", "LinkPreviewNativeModule"],
4
+ "modules": ["ExpoHeadModule", "LinkPreviewNativeModule", "RouterToolbarModule"],
5
5
  "appDelegateSubscribers": ["ExpoHeadAppDelegateSubscriber"]
6
6
  },
7
7
  "android": {
@@ -9,7 +9,7 @@
9
9
  "publication": {
10
10
  "groupId": "expo.modules.router",
11
11
  "artifactId": "expo.modules.router",
12
- "version": "7.0.0-canary-20251127-587bc53",
12
+ "version": "7.0.0-canary-20251205-a1dedc6",
13
13
  "repository": "local-maven-repo"
14
14
  }
15
15
  }
@@ -2,6 +2,7 @@ import ExpoModulesCore
2
2
  import WebKit
3
3
 
4
4
  class LinkPreviewNativeActionView: ExpoView, LinkPreviewMenuUpdatable {
5
+ var identifier: String = ""
5
6
  // MARK: - Shared props
6
7
  var title: String = "" {
7
8
  didSet {
@@ -1,8 +1,11 @@
1
1
  import ExpoModulesCore
2
2
 
3
3
  public class LinkPreviewNativeModule: Module {
4
+ static let moduleName: String = "ExpoRouterNativeLinkPreview"
5
+ lazy var zoomSourceRepository = LinkZoomTransitionsSourceRepository()
6
+
4
7
  public func definition() -> ModuleDefinition {
5
- Name("ExpoRouterNativeLinkPreview")
8
+ Name(LinkPreviewNativeModule.moduleName)
6
9
 
7
10
  View(NativeLinkPreviewView.self) {
8
11
  Prop("nextScreenId") { (view: NativeLinkPreviewView, nextScreenId: String) in
@@ -48,6 +51,9 @@ public class LinkPreviewNativeModule: Module {
48
51
  Prop("title") { (view: LinkPreviewNativeActionView, title: String) in
49
52
  view.title = title
50
53
  }
54
+ Prop("identifier") { (view: LinkPreviewNativeActionView, identifier: String) in
55
+ view.identifier = identifier
56
+ }
51
57
  Prop("icon") { (view: LinkPreviewNativeActionView, icon: String?) in
52
58
  view.icon = icon
53
59
  }
@@ -75,6 +81,41 @@ public class LinkPreviewNativeModule: Module {
75
81
 
76
82
  Events("onSelected")
77
83
  }
84
+
85
+ View(LinkZoomTransitionSource.self) {
86
+ Prop("disableForceFlatten") { (_: LinkZoomTransitionSource, _: Bool) in
87
+ // This prop is used in ExpoShadowNode in order to disable force flattening, when display: contents is used
88
+ }
89
+ Prop("identifier") { (view: LinkZoomTransitionSource, identifier: String) in
90
+ view.identifier = identifier
91
+ }
92
+ Prop("alignment") { (view: LinkZoomTransitionSource, alignment: LinkSourceAlignmentRect?) in
93
+ if let alignment = alignment {
94
+ view.alignment = CGRect(
95
+ x: alignment.x,
96
+ y: alignment.y,
97
+ width: alignment.width,
98
+ height: alignment.height
99
+ )
100
+ } else {
101
+ view.alignment = nil
102
+ }
103
+ }
104
+ }
105
+
106
+ View(LinkZoomTransitionEnabler.self) {
107
+ Prop("zoomTransitionSourceIdentifier") {
108
+ (view: LinkZoomTransitionEnabler, identifier: String) in
109
+ view.zoomTransitionSourceIdentifier = identifier
110
+ }
111
+ Prop("disableForceFlatten") { (_: LinkZoomTransitionEnabler, _: Bool) in
112
+ // This prop is used in ExpoShadowNode in order to disable force flattening, when display: contents is used
113
+ }
114
+
115
+ Prop("preventInteractiveDismissal") { (view: LinkZoomTransitionEnabler, prevent: Bool) in
116
+ view.isPreventingInteractiveDismissal = prevent
117
+ }
118
+ }
78
119
  }
79
120
  }
80
121
 
@@ -86,3 +127,10 @@ struct TabStatePath: Record {
86
127
  @Field var oldTabKey: String
87
128
  @Field var newTabKey: String
88
129
  }
130
+
131
+ struct LinkSourceAlignmentRect: Record {
132
+ @Field var x: Double
133
+ @Field var y: Double
134
+ @Field var width: Double
135
+ @Field var height: Double
136
+ }
@@ -1,3 +1,5 @@
1
+ import ExpoModulesCore
2
+ import RNScreens
1
3
  import UIKit
2
4
 
3
5
  struct TabChangeCommand {
@@ -6,23 +8,36 @@ struct TabChangeCommand {
6
8
  }
7
9
 
8
10
  internal class LinkPreviewNativeNavigation {
9
- private var preloadedView: UIView?
10
- private var preloadedStackView: UIView?
11
+ private var preloadedScreenView: RNSScreenView?
12
+ private var preloadedStackView: RNSScreenStackView?
11
13
  private var tabChangeCommands: [TabChangeCommand] = []
14
+ private let logger: Logger?
12
15
 
13
- init() {}
16
+ init(logger: Logger?) {
17
+ self.logger = logger
18
+ }
14
19
 
15
20
  func pushPreloadedView() {
16
- self.tabChangeCommands.forEach { command in
17
- command.tabBarController?.selectedIndex = command.tabIndex
18
- }
19
- guard let preloadedView,
21
+ self.performTabChanges()
22
+
23
+ guard let preloadedScreenView,
20
24
  let preloadedStackView
21
25
  else {
26
+ // Check if there were any tab change commands to perform
27
+ // If there were, the preview transition could be to a different tab only
28
+ if self.tabChangeCommands.isEmpty {
29
+ logger?.warn(
30
+ "expo-router: No preloaded screen view to push. You should only use Link.Preview when navigating inside a stack or native tabs navigator."
31
+ )
32
+ }
22
33
  return
23
34
  }
24
- LinkPreviewNativeNavigationObjC.pushPreloadedView(
25
- preloadedView, ontoStackView: preloadedStackView)
35
+
36
+ // Instead of pushing the preloaded screen view, we set its activity state
37
+ // React native screens will then handle the rest.
38
+ preloadedScreenView.activityState = Int32(RNSActivityState.onTop.rawValue)
39
+ preloadedStackView.markChildUpdated()
40
+ self.pushModalInnerScreenIfNeeded(screenView: preloadedScreenView)
26
41
  }
27
42
 
28
43
  func updatePreloadedView(screenId: String?, tabPath: TabPathPayload?, responder: UIView) {
@@ -30,69 +45,92 @@ internal class LinkPreviewNativeNavigation {
30
45
  let oldTabKeys = tabPath?.path.map { $0.oldTabKey } ?? []
31
46
  let stackOrTabView = findStackViewWithScreenIdOrTabBarController(
32
47
  screenId: screenId, tabKeys: oldTabKeys, responder: responder)
33
- if let stackOrTabView = stackOrTabView {
34
- if LinkPreviewNativeNavigationObjC.isRNSBottomTabsScreenComponentView(stackOrTabView) {
35
- let tabView = stackOrTabView
48
+ if stackOrTabView != nil {
49
+ if let tabView = stackOrTabView as? RNSBottomTabsScreenComponentView {
36
50
  let newTabKeys = tabPath?.path.map { $0.newTabKey } ?? []
37
- let stackView = findStackViewWithScreenIdInSubViews(
38
- screenId: screenId, tabKeys: newTabKeys, rootView: tabView)
39
- if let stackView = stackView {
40
- let screenViews = LinkPreviewNativeNavigationObjC.getScreenViews(stackView)
41
- if let screenView = screenViews.first(where: {
42
- LinkPreviewNativeNavigationObjC.getScreenId($0) == screenId
43
- }) {
44
- preloadedView = screenView
45
- preloadedStackView = stackView
46
- print("LinkPreviewNativeNavigation: Preloaded view for screenId \(screenId).")
47
- }
48
- }
49
- } else if LinkPreviewNativeNavigationObjC.isRNSScreenStackView(stackOrTabView) {
50
- let stackView = stackOrTabView
51
- let screenViews = LinkPreviewNativeNavigationObjC.getScreenViews(stackView)
52
- if let screenView = screenViews.first(where: {
53
- LinkPreviewNativeNavigationObjC.getScreenId($0) == screenId
54
- }) {
55
- preloadedView = screenView
56
- preloadedStackView = stackView
57
- print("LinkPreviewNativeNavigation: Preloaded view for screenId \(screenId).")
51
+ // The order is important here. findStackViewWithScreenIdInSubViews must be called
52
+ // even if screenId is nil to compute the tabChangeCommands.
53
+ if let stackView = findStackViewWithScreenIdInSubViews(
54
+ screenId: screenId, tabKeys: newTabKeys, rootView: tabView), let screenId {
55
+ setPreloadedView(stackView: stackView, screenId: screenId)
58
56
  }
57
+ } else if let stackView = stackOrTabView as? RNSScreenStackView, let screenId {
58
+ setPreloadedView(stackView: stackView, screenId: screenId)
59
59
  }
60
60
  } else {
61
- print("LinkPreviewNativeNavigation: No stack view found for screenId \(screenId).")
61
+ logger?.warn(
62
+ "expo-router: No view found for link preview navigation. You should only use Link.Preview when navigating inside a stack or native tabs navigator."
63
+ )
64
+ }
65
+ }
66
+
67
+ private func performTabChanges() {
68
+ self.tabChangeCommands.forEach { command in
69
+ command.tabBarController?.selectedIndex = command.tabIndex
70
+ }
71
+ }
72
+
73
+ // If screen is a modal with header, it will have an inner stack screen
74
+ // https://github.com/software-mansion/react-native-screens/blob/8b82e081e8fdfa6e0864821134bda9e87a745b00/src/components/ScreenStackItem.tsx#L146-L160
75
+ // In this case we need to set the activity state of the inner screen as well.
76
+ private func pushModalInnerScreenIfNeeded(screenView: RNSScreenView) {
77
+ // If the screen is modal with header then it will have exactly one child - RNSNavigationController.
78
+ if screenView.isModal() && screenView.controller.children.count == 1 {
79
+ // To get the inner screen stack we need to go through RNSNavigationController.
80
+ // The structure is as follows:
81
+ // RNSScreenView (preloadedScreenView)
82
+ // └── RNSNavigationController (outer stack)
83
+ // └── RNSScreenStackView (innerScreenStack)
84
+ if let rnsNavController = screenView.controller.children.first
85
+ as? RNSNavigationController,
86
+ // The delegate of RNSNavigationController is RNSScreenStackView.
87
+ let innerScreenStack = rnsNavController.delegate as? RNSScreenStackView,
88
+ // The first and only child of the inner screen stack should be
89
+ // RNSScreenView (<ScreenStackItem>).
90
+ let screenContentView = innerScreenStack.reactSubviews().first as? RNSScreenView {
91
+ print("screenView screenId:", screenView.screenId)
92
+ print("innerScreenStack screenIds:", innerScreenStack.screenIds)
93
+ // Same as above, we let React Native Screens handle the transition.
94
+ // We need to set the activity of inner screen as well, because its
95
+ // react value is the same as the preloaded screen - 0.
96
+ // https://github.com/software-mansion/react-native-screens/blob/8b82e081e8fdfa6e0864821134bda9e87a745b00/src/components/ScreenStackItem.tsx#L151
97
+ screenContentView.activityState = Int32(RNSActivityState.onTop.rawValue)
98
+ innerScreenStack.markChildUpdated()
99
+ }
100
+ }
101
+ }
102
+
103
+ private func setPreloadedView(
104
+ stackView: RNSScreenStackView, screenId: String
105
+ ) {
106
+ let screenViews = stackView.reactSubviews()
107
+ if let screenView = screenViews?.first(where: {
108
+ ($0 as? RNSScreenView)?.screenId == screenId
109
+ }) as? RNSScreenView {
110
+ preloadedScreenView = screenView
111
+ preloadedStackView = stackView
62
112
  }
63
113
  }
64
114
 
115
+ // Allowing for null screenId to support preloading tab navigators
116
+ // Even if the desired screenId is not found, we still need to compute the tabChangeCommands
65
117
  private func findStackViewWithScreenIdInSubViews(
66
118
  screenId: String?, tabKeys: [String], rootView: UIView
67
- ) -> UIView? {
68
- if LinkPreviewNativeNavigationObjC.isRNSScreenStackView(rootView),
69
- let _screenId = screenId {
70
- let screenIds = LinkPreviewNativeNavigationObjC.getStackViewScreenIds(rootView)
71
- if screenIds.contains(_screenId) {
119
+ ) -> RNSScreenStackView? {
120
+ if let rootView = rootView as? RNSScreenStackView,
121
+ let screenId {
122
+ if rootView.screenIds.contains(screenId) {
72
123
  return rootView
73
124
  }
74
- } else if LinkPreviewNativeNavigationObjC.isRNSBottomTabsScreenComponentView(rootView)
75
- || LinkPreviewNativeNavigationObjC.isRNSBottomTabsHostComponentView(rootView) {
76
- let tabBarController = LinkPreviewNativeNavigationObjC.getBottomTabController(from: rootView)
77
- if let tabBarController = tabBarController {
78
- let views = tabBarController.viewControllers?.compactMap { $0.view } ?? []
79
- let enumeratedViews = views.enumerated()
80
- if let (tabIndex, tabView) =
81
- enumeratedViews
82
- .first(where: { _, view in
83
- LinkPreviewNativeNavigationObjC.isRNSBottomTabsScreenComponentView(view)
84
- && tabKeys.contains(LinkPreviewNativeNavigationObjC.getTabKey(view))
85
- }) {
86
- self.tabChangeCommands.append(
87
- TabChangeCommand(tabBarController: tabBarController, tabIndex: tabIndex))
88
- let test = tabBarController.viewControllers
89
-
90
- for subview in tabView.subviews {
91
- let result = findStackViewWithScreenIdInSubViews(
92
- screenId: screenId, tabKeys: tabKeys, rootView: subview)
93
- if result != nil {
94
- return result
95
- }
125
+ } else if let tabBarController = getTabBarControllerFromTabView(view: rootView) {
126
+ if let (tabIndex, tabView) = getIndexAndViewOfFirstTabWithKey(
127
+ tabBarController: tabBarController, tabKeys: tabKeys) {
128
+ self.tabChangeCommands.append(
129
+ TabChangeCommand(tabBarController: tabBarController, tabIndex: tabIndex))
130
+ for subview in tabView.subviews {
131
+ if let result = findStackViewWithScreenIdInSubViews(
132
+ screenId: screenId, tabKeys: tabKeys, rootView: subview) {
133
+ return result
96
134
  }
97
135
  }
98
136
  }
@@ -109,23 +147,47 @@ internal class LinkPreviewNativeNavigation {
109
147
  return nil
110
148
  }
111
149
 
150
+ private func getIndexAndViewOfFirstTabWithKey(
151
+ tabBarController: UITabBarController, tabKeys: [String]
152
+ ) -> (tabIndex: Int, tabView: UIView)? {
153
+ let views = tabBarController.viewControllers?.compactMap { $0.view } ?? []
154
+ let enumeratedViews = views.enumerated()
155
+ if let result = enumeratedViews
156
+ .first(where: { _, view in
157
+ guard let tabView = view as? RNSBottomTabsScreenComponentView, let tabKey = tabView.tabKey
158
+ else {
159
+ return false
160
+ }
161
+ return tabKeys.contains(tabKey)
162
+ }) {
163
+ return (result.offset, result.element)
164
+ }
165
+ return nil
166
+ }
167
+
168
+ private func getTabBarControllerFromTabView(view: UIView) -> UITabBarController? {
169
+ if let tabScreenView = view as? RNSBottomTabsScreenComponentView {
170
+ return tabScreenView.reactViewController()?.tabBarController as? UITabBarController
171
+ }
172
+ if let tabHostView = view as? RNSBottomTabsHostComponentView {
173
+ return tabHostView.controller as? UITabBarController
174
+ }
175
+ return nil
176
+ }
177
+
112
178
  private func findStackViewWithScreenIdOrTabBarController(
113
179
  screenId: String?, tabKeys: [String], responder: UIView
114
180
  ) -> UIView? {
115
181
  var currentResponder: UIResponder? = responder
116
182
 
117
183
  while let nextResponder = currentResponder?.next {
118
- if let view = nextResponder as? UIView,
119
- LinkPreviewNativeNavigationObjC.isRNSScreenStackView(view),
120
- let _screenId = screenId {
121
- let screenIds = LinkPreviewNativeNavigationObjC.getStackViewScreenIds(view)
122
- if screenIds.contains(_screenId) {
184
+ if let view = nextResponder as? RNSScreenStackView,
185
+ let screenId {
186
+ if view.screenIds.contains(screenId) {
123
187
  return view
124
188
  }
125
- } else if let tabView = nextResponder as? UIView,
126
- LinkPreviewNativeNavigationObjC.isRNSBottomTabsScreenComponentView(tabView) {
127
- let tabKey = LinkPreviewNativeNavigationObjC.getTabKey(tabView)
128
- if tabKeys.contains(tabKey) {
189
+ } else if let tabView = nextResponder as? RNSBottomTabsScreenComponentView {
190
+ if let tabKey = tabView.tabKey, tabKeys.contains(tabKey) {
129
191
  return tabView
130
192
  }
131
193
  }