expo-router 7.0.0-canary-20260114-d8e19f5 → 7.0.0-canary-20260120-bb71700

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 (261) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/ExpoRoot.d.ts.map +1 -1
  3. package/build/ExpoRoot.js +2 -0
  4. package/build/ExpoRoot.js.map +1 -1
  5. package/build/global-state/routing.d.ts.map +1 -1
  6. package/build/global-state/routing.js +7 -2
  7. package/build/global-state/routing.js.map +1 -1
  8. package/build/global.d.ts +29 -0
  9. package/build/global.d.ts.map +1 -0
  10. package/build/global.js +3 -0
  11. package/build/global.js.map +1 -0
  12. package/build/index.d.ts +1 -0
  13. package/build/index.d.ts.map +1 -1
  14. package/build/index.js +1 -0
  15. package/build/index.js.map +1 -1
  16. package/build/layouts/Stack.d.ts.map +1 -1
  17. package/build/layouts/Stack.js +3 -0
  18. package/build/layouts/Stack.js.map +1 -1
  19. package/build/layouts/Stack.web.js +1 -0
  20. package/build/layouts/Stack.web.js.map +1 -1
  21. package/build/layouts/StackClient.d.ts +13 -14
  22. package/build/layouts/StackClient.d.ts.map +1 -1
  23. package/build/layouts/StackClient.js +3 -2
  24. package/build/layouts/StackClient.js.map +1 -1
  25. package/build/layouts/stack-utils/StackHeaderComponent.d.ts +12 -23
  26. package/build/layouts/stack-utils/StackHeaderComponent.d.ts.map +1 -1
  27. package/build/layouts/stack-utils/StackHeaderComponent.js +15 -55
  28. package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
  29. package/build/layouts/stack-utils/StackScreen.d.ts +5 -0
  30. package/build/layouts/stack-utils/StackScreen.d.ts.map +1 -1
  31. package/build/layouts/stack-utils/StackScreen.js +34 -7
  32. package/build/layouts/stack-utils/StackScreen.js.map +1 -1
  33. package/build/layouts/stack-utils/StackSearchBar.d.ts +28 -0
  34. package/build/layouts/stack-utils/StackSearchBar.d.ts.map +1 -1
  35. package/build/layouts/stack-utils/StackSearchBar.js +29 -0
  36. package/build/layouts/stack-utils/StackSearchBar.js.map +1 -1
  37. package/build/layouts/stack-utils/common-primitives.d.ts +6 -6
  38. package/build/layouts/stack-utils/common-primitives.d.ts.map +1 -1
  39. package/build/layouts/stack-utils/common-primitives.js +4 -4
  40. package/build/layouts/stack-utils/common-primitives.js.map +1 -1
  41. package/build/layouts/stack-utils/index.d.ts +4 -23
  42. package/build/layouts/stack-utils/index.d.ts.map +1 -1
  43. package/build/layouts/stack-utils/index.js +18 -35
  44. package/build/layouts/stack-utils/index.js.map +1 -1
  45. package/build/layouts/stack-utils/screen/StackScreenBackButton.d.ts +68 -0
  46. package/build/layouts/stack-utils/screen/StackScreenBackButton.d.ts.map +1 -0
  47. package/build/layouts/stack-utils/screen/StackScreenBackButton.js +58 -0
  48. package/build/layouts/stack-utils/screen/StackScreenBackButton.js.map +1 -0
  49. package/build/layouts/stack-utils/screen/StackScreenTitle.d.ts +58 -0
  50. package/build/layouts/stack-utils/screen/StackScreenTitle.d.ts.map +1 -0
  51. package/build/layouts/stack-utils/screen/StackScreenTitle.js +75 -0
  52. package/build/layouts/stack-utils/screen/StackScreenTitle.js.map +1 -0
  53. package/build/layouts/stack-utils/screen/index.d.ts +3 -0
  54. package/build/layouts/stack-utils/screen/index.d.ts.map +1 -0
  55. package/build/layouts/stack-utils/screen/index.js +10 -0
  56. package/build/layouts/stack-utils/screen/index.js.map +1 -0
  57. package/build/layouts/stack-utils/shared.js +3 -3
  58. package/build/layouts/stack-utils/shared.js.map +1 -1
  59. package/build/layouts/stack-utils/toolbar/StackToolbar.d.ts +3 -0
  60. package/build/layouts/stack-utils/toolbar/StackToolbar.d.ts.map +1 -0
  61. package/build/layouts/stack-utils/toolbar/StackToolbar.js +24 -0
  62. package/build/layouts/stack-utils/toolbar/StackToolbar.js.map +1 -0
  63. package/build/layouts/stack-utils/toolbar/StackToolbarButton.d.ts +144 -0
  64. package/build/layouts/stack-utils/toolbar/StackToolbarButton.d.ts.map +1 -0
  65. package/build/layouts/stack-utils/toolbar/StackToolbarButton.js +68 -0
  66. package/build/layouts/stack-utils/toolbar/StackToolbarButton.js.map +1 -0
  67. package/build/layouts/stack-utils/toolbar/StackToolbarClient.d.ts +104 -0
  68. package/build/layouts/stack-utils/toolbar/StackToolbarClient.d.ts.map +1 -0
  69. package/build/layouts/stack-utils/toolbar/StackToolbarClient.js +214 -0
  70. package/build/layouts/stack-utils/toolbar/StackToolbarClient.js.map +1 -0
  71. package/build/layouts/stack-utils/{StackHeaderMenu.d.ts → toolbar/StackToolbarMenu.d.ts} +58 -106
  72. package/build/layouts/stack-utils/toolbar/StackToolbarMenu.d.ts.map +1 -0
  73. package/build/layouts/stack-utils/toolbar/StackToolbarMenu.js +190 -0
  74. package/build/layouts/stack-utils/toolbar/StackToolbarMenu.js.map +1 -0
  75. package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.d.ts +48 -0
  76. package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.d.ts.map +1 -0
  77. package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.js +44 -0
  78. package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.js.map +1 -0
  79. package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.d.ts +80 -0
  80. package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.d.ts.map +1 -0
  81. package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.js +77 -0
  82. package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.js.map +1 -0
  83. package/build/layouts/stack-utils/{StackHeaderView.d.ts → toolbar/StackToolbarView.d.ts} +21 -17
  84. package/build/layouts/stack-utils/toolbar/StackToolbarView.d.ts.map +1 -0
  85. package/build/layouts/stack-utils/toolbar/StackToolbarView.js +61 -0
  86. package/build/layouts/stack-utils/toolbar/StackToolbarView.js.map +1 -0
  87. package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.d.ts +93 -0
  88. package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.d.ts.map +1 -0
  89. package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.js +89 -0
  90. package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.js.map +1 -0
  91. package/build/layouts/stack-utils/toolbar/context.d.ts +9 -0
  92. package/build/layouts/stack-utils/toolbar/context.d.ts.map +1 -0
  93. package/build/layouts/stack-utils/toolbar/context.js +16 -0
  94. package/build/layouts/stack-utils/toolbar/context.js.map +1 -0
  95. package/build/layouts/stack-utils/toolbar/index.d.ts +10 -0
  96. package/build/layouts/stack-utils/toolbar/index.d.ts.map +1 -0
  97. package/build/layouts/stack-utils/toolbar/index.js +23 -0
  98. package/build/layouts/stack-utils/toolbar/index.js.map +1 -0
  99. package/build/link/LinkWithPreview.d.ts.map +1 -1
  100. package/build/link/LinkWithPreview.js +8 -5
  101. package/build/link/LinkWithPreview.js.map +1 -1
  102. package/build/link/NativeMenuContext.d.ts +5 -0
  103. package/build/link/NativeMenuContext.d.ts.map +1 -0
  104. package/build/link/NativeMenuContext.js +9 -0
  105. package/build/link/NativeMenuContext.js.map +1 -0
  106. package/build/link/elements.d.ts +41 -0
  107. package/build/link/elements.d.ts.map +1 -1
  108. package/build/link/elements.js +3 -2
  109. package/build/link/elements.js.map +1 -1
  110. package/build/link/preview/native.d.ts +2 -0
  111. package/build/link/preview/native.d.ts.map +1 -1
  112. package/build/link/preview/native.js +3 -1
  113. package/build/link/preview/native.js.map +1 -1
  114. package/build/loaders/utils.d.ts +5 -2
  115. package/build/loaders/utils.d.ts.map +1 -1
  116. package/build/loaders/utils.js +8 -5
  117. package/build/loaders/utils.js.map +1 -1
  118. package/build/native-tabs/NativeBottomTabsNavigator.d.ts +1 -1
  119. package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
  120. package/build/native-tabs/NativeBottomTabsNavigator.js +2 -1
  121. package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -1
  122. package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
  123. package/build/native-tabs/NativeTabTrigger.js +6 -4
  124. package/build/native-tabs/NativeTabTrigger.js.map +1 -1
  125. package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
  126. package/build/native-tabs/NativeTabsView.js +6 -9
  127. package/build/native-tabs/NativeTabsView.js.map +1 -1
  128. package/build/native-tabs/appearance.d.ts +7 -7
  129. package/build/native-tabs/appearance.d.ts.map +1 -1
  130. package/build/native-tabs/appearance.js.map +1 -1
  131. package/build/native-tabs/common/elements.d.ts +10 -0
  132. package/build/native-tabs/common/elements.d.ts.map +1 -1
  133. package/build/native-tabs/common/elements.js.map +1 -1
  134. package/build/native-tabs/types.d.ts +9 -3
  135. package/build/native-tabs/types.d.ts.map +1 -1
  136. package/build/native-tabs/types.js.map +1 -1
  137. package/build/native-tabs/utils/bottomAccessory.d.ts +2 -2
  138. package/build/native-tabs/utils/bottomAccessory.d.ts.map +1 -1
  139. package/build/native-tabs/utils/bottomAccessory.js.map +1 -1
  140. package/build/native-tabs/utils/icon.d.ts +4 -2
  141. package/build/native-tabs/utils/icon.d.ts.map +1 -1
  142. package/build/native-tabs/utils/icon.js +3 -0
  143. package/build/native-tabs/utils/icon.js.map +1 -1
  144. package/build/navigationEvents/index.d.ts +7 -24
  145. package/build/navigationEvents/index.d.ts.map +1 -1
  146. package/build/navigationEvents/index.js +47 -12
  147. package/build/navigationEvents/index.js.map +1 -1
  148. package/build/navigationEvents/types.d.ts +23 -0
  149. package/build/navigationEvents/types.d.ts.map +1 -0
  150. package/build/navigationEvents/types.js +3 -0
  151. package/build/navigationEvents/types.js.map +1 -0
  152. package/build/navigationEvents/utils.d.ts +9 -0
  153. package/build/navigationEvents/utils.d.ts.map +1 -0
  154. package/build/navigationEvents/utils.js +25 -0
  155. package/build/navigationEvents/utils.js.map +1 -0
  156. package/build/primitives/types.d.ts +6 -6
  157. package/build/primitives/types.d.ts.map +1 -1
  158. package/build/primitives/types.js.map +1 -1
  159. package/build/screensFeatureFlags.d.ts +2 -0
  160. package/build/screensFeatureFlags.d.ts.map +1 -0
  161. package/build/screensFeatureFlags.js +20 -0
  162. package/build/screensFeatureFlags.js.map +1 -0
  163. package/build/split-view/elements.js +3 -3
  164. package/build/split-view/elements.js.map +1 -1
  165. package/build/split-view/index.d.ts +1 -1
  166. package/build/split-view/index.d.ts.map +1 -1
  167. package/build/split-view/index.js.map +1 -1
  168. package/build/split-view/split-view.d.ts +3 -3
  169. package/build/split-view/split-view.d.ts.map +1 -1
  170. package/build/split-view/split-view.js +4 -4
  171. package/build/split-view/split-view.js.map +1 -1
  172. package/build/toolbar/native.types.d.ts +0 -14
  173. package/build/toolbar/native.types.d.ts.map +1 -1
  174. package/build/toolbar/native.types.js.map +1 -1
  175. package/build/ui/TabRouter.d.ts +14 -2
  176. package/build/ui/TabRouter.d.ts.map +1 -1
  177. package/build/ui/TabRouter.js +34 -4
  178. package/build/ui/TabRouter.js.map +1 -1
  179. package/build/useScreens.d.ts.map +1 -1
  180. package/build/useScreens.js +30 -15
  181. package/build/useScreens.js.map +1 -1
  182. package/expo-module.config.json +1 -1
  183. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +18 -2
  184. package/ios/LinkPreview/LinkPreviewNativeModule.swift +3 -0
  185. package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +2 -2
  186. package/ios/LinkPreview/LinkZoomTransition.swift +2 -2
  187. package/ios/Toolbar/RouterToolbarHostView.swift +68 -43
  188. package/ios/Toolbar/RouterToolbarItemView.swift +89 -21
  189. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.module → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module} +7 -7
  190. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.md5 +1 -0
  191. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.sha1 +1 -0
  192. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.sha256 +1 -0
  193. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.module.sha512 +1 -0
  194. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.pom → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom} +1 -1
  195. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.md5 +1 -0
  196. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.sha1 +1 -0
  197. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.sha256 +1 -0
  198. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.pom.sha512 +1 -0
  199. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  200. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  201. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  202. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  203. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  204. package/package.json +11 -13
  205. package/plugin/build/index.js +1 -1
  206. package/plugin/options.json +5 -0
  207. package/plugin/src/index.ts +1 -1
  208. package/build/layouts/stack-utils/StackHeaderBackButton.d.ts +0 -14
  209. package/build/layouts/stack-utils/StackHeaderBackButton.d.ts.map +0 -1
  210. package/build/layouts/stack-utils/StackHeaderBackButton.js +0 -19
  211. package/build/layouts/stack-utils/StackHeaderBackButton.js.map +0 -1
  212. package/build/layouts/stack-utils/StackHeaderButton.d.ts +0 -114
  213. package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +0 -1
  214. package/build/layouts/stack-utils/StackHeaderButton.js +0 -49
  215. package/build/layouts/stack-utils/StackHeaderButton.js.map +0 -1
  216. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts +0 -119
  217. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +0 -1
  218. package/build/layouts/stack-utils/StackHeaderLeftRight.js +0 -206
  219. package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +0 -1
  220. package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +0 -1
  221. package/build/layouts/stack-utils/StackHeaderMenu.js +0 -214
  222. package/build/layouts/stack-utils/StackHeaderMenu.js.map +0 -1
  223. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +0 -46
  224. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +0 -1
  225. package/build/layouts/stack-utils/StackHeaderSpacer.js +0 -44
  226. package/build/layouts/stack-utils/StackHeaderSpacer.js.map +0 -1
  227. package/build/layouts/stack-utils/StackHeaderTitle.d.ts +0 -22
  228. package/build/layouts/stack-utils/StackHeaderTitle.d.ts.map +0 -1
  229. package/build/layouts/stack-utils/StackHeaderTitle.js +0 -36
  230. package/build/layouts/stack-utils/StackHeaderTitle.js.map +0 -1
  231. package/build/layouts/stack-utils/StackHeaderView.d.ts.map +0 -1
  232. package/build/layouts/stack-utils/StackHeaderView.js +0 -56
  233. package/build/layouts/stack-utils/StackHeaderView.js.map +0 -1
  234. package/build/toolbar/elements.d.ts +0 -417
  235. package/build/toolbar/elements.d.ts.map +0 -1
  236. package/build/toolbar/elements.js +0 -188
  237. package/build/toolbar/elements.js.map +0 -1
  238. package/build/toolbar/index.d.ts +0 -42
  239. package/build/toolbar/index.d.ts.map +0 -1
  240. package/build/toolbar/index.js +0 -49
  241. package/build/toolbar/index.js.map +0 -1
  242. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.module.md5 +0 -1
  243. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.module.sha1 +0 -1
  244. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.module.sha256 +0 -1
  245. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.module.sha512 +0 -1
  246. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.pom.md5 +0 -1
  247. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.pom.sha1 +0 -1
  248. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.pom.sha256 +0 -1
  249. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.pom.sha512 +0 -1
  250. package/unstable-toolbar.d.ts +0 -1
  251. package/unstable-toolbar.js +0 -1
  252. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5-sources.jar → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar} +0 -0
  253. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5-sources.jar.md5 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.md5} +0 -0
  254. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5-sources.jar.sha1 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.sha1} +0 -0
  255. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5-sources.jar.sha256 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.sha256} +0 -0
  256. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5-sources.jar.sha512 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700-sources.jar.sha512} +0 -0
  257. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.aar → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar} +0 -0
  258. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.aar.md5 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.md5} +0 -0
  259. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.aar.sha1 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.sha1} +0 -0
  260. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.aar.sha256 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.sha256} +0 -0
  261. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260114-d8e19f5/expo.modules.router-7.0.0-canary-20260114-d8e19f5.aar.sha512 → 7.0.0-canary-20260120-bb71700/expo.modules.router-7.0.0-canary-20260120-bb71700.aar.sha512} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarSpacer.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarSpacer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAKnF,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAQhE,CAAC;AAEF,wBAAgB,4CAA4C,CAC1D,KAAK,EAAE,uBAAuB,GAC7B,4BAA4B,GAAG,SAAS,CAqB1C"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.StackToolbarSpacer = void 0;
5
+ exports.convertStackToolbarSpacerPropsToRNHeaderItem = convertStackToolbarSpacerPropsToRNHeaderItem;
6
+ const bottom_toolbar_native_elements_1 = require("./bottom-toolbar-native-elements");
7
+ const context_1 = require("./context");
8
+ /**
9
+ * A spacing helper used inside `Stack.Toolbar` to create empty space between toolbar items.
10
+ *
11
+ * In left/right placements, width is required.
12
+ * In bottom placement, if width is not provided, creates a flexible spacer that expands to fill space.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * import { Stack } from 'expo-router';
17
+ *
18
+ * export default function Page() {
19
+ * return (
20
+ * <>
21
+ * <Stack.Toolbar placement="left">
22
+ * <Stack.Toolbar.Button icon="arrow.left" />
23
+ * <Stack.Toolbar.Spacer width={8} />
24
+ * <Stack.Toolbar.Button icon="arrow.right" />
25
+ * </Stack.Toolbar>
26
+ * <ScreenContent />
27
+ * </>
28
+ * );
29
+ * }
30
+ * ```
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * import { Stack } from 'expo-router';
35
+ *
36
+ * export default function Page() {
37
+ * return (
38
+ * <>
39
+ * <Stack.Toolbar>
40
+ * <Stack.Toolbar.Spacer />
41
+ * <Stack.Toolbar.Button icon="search" />
42
+ * <Stack.Toolbar.Spacer />
43
+ * </Stack.Toolbar>
44
+ * <ScreenContent />
45
+ * </>
46
+ * );
47
+ * }
48
+ * ```
49
+ *
50
+ * @platform ios
51
+ */
52
+ const StackToolbarSpacer = (props) => {
53
+ const placement = (0, context_1.useToolbarPlacement)();
54
+ if (placement === 'bottom') {
55
+ return <bottom_toolbar_native_elements_1.NativeToolbarSpacer {...props}/>;
56
+ }
57
+ return null;
58
+ };
59
+ exports.StackToolbarSpacer = StackToolbarSpacer;
60
+ function convertStackToolbarSpacerPropsToRNHeaderItem(props) {
61
+ const { hidden, width } = props;
62
+ if (hidden) {
63
+ return undefined;
64
+ }
65
+ // Warn if using flexible spacer in Left/Right placement
66
+ if (width === undefined) {
67
+ if (process.env.NODE_ENV !== 'production') {
68
+ console.warn('Stack.Toolbar.Spacer requires `width` when used in Left or Right placement. Flexible spacers are only supported in Bottom placement.');
69
+ }
70
+ return undefined;
71
+ }
72
+ return {
73
+ type: 'spacing',
74
+ spacing: width ?? 0,
75
+ };
76
+ }
77
+ //# sourceMappingURL=StackToolbarSpacer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarSpacer.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarSpacer.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA+Fb,oGAuBC;AAnHD,qFAAuE;AACvE,uCAAgD;AAqChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACI,MAAM,kBAAkB,GAAsC,CAAC,KAAK,EAAE,EAAE;IAC7E,MAAM,SAAS,GAAG,IAAA,6BAAmB,GAAE,CAAC;IAExC,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,oDAAmB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IAC5C,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B;AAEF,SAAgB,4CAA4C,CAC1D,KAA8B;IAE9B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEhC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,wDAAwD;IACxD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,OAAO,CAAC,IAAI,CACV,sIAAsI,CACvI,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK,IAAI,CAAC;KACpB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport type { NativeStackHeaderItemSpacing } from '@react-navigation/native-stack';\n\nimport { NativeToolbarSpacer } from './bottom-toolbar-native-elements';\nimport { useToolbarPlacement } from './context';\n\nexport interface StackToolbarSpacerProps {\n /**\n * Whether the spacer should be hidden.\n *\n * @default false\n */\n hidden?: boolean;\n // TODO(@ubax): implement fluid spacing in react-native-screens\n /**\n * The width of the spacing element.\n *\n * In Left/Right placements, width is required.\n * In Bottom placement, if width is not provided, the spacer will be flexible\n * and expand to fill available space.\n */\n width?: number;\n // TODO(@ubax): implement missing props in react-native-screens\n /**\n * Whether to hide the shared background.\n *\n * Only available in bottom placement.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n /**\n * Whether this spacer shares background with adjacent items.\n *\n * Only available in bottom placement.\n *\n * @platform iOS 26+\n */\n sharesBackground?: boolean;\n}\n\n/**\n * A spacing helper used inside `Stack.Toolbar` to create empty space between toolbar items.\n *\n * In left/right placements, width is required.\n * In bottom placement, if width is not provided, creates a flexible spacer that expands to fill space.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar placement=\"left\">\n * <Stack.Toolbar.Button icon=\"arrow.left\" />\n * <Stack.Toolbar.Spacer width={8} />\n * <Stack.Toolbar.Button icon=\"arrow.right\" />\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar>\n * <Stack.Toolbar.Spacer />\n * <Stack.Toolbar.Button icon=\"search\" />\n * <Stack.Toolbar.Spacer />\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const StackToolbarSpacer: React.FC<StackToolbarSpacerProps> = (props) => {\n const placement = useToolbarPlacement();\n\n if (placement === 'bottom') {\n return <NativeToolbarSpacer {...props} />;\n }\n\n return null;\n};\n\nexport function convertStackToolbarSpacerPropsToRNHeaderItem(\n props: StackToolbarSpacerProps\n): NativeStackHeaderItemSpacing | undefined {\n const { hidden, width } = props;\n\n if (hidden) {\n return undefined;\n }\n\n // Warn if using flexible spacer in Left/Right placement\n if (width === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Stack.Toolbar.Spacer requires `width` when used in Left or Right placement. Flexible spacers are only supported in Bottom placement.'\n );\n }\n return undefined;\n }\n\n return {\n type: 'spacing',\n spacing: width ?? 0,\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { NativeStackHeaderItemCustom } from '@react-navigation/native-stack';
2
- export interface StackHeaderViewProps {
2
+ export interface StackToolbarViewProps {
3
3
  /**
4
4
  * Can be any React node.
5
5
  */
@@ -18,34 +18,38 @@ export interface StackHeaderViewProps {
18
18
  * @platform iOS 26+
19
19
  */
20
20
  hidesSharedBackground?: boolean;
21
+ /**
22
+ * Whether to separate the background of this item from other items.
23
+ *
24
+ * Only available in bottom placement.
25
+ *
26
+ * @default false
27
+ */
28
+ separateBackground?: boolean;
21
29
  }
22
30
  /**
23
- * A wrapper to render custom content in the header.
31
+ * A wrapper to render custom content in the toolbar.
24
32
  *
25
- * Use as `Stack.Header.Item` to render a custom React element into the header
33
+ * Use inside `Stack.Toolbar` to render a custom React element.
26
34
  *
27
35
  * @example
28
36
  * ```tsx
29
37
  * import { Stack } from 'expo-router';
30
38
  * import { Text } from 'react-native';
31
39
  *
32
- * function CustomHeaderElement() {
40
+ * function CustomElement() {
33
41
  * return <Text>Custom Element</Text>;
34
42
  * }
35
43
  *
36
- * function Screen() {
44
+ * export default function Page() {
37
45
  * return (
38
46
  * <>
47
+ * <Stack.Toolbar>
48
+ * <Stack.Toolbar.View>
49
+ * <CustomElement />
50
+ * </Stack.Toolbar.View>
51
+ * </Stack.Toolbar>
39
52
  * <ScreenContent />
40
- * <Stack.Screen>
41
- * <Stack.Header>
42
- * <Stack.Header.Left>
43
- * <Stack.Header.Item>
44
- * <CustomHeaderElement />
45
- * </Stack.Header.Item>
46
- * </Stack.Header.Left>
47
- * </Stack.Header>
48
- * </Stack.Screen>
49
53
  * </>
50
54
  * );
51
55
  * }
@@ -53,6 +57,6 @@ export interface StackHeaderViewProps {
53
57
  *
54
58
  * @platform ios
55
59
  */
56
- export declare const StackHeaderView: React.FC<StackHeaderViewProps>;
57
- export declare function convertStackHeaderViewPropsToRNHeaderItem(props: StackHeaderViewProps): NativeStackHeaderItemCustom | undefined;
58
- //# sourceMappingURL=StackHeaderView.d.ts.map
60
+ export declare const StackToolbarView: React.FC<StackToolbarViewProps>;
61
+ export declare function convertStackToolbarViewPropsToRNHeaderItem(props: StackToolbarViewProps): NativeStackHeaderItemCustom | undefined;
62
+ //# sourceMappingURL=StackToolbarView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarView.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAKlF,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;IAClD;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAQ5D,CAAC;AAEF,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,qBAAqB,GAC3B,2BAA2B,GAAG,SAAS,CAgBzC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.StackToolbarView = void 0;
5
+ exports.convertStackToolbarViewPropsToRNHeaderItem = convertStackToolbarViewPropsToRNHeaderItem;
6
+ const bottom_toolbar_native_elements_1 = require("./bottom-toolbar-native-elements");
7
+ const context_1 = require("./context");
8
+ /**
9
+ * A wrapper to render custom content in the toolbar.
10
+ *
11
+ * Use inside `Stack.Toolbar` to render a custom React element.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { Stack } from 'expo-router';
16
+ * import { Text } from 'react-native';
17
+ *
18
+ * function CustomElement() {
19
+ * return <Text>Custom Element</Text>;
20
+ * }
21
+ *
22
+ * export default function Page() {
23
+ * return (
24
+ * <>
25
+ * <Stack.Toolbar>
26
+ * <Stack.Toolbar.View>
27
+ * <CustomElement />
28
+ * </Stack.Toolbar.View>
29
+ * </Stack.Toolbar>
30
+ * <ScreenContent />
31
+ * </>
32
+ * );
33
+ * }
34
+ * ```
35
+ *
36
+ * @platform ios
37
+ */
38
+ const StackToolbarView = (props) => {
39
+ const placement = (0, context_1.useToolbarPlacement)();
40
+ if (placement === 'bottom') {
41
+ return <bottom_toolbar_native_elements_1.NativeToolbarView {...props}>{props.children}</bottom_toolbar_native_elements_1.NativeToolbarView>;
42
+ }
43
+ return null;
44
+ };
45
+ exports.StackToolbarView = StackToolbarView;
46
+ function convertStackToolbarViewPropsToRNHeaderItem(props) {
47
+ if (props.hidden) {
48
+ return undefined;
49
+ }
50
+ const { children, hidesSharedBackground } = props;
51
+ if (!children) {
52
+ console.warn('Stack.Toolbar.View requires a child element to render custom content in the toolbar.');
53
+ }
54
+ const element = children ? children : <></>;
55
+ return {
56
+ type: 'custom',
57
+ element,
58
+ hidesSharedBackground,
59
+ };
60
+ }
61
+ //# sourceMappingURL=StackToolbarView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarView.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarView.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA4Eb,gGAkBC;AA3FD,qFAAqE;AACrE,uCAAgD;AAgChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACI,MAAM,gBAAgB,GAAoC,CAAC,KAAK,EAAE,EAAE;IACzE,MAAM,SAAS,GAAG,IAAA,6BAAmB,GAAE,CAAC;IAExC,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,CAAC,kDAAiB,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,kDAAiB,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AARW,QAAA,gBAAgB,oBAQ3B;AAEF,SAAgB,0CAA0C,CACxD,KAA4B;IAE5B,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC;IAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CACV,sFAAsF,CACvF,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IAC5C,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,qBAAqB;KACtB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport type { NativeStackHeaderItemCustom } from '@react-navigation/native-stack';\n\nimport { NativeToolbarView } from './bottom-toolbar-native-elements';\nimport { useToolbarPlacement } from './context';\n\nexport interface StackToolbarViewProps {\n /**\n * Can be any React node.\n */\n children?: NativeStackHeaderItemCustom['element'];\n /**\n * Whether the view should be hidden.\n *\n * @default false\n */\n hidden?: boolean;\n /**\n * Whether to hide the shared background.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n // TODO(@ubax): implement missing props in react-native-screens\n /**\n * Whether to separate the background of this item from other items.\n *\n * Only available in bottom placement.\n *\n * @default false\n */\n separateBackground?: boolean;\n}\n\n/**\n * A wrapper to render custom content in the toolbar.\n *\n * Use inside `Stack.Toolbar` to render a custom React element.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n * import { Text } from 'react-native';\n *\n * function CustomElement() {\n * return <Text>Custom Element</Text>;\n * }\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar>\n * <Stack.Toolbar.View>\n * <CustomElement />\n * </Stack.Toolbar.View>\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const StackToolbarView: React.FC<StackToolbarViewProps> = (props) => {\n const placement = useToolbarPlacement();\n\n if (placement === 'bottom') {\n return <NativeToolbarView {...props}>{props.children}</NativeToolbarView>;\n }\n\n return null;\n};\n\nexport function convertStackToolbarViewPropsToRNHeaderItem(\n props: StackToolbarViewProps\n): NativeStackHeaderItemCustom | undefined {\n if (props.hidden) {\n return undefined;\n }\n const { children, hidesSharedBackground } = props;\n if (!children) {\n console.warn(\n 'Stack.Toolbar.View requires a child element to render custom content in the toolbar.'\n );\n }\n const element = children ? children : <></>;\n return {\n type: 'custom',\n element,\n hidesSharedBackground,\n };\n}\n"]}
@@ -0,0 +1,93 @@
1
+ import type { ImageRef } from 'expo-image';
2
+ import { type ReactNode } from 'react';
3
+ import { type ColorValue, type ImageSourcePropType, type StyleProp, type TextStyle } from 'react-native';
4
+ import type { SFSymbol } from 'sf-symbols-typescript';
5
+ import { LinkMenuAction } from '../../../link/elements';
6
+ import type { BasicTextStyle } from '../../../utils/font';
7
+ export interface NativeToolbarMenuProps {
8
+ accessibilityLabel?: string;
9
+ accessibilityHint?: string;
10
+ children?: ReactNode;
11
+ subtitle?: string;
12
+ destructive?: boolean;
13
+ disabled?: boolean;
14
+ hidden?: boolean;
15
+ hidesSharedBackground?: boolean;
16
+ icon?: SFSymbol | ImageSourcePropType;
17
+ /**
18
+ * Image to display for the menu item.
19
+ */
20
+ image?: ImageRef;
21
+ inline?: boolean;
22
+ palette?: boolean;
23
+ separateBackground?: boolean;
24
+ style?: StyleProp<TextStyle>;
25
+ title?: string;
26
+ tintColor?: ColorValue;
27
+ variant?: 'plain' | 'done' | 'prominent';
28
+ elementSize?: 'auto' | 'small' | 'medium' | 'large';
29
+ }
30
+ /**
31
+ * Native toolbar menu component for bottom toolbar.
32
+ * Renders as NativeLinkPreviewAction.
33
+ */
34
+ export declare const NativeToolbarMenu: React.FC<NativeToolbarMenuProps>;
35
+ /**
36
+ * Native toolbar menu action - reuses LinkMenuAction.
37
+ */
38
+ export declare const NativeToolbarMenuAction: typeof LinkMenuAction;
39
+ export interface NativeToolbarButtonProps {
40
+ accessibilityLabel?: string;
41
+ accessibilityHint?: string;
42
+ children?: ReactNode;
43
+ disabled?: boolean;
44
+ hidden?: boolean;
45
+ hidesSharedBackground?: boolean;
46
+ icon?: SFSymbol;
47
+ image?: ImageRef;
48
+ onPress?: () => void;
49
+ possibleTitles?: string[];
50
+ selected?: boolean;
51
+ separateBackground?: boolean;
52
+ style?: StyleProp<BasicTextStyle>;
53
+ tintColor?: ColorValue;
54
+ variant?: 'plain' | 'done' | 'prominent';
55
+ }
56
+ /**
57
+ * Native toolbar button component for bottom toolbar.
58
+ * Renders as RouterToolbarItem.
59
+ */
60
+ export declare const NativeToolbarButton: React.FC<NativeToolbarButtonProps>;
61
+ export interface NativeToolbarSpacerProps {
62
+ hidden?: boolean;
63
+ hidesSharedBackground?: boolean;
64
+ sharesBackground?: boolean;
65
+ width?: number;
66
+ }
67
+ /**
68
+ * Native toolbar spacer component for bottom toolbar.
69
+ * Renders as RouterToolbarItem with type 'fixedSpacer' or 'fluidSpacer'.
70
+ */
71
+ export declare const NativeToolbarSpacer: React.FC<NativeToolbarSpacerProps>;
72
+ export interface NativeToolbarSearchBarSlotProps {
73
+ hidesSharedBackground?: boolean;
74
+ hidden?: boolean;
75
+ sharesBackground?: boolean;
76
+ }
77
+ /**
78
+ * Native toolbar search bar slot for bottom toolbar (iOS 26+).
79
+ * Renders as RouterToolbarItem with type 'searchBar'.
80
+ */
81
+ export declare const NativeToolbarSearchBarSlot: React.FC<NativeToolbarSearchBarSlotProps>;
82
+ export interface NativeToolbarViewProps {
83
+ children?: ReactNode;
84
+ hidden?: boolean;
85
+ hidesSharedBackground?: boolean;
86
+ separateBackground?: boolean;
87
+ }
88
+ /**
89
+ * Native toolbar view component for bottom toolbar.
90
+ * Renders as RouterToolbarItem with children.
91
+ */
92
+ export declare const NativeToolbarView: React.FC<NativeToolbarViewProps>;
93
+ //# sourceMappingURL=bottom-toolbar-native-elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bottom-toolbar-native-elements.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,IAAI,CAAC,EAAE,QAAQ,GAAG,mBAAmB,CAAC;IAEtC;;OAEG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O,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgClE,CAAC;AAMF,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAYlE,CAAC;AAMF,MAAM,WAAW,+BAA+B;IAC9C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAoBhF,CAAC;AAMF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAgB9D,CAAC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.NativeToolbarView = exports.NativeToolbarSearchBarSlot = exports.NativeToolbarSpacer = exports.NativeToolbarButton = exports.NativeToolbarMenuAction = exports.NativeToolbarMenu = void 0;
5
+ const react_1 = require("react");
6
+ const react_native_1 = require("react-native");
7
+ const elements_1 = require("../../../link/elements");
8
+ const native_1 = require("../../../link/preview/native");
9
+ const primitives_1 = require("../../../primitives");
10
+ const native_2 = require("../../../toolbar/native");
11
+ const children_1 = require("../../../utils/children");
12
+ /**
13
+ * Native toolbar menu component for bottom toolbar.
14
+ * Renders as NativeLinkPreviewAction.
15
+ */
16
+ const NativeToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, destructive, children, icon, image, tintColor, variant, style, elementSize, }) => {
17
+ const identifier = (0, react_1.useId)();
18
+ const label = (0, children_1.getFirstChildOfType)(children, primitives_1.Label);
19
+ const iconComponent = (0, children_1.getFirstChildOfType)(children, primitives_1.Icon);
20
+ const computedTitle = title ?? label?.props.children ?? '';
21
+ const computedIcon = icon ??
22
+ (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);
23
+ const sf = typeof computedIcon === 'string' ? computedIcon : undefined;
24
+ const titleStyle = react_native_1.StyleSheet.flatten(style);
25
+ return (<native_1.NativeLinkPreviewAction sharesBackground={!separateBackground} hidesSharedBackground={hidesSharedBackground} hidden={hidden} icon={sf}
26
+ // TODO(@ubax): Handle image loading using useImage in a follow-up PR.
27
+ image={image} destructive={destructive} subtitle={subtitle} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} displayAsPalette={palette} displayInline={inline} preferredElementSize={elementSize} tintColor={tintColor} titleStyle={titleStyle} barButtonItemStyle={variant === 'done' ? 'prominent' : variant} title={computedTitle} onSelected={() => { }} children={children} identifier={identifier}/>);
28
+ };
29
+ exports.NativeToolbarMenu = NativeToolbarMenu;
30
+ // #endregion
31
+ // #region NativeToolbarMenuAction
32
+ /**
33
+ * Native toolbar menu action - reuses LinkMenuAction.
34
+ */
35
+ exports.NativeToolbarMenuAction = elements_1.LinkMenuAction;
36
+ /**
37
+ * Native toolbar button component for bottom toolbar.
38
+ * Renders as RouterToolbarItem.
39
+ */
40
+ const NativeToolbarButton = (props) => {
41
+ const id = (0, react_1.useId)();
42
+ const areChildrenString = typeof props.children === 'string';
43
+ const label = areChildrenString
44
+ ? props.children
45
+ : (0, children_1.getFirstChildOfType)(props.children, primitives_1.Label)?.props.children;
46
+ const iconComponent = !props.icon && !areChildrenString ? (0, children_1.getFirstChildOfType)(props.children, primitives_1.Icon) : undefined;
47
+ const icon = props.icon ??
48
+ (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);
49
+ const sf = typeof icon === 'string' ? icon : undefined;
50
+ return (<native_2.RouterToolbarItem accessibilityHint={props.accessibilityHint} accessibilityLabel={props.accessibilityLabel} barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant} disabled={props.disabled} hidden={props.hidden} hidesSharedBackground={props.hidesSharedBackground} identifier={id} image={props.image} onSelected={props.onPress} possibleTitles={props.possibleTitles} selected={props.selected} sharesBackground={!props.separateBackground} systemImageName={sf} title={label} tintColor={props.tintColor} titleStyle={react_native_1.StyleSheet.flatten(props.style)}/>);
51
+ };
52
+ exports.NativeToolbarButton = NativeToolbarButton;
53
+ /**
54
+ * Native toolbar spacer component for bottom toolbar.
55
+ * Renders as RouterToolbarItem with type 'fixedSpacer' or 'fluidSpacer'.
56
+ */
57
+ const NativeToolbarSpacer = (props) => {
58
+ const id = (0, react_1.useId)();
59
+ return (<native_2.RouterToolbarItem hidesSharedBackground={props.hidesSharedBackground} hidden={props.hidden} identifier={id} sharesBackground={props.sharesBackground} type={props.width ? 'fixedSpacer' : 'fluidSpacer'} width={props.width}/>);
60
+ };
61
+ exports.NativeToolbarSpacer = NativeToolbarSpacer;
62
+ /**
63
+ * Native toolbar search bar slot for bottom toolbar (iOS 26+).
64
+ * Renders as RouterToolbarItem with type 'searchBar'.
65
+ */
66
+ const NativeToolbarSearchBarSlot = ({ hidesSharedBackground, hidden, sharesBackground, }) => {
67
+ const id = (0, react_1.useId)();
68
+ if (process.env.EXPO_OS !== 'ios' || parseInt(String(react_native_1.Platform.Version).split('.')[0], 10) < 26) {
69
+ return null;
70
+ }
71
+ if (hidden) {
72
+ return null;
73
+ }
74
+ return (<native_2.RouterToolbarItem hidesSharedBackground={hidesSharedBackground} identifier={id} sharesBackground={sharesBackground} type="searchBar"/>);
75
+ };
76
+ exports.NativeToolbarSearchBarSlot = NativeToolbarSearchBarSlot;
77
+ /**
78
+ * Native toolbar view component for bottom toolbar.
79
+ * Renders as RouterToolbarItem with children.
80
+ */
81
+ const NativeToolbarView = ({ children, hidden, hidesSharedBackground, separateBackground, }) => {
82
+ const id = (0, react_1.useId)();
83
+ return (<native_2.RouterToolbarItem hidesSharedBackground={hidesSharedBackground} hidden={hidden} identifier={id} sharesBackground={!separateBackground}>
84
+ {children}
85
+ </native_2.RouterToolbarItem>);
86
+ };
87
+ exports.NativeToolbarView = NativeToolbarView;
88
+ // #endregion
89
+ //# sourceMappingURL=bottom-toolbar-native-elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bottom-toolbar-native-elements.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,iCAA8C;AAC9C,+CAOsB;AAGtB,qDAAwD;AACxD,yDAAuE;AACvE,oDAAkD;AAClD,oDAA4D;AAC5D,sDAA8D;AA8B9D;;;GAGG;AACI,MAAM,iBAAiB,GAAqC,CAAC,EAClE,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,IAAA,8BAAmB,EAAC,QAAQ,EAAE,kBAAK,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,IAAA,8BAAmB,EAAC,QAAQ,EAAE,iBAAI,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,KAAK,IAAI,KAAK,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC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} from 'react';\nimport {\n Platform,\n StyleSheet,\n type ColorValue,\n type ImageSourcePropType,\n type StyleProp,\n type TextStyle,\n} from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { LinkMenuAction } from '../../../link/elements';\nimport { NativeLinkPreviewAction } from '../../../link/preview/native';\nimport { Label, Icon } from '../../../primitives';\nimport { RouterToolbarItem } from '../../../toolbar/native';\nimport { getFirstChildOfType } from '../../../utils/children';\nimport type { BasicTextStyle } from '../../../utils/font';\n\n// #region NativeToolbarMenu\n\nexport interface NativeToolbarMenuProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n children?: ReactNode;\n subtitle?: string;\n destructive?: boolean;\n disabled?: boolean;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n icon?: SFSymbol | ImageSourcePropType;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu item.\n */\n image?: ImageRef;\n inline?: boolean;\n palette?: boolean;\n separateBackground?: boolean;\n style?: StyleProp<TextStyle>;\n title?: string;\n tintColor?: ColorValue;\n variant?: 'plain' | 'done' | 'prominent';\n elementSize?: 'auto' | 'small' | 'medium' | 'large';\n}\n\n/**\n * Native toolbar menu component for bottom toolbar.\n * Renders as NativeLinkPreviewAction.\n */\nexport const NativeToolbarMenu: React.FC<NativeToolbarMenuProps> = ({\n accessibilityHint,\n accessibilityLabel,\n separateBackground,\n hidesSharedBackground,\n palette,\n inline,\n hidden,\n subtitle,\n title,\n destructive,\n children,\n icon,\n image,\n tintColor,\n variant,\n style,\n elementSize,\n}) => {\n const identifier = useId();\n const label = getFirstChildOfType(children, Label);\n const iconComponent = getFirstChildOfType(children, Icon);\n\n const computedTitle = title ?? label?.props.children ?? '';\n const computedIcon =\n icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof computedIcon === 'string' ? computedIcon : undefined;\n const titleStyle = StyleSheet.flatten(style);\n return (\n <NativeLinkPreviewAction\n sharesBackground={!separateBackground}\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n icon={sf}\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n image={image}\n destructive={destructive}\n subtitle={subtitle}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n displayAsPalette={palette}\n displayInline={inline}\n preferredElementSize={elementSize}\n tintColor={tintColor}\n titleStyle={titleStyle}\n barButtonItemStyle={variant === 'done' ? 'prominent' : variant}\n title={computedTitle}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarMenuAction\n\n/**\n * Native toolbar menu action - reuses LinkMenuAction.\n */\nexport const NativeToolbarMenuAction = LinkMenuAction;\n\n// #endregion\n\n// #region NativeToolbarButton\n\nexport interface NativeToolbarButtonProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n children?: ReactNode;\n disabled?: boolean;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n icon?: SFSymbol;\n image?: ImageRef;\n onPress?: () => void;\n possibleTitles?: string[];\n selected?: boolean;\n separateBackground?: boolean;\n style?: StyleProp<BasicTextStyle>;\n tintColor?: ColorValue;\n variant?: 'plain' | 'done' | 'prominent';\n}\n\n/**\n * Native toolbar button component for bottom toolbar.\n * Renders as RouterToolbarItem.\n */\nexport const NativeToolbarButton: React.FC<NativeToolbarButtonProps> = (props) => {\n const id = useId();\n const areChildrenString = typeof props.children === 'string';\n const label = areChildrenString\n ? (props.children as string)\n : getFirstChildOfType(props.children, Label)?.props.children;\n const iconComponent =\n !props.icon && !areChildrenString ? getFirstChildOfType(props.children, Icon) : undefined;\n const icon =\n props.icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof icon === 'string' ? icon : undefined;\n return (\n <RouterToolbarItem\n accessibilityHint={props.accessibilityHint}\n accessibilityLabel={props.accessibilityLabel}\n barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant}\n disabled={props.disabled}\n hidden={props.hidden}\n hidesSharedBackground={props.hidesSharedBackground}\n identifier={id}\n image={props.image}\n onSelected={props.onPress}\n possibleTitles={props.possibleTitles}\n selected={props.selected}\n sharesBackground={!props.separateBackground}\n systemImageName={sf}\n title={label}\n tintColor={props.tintColor}\n titleStyle={StyleSheet.flatten(props.style)}\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarSpacer\n\nexport interface NativeToolbarSpacerProps {\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n sharesBackground?: boolean;\n width?: number;\n}\n\n/**\n * Native toolbar spacer component for bottom toolbar.\n * Renders as RouterToolbarItem with type 'fixedSpacer' or 'fluidSpacer'.\n */\nexport const NativeToolbarSpacer: React.FC<NativeToolbarSpacerProps> = (props) => {\n const id = useId();\n return (\n <RouterToolbarItem\n hidesSharedBackground={props.hidesSharedBackground}\n hidden={props.hidden}\n identifier={id}\n sharesBackground={props.sharesBackground}\n type={props.width ? 'fixedSpacer' : 'fluidSpacer'}\n width={props.width}\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarSearchBarSlot\n\nexport interface NativeToolbarSearchBarSlotProps {\n hidesSharedBackground?: boolean;\n hidden?: boolean;\n sharesBackground?: boolean;\n}\n\n/**\n * Native toolbar search bar slot for bottom toolbar (iOS 26+).\n * Renders as RouterToolbarItem with type 'searchBar'.\n */\nexport const NativeToolbarSearchBarSlot: React.FC<NativeToolbarSearchBarSlotProps> = ({\n hidesSharedBackground,\n hidden,\n sharesBackground,\n}) => {\n const id = useId();\n if (process.env.EXPO_OS !== 'ios' || parseInt(String(Platform.Version).split('.')[0], 10) < 26) {\n return null;\n }\n if (hidden) {\n return null;\n }\n return (\n <RouterToolbarItem\n hidesSharedBackground={hidesSharedBackground}\n identifier={id}\n sharesBackground={sharesBackground}\n type=\"searchBar\"\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarView\n\nexport interface NativeToolbarViewProps {\n children?: ReactNode;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n separateBackground?: boolean;\n}\n\n/**\n * Native toolbar view component for bottom toolbar.\n * Renders as RouterToolbarItem with children.\n */\nexport const NativeToolbarView: React.FC<NativeToolbarViewProps> = ({\n children,\n hidden,\n hidesSharedBackground,\n separateBackground,\n}) => {\n const id = useId();\n return (\n <RouterToolbarItem\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n identifier={id}\n sharesBackground={!separateBackground}>\n {children}\n </RouterToolbarItem>\n );\n};\n\n// #endregion\n"]}
@@ -0,0 +1,9 @@
1
+ export type ToolbarPlacement = 'left' | 'right' | 'bottom';
2
+ /**
3
+ * Context to track which toolbar placement the current component is in.
4
+ * This allows shared components (Button, Menu, Spacer, etc.) to behave
5
+ * differently based on their placement.
6
+ */
7
+ export declare const ToolbarPlacementContext: import("react").Context<ToolbarPlacement | null>;
8
+ export declare function useToolbarPlacement(): ToolbarPlacement | null;
9
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/context.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,kDAA+C,CAAC;AAEpF,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAE7D"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ToolbarPlacementContext = void 0;
5
+ exports.useToolbarPlacement = useToolbarPlacement;
6
+ const react_1 = require("react");
7
+ /**
8
+ * Context to track which toolbar placement the current component is in.
9
+ * This allows shared components (Button, Menu, Spacer, etc.) to behave
10
+ * differently based on their placement.
11
+ */
12
+ exports.ToolbarPlacementContext = (0, react_1.createContext)(null);
13
+ function useToolbarPlacement() {
14
+ return (0, react_1.useContext)(exports.ToolbarPlacementContext);
15
+ }
16
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/context.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAYb,kDAEC;AAbD,iCAAkD;AAIlD;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAA0B,IAAI,CAAC,CAAC;AAEpF,SAAgB,mBAAmB;IACjC,OAAO,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["'use client';\nimport { createContext, useContext } from 'react';\n\nexport type ToolbarPlacement = 'left' | 'right' | 'bottom';\n\n/**\n * Context to track which toolbar placement the current component is in.\n * This allows shared components (Button, Menu, Spacer, etc.) to behave\n * differently based on their placement.\n */\nexport const ToolbarPlacementContext = createContext<ToolbarPlacement | null>(null);\n\nexport function useToolbarPlacement(): ToolbarPlacement | null {\n return useContext(ToolbarPlacementContext);\n}\n"]}
@@ -0,0 +1,10 @@
1
+ export { StackToolbarBadge, StackToolbarIcon, StackToolbarLabel, type StackToolbarBadgeProps, type StackToolbarIconProps, type StackToolbarLabelProps, } from '../common-primitives';
2
+ export { StackToolbar } from './StackToolbar';
3
+ export { appendStackToolbarPropsToOptions, type StackToolbarProps } from './StackToolbarClient';
4
+ export { StackToolbarButton, type StackToolbarButtonProps } from './StackToolbarButton';
5
+ export { StackToolbarMenu, StackToolbarMenuAction, type StackToolbarMenuProps, type StackToolbarMenuActionProps, } from './StackToolbarMenu';
6
+ export { StackToolbarSearchBarSlot, type StackToolbarSearchBarSlotProps, } from './StackToolbarSearchBarSlot';
7
+ export { StackToolbarSpacer, type StackToolbarSpacerProps } from './StackToolbarSpacer';
8
+ export { StackToolbarView, type StackToolbarViewProps } from './StackToolbarView';
9
+ export type { ToolbarPlacement } from './context';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,gCAAgC,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEhG,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,GACjC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAElF,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StackToolbarView = exports.StackToolbarSpacer = exports.StackToolbarSearchBarSlot = exports.StackToolbarMenuAction = exports.StackToolbarMenu = exports.StackToolbarButton = exports.appendStackToolbarPropsToOptions = exports.StackToolbar = exports.StackToolbarLabel = exports.StackToolbarIcon = exports.StackToolbarBadge = void 0;
4
+ var common_primitives_1 = require("../common-primitives");
5
+ Object.defineProperty(exports, "StackToolbarBadge", { enumerable: true, get: function () { return common_primitives_1.StackToolbarBadge; } });
6
+ Object.defineProperty(exports, "StackToolbarIcon", { enumerable: true, get: function () { return common_primitives_1.StackToolbarIcon; } });
7
+ Object.defineProperty(exports, "StackToolbarLabel", { enumerable: true, get: function () { return common_primitives_1.StackToolbarLabel; } });
8
+ var StackToolbar_1 = require("./StackToolbar");
9
+ Object.defineProperty(exports, "StackToolbar", { enumerable: true, get: function () { return StackToolbar_1.StackToolbar; } });
10
+ var StackToolbarClient_1 = require("./StackToolbarClient");
11
+ Object.defineProperty(exports, "appendStackToolbarPropsToOptions", { enumerable: true, get: function () { return StackToolbarClient_1.appendStackToolbarPropsToOptions; } });
12
+ var StackToolbarButton_1 = require("./StackToolbarButton");
13
+ Object.defineProperty(exports, "StackToolbarButton", { enumerable: true, get: function () { return StackToolbarButton_1.StackToolbarButton; } });
14
+ var StackToolbarMenu_1 = require("./StackToolbarMenu");
15
+ Object.defineProperty(exports, "StackToolbarMenu", { enumerable: true, get: function () { return StackToolbarMenu_1.StackToolbarMenu; } });
16
+ Object.defineProperty(exports, "StackToolbarMenuAction", { enumerable: true, get: function () { return StackToolbarMenu_1.StackToolbarMenuAction; } });
17
+ var StackToolbarSearchBarSlot_1 = require("./StackToolbarSearchBarSlot");
18
+ Object.defineProperty(exports, "StackToolbarSearchBarSlot", { enumerable: true, get: function () { return StackToolbarSearchBarSlot_1.StackToolbarSearchBarSlot; } });
19
+ var StackToolbarSpacer_1 = require("./StackToolbarSpacer");
20
+ Object.defineProperty(exports, "StackToolbarSpacer", { enumerable: true, get: function () { return StackToolbarSpacer_1.StackToolbarSpacer; } });
21
+ var StackToolbarView_1 = require("./StackToolbarView");
22
+ Object.defineProperty(exports, "StackToolbarView", { enumerable: true, get: function () { return StackToolbarView_1.StackToolbarView; } });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/index.tsx"],"names":[],"mappings":";;;AAAA,0DAO8B;AAN5B,sHAAA,iBAAiB,OAAA;AACjB,qHAAA,gBAAgB,OAAA;AAChB,sHAAA,iBAAiB,OAAA;AAMnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAErB,2DAAgG;AAAvF,sIAAA,gCAAgC,OAAA;AAEzC,2DAAwF;AAA/E,wHAAA,kBAAkB,OAAA;AAE3B,uDAK4B;AAJ1B,oHAAA,gBAAgB,OAAA;AAChB,0HAAA,sBAAsB,OAAA;AAKxB,yEAGqC;AAFnC,sIAAA,yBAAyB,OAAA;AAI3B,2DAAwF;AAA/E,wHAAA,kBAAkB,OAAA;AAE3B,uDAAkF;AAAzE,oHAAA,gBAAgB,OAAA","sourcesContent":["export {\n StackToolbarBadge,\n StackToolbarIcon,\n StackToolbarLabel,\n type StackToolbarBadgeProps,\n type StackToolbarIconProps,\n type StackToolbarLabelProps,\n} from '../common-primitives';\n\nexport { StackToolbar } from './StackToolbar';\n\nexport { appendStackToolbarPropsToOptions, type StackToolbarProps } from './StackToolbarClient';\n\nexport { StackToolbarButton, type StackToolbarButtonProps } from './StackToolbarButton';\n\nexport {\n StackToolbarMenu,\n StackToolbarMenuAction,\n type StackToolbarMenuProps,\n type StackToolbarMenuActionProps,\n} from './StackToolbarMenu';\n\nexport {\n StackToolbarSearchBarSlot,\n type StackToolbarSearchBarSlotProps,\n} from './StackToolbarSearchBarSlot';\n\nexport { StackToolbarSpacer, type StackToolbarSpacerProps } from './StackToolbarSpacer';\n\nexport { StackToolbarView, type StackToolbarViewProps } from './StackToolbarView';\n\nexport type { ToolbarPlacement } from './context';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAQpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAM3C,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,wBAAwB,EAAE,IAAI,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,oBAAoB,qBAyH1E"}
1
+ {"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAM3C,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,wBAAwB,EAAE,IAAI,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,oBAAoB,qBA2H1E"}
@@ -40,6 +40,7 @@ const react_native_1 = require("react-native");
40
40
  const hooks_1 = require("../hooks");
41
41
  const BaseExpoRouterLink_1 = require("./BaseExpoRouterLink");
42
42
  const InternalLinkPreviewContext_1 = require("./InternalLinkPreviewContext");
43
+ const NativeMenuContext_1 = require("./NativeMenuContext");
43
44
  const elements_1 = require("./elements");
44
45
  const href_1 = require("./href");
45
46
  const LinkPreviewContext_1 = require("./preview/LinkPreviewContext");
@@ -121,11 +122,13 @@ function LinkWithPreview({ children, ...rest }) {
121
122
  router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });
122
123
  }
123
124
  }} style={{ display: 'contents' }} disableForceFlatten>
124
- <InternalLinkPreviewContext_1.InternalLinkPreviewContext value={{ isVisible: isCurrentPreviewOpen, href: rest.hrefForPreviewNavigation }}>
125
- <BaseExpoRouterLink_1.BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref}/>
126
- {preview}
127
- {menuElement}
128
- </InternalLinkPreviewContext_1.InternalLinkPreviewContext>
125
+ <NativeMenuContext_1.NativeMenuContext value>
126
+ <InternalLinkPreviewContext_1.InternalLinkPreviewContext value={{ isVisible: isCurrentPreviewOpen, href: rest.hrefForPreviewNavigation }}>
127
+ <BaseExpoRouterLink_1.BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref}/>
128
+ {preview}
129
+ {menuElement}
130
+ </InternalLinkPreviewContext_1.InternalLinkPreviewContext>
131
+ </NativeMenuContext_1.NativeMenuContext>
129
132
  </native_1.NativeLinkPreview>);
130
133
  }
131
134
  //# sourceMappingURL=LinkWithPreview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBb,0CAyHC;AA/ID,+CAAoE;AACpE,+CAAwC;AAExC,oCAAqC;AACrC,6DAA0D;AAC1D,6EAA0E;AAC1E,yCAAgE;AAChE,iCAAqC;AAErC,qEAAqE;AACrE,6CAAqD;AACrD,+DAA4D;AAE5D,gDAAwD;AACxD,sCAAoD;AAEpD,MAAM,KAAK,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,uBAAQ,CAAC,KAAK,CAAC;AAMtD,SAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAwB;IACzE,MAAM,MAAM,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC3B,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,0CAAqB,GAAE,CAAC;IACtD,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEvE,MAAM,gBAAgB,GAAG,IAAA,kBAAW,EAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,oBAAoB,GAAG,IAAA,cAAM,EAAC,gBAAgB,CAAC,CAAC;IAEtD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,oBAAoB,EAAE,CAAC;YACzB,IAAI,oBAAoB,CAAC,OAAO,KAAK,gBAAgB,EAAE,CAAC;gBACtD,MA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IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC/D;QAAA,CAAC,OAAO,CACR;QAAA,CAAC,WAAW,CACd;MAAA,EAAE,uDAA0B,CAC9B;IAAA,EAAE,0BAAiB,CAAC,CACrB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport { useRouter } from '../hooks';\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { LinkMenu, LinkPreview, LinkTrigger } from './elements';\nimport { resolveHref } from './href';\nimport type { Href } from '../types';\nimport { useLinkPreviewContext } from './preview/LinkPreviewContext';\nimport { NativeLinkPreview } from './preview/native';\nimport { useNextScreenId } from './preview/useNextScreenId';\nimport { LinkProps } from './useLinkHooks';\nimport { getFirstChildOfType } from '../utils/children';\nimport { shouldLinkExternally } from '../utils/url';\n\nconst isPad = Platform.OS === 'ios' && Platform.isPad;\n\ninterface LinkWithPreviewProps extends LinkProps {\n hrefForPreviewNavigation: Href;\n}\n\nexport function LinkWithPreview({ children, ...rest }: LinkWithPreviewProps) {\n const router = useRouter();\n const { setOpenPreviewKey } = useLinkPreviewContext();\n const [isCurrentPreviewOpen, setIsCurrenPreviewOpen] = useState(false);\n\n const hrefWithoutQuery = resolveHref(rest.hrefForPreviewNavigation).split('?')[0];\n const prevHrefWithoutQuery = useRef(hrefWithoutQuery);\n\n useEffect(() => {\n if (isCurrentPreviewOpen) {\n if (prevHrefWithoutQuery.current !== hrefWithoutQuery) {\n throw new Error(\n 'Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.'\n );\n }\n } else {\n prevHrefWithoutQuery.current = hrefWithoutQuery;\n }\n }, [hrefWithoutQuery]);\n\n const [{ nextScreenId, tabPath }, prefetch] = useNextScreenId();\n\n useEffect(() => {\n if (rest.replace) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Using replace links with preview is not supported');\n } else {\n console.warn('Using replace links with preview is not supported');\n }\n }\n }, [rest.href, rest.replace]);\n\n const triggerElement = React.useMemo(\n () => getFirstChildOfType(children, LinkTrigger),\n [children]\n );\n const menuElement = React.useMemo(() => getFirstChildOfType(children, LinkMenu), [children]);\n const previewElement = React.useMemo(\n () => getFirstChildOfType(children, LinkPreview),\n [children]\n );\n\n if ((previewElement || menuElement) && !triggerElement) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n } else {\n console.warn(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n }\n }\n\n const trigger = React.useMemo(\n () => triggerElement ?? <LinkTrigger>{children}</LinkTrigger>,\n [triggerElement, children]\n );\n\n const preview = React.useMemo(\n () => (shouldLinkExternally(String(rest.href)) || !previewElement ? null : previewElement),\n [previewElement, rest.href]\n );\n\n const isPreviewTapped = useRef(false);\n\n const tabPathValue = useMemo(\n () => ({\n path: tabPath,\n }),\n [tabPath]\n );\n\n const hasPreview = !!previewElement;\n\n if (rest.replace) {\n return <BaseExpoRouterLink children={children} {...rest} />;\n }\n\n return (\n <NativeLinkPreview\n nextScreenId={isPad ? undefined : nextScreenId}\n tabPath={isPad ? undefined : tabPathValue}\n onWillPreviewOpen={() => {\n if (hasPreview) {\n isPreviewTapped.current = false;\n prefetch(rest.hrefForPreviewNavigation);\n setIsCurrenPreviewOpen(true);\n }\n }}\n onPreviewWillClose={() => {\n if (hasPreview) {\n setIsCurrenPreviewOpen(false);\n // When preview was not tapped, then we need to enable the screen stack animation\n // Otherwise this will happen in StackNavigator, when new screen is opened\n if (!isPreviewTapped.current || isPad) {\n setOpenPreviewKey(undefined);\n }\n }\n }}\n onPreviewDidClose={() => {\n if (hasPreview && isPreviewTapped.current && isPad) {\n router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });\n }\n }}\n onPreviewTapped={() => {\n isPreviewTapped.current = true;\n if (!isPad) {\n router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });\n }\n }}\n style={{ display: 'contents' }}\n disableForceFlatten>\n <InternalLinkPreviewContext\n value={{ isVisible: isCurrentPreviewOpen, href: rest.hrefForPreviewNavigation }}>\n <BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref} />\n {preview}\n {menuElement}\n </InternalLinkPreviewContext>\n </NativeLinkPreview>\n );\n}\n"]}
1
+ {"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBb,0CA2HC;AAlJD,+CAAoE;AACpE,+CAAwC;AAExC,oCAAqC;AACrC,6DAA0D;AAC1D,6EAA0E;AAC1E,2DAAwD;AACxD,yCAAgE;AAChE,iCAAqC;AAErC,qEAAqE;AACrE,6CAAqD;AACrD,+DAA4D;AAE5D,gDAAwD;AACxD,sCAAoD;AAEpD,MAAM,KAAK,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,uBAAQ,CAAC,KAAK,CAAC;AAMtD,SAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAwB;IACzE,MAAM,MAAM,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC3B,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,0CAAqB,GAAE,CAAC;IACtD,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEvE,MAAM,gBAAgB,GAAG,IAAA,kBAAW,EAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,oBAAoB,GAAG,IAAA,cAAM,EAAC,g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nB;MAAA,CAAC,qCAAiB,CAAC,KAAK,CACtB;QAAA,CAAC,uDAA0B,CACzB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAChF;UAAA,CAAC,uCAAkB,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC/D;UAAA,CAAC,OAAO,CACR;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,uDAA0B,CAC9B;MAAA,EAAE,qCAAiB,CACrB;IAAA,EAAE,0BAAiB,CAAC,CACrB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport { useRouter } from '../hooks';\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { NativeMenuContext } from './NativeMenuContext';\nimport { LinkMenu, LinkPreview, LinkTrigger } from './elements';\nimport { resolveHref } from './href';\nimport type { Href } from '../types';\nimport { useLinkPreviewContext } from './preview/LinkPreviewContext';\nimport { NativeLinkPreview } from './preview/native';\nimport { useNextScreenId } from './preview/useNextScreenId';\nimport { LinkProps } from './useLinkHooks';\nimport { getFirstChildOfType } from '../utils/children';\nimport { shouldLinkExternally } from '../utils/url';\n\nconst isPad = Platform.OS === 'ios' && Platform.isPad;\n\ninterface LinkWithPreviewProps extends LinkProps {\n hrefForPreviewNavigation: Href;\n}\n\nexport function LinkWithPreview({ children, ...rest }: LinkWithPreviewProps) {\n const router = useRouter();\n const { setOpenPreviewKey } = useLinkPreviewContext();\n const [isCurrentPreviewOpen, setIsCurrenPreviewOpen] = useState(false);\n\n const hrefWithoutQuery = resolveHref(rest.hrefForPreviewNavigation).split('?')[0];\n const prevHrefWithoutQuery = useRef(hrefWithoutQuery);\n\n useEffect(() => {\n if (isCurrentPreviewOpen) {\n if (prevHrefWithoutQuery.current !== hrefWithoutQuery) {\n throw new Error(\n 'Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.'\n );\n }\n } else {\n prevHrefWithoutQuery.current = hrefWithoutQuery;\n }\n }, [hrefWithoutQuery]);\n\n const [{ nextScreenId, tabPath }, prefetch] = useNextScreenId();\n\n useEffect(() => {\n if (rest.replace) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Using replace links with preview is not supported');\n } else {\n console.warn('Using replace links with preview is not supported');\n }\n }\n }, [rest.href, rest.replace]);\n\n const triggerElement = React.useMemo(\n () => getFirstChildOfType(children, LinkTrigger),\n [children]\n );\n const menuElement = React.useMemo(() => getFirstChildOfType(children, LinkMenu), [children]);\n const previewElement = React.useMemo(\n () => getFirstChildOfType(children, LinkPreview),\n [children]\n );\n\n if ((previewElement || menuElement) && !triggerElement) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n } else {\n console.warn(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n }\n }\n\n const trigger = React.useMemo(\n () => triggerElement ?? <LinkTrigger>{children}</LinkTrigger>,\n [triggerElement, children]\n );\n\n const preview = React.useMemo(\n () => (shouldLinkExternally(String(rest.href)) || !previewElement ? null : previewElement),\n [previewElement, rest.href]\n );\n\n const isPreviewTapped = useRef(false);\n\n const tabPathValue = useMemo(\n () => ({\n path: tabPath,\n }),\n [tabPath]\n );\n\n const hasPreview = !!previewElement;\n\n if (rest.replace) {\n return <BaseExpoRouterLink children={children} {...rest} />;\n }\n\n return (\n <NativeLinkPreview\n nextScreenId={isPad ? undefined : nextScreenId}\n tabPath={isPad ? undefined : tabPathValue}\n onWillPreviewOpen={() => {\n if (hasPreview) {\n isPreviewTapped.current = false;\n prefetch(rest.hrefForPreviewNavigation);\n setIsCurrenPreviewOpen(true);\n }\n }}\n onPreviewWillClose={() => {\n if (hasPreview) {\n setIsCurrenPreviewOpen(false);\n // When preview was not tapped, then we need to enable the screen stack animation\n // Otherwise this will happen in StackNavigator, when new screen is opened\n if (!isPreviewTapped.current || isPad) {\n setOpenPreviewKey(undefined);\n }\n }\n }}\n onPreviewDidClose={() => {\n if (hasPreview && isPreviewTapped.current && isPad) {\n router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });\n }\n }}\n onPreviewTapped={() => {\n isPreviewTapped.current = true;\n if (!isPad) {\n router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });\n }\n }}\n style={{ display: 'contents' }}\n disableForceFlatten>\n <NativeMenuContext value>\n <InternalLinkPreviewContext\n value={{ isVisible: isCurrentPreviewOpen, href: rest.hrefForPreviewNavigation }}>\n <BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref} />\n {preview}\n {menuElement}\n </InternalLinkPreviewContext>\n </NativeMenuContext>\n </NativeLinkPreview>\n );\n}\n"]}