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,144 @@
1
+ import type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';
2
+ import type { ImageRef } from 'expo-image';
3
+ import type { ReactNode } from 'react';
4
+ import type { StyleProp, TextStyle } from 'react-native';
5
+ import { type StackHeaderItemSharedProps } from '../shared';
6
+ export interface StackToolbarButtonProps {
7
+ accessibilityLabel?: string;
8
+ accessibilityHint?: string;
9
+ /**
10
+ * There are two ways to specify the content of the button:
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { Stack } from 'expo-router';
15
+ *
16
+ * export default function Page() {
17
+ * return (
18
+ * <>
19
+ * <Stack.Toolbar placement="left">
20
+ * <Stack.Toolbar.Button icon="star.fill">As text passed as children</Stack.Toolbar.Button>
21
+ * </Stack.Toolbar>
22
+ * <ScreenContent />
23
+ * </>
24
+ * );
25
+ * }
26
+ * ```
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * import { Stack } from 'expo-router';
31
+ *
32
+ * export default function Page() {
33
+ * return (
34
+ * <>
35
+ * <Stack.Toolbar placement="left">
36
+ * <Stack.Toolbar.Button>
37
+ * <Stack.Toolbar.Icon sf="star.fill" />
38
+ * <Stack.Toolbar.Label>As components</Stack.Toolbar.Label>
39
+ * <Stack.Toolbar.Badge>3</Stack.Toolbar.Badge>
40
+ * </Stack.Toolbar.Button>
41
+ * </Stack.Toolbar>
42
+ * <ScreenContent />
43
+ * </>
44
+ * );
45
+ * }
46
+ * ```
47
+ *
48
+ * > **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only. Badge is only supported in left/right placements, not in bottom (iOS toolbar limitation).
49
+ */
50
+ children?: ReactNode;
51
+ disabled?: boolean;
52
+ /**
53
+ * Whether the button should be hidden.
54
+ *
55
+ * @default false
56
+ */
57
+ hidden?: boolean;
58
+ /**
59
+ * Whether to hide the shared background.
60
+ *
61
+ * @platform iOS 26+
62
+ */
63
+ hidesSharedBackground?: boolean;
64
+ /**
65
+ * Icon to display in the button.
66
+ *
67
+ * Can be a string representing an SFSymbol or an image source.
68
+ */
69
+ icon?: StackHeaderItemSharedProps['icon'];
70
+ /**
71
+ * Image to display in the button.
72
+ *
73
+ * > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.
74
+ */
75
+ image?: ImageRef;
76
+ onPress?: () => void;
77
+ /**
78
+ * Whether to separate the background of this item from other header items.
79
+ *
80
+ * @default false
81
+ */
82
+ separateBackground?: boolean;
83
+ /**
84
+ * Whether the button is in a selected state
85
+ *
86
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected) for more information
87
+ */
88
+ selected?: boolean;
89
+ /**
90
+ * Style for the label of the header item.
91
+ */
92
+ style?: StyleProp<TextStyle>;
93
+ /**
94
+ * The tint color to apply to the button item
95
+ *
96
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor) for more information.
97
+ */
98
+ tintColor?: StackHeaderItemSharedProps['tintColor'];
99
+ /**
100
+ * @default 'plain'
101
+ */
102
+ variant?: StackHeaderItemSharedProps['variant'];
103
+ }
104
+ /**
105
+ * A button used inside `Stack.Toolbar`.
106
+ *
107
+ * @example
108
+ * ```tsx
109
+ * import { Stack } from 'expo-router';
110
+ *
111
+ * export default function Layout() {
112
+ * return (
113
+ * <Stack>
114
+ * <Stack.Screen name="index">
115
+ * <Stack.Toolbar placement="left">
116
+ * <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
117
+ * </Stack.Toolbar>
118
+ * </Stack.Screen>
119
+ * </Stack>
120
+ * );
121
+ * }
122
+ * ```
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * import { Stack } from 'expo-router';
127
+ *
128
+ * export default function Page() {
129
+ * return (
130
+ * <>
131
+ * <Stack.Toolbar placement="left">
132
+ * <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
133
+ * </Stack.Toolbar>
134
+ * <ScreenContent />
135
+ * </>
136
+ * );
137
+ * }
138
+ * ```
139
+ *
140
+ * @platform ios
141
+ */
142
+ export declare const StackToolbarButton: React.FC<StackToolbarButtonProps>;
143
+ export declare function convertStackToolbarButtonPropsToRNHeaderItem(props: StackToolbarButtonProps): NativeStackHeaderItemButton | undefined;
144
+ //# sourceMappingURL=StackToolbarButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarButton.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAE1C;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAUhE,CAAC;AAEF,wBAAgB,4CAA4C,CAC1D,KAAK,EAAE,uBAAuB,GAC7B,2BAA2B,GAAG,SAAS,CAWzC"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.StackToolbarButton = void 0;
5
+ exports.convertStackToolbarButtonPropsToRNHeaderItem = convertStackToolbarButtonPropsToRNHeaderItem;
6
+ const bottom_toolbar_native_elements_1 = require("./bottom-toolbar-native-elements");
7
+ const context_1 = require("./context");
8
+ const shared_1 = require("../shared");
9
+ /**
10
+ * A button used inside `Stack.Toolbar`.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { Stack } from 'expo-router';
15
+ *
16
+ * export default function Layout() {
17
+ * return (
18
+ * <Stack>
19
+ * <Stack.Screen name="index">
20
+ * <Stack.Toolbar placement="left">
21
+ * <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
22
+ * </Stack.Toolbar>
23
+ * </Stack.Screen>
24
+ * </Stack>
25
+ * );
26
+ * }
27
+ * ```
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * import { Stack } from 'expo-router';
32
+ *
33
+ * export default function Page() {
34
+ * return (
35
+ * <>
36
+ * <Stack.Toolbar placement="left">
37
+ * <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
38
+ * </Stack.Toolbar>
39
+ * <ScreenContent />
40
+ * </>
41
+ * );
42
+ * }
43
+ * ```
44
+ *
45
+ * @platform ios
46
+ */
47
+ const StackToolbarButton = (props) => {
48
+ const placement = (0, context_1.useToolbarPlacement)();
49
+ if (placement === 'bottom') {
50
+ // TODO(@ubax): Handle image loading using useImage in a follow-up PR.
51
+ const icon = typeof props.icon === 'string' ? props.icon : undefined;
52
+ return <bottom_toolbar_native_elements_1.NativeToolbarButton {...props} icon={icon} image={props.image}/>;
53
+ }
54
+ return null;
55
+ };
56
+ exports.StackToolbarButton = StackToolbarButton;
57
+ function convertStackToolbarButtonPropsToRNHeaderItem(props) {
58
+ if (props.hidden) {
59
+ return undefined;
60
+ }
61
+ return {
62
+ ...(0, shared_1.convertStackHeaderSharedPropsToRNSharedHeaderItem)(props),
63
+ type: 'button',
64
+ onPress: props.onPress ?? (() => { }),
65
+ selected: !!props.selected,
66
+ };
67
+ }
68
+ //# sourceMappingURL=StackToolbarButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarButton.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarButton.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAmKb,oGAaC;AA1KD,qFAAuE;AACvE,uCAAgD;AAChD,sCAGmB;AAsGnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACI,MAAM,kBAAkB,GAAsC,CAAC,KAAK,EAAE,EAAE;IAC7E,MAAM,SAAS,GAAG,IAAA,6BAAmB,GAAE,CAAC;IAExC,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC3B,sEAAsE;QACtE,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACrE,OAAO,CAAC,oDAAmB,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAG,CAAC;IAC5E,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B;AAEF,SAAgB,4CAA4C,CAC1D,KAA8B;IAE9B,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,IAAA,0DAAiD,EAAC,KAAK,CAAC;QAC3D,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;QACpC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';\nimport type { ImageRef } from 'expo-image';\nimport type { ReactNode } from 'react';\nimport type { StyleProp, TextStyle } from 'react-native';\n\nimport { NativeToolbarButton } from './bottom-toolbar-native-elements';\nimport { useToolbarPlacement } from './context';\nimport {\n convertStackHeaderSharedPropsToRNSharedHeaderItem,\n type StackHeaderItemSharedProps,\n} from '../shared';\n\nexport interface StackToolbarButtonProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n /**\n * There are two ways to specify the content of the button:\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=\"star.fill\">As text passed as children</Stack.Toolbar.Button>\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 placement=\"left\">\n * <Stack.Toolbar.Button>\n * <Stack.Toolbar.Icon sf=\"star.fill\" />\n * <Stack.Toolbar.Label>As components</Stack.Toolbar.Label>\n * <Stack.Toolbar.Badge>3</Stack.Toolbar.Badge>\n * </Stack.Toolbar.Button>\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * > **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only. Badge is only supported in left/right placements, not in bottom (iOS toolbar limitation).\n */\n children?: ReactNode;\n disabled?: boolean;\n /**\n * Whether the button should be hidden.\n *\n * @default false\n */\n hidden?: boolean;\n /**\n * Whether to hide the shared background.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n /**\n * Icon to display in the button.\n *\n * Can be a string representing an SFSymbol or an image source.\n */\n icon?: StackHeaderItemSharedProps['icon'];\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display in the button.\n *\n * > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.\n */\n image?: ImageRef;\n onPress?: () => void;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\n */\n separateBackground?: boolean;\n /**\n * Whether the button is in a selected state\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected) for more information\n */\n selected?: boolean;\n /**\n * Style for the label of the header item.\n */\n style?: StyleProp<TextStyle>;\n /**\n * The tint color to apply to the button item\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor) for more information.\n */\n tintColor?: StackHeaderItemSharedProps['tintColor'];\n /**\n * @default 'plain'\n */\n variant?: StackHeaderItemSharedProps['variant'];\n}\n\n/**\n * A button used inside `Stack.Toolbar`.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Layout() {\n * return (\n * <Stack>\n * <Stack.Screen name=\"index\">\n * <Stack.Toolbar placement=\"left\">\n * <Stack.Toolbar.Button icon=\"arrow.left.circle\" onPress={() => alert('Left pressed')} />\n * </Stack.Toolbar>\n * </Stack.Screen>\n * </Stack>\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 placement=\"left\">\n * <Stack.Toolbar.Button icon=\"arrow.left.circle\" onPress={() => alert('Left pressed')} />\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const StackToolbarButton: React.FC<StackToolbarButtonProps> = (props) => {\n const placement = useToolbarPlacement();\n\n if (placement === 'bottom') {\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n const icon = typeof props.icon === 'string' ? props.icon : undefined;\n return <NativeToolbarButton {...props} icon={icon} image={props.image} />;\n }\n\n return null;\n};\n\nexport function convertStackToolbarButtonPropsToRNHeaderItem(\n props: StackToolbarButtonProps\n): NativeStackHeaderItemButton | undefined {\n if (props.hidden) {\n return undefined;\n }\n\n return {\n ...convertStackHeaderSharedPropsToRNSharedHeaderItem(props),\n type: 'button',\n onPress: props.onPress ?? (() => {}),\n selected: !!props.selected,\n };\n}\n"]}
@@ -0,0 +1,104 @@
1
+ import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
2
+ import React, { type ReactNode } from 'react';
3
+ import { type ToolbarPlacement } from './context';
4
+ export interface StackToolbarProps {
5
+ /**
6
+ * Child elements to compose the toolbar. Can include Stack.Toolbar.Button,
7
+ * Stack.Toolbar.Menu, Stack.Toolbar.View, Stack.Toolbar.Spacer, and
8
+ * Stack.Toolbar.SearchBarSlot (bottom only) components.
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * The placement of the toolbar.
13
+ *
14
+ * - `'left'`: Renders items in the left area of the header.
15
+ * - `'right'`: Renders items in the right area of the header.
16
+ * - `'bottom'`: Renders items in the bottom toolbar (iOS only).
17
+ *
18
+ * @default 'bottom'
19
+ */
20
+ placement?: ToolbarPlacement;
21
+ /**
22
+ * When `true`, renders children as a custom component in the header area,
23
+ * replacing the default header layout.
24
+ *
25
+ * Only applies to `placement="left"` and `placement="right"`.
26
+ *
27
+ * @default false
28
+ */
29
+ asChild?: boolean;
30
+ }
31
+ /**
32
+ * The component used to configure the stack toolbar.
33
+ *
34
+ * - Use `placement="left"` to customize the left side of the header.
35
+ * - Use `placement="right"` to customize the right side of the header.
36
+ * - Use `placement="bottom"` (default) to show a bottom toolbar (iOS only).
37
+ *
38
+ * > **Note:** Using `Stack.Toolbar` with `placement="left"` or `placement="right"` will
39
+ * automatically make the header visible (`headerShown: true`), as the toolbar is rendered
40
+ * as part of the native header.
41
+ *
42
+ * > **Note:** `Stack.Toolbar` with `placement="bottom"` can only be used inside **page**
43
+ * components, not in layout components.
44
+ *
45
+ * > **Note**: Stack.Toolbar is an experimental API and may change without notice.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * import { Stack } from 'expo-router';
50
+ *
51
+ * export default function Layout() {
52
+ * return (
53
+ * <Stack>
54
+ * <Stack.Screen name="index">
55
+ * <Stack.Toolbar placement="left">
56
+ * <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
57
+ * </Stack.Toolbar>
58
+ * <Stack.Toolbar placement="right">
59
+ * <Stack.Toolbar.Button icon="ellipsis.circle" onPress={() => alert('Right button pressed!')} />
60
+ * </Stack.Toolbar>
61
+ * </Stack.Screen>
62
+ * </Stack>
63
+ * );
64
+ * }
65
+ * ```
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * import { Stack } from 'expo-router';
70
+ *
71
+ * export default function Page() {
72
+ * return (
73
+ * <>
74
+ * <Stack.Toolbar placement="left">
75
+ * <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
76
+ * </Stack.Toolbar>
77
+ * <Stack.Toolbar>
78
+ * <Stack.Toolbar.Spacer />
79
+ * <Stack.Toolbar.Button icon="magnifyingglass" onPress={() => {}} />
80
+ * <Stack.Toolbar.Spacer />
81
+ * </Stack.Toolbar>
82
+ * <ScreenContent />
83
+ * </>
84
+ * );
85
+ * }
86
+ * ```
87
+ *
88
+ * @platform ios
89
+ */
90
+ export declare const StackToolbar: {
91
+ ({ children, placement, asChild }: StackToolbarProps): React.JSX.Element;
92
+ Button: React.FC<import("./StackToolbarButton").StackToolbarButtonProps>;
93
+ Menu: React.FC<import("./StackToolbarMenu").StackToolbarMenuProps>;
94
+ MenuAction: React.FC<import("./StackToolbarMenu").StackToolbarMenuActionProps>;
95
+ SearchBarSlot: React.FC<import("./StackToolbarSearchBarSlot").StackToolbarSearchBarSlotProps>;
96
+ Spacer: React.FC<import("./StackToolbarSpacer").StackToolbarSpacerProps>;
97
+ View: React.FC<import("./StackToolbarView").StackToolbarViewProps>;
98
+ Label: React.FC<import("../common-primitives").StackToolbarLabelProps>;
99
+ Icon: React.FC<import("../common-primitives").StackToolbarIconProps>;
100
+ Badge: React.FC<import("../common-primitives").StackToolbarBadgeProps>;
101
+ };
102
+ export declare function appendStackToolbarPropsToOptions(options: NativeStackNavigationOptions, props: StackToolbarProps): NativeStackNavigationOptions;
103
+ export default StackToolbar;
104
+ //# sourceMappingURL=StackToolbarClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarClient.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarClient.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBxE,OAAO,EAAgD,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAOhG,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,eAAO,MAAM,YAAY;uCAAiD,iBAAiB;;;;;;;;;;CA4B1F,CAAC;AAiDF,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,iBAAiB,GACvB,4BAA4B,CAqC9B;AAYD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ 'use client';
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.StackToolbar = void 0;
38
+ exports.appendStackToolbarPropsToOptions = appendStackToolbarPropsToOptions;
39
+ const react_1 = __importStar(require("react"));
40
+ const react_2 = require("react");
41
+ const StackToolbarButton_1 = require("./StackToolbarButton");
42
+ const StackToolbarMenu_1 = require("./StackToolbarMenu");
43
+ const StackToolbarSearchBarSlot_1 = require("./StackToolbarSearchBarSlot");
44
+ const StackToolbarSpacer_1 = require("./StackToolbarSpacer");
45
+ const StackToolbarView_1 = require("./StackToolbarView");
46
+ const context_1 = require("./context");
47
+ const NativeMenuContext_1 = require("../../../link/NativeMenuContext");
48
+ const native_1 = require("../../../toolbar/native");
49
+ const children_1 = require("../../../utils/children");
50
+ const Screen_1 = require("../../../views/Screen");
51
+ const common_primitives_1 = require("../common-primitives");
52
+ /**
53
+ * The component used to configure the stack toolbar.
54
+ *
55
+ * - Use `placement="left"` to customize the left side of the header.
56
+ * - Use `placement="right"` to customize the right side of the header.
57
+ * - Use `placement="bottom"` (default) to show a bottom toolbar (iOS only).
58
+ *
59
+ * > **Note:** Using `Stack.Toolbar` with `placement="left"` or `placement="right"` will
60
+ * automatically make the header visible (`headerShown: true`), as the toolbar is rendered
61
+ * as part of the native header.
62
+ *
63
+ * > **Note:** `Stack.Toolbar` with `placement="bottom"` can only be used inside **page**
64
+ * components, not in layout components.
65
+ *
66
+ * > **Note**: Stack.Toolbar is an experimental API and may change without notice.
67
+ *
68
+ * @example
69
+ * ```tsx
70
+ * import { Stack } from 'expo-router';
71
+ *
72
+ * export default function Layout() {
73
+ * return (
74
+ * <Stack>
75
+ * <Stack.Screen name="index">
76
+ * <Stack.Toolbar placement="left">
77
+ * <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
78
+ * </Stack.Toolbar>
79
+ * <Stack.Toolbar placement="right">
80
+ * <Stack.Toolbar.Button icon="ellipsis.circle" onPress={() => alert('Right button pressed!')} />
81
+ * </Stack.Toolbar>
82
+ * </Stack.Screen>
83
+ * </Stack>
84
+ * );
85
+ * }
86
+ * ```
87
+ *
88
+ * @example
89
+ * ```tsx
90
+ * import { Stack } from 'expo-router';
91
+ *
92
+ * export default function Page() {
93
+ * return (
94
+ * <>
95
+ * <Stack.Toolbar placement="left">
96
+ * <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
97
+ * </Stack.Toolbar>
98
+ * <Stack.Toolbar>
99
+ * <Stack.Toolbar.Spacer />
100
+ * <Stack.Toolbar.Button icon="magnifyingglass" onPress={() => {}} />
101
+ * <Stack.Toolbar.Spacer />
102
+ * </Stack.Toolbar>
103
+ * <ScreenContent />
104
+ * </>
105
+ * );
106
+ * }
107
+ * ```
108
+ *
109
+ * @platform ios
110
+ */
111
+ const StackToolbar = ({ children, placement = 'bottom', asChild }) => {
112
+ const parentPlacement = (0, context_1.useToolbarPlacement)();
113
+ if (parentPlacement) {
114
+ throw new Error(`Stack.Toolbar cannot be nested inside another Stack.Toolbar.`);
115
+ }
116
+ if (placement === 'bottom') {
117
+ return (<context_1.ToolbarPlacementContext.Provider value="bottom">
118
+ <NativeMenuContext_1.NativeMenuContext value>
119
+ <native_1.RouterToolbarHost>{children}</native_1.RouterToolbarHost>
120
+ </NativeMenuContext_1.NativeMenuContext>
121
+ </context_1.ToolbarPlacementContext.Provider>);
122
+ }
123
+ // placement === 'left' or 'right'
124
+ // This component will only render when used inside a page
125
+ // eslint-disable-next-line react-hooks/rules-of-hooks
126
+ const updatedOptions = (0, react_2.useMemo)(() => appendStackToolbarPropsToOptions({}, { children, placement, asChild }), [children, placement, asChild]);
127
+ return (<context_1.ToolbarPlacementContext.Provider value={placement}>
128
+ <Screen_1.Screen options={updatedOptions}/>
129
+ </context_1.ToolbarPlacementContext.Provider>);
130
+ };
131
+ exports.StackToolbar = StackToolbar;
132
+ function convertToolbarChildrenToUnstableItems(children, side) {
133
+ const allChildren = react_1.default.Children.toArray(children);
134
+ const actions = allChildren.filter((child) => (0, children_1.isChildOfType)(child, StackToolbarButton_1.StackToolbarButton) ||
135
+ (0, children_1.isChildOfType)(child, StackToolbarMenu_1.StackToolbarMenu) ||
136
+ (0, children_1.isChildOfType)(child, StackToolbarSpacer_1.StackToolbarSpacer) ||
137
+ (0, children_1.isChildOfType)(child, StackToolbarView_1.StackToolbarView));
138
+ if (actions.length !== allChildren.length && process.env.NODE_ENV !== 'production') {
139
+ const otherElements = allChildren
140
+ .filter((child) => !actions.some((action) => action === child))
141
+ .map((e) => {
142
+ if ((0, react_1.isValidElement)(e)) {
143
+ if (e.type === react_1.Fragment) {
144
+ return '<Fragment>';
145
+ }
146
+ else {
147
+ return e.type?.name ?? e.type;
148
+ }
149
+ }
150
+ return String(e);
151
+ });
152
+ console.warn(`Stack.Toolbar with placement="${side}" only accepts <Stack.Toolbar.Button>, <Stack.Toolbar.Menu>, <Stack.Toolbar.View>, and <Stack.Toolbar.Spacer> as children. Found invalid children: ${otherElements.join(', ')}`);
153
+ }
154
+ return () => actions
155
+ .map((action) => {
156
+ if ((0, children_1.isChildOfType)(action, StackToolbarButton_1.StackToolbarButton)) {
157
+ return (0, StackToolbarButton_1.convertStackToolbarButtonPropsToRNHeaderItem)(action.props);
158
+ }
159
+ else if ((0, children_1.isChildOfType)(action, StackToolbarMenu_1.StackToolbarMenu)) {
160
+ return (0, StackToolbarMenu_1.convertStackToolbarMenuPropsToRNHeaderItem)(action.props);
161
+ }
162
+ else if ((0, children_1.isChildOfType)(action, StackToolbarSpacer_1.StackToolbarSpacer)) {
163
+ return (0, StackToolbarSpacer_1.convertStackToolbarSpacerPropsToRNHeaderItem)(action.props);
164
+ }
165
+ return (0, StackToolbarView_1.convertStackToolbarViewPropsToRNHeaderItem)(action.props);
166
+ })
167
+ .filter((item) => !!item);
168
+ }
169
+ function appendStackToolbarPropsToOptions(options, props) {
170
+ const { children, placement = 'bottom', asChild } = props;
171
+ if (placement === 'bottom') {
172
+ // Bottom toolbar doesn't modify navigation options
173
+ return options;
174
+ }
175
+ if (asChild) {
176
+ if (placement === 'left') {
177
+ return {
178
+ ...options,
179
+ headerShown: true,
180
+ headerLeft: () => children,
181
+ };
182
+ }
183
+ else {
184
+ return {
185
+ ...options,
186
+ headerShown: true,
187
+ headerRight: () => children,
188
+ };
189
+ }
190
+ }
191
+ if (placement === 'left') {
192
+ return {
193
+ ...options,
194
+ headerShown: true,
195
+ unstable_headerLeftItems: convertToolbarChildrenToUnstableItems(children, 'left'),
196
+ };
197
+ }
198
+ return {
199
+ ...options,
200
+ headerShown: true,
201
+ unstable_headerRightItems: convertToolbarChildrenToUnstableItems(children, 'right'),
202
+ };
203
+ }
204
+ exports.StackToolbar.Button = StackToolbarButton_1.StackToolbarButton;
205
+ exports.StackToolbar.Menu = StackToolbarMenu_1.StackToolbarMenu;
206
+ exports.StackToolbar.MenuAction = StackToolbarMenu_1.StackToolbarMenuAction;
207
+ exports.StackToolbar.SearchBarSlot = StackToolbarSearchBarSlot_1.StackToolbarSearchBarSlot;
208
+ exports.StackToolbar.Spacer = StackToolbarSpacer_1.StackToolbarSpacer;
209
+ exports.StackToolbar.View = StackToolbarView_1.StackToolbarView;
210
+ exports.StackToolbar.Label = common_primitives_1.StackToolbarLabel;
211
+ exports.StackToolbar.Icon = common_primitives_1.StackToolbarIcon;
212
+ exports.StackToolbar.Badge = common_primitives_1.StackToolbarBadge;
213
+ exports.default = exports.StackToolbar;
214
+ //# sourceMappingURL=StackToolbarClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackToolbarClient.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarClient.tsx"],"names":[],"mappings":"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","sourcesContent":["'use client';\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport React, { Fragment, isValidElement, type ReactNode } from 'react';\nimport { useMemo } from 'react';\n\nimport {\n convertStackToolbarButtonPropsToRNHeaderItem,\n StackToolbarButton,\n} from './StackToolbarButton';\nimport {\n convertStackToolbarMenuPropsToRNHeaderItem,\n StackToolbarMenu,\n StackToolbarMenuAction,\n} from './StackToolbarMenu';\nimport { StackToolbarSearchBarSlot } from './StackToolbarSearchBarSlot';\nimport {\n convertStackToolbarSpacerPropsToRNHeaderItem,\n StackToolbarSpacer,\n} from './StackToolbarSpacer';\nimport { convertStackToolbarViewPropsToRNHeaderItem, StackToolbarView } from './StackToolbarView';\nimport { ToolbarPlacementContext, useToolbarPlacement, type ToolbarPlacement } from './context';\nimport { NativeMenuContext } from '../../../link/NativeMenuContext';\nimport { RouterToolbarHost } from '../../../toolbar/native';\nimport { isChildOfType } from '../../../utils/children';\nimport { Screen } from '../../../views/Screen';\nimport { StackToolbarBadge, StackToolbarIcon, StackToolbarLabel } from '../common-primitives';\n\nexport interface StackToolbarProps {\n /**\n * Child elements to compose the toolbar. Can include Stack.Toolbar.Button,\n * Stack.Toolbar.Menu, Stack.Toolbar.View, Stack.Toolbar.Spacer, and\n * Stack.Toolbar.SearchBarSlot (bottom only) components.\n */\n children?: ReactNode;\n /**\n * The placement of the toolbar.\n *\n * - `'left'`: Renders items in the left area of the header.\n * - `'right'`: Renders items in the right area of the header.\n * - `'bottom'`: Renders items in the bottom toolbar (iOS only).\n *\n * @default 'bottom'\n */\n placement?: ToolbarPlacement;\n /**\n * When `true`, renders children as a custom component in the header area,\n * replacing the default header layout.\n *\n * Only applies to `placement=\"left\"` and `placement=\"right\"`.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\n/**\n * The component used to configure the stack toolbar.\n *\n * - Use `placement=\"left\"` to customize the left side of the header.\n * - Use `placement=\"right\"` to customize the right side of the header.\n * - Use `placement=\"bottom\"` (default) to show a bottom toolbar (iOS only).\n *\n * > **Note:** Using `Stack.Toolbar` with `placement=\"left\"` or `placement=\"right\"` will\n * automatically make the header visible (`headerShown: true`), as the toolbar is rendered\n * as part of the native header.\n *\n * > **Note:** `Stack.Toolbar` with `placement=\"bottom\"` can only be used inside **page**\n * components, not in layout components.\n *\n * > **Note**: Stack.Toolbar is an experimental API and may change without notice.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Layout() {\n * return (\n * <Stack>\n * <Stack.Screen name=\"index\">\n * <Stack.Toolbar placement=\"left\">\n * <Stack.Toolbar.Button icon=\"sidebar.left\" onPress={() => alert('Left button pressed!')} />\n * </Stack.Toolbar>\n * <Stack.Toolbar placement=\"right\">\n * <Stack.Toolbar.Button icon=\"ellipsis.circle\" onPress={() => alert('Right button pressed!')} />\n * </Stack.Toolbar>\n * </Stack.Screen>\n * </Stack>\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 placement=\"left\">\n * <Stack.Toolbar.Button icon=\"sidebar.left\" onPress={() => alert('Left button pressed!')} />\n * </Stack.Toolbar>\n * <Stack.Toolbar>\n * <Stack.Toolbar.Spacer />\n * <Stack.Toolbar.Button icon=\"magnifyingglass\" onPress={() => {}} />\n * <Stack.Toolbar.Spacer />\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const StackToolbar = ({ children, placement = 'bottom', asChild }: StackToolbarProps) => {\n const parentPlacement = useToolbarPlacement();\n if (parentPlacement) {\n throw new Error(`Stack.Toolbar cannot be nested inside another Stack.Toolbar.`);\n }\n\n if (placement === 'bottom') {\n return (\n <ToolbarPlacementContext.Provider value=\"bottom\">\n <NativeMenuContext value>\n <RouterToolbarHost>{children}</RouterToolbarHost>\n </NativeMenuContext>\n </ToolbarPlacementContext.Provider>\n );\n }\n\n // placement === 'left' or 'right'\n // This component will only render when used inside a page\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const updatedOptions = useMemo(\n () => appendStackToolbarPropsToOptions({}, { children, placement, asChild }),\n [children, placement, asChild]\n );\n return (\n <ToolbarPlacementContext.Provider value={placement}>\n <Screen options={updatedOptions} />\n </ToolbarPlacementContext.Provider>\n );\n};\n\nfunction convertToolbarChildrenToUnstableItems(\n children: React.ReactNode,\n side: 'left' | 'right'\n):\n | NativeStackNavigationOptions['unstable_headerRightItems']\n | NativeStackNavigationOptions['unstable_headerLeftItems'] {\n const allChildren = React.Children.toArray(children);\n const actions = allChildren.filter(\n (child) =>\n isChildOfType(child, StackToolbarButton) ||\n isChildOfType(child, StackToolbarMenu) ||\n isChildOfType(child, StackToolbarSpacer) ||\n isChildOfType(child, StackToolbarView)\n );\n if (actions.length !== allChildren.length && process.env.NODE_ENV !== 'production') {\n const otherElements = allChildren\n .filter((child) => !actions.some((action) => action === child))\n .map((e) => {\n if (isValidElement(e)) {\n if (e.type === Fragment) {\n return '<Fragment>';\n } else {\n return (e.type as { name: string })?.name ?? e.type;\n }\n }\n\n return String(e);\n });\n console.warn(\n `Stack.Toolbar with placement=\"${side}\" only accepts <Stack.Toolbar.Button>, <Stack.Toolbar.Menu>, <Stack.Toolbar.View>, and <Stack.Toolbar.Spacer> as children. Found invalid children: ${otherElements.join(', ')}`\n );\n }\n return () =>\n actions\n .map((action) => {\n if (isChildOfType(action, StackToolbarButton)) {\n return convertStackToolbarButtonPropsToRNHeaderItem(action.props);\n } else if (isChildOfType(action, StackToolbarMenu)) {\n return convertStackToolbarMenuPropsToRNHeaderItem(action.props);\n } else if (isChildOfType(action, StackToolbarSpacer)) {\n return convertStackToolbarSpacerPropsToRNHeaderItem(action.props);\n }\n return convertStackToolbarViewPropsToRNHeaderItem(action.props);\n })\n .filter((item) => !!item);\n}\n\nexport function appendStackToolbarPropsToOptions(\n options: NativeStackNavigationOptions,\n props: StackToolbarProps\n): NativeStackNavigationOptions {\n const { children, placement = 'bottom', asChild } = props;\n\n if (placement === 'bottom') {\n // Bottom toolbar doesn't modify navigation options\n return options;\n }\n\n if (asChild) {\n if (placement === 'left') {\n return {\n ...options,\n headerShown: true,\n headerLeft: () => children,\n };\n } else {\n return {\n ...options,\n headerShown: true,\n headerRight: () => children,\n };\n }\n }\n\n if (placement === 'left') {\n return {\n ...options,\n headerShown: true,\n unstable_headerLeftItems: convertToolbarChildrenToUnstableItems(children, 'left'),\n };\n }\n\n return {\n ...options,\n headerShown: true,\n unstable_headerRightItems: convertToolbarChildrenToUnstableItems(children, 'right'),\n };\n}\n\nStackToolbar.Button = StackToolbarButton;\nStackToolbar.Menu = StackToolbarMenu;\nStackToolbar.MenuAction = StackToolbarMenuAction;\nStackToolbar.SearchBarSlot = StackToolbarSearchBarSlot;\nStackToolbar.Spacer = StackToolbarSpacer;\nStackToolbar.View = StackToolbarView;\nStackToolbar.Label = StackToolbarLabel;\nStackToolbar.Icon = StackToolbarIcon;\nStackToolbar.Badge = StackToolbarBadge;\n\nexport default StackToolbar;\n"]}