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
@@ -0,0 +1,6 @@
1
+ import { LinkProps } from '../useLinkHooks';
2
+ export declare function useZoomTransitionPrimitives({ href }: LinkProps): {
3
+ zoomTransitionSourceContextValue: undefined;
4
+ href: string | import("../..").HrefObject;
5
+ };
6
+ //# sourceMappingURL=useZoomTransitionPrimitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomTransitionPrimitives.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,wBAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;;;EAG9D"}
@@ -0,0 +1,11 @@
1
+ import { LinkProps } from '../useLinkHooks';
2
+ export declare function useZoomTransitionPrimitives({ href, asChild }: LinkProps): {
3
+ zoomTransitionSourceContextValue: {
4
+ identifier: string;
5
+ addSource: () => void;
6
+ removeSource: () => void;
7
+ canAddSource: boolean;
8
+ } | undefined;
9
+ href: string | import("../..").HrefObject;
10
+ };
11
+ //# sourceMappingURL=useZoomTransitionPrimitives.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomTransitionPrimitives.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.ios.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,SAAS;;;;;;;;EAqEvE"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useZoomTransitionPrimitives = useZoomTransitionPrimitives;
5
+ const non_secure_1 = require("nanoid/non-secure");
6
+ const react_1 = require("react");
7
+ const ZoomTransitionEnabler_1 = require("./ZoomTransitionEnabler");
8
+ const navigationParams_1 = require("../../navigationParams");
9
+ const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
10
+ function useZoomTransitionPrimitives({ href, asChild }) {
11
+ const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
12
+ const zoomTransitionId = (0, react_1.useMemo)(() => !isPreview && process.env.EXPO_OS === 'ios' && (0, ZoomTransitionEnabler_1.isZoomTransitionEnabled)()
13
+ ? (0, non_secure_1.nanoid)()
14
+ : undefined, []);
15
+ const [numberOfSources, setNumberOfSources] = (0, react_1.useState)(0);
16
+ const addSource = (0, react_1.useCallback)(() => {
17
+ setNumberOfSources((prev) => prev + 1);
18
+ }, []);
19
+ const removeSource = (0, react_1.useCallback)(() => {
20
+ setNumberOfSources((prev) => prev - 1);
21
+ }, []);
22
+ const hasZoomSource = numberOfSources > 0;
23
+ (0, react_1.useEffect)(() => {
24
+ if (numberOfSources > 1) {
25
+ throw new Error('[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.');
26
+ }
27
+ }, [numberOfSources]);
28
+ (0, react_1.useEffect)(() => {
29
+ if (hasZoomSource && !asChild) {
30
+ console.warn('[expo-router] Using zoom transition links without `asChild` prop may lead to unexpected behavior. Please ensure to set `asChild` when using zoom transitions.');
31
+ }
32
+ }, [hasZoomSource, asChild]);
33
+ const zoomTransitionSourceContextValue = (0, react_1.useMemo)(() => {
34
+ if (!zoomTransitionId) {
35
+ return undefined;
36
+ }
37
+ return {
38
+ identifier: zoomTransitionId,
39
+ addSource,
40
+ removeSource,
41
+ canAddSource: !hasZoomSource,
42
+ };
43
+ }, [zoomTransitionId, addSource, removeSource, hasZoomSource]);
44
+ const computedHref = (0, react_1.useMemo)(() => {
45
+ if (!hasZoomSource || !zoomTransitionId) {
46
+ return href;
47
+ }
48
+ if (typeof href === 'string') {
49
+ return {
50
+ pathname: href,
51
+ params: {
52
+ [navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,
53
+ },
54
+ };
55
+ }
56
+ return {
57
+ pathname: href.pathname,
58
+ params: {
59
+ ...(href.params ?? {}),
60
+ [navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,
61
+ },
62
+ };
63
+ }, [href, zoomTransitionId, hasZoomSource]);
64
+ return { zoomTransitionSourceContextValue, href: computedHref };
65
+ }
66
+ //# sourceMappingURL=useZoomTransitionPrimitives.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomTransitionPrimitives.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAUb,kEAqEC;AA7ED,kDAA2C;AAC3C,iCAAkE;AAElE,mEAAkE;AAClE,6DAAmG;AACnG,wEAA8D;AAG9D,SAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAa;IACtE,MAAM,SAAS,GAAG,IAAA,kCAAY,GAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,IAAA,eAAO,EAC9B,GAAG,EAAE,CACH,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,IAAA,+CAAuB,GAAE;QACtE,CAAC,CAAC,IAAA,mBAAM,GAAE;QACV,CAAC,CAAC,SAAS,EACf,EAAE,CACH,CAAC;IAEF,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACjC,kBAAkB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,YAAY,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACpC,kBAAkB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,aAAa,GAAG,eAAe,GAAG,CAAC,CAAC;IAE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AAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,gCAAgC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAClE,CAAC","sourcesContent":["'use client';\n\nimport { nanoid } from 'nanoid/non-secure';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler';\nimport { INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME } from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\nimport { LinkProps } from '../useLinkHooks';\n\nexport function useZoomTransitionPrimitives({ href, asChild }: LinkProps) {\n const isPreview = useIsPreview();\n const zoomTransitionId = useMemo(\n () =>\n !isPreview && process.env.EXPO_OS === 'ios' && isZoomTransitionEnabled()\n ? nanoid()\n : undefined,\n []\n );\n\n const [numberOfSources, setNumberOfSources] = useState(0);\n const addSource = useCallback(() => {\n setNumberOfSources((prev) => prev + 1);\n }, []);\n const removeSource = useCallback(() => {\n setNumberOfSources((prev) => prev - 1);\n }, []);\n\n const hasZoomSource = numberOfSources > 0;\n\n useEffect(() => {\n if (numberOfSources > 1) {\n throw new Error(\n '[expo-router] Only one Link.ZoomTransitionSource can be used within a single Link component.'\n );\n }\n }, [numberOfSources]);\n\n useEffect(() => {\n if (hasZoomSource && !asChild) {\n console.warn(\n '[expo-router] Using zoom transition links without `asChild` prop may lead to unexpected behavior. Please ensure to set `asChild` when using zoom transitions.'\n );\n }\n }, [hasZoomSource, asChild]);\n\n const zoomTransitionSourceContextValue = useMemo(() => {\n if (!zoomTransitionId) {\n return undefined;\n }\n return {\n identifier: zoomTransitionId,\n addSource,\n removeSource,\n canAddSource: !hasZoomSource,\n };\n }, [zoomTransitionId, addSource, removeSource, hasZoomSource]);\n\n const computedHref = useMemo(() => {\n if (!hasZoomSource || !zoomTransitionId) {\n return href;\n }\n if (typeof href === 'string') {\n return {\n pathname: href,\n params: {\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,\n },\n };\n }\n return {\n pathname: href.pathname,\n params: {\n ...(href.params ?? {}),\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: zoomTransitionId,\n },\n };\n }, [href, zoomTransitionId, hasZoomSource]);\n return { zoomTransitionSourceContextValue, href: computedHref };\n}\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useZoomTransitionPrimitives = useZoomTransitionPrimitives;
5
+ function useZoomTransitionPrimitives({ href }) {
6
+ const zoomTransitionSourceContextValue = undefined;
7
+ return { zoomTransitionSourceContextValue, href };
8
+ }
9
+ //# sourceMappingURL=useZoomTransitionPrimitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZoomTransitionPrimitives.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomTransitionPrimitives.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAKb,kEAGC;AAHD,SAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAa;IAC7D,MAAM,gCAAgC,GAAyC,SAAS,CAAC;IACzF,OAAO,EAAE,gCAAgC,EAAE,IAAI,EAAE,CAAC;AACpD,CAAC","sourcesContent":["'use client';\n\nimport { LinkProps } from '../useLinkHooks';\nimport type { ZoomTransitionSourceContextValueType } from './zoom-transition-context';\n\nexport function useZoomTransitionPrimitives({ href }: LinkProps) {\n const zoomTransitionSourceContextValue: ZoomTransitionSourceContextValueType = undefined;\n return { zoomTransitionSourceContextValue, href };\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export type ZoomTransitionSourceContextValueType = {
2
+ identifier: string;
3
+ addSource: () => void;
4
+ removeSource: () => void;
5
+ } | undefined;
6
+ export declare const ZoomTransitionSourceContext: import("react").Context<ZoomTransitionSourceContextValueType>;
7
+ //# sourceMappingURL=zoom-transition-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,oCAAoC,GAC5C;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,GACD,SAAS,CAAC;AAEd,eAAO,MAAM,2BAA2B,+DACwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZoomTransitionSourceContext = void 0;
4
+ const react_1 = require("react");
5
+ exports.ZoomTransitionSourceContext = (0, react_1.createContext)(undefined);
6
+ //# sourceMappingURL=zoom-transition-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zoom-transition-context.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":";;;AAAA,iCAAsC;AAUzB,QAAA,2BAA2B,GACtC,IAAA,qBAAa,EAAuC,SAAS,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\nexport type ZoomTransitionSourceContextValueType =\n | {\n identifier: string;\n addSource: () => void;\n removeSource: () => void;\n }\n | undefined;\n\nexport const ZoomTransitionSourceContext =\n createContext<ZoomTransitionSourceContextValueType>(undefined);\n"]}
@@ -1,18 +1,6 @@
1
- import { ParamListBase, type EventMapBase } from '@react-navigation/native';
2
1
  import React from 'react';
3
- import type { NativeTabOptions, NativeTabsProps } from './types';
2
+ import type { InternalNativeTabsProps, NativeTabsProps } from './types';
4
3
  export declare const NativeTabsContext: React.Context<boolean>;
5
- export declare function NativeTabsNavigator({ children, backBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, ...rest }: NativeTabsProps): React.JSX.Element;
6
- export declare const NativeTabsNavigatorWithContext: React.ForwardRefExoticComponent<Omit<NativeTabsProps, "children"> & Partial<Pick<NativeTabsProps, "children">> & React.RefAttributes<unknown>> & {
7
- Screen: (props: import("..").ScreenProps<NativeTabOptions, Readonly<{
8
- key: string;
9
- index: number;
10
- routeNames: string[];
11
- history?: unknown[];
12
- routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
13
- type: string;
14
- stale: false;
15
- }>, EventMapBase>) => null;
16
- Protected: typeof import("../views/Protected").Protected;
17
- };
4
+ export declare function NativeTabsNavigator({ children, backBehavior, labelStyle, iconColor, blurEffect, backgroundColor, badgeBackgroundColor, indicatorColor, badgeTextColor, ...rest }: InternalNativeTabsProps): React.JSX.Element;
5
+ export declare function NativeTabsNavigatorWrapper(props: NativeTabsProps): React.JSX.Element;
18
6
  //# sourceMappingURL=NativeBottomTabsNavigator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,aAAa,EAIb,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAoC,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAyB,MAAM,SAAS,CAAC;AAOxF,eAAO,MAAM,iBAAiB,wBAAsC,CAAC;AAErE,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAkC,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,GAAG,IAAI,EACR,EAAE,eAAe,qBAqGjB;AAID,eAAO,MAAM,8BAA8B;;;;;;;;;;;CAKa,CAAC"}
1
+ {"version":3,"file":"NativeBottomTabsNavigator.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,OAAO,KAAK,EACV,uBAAuB,EAEvB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAQjB,eAAO,MAAM,iBAAiB,wBAAsC,CAAC;AAErE,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAkC,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,GAAG,IAAI,EACR,EAAE,uBAAuB,qBA4GzB;AAWD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,eAAe,qBAiBhE"}
@@ -34,15 +34,18 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.NativeTabsNavigatorWithContext = exports.NativeTabsContext = void 0;
37
+ exports.NativeTabsContext = void 0;
38
38
  exports.NativeTabsNavigator = NativeTabsNavigator;
39
+ exports.NativeTabsNavigatorWrapper = NativeTabsNavigatorWrapper;
39
40
  const native_1 = require("@react-navigation/native");
40
41
  const react_1 = __importStar(require("react"));
41
42
  const NativeBottomTabsRouter_1 = require("./NativeBottomTabsRouter");
43
+ const NativeTabTrigger_1 = require("./NativeTabTrigger");
42
44
  const NativeTabsView_1 = require("./NativeTabsView");
43
45
  const utils_1 = require("./utils");
44
46
  const withLayoutContext_1 = require("../layouts/withLayoutContext");
45
47
  const linking_1 = require("../link/linking");
48
+ const children_1 = require("../utils/children");
46
49
  // In Jetpack Compose, the default back behavior is to go back to the initial route.
47
50
  const defaultBackBehavior = 'initialRoute';
48
51
  exports.NativeTabsContext = react_1.default.createContext(false);
@@ -97,6 +100,13 @@ function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, lab
97
100
  const onTabChange = (0, react_1.useCallback)((tabKey) => {
98
101
  const descriptor = descriptors[tabKey];
99
102
  const route = descriptor.route;
103
+ navigation.emit({
104
+ type: 'tabPress',
105
+ target: tabKey,
106
+ data: {
107
+ __internalTabsType: 'native',
108
+ },
109
+ });
100
110
  navigation.dispatch({
101
111
  type: 'JUMP_TO',
102
112
  target: state.key,
@@ -112,5 +122,10 @@ function NativeTabsNavigator({ children, backBehavior = defaultBackBehavior, lab
112
122
  </NavigationContent>);
113
123
  }
114
124
  const createNativeTabNavigator = (0, native_1.createNavigatorFactory)(NativeTabsNavigator);
115
- exports.NativeTabsNavigatorWithContext = (0, withLayoutContext_1.withLayoutContext)(createNativeTabNavigator().Navigator, undefined, true);
125
+ const NativeTabsNavigatorWithContext = (0, withLayoutContext_1.withLayoutContext)(createNativeTabNavigator().Navigator, undefined, true);
126
+ function NativeTabsNavigatorWrapper(props) {
127
+ const triggerChildren = (0, react_1.useMemo)(() => (0, children_1.getAllChildrenOfType)(props.children, NativeTabTrigger_1.NativeTabTrigger), [props.children]);
128
+ const nonTriggerChildren = (0, react_1.useMemo)(() => (0, children_1.getAllChildrenNotOfType)(props.children, NativeTabTrigger_1.NativeTabTrigger), [props.children]);
129
+ return (<NativeTabsNavigatorWithContext {...props} children={triggerChildren} nonTriggerChildren={nonTriggerChildren}/>);
130
+ }
116
131
  //# sourceMappingURL=NativeBottomTabsNavigator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBb,kDAgHC;AAtID,qDAQkC;AAClC,+CAAyD;AAEzD,qEAAkE;AAClE,qDAAkD;AAElD,mCAAsF;AACtF,oEAAiE;AACjE,6CAAmD;AAEnD,oFAAoF;AACpF,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAC9B,QAAA,iBAAiB,GAAG,eAAK,CAAC,aAAa,CAAU,KAAK,CAAC,CAAC;AAErE,SAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAY,GAAG,mBAAmB,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB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SAAS;YACf,MAAM,EAAE,KAAK,CAAC,GAAG;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB;SACF,CAAC,CAAC;IACL,CAAC,EACD,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CACrC,CAAC;IAEF,OAAO,CACL,CAAC,iBAAiB,CAChB;MAAA,CAAC,yBAAiB,CAAC,KAAK,CACtB;QAAA,CAAC,+BAAc,CACb,IAAI,IAAI,CAAC,CACT,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,IAAI,CAAC,CAAC,WAAW,CAAC,CAClB,WAAW,CAAC,CAAC,WAAW,CAAC,EAE7B;MAAA,EAAE,yBAAiB,CACrB;IAAA,EAAE,iBAAiB,CAAC,CACrB,CAAC;AACJ,CAAC;AAED,MAAM,wBAAwB,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAC;AAEhE,QAAA,8BAA8B,GAAG,IAAA,qCAAiB,EAK7D,wBAAwB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC","sourcesContent":["'use client';\n\nimport {\n createNavigatorFactory,\n NavigationState,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n type EventMapBase,\n} from '@react-navigation/native';\nimport React, { use, useCallback, useMemo } from 'react';\n\nimport { NativeBottomTabsRouter } from './NativeBottomTabsRouter';\nimport { NativeTabsView } from './NativeTabsView';\nimport type { NativeTabOptions, NativeTabsProps, NativeTabsViewTabItem } from './types';\nimport { convertIconColorPropToObject, convertLabelStylePropToObject } from './utils';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport { getPathFromState } from '../link/linking';\n\n// In Jetpack Compose, the default back behavior is to go back to the initial route.\nconst defaultBackBehavior = 'initialRoute';\nexport const NativeTabsContext = React.createContext<boolean>(false);\n\nexport function NativeTabsNavigator({\n children,\n backBehavior = defaultBackBehavior,\n labelStyle,\n iconColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n ...rest\n}: NativeTabsProps) {\n if (use(NativeTabsContext)) {\n throw new Error(\n 'Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.'\n );\n }\n\n const processedLabelStyle = convertLabelStylePropToObject(labelStyle);\n const processedIconColor = convertIconColorPropToObject(iconColor);\n\n const selectedLabelStyle = processedLabelStyle.selected\n ? {\n ...processedLabelStyle.selected,\n color: processedLabelStyle.selected.color ?? rest.tintColor,\n }\n : rest.tintColor\n ? { color: rest.tintColor }\n : undefined;\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >(NativeBottomTabsRouter, {\n children,\n backBehavior,\n screenOptions: {\n disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,\n labelStyle: processedLabelStyle.default,\n selectedLabelStyle,\n iconColor: processedIconColor.default,\n selectedIconColor: processedIconColor.selected ?? rest.tintColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n },\n });\n\n const { routes } = state;\n\n const visibleTabs = useMemo(\n () =>\n routes\n // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.\n // If it is not defined, then it was not specified, and we should hide the tab.\n .filter((route) => descriptors[route.key].options?.hidden !== true)\n .map(\n (route): NativeTabsViewTabItem => ({\n options: descriptors[route.key].options,\n routeKey: route.key,\n name: route.name,\n contentRenderer: () => descriptors[route.key].render(),\n })\n ),\n [routes, descriptors]\n );\n const visibleFocusedTabIndex = useMemo(\n () => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index].key),\n [visibleTabs, routes, state.index]\n );\n\n if (visibleFocusedTabIndex < 0) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: \"${getPathFromState(state)}\"`\n );\n }\n }\n const focusedIndex = visibleFocusedTabIndex >= 0 ? visibleFocusedTabIndex : 0;\n\n const onTabChange = useCallback(\n (tabKey: string) => {\n const descriptor = descriptors[tabKey];\n const route = descriptor.route;\n navigation.dispatch({\n type: 'JUMP_TO',\n target: state.key,\n payload: {\n name: route.name,\n },\n });\n },\n [descriptors, navigation, state.key]\n );\n\n return (\n <NavigationContent>\n <NativeTabsContext value>\n <NativeTabsView\n {...rest}\n focusedIndex={focusedIndex}\n tabs={visibleTabs}\n onTabChange={onTabChange}\n />\n </NativeTabsContext>\n </NavigationContent>\n );\n}\n\nconst createNativeTabNavigator = createNavigatorFactory(NativeTabsNavigator);\n\nexport const NativeTabsNavigatorWithContext = withLayoutContext<\n NativeTabOptions,\n typeof NativeTabsNavigator,\n NavigationState,\n EventMapBase\n>(createNativeTabNavigator().Navigator, undefined, true);\n"]}
1
+ {"version":3,"file":"NativeBottomTabsNavigator.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsNavigator.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Bb,kDAuHC;AAWD,gEAiBC;AAhLD,qDAQkC;AAClC,+CAAyD;AAEzD,qEAAkE;AAClE,yDAAsD;AACtD,qDAAkD;AAOlD,mCAAsF;AACtF,oEAAiE;AACjE,6CAAmD;AACnD,gDAAkF;AAElF,oFAAoF;AACpF,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAC9B,QAAA,iBAAiB,GAAG,eAAK,CAAC,aAAa,CAAU,KAAK,CAAC,CAAC;AAErE,SAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAY,GAAG,mBAAmB,EAClC,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,GAAG,IAAI,EACiB;IACxB,IAAI,IAAA,WAAG,EAAC,yBAAiB,CAAC,EAAE,CAAC;QAC3B,MA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AAkB,CAAC,EACvC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport {\n createNavigatorFactory,\n NavigationState,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n type EventMapBase,\n} from '@react-navigation/native';\nimport React, { use, useCallback, useMemo } from 'react';\n\nimport { NativeBottomTabsRouter } from './NativeBottomTabsRouter';\nimport { NativeTabTrigger } from './NativeTabTrigger';\nimport { NativeTabsView } from './NativeTabsView';\nimport type {\n InternalNativeTabsProps,\n NativeTabOptions,\n NativeTabsProps,\n NativeTabsViewTabItem,\n} from './types';\nimport { convertIconColorPropToObject, convertLabelStylePropToObject } from './utils';\nimport { withLayoutContext } from '../layouts/withLayoutContext';\nimport { getPathFromState } from '../link/linking';\nimport { getAllChildrenNotOfType, getAllChildrenOfType } from '../utils/children';\n\n// In Jetpack Compose, the default back behavior is to go back to the initial route.\nconst defaultBackBehavior = 'initialRoute';\nexport const NativeTabsContext = React.createContext<boolean>(false);\n\nexport function NativeTabsNavigator({\n children,\n backBehavior = defaultBackBehavior,\n labelStyle,\n iconColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n ...rest\n}: InternalNativeTabsProps) {\n if (use(NativeTabsContext)) {\n throw new Error(\n 'Nesting Native Tabs inside each other is not supported natively. Use JS tabs for nesting instead.'\n );\n }\n\n const processedLabelStyle = convertLabelStylePropToObject(labelStyle);\n const processedIconColor = convertIconColorPropToObject(iconColor);\n\n const selectedLabelStyle = processedLabelStyle.selected\n ? {\n ...processedLabelStyle.selected,\n color: processedLabelStyle.selected.color ?? rest.tintColor,\n }\n : rest.tintColor\n ? { color: rest.tintColor }\n : undefined;\n\n const { state, descriptors, navigation, NavigationContent } = useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >(NativeBottomTabsRouter, {\n children,\n backBehavior,\n screenOptions: {\n disableTransparentOnScrollEdge: rest.disableTransparentOnScrollEdge,\n labelStyle: processedLabelStyle.default,\n selectedLabelStyle,\n iconColor: processedIconColor.default,\n selectedIconColor: processedIconColor.selected ?? rest.tintColor,\n blurEffect,\n backgroundColor,\n badgeBackgroundColor,\n indicatorColor,\n badgeTextColor,\n },\n });\n\n const { routes } = state;\n\n const visibleTabs = useMemo(\n () =>\n routes\n // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.\n // If it is not defined, then it was not specified, and we should hide the tab.\n .filter((route) => descriptors[route.key].options?.hidden !== true)\n .map(\n (route): NativeTabsViewTabItem => ({\n options: descriptors[route.key].options,\n routeKey: route.key,\n name: route.name,\n contentRenderer: () => descriptors[route.key].render(),\n })\n ),\n [routes, descriptors]\n );\n const visibleFocusedTabIndex = useMemo(\n () => visibleTabs.findIndex((tab) => tab.routeKey === routes[state.index].key),\n [visibleTabs, routes, state.index]\n );\n\n if (visibleFocusedTabIndex < 0) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `The focused tab in NativeTabsView cannot be displayed. Make sure path is correct and the route is not hidden. Path: \"${getPathFromState(state)}\"`\n );\n }\n }\n const focusedIndex = visibleFocusedTabIndex >= 0 ? visibleFocusedTabIndex : 0;\n\n const onTabChange = useCallback(\n (tabKey: string) => {\n const descriptor = descriptors[tabKey];\n const route = descriptor.route;\n navigation.emit({\n type: 'tabPress',\n target: tabKey,\n data: {\n __internalTabsType: 'native',\n },\n });\n navigation.dispatch({\n type: 'JUMP_TO',\n target: state.key,\n payload: {\n name: route.name,\n },\n });\n },\n [descriptors, navigation, state.key]\n );\n\n return (\n <NavigationContent>\n <NativeTabsContext value>\n <NativeTabsView\n {...rest}\n focusedIndex={focusedIndex}\n tabs={visibleTabs}\n onTabChange={onTabChange}\n />\n </NativeTabsContext>\n </NavigationContent>\n );\n}\n\nconst createNativeTabNavigator = createNavigatorFactory(NativeTabsNavigator);\n\nconst NativeTabsNavigatorWithContext = withLayoutContext<\n NativeTabOptions,\n typeof NativeTabsNavigator,\n NavigationState,\n EventMapBase\n>(createNativeTabNavigator().Navigator, undefined, true);\n\nexport function NativeTabsNavigatorWrapper(props: NativeTabsProps) {\n const triggerChildren = useMemo(\n () => getAllChildrenOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n const nonTriggerChildren = useMemo(\n () => getAllChildrenNotOfType(props.children, NativeTabTrigger),\n [props.children]\n );\n\n return (\n <NativeTabsNavigatorWithContext\n {...props}\n children={triggerChildren}\n nonTriggerChildren={nonTriggerChildren}\n />\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeBottomTabsRouter.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,MAAM,EACN,aAAa,EACb,kBAAkB,EAElB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AASlC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,0IAiD/D"}
1
+ {"version":3,"file":"NativeBottomTabsRouter.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,MAAM,EACN,aAAa,EACb,kBAAkB,EAElB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAYlC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,0IAkE/D"}
@@ -26,7 +26,18 @@ function NativeBottomTabsRouter(options) {
26
26
  if (route.params && 'screen' in route.params) {
27
27
  expoParams[navigationParams_1.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME] = true;
28
28
  }
29
- const params = (0, navigationParams_1.appendInternalExpoRouterParams)(route.params, expoParams);
29
+ if (process.env.NODE_ENV !== 'production') {
30
+ if (expoParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]) {
31
+ console.warn('Zoom transition is not supported when navigating between tabs. Falling back to standard navigation transition.');
32
+ }
33
+ }
34
+ // Zoom transition needs to be disabled for navigation inside tabs
35
+ // Otherwise user can end up in a situation where a view is missing on one tab
36
+ // because it was used to perform zoom transition on another tab
37
+ const params = (0, navigationParams_1.removeParams)((0, navigationParams_1.appendInternalExpoRouterParams)(route.params, expoParams), [
38
+ navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,
39
+ navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,
40
+ ]);
30
41
  return {
31
42
  ...route,
32
43
  params,
@@ -1 +1 @@
1
- {"version":3,"file":"NativeBottomTabsRouter.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsRouter.tsx"],"names":[],"mappings":";;AAiBA,wDAiDC;AAlED,qDAQkC;AAElC,0DAK6B;AAE7B,SAAgB,sBAAsB,CAAC,OAAyB;IAC9D,MAAM,SAAS,GAAG,IAAA,kBAAS,EAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAE5C,MAAM,eAAe,GAGjB;QACF,GAAG,SAAS;QACZ,qEAAqE;QACrE,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAA8C,EAAE,OAAO,EAAE,EAAE;YACpF,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,UAAU,CAAC,CAAC,CAAC;oBAChB,MAAM,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;oBACnF,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBAEpF,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;wBAC5C,OAAO,sBAAsB,CAAC;oBAChC,CAAC;oBAED,MAAM,QAAQ,GAAG;wBACf,GAAG,sBAAsB;wBACzB,MAAM,EAAE,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;4BAClD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gCACvC,OAAO,KAAK,CAAC;4BACf,CAAC;4BAED,MAAM,UAAU,GAA6B,IAAA,8CAA2B,EACtE,MAAM,CAAC,OAAO,CAAC,MAAM,CACtB,CAAC;4BAEF,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gCAC7C,UAAU,CAAC,+DAA4C,CAAC,GAAG,IAAI,CAAC;4BAClE,CAAC;4BAED,MAAM,MAAM,GAAG,IAAA,iDAA8B,EAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;4BACxE,OAAO;gCACL,GAAG,KAAK;gCACR,MAAM;6BACP,CAAC;wBACJ,CAAC,CAAC;qBACH,CAAC;oBACF,OAAO,QAAQ,CAAC;gBAClB,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7D,CAAC;KACF,CAAC;IAEF,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import {\n CommonNavigationAction,\n ParamListBase,\n Router,\n TabActionType,\n TabNavigationState,\n TabRouter,\n type TabRouterOptions,\n} from '@react-navigation/native';\n\nimport {\n appendInternalExpoRouterParams,\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n type InternalExpoRouterParams,\n} from '../navigationParams';\n\nexport function NativeBottomTabsRouter(options: TabRouterOptions) {\n const tabRouter = TabRouter({ ...options });\n\n const nativeTabRouter: Router<\n TabNavigationState<ParamListBase>,\n TabActionType | CommonNavigationAction\n > = {\n ...tabRouter,\n // @ts-expect-error TODO: For some reason this is not typed correctly\n getStateForAction: (state, action: TabActionType | CommonNavigationAction, options) => {\n switch (action.type) {\n case 'NAVIGATE': {\n const newStateFromNavigation = tabRouter.getStateForAction(state, action, options);\n const index = state.routes.findIndex((route) => route.name === action.payload.name);\n\n if (index === -1 || !newStateFromNavigation) {\n return newStateFromNavigation;\n }\n\n const newState = {\n ...newStateFromNavigation,\n routes: newStateFromNavigation.routes.map((route) => {\n if (route.name !== action.payload.name) {\n return route;\n }\n\n const expoParams: InternalExpoRouterParams = getInternalExpoRouterParams(\n action.payload.params\n );\n\n if (route.params && 'screen' in route.params) {\n expoParams[INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME] = true;\n }\n\n const params = appendInternalExpoRouterParams(route.params, expoParams);\n return {\n ...route,\n params,\n };\n }),\n };\n return newState;\n }\n }\n return tabRouter.getStateForAction(state, action, options);\n },\n };\n\n return nativeTabRouter;\n}\n"]}
1
+ {"version":3,"file":"NativeBottomTabsRouter.js","sourceRoot":"","sources":["../../src/native-tabs/NativeBottomTabsRouter.tsx"],"names":[],"mappings":";;AAoBA,wDAkEC;AAtFD,qDAQkC;AAElC,0DAQ6B;AAE7B,SAAgB,sBAAsB,CAAC,OAAyB;IAC9D,MAAM,SAAS,GAAG,IAAA,kBAAS,EAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAE5C,MAAM,eAAe,GAGjB;QACF,GAAG,SAAS;QACZ,qEAAqE;QACrE,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAA8C,EAAE,OAAO,EAAE,EAAE;YACpF,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,UAAU,CAAC,CAAC,CAAC;oBAChB,MAAM,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;oBACnF,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,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AiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7D,CAAC;KACF,CAAC;IAEF,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import {\n CommonNavigationAction,\n ParamListBase,\n Router,\n TabActionType,\n TabNavigationState,\n TabRouter,\n type TabRouterOptions,\n} from '@react-navigation/native';\n\nimport {\n appendInternalExpoRouterParams,\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n removeParams,\n type InternalExpoRouterParams,\n} from '../navigationParams';\n\nexport function NativeBottomTabsRouter(options: TabRouterOptions) {\n const tabRouter = TabRouter({ ...options });\n\n const nativeTabRouter: Router<\n TabNavigationState<ParamListBase>,\n TabActionType | CommonNavigationAction\n > = {\n ...tabRouter,\n // @ts-expect-error TODO: For some reason this is not typed correctly\n getStateForAction: (state, action: TabActionType | CommonNavigationAction, options) => {\n switch (action.type) {\n case 'NAVIGATE': {\n const newStateFromNavigation = tabRouter.getStateForAction(state, action, options);\n const index = state.routes.findIndex((route) => route.name === action.payload.name);\n\n if (index === -1 || !newStateFromNavigation) {\n return newStateFromNavigation;\n }\n\n const newState = {\n ...newStateFromNavigation,\n routes: newStateFromNavigation.routes.map((route) => {\n if (route.name !== action.payload.name) {\n return route;\n }\n\n const expoParams: InternalExpoRouterParams = getInternalExpoRouterParams(\n action.payload.params\n );\n\n if (route.params && 'screen' in route.params) {\n expoParams[INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME] = true;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (expoParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]) {\n console.warn(\n 'Zoom transition is not supported when navigating between tabs. Falling back to standard navigation transition.'\n );\n }\n }\n\n // Zoom transition needs to be disabled for navigation inside tabs\n // Otherwise user can end up in a situation where a view is missing on one tab\n // because it was used to perform zoom transition on another tab\n const params = removeParams(\n appendInternalExpoRouterParams(route.params, expoParams),\n [\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n ]\n );\n return {\n ...route,\n params,\n };\n }),\n };\n return newState;\n }\n }\n return tabRouter.getStateForAction(state, action, options);\n },\n };\n\n return nativeTabRouter;\n}\n"]}
@@ -46,9 +46,9 @@ export declare const NativeTabTrigger: typeof NativeTabTriggerImpl & {
46
46
  Label: import("react").FC<NativeTabsTriggerLabelProps>;
47
47
  Icon: import("react").FC<NativeTabsTriggerIconProps>;
48
48
  Badge: import("react").FC<NativeTabsTriggerBadgeProps>;
49
- VectorIcon: typeof import("../primitives").VectorIcon;
49
+ VectorIcon: typeof import("..").VectorIcon;
50
50
  };
51
- export declare function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, }: NativeTabTriggerProps, isDynamic?: boolean): NativeTabOptions;
51
+ export declare function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, }: NativeTabTriggerProps, isDynamic?: boolean): NativeTabOptions;
52
52
  export declare function appendIconOptions(options: NativeTabOptions, props: NativeTabsTriggerIconProps): void;
53
53
  export declare function isNativeTabTrigger(child: ReactNode, contextKey?: string): child is ReactElement<NativeTabTriggerProps & {
54
54
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,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EACE,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,6BAA6B,EAC7B,YAAY,GACb,EAAE,qBAAqB,EACxB,SAAS,GAAE,OAAe,oBAqC3B;AAyBD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,0BAA0B,QA8C7F;AA+BD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,KAAK,IAAI,YAAY,CAAC,qBAAqB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA6BjE"}
@@ -7,10 +7,13 @@ exports.appendIconOptions = appendIconOptions;
7
7
  exports.isNativeTabTrigger = isNativeTabTrigger;
8
8
  const native_1 = require("@react-navigation/native");
9
9
  const react_1 = require("react");
10
- const utils_1 = require("./utils");
10
+ const react_native_1 = require("react-native");
11
11
  const PreviewRouteContext_1 = require("../link/preview/PreviewRouteContext");
12
12
  const useSafeLayoutEffect_1 = require("../views/useSafeLayoutEffect");
13
13
  const elements_1 = require("./common/elements");
14
+ const children_1 = require("../utils/children");
15
+ const icon_1 = require("./utils/icon");
16
+ const materialIconConverter_1 = require("./utils/materialIconConverter");
14
17
  /**
15
18
  * The component used to customize the native tab options both in the _layout file and from the tab screen.
16
19
  *
@@ -76,7 +79,7 @@ exports.NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {
76
79
  Badge: elements_1.NativeTabsTriggerBadge,
77
80
  VectorIcon: elements_1.NativeTabsTriggerVectorIcon,
78
81
  });
79
- function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, }, isDynamic = false) {
82
+ function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, disableScrollToTop, unstable_nativeProps, disableAutomaticContentInsets, contentStyle, }, isDynamic = false) {
80
83
  const initialOptions = isDynamic
81
84
  ? {
82
85
  ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),
@@ -89,22 +92,24 @@ function convertTabPropsToOptions({ hidden, children, role, disablePopToTop, dis
89
92
  scrollToTop: !disableScrollToTop,
90
93
  },
91
94
  },
95
+ contentStyle,
92
96
  role,
93
97
  nativeProps: unstable_nativeProps,
98
+ disableAutomaticContentInsets,
94
99
  };
95
- const allowedChildren = (0, utils_1.filterAllowedChildrenElements)(children, [
100
+ const allowedChildren = (0, children_1.filterAllowedChildrenElements)(children, [
96
101
  elements_1.NativeTabsTriggerBadge,
97
102
  elements_1.NativeTabsTriggerLabel,
98
103
  elements_1.NativeTabsTriggerIcon,
99
104
  ]);
100
105
  return allowedChildren.reduce((acc, child) => {
101
- if ((0, utils_1.isChildOfType)(child, elements_1.NativeTabsTriggerBadge)) {
106
+ if ((0, children_1.isChildOfType)(child, elements_1.NativeTabsTriggerBadge)) {
102
107
  appendBadgeOptions(acc, child.props);
103
108
  }
104
- else if ((0, utils_1.isChildOfType)(child, elements_1.NativeTabsTriggerLabel)) {
109
+ else if ((0, children_1.isChildOfType)(child, elements_1.NativeTabsTriggerLabel)) {
105
110
  appendLabelOptions(acc, child.props);
106
111
  }
107
- else if ((0, utils_1.isChildOfType)(child, elements_1.NativeTabsTriggerIcon)) {
112
+ else if ((0, children_1.isChildOfType)(child, elements_1.NativeTabsTriggerIcon)) {
108
113
  appendIconOptions(acc, child.props);
109
114
  }
110
115
  return acc;
@@ -129,7 +134,7 @@ function appendLabelOptions(options, props) {
129
134
  else {
130
135
  options.title = props.children;
131
136
  if (props.selectedStyle) {
132
- options.selectedLabelStyle = props.selectedStyle;
137
+ options.selectedLabelStyle = react_native_1.StyleSheet.flatten(props.selectedStyle);
133
138
  }
134
139
  }
135
140
  }
@@ -157,9 +162,20 @@ function appendIconOptions(options, props) {
157
162
  }
158
163
  }
159
164
  else if ('drawable' in props && props.drawable && process.env.EXPO_OS === 'android') {
165
+ if ('md' in props) {
166
+ console.warn('Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.');
167
+ }
160
168
  options.icon = { drawable: props.drawable };
161
169
  options.selectedIcon = undefined;
162
170
  }
171
+ else if ('md' in props && props.md && process.env.EXPO_OS === 'android') {
172
+ if (process.env.NODE_ENV !== 'production') {
173
+ if ('drawable' in props) {
174
+ console.warn('Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.');
175
+ }
176
+ }
177
+ options.icon = (0, materialIconConverter_1.convertMaterialIconNameToImageSource)(props.md);
178
+ }
163
179
  else if ('src' in props && props.src) {
164
180
  const icon = convertIconSrcToIconOption(props);
165
181
  options.icon = icon?.icon;
@@ -184,13 +200,7 @@ function convertIconSrcToIconOption(icon) {
184
200
  function convertSrcOrComponentToSrc(src) {
185
201
  if (src) {
186
202
  if ((0, react_1.isValidElement)(src)) {
187
- if (src.type === elements_1.NativeTabsTriggerVectorIcon) {
188
- const props = src.props;
189
- return { src: props.family.getImageSource(props.name, 24, 'white') };
190
- }
191
- else {
192
- console.warn('Only VectorIcon is supported as a React element in Icon.src');
193
- }
203
+ return (0, icon_1.convertComponentSrcToImageSource)(src);
194
204
  }
195
205
  else {
196
206
  return { src };
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA6Fb,4DA4CC;AAyBD,8CAgCC;AAoCD,gDAgCC;AApQD,qDAAmE;AACnE,iCAA0E;AAI1E,mCAAuE;AACvE,6EAAmE;AAEnE,sEAAmE;AACnE,gDAS2B;AAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAS,oBAAoB,CAAC,KAA4B;IACxD,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;IACnC,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,C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C;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, type ReactElement, type ReactNode } from 'react';\nimport { type ImageSourcePropType } from 'react-native';\n\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { filterAllowedChildrenElements, isChildOfType } from './utils';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport type { VectorIconProps } from '../primitives';\nimport { useSafeLayoutEffect } from '../views/useSafeLayoutEffect';\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n type NativeTabsTriggerIconProps,\n type SrcIcon,\n} from './common/elements';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // In a tab screen\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n * ```\n *\n * > **Note:** You can use the alias `NativeTabs.Trigger` for this component.\n */\nfunction NativeTabTriggerImpl(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isFocused = navigation.isFocused();\n const isInPreview = useIsPreview();\n\n useSafeLayoutEffect(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (isFocused && !isInPreview) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props, true);\n navigation.setOptions(options);\n }\n }, [isFocused, props, isInPreview]);\n\n return null;\n}\n\nexport const NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {\n Label: NativeTabsTriggerLabel,\n Icon: NativeTabsTriggerIcon,\n Badge: NativeTabsTriggerBadge,\n VectorIcon: NativeTabsTriggerVectorIcon,\n});\n\nexport function convertTabPropsToOptions(\n {\n hidden,\n children,\n role,\n disablePopToTop,\n disableScrollToTop,\n unstable_nativeProps,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n }\n : {\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n role,\n nativeProps: unstable_nativeProps,\n };\n const allowedChildren = filterAllowedChildrenElements(children, [\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerIcon,\n ]);\n return allowedChildren.reduce<NativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, NativeTabsTriggerBadge)) {\n appendBadgeOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerLabel)) {\n appendLabelOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerIcon)) {\n appendIconOptions(acc, child.props);\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nfunction appendBadgeOptions(options: NativeTabOptions, props: NativeTabsTriggerBadgeProps) {\n if (props.children) {\n options.badgeValue = String(props.children);\n options.selectedBadgeBackgroundColor = props.selectedBackgroundColor;\n } else if (!props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n options.badgeValue = ' ';\n }\n}\n\nfunction appendLabelOptions(options: NativeTabOptions, props: NativeTabsTriggerLabelProps) {\n if (props.hidden) {\n options.title = '';\n } else {\n options.title = props.children;\n if (props.selectedStyle) {\n options.selectedLabelStyle = props.selectedStyle;\n }\n }\n}\n\nexport function appendIconOptions(options: NativeTabOptions, props: NativeTabsTriggerIconProps) {\n if ('sf' in props && props.sf && process.env.EXPO_OS === 'ios') {\n if (typeof props.sf === 'string') {\n options.icon = props.sf\n ? {\n sf: props.sf,\n }\n : undefined;\n options.selectedIcon = undefined;\n } else if (props.sf) {\n options.icon = props.sf.default\n ? {\n sf: props.sf.default,\n }\n : undefined;\n options.selectedIcon = props.sf.selected\n ? {\n sf: props.sf.selected,\n }\n : undefined;\n }\n } else if ('drawable' in props && props.drawable && process.env.EXPO_OS === 'android') {\n options.icon = { drawable: props.drawable };\n options.selectedIcon = undefined;\n } else if ('src' in props && props.src) {\n const icon = convertIconSrcToIconOption(props);\n options.icon = icon?.icon;\n options.selectedIcon = icon?.selectedIcon;\n }\n if (props.selectedColor) {\n options.selectedIconColor = props.selectedColor;\n }\n}\n\nfunction convertIconSrcToIconOption(\n icon: SrcIcon | undefined\n): Pick<NativeTabOptions, 'icon' | 'selectedIcon'> | undefined {\n if (icon && icon.src) {\n const { defaultIcon, selected } =\n typeof icon.src === 'object' && 'selected' in icon.src\n ? { defaultIcon: icon.src.default, selected: icon.src.selected }\n : { defaultIcon: icon.src };\n\n const options: Pick<NativeTabOptions, 'icon' | 'selectedIcon'> = {};\n options.icon = convertSrcOrComponentToSrc(defaultIcon);\n options.selectedIcon = convertSrcOrComponentToSrc(selected);\n return options;\n }\n\n return undefined;\n}\n\nfunction convertSrcOrComponentToSrc(src: ImageSourcePropType | ReactElement | undefined) {\n if (src) {\n if (isValidElement(src)) {\n if (src.type === NativeTabsTriggerVectorIcon) {\n const props = src.props as VectorIconProps<string>;\n return { src: props.family.getImageSource(props.name, 24, 'white') };\n } else {\n console.warn('Only VectorIcon is supported as a React element in Icon.src');\n }\n } else {\n return { src };\n }\n }\n return undefined;\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isValidElement(child) && child && child.type === NativeTabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA8Fb,4DAgDC;AAyBD,8CA8CC;AA+BD,gDAgCC;AAlRD,qDAAmE;AACnE,iCAA0E;AAC1E,+CAAoE;AAGpE,6EAAmE;AACnE,sEAAmE;AACnE,gDAS2B;AAC3B,gDAAiF;AACjF,uCAAgE;AAChE,yEAAqF;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAS,oBAAoB,CAAC,KAA4B;IACxD,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;IACnC,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IACzC,MAAM,WAAW,GAAG,I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AAG,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,GAAG,IAAI,KAAK,CAAC,KAAK,CAC9E,EACD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,0GAA0G,CAC5K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, type ReactElement, type ReactNode } from 'react';\nimport { StyleSheet, type ImageSourcePropType } from 'react-native';\n\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport { useSafeLayoutEffect } from '../views/useSafeLayoutEffect';\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n type NativeTabsTriggerIconProps,\n type SrcIcon,\n} from './common/elements';\nimport { filterAllowedChildrenElements, isChildOfType } from '../utils/children';\nimport { convertComponentSrcToImageSource } from './utils/icon';\nimport { convertMaterialIconNameToImageSource } from './utils/materialIconConverter';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // In a tab screen\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n * ```\n *\n * > **Note:** You can use the alias `NativeTabs.Trigger` for this component.\n */\nfunction NativeTabTriggerImpl(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isFocused = navigation.isFocused();\n const isInPreview = useIsPreview();\n\n useSafeLayoutEffect(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (isFocused && !isInPreview) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props, true);\n navigation.setOptions(options);\n }\n }, [isFocused, props, isInPreview]);\n\n return null;\n}\n\nexport const NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {\n Label: NativeTabsTriggerLabel,\n Icon: NativeTabsTriggerIcon,\n Badge: NativeTabsTriggerBadge,\n VectorIcon: NativeTabsTriggerVectorIcon,\n});\n\nexport function convertTabPropsToOptions(\n {\n hidden,\n children,\n role,\n disablePopToTop,\n disableScrollToTop,\n unstable_nativeProps,\n disableAutomaticContentInsets,\n contentStyle,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n }\n : {\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n contentStyle,\n role,\n nativeProps: unstable_nativeProps,\n disableAutomaticContentInsets,\n };\n const allowedChildren = filterAllowedChildrenElements(children, [\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerIcon,\n ]);\n return allowedChildren.reduce<NativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, NativeTabsTriggerBadge)) {\n appendBadgeOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerLabel)) {\n appendLabelOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerIcon)) {\n appendIconOptions(acc, child.props);\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nfunction appendBadgeOptions(options: NativeTabOptions, props: NativeTabsTriggerBadgeProps) {\n if (props.children) {\n options.badgeValue = String(props.children);\n options.selectedBadgeBackgroundColor = props.selectedBackgroundColor;\n } else if (!props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n options.badgeValue = ' ';\n }\n}\n\nfunction appendLabelOptions(options: NativeTabOptions, props: NativeTabsTriggerLabelProps) {\n if (props.hidden) {\n options.title = '';\n } else {\n options.title = props.children;\n if (props.selectedStyle) {\n options.selectedLabelStyle = StyleSheet.flatten(props.selectedStyle);\n }\n }\n}\n\nexport function appendIconOptions(options: NativeTabOptions, props: NativeTabsTriggerIconProps) {\n if ('sf' in props && props.sf && process.env.EXPO_OS === 'ios') {\n if (typeof props.sf === 'string') {\n options.icon = props.sf\n ? {\n sf: props.sf,\n }\n : undefined;\n options.selectedIcon = undefined;\n } else if (props.sf) {\n options.icon = props.sf.default\n ? {\n sf: props.sf.default,\n }\n : undefined;\n options.selectedIcon = props.sf.selected\n ? {\n sf: props.sf.selected,\n }\n : undefined;\n }\n } else if ('drawable' in props && props.drawable && process.env.EXPO_OS === 'android') {\n if ('md' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n options.icon = { drawable: props.drawable };\n options.selectedIcon = undefined;\n } else if ('md' in props && props.md && process.env.EXPO_OS === 'android') {\n if (process.env.NODE_ENV !== 'production') {\n if ('drawable' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n }\n options.icon = convertMaterialIconNameToImageSource(props.md);\n } else if ('src' in props && props.src) {\n const icon = convertIconSrcToIconOption(props);\n options.icon = icon?.icon;\n options.selectedIcon = icon?.selectedIcon;\n }\n if (props.selectedColor) {\n options.selectedIconColor = props.selectedColor;\n }\n}\n\nfunction convertIconSrcToIconOption(\n icon: SrcIcon | undefined\n): Pick<NativeTabOptions, 'icon' | 'selectedIcon'> | undefined {\n if (icon && icon.src) {\n const { defaultIcon, selected } =\n typeof icon.src === 'object' && 'selected' in icon.src\n ? { defaultIcon: icon.src.default, selected: icon.src.selected }\n : { defaultIcon: icon.src };\n\n const options: Pick<NativeTabOptions, 'icon' | 'selectedIcon'> = {};\n options.icon = convertSrcOrComponentToSrc(defaultIcon);\n options.selectedIcon = convertSrcOrComponentToSrc(selected);\n return options;\n }\n\n return undefined;\n}\n\nfunction convertSrcOrComponentToSrc(src: ImageSourcePropType | ReactElement | undefined) {\n if (src) {\n if (isValidElement(src)) {\n return convertComponentSrcToImageSource(src);\n } else {\n return { src };\n }\n }\n return undefined;\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isValidElement(child) && child && child.type === NativeTabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
@@ -19,10 +19,13 @@ import type { NativeTabsProps } from './types';
19
19
  */
20
20
  export declare const NativeTabs: ((props: NativeTabsProps) => import("react").JSX.Element) & {
21
21
  Trigger: ((props: import("./types").NativeTabTriggerProps) => null) & {
22
- Label: import("react").FC<import(".").NativeTabsTriggerLabelProps>;
23
- Icon: import("react").FC<import(".").NativeTabsTriggerIconProps>;
24
- Badge: import("react").FC<import(".").NativeTabsTriggerBadgeProps>;
22
+ Label: import("react").FC<import("./common/elements").NativeTabsTriggerLabelProps>;
23
+ Icon: import("react").FC<import("./common/elements").NativeTabsTriggerIconProps>;
24
+ Badge: import("react").FC<import("./common/elements").NativeTabsTriggerBadgeProps>;
25
25
  VectorIcon: typeof import("..").VectorIcon;
26
26
  };
27
+ BottomAccessory: import("react").FC<import("./common/elements").NativeTabsBottomAccessoryProps> & {
28
+ usePlacement: () => "regular" | "inline";
29
+ };
27
30
  };
28
31
  //# sourceMappingURL=NativeTabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabs.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabs.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,WACb,eAAe;;;;;;;CAIxB,CAAC"}
1
+ {"version":3,"file":"NativeTabs.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabs.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAM/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,WACb,eAAe;;;;;;;;;;CAIxB,CAAC"}
@@ -5,6 +5,11 @@ exports.NativeTabs = void 0;
5
5
  // Otherwise rsc would fail
6
6
  const NativeBottomTabsNavigator_1 = require("./NativeBottomTabsNavigator");
7
7
  const NativeTabTrigger_1 = require("./NativeTabTrigger");
8
+ const elements_1 = require("./common/elements");
9
+ const hooks_1 = require("./hooks");
10
+ const BottomAccessory = Object.assign(elements_1.NativeTabsBottomAccessory, {
11
+ usePlacement: hooks_1.usePlacement,
12
+ });
8
13
  /**
9
14
  * The component used to create native tabs layout.
10
15
  *
@@ -24,6 +29,6 @@ const NativeTabTrigger_1 = require("./NativeTabTrigger");
24
29
  * ```
25
30
  */
26
31
  exports.NativeTabs = Object.assign((props) => {
27
- return <NativeBottomTabsNavigator_1.NativeTabsNavigatorWithContext {...props}/>;
28
- }, { Trigger: NativeTabTrigger_1.NativeTabTrigger });
32
+ return <NativeBottomTabsNavigator_1.NativeTabsNavigatorWrapper {...props}/>;
33
+ }, { Trigger: NativeTabTrigger_1.NativeTabTrigger, BottomAccessory });
29
34
  //# sourceMappingURL=NativeTabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabs.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabs.tsx"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2BAA2B;AAC3B,2EAA6E;AAC7E,yDAAsD;AAGtD;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CACrC,CAAC,KAAsB,EAAE,EAAE;IACzB,OAAO,CAAC,0DAA8B,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACvD,CAAC,EACD,EAAE,OAAO,EAAE,mCAAgB,EAAE,CAC9B,CAAC","sourcesContent":["// We need this file to re-export the navigator\n// Otherwise rsc would fail\nimport { NativeTabsNavigatorWithContext } from './NativeBottomTabsNavigator';\nimport { NativeTabTrigger } from './NativeTabTrigger';\nimport type { NativeTabsProps } from './types';\n\n/**\n * The component used to create native tabs layout.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n */\nexport const NativeTabs = Object.assign(\n (props: NativeTabsProps) => {\n return <NativeTabsNavigatorWithContext {...props} />;\n },\n { Trigger: NativeTabTrigger }\n);\n"]}
1
+ {"version":3,"file":"NativeTabs.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabs.tsx"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2BAA2B;AAC3B,2EAAyE;AACzE,yDAAsD;AACtD,gDAA8D;AAC9D,mCAAuC;AAGvC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,oCAAyB,EAAE;IAC/D,YAAY,EAAZ,oBAAY;CACb,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CACrC,CAAC,KAAsB,EAAE,EAAE;IACzB,OAAO,CAAC,sDAA0B,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACnD,CAAC,EACD,EAAE,OAAO,EAAE,mCAAgB,EAAE,eAAe,EAAE,CAC/C,CAAC","sourcesContent":["// We need this file to re-export the navigator\n// Otherwise rsc would fail\nimport { NativeTabsNavigatorWrapper } from './NativeBottomTabsNavigator';\nimport { NativeTabTrigger } from './NativeTabTrigger';\nimport { NativeTabsBottomAccessory } from './common/elements';\nimport { usePlacement } from './hooks';\nimport type { NativeTabsProps } from './types';\n\nconst BottomAccessory = Object.assign(NativeTabsBottomAccessory, {\n usePlacement,\n});\n\n/**\n * The component used to create native tabs layout.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n */\nexport const NativeTabs = Object.assign(\n (props: NativeTabsProps) => {\n return <NativeTabsNavigatorWrapper {...props} />;\n },\n { Trigger: NativeTabTrigger, BottomAccessory }\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabsView.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAchD,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AAWjB,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA6ExD"}
1
+ {"version":3,"file":"NativeTabsView.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAgBzD,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AAajB,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA6FxD"}