@amazon-devices/react-native-screens 2.0.1758683737

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 (381) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +223 -0
  3. package/RNScreens.podspec +53 -0
  4. package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.bundle +33668 -0
  5. package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.map +1 -0
  6. package/SystemModules/amzn__react-native-screens.modules.txt +101 -0
  7. package/SystemModules/amzn__react-native-screens.private.modules.txt +244 -0
  8. package/SystemModules/keplerscript-system-bundle-config.json +7 -0
  9. package/THIRD_PARTY_NOTICES.txt +707 -0
  10. package/android/build.gradle +133 -0
  11. package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +49 -0
  12. package/android/src/main/AndroidManifest.xml +5 -0
  13. package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +77 -0
  14. package/android/src/main/java/com/swmansion/rnscreens/CustomToolbar.kt +7 -0
  15. package/android/src/main/java/com/swmansion/rnscreens/FragmentBackPressOverrider.kt +29 -0
  16. package/android/src/main/java/com/swmansion/rnscreens/FragmentHolder.kt +7 -0
  17. package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +21 -0
  18. package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +289 -0
  19. package/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt +372 -0
  20. package/android/src/main/java/com/swmansion/rnscreens/ScreenContainerViewManager.kt +40 -0
  21. package/android/src/main/java/com/swmansion/rnscreens/ScreenEventDispatcher.kt +21 -0
  22. package/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt +331 -0
  23. package/android/src/main/java/com/swmansion/rnscreens/ScreenFragmentWrapper.kt +22 -0
  24. package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +336 -0
  25. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +282 -0
  26. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragmentWrapper.kt +15 -0
  27. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +398 -0
  28. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +204 -0
  29. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt +38 -0
  30. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubviewManager.kt +41 -0
  31. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt +75 -0
  32. package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +186 -0
  33. package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +296 -0
  34. package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +19 -0
  35. package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +133 -0
  36. package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +178 -0
  37. package/android/src/main/java/com/swmansion/rnscreens/SearchViewFormatter.kt +67 -0
  38. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +22 -0
  39. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt +22 -0
  40. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +22 -0
  41. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +26 -0
  42. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt +18 -0
  43. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt +18 -0
  44. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt +20 -0
  45. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt +32 -0
  46. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt +18 -0
  47. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt +18 -0
  48. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +22 -0
  49. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +28 -0
  50. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +22 -0
  51. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +22 -0
  52. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +22 -0
  53. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +24 -0
  54. package/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt +18 -0
  55. package/android/src/main/java/com/swmansion/rnscreens/utils/DeviceUtils.kt +12 -0
  56. package/android/src/main/jni/CMakeLists.txt +72 -0
  57. package/android/src/main/jni/rnscreens.cpp +16 -0
  58. package/android/src/main/jni/rnscreens.h +28 -0
  59. package/android/src/main/res/base/anim/rns_default_enter_in.xml +18 -0
  60. package/android/src/main/res/base/anim/rns_default_enter_out.xml +19 -0
  61. package/android/src/main/res/base/anim/rns_default_exit_in.xml +17 -0
  62. package/android/src/main/res/base/anim/rns_default_exit_out.xml +18 -0
  63. package/android/src/main/res/base/anim/rns_fade_from_bottom.xml +14 -0
  64. package/android/src/main/res/base/anim/rns_fade_in.xml +7 -0
  65. package/android/src/main/res/base/anim/rns_fade_out.xml +7 -0
  66. package/android/src/main/res/base/anim/rns_fade_to_bottom.xml +15 -0
  67. package/android/src/main/res/base/anim/rns_no_animation_20.xml +6 -0
  68. package/android/src/main/res/base/anim/rns_no_animation_250.xml +7 -0
  69. package/android/src/main/res/base/anim/rns_no_animation_350.xml +6 -0
  70. package/android/src/main/res/base/anim/rns_no_animation_medium.xml +7 -0
  71. package/android/src/main/res/base/anim/rns_slide_in_from_bottom.xml +7 -0
  72. package/android/src/main/res/base/anim/rns_slide_in_from_left.xml +5 -0
  73. package/android/src/main/res/base/anim/rns_slide_in_from_right.xml +5 -0
  74. package/android/src/main/res/base/anim/rns_slide_out_to_bottom.xml +7 -0
  75. package/android/src/main/res/base/anim/rns_slide_out_to_left.xml +5 -0
  76. package/android/src/main/res/base/anim/rns_slide_out_to_right.xml +5 -0
  77. package/android/src/main/res/base/anim/rns_standard_accelerate_interpolator.xml +6 -0
  78. package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +38 -0
  79. package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +38 -0
  80. package/android/src/main/res/v33/anim-v33/rns_default_exit_in.xml +38 -0
  81. package/android/src/main/res/v33/anim-v33/rns_default_exit_out.xml +38 -0
  82. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +111 -0
  83. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +44 -0
  84. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +107 -0
  85. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +42 -0
  86. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerDelegate.java +31 -0
  87. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerInterface.java +17 -0
  88. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerDelegate.java +25 -0
  89. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerInterface.java +16 -0
  90. package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +10 -0
  91. package/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +41 -0
  92. package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +9 -0
  93. package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +30 -0
  94. package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +14 -0
  95. package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +45 -0
  96. package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.h +11 -0
  97. package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.mm +14 -0
  98. package/ios/RNSConvert.h +36 -0
  99. package/ios/RNSConvert.mm +154 -0
  100. package/ios/RNSEnums.h +71 -0
  101. package/ios/RNSFullWindowOverlay.h +34 -0
  102. package/ios/RNSFullWindowOverlay.mm +241 -0
  103. package/ios/RNSScreen.h +144 -0
  104. package/ios/RNSScreen.mm +1599 -0
  105. package/ios/RNSScreenContainer.h +45 -0
  106. package/ios/RNSScreenContainer.mm +343 -0
  107. package/ios/RNSScreenNavigationContainer.h +16 -0
  108. package/ios/RNSScreenNavigationContainer.mm +66 -0
  109. package/ios/RNSScreenStack.h +37 -0
  110. package/ios/RNSScreenStack.mm +1111 -0
  111. package/ios/RNSScreenStackAnimator.h +8 -0
  112. package/ios/RNSScreenStackAnimator.mm +320 -0
  113. package/ios/RNSScreenStackHeaderConfig.h +74 -0
  114. package/ios/RNSScreenStackHeaderConfig.mm +967 -0
  115. package/ios/RNSScreenStackHeaderSubview.h +44 -0
  116. package/ios/RNSScreenStackHeaderSubview.mm +147 -0
  117. package/ios/RNSScreenWindowTraits.h +26 -0
  118. package/ios/RNSScreenWindowTraits.mm +266 -0
  119. package/ios/RNSSearchBar.h +43 -0
  120. package/ios/RNSSearchBar.mm +465 -0
  121. package/ios/RNScreens.xcodeproj/project.pbxproj +461 -0
  122. package/ios/UIViewController+RNScreens.h +9 -0
  123. package/ios/UIViewController+RNScreens.mm +78 -0
  124. package/ios/UIWindow+RNScreens.h +9 -0
  125. package/ios/UIWindow+RNScreens.mm +17 -0
  126. package/ios/events/RNSHeaderHeightChangeEvent.h +8 -0
  127. package/ios/events/RNSHeaderHeightChangeEvent.mm +44 -0
  128. package/ios/events/RNSScreenViewEvent.h +12 -0
  129. package/ios/events/RNSScreenViewEvent.mm +59 -0
  130. package/ios/utils/RNSUIBarButtonItem.h +5 -0
  131. package/ios/utils/RNSUIBarButtonItem.mm +22 -0
  132. package/kepler-compatibility.json +8 -0
  133. package/kepler-transformed-package-info.json +3 -0
  134. package/lib/commonjs/TransitionProgressContext.js +11 -0
  135. package/lib/commonjs/TransitionProgressContext.js.map +1 -0
  136. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +11 -0
  137. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
  138. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +33 -0
  139. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -0
  140. package/lib/commonjs/fabric/ScreenNativeComponent.js +70 -0
  141. package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -0
  142. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +11 -0
  143. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
  144. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +31 -0
  145. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -0
  146. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +12 -0
  147. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -0
  148. package/lib/commonjs/fabric/ScreenStackNativeComponent.js +35 -0
  149. package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -0
  150. package/lib/commonjs/fabric/SearchBarNativeComponent.js +19 -0
  151. package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -0
  152. package/lib/commonjs/index.js +147 -0
  153. package/lib/commonjs/index.js.map +1 -0
  154. package/lib/commonjs/index.native.js +407 -0
  155. package/lib/commonjs/index.native.js.map +1 -0
  156. package/lib/commonjs/native-stack/index.js +49 -0
  157. package/lib/commonjs/native-stack/index.js.map +1 -0
  158. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +75 -0
  159. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
  160. package/lib/commonjs/native-stack/types.js +6 -0
  161. package/lib/commonjs/native-stack/types.js.map +1 -0
  162. package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js +12 -0
  163. package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -0
  164. package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +12 -0
  165. package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -0
  166. package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +75 -0
  167. package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -0
  168. package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js +35 -0
  169. package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -0
  170. package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js +19 -0
  171. package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
  172. package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +54 -0
  173. package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -0
  174. package/lib/commonjs/native-stack/utils/useHeaderHeight.js +19 -0
  175. package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -0
  176. package/lib/commonjs/native-stack/views/FontProcessor.js +21 -0
  177. package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -0
  178. package/lib/commonjs/native-stack/views/HeaderConfig.js +141 -0
  179. package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -0
  180. package/lib/commonjs/native-stack/views/NativeStackView.js +354 -0
  181. package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -0
  182. package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js +12 -0
  183. package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -0
  184. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +101 -0
  185. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -0
  186. package/lib/commonjs/reanimated/ReanimatedScreen.js +22 -0
  187. package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -0
  188. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +47 -0
  189. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -0
  190. package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +12 -0
  191. package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -0
  192. package/lib/commonjs/reanimated/index.js +28 -0
  193. package/lib/commonjs/reanimated/index.js.map +1 -0
  194. package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +19 -0
  195. package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -0
  196. package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +19 -0
  197. package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -0
  198. package/lib/commonjs/types.js +6 -0
  199. package/lib/commonjs/types.js.map +1 -0
  200. package/lib/commonjs/useTransitionProgress.js +19 -0
  201. package/lib/commonjs/useTransitionProgress.js.map +1 -0
  202. package/lib/commonjs/utils.js +21 -0
  203. package/lib/commonjs/utils.js.map +1 -0
  204. package/lib/module/TransitionProgressContext.js +3 -0
  205. package/lib/module/TransitionProgressContext.js.map +1 -0
  206. package/lib/module/fabric/FullWindowOverlayNativeComponent.js +4 -0
  207. package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
  208. package/lib/module/fabric/ScreenContainerNativeComponent.js +25 -0
  209. package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -0
  210. package/lib/module/fabric/ScreenNativeComponent.js +63 -0
  211. package/lib/module/fabric/ScreenNativeComponent.js.map +1 -0
  212. package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +4 -0
  213. package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
  214. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +23 -0
  215. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -0
  216. package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +7 -0
  217. package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -0
  218. package/lib/module/fabric/ScreenStackNativeComponent.js +28 -0
  219. package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -0
  220. package/lib/module/fabric/SearchBarNativeComponent.js +10 -0
  221. package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -0
  222. package/lib/module/index.js +67 -0
  223. package/lib/module/index.js.map +1 -0
  224. package/lib/module/index.native.js +410 -0
  225. package/lib/module/index.native.js.map +1 -0
  226. package/lib/module/native-stack/index.js +22 -0
  227. package/lib/module/native-stack/index.js.map +1 -0
  228. package/lib/module/native-stack/navigators/createNativeStackNavigator.js +72 -0
  229. package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
  230. package/lib/module/native-stack/types.js +2 -0
  231. package/lib/module/native-stack/types.js.map +1 -0
  232. package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js +4 -0
  233. package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -0
  234. package/lib/module/native-stack/utils/HeaderHeightContext.js +4 -0
  235. package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -0
  236. package/lib/module/native-stack/utils/SafeAreaProviderCompat.js +68 -0
  237. package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -0
  238. package/lib/module/native-stack/utils/getDefaultHeaderHeight.js +29 -0
  239. package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -0
  240. package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js +10 -0
  241. package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
  242. package/lib/module/native-stack/utils/useBackPressSubscription.js +47 -0
  243. package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -0
  244. package/lib/module/native-stack/utils/useHeaderHeight.js +10 -0
  245. package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -0
  246. package/lib/module/native-stack/views/FontProcessor.js +13 -0
  247. package/lib/module/native-stack/views/FontProcessor.js.map +1 -0
  248. package/lib/module/native-stack/views/HeaderConfig.js +132 -0
  249. package/lib/module/native-stack/views/HeaderConfig.js.map +1 -0
  250. package/lib/module/native-stack/views/NativeStackView.js +355 -0
  251. package/lib/module/native-stack/views/NativeStackView.js.map +1 -0
  252. package/lib/module/reanimated/ReanimatedHeaderHeightContext.js +5 -0
  253. package/lib/module/reanimated/ReanimatedHeaderHeightContext.js.map +1 -0
  254. package/lib/module/reanimated/ReanimatedNativeStackScreen.js +97 -0
  255. package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -0
  256. package/lib/module/reanimated/ReanimatedScreen.js +17 -0
  257. package/lib/module/reanimated/ReanimatedScreen.js.map +1 -0
  258. package/lib/module/reanimated/ReanimatedScreenProvider.js +40 -0
  259. package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -0
  260. package/lib/module/reanimated/ReanimatedTransitionProgressContext.js +5 -0
  261. package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -0
  262. package/lib/module/reanimated/index.js +4 -0
  263. package/lib/module/reanimated/index.js.map +1 -0
  264. package/lib/module/reanimated/useReanimatedHeaderHeight.js +10 -0
  265. package/lib/module/reanimated/useReanimatedHeaderHeight.js.map +1 -0
  266. package/lib/module/reanimated/useReanimatedTransitionProgress.js +10 -0
  267. package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -0
  268. package/lib/module/types.js +2 -0
  269. package/lib/module/types.js.map +1 -0
  270. package/lib/module/useTransitionProgress.js +10 -0
  271. package/lib/module/useTransitionProgress.js.map +1 -0
  272. package/lib/module/utils.js +14 -0
  273. package/lib/module/utils.js.map +1 -0
  274. package/lib/typescript/TransitionProgressContext.d.ts +9 -0
  275. package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +7 -0
  276. package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +5 -0
  277. package/lib/typescript/fabric/ScreenNativeComponent.d.ts +66 -0
  278. package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +7 -0
  279. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +33 -0
  280. package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +10 -0
  281. package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +8 -0
  282. package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +49 -0
  283. package/lib/typescript/index.d.ts +33 -0
  284. package/lib/typescript/index.native.d.ts +2 -0
  285. package/lib/typescript/native-stack/index.d.ts +19 -0
  286. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +6 -0
  287. package/lib/typescript/native-stack/types.d.ts +438 -0
  288. package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts +4 -0
  289. package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts +3 -0
  290. package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +11 -0
  291. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +7 -0
  292. package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +1 -0
  293. package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts +16 -0
  294. package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts +1 -0
  295. package/lib/typescript/native-stack/views/FontProcessor.d.ts +1 -0
  296. package/lib/typescript/native-stack/views/HeaderConfig.d.ts +8 -0
  297. package/lib/typescript/native-stack/views/NativeStackView.d.ts +10 -0
  298. package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts +4 -0
  299. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +5 -0
  300. package/lib/typescript/reanimated/ReanimatedScreen.d.ts +5 -0
  301. package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts +2 -0
  302. package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +9 -0
  303. package/lib/typescript/reanimated/index.d.ts +3 -0
  304. package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts +3 -0
  305. package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts +11 -0
  306. package/lib/typescript/types.d.ts +612 -0
  307. package/lib/typescript/useTransitionProgress.d.ts +5 -0
  308. package/lib/typescript/utils.d.ts +3 -0
  309. package/native-stack/README.md +814 -0
  310. package/native-stack/package.json +6 -0
  311. package/package.json +1 -0
  312. package/react-native.config.js +42 -0
  313. package/reanimated/package.json +6 -0
  314. package/src/TransitionProgressContext.tsx +12 -0
  315. package/src/fabric/FullWindowOverlayNativeComponent.ts +7 -0
  316. package/src/fabric/ScreenContainerNativeComponent.ts +28 -0
  317. package/src/fabric/ScreenNativeComponent.ts +158 -0
  318. package/src/fabric/ScreenNavigationContainerNativeComponent.ts +10 -0
  319. package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +61 -0
  320. package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +22 -0
  321. package/src/fabric/ScreenStackNativeComponent.ts +33 -0
  322. package/src/fabric/SearchBarNativeComponent.ts +79 -0
  323. package/src/index.native.tsx +599 -0
  324. package/src/index.tsx +119 -0
  325. package/src/native-stack/index.tsx +27 -0
  326. package/src/native-stack/navigators/createNativeStackNavigator.tsx +107 -0
  327. package/src/native-stack/types.tsx +486 -0
  328. package/src/native-stack/utils/AnimatedHeaderHeightContext.tsx +8 -0
  329. package/src/native-stack/utils/HeaderHeightContext.tsx +5 -0
  330. package/src/native-stack/utils/SafeAreaProviderCompat.tsx +78 -0
  331. package/src/native-stack/utils/getDefaultHeaderHeight.tsx +41 -0
  332. package/src/native-stack/utils/useAnimatedHeaderHeight.tsx +15 -0
  333. package/src/native-stack/utils/useBackPressSubscription.tsx +66 -0
  334. package/src/native-stack/utils/useHeaderHeight.tsx +15 -0
  335. package/src/native-stack/views/FontProcessor.tsx +14 -0
  336. package/src/native-stack/views/HeaderConfig.tsx +187 -0
  337. package/src/native-stack/views/NativeStackView.tsx +466 -0
  338. package/src/reanimated/ReanimatedHeaderHeightContext.tsx +7 -0
  339. package/src/reanimated/ReanimatedNativeStackScreen.tsx +130 -0
  340. package/src/reanimated/ReanimatedScreen.tsx +25 -0
  341. package/src/reanimated/ReanimatedScreenProvider.tsx +42 -0
  342. package/src/reanimated/ReanimatedTransitionProgressContext.tsx +13 -0
  343. package/src/reanimated/index.tsx +3 -0
  344. package/src/reanimated/useReanimatedHeaderHeight.tsx +14 -0
  345. package/src/reanimated/useReanimatedTransitionProgress.tsx +14 -0
  346. package/src/types.tsx +699 -0
  347. package/src/useTransitionProgress.tsx +15 -0
  348. package/src/utils.ts +18 -0
  349. package/windows/README.md +25 -0
  350. package/windows/RNScreens/PropertySheet.props +16 -0
  351. package/windows/RNScreens/RNScreens.cpp +66 -0
  352. package/windows/RNScreens/RNScreens.def +3 -0
  353. package/windows/RNScreens/RNScreens.h +41 -0
  354. package/windows/RNScreens/RNScreens.idl +8 -0
  355. package/windows/RNScreens/RNScreens.vcxproj +187 -0
  356. package/windows/RNScreens/RNScreens.vcxproj.filters +52 -0
  357. package/windows/RNScreens/ReactPackageProvider.cpp +30 -0
  358. package/windows/RNScreens/ReactPackageProvider.h +17 -0
  359. package/windows/RNScreens/ReactPackageProvider.idl +9 -0
  360. package/windows/RNScreens/Screen.cpp +122 -0
  361. package/windows/RNScreens/Screen.h +64 -0
  362. package/windows/RNScreens/ScreenContainer.cpp +49 -0
  363. package/windows/RNScreens/ScreenContainer.h +23 -0
  364. package/windows/RNScreens/ScreenContainerViewManager.cpp +133 -0
  365. package/windows/RNScreens/ScreenContainerViewManager.h +78 -0
  366. package/windows/RNScreens/ScreenStack.cpp +65 -0
  367. package/windows/RNScreens/ScreenStack.h +23 -0
  368. package/windows/RNScreens/ScreenStackHeaderConfig.cpp +19 -0
  369. package/windows/RNScreens/ScreenStackHeaderConfig.h +14 -0
  370. package/windows/RNScreens/ScreenStackHeaderConfigViewManager.cpp +89 -0
  371. package/windows/RNScreens/ScreenStackHeaderConfigViewManager.h +62 -0
  372. package/windows/RNScreens/ScreenStackViewManager.cpp +132 -0
  373. package/windows/RNScreens/ScreenStackViewManager.h +78 -0
  374. package/windows/RNScreens/ScreenViewManager.cpp +154 -0
  375. package/windows/RNScreens/ScreenViewManager.h +78 -0
  376. package/windows/RNScreens/packages.config +4 -0
  377. package/windows/RNScreens/pch.cpp +1 -0
  378. package/windows/RNScreens/pch.h +9 -0
  379. package/windows/RNScreens62.sln +254 -0
  380. package/windows/RNScreens63.sln +225 -0
  381. package/windows/RNScreens65.sln +144 -0
package/src/types.tsx ADDED
@@ -0,0 +1,699 @@
1
+ /*
2
+ * Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
3
+ *
4
+ * PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.
5
+ *
6
+ * Amazon modifications are indicated by [amznmod_* comments].
7
+ */
8
+
9
+ /*
10
+ * Changelog:
11
+ * Set up react-native-screens package to build for Kepler
12
+ */
13
+
14
+ import {
15
+ NativeSyntheticEvent,
16
+ ViewProps,
17
+ View,
18
+ TargetedEvent,
19
+ TextInputFocusEventData,
20
+ ColorValue,
21
+ } from 'react-native';
22
+
23
+ export type SearchBarCommands = {
24
+ focus: () => void;
25
+ blur: () => void;
26
+ clearText: () => void;
27
+ toggleCancelButton: (show: boolean) => void;
28
+ setText: (text: string) => void;
29
+ };
30
+
31
+ export type StackPresentationTypes =
32
+ | 'push'
33
+ | 'modal'
34
+ | 'transparentModal'
35
+ | 'containedModal'
36
+ | 'containedTransparentModal'
37
+ | 'fullScreenModal'
38
+ | 'formSheet';
39
+ export type StackAnimationTypes =
40
+ | 'default'
41
+ | 'fade'
42
+ | 'fade_from_bottom'
43
+ | 'flip'
44
+ | 'none'
45
+ | 'simple_push'
46
+ | 'slide_from_bottom'
47
+ | 'slide_from_right'
48
+ | 'slide_from_left';
49
+ export type BlurEffectTypes =
50
+ | 'extraLight'
51
+ | 'light'
52
+ | 'dark'
53
+ | 'regular'
54
+ | 'prominent'
55
+ | 'systemUltraThinMaterial'
56
+ | 'systemThinMaterial'
57
+ | 'systemMaterial'
58
+ | 'systemThickMaterial'
59
+ | 'systemChromeMaterial'
60
+ | 'systemUltraThinMaterialLight'
61
+ | 'systemThinMaterialLight'
62
+ | 'systemMaterialLight'
63
+ | 'systemThickMaterialLight'
64
+ | 'systemChromeMaterialLight'
65
+ | 'systemUltraThinMaterialDark'
66
+ | 'systemThinMaterialDark'
67
+ | 'systemMaterialDark'
68
+ | 'systemThickMaterialDark'
69
+ | 'systemChromeMaterialDark';
70
+ export type ScreenReplaceTypes = 'push' | 'pop';
71
+ export type SwipeDirectionTypes = 'vertical' | 'horizontal';
72
+ export type ScreenOrientationTypes =
73
+ | 'default'
74
+ | 'all'
75
+ | 'portrait'
76
+ | 'portrait_up'
77
+ | 'portrait_down'
78
+ | 'landscape'
79
+ | 'landscape_left'
80
+ | 'landscape_right';
81
+ export type HeaderSubviewTypes =
82
+ | 'back'
83
+ | 'right'
84
+ | 'left'
85
+ | 'center'
86
+ | 'searchBar';
87
+
88
+ export type HeaderHeightChangeEventType = {
89
+ headerHeight: number;
90
+ };
91
+
92
+ export type TransitionProgressEventType = {
93
+ progress: number;
94
+ closing: number;
95
+ goingForward: number;
96
+ };
97
+
98
+ export type GestureResponseDistanceType = {
99
+ start?: number;
100
+ end?: number;
101
+ top?: number;
102
+ bottom?: number;
103
+ };
104
+
105
+ export type SheetDetentTypes = 'medium' | 'large' | 'all';
106
+ export type SearchBarPlacement = 'automatic' | 'inline' | 'stacked';
107
+
108
+ export interface ScreenProps extends ViewProps {
109
+ active?: 0 | 1 ;
110
+ activityState?: 0 | 1 | 2;
111
+ children?: React.ReactNode;
112
+ /**
113
+ * Boolean indicating that swipe dismissal should trigger animation provided by `stackAnimation`. Defaults to `false`.
114
+ *
115
+ * @platform ios
116
+ */
117
+ customAnimationOnSwipe?: boolean;
118
+ /**
119
+ * All children screens should have the same value of their "enabled" prop as their container.
120
+ */
121
+ enabled?: boolean;
122
+ /**
123
+ * Internal boolean used to not attach events used only by native-stack. It prevents non native-stack navigators from sending transition progress from their Screen components.
124
+ */
125
+ isNativeStack?: boolean;
126
+ /**
127
+ * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
128
+ * When `enableFreeze()` is run at the top of the application defaults to `true`.
129
+ */
130
+ freezeOnBlur?: boolean;
131
+ /**
132
+ * Boolean indicating whether the swipe gesture should work on whole screen. Swiping with this option results in the same transition animation as `simple_push` by default.
133
+ * It can be changed to other custom animations with `customAnimationOnSwipe` prop, but default iOS swipe animation is not achievable due to usage of custom recognizer.
134
+ * Defaults to `false`.
135
+ *
136
+ * @platform ios
137
+ */
138
+ fullScreenSwipeEnabled?: boolean;
139
+ /**
140
+ * Whether you can use gestures to dismiss this screen. Defaults to `true`.
141
+ *
142
+ * @platform ios
143
+ */
144
+ gestureEnabled?: boolean;
145
+ /**
146
+ * Use it to restrict the distance from the edges of screen in which the gesture should be recognized. To be used alongside `fullScreenSwipeEnabled`.
147
+ *
148
+ * @platform ios
149
+ */
150
+ gestureResponseDistance?: GestureResponseDistanceType;
151
+ /**
152
+ * Whether the home indicator should be hidden on this screen. Defaults to `false`.
153
+ *
154
+ * @platform ios
155
+ */
156
+ homeIndicatorHidden?: boolean;
157
+ /**
158
+ * Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.
159
+ *
160
+ * @platform ios
161
+ */
162
+ hideKeyboardOnSwipe?: boolean;
163
+ /**
164
+ * Boolean indicating whether, when the Android default back button is clicked, the `pop` action should be performed on the native side or on the JS side to be able to prevent it.
165
+ * Unfortunately the same behavior is not available on iOS since the behavior of native back button cannot be changed there.
166
+ * Defaults to `false`.
167
+ *
168
+ * @platform android
169
+ */
170
+ nativeBackButtonDismissalEnabled?: boolean;
171
+ /**
172
+ * Sets the navigation bar color. Defaults to initial status bar color.
173
+ *
174
+ * @platform android
175
+ */
176
+ navigationBarColor?: ColorValue;
177
+ /**
178
+ * Sets the visibility of the navigation bar. Defaults to `false`.
179
+ *
180
+ * @platform android
181
+ */
182
+ navigationBarHidden?: boolean;
183
+ /**
184
+ * A callback that gets called when the current screen appears.
185
+ */
186
+ onAppear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
187
+ onComponentRef?: (view: unknown) => void;
188
+ /**
189
+ * A callback that gets called when the current screen disappears.
190
+ */
191
+ onDisappear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
192
+ /**
193
+ * A callback that gets called when the current screen is dismissed by hardware back (on Android) or dismiss gesture (swipe back or down).
194
+ * The callback takes the number of dismissed screens as an argument since iOS 14 native header back button can pop more than 1 screen at a time.
195
+ */
196
+ onDismissed?: (e: NativeSyntheticEvent<{ dismissCount: number }>) => void;
197
+ /**
198
+ * A callback that gets called when the header height has changed.
199
+ */
200
+ onHeaderHeightChange?: (
201
+ e: NativeSyntheticEvent<HeaderHeightChangeEventType>
202
+ ) => void;
203
+ /**
204
+ * A callback that gets called after swipe back is canceled.
205
+ */
206
+ onGestureCancel?: (e: NativeSyntheticEvent<null>) => void;
207
+ /**
208
+ * An internal callback that gets called when the native header back button is clicked on Android and `enableNativeBackButtonDismissal` is set to `false`. It dismises the screen using `navigation.pop()`.
209
+ *
210
+ * @platform android
211
+ */
212
+ onHeaderBackButtonClicked?: () => void;
213
+ /**
214
+ * An internal callback called when screen is dismissed by gesture or by native header back button and `preventNativeDismiss` is set to `true`.
215
+ *
216
+ * @platform ios
217
+ */
218
+ onNativeDismissCancelled?: (
219
+ e: NativeSyntheticEvent<{ dismissCount: number }>
220
+ ) => void;
221
+ /**
222
+ * An internal callback called every frame during the transition of screens of `native-stack`, used to feed transition context.
223
+ */
224
+ onTransitionProgress?: (
225
+ e: NativeSyntheticEvent<TransitionProgressEventType>
226
+ ) => void;
227
+ /**
228
+ * A callback that gets called when the current screen will appear. This is called as soon as the transition begins.
229
+ */
230
+ onWillAppear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
231
+ /**
232
+ * A callback that gets called when the current screen will disappear. This is called as soon as the transition begins.
233
+ */
234
+ onWillDisappear?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
235
+ /**
236
+ * Boolean indicating whether to prevent current screen from being dismissed.
237
+ * Defaults to `false`.
238
+ *
239
+ * @platform ios
240
+ */
241
+ preventNativeDismiss?: boolean;
242
+ ref?: React.Ref<View>;
243
+ /**
244
+ * How should the screen replacing another screen animate. Defaults to `pop`.
245
+ * The following values are currently supported:
246
+ * - "push" – the new screen will perform push animation.
247
+ * - "pop" – the new screen will perform pop animation.
248
+ */
249
+ replaceAnimation?: ScreenReplaceTypes;
250
+ /**
251
+ * In which orientation should the screen appear.
252
+ * The following values are currently supported:
253
+ * - "default" - resolves to "all" without "portrait_down" on iOS. On Android, this lets the system decide the best orientation.
254
+ * - "all" – all orientations are permitted
255
+ * - "portrait" – portrait orientations are permitted
256
+ * - "portrait_up" – right-side portrait orientation is permitted
257
+ * - "portrait_down" – upside-down portrait orientation is permitted
258
+ * - "landscape" – landscape orientations are permitted
259
+ * - "landscape_left" – landscape-left orientation is permitted
260
+ * - "landscape_right" – landscape-right orientation is permitted
261
+ */
262
+ screenOrientation?: ScreenOrientationTypes;
263
+ /**
264
+ * Describes heights where a sheet can rest.
265
+ * Works only when `stackPresentation` is set to `formSheet`.
266
+ * Defaults to `large`.
267
+ *
268
+ * Available values:
269
+ *
270
+ * - `large` - only large detent level will be allowed
271
+ * - `medium` - only medium detent level will be allowed
272
+ * - `all` - all detent levels will be allowed
273
+ *
274
+ * @platform ios
275
+ */
276
+ sheetAllowedDetents?: SheetDetentTypes;
277
+ /**
278
+ * Whether the sheet should expand to larger detent when scrolling.
279
+ * Works only when `stackPresentation` is set to `formSheet`.
280
+ * Defaults to `true`.
281
+ *
282
+ * @platform ios
283
+ */
284
+ sheetExpandsWhenScrolledToEdge?: boolean;
285
+ /**
286
+ * The corner radius that the sheet will try to render with.
287
+ * Works only when `stackPresentation` is set to `formSheet`.
288
+ *
289
+ * If set to non-negative value it will try to render sheet with provided radius, else it will apply system default.
290
+ *
291
+ * If left unset system default is used.
292
+ *
293
+ * @platform ios
294
+ */
295
+ sheetCornerRadius?: number;
296
+ /**
297
+ * Boolean indicating whether the sheet shows a grabber at the top.
298
+ * Works only when `stackPresentation` is set to `formSheet`.
299
+ * Defaults to `false`.
300
+ *
301
+ * @platform ios
302
+ */
303
+ sheetGrabberVisible?: boolean;
304
+ /**
305
+ * The largest sheet detent for which a view underneath won't be dimmed.
306
+ * Works only when `stackPresentation` is set to `formSheet`.
307
+ *
308
+ * If this prop is set to:
309
+ *
310
+ * - `large` - the view underneath won't be dimmed at any detent level
311
+ * - `medium` - the view underneath will be dimmed only when detent level is `large`
312
+ * - `all` - the view underneath will be dimmed for any detent level
313
+ *
314
+ * Defaults to `all`.
315
+ *
316
+ * @platform ios
317
+ */
318
+ sheetLargestUndimmedDetent?: SheetDetentTypes;
319
+ /**
320
+ * How the screen should appear/disappear when pushed or popped at the top of the stack.
321
+ * The following values are currently supported:
322
+ * - "default" – uses a platform default animation
323
+ * - "fade" – fades screen in or out
324
+ * - "fade_from_bottom" – performs a fade from bottom animation
325
+ * - "flip" – flips the screen, requires stackPresentation: "modal" (iOS only)
326
+ * - "simple_push" – performs a default animation, but without shadow and native header transition (iOS only)
327
+ * - `slide_from_bottom` – performs a slide from bottom animation
328
+ * - "slide_from_right" - slide in the new screen from right to left (Android only, resolves to default transition on iOS)
329
+ * - "slide_from_left" - slide in the new screen from left to right (Android only, resolves to default transition on iOS)
330
+ * - "none" – the screen appears/dissapears without an animation
331
+ */
332
+ stackAnimation?: StackAnimationTypes;
333
+ /**
334
+ * How should the screen be presented.
335
+ * The following values are currently supported:
336
+ * - "push" – the new screen will be pushed onto a stack which on iOS means that the default animation will be slide from the side, the animation on Android may vary depending on the OS version and theme.
337
+ * - "modal" – the new screen will be presented modally. In addition this allow for a nested stack to be rendered inside such screens.
338
+ * - "transparentModal" – the new screen will be presented modally but in addition the second to last screen will remain attached to the stack container such that if the top screen is non opaque the content below can still be seen. If "modal" is used instead the below screen will get unmounted as soon as the transition ends.
339
+ * - "containedModal" – will use "UIModalPresentationCurrentContext" modal style on iOS and will fallback to "modal" on Android.
340
+ * - "containedTransparentModal" – will use "UIModalPresentationOverCurrentContext" modal style on iOS and will fallback to "transparentModal" on Android.
341
+ * - "fullScreenModal" – will use "UIModalPresentationFullScreen" modal style on iOS and will fallback to "modal" on Android.
342
+ * - "formSheet" – will use "UIModalPresentationFormSheet" modal style on iOS and will fallback to "modal" on Android.
343
+ */
344
+ stackPresentation?: StackPresentationTypes;
345
+ /**
346
+ * Sets the status bar animation (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS.
347
+ */
348
+ statusBarAnimation?: 'none' | 'fade' | 'slide';
349
+ /**
350
+ * Sets the status bar color (similar to the `StatusBar` component). Defaults to initial status bar color.
351
+ *
352
+ * @platform android
353
+ */
354
+ statusBarColor?: ColorValue;
355
+ /**
356
+ * Whether the status bar should be hidden on this screen. Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `false`.
357
+ */
358
+ statusBarHidden?: boolean;
359
+ /**
360
+ * Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `auto`.
361
+ */
362
+ statusBarStyle?: 'inverted' | 'auto' | 'light' | 'dark';
363
+ /**
364
+ * Sets the translucency of the status bar. Defaults to `false`.
365
+ *
366
+ * @platform android
367
+ */
368
+ statusBarTranslucent?: boolean;
369
+ /**
370
+ * Sets the direction in which you should swipe to dismiss the screen.
371
+ * When using `vertical` option, options `fullScreenSwipeEnabled: true`, `customAnimationOnSwipe: true` and `stackAnimation: 'slide_from_bottom'` are set by default.
372
+ * The following values are supported:
373
+ * - `vertical` – dismiss screen vertically
374
+ * - `horizontal` – dismiss screen horizontally (default)
375
+ *
376
+ * @platform ios
377
+ */
378
+ swipeDirection?: SwipeDirectionTypes;
379
+ /**
380
+ * Changes the duration (in milliseconds) of `slide_from_bottom`, `fade_from_bottom`, `fade` and `simple_push` transitions on iOS. Defaults to `350`.
381
+ * The duration of `default` and `flip` transitions isn't customizable.
382
+ *
383
+ * @platform ios
384
+ */
385
+ transitionDuration?: number;
386
+ }
387
+
388
+ export interface ScreenContainerProps extends ViewProps {
389
+ children?: React.ReactNode;
390
+ /**
391
+ * A prop that gives users an option to switch between using Screens for the navigator (container). All children screens should have the same value of their "enabled" prop as their container.
392
+ */
393
+ enabled?: boolean;
394
+ /**
395
+ * A prop to be used in navigators always showing only one screen (providing only `0` or `2` `activityState` values) for better implementation of `ScreenContainer` on iOS.
396
+ */
397
+ hasTwoStates?: boolean;
398
+ }
399
+
400
+ export interface ScreenStackProps extends ViewProps {
401
+ children?: React.ReactNode;
402
+ /**
403
+ * A callback that gets called when the current screen finishes its transition.
404
+ */
405
+ onFinishTransitioning?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
406
+ }
407
+
408
+ export interface ScreenStackHeaderConfigProps extends ViewProps {
409
+ /**
410
+ * Whether to show the back button with custom left side of the header.
411
+ */
412
+ backButtonInCustomView?: boolean;
413
+ /**
414
+ * Controls the color of the navigation header.
415
+ */
416
+ backgroundColor?: ColorValue;
417
+ /**
418
+ * Title to display in the back button.
419
+ * @platform ios.
420
+ */
421
+ backTitle?: string;
422
+ /**
423
+ * Allows for customizing font family to be used for back button title on iOS.
424
+ * @platform ios
425
+ */
426
+ backTitleFontFamily?: string;
427
+ /**
428
+ * Allows for customizing font size to be used for back button title on iOS.
429
+ * @platform ios
430
+ */
431
+ backTitleFontSize?: number;
432
+ /**
433
+ * Whether the back button title should be visible or not. Defaults to `true`.
434
+ * @platform ios
435
+ */
436
+ backTitleVisible?: boolean;
437
+ /**
438
+ * Blur effect to be applied to the header. Works with backgroundColor's alpha < 1.
439
+ * @platform ios
440
+ */
441
+ blurEffect?: BlurEffectTypes;
442
+ /**
443
+ * Pass HeaderLeft, HeaderRight and HeaderTitle
444
+ */
445
+ children?: React.ReactNode;
446
+ /**
447
+ * Controls the color of items rendered on the header. This includes back icon, back text (iOS only) and title text. If you want the title to have different color use titleColor property.
448
+ */
449
+ color?: ColorValue;
450
+ /**
451
+ * Whether the stack should be in rtl or ltr form.
452
+ */
453
+ direction?: 'rtl' | 'ltr';
454
+ /**
455
+ * Boolean indicating whether to show the menu on longPress of iOS >= 14 back button.
456
+ * @platform ios
457
+ */
458
+ disableBackButtonMenu?: boolean;
459
+ /**
460
+ * When set to true the header will be hidden while the parent Screen is on the top of the stack. The default value is false.
461
+ */
462
+ hidden?: boolean;
463
+ /**
464
+ * Boolean indicating whether to hide the back button in header.
465
+ */
466
+ hideBackButton?: boolean;
467
+ /**
468
+ * Boolean indicating whether to hide the elevation shadow or the bottom border on the header.
469
+ */
470
+ hideShadow?: boolean;
471
+ /**
472
+ * Boolean to set native property to prefer large title header (like in iOS setting).
473
+ * For large title to collapse on scroll, the content of the screen should be wrapped in a scrollable view such as `ScrollView` or `FlatList`.
474
+ * If the scrollable area doesn't fill the screen, the large title won't collapse on scroll.
475
+ * Only supported on iOS.
476
+ *
477
+ * @platform ios
478
+ */
479
+ largeTitle?: boolean;
480
+ /**
481
+ * Controls the color of the navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar.
482
+ */
483
+ largeTitleBackgroundColor?: ColorValue;
484
+ /**
485
+ * Customize the color to be used for the large title. By default uses the titleColor property.
486
+ * @platform ios
487
+ */
488
+ largeTitleColor?: ColorValue;
489
+ /**
490
+ * Customize font family to be used for the large title.
491
+ * @platform ios
492
+ */
493
+ largeTitleFontFamily?: string;
494
+ /**
495
+ * Customize the size of the font to be used for the large title.
496
+ * @platform ios
497
+ */
498
+ largeTitleFontSize?: number;
499
+ /**
500
+ * Customize the weight of the font to be used for the large title.
501
+ * @platform ios
502
+ */
503
+ largeTitleFontWeight?: string;
504
+ /**
505
+ * Boolean that allows for disabling drop shadow under navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar.
506
+ */
507
+ largeTitleHideShadow?: boolean;
508
+ /**
509
+ * Callback which is executed when screen header is attached
510
+ */
511
+ onAttached?: () => void;
512
+ /**
513
+ * Callback which is executed when screen header is detached
514
+ */
515
+ onDetached?: () => void;
516
+ /**
517
+ * String that can be displayed in the header as a fallback for `headerTitle`.
518
+ */
519
+ title?: string;
520
+ /**
521
+ * Allows for setting text color of the title.
522
+ */
523
+ titleColor?: ColorValue;
524
+ /**
525
+ * Customize font family to be used for the title.
526
+ */
527
+ titleFontFamily?: string;
528
+ /**
529
+ * Customize the size of the font to be used for the title.
530
+ */
531
+ titleFontSize?: number;
532
+ /**
533
+ * Customize the weight of the font to be used for the title.
534
+ */
535
+ titleFontWeight?: string;
536
+ /**
537
+ * A flag to that lets you opt out of insetting the header. You may want to
538
+ * set this to `false` if you use an opaque status bar. Defaults to `true`.
539
+ * Only supported on Android. Insets are always applied on iOS because the
540
+ * header cannot be opaque.
541
+ *
542
+ * @platform android
543
+ */
544
+ topInsetEnabled?: boolean;
545
+ /**
546
+ * Boolean indicating whether the navigation bar is translucent.
547
+ */
548
+ translucent?: boolean;
549
+ }
550
+
551
+ export interface SearchBarProps {
552
+ /**
553
+ * Reference to imperatively modify search bar.
554
+ *
555
+ * Currently supported operations are:
556
+ *
557
+ * * `focus` - focuses the search bar
558
+ * * `blur` - removes focus from the search bar
559
+ * * `clearText` - removes any text present in the search bar input field
560
+ * * `setText` - sets the search bar's content to given value
561
+ * * `toggleCancelButton` - depending on passed boolean value, hides or shows cancel button (iOS only)
562
+ */
563
+ ref?: React.RefObject<SearchBarCommands>;
564
+
565
+ /**
566
+ * The auto-capitalization behavior
567
+ */
568
+ autoCapitalize?: 'none' | 'words' | 'sentences' | 'characters';
569
+ /**
570
+ * Automatically focuses search bar on mount
571
+ *
572
+ * @platform android
573
+ */
574
+ autoFocus?: boolean;
575
+ /**
576
+ * The search field background color
577
+ */
578
+ barTintColor?: ColorValue;
579
+ /**
580
+ * The color for the cursor caret and cancel button text.
581
+ *
582
+ * @platform ios
583
+ */
584
+ tintColor?: ColorValue;
585
+ /**
586
+ * The text to be used instead of default `Cancel` button text
587
+ *
588
+ * @platform ios
589
+ */
590
+ cancelButtonText?: string;
591
+ /**
592
+ * Specifies whether the back button should close search bar's text input or not.
593
+ *
594
+ * @platform android
595
+ */
596
+ disableBackButtonOverride?: boolean;
597
+ /**
598
+ * Indicates whether to hide the navigation bar
599
+ *
600
+ * @platform ios
601
+ */
602
+ hideNavigationBar?: boolean;
603
+ /**
604
+ * Indicates whether to hide the search bar when scrolling
605
+ *
606
+ * @platform ios
607
+ */
608
+ hideWhenScrolling?: boolean;
609
+
610
+ /**
611
+ * Sets type of the input. Defaults to `text`.
612
+ *
613
+ * @platform android
614
+ */
615
+ inputType?: 'text' | 'phone' | 'number' | 'email';
616
+ /**
617
+ * Indicates whether to obscure the underlying content
618
+ */
619
+ obscureBackground?: boolean;
620
+ /**
621
+ * A callback that gets called when search bar has lost focus
622
+ */
623
+ onBlur?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
624
+ /**
625
+ * A callback that gets called when the cancel button is pressed
626
+ *
627
+ * @platform ios
628
+ */
629
+ onCancelButtonPress?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
630
+
631
+ /**
632
+ * A callback that gets called when the text changes. It receives the current text value of the search bar.
633
+ */
634
+ onChangeText?: (e: NativeSyntheticEvent<TextInputFocusEventData>) => void;
635
+
636
+ /**
637
+ * A callback that gets called when search bar is closed
638
+ *
639
+ * @platform android
640
+ */
641
+ onClose?: () => void;
642
+ /**
643
+ * A callback that gets called when search bar has received focus
644
+ */
645
+ onFocus?: (e: NativeSyntheticEvent<TargetedEvent>) => void;
646
+ /**
647
+ * A callback that gets called when search bar is opened
648
+ *
649
+ * @platform android
650
+ */
651
+ onOpen?: () => void;
652
+ /**
653
+ * A callback that gets called when the search button is pressed. It receives the current text value of the search bar.
654
+ */
655
+ onSearchButtonPress?: (
656
+ e: NativeSyntheticEvent<TextInputFocusEventData>
657
+ ) => void;
658
+ /**
659
+ * Text displayed when search field is empty
660
+ */
661
+ placeholder?: string;
662
+ /**
663
+ * Position of the search bar
664
+ *
665
+ * Supported values:
666
+ *
667
+ * * `automatic` - the search bar is placed according to current layout
668
+ * * `inline` - the search bar is placed on the trailing edge of navigation bar
669
+ * * `stacked` - the search bar is placed below the other content in navigation bar
670
+ *
671
+ * Defaults to `stacked`
672
+ *
673
+ * @platform iOS (>= 16.0)
674
+ */
675
+ placement?: SearchBarPlacement;
676
+ /**
677
+ * The search field text color
678
+ */
679
+ textColor?: ColorValue;
680
+ /**
681
+ * The search hint text color
682
+ *
683
+ * @plaform android
684
+ */
685
+ hintTextColor?: ColorValue;
686
+ /**
687
+ * The search and close icon color shown in the header
688
+ *
689
+ * @plaform android
690
+ */
691
+ headerIconColor?: ColorValue;
692
+ /**
693
+ * Show the search hint icon when search bar is focused
694
+ *
695
+ * @plaform android
696
+ * @default true
697
+ */
698
+ shouldShowHintSearchIcon?: boolean;
699
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+
3
+ import TransitionProgressContext from './TransitionProgressContext';
4
+
5
+ export default function useTransitionProgress() {
6
+ const progress = React.useContext(TransitionProgressContext);
7
+
8
+ if (progress === undefined) {
9
+ throw new Error(
10
+ "Couldn't find values for transition progress. Are you inside a screen in Native Stack?"
11
+ );
12
+ }
13
+
14
+ return progress;
15
+ }