expo-router 7.0.0-canary-20251120-e46b3cc → 7.0.0-canary-20251205-756eb7a

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 (227) 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 +25 -7
  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 +39 -5
  21. package/build/layouts/StackClient.js.map +1 -1
  22. package/build/layouts/stack-utils/StackHeaderComponent.js +6 -6
  23. package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
  24. package/build/layouts/stack-utils/StackHeaderTitle.d.ts.map +1 -1
  25. package/build/layouts/stack-utils/StackHeaderTitle.js +3 -8
  26. package/build/layouts/stack-utils/StackHeaderTitle.js.map +1 -1
  27. package/build/layouts/stack-utils/index.d.ts +0 -1
  28. package/build/layouts/stack-utils/index.d.ts.map +1 -1
  29. package/build/layouts/stack-utils/index.js +1 -3
  30. package/build/layouts/stack-utils/index.js.map +1 -1
  31. package/build/link/ExpoLink.d.ts.map +1 -1
  32. package/build/link/ExpoLink.js +12 -4
  33. package/build/link/ExpoLink.js.map +1 -1
  34. package/build/link/Link.d.ts +2 -0
  35. package/build/link/Link.d.ts.map +1 -1
  36. package/build/link/Link.js +2 -0
  37. package/build/link/Link.js.map +1 -1
  38. package/build/link/LinkWithPreview.d.ts +6 -1
  39. package/build/link/LinkWithPreview.d.ts.map +1 -1
  40. package/build/link/LinkWithPreview.js +10 -11
  41. package/build/link/LinkWithPreview.js.map +1 -1
  42. package/build/link/elements.d.ts +8 -0
  43. package/build/link/elements.d.ts.map +1 -1
  44. package/build/link/elements.js +7 -2
  45. package/build/link/elements.js.map +1 -1
  46. package/build/link/preview/native.d.ts +17 -0
  47. package/build/link/preview/native.d.ts.map +1 -1
  48. package/build/link/preview/native.js +22 -0
  49. package/build/link/preview/native.js.map +1 -1
  50. package/build/link/zoom/ZoomTransitionEnabler.d.ts +5 -0
  51. package/build/link/zoom/ZoomTransitionEnabler.d.ts.map +1 -0
  52. package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts +5 -0
  53. package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -0
  54. package/build/link/zoom/ZoomTransitionEnabler.ios.js +44 -0
  55. package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -0
  56. package/build/link/zoom/ZoomTransitionEnabler.js +13 -0
  57. package/build/link/zoom/ZoomTransitionEnabler.js.map +1 -0
  58. package/build/link/zoom/ZoomTransitionEnabler.types.d.ts +4 -0
  59. package/build/link/zoom/ZoomTransitionEnabler.types.d.ts.map +1 -0
  60. package/build/link/zoom/ZoomTransitionEnabler.types.js +3 -0
  61. package/build/link/zoom/ZoomTransitionEnabler.types.js.map +1 -0
  62. package/build/link/zoom/link-apple-zoom.d.ts +23 -0
  63. package/build/link/zoom/link-apple-zoom.d.ts.map +1 -0
  64. package/build/link/zoom/link-apple-zoom.js +40 -0
  65. package/build/link/zoom/link-apple-zoom.js.map +1 -0
  66. package/build/link/zoom/useZoomTransitionPrimitives.d.ts +6 -0
  67. package/build/link/zoom/useZoomTransitionPrimitives.d.ts.map +1 -0
  68. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts +11 -0
  69. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +1 -0
  70. package/build/link/zoom/useZoomTransitionPrimitives.ios.js +66 -0
  71. package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +1 -0
  72. package/build/link/zoom/useZoomTransitionPrimitives.js +9 -0
  73. package/build/link/zoom/useZoomTransitionPrimitives.js.map +1 -0
  74. package/build/link/zoom/zoom-transition-context.d.ts +7 -0
  75. package/build/link/zoom/zoom-transition-context.d.ts.map +1 -0
  76. package/build/link/zoom/zoom-transition-context.js +6 -0
  77. package/build/link/zoom/zoom-transition-context.js.map +1 -0
  78. package/build/native-tabs/NativeBottomTabsNavigator.d.ts +3 -15
  79. package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
  80. package/build/native-tabs/NativeBottomTabsNavigator.js +17 -2
  81. package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -1
  82. package/build/native-tabs/NativeBottomTabsRouter.d.ts.map +1 -1
  83. package/build/native-tabs/NativeBottomTabsRouter.js +12 -1
  84. package/build/native-tabs/NativeBottomTabsRouter.js.map +1 -1
  85. package/build/native-tabs/NativeTabTrigger.d.ts +2 -2
  86. package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
  87. package/build/native-tabs/NativeTabTrigger.js +24 -14
  88. package/build/native-tabs/NativeTabTrigger.js.map +1 -1
  89. package/build/native-tabs/NativeTabs.d.ts +6 -3
  90. package/build/native-tabs/NativeTabs.d.ts.map +1 -1
  91. package/build/native-tabs/NativeTabs.js +7 -2
  92. package/build/native-tabs/NativeTabs.js.map +1 -1
  93. package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
  94. package/build/native-tabs/NativeTabsView.js +26 -3
  95. package/build/native-tabs/NativeTabsView.js.map +1 -1
  96. package/build/native-tabs/appearance.d.ts.map +1 -1
  97. package/build/native-tabs/appearance.js +2 -4
  98. package/build/native-tabs/appearance.js.map +1 -1
  99. package/build/native-tabs/common/elements.d.ts +36 -3
  100. package/build/native-tabs/common/elements.d.ts.map +1 -1
  101. package/build/native-tabs/common/elements.js +30 -1
  102. package/build/native-tabs/common/elements.js.map +1 -1
  103. package/build/native-tabs/hooks.d.ts +45 -0
  104. package/build/native-tabs/hooks.d.ts.map +1 -0
  105. package/build/native-tabs/hooks.js +57 -0
  106. package/build/native-tabs/hooks.js.map +1 -0
  107. package/build/native-tabs/index.d.ts +1 -1
  108. package/build/native-tabs/index.d.ts.map +1 -1
  109. package/build/native-tabs/index.js.map +1 -1
  110. package/build/native-tabs/types.d.ts +42 -55
  111. package/build/native-tabs/types.d.ts.map +1 -1
  112. package/build/native-tabs/types.js.map +1 -1
  113. package/build/native-tabs/utils/bottomAccessory.d.ts +9 -0
  114. package/build/native-tabs/utils/bottomAccessory.d.ts.map +1 -0
  115. package/build/native-tabs/utils/bottomAccessory.js +17 -0
  116. package/build/native-tabs/utils/bottomAccessory.js.map +1 -0
  117. package/build/native-tabs/utils/icon.d.ts +3 -0
  118. package/build/native-tabs/utils/icon.d.ts.map +1 -1
  119. package/build/native-tabs/utils/icon.js +16 -0
  120. package/build/native-tabs/utils/icon.js.map +1 -1
  121. package/build/native-tabs/utils/index.d.ts +0 -1
  122. package/build/native-tabs/utils/index.d.ts.map +1 -1
  123. package/build/native-tabs/utils/index.js +1 -4
  124. package/build/native-tabs/utils/index.js.map +1 -1
  125. package/build/native-tabs/utils/label.d.ts.map +1 -1
  126. package/build/native-tabs/utils/label.js +6 -2
  127. package/build/native-tabs/utils/label.js.map +1 -1
  128. package/build/native-tabs/utils/materialIconConverter.android.d.ts +4 -0
  129. package/build/native-tabs/utils/materialIconConverter.android.d.ts.map +1 -0
  130. package/build/native-tabs/utils/materialIconConverter.android.js +10 -0
  131. package/build/native-tabs/utils/materialIconConverter.android.js.map +1 -0
  132. package/build/native-tabs/utils/materialIconConverter.d.ts +4 -0
  133. package/build/native-tabs/utils/materialIconConverter.d.ts.map +1 -0
  134. package/build/native-tabs/utils/materialIconConverter.js +8 -0
  135. package/build/native-tabs/utils/materialIconConverter.js.map +1 -0
  136. package/build/navigationParams.d.ts +5 -1
  137. package/build/navigationParams.d.ts.map +1 -1
  138. package/build/navigationParams.js +32 -8
  139. package/build/navigationParams.js.map +1 -1
  140. package/build/toolbar/elements.d.ts +24 -0
  141. package/build/toolbar/elements.d.ts.map +1 -0
  142. package/build/toolbar/elements.js +36 -0
  143. package/build/toolbar/elements.js.map +1 -0
  144. package/build/toolbar/index.d.ts +9 -0
  145. package/build/toolbar/index.d.ts.map +1 -0
  146. package/build/toolbar/index.js +12 -0
  147. package/build/toolbar/index.js.map +1 -0
  148. package/build/toolbar/native.d.ts +4 -0
  149. package/build/toolbar/native.d.ts.map +1 -0
  150. package/build/toolbar/native.ios.d.ts +4 -0
  151. package/build/toolbar/native.ios.d.ts.map +1 -0
  152. package/build/toolbar/native.ios.js +21 -0
  153. package/build/toolbar/native.ios.js.map +1 -0
  154. package/build/toolbar/native.js +11 -0
  155. package/build/toolbar/native.js.map +1 -0
  156. package/build/toolbar/native.types.d.ts +30 -0
  157. package/build/toolbar/native.types.d.ts.map +1 -0
  158. package/build/toolbar/native.types.js +3 -0
  159. package/build/toolbar/native.types.js.map +1 -0
  160. package/build/useScreens.d.ts.map +1 -1
  161. package/build/useScreens.js +14 -0
  162. package/build/useScreens.js.map +1 -1
  163. package/build/utils/children.d.ts +7 -0
  164. package/build/utils/children.d.ts.map +1 -0
  165. package/build/utils/children.js +24 -0
  166. package/build/utils/children.js.map +1 -0
  167. package/build/utils/style.d.ts +3 -0
  168. package/build/utils/style.d.ts.map +1 -0
  169. package/build/utils/style.js +10 -0
  170. package/build/utils/style.js.map +1 -0
  171. package/build/views/Sitemap.js +3 -2
  172. package/build/views/Sitemap.js.map +1 -1
  173. package/expo-module.config.json +2 -2
  174. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +1 -0
  175. package/ios/LinkPreview/LinkPreviewNativeModule.swift +49 -1
  176. package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +132 -70
  177. package/ios/LinkPreview/LinkPreviewNativeView.swift +34 -17
  178. package/ios/LinkPreview/LinkZoomTransition.swift +227 -0
  179. package/ios/Toolbar/RouterToolbarHostView.swift +140 -0
  180. package/ios/Toolbar/RouterToolbarItemView.swift +171 -0
  181. package/ios/Toolbar/RouterToolbarModule.swift +102 -0
  182. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module} +7 -7
  183. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.md5 +1 -0
  184. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.sha1 +1 -0
  185. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.sha256 +1 -0
  186. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.module.sha512 +1 -0
  187. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom} +1 -1
  188. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.md5 +1 -0
  189. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.sha1 +1 -0
  190. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.sha256 +1 -0
  191. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.pom.sha512 +1 -0
  192. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  193. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  194. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  195. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  196. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  197. package/package.json +17 -14
  198. package/unstable-toolbar.d.ts +1 -0
  199. package/unstable-toolbar.js +1 -0
  200. package/build/layouts/stack-utils/utils.d.ts +0 -3
  201. package/build/layouts/stack-utils/utils.d.ts.map +0 -1
  202. package/build/layouts/stack-utils/utils.js +0 -8
  203. package/build/layouts/stack-utils/utils.js.map +0 -1
  204. package/build/native-tabs/utils/children.d.ts +0 -5
  205. package/build/native-tabs/utils/children.d.ts.map +0 -1
  206. package/build/native-tabs/utils/children.js +0 -15
  207. package/build/native-tabs/utils/children.js.map +0 -1
  208. package/ios/LinkPreview/LinkPreviewNativeNavigation.h +0 -50
  209. package/ios/LinkPreview/LinkPreviewNativeNavigation.mm +0 -164
  210. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.md5 +0 -1
  211. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.sha1 +0 -1
  212. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.sha256 +0 -1
  213. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.module.sha512 +0 -1
  214. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.md5 +0 -1
  215. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.sha1 +0 -1
  216. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.sha256 +0 -1
  217. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.pom.sha512 +0 -1
  218. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar} +0 -0
  219. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.md5 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.md5} +0 -0
  220. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.sha1 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.sha1} +0 -0
  221. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.sha256 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.sha256} +0 -0
  222. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc-sources.jar.sha512 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a-sources.jar.sha512} +0 -0
  223. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar} +0 -0
  224. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.md5 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.md5} +0 -0
  225. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.sha1 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.sha1} +0 -0
  226. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.sha256 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.sha256} +0 -0
  227. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251120-e46b3cc/expo.modules.router-7.0.0-canary-20251120-e46b3cc.aar.sha512 → 7.0.0-canary-20251205-756eb7a/expo.modules.router-7.0.0-canary-20251205-756eb7a.aar.sha512} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"navigationParams.js","sourceRoot":"","sources":["../src/navigationParams.ts"],"names":[],"mappings":";;;AAY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B,CACF,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,OAAO,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["export const INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = '__internal_expo_router_no_animation';\nexport const INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME =\n '__internal__expo_router_is_preview_navigation';\n\nconst internalExpoRouterParamNames = [\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,\n] as const;\n\nexport type InternalExpoRouterParamName = (typeof internalExpoRouterParamNames)[number];\nexport type InternalExpoRouterParams = Partial<Record<InternalExpoRouterParamName, unknown>>;\n\nexport function appendInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined,\n expoParams: InternalExpoRouterParams\n) {\n let newParams: Record<string, unknown> = {};\n // Using nested params is a workaround for the issue with the preview key not being passed to the params\n // https://github.com/Ubax/react-navigation/blob/main/packages/core/src/useNavigationBuilder.tsx#L573\n // Another solution would be to propagate the preview key in the useNavigationBuilder,\n // but that would require us to fork the @react-navigation/core package.\n let nestedParams: Record<string, unknown> = {};\n if (params) {\n newParams = { ...params };\n if ('params' in params) {\n if (typeof params.params === 'object' && params.params) {\n nestedParams = params.params as Record<string, unknown>;\n }\n }\n }\n nestedParams = { ...nestedParams, ...expoParams };\n newParams = { ...newParams, ...expoParams };\n if (Object.keys(nestedParams).length > 0) {\n newParams.params = nestedParams;\n }\n if (Object.keys(newParams).length === 0 && params === undefined) {\n return undefined;\n }\n return newParams;\n}\n\nexport function getInternalExpoRouterParams(\n _params: Record<string, unknown> | object | undefined\n): InternalExpoRouterParams {\n const expoParams: InternalExpoRouterParams = {};\n const params: Record<string, unknown> = _params ? (_params as Record<string, unknown>) : {};\n const nestedParams: Record<string, unknown> =\n 'params' in params && typeof params.params === 'object' && params.params\n ? (params.params as Record<string, unknown>)\n : {};\n\n for (const key of internalExpoRouterParamNames) {\n if (key in params) {\n expoParams[key] = params[key];\n } else if (key in nestedParams) {\n expoParams[key] = nestedParams[key];\n }\n }\n\n return expoParams;\n}\n\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object\n): Record<string, unknown> | object;\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined\n): Record<string, unknown> | object | undefined;\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined\n): Record<string, unknown> | object | undefined {\n if (!params) {\n return undefined;\n }\n const newNestedParams =\n 'params' in params && typeof params.params === 'object' && params.params\n ? Object.fromEntries(\n Object.entries(params.params).filter(\n ([key]) => !internalExpoRouterParamNames.includes(key as InternalExpoRouterParamName)\n )\n )\n : {};\n const newParams = Object.fromEntries(\n Object.entries(params).filter(\n ([key]) =>\n !internalExpoRouterParamNames.includes(key as InternalExpoRouterParamName) &&\n key !== 'params'\n )\n );\n if (Object.keys(newNestedParams).length > 0) {\n return { ...newParams, params: newNestedParams };\n }\n return newParams;\n}\n"]}
1
+ {"version":3,"file":"navigationParams.js","sourceRoot":"","sources":["../src/navigationParams.ts"],"names":[],"mappings":";;;AAkBA,wEA2BC;AAED,kEAmBC;AAED,4BAWC;AAED,oCAmBC;AAQD,wEAOC;AAnHY,QAAA,4CAA4C,GAAG,qCAAqC,CAAC;AACrF,QAAA,qDAAqD,GAChE,+CAA+C,CAAC;AACrC,QAAA,yDAAyD,GACpE,kDAAkD,CAAC;AACxC,QAAA,yDAAyD,GACpE,kDAAkD,CAAC;AAErD,MAAM,4BAA4B,GAAG;IACnC,oDAA4C;IAC5C,6DAAqD;IACrD,iEAAyD;IACzD,iEAAyD;CACjD,CAAC;AAKX,SAAgB,8BAA8B,CAC5C,MAAoD,EACpD,UAAoC;IAE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MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,QAAQ,CAAC,CACvF,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClD,OAAO,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IACnD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAQD,SAAgB,8BAA8B,CAC5C,MAAoD;IAEpD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,4BAA4B,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["export const INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME = '__internal_expo_router_no_animation';\nexport const INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME =\n '__internal__expo_router_is_preview_navigation';\nexport const INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME =\n '__internal_expo_router_zoom_transition_source_id';\nexport const INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME =\n '__internal_expo_router_zoom_transition_screen_id';\n\nconst internalExpoRouterParamNames = [\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n] as const;\n\nexport type InternalExpoRouterParamName = (typeof internalExpoRouterParamNames)[number];\nexport type InternalExpoRouterParams = Partial<Record<InternalExpoRouterParamName, unknown>>;\n\nexport function appendInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined,\n expoParams: InternalExpoRouterParams\n) {\n let newParams: Record<string, unknown> = {};\n // Using nested params is a workaround for the issue with the preview key not being passed to the params\n // https://github.com/Ubax/react-navigation/blob/main/packages/core/src/useNavigationBuilder.tsx#L573\n // Another solution would be to propagate the preview key in the useNavigationBuilder,\n // but that would require us to fork the @react-navigation/core package.\n let nestedParams: Record<string, unknown> = {};\n if (params) {\n newParams = { ...params };\n if ('params' in params) {\n if (typeof params.params === 'object' && params.params) {\n nestedParams = params.params as Record<string, unknown>;\n }\n }\n }\n nestedParams = { ...nestedParams, ...expoParams };\n newParams = { ...newParams, ...expoParams };\n if (Object.keys(nestedParams).length > 0) {\n newParams.params = nestedParams;\n }\n if (Object.keys(newParams).length === 0 && params === undefined) {\n return undefined;\n }\n return newParams;\n}\n\nexport function getInternalExpoRouterParams(\n _params: Record<string, unknown> | object | undefined\n): InternalExpoRouterParams {\n const expoParams: InternalExpoRouterParams = {};\n const params: Record<string, unknown> = _params ? (_params as Record<string, unknown>) : {};\n const nestedParams: Record<string, unknown> =\n 'params' in params && typeof params.params === 'object' && params.params\n ? (params.params as Record<string, unknown>)\n : {};\n\n for (const key of internalExpoRouterParamNames) {\n if (key in params) {\n expoParams[key] = params[key];\n } else if (key in nestedParams) {\n expoParams[key] = nestedParams[key];\n }\n }\n\n return expoParams;\n}\n\nexport function hasParam(params: unknown, paramName: string): boolean {\n if (!!params && typeof params === 'object') {\n const recordParams = params as Record<string, unknown>;\n if (recordParams[paramName] !== undefined) {\n return true;\n }\n if (recordParams.params && typeof recordParams.params === 'object') {\n return hasParam(recordParams.params, paramName);\n }\n }\n return false;\n}\n\nexport function removeParams(\n params: Record<string, unknown> | object | undefined,\n paramName: readonly string[]\n): Record<string, unknown> | object | undefined {\n if (!params) {\n return undefined;\n }\n const nestedParams =\n 'params' in params && typeof params.params === 'object' && params.params\n ? (params.params as Record<string, unknown>)\n : undefined;\n const newNestedParams = nestedParams ? removeParams(nestedParams, paramName) : undefined;\n const newParams = Object.fromEntries(\n Object.entries(params).filter(([key]) => !paramName.includes(key) && key !== 'params')\n );\n if (Object.keys(newNestedParams ?? {}).length > 0) {\n return { ...newParams, params: newNestedParams };\n }\n return newParams;\n}\n\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object\n): Record<string, unknown> | object;\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined\n): Record<string, unknown> | object | undefined;\nexport function removeInternalExpoRouterParams(\n params: Record<string, unknown> | object | undefined\n): Record<string, unknown> | object | undefined {\n if (!params) {\n return undefined;\n }\n return removeParams(params, [...internalExpoRouterParamNames, 'params']);\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import { type StyleProp, type ViewStyle } from 'react-native';
2
+ import type { SFSymbol } from 'sf-symbols-typescript';
3
+ import type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';
4
+ import { LinkMenuAction, type LinkMenuActionProps, type LinkMenuProps } from '../link/elements';
5
+ export type ToolbarMenuProps = LinkMenuProps;
6
+ export declare const ToolbarMenu: import("react").FC<LinkMenuProps>;
7
+ export type ToolbarMenuActionProps = LinkMenuActionProps;
8
+ export declare const ToolbarMenuAction: typeof LinkMenuAction;
9
+ export interface ToolbarButtonProps extends Pick<RouterToolbarItemProps, 'barButtonItemStyle' | 'hidden' | 'selected' | 'possibleTitles' | 'tintColor' | 'hidesSharedBackground' | 'sharesBackground'> {
10
+ children?: string;
11
+ sf?: SFSymbol;
12
+ onPress?: () => void;
13
+ }
14
+ export declare const ToolbarButton: ({ children, sf, onPress, ...rest }: ToolbarButtonProps) => import("react").JSX.Element;
15
+ export type ToolbarSpacerProps = Pick<RouterToolbarItemProps, 'width' | 'hidden'>;
16
+ export declare const ToolbarSpacer: ({ width, ...rest }: ToolbarSpacerProps) => import("react").JSX.Element;
17
+ export interface ToolbarViewProps extends Pick<RouterToolbarItemProps, 'hidesSharedBackground' | 'sharesBackground'> {
18
+ children: React.ReactNode;
19
+ style?: StyleProp<Omit<ViewStyle, 'position' | 'inset' | 'top' | 'left' | 'right' | 'bottom' | 'flex'>>;
20
+ }
21
+ export declare const ToolbarView: ({ children, style, ...rest }: ToolbarViewProps) => import("react").JSX.Element;
22
+ export type ToolbarHostProps = RouterToolbarHostProps;
23
+ export declare const ToolbarHost: (props: ToolbarHostProps) => import("react").JSX.Element;
24
+ //# sourceMappingURL=elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/toolbar/elements.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAErF,OAAO,EAEL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAC7C,eAAO,MAAM,WAAW,mCAAW,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACzD,eAAO,MAAM,iBAAiB,uBAAiB,CAAC;AAEhD,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,sBAAsB,EACpB,oBAAoB,GACpB,QAAQ,GACR,UAAU,GACV,gBAAgB,GAChB,WAAW,GACX,uBAAuB,GACvB,kBAAkB,CACrB;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AACD,eAAO,MAAM,aAAa,GAAI,oCAAoC,kBAAkB,gCAWnF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;AAClF,eAAO,MAAM,aAAa,GAAI,oBAAoB,kBAAkB,gCAUnE,CAAC;AAEF,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,uBAAuB,GAAG,kBAAkB,CAAC;IAClF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CACf,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC,CACrF,CAAC;CACH;AACD,eAAO,MAAM,WAAW,GAAI,8BAA8B,gBAAgB,gCAOzE,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AACtD,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,gCAOlD,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolbarHost = exports.ToolbarView = exports.ToolbarSpacer = exports.ToolbarButton = exports.ToolbarMenuAction = exports.ToolbarMenu = void 0;
4
+ const non_secure_1 = require("nanoid/non-secure");
5
+ const react_1 = require("react");
6
+ const react_native_1 = require("react-native");
7
+ const native_1 = require("./native");
8
+ const InternalLinkPreviewContext_1 = require("../link/InternalLinkPreviewContext");
9
+ const elements_1 = require("../link/elements");
10
+ exports.ToolbarMenu = elements_1.LinkMenu;
11
+ exports.ToolbarMenuAction = elements_1.LinkMenuAction;
12
+ const ToolbarButton = ({ children, sf, onPress, ...rest }) => {
13
+ const id = (0, react_1.useMemo)(() => (0, non_secure_1.nanoid)(), []);
14
+ return (<native_1.RouterToolbarItem {...rest} onSelected={onPress} identifier={id} title={children} systemImageName={sf}/>);
15
+ };
16
+ exports.ToolbarButton = ToolbarButton;
17
+ const ToolbarSpacer = ({ width, ...rest }) => {
18
+ const id = (0, react_1.useMemo)(() => (0, non_secure_1.nanoid)(), []);
19
+ return (<native_1.RouterToolbarItem {...rest} identifier={id} type={width ? 'fixedSpacer' : 'fluidSpacer'} width={width}/>);
20
+ };
21
+ exports.ToolbarSpacer = ToolbarSpacer;
22
+ const ToolbarView = ({ children, style, ...rest }) => {
23
+ const id = (0, react_1.useMemo)(() => (0, non_secure_1.nanoid)(), []);
24
+ return (<native_1.RouterToolbarItem {...rest} identifier={id}>
25
+ <react_native_1.View style={[style, { position: 'absolute' }]}>{children}</react_native_1.View>
26
+ </native_1.RouterToolbarItem>);
27
+ };
28
+ exports.ToolbarView = ToolbarView;
29
+ const ToolbarHost = (props) => {
30
+ // TODO: Replace InternalLinkPreviewContext with a more generic context
31
+ return (<InternalLinkPreviewContext_1.InternalLinkPreviewContext value={{ isVisible: false, href: '' }}>
32
+ <native_1.RouterToolbarHost {...props}/>
33
+ </InternalLinkPreviewContext_1.InternalLinkPreviewContext>);
34
+ };
35
+ exports.ToolbarHost = ToolbarHost;
36
+ //# sourceMappingURL=elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/toolbar/elements.tsx"],"names":[],"mappings":";;;AAAA,kDAA2C;AAC3C,iCAAgC;AAChC,+CAAoE;AAGpE,qCAAgE;AAEhE,mFAAgF;AAChF,+CAK0B;AAGb,QAAA,WAAW,GAAG,mBAAQ,CAAC;AAGvB,QAAA,iBAAiB,GAAG,yBAAc,CAAC;AAiBzC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAsB,EAAE,EAAE;IACtF,MAAM,EAAE,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,mBAAM,GAAE,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,CACL,CAAC,0BAAiB,CAChB,IAAI,IAAI,CAAC,CACT,UAAU,CAAC,CAAC,OAAO,C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L,CAAC,uDAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAChE;MAAA,CAAC,0BAAiB,CAAC,IAAI,KAAK,CAAC,EAC/B;IAAA,EAAE,uDAA0B,CAAC,CAC9B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,WAAW,eAOtB","sourcesContent":["import { nanoid } from 'nanoid/non-secure';\nimport { useMemo } from 'react';\nimport { View, type StyleProp, type ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { RouterToolbarHost, RouterToolbarItem } from './native';\nimport type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';\nimport { InternalLinkPreviewContext } from '../link/InternalLinkPreviewContext';\nimport {\n LinkMenu,\n LinkMenuAction,\n type LinkMenuActionProps,\n type LinkMenuProps,\n} from '../link/elements';\n\nexport type ToolbarMenuProps = LinkMenuProps;\nexport const ToolbarMenu = LinkMenu;\n\nexport type ToolbarMenuActionProps = LinkMenuActionProps;\nexport const ToolbarMenuAction = LinkMenuAction;\n\nexport interface ToolbarButtonProps\n extends Pick<\n RouterToolbarItemProps,\n | 'barButtonItemStyle'\n | 'hidden'\n | 'selected'\n | 'possibleTitles'\n | 'tintColor'\n | 'hidesSharedBackground'\n | 'sharesBackground'\n > {\n children?: string;\n sf?: SFSymbol;\n onPress?: () => void;\n}\nexport const ToolbarButton = ({ children, sf, onPress, ...rest }: ToolbarButtonProps) => {\n const id = useMemo(() => nanoid(), []);\n return (\n <RouterToolbarItem\n {...rest}\n onSelected={onPress}\n identifier={id}\n title={children}\n systemImageName={sf}\n />\n );\n};\n\nexport type ToolbarSpacerProps = Pick<RouterToolbarItemProps, 'width' | 'hidden'>;\nexport const ToolbarSpacer = ({ width, ...rest }: ToolbarSpacerProps) => {\n const id = useMemo(() => nanoid(), []);\n return (\n <RouterToolbarItem\n {...rest}\n identifier={id}\n type={width ? 'fixedSpacer' : 'fluidSpacer'}\n width={width}\n />\n );\n};\n\nexport interface ToolbarViewProps\n extends Pick<RouterToolbarItemProps, 'hidesSharedBackground' | 'sharesBackground'> {\n children: React.ReactNode;\n style?: StyleProp<\n Omit<ViewStyle, 'position' | 'inset' | 'top' | 'left' | 'right' | 'bottom' | 'flex'>\n >;\n}\nexport const ToolbarView = ({ children, style, ...rest }: ToolbarViewProps) => {\n const id = useMemo(() => nanoid(), []);\n return (\n <RouterToolbarItem {...rest} identifier={id}>\n <View style={[style, { position: 'absolute' }]}>{children}</View>\n </RouterToolbarItem>\n );\n};\n\nexport type ToolbarHostProps = RouterToolbarHostProps;\nexport const ToolbarHost = (props: ToolbarHostProps) => {\n // TODO: Replace InternalLinkPreviewContext with a more generic context\n return (\n <InternalLinkPreviewContext value={{ isVisible: false, href: '' }}>\n <RouterToolbarHost {...props} />\n </InternalLinkPreviewContext>\n );\n};\n"]}
@@ -0,0 +1,9 @@
1
+ export declare const Toolbar: ((props: import("./elements").ToolbarHostProps) => import("react").JSX.Element) & {
2
+ Menu: import("react").FC<import("..").LinkMenuProps>;
3
+ MenuAction: typeof import("..").LinkMenuAction;
4
+ Button: ({ children, sf, onPress, ...rest }: import("./elements").ToolbarButtonProps) => import("react").JSX.Element;
5
+ Spacer: ({ width, ...rest }: import("./elements").ToolbarSpacerProps) => import("react").JSX.Element;
6
+ View: ({ children, style, ...rest }: import("./elements").ToolbarViewProps) => import("react").JSX.Element;
7
+ };
8
+ export type { ToolbarHostProps, ToolbarMenuProps, ToolbarMenuActionProps, ToolbarButtonProps, ToolbarSpacerProps, ToolbarViewProps as ToolbarCustomViewProps, } from './elements';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toolbar/index.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO;;;;;;CAMlB,CAAC;AAEH,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,IAAI,sBAAsB,GAC3C,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Toolbar = void 0;
4
+ const elements_1 = require("./elements");
5
+ exports.Toolbar = Object.assign(elements_1.ToolbarHost, {
6
+ Menu: elements_1.ToolbarMenu,
7
+ MenuAction: elements_1.ToolbarMenuAction,
8
+ Button: elements_1.ToolbarButton,
9
+ Spacer: elements_1.ToolbarSpacer,
10
+ View: elements_1.ToolbarView,
11
+ });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toolbar/index.tsx"],"names":[],"mappings":";;;AAAA,yCAOoB;AAEP,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAW,EAAE;IAChD,IAAI,EAAE,sBAAW;IACjB,UAAU,EAAE,4BAAiB;IAC7B,MAAM,EAAE,wBAAa;IACrB,MAAM,EAAE,wBAAa;IACrB,IAAI,EAAE,sBAAW;CAClB,CAAC,CAAC","sourcesContent":["import {\n ToolbarHost,\n ToolbarMenu,\n ToolbarMenuAction,\n ToolbarButton,\n ToolbarSpacer,\n ToolbarView,\n} from './elements';\n\nexport const Toolbar = Object.assign(ToolbarHost, {\n Menu: ToolbarMenu,\n MenuAction: ToolbarMenuAction,\n Button: ToolbarButton,\n Spacer: ToolbarSpacer,\n View: ToolbarView,\n});\n\nexport type {\n ToolbarHostProps,\n ToolbarMenuProps,\n ToolbarMenuActionProps,\n ToolbarButtonProps,\n ToolbarSpacerProps,\n ToolbarViewProps as ToolbarCustomViewProps,\n} from './elements';\n"]}
@@ -0,0 +1,4 @@
1
+ import type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';
2
+ export declare function RouterToolbarHost(props: RouterToolbarHostProps): null;
3
+ export declare function RouterToolbarItem(props: RouterToolbarItemProps): null;
4
+ //# sourceMappingURL=native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAErF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,QAE9D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,QAE9D"}
@@ -0,0 +1,4 @@
1
+ import type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';
2
+ export declare function RouterToolbarHost(props: RouterToolbarHostProps): import("react").JSX.Element;
3
+ export declare function RouterToolbarItem(props: RouterToolbarItemProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=native.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAMrF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAc9D;AAKD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAE9D"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RouterToolbarHost = RouterToolbarHost;
4
+ exports.RouterToolbarItem = RouterToolbarItem;
5
+ const expo_1 = require("expo");
6
+ const RouterToolbarHostView = (0, expo_1.requireNativeView)('ExpoRouterToolbarModule', 'RouterToolbarHostView');
7
+ function RouterToolbarHost(props) {
8
+ return (<RouterToolbarHostView {...props} style={{
9
+ position: 'absolute',
10
+ top: 0,
11
+ left: 0,
12
+ width: 1,
13
+ height: 1,
14
+ backgroundColor: 'transparent',
15
+ }}/>);
16
+ }
17
+ const RouterToolbarItemView = (0, expo_1.requireNativeView)('ExpoRouterToolbarModule', 'RouterToolbarItemView');
18
+ function RouterToolbarItem(props) {
19
+ return <RouterToolbarItemView {...props}/>;
20
+ }
21
+ //# sourceMappingURL=native.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../src/toolbar/native.ios.tsx"],"names":[],"mappings":";;AAUA,8CAcC;AAKD,8CAEC;AA/BD,+BAAyC;AAMzC,MAAM,qBAAqB,GAAmC,IAAA,wBAAiB,EAC7E,yBAAyB,EACzB,uBAAuB,CACxB,CAAC;AACF,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,CACL,CAAC,qBAAqB,CACpB,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,eAAe,EAAE,aAAa;SAC/B,CAAC,EACF,CACH,CAAC;AACJ,CAAC;AAED,MAAM,qBAAqB,GAEvB,IAAA,wBAAiB,EAAC,yBAAyB,EAAE,uBAAuB,CAAC,CAAC;AAC1E,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC9C,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport type { ViewProps } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';\n\nconst RouterToolbarHostView: React.ComponentType<ViewProps> = requireNativeView(\n 'ExpoRouterToolbarModule',\n 'RouterToolbarHostView'\n);\nexport function RouterToolbarHost(props: RouterToolbarHostProps) {\n return (\n <RouterToolbarHostView\n {...props}\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n width: 1,\n height: 1,\n backgroundColor: 'transparent',\n }}\n />\n );\n}\n\nconst RouterToolbarItemView: React.ComponentType<\n ViewProps & { identifier: string; title?: string; systemImageName?: SFSymbol; type?: string }\n> = requireNativeView('ExpoRouterToolbarModule', 'RouterToolbarItemView');\nexport function RouterToolbarItem(props: RouterToolbarItemProps) {\n return <RouterToolbarItemView {...props} />;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RouterToolbarHost = RouterToolbarHost;
4
+ exports.RouterToolbarItem = RouterToolbarItem;
5
+ function RouterToolbarHost(props) {
6
+ return null;
7
+ }
8
+ function RouterToolbarItem(props) {
9
+ return null;
10
+ }
11
+ //# sourceMappingURL=native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/toolbar/native.tsx"],"names":[],"mappings":";;AAEA,8CAEC;AAED,8CAEC;AAND,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';\n\nexport function RouterToolbarHost(props: RouterToolbarHostProps) {\n return null;\n}\n\nexport function RouterToolbarItem(props: RouterToolbarItemProps) {\n return null;\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import type { ColorValue } from 'react-native';
2
+ import type { SFSymbol } from 'sf-symbols-typescript';
3
+ export interface RouterToolbarHostProps {
4
+ children?: React.ReactNode;
5
+ }
6
+ export interface RouterToolbarItemProps {
7
+ children?: React.ReactNode;
8
+ identifier: string;
9
+ title?: string;
10
+ systemImageName?: SFSymbol;
11
+ type?: 'normal' | 'fixedSpacer' | 'fluidSpacer';
12
+ tintColor?: ColorValue;
13
+ hidesSharedBackground?: boolean;
14
+ sharesBackground?: boolean;
15
+ barButtonItemStyle?: 'plain' | 'prominent';
16
+ width?: number;
17
+ hidden?: boolean;
18
+ selected?: boolean;
19
+ possibleTitles?: string[];
20
+ badgeConfiguration?: {
21
+ value?: string;
22
+ backgroundColor?: ColorValue;
23
+ color?: ColorValue;
24
+ fontFamily?: string;
25
+ fontSize?: number;
26
+ fontWeight?: string;
27
+ };
28
+ onSelected?: () => void;
29
+ }
30
+ //# sourceMappingURL=native.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.types.d.ts","sourceRoot":"","sources":["../../src/toolbar/native.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,GAAG,aAAa,CAAC;IAChD,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B,kBAAkB,CAAC,EAAE;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,UAAU,CAAC;QAC7B,KAAK,CAAC,EAAE,UAAU,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=native.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.types.js","sourceRoot":"","sources":["../../src/toolbar/native.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorValue } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface RouterToolbarHostProps {\n children?: React.ReactNode;\n}\n\nexport interface RouterToolbarItemProps {\n children?: React.ReactNode;\n identifier: string;\n title?: string;\n systemImageName?: SFSymbol;\n type?: 'normal' | 'fixedSpacer' | 'fluidSpacer';\n tintColor?: ColorValue;\n hidesSharedBackground?: boolean;\n sharesBackground?: boolean;\n barButtonItemStyle?: 'plain' | 'prominent';\n width?: number;\n hidden?: boolean;\n selected?: boolean;\n possibleTitles?: string[];\n // Right now this does not seem to work\n badgeConfiguration?: {\n value?: string;\n backgroundColor?: ColorValue;\n color?: ColorValue;\n fontFamily?: string;\n fontSize?: number;\n fontWeight?: string;\n };\n onSelected?: () => void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAsB,SAAS,EAAuC,MAAM,SAAS,CAAC;AAI7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAK9C,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG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C,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,UAa5E"}
@@ -47,6 +47,8 @@ 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");
51
+ const navigationParams_1 = require("./navigationParams");
50
52
  const primitives_1 = require("./primitives");
51
53
  const EmptyRoute_1 = require("./views/EmptyRoute");
52
54
  const SuspenseFallback_1 = require("./views/SuspenseFallback");
@@ -208,7 +210,19 @@ function getQualifiedRouteComponent(value) {
208
210
  if (isLeaf && stateForPath)
209
211
  store.setFocusedState(stateForPath);
210
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]);
211
224
  return (<Route_1.Route node={value} route={route}>
225
+ <ZoomTransitionEnabler_1.ZoomTransitionEnabler route={route}/>
212
226
  <react_1.default.Suspense fallback={<SuspenseFallback_1.SuspenseFallback route={value}/>}>
213
227
  <ScreenComponent {...props}
214
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkJb,4CA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AAE,OAAO,EAAE,KAAK,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 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 { 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 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,MAAM,OAAO,GAAG,KAAK;SAClB,GAAG,CACF,CAAC,EACC,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,EACP,KAAK,EACL,mBAAmB,EAAE,QAAQ,GAC9B,EAAE,EAAE;QACH,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CACV,uDAAuD,IAAI,kBAAkB,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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"]}
@@ -0,0 +1,7 @@
1
+ import { type JSXElementConstructor, type ReactElement, type ReactNode } from 'react';
2
+ export declare function isChildOfType<ComponentT extends JSXElementConstructor<any>>(element: React.ReactNode, type: ComponentT): element is ReactElement<React.ComponentProps<ComponentT>, ComponentT>;
3
+ export declare function getFirstChildOfType<ComponentT extends JSXElementConstructor<any>>(children: React.ReactNode | React.ReactNode[], type: ComponentT): ReactElement<import("react").ComponentProps<ComponentT>, ComponentT> | undefined;
4
+ export declare function getAllChildrenOfType<ComponentT extends JSXElementConstructor<any>>(children: React.ReactNode | React.ReactNode[], type: ComponentT): ReactElement<import("react").ComponentProps<ComponentT>, ComponentT>[];
5
+ export declare function getAllChildrenNotOfType<ComponentT extends JSXElementConstructor<any>>(children: React.ReactNode | React.ReactNode[], type: ComponentT): (string | number | bigint | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | Promise<string | number | bigint | boolean | import("react").ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined>)[];
6
+ export declare function filterAllowedChildrenElements<Components extends JSXElementConstructor<any>[]>(children: ReactNode | ReactNode[], components: Components): React.ReactElement<React.ComponentProps<Components[number]>, Components[number]>[];
7
+ //# source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defineProperty(exports, "__esModule", { value: true });
3
+ exports.isChildOfType = isChildOfType;
4
+ exports.getFirstChildOfType = getFirstChildOfType;
5
+ exports.getAllChildrenOfType = getAllChildrenOfType;
6
+ exports.getAllChildrenNotOfType = getAllChildrenNotOfType;
7
+ exports.filterAllowedChildrenElements = filterAllowedChildrenElements;
8
+ const react_1 = require("react");
9
+ function isChildOfType(element, type) {
10
+ return (0, react_1.isValidElement)(element) && element.type === type;
11
+ }
12
+ function getFirstChildOfType(children, type) {
13
+ return react_1.Children.toArray(children).find((child) => isChildOfType(child, type));
14
+ }
15
+ function getAllChildrenOfType(children, type) {
16
+ return react_1.Children.toArray(children).filter((child) => isChildOfType(child, type));
17
+ }
18
+ function getAllChildrenNotOfType(children, type) {
19
+ return react_1.Children.toArray(children).filter((child) => !isChildOfType(child, type));
20
+ }
21
+ function filterAllowedChildrenElements(children, components) {
22
+ return react_1.Children.toArray(children).filter((child) => (0, react_1.isValidElement)(child) && components.includes(child.type));
23
+ }
24
+ //# sourceMappingURL=children.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"children.js","sourceRoot":"","sources":["../../src/utils/children.ts"],"names":[],"mappings":";;AAQA,sCAKC;AAED,kDAKC;AAED,oDAKC;AAED,0DAKC;AAED,sEAUC;AA9CD,iCAMe;AAEf,SAAgB,aAAa,CAC3B,OAAwB,EACxB,IAAgB;IAEhB,OAAO,IAAA,sBAAc,EAAC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;AAC1D,CAAC;AAED,SAAgB,mBAAmB,CACjC,QAA6C,EAC7C,IAAgB;IAEhB,OAAO,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,SAAgB,oBAAoB,CAClC,QAA6C,EAC7C,IAAgB;IAEhB,OAAO,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,SAAgB,uBAAuB,CACrC,QAA6C,EAC7C,IAAgB;IAEhB,OAAO,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,6BAA6B,CAC3C,QAAiC,EACjC,UAAsB;IAEtB,OAAO,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACtC,CACE,KAAK,EACsF,EAAE,CAC7F,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAiC,CAAC,CACxF,CAAC;AACJ,CAAC","sourcesContent":["import {\n Children,\n isValidElement,\n type JSXElementConstructor,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nexport function isChildOfType<ComponentT extends JSXElementConstructor<any>>(\n element: React.ReactNode,\n type: ComponentT\n): element is ReactElement<React.ComponentProps<ComponentT>, ComponentT> {\n return isValidElement(element) && element.type === type;\n}\n\nexport function getFirstChildOfType<ComponentT extends JSXElementConstructor<any>>(\n children: React.ReactNode | React.ReactNode[],\n type: ComponentT\n) {\n return Children.toArray(children).find((child) => isChildOfType(child, type));\n}\n\nexport function getAllChildrenOfType<ComponentT extends JSXElementConstructor<any>>(\n children: React.ReactNode | React.ReactNode[],\n type: ComponentT\n) {\n return Children.toArray(children).filter((child) => isChildOfType(child, type));\n}\n\nexport function getAllChildrenNotOfType<ComponentT extends JSXElementConstructor<any>>(\n children: React.ReactNode | React.ReactNode[],\n type: ComponentT\n) {\n return Children.toArray(children).filter((child) => !isChildOfType(child, type));\n}\n\nexport function filterAllowedChildrenElements<Components extends JSXElementConstructor<any>[]>(\n children: ReactNode | ReactNode[],\n components: Components\n): React.ReactElement<React.ComponentProps<Components[number]>, Components[number]>[] {\n return Children.toArray(children).filter(\n (\n child\n ): child is React.ReactElement<React.ComponentProps<Components[number]>, Components[number]> =>\n isValidElement(child) && components.includes(child.type as (props: any) => ReactNode)\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { TextStyle } from 'react-native';
2
+ export declare function convertFontWeightToStringFontWeight(fontWeight: TextStyle['fontWeight']): Exclude<TextStyle['fontWeight'], number> | undefined;
3
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/utils/style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC,GAClC,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,SAAS,CAKtD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertFontWeightToStringFontWeight = convertFontWeightToStringFontWeight;
4
+ function convertFontWeightToStringFontWeight(fontWeight) {
5
+ if (typeof fontWeight === 'number') {
6
+ return String(fontWeight);
7
+ }
8
+ return fontWeight;
9
+ }
10
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../src/utils/style.ts"],"names":[],"mappings":";;AAEA,kFAOC;AAPD,SAAgB,mCAAmC,CACjD,UAAmC;IAEnC,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC,UAAU,CAAkD,CAAC;IAC7E,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { TextStyle } from 'react-native';\n\nexport function convertFontWeightToStringFontWeight(\n fontWeight: TextStyle['fontWeight']\n): Exclude<TextStyle['fontWeight'], number> | undefined {\n if (typeof fontWeight === 'number') {\n return String(fontWeight) as `${Extract<TextStyle['fontWeight'], number>}`;\n }\n return fontWeight;\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]);