@amazon-devices/react-native-screens 2.0.1758683737 → 3.0.9000000000

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 (673) hide show
  1. package/README.md +57 -18
  2. package/RNScreens.podspec +12 -30
  3. package/SystemBundles/31d5b6b69618249f6233b73a1de7c4d890c86be7ccb031ce7cf2dcc41783f9f7.bundle +45301 -0
  4. package/SystemBundles/31d5b6b69618249f6233b73a1de7c4d890c86be7ccb031ce7cf2dcc41783f9f7.map +13711 -0
  5. package/SystemModules/amzn__react-native-screens-3.modules.txt +158 -0
  6. package/SystemModules/amzn__react-native-screens-3.private.modules.txt +377 -0
  7. package/SystemModules/keplerscript-system-bundle-config.json +4 -4
  8. package/THIRD_PARTY_NOTICES.txt +1 -684
  9. package/android/CMakeLists.txt +80 -0
  10. package/android/build.gradle +96 -17
  11. package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledHeaderConfigViewGroup.kt +61 -0
  12. package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +38 -25
  13. package/android/src/fabric/java/com/swmansion/rnscreens/NativeProxy.kt +53 -0
  14. package/android/src/main/cpp/NativeProxy.cpp +51 -0
  15. package/android/src/main/cpp/NativeProxy.h +35 -0
  16. package/android/src/main/cpp/OnLoad.cpp +8 -0
  17. package/android/src/main/cpp/jni-adapter.cpp +106 -0
  18. package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +20 -10
  19. package/android/src/main/java/com/swmansion/rnscreens/CustomToolbar.kt +69 -1
  20. package/android/src/main/java/com/swmansion/rnscreens/FragmentBackPressOverrider.kt +8 -8
  21. package/android/src/main/java/com/swmansion/rnscreens/InsetsObserverProxy.kt +104 -0
  22. package/android/src/main/java/com/swmansion/rnscreens/ModalScreenViewManager.kt +12 -0
  23. package/android/src/main/java/com/swmansion/rnscreens/NativeDismissalObserver.kt +12 -0
  24. package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +65 -7
  25. package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +327 -84
  26. package/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt +122 -72
  27. package/android/src/main/java/com/swmansion/rnscreens/ScreenContainerViewManager.kt +27 -4
  28. package/android/src/main/java/com/swmansion/rnscreens/ScreenContentWrapper.kt +38 -0
  29. package/android/src/main/java/com/swmansion/rnscreens/ScreenContentWrapperManager.kt +25 -0
  30. package/android/src/main/java/com/swmansion/rnscreens/ScreenEventDispatcher.kt +10 -2
  31. package/android/src/main/java/com/swmansion/rnscreens/ScreenFooter.kt +299 -0
  32. package/android/src/main/java/com/swmansion/rnscreens/ScreenFooterManager.kt +25 -0
  33. package/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt +91 -67
  34. package/android/src/main/java/com/swmansion/rnscreens/ScreenFragmentWrapper.kt +12 -1
  35. package/android/src/main/java/com/swmansion/rnscreens/ScreenModalFragment.kt +281 -0
  36. package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +184 -81
  37. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +467 -80
  38. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragmentWrapper.kt +8 -1
  39. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +156 -124
  40. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigShadowNode.kt +25 -0
  41. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +159 -39
  42. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt +24 -9
  43. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubviewManager.kt +19 -13
  44. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt +31 -28
  45. package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +276 -71
  46. package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +124 -64
  47. package/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt +127 -0
  48. package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +4 -2
  49. package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +160 -53
  50. package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +57 -32
  51. package/android/src/main/java/com/swmansion/rnscreens/SearchViewFormatter.kt +15 -10
  52. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetBehaviorExt.kt +42 -0
  53. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetDialogRootView.kt +104 -0
  54. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetDialogScreen.kt +26 -0
  55. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/DimmingFragment.kt +493 -0
  56. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/DimmingView.kt +66 -0
  57. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/GestureTransparentViewGroup.kt +24 -0
  58. package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/SheetUtils.kt +135 -0
  59. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +7 -8
  60. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt +8 -9
  61. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +7 -8
  62. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +9 -10
  63. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt +4 -1
  64. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt +4 -1
  65. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt +8 -4
  66. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt +13 -16
  67. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt +4 -1
  68. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt +4 -1
  69. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +8 -9
  70. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +8 -11
  71. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +7 -8
  72. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +8 -9
  73. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +7 -8
  74. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +12 -11
  75. package/android/src/main/java/com/swmansion/rnscreens/events/SheetDetentChangedEvent.kt +27 -0
  76. package/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt +4 -1
  77. package/android/src/main/java/com/swmansion/rnscreens/ext/NumericExt.kt +12 -0
  78. package/android/src/main/java/com/swmansion/rnscreens/ext/ViewExt.kt +32 -0
  79. package/android/src/main/java/com/swmansion/rnscreens/utils/DeviceUtils.kt +1 -5
  80. package/android/src/main/java/com/swmansion/rnscreens/utils/PaddingBundle.kt +8 -0
  81. package/android/src/main/java/com/swmansion/rnscreens/utils/ScreenDummyLayoutHelper.kt +282 -0
  82. package/android/src/main/jni/CMakeLists.txt +35 -23
  83. package/android/src/main/jni/rnscreens.h +3 -0
  84. package/android/src/main/res/base/anim/rns_ios_from_left_background_close.xml +5 -0
  85. package/android/src/main/res/base/anim/rns_ios_from_left_background_open.xml +5 -0
  86. package/android/src/main/res/base/anim/rns_ios_from_left_foreground_close.xml +6 -0
  87. package/android/src/main/res/base/anim/rns_ios_from_left_foreground_open.xml +6 -0
  88. package/android/src/main/res/base/anim/rns_ios_from_right_background_close.xml +5 -0
  89. package/android/src/main/res/base/anim/rns_ios_from_right_background_open.xml +5 -0
  90. package/android/src/main/res/base/anim/rns_ios_from_right_foreground_close.xml +6 -0
  91. package/android/src/main/res/base/anim/rns_ios_from_right_foreground_open.xml +6 -0
  92. package/android/src/main/res/base/drawable/rns_rounder_top_corners_shape.xml +8 -0
  93. package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +0 -1
  94. package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +2 -2
  95. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerDelegate.java +25 -0
  96. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerInterface.java +16 -0
  97. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContentWrapperManagerDelegate.java +25 -0
  98. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContentWrapperManagerInterface.java +16 -0
  99. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenFooterManagerDelegate.java +25 -0
  100. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenFooterManagerInterface.java +16 -0
  101. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +16 -3
  102. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +7 -2
  103. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +6 -0
  104. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +2 -0
  105. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerDelegate.java +99 -0
  106. package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerInterface.java +37 -0
  107. package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledHeaderConfigViewGroup.kt +39 -0
  108. package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +11 -2
  109. package/android/src/paper/java/com/swmansion/rnscreens/NativeProxy.kt +19 -0
  110. package/android/src/paper/java/com/swmansion/rnscreens/NativeScreensModuleSpec.java +36 -0
  111. package/common/cpp/react/renderer/components/rnscreens/FrameCorrectionModes.h +51 -0
  112. package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenComponentDescriptor.h +40 -0
  113. package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.cpp +16 -0
  114. package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.h +32 -0
  115. package/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +55 -12
  116. package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +157 -0
  117. package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +31 -11
  118. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigComponentDescriptor.h +49 -0
  119. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigShadowNode.cpp +22 -0
  120. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigShadowNode.h +40 -0
  121. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigState.cpp +34 -0
  122. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigState.h +57 -0
  123. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewComponentDescriptor.h +27 -0
  124. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewShadowNode.cpp +8 -0
  125. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewShadowNode.h +31 -0
  126. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewState.cpp +15 -0
  127. package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewState.h +39 -0
  128. package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +23 -2
  129. package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +33 -8
  130. package/common/cpp/react/renderer/components/rnscreens/utils/RectUtil.h +36 -0
  131. package/cpp/RNSScreenRemovalListener.cpp +25 -0
  132. package/cpp/RNSScreenRemovalListener.h +20 -0
  133. package/cpp/RNScreensTurboModule.cpp +115 -0
  134. package/cpp/RNScreensTurboModule.h +40 -0
  135. package/gesture-handler/package.json +6 -0
  136. package/ios/RNSConvert.h +24 -4
  137. package/ios/RNSConvert.mm +180 -55
  138. package/ios/RNSEnums.h +48 -0
  139. package/ios/RNSFullWindowOverlay.mm +12 -2
  140. package/ios/RNSModalScreen.h +8 -0
  141. package/ios/RNSModalScreen.mm +65 -0
  142. package/ios/RNSModule.h +19 -0
  143. package/ios/RNSModule.mm +173 -0
  144. package/ios/RNSPercentDrivenInteractiveTransition.h +12 -0
  145. package/ios/RNSPercentDrivenInteractiveTransition.mm +69 -0
  146. package/ios/RNSScreen.h +24 -5
  147. package/ios/RNSScreen.mm +652 -173
  148. package/ios/RNSScreenContainer.mm +12 -1
  149. package/ios/RNSScreenContentWrapper.h +44 -0
  150. package/ios/RNSScreenContentWrapper.mm +67 -0
  151. package/ios/RNSScreenFooter.h +30 -0
  152. package/ios/RNSScreenFooter.mm +142 -0
  153. package/ios/RNSScreenNavigationContainer.mm +7 -0
  154. package/ios/RNSScreenStack.h +6 -0
  155. package/ios/RNSScreenStack.mm +333 -109
  156. package/ios/RNSScreenStackAnimator.h +15 -1
  157. package/ios/RNSScreenStackAnimator.mm +380 -115
  158. package/ios/RNSScreenStackHeaderConfig.h +74 -6
  159. package/ios/RNSScreenStackHeaderConfig.mm +338 -69
  160. package/ios/RNSScreenStackHeaderSubview.h +0 -7
  161. package/ios/RNSScreenStackHeaderSubview.mm +61 -24
  162. package/ios/RNSScreenWindowTraits.h +1 -1
  163. package/ios/RNSScreenWindowTraits.mm +24 -50
  164. package/ios/RNSSearchBar.h +5 -5
  165. package/ios/RNSSearchBar.mm +42 -11
  166. package/ios/events/RNSHeaderHeightChangeEvent.h +0 -1
  167. package/ios/events/RNSHeaderHeightChangeEvent.mm +15 -0
  168. package/ios/events/RNSScreenViewEvent.h +0 -1
  169. package/ios/utils/RCTSurfaceTouchHandler+RNSUtility.h +15 -0
  170. package/ios/utils/RCTSurfaceTouchHandler+RNSUtility.mm +14 -0
  171. package/ios/utils/RCTTouchHandler+RNSUtility.h +15 -0
  172. package/ios/utils/RCTTouchHandler+RNSUtility.mm +15 -0
  173. package/ios/utils/RNSDefines.h +7 -0
  174. package/ios/utils/RNSUIBarButtonItem.h +2 -0
  175. package/ios/utils/UINavigationBar+RNSUtility.h +37 -0
  176. package/ios/utils/UINavigationBar+RNSUtility.mm +44 -0
  177. package/ios/utils/UIView+RNSUtility.h +23 -0
  178. package/ios/utils/UIView+RNSUtility.mm +54 -0
  179. package/kepler-compatibility.json +2 -4
  180. package/lib/commonjs/TransitionProgressContext.js +1 -0
  181. package/lib/commonjs/TransitionProgressContext.js.map +1 -1
  182. package/lib/commonjs/components/DebugContainer.js +39 -0
  183. package/lib/commonjs/components/DebugContainer.js.map +1 -0
  184. package/lib/commonjs/components/DebugContainer.web.js +15 -0
  185. package/lib/commonjs/components/DebugContainer.web.js.map +1 -0
  186. package/lib/commonjs/components/FullWindowOverlay.js +31 -0
  187. package/lib/commonjs/components/FullWindowOverlay.js.map +1 -0
  188. package/lib/commonjs/components/FullWindowOverlay.web.js +9 -0
  189. package/lib/commonjs/components/FullWindowOverlay.web.js.map +1 -0
  190. package/lib/commonjs/components/Screen.js +286 -0
  191. package/lib/commonjs/components/Screen.js.map +1 -0
  192. package/lib/commonjs/components/Screen.web.js +47 -0
  193. package/lib/commonjs/components/Screen.web.js.map +1 -0
  194. package/lib/commonjs/components/ScreenContainer.js +32 -0
  195. package/lib/commonjs/components/ScreenContainer.js.map +1 -0
  196. package/lib/commonjs/components/ScreenContainer.web.js +10 -0
  197. package/lib/commonjs/components/ScreenContainer.web.js.map +1 -0
  198. package/lib/commonjs/components/ScreenContentWrapper.js +17 -0
  199. package/lib/commonjs/components/ScreenContentWrapper.js.map +1 -0
  200. package/lib/commonjs/components/ScreenContentWrapper.web.js +10 -0
  201. package/lib/commonjs/components/ScreenContentWrapper.web.js.map +1 -0
  202. package/lib/commonjs/components/ScreenFooter.js +25 -0
  203. package/lib/commonjs/components/ScreenFooter.js.map +1 -0
  204. package/lib/commonjs/components/ScreenFooter.web.js +11 -0
  205. package/lib/commonjs/components/ScreenFooter.web.js.map +1 -0
  206. package/lib/commonjs/components/ScreenStack.js +67 -0
  207. package/lib/commonjs/components/ScreenStack.js.map +1 -0
  208. package/lib/commonjs/components/ScreenStack.web.js +10 -0
  209. package/lib/commonjs/components/ScreenStack.web.js.map +1 -0
  210. package/lib/commonjs/components/ScreenStackHeaderConfig.js +90 -0
  211. package/lib/commonjs/components/ScreenStackHeaderConfig.js.map +1 -0
  212. package/lib/commonjs/components/ScreenStackHeaderConfig.web.js +27 -0
  213. package/lib/commonjs/components/ScreenStackHeaderConfig.web.js.map +1 -0
  214. package/lib/commonjs/components/ScreenStackItem.js +107 -0
  215. package/lib/commonjs/components/ScreenStackItem.js.map +1 -0
  216. package/lib/commonjs/components/SearchBar.js +63 -0
  217. package/lib/commonjs/components/SearchBar.js.map +1 -0
  218. package/lib/commonjs/components/SearchBar.web.js +10 -0
  219. package/lib/commonjs/components/SearchBar.web.js.map +1 -0
  220. package/lib/commonjs/components/helpers/DelayedFreeze.js +31 -0
  221. package/lib/commonjs/components/helpers/DelayedFreeze.js.map +1 -0
  222. package/lib/commonjs/components/helpers/usePrevious.js +15 -0
  223. package/lib/commonjs/components/helpers/usePrevious.js.map +1 -0
  224. package/lib/commonjs/contexts.js +11 -0
  225. package/lib/commonjs/contexts.js.map +1 -0
  226. package/lib/commonjs/core.js +40 -0
  227. package/lib/commonjs/core.js.map +1 -0
  228. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +16 -1
  229. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
  230. package/lib/commonjs/fabric/ModalScreenNativeComponent.js +14 -0
  231. package/lib/commonjs/fabric/ModalScreenNativeComponent.js.map +1 -0
  232. package/lib/commonjs/fabric/NativeScreensModule.js +10 -0
  233. package/lib/commonjs/fabric/NativeScreensModule.js.map +1 -0
  234. package/lib/commonjs/fabric/NativeScreensModule.web.js +8 -0
  235. package/lib/commonjs/fabric/NativeScreensModule.web.js.map +1 -0
  236. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +8 -11
  237. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
  238. package/lib/commonjs/fabric/ScreenContentWrapperNativeComponent.js +18 -0
  239. package/lib/commonjs/fabric/ScreenContentWrapperNativeComponent.js.map +1 -0
  240. package/lib/commonjs/fabric/ScreenFooterNativeComponent.js +10 -0
  241. package/lib/commonjs/fabric/ScreenFooterNativeComponent.js.map +1 -0
  242. package/lib/commonjs/fabric/ScreenNativeComponent.js +16 -16
  243. package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
  244. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +2 -1
  245. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
  246. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +10 -9
  247. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  248. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +5 -2
  249. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
  250. package/lib/commonjs/fabric/ScreenStackNativeComponent.js +8 -11
  251. package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
  252. package/lib/commonjs/fabric/SearchBarNativeComponent.js +4 -5
  253. package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
  254. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +19 -0
  255. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js.map +1 -0
  256. package/lib/commonjs/gesture-handler/RNScreensTurboModule.js +8 -0
  257. package/lib/commonjs/gesture-handler/RNScreensTurboModule.js.map +1 -0
  258. package/lib/commonjs/gesture-handler/ScreenGestureDetector.js +201 -0
  259. package/lib/commonjs/gesture-handler/ScreenGestureDetector.js.map +1 -0
  260. package/lib/commonjs/gesture-handler/constraints.js +64 -0
  261. package/lib/commonjs/gesture-handler/constraints.js.map +1 -0
  262. package/lib/commonjs/gesture-handler/defaults.js +45 -0
  263. package/lib/commonjs/gesture-handler/defaults.js.map +1 -0
  264. package/lib/commonjs/gesture-handler/fabricUtils.js +66 -0
  265. package/lib/commonjs/gesture-handler/fabricUtils.js.map +1 -0
  266. package/lib/commonjs/gesture-handler/fabricUtils.web.js +17 -0
  267. package/lib/commonjs/gesture-handler/fabricUtils.web.js.map +1 -0
  268. package/lib/commonjs/gesture-handler/index.js +14 -0
  269. package/lib/commonjs/gesture-handler/index.js.map +1 -0
  270. package/lib/commonjs/index.js +157 -93
  271. package/lib/commonjs/index.js.map +1 -1
  272. package/lib/commonjs/native-stack/contexts/GHContext.js +12 -0
  273. package/lib/commonjs/native-stack/contexts/GHContext.js.map +1 -0
  274. package/lib/commonjs/native-stack/index.js.map +1 -1
  275. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +21 -20
  276. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  277. package/lib/commonjs/native-stack/types.js.map +1 -1
  278. package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
  279. package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
  280. package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
  281. package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
  282. package/lib/commonjs/native-stack/utils/getStatusBarHeight.js +22 -0
  283. package/lib/commonjs/native-stack/utils/getStatusBarHeight.js.map +1 -0
  284. package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
  285. package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +2 -4
  286. package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
  287. package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
  288. package/lib/commonjs/native-stack/views/FontProcessor.js +1 -3
  289. package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
  290. package/lib/commonjs/native-stack/views/FooterComponent.js +17 -0
  291. package/lib/commonjs/native-stack/views/FooterComponent.js.map +1 -0
  292. package/lib/commonjs/native-stack/views/HeaderConfig.js +21 -13
  293. package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
  294. package/lib/commonjs/native-stack/views/NativeStackView.js +118 -52
  295. package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
  296. package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
  297. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +15 -21
  298. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  299. package/lib/commonjs/reanimated/ReanimatedScreen.js +2 -2
  300. package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
  301. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +8 -16
  302. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
  303. package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
  304. package/lib/commonjs/reanimated/index.js.map +1 -1
  305. package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +2 -2
  306. package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -1
  307. package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
  308. package/lib/commonjs/types.js.map +1 -1
  309. package/lib/commonjs/useTransitionProgress.js.map +1 -1
  310. package/lib/commonjs/utils.js +28 -6
  311. package/lib/commonjs/utils.js.map +1 -1
  312. package/lib/module/TransitionProgressContext.js +2 -0
  313. package/lib/module/TransitionProgressContext.js.map +1 -1
  314. package/lib/module/components/DebugContainer.js +30 -0
  315. package/lib/module/components/DebugContainer.js.map +1 -0
  316. package/lib/module/components/DebugContainer.web.js +6 -0
  317. package/lib/module/components/DebugContainer.web.js.map +1 -0
  318. package/lib/module/components/FullWindowOverlay.js +24 -0
  319. package/lib/module/components/FullWindowOverlay.js.map +1 -0
  320. package/lib/module/components/FullWindowOverlay.web.js +3 -0
  321. package/lib/module/components/FullWindowOverlay.web.js.map +1 -0
  322. package/lib/module/components/Screen.js +282 -0
  323. package/lib/module/components/Screen.js.map +1 -0
  324. package/lib/module/components/Screen.web.js +40 -0
  325. package/lib/module/components/Screen.web.js.map +1 -0
  326. package/lib/module/components/ScreenContainer.js +26 -0
  327. package/lib/module/components/ScreenContainer.js.map +1 -0
  328. package/lib/module/components/ScreenContainer.web.js +4 -0
  329. package/lib/module/components/ScreenContainer.web.js.map +1 -0
  330. package/lib/module/components/ScreenContentWrapper.js +10 -0
  331. package/lib/module/components/ScreenContentWrapper.js.map +1 -0
  332. package/lib/module/components/ScreenContentWrapper.web.js +4 -0
  333. package/lib/module/components/ScreenContentWrapper.web.js.map +1 -0
  334. package/lib/module/components/ScreenFooter.js +18 -0
  335. package/lib/module/components/ScreenFooter.js.map +1 -0
  336. package/lib/module/components/ScreenFooter.web.js +6 -0
  337. package/lib/module/components/ScreenFooter.web.js.map +1 -0
  338. package/lib/module/components/ScreenStack.js +63 -0
  339. package/lib/module/components/ScreenStack.js.map +1 -0
  340. package/lib/module/components/ScreenStack.web.js +4 -0
  341. package/lib/module/components/ScreenStack.web.js.map +1 -0
  342. package/lib/module/components/ScreenStackHeaderConfig.js +81 -0
  343. package/lib/module/components/ScreenStackHeaderConfig.js.map +1 -0
  344. package/lib/module/components/ScreenStackHeaderConfig.web.js +14 -0
  345. package/lib/module/components/ScreenStackHeaderConfig.web.js.map +1 -0
  346. package/lib/module/components/ScreenStackItem.js +98 -0
  347. package/lib/module/components/ScreenStackItem.js.map +1 -0
  348. package/lib/module/components/SearchBar.js +57 -0
  349. package/lib/module/components/SearchBar.js.map +1 -0
  350. package/lib/module/components/SearchBar.web.js +4 -0
  351. package/lib/module/components/SearchBar.web.js.map +1 -0
  352. package/lib/module/components/helpers/DelayedFreeze.js +24 -0
  353. package/lib/module/components/helpers/DelayedFreeze.js.map +1 -0
  354. package/lib/module/components/helpers/usePrevious.js +9 -0
  355. package/lib/module/components/helpers/usePrevious.js.map +1 -0
  356. package/lib/module/contexts.js +4 -0
  357. package/lib/module/contexts.js.map +1 -0
  358. package/lib/module/core.js +31 -0
  359. package/lib/module/core.js.map +1 -0
  360. package/lib/module/fabric/FullWindowOverlayNativeComponent.js +16 -0
  361. package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
  362. package/lib/module/fabric/ModalScreenNativeComponent.js +10 -0
  363. package/lib/module/fabric/ModalScreenNativeComponent.js.map +1 -0
  364. package/lib/module/fabric/NativeScreensModule.js +5 -0
  365. package/lib/module/fabric/NativeScreensModule.js.map +1 -0
  366. package/lib/module/fabric/NativeScreensModule.web.js +2 -0
  367. package/lib/module/fabric/NativeScreensModule.web.js.map +1 -0
  368. package/lib/module/fabric/ScreenContainerNativeComponent.js +3 -4
  369. package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
  370. package/lib/module/fabric/ScreenContentWrapperNativeComponent.js +10 -0
  371. package/lib/module/fabric/ScreenContentWrapperNativeComponent.js.map +1 -0
  372. package/lib/module/fabric/ScreenFooterNativeComponent.js +3 -0
  373. package/lib/module/fabric/ScreenFooterNativeComponent.js.map +1 -0
  374. package/lib/module/fabric/ScreenNativeComponent.js +11 -8
  375. package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
  376. package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +2 -0
  377. package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
  378. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +8 -2
  379. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  380. package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +5 -1
  381. package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
  382. package/lib/module/fabric/ScreenStackNativeComponent.js +3 -3
  383. package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
  384. package/lib/module/fabric/SearchBarNativeComponent.js +3 -1
  385. package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
  386. package/lib/module/gesture-handler/GestureDetectorProvider.js +12 -0
  387. package/lib/module/gesture-handler/GestureDetectorProvider.js.map +1 -0
  388. package/lib/module/gesture-handler/RNScreensTurboModule.js +2 -0
  389. package/lib/module/gesture-handler/RNScreensTurboModule.js.map +1 -0
  390. package/lib/module/gesture-handler/ScreenGestureDetector.js +193 -0
  391. package/lib/module/gesture-handler/ScreenGestureDetector.js.map +1 -0
  392. package/lib/module/gesture-handler/constraints.js +56 -0
  393. package/lib/module/gesture-handler/constraints.js.map +1 -0
  394. package/lib/module/gesture-handler/defaults.js +39 -0
  395. package/lib/module/gesture-handler/defaults.js.map +1 -0
  396. package/lib/module/gesture-handler/fabricUtils.js +61 -0
  397. package/lib/module/gesture-handler/fabricUtils.js.map +1 -0
  398. package/lib/module/gesture-handler/fabricUtils.web.js +10 -0
  399. package/lib/module/gesture-handler/fabricUtils.web.js.map +1 -0
  400. package/lib/module/gesture-handler/index.js +5 -0
  401. package/lib/module/gesture-handler/index.js.map +1 -0
  402. package/lib/module/index.js +29 -63
  403. package/lib/module/index.js.map +1 -1
  404. package/lib/module/native-stack/contexts/GHContext.js +6 -0
  405. package/lib/module/native-stack/contexts/GHContext.js.map +1 -0
  406. package/lib/module/native-stack/index.js.map +1 -1
  407. package/lib/module/native-stack/navigators/createNativeStackNavigator.js +21 -20
  408. package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  409. package/lib/module/native-stack/types.js.map +1 -1
  410. package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
  411. package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -1
  412. package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
  413. package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
  414. package/lib/module/native-stack/utils/getStatusBarHeight.js +16 -0
  415. package/lib/module/native-stack/utils/getStatusBarHeight.js.map +1 -0
  416. package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
  417. package/lib/module/native-stack/utils/useBackPressSubscription.js +2 -4
  418. package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
  419. package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
  420. package/lib/module/native-stack/views/FontProcessor.js +2 -3
  421. package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
  422. package/lib/module/native-stack/views/FooterComponent.js +10 -0
  423. package/lib/module/native-stack/views/FooterComponent.js.map +1 -0
  424. package/lib/module/native-stack/views/HeaderConfig.js +13 -6
  425. package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
  426. package/lib/module/native-stack/views/NativeStackView.js +114 -46
  427. package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
  428. package/lib/module/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
  429. package/lib/module/reanimated/ReanimatedNativeStackScreen.js +8 -12
  430. package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  431. package/lib/module/reanimated/ReanimatedScreen.js +1 -2
  432. package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
  433. package/lib/module/reanimated/ReanimatedScreenProvider.js +7 -15
  434. package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
  435. package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
  436. package/lib/module/reanimated/index.js.map +1 -1
  437. package/lib/module/reanimated/useReanimatedHeaderHeight.js +1 -1
  438. package/lib/module/reanimated/useReanimatedHeaderHeight.js.map +1 -1
  439. package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
  440. package/lib/module/types.js.map +1 -1
  441. package/lib/module/useTransitionProgress.js.map +1 -1
  442. package/lib/module/utils.js +26 -5
  443. package/lib/module/utils.js.map +1 -1
  444. package/lib/typescript/TransitionProgressContext.d.ts +2 -1
  445. package/lib/typescript/TransitionProgressContext.d.ts.map +1 -0
  446. package/lib/typescript/components/DebugContainer.d.ts +15 -0
  447. package/lib/typescript/components/DebugContainer.d.ts.map +1 -0
  448. package/lib/typescript/components/DebugContainer.web.d.ts +4 -0
  449. package/lib/typescript/components/DebugContainer.web.d.ts.map +1 -0
  450. package/lib/typescript/components/FullWindowOverlay.d.ts +6 -0
  451. package/lib/typescript/components/FullWindowOverlay.d.ts.map +1 -0
  452. package/lib/typescript/components/FullWindowOverlay.web.d.ts +6 -0
  453. package/lib/typescript/components/FullWindowOverlay.web.d.ts.map +1 -0
  454. package/lib/typescript/components/Screen.d.ts +8 -0
  455. package/lib/typescript/components/Screen.d.ts.map +1 -0
  456. package/lib/typescript/components/Screen.web.d.ts +11 -0
  457. package/lib/typescript/components/Screen.web.d.ts.map +1 -0
  458. package/lib/typescript/components/ScreenContainer.d.ts +5 -0
  459. package/lib/typescript/components/ScreenContainer.d.ts.map +1 -0
  460. package/lib/typescript/components/ScreenContainer.web.d.ts +4 -0
  461. package/lib/typescript/components/ScreenContainer.web.d.ts.map +1 -0
  462. package/lib/typescript/components/ScreenContentWrapper.d.ts +5 -0
  463. package/lib/typescript/components/ScreenContentWrapper.d.ts.map +1 -0
  464. package/lib/typescript/components/ScreenContentWrapper.web.d.ts +4 -0
  465. package/lib/typescript/components/ScreenContentWrapper.web.d.ts.map +1 -0
  466. package/lib/typescript/components/ScreenFooter.d.ts +12 -0
  467. package/lib/typescript/components/ScreenFooter.d.ts.map +1 -0
  468. package/lib/typescript/components/ScreenFooter.web.d.ts +6 -0
  469. package/lib/typescript/components/ScreenFooter.web.d.ts.map +1 -0
  470. package/lib/typescript/components/ScreenStack.d.ts +5 -0
  471. package/lib/typescript/components/ScreenStack.d.ts.map +1 -0
  472. package/lib/typescript/components/ScreenStack.web.d.ts +4 -0
  473. package/lib/typescript/components/ScreenStack.web.d.ts.map +1 -0
  474. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +13 -0
  475. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -0
  476. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +13 -0
  477. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -0
  478. package/lib/typescript/components/ScreenStackItem.d.ts +11 -0
  479. package/lib/typescript/components/ScreenStackItem.d.ts.map +1 -0
  480. package/lib/typescript/components/SearchBar.d.ts +5 -0
  481. package/lib/typescript/components/SearchBar.d.ts.map +1 -0
  482. package/lib/typescript/components/SearchBar.web.d.ts +4 -0
  483. package/lib/typescript/components/SearchBar.web.d.ts.map +1 -0
  484. package/lib/typescript/components/helpers/DelayedFreeze.d.ts +8 -0
  485. package/lib/typescript/components/helpers/DelayedFreeze.d.ts.map +1 -0
  486. package/lib/typescript/components/helpers/usePrevious.d.ts +2 -0
  487. package/lib/typescript/components/helpers/usePrevious.d.ts.map +1 -0
  488. package/lib/typescript/contexts.d.ts +5 -0
  489. package/lib/typescript/contexts.d.ts.map +1 -0
  490. package/lib/typescript/core.d.ts +6 -0
  491. package/lib/typescript/core.d.ts.map +1 -0
  492. package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +1 -1
  493. package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts.map +1 -0
  494. package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts +76 -0
  495. package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts.map +1 -0
  496. package/lib/typescript/fabric/NativeScreensModule.d.ts +6 -0
  497. package/lib/typescript/fabric/NativeScreensModule.d.ts.map +1 -0
  498. package/lib/typescript/fabric/NativeScreensModule.web.d.ts +3 -0
  499. package/lib/typescript/fabric/NativeScreensModule.web.d.ts.map +1 -0
  500. package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +1 -0
  501. package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts.map +1 -0
  502. package/lib/typescript/fabric/ScreenContentWrapperNativeComponent.d.ts +6 -0
  503. package/lib/typescript/fabric/ScreenContentWrapperNativeComponent.d.ts.map +1 -0
  504. package/lib/typescript/fabric/ScreenFooterNativeComponent.d.ts +7 -0
  505. package/lib/typescript/fabric/ScreenFooterNativeComponent.d.ts.map +1 -0
  506. package/lib/typescript/fabric/ScreenNativeComponent.d.ts +34 -24
  507. package/lib/typescript/fabric/ScreenNativeComponent.d.ts.map +1 -0
  508. package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +1 -1
  509. package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts.map +1 -0
  510. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +12 -2
  511. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -0
  512. package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +2 -2
  513. package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts.map +1 -0
  514. package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +4 -2
  515. package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts.map +1 -0
  516. package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +17 -16
  517. package/lib/typescript/fabric/SearchBarNativeComponent.d.ts.map +1 -0
  518. package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts +5 -0
  519. package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts.map +1 -0
  520. package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts +13 -0
  521. package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts.map +1 -0
  522. package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts +5 -0
  523. package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts.map +1 -0
  524. package/lib/typescript/gesture-handler/constraints.d.ts +6 -0
  525. package/lib/typescript/gesture-handler/constraints.d.ts.map +1 -0
  526. package/lib/typescript/gesture-handler/defaults.d.ts +20 -0
  527. package/lib/typescript/gesture-handler/defaults.d.ts.map +1 -0
  528. package/lib/typescript/gesture-handler/fabricUtils.d.ts +10 -0
  529. package/lib/typescript/gesture-handler/fabricUtils.d.ts.map +1 -0
  530. package/lib/typescript/gesture-handler/fabricUtils.web.d.ts +6 -0
  531. package/lib/typescript/gesture-handler/fabricUtils.web.d.ts.map +1 -0
  532. package/lib/typescript/gesture-handler/index.d.ts +2 -0
  533. package/lib/typescript/gesture-handler/index.d.ts.map +1 -0
  534. package/lib/typescript/index.d.ts +25 -31
  535. package/lib/typescript/index.d.ts.map +1 -0
  536. package/lib/typescript/native-stack/contexts/GHContext.d.ts +4 -0
  537. package/lib/typescript/native-stack/contexts/GHContext.d.ts.map +1 -0
  538. package/lib/typescript/native-stack/index.d.ts +1 -0
  539. package/lib/typescript/native-stack/index.d.ts.map +1 -0
  540. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +4 -0
  541. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -0
  542. package/lib/typescript/native-stack/types.d.ts +191 -33
  543. package/lib/typescript/native-stack/types.d.ts.map +1 -0
  544. package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts +1 -0
  545. package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts.map +1 -0
  546. package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts +1 -0
  547. package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts.map +1 -0
  548. package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +2 -1
  549. package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts.map +1 -0
  550. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +3 -2
  551. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -0
  552. package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts +3 -0
  553. package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts.map +1 -0
  554. package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +2 -1
  555. package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
  556. package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts +1 -0
  557. package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts.map +1 -0
  558. package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts +1 -0
  559. package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts.map +1 -0
  560. package/lib/typescript/native-stack/views/FontProcessor.d.ts +1 -0
  561. package/lib/typescript/native-stack/views/FontProcessor.d.ts.map +1 -0
  562. package/lib/typescript/native-stack/views/FooterComponent.d.ts +7 -0
  563. package/lib/typescript/native-stack/views/FooterComponent.d.ts.map +1 -0
  564. package/lib/typescript/native-stack/views/HeaderConfig.d.ts +3 -2
  565. package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -0
  566. package/lib/typescript/native-stack/views/NativeStackView.d.ts +2 -1
  567. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -0
  568. package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts +1 -0
  569. package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts.map +1 -0
  570. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +3 -3
  571. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts.map +1 -0
  572. package/lib/typescript/reanimated/ReanimatedScreen.d.ts +3 -3
  573. package/lib/typescript/reanimated/ReanimatedScreen.d.ts.map +1 -0
  574. package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts +1 -0
  575. package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts.map +1 -0
  576. package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +2 -1
  577. package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts.map +1 -0
  578. package/lib/typescript/reanimated/index.d.ts +1 -0
  579. package/lib/typescript/reanimated/index.d.ts.map +1 -0
  580. package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts +2 -3
  581. package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts.map +1 -0
  582. package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts +4 -9
  583. package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts.map +1 -0
  584. package/lib/typescript/types.d.ts +186 -36
  585. package/lib/typescript/types.d.ts.map +1 -0
  586. package/lib/typescript/useTransitionProgress.d.ts +4 -3
  587. package/lib/typescript/useTransitionProgress.d.ts.map +1 -0
  588. package/lib/typescript/utils.d.ts +27 -1
  589. package/lib/typescript/utils.d.ts.map +1 -0
  590. package/native-stack/README.md +156 -108
  591. package/native-stack/package.json +4 -4
  592. package/package.json +1 -1
  593. package/react-native.config.js +19 -16
  594. package/reanimated/package.json +1 -1
  595. package/src/TransitionProgressContext.tsx +3 -1
  596. package/src/components/DebugContainer.tsx +46 -0
  597. package/src/components/DebugContainer.web.tsx +7 -0
  598. package/src/components/FullWindowOverlay.tsx +33 -0
  599. package/src/components/FullWindowOverlay.web.tsx +6 -0
  600. package/src/components/Screen.tsx +392 -0
  601. package/src/components/Screen.web.tsx +46 -0
  602. package/src/components/ScreenContainer.tsx +28 -0
  603. package/src/components/ScreenContainer.web.tsx +5 -0
  604. package/src/components/ScreenContentWrapper.tsx +9 -0
  605. package/src/components/ScreenContentWrapper.web.tsx +5 -0
  606. package/src/components/ScreenFooter.tsx +20 -0
  607. package/src/components/ScreenFooter.web.tsx +7 -0
  608. package/src/components/ScreenStack.tsx +112 -0
  609. package/src/components/ScreenStack.web.tsx +5 -0
  610. package/src/components/ScreenStackHeaderConfig.tsx +122 -0
  611. package/src/components/ScreenStackHeaderConfig.web.tsx +39 -0
  612. package/src/components/ScreenStackItem.tsx +174 -0
  613. package/src/components/SearchBar.tsx +102 -0
  614. package/src/components/SearchBar.web.tsx +5 -0
  615. package/src/components/helpers/DelayedFreeze.tsx +27 -0
  616. package/src/components/helpers/usePrevious.tsx +11 -0
  617. package/src/contexts.tsx +9 -0
  618. package/src/core.ts +45 -0
  619. package/src/fabric/FullWindowOverlayNativeComponent.ts +16 -0
  620. package/src/fabric/ModalScreenNativeComponent.ts +115 -0
  621. package/src/fabric/NativeScreensModule.ts +8 -0
  622. package/src/fabric/NativeScreensModule.web.ts +1 -0
  623. package/src/fabric/ScreenContainerNativeComponent.ts +3 -3
  624. package/src/fabric/ScreenContentWrapperNativeComponent.ts +14 -0
  625. package/src/fabric/ScreenFooterNativeComponent.ts +6 -0
  626. package/src/fabric/ScreenNativeComponent.ts +36 -23
  627. package/src/fabric/ScreenNavigationContainerNativeComponent.ts +3 -1
  628. package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +38 -2
  629. package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +5 -1
  630. package/src/fabric/ScreenStackNativeComponent.ts +3 -2
  631. package/src/fabric/SearchBarNativeComponent.ts +17 -13
  632. package/src/gesture-handler/GestureDetectorProvider.tsx +16 -0
  633. package/src/gesture-handler/RNScreensTurboModule.ts +13 -0
  634. package/src/gesture-handler/ScreenGestureDetector.tsx +241 -0
  635. package/src/gesture-handler/constraints.ts +87 -0
  636. package/src/gesture-handler/defaults.ts +46 -0
  637. package/src/gesture-handler/fabricUtils.ts +86 -0
  638. package/src/gesture-handler/fabricUtils.web.ts +10 -0
  639. package/src/gesture-handler/index.tsx +4 -0
  640. package/src/index.tsx +49 -112
  641. package/src/native-stack/contexts/GHContext.tsx +9 -0
  642. package/src/native-stack/navigators/createNativeStackNavigator.tsx +6 -3
  643. package/src/native-stack/types.tsx +204 -31
  644. package/src/native-stack/utils/getDefaultHeaderHeight.tsx +2 -2
  645. package/src/native-stack/utils/getStatusBarHeight.tsx +22 -0
  646. package/src/native-stack/utils/useAnimatedHeaderHeight.tsx +1 -1
  647. package/src/native-stack/utils/useBackPressSubscription.tsx +1 -1
  648. package/src/native-stack/utils/useHeaderHeight.tsx +1 -1
  649. package/src/native-stack/views/FontProcessor.tsx +2 -2
  650. package/src/native-stack/views/FooterComponent.tsx +10 -0
  651. package/src/native-stack/views/HeaderConfig.tsx +20 -5
  652. package/src/native-stack/views/NativeStackView.tsx +137 -53
  653. package/src/reanimated/ReanimatedHeaderHeightContext.tsx +1 -1
  654. package/src/reanimated/ReanimatedNativeStackScreen.tsx +15 -13
  655. package/src/reanimated/ReanimatedScreen.tsx +4 -3
  656. package/src/reanimated/ReanimatedScreenProvider.tsx +3 -2
  657. package/src/reanimated/useReanimatedHeaderHeight.tsx +2 -2
  658. package/src/reanimated/useReanimatedTransitionProgress.tsx +1 -1
  659. package/src/types.tsx +210 -40
  660. package/src/useTransitionProgress.tsx +1 -1
  661. package/src/utils.ts +27 -5
  662. package/windows/README.md +4 -1
  663. package/windows/RNScreens/Screen.h +3 -1
  664. package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.bundle +0 -33668
  665. package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.map +0 -1
  666. package/SystemModules/amzn__react-native-screens.modules.txt +0 -101
  667. package/SystemModules/amzn__react-native-screens.private.modules.txt +0 -244
  668. package/lib/commonjs/index.native.js +0 -407
  669. package/lib/commonjs/index.native.js.map +0 -1
  670. package/lib/module/index.native.js +0 -410
  671. package/lib/module/index.native.js.map +0 -1
  672. package/lib/typescript/index.native.d.ts +0 -2
  673. package/src/index.native.tsx +0 -599
@@ -3,27 +3,48 @@
3
3
 
4
4
  #import "RNSScreen.h"
5
5
 
6
- // proportions to default transition duration
7
- static const float RNSSlideOpenTransitionDurationProportion = 1;
8
- static const float RNSFadeOpenTransitionDurationProportion = 0.2 / 0.35;
9
- static const float RNSSlideCloseTransitionDurationProportion = 0.25 / 0.35;
10
- static const float RNSFadeCloseTransitionDurationProportion = 0.15 / 0.35;
11
- static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
6
+ #pragma mark - Constants
7
+
8
+ // Default duration for transitions in seconds. Note, that this enforces the default
9
+ // only on Paper. On Fabric the transition duration coming from JS layer
10
+ // is never null, thus it defaults to the value set in component codegen spec.
11
+ static constexpr NSTimeInterval RNSDefaultTransitionDuration = 0.5;
12
+
13
+ // Proportions for diffrent phases of more complex animations.
14
+ // The reference duration differs from default transition duration,
15
+ // because we've changed the default duration & we want to keep proportions
16
+ // in tact. Unit = seconds.
17
+ static constexpr NSTimeInterval RNSTransitionDurationForProportion = 0.35;
18
+
19
+ static constexpr float RNSSlideOpenTransitionDurationProportion = 1;
20
+ static constexpr float RNSFadeOpenTransitionDurationProportion = 0.2 / RNSTransitionDurationForProportion;
21
+ static constexpr float RNSSlideCloseTransitionDurationProportion = 0.25 / RNSTransitionDurationForProportion;
22
+ static constexpr float RNSFadeCloseTransitionDurationProportion = 0.15 / RNSTransitionDurationForProportion;
23
+ static constexpr float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / RNSTransitionDurationForProportion;
24
+
25
+ // Value used for dimming view attached for tranistion time.
26
+ // Same value is used in other projects using similar approach for transistions
27
+ // and it looks the most similar to the value used by Apple
28
+ static constexpr float RNSShadowViewMaxAlpha = 0.1;
12
29
 
13
30
  @implementation RNSScreenStackAnimator {
14
31
  UINavigationControllerOperation _operation;
15
32
  NSTimeInterval _transitionDuration;
33
+ UIViewPropertyAnimator *_Nullable _inFlightAnimator;
16
34
  }
17
35
 
18
36
  - (instancetype)initWithOperation:(UINavigationControllerOperation)operation
19
37
  {
20
38
  if (self = [super init]) {
21
39
  _operation = operation;
22
- _transitionDuration = 0.35; // default duration in seconds
40
+ _transitionDuration = RNSDefaultTransitionDuration; // default duration in seconds
41
+ _inFlightAnimator = nil;
23
42
  }
24
43
  return self;
25
44
  }
26
45
 
46
+ #pragma mark - UIViewControllerAnimatedTransitioning
47
+
27
48
  - (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext
28
49
  {
29
50
  RNSScreenView *screen;
@@ -38,7 +59,7 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
38
59
  }
39
60
 
40
61
  if (screen != nil && screen.stackAnimation == RNSScreenStackAnimationNone) {
41
- return 0;
62
+ return 0.0;
42
63
  }
43
64
 
44
65
  if (screen != nil && screen.transitionDuration != nil && [screen.transitionDuration floatValue] >= 0) {
@@ -64,21 +85,29 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
64
85
  }
65
86
 
66
87
  if (screen != nil) {
67
- if (screen.fullScreenSwipeEnabled && transitionContext.isInteractive) {
88
+ if ([screen.reactSuperview isKindOfClass:[RNSScreenStackView class]] &&
89
+ ((RNSScreenStackView *)(screen.reactSuperview)).customAnimation) {
90
+ [self animateWithNoAnimation:transitionContext toVC:toViewController fromVC:fromViewController];
91
+ } else if (screen.fullScreenSwipeEnabled && transitionContext.isInteractive) {
68
92
  // we are swiping with full width gesture
69
93
  if (screen.customAnimationOnSwipe) {
70
94
  [self animateTransitionWithStackAnimation:screen.stackAnimation
95
+ shadowEnabled:screen.fullScreenSwipeShadowEnabled
71
96
  transitionContext:transitionContext
72
97
  toVC:toViewController
73
98
  fromVC:fromViewController];
74
99
  } else {
75
100
  // we have to provide an animation when swiping, otherwise the screen will be popped immediately,
76
101
  // so in case of no custom animation on swipe set, we provide the one closest to the default
77
- [self animateSimplePushWithTransitionContext:transitionContext toVC:toViewController fromVC:fromViewController];
102
+ [self animateSimplePushWithShadowEnabled:screen.fullScreenSwipeShadowEnabled
103
+ transitionContext:transitionContext
104
+ toVC:toViewController
105
+ fromVC:fromViewController];
78
106
  }
79
107
  } else {
80
108
  // we are going forward or provided custom animation on swipe or clicked native header back button
81
109
  [self animateTransitionWithStackAnimation:screen.stackAnimation
110
+ shadowEnabled:screen.fullScreenSwipeShadowEnabled
82
111
  transitionContext:transitionContext
83
112
  toVC:toViewController
84
113
  fromVC:fromViewController];
@@ -86,9 +115,17 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
86
115
  }
87
116
  }
88
117
 
89
- - (void)animateSimplePushWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
90
- toVC:(UIViewController *)toViewController
91
- fromVC:(UIViewController *)fromViewController
118
+ - (void)animationEnded:(BOOL)transitionCompleted
119
+ {
120
+ _inFlightAnimator = nil;
121
+ }
122
+
123
+ #pragma mark - Animation implementations
124
+
125
+ - (void)animateSimplePushWithShadowEnabled:(BOOL)shadowEnabled
126
+ transitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
127
+ toVC:(UIViewController *)toViewController
128
+ fromVC:(UIViewController *)fromViewController
92
129
  {
93
130
  float containerWidth = transitionContext.containerView.bounds.size.width;
94
131
  float belowViewWidth = containerWidth * 0.3;
@@ -102,19 +139,125 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
102
139
  leftTransform = CGAffineTransformMakeTranslation(belowViewWidth, 0);
103
140
  }
104
141
 
142
+ UIView *shadowView;
143
+ if (shadowEnabled) {
144
+ shadowView = [[UIView alloc] initWithFrame:fromViewController.view.frame];
145
+ shadowView.backgroundColor = [UIColor blackColor];
146
+ }
147
+
105
148
  if (_operation == UINavigationControllerOperationPush) {
106
149
  toViewController.view.transform = rightTransform;
107
150
  [[transitionContext containerView] addSubview:toViewController.view];
108
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
109
- animations:^{
110
- fromViewController.view.transform = leftTransform;
111
- toViewController.view.transform = CGAffineTransformIdentity;
112
- }
113
- completion:^(BOOL finished) {
114
- fromViewController.view.transform = CGAffineTransformIdentity;
115
- toViewController.view.transform = CGAffineTransformIdentity;
116
- [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
117
- }];
151
+ if (shadowView) {
152
+ [[transitionContext containerView] insertSubview:shadowView belowSubview:toViewController.view];
153
+ shadowView.alpha = 0.0;
154
+ }
155
+
156
+ UIViewPropertyAnimator *animator =
157
+ [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
158
+ timingParameters:[RNSScreenStackAnimator defaultSpringTimingParametersApprox]];
159
+
160
+ [animator addAnimations:^{
161
+ fromViewController.view.transform = leftTransform;
162
+ toViewController.view.transform = CGAffineTransformIdentity;
163
+ if (shadowView) {
164
+ shadowView.alpha = RNSShadowViewMaxAlpha;
165
+ }
166
+ }];
167
+
168
+ [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
169
+ if (shadowView) {
170
+ [shadowView removeFromSuperview];
171
+ }
172
+ fromViewController.view.transform = CGAffineTransformIdentity;
173
+ toViewController.view.transform = CGAffineTransformIdentity;
174
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
175
+ }];
176
+ _inFlightAnimator = animator;
177
+ [animator startAnimation];
178
+ } else if (_operation == UINavigationControllerOperationPop) {
179
+ toViewController.view.transform = leftTransform;
180
+ [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
181
+ if (shadowView) {
182
+ [[transitionContext containerView] insertSubview:shadowView belowSubview:fromViewController.view];
183
+ shadowView.alpha = RNSShadowViewMaxAlpha;
184
+ }
185
+
186
+ void (^animationBlock)(void) = ^{
187
+ toViewController.view.transform = CGAffineTransformIdentity;
188
+ fromViewController.view.transform = rightTransform;
189
+ if (shadowView) {
190
+ shadowView.alpha = 0.0;
191
+ }
192
+ };
193
+
194
+ void (^completionBlock)(UIViewAnimatingPosition) = ^(UIViewAnimatingPosition finalPosition) {
195
+ if (shadowView) {
196
+ [shadowView removeFromSuperview];
197
+ }
198
+ fromViewController.view.transform = CGAffineTransformIdentity;
199
+ toViewController.view.transform = CGAffineTransformIdentity;
200
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
201
+ };
202
+
203
+ if (!transitionContext.isInteractive) {
204
+ UIViewPropertyAnimator *animator = [[UIViewPropertyAnimator alloc]
205
+ initWithDuration:[self transitionDuration:transitionContext]
206
+ timingParameters:[RNSScreenStackAnimator defaultSpringTimingParametersApprox]];
207
+
208
+ [animator addAnimations:animationBlock];
209
+ [animator addCompletion:completionBlock];
210
+ _inFlightAnimator = animator;
211
+ [animator startAnimation];
212
+ } else {
213
+ // we don't want the EaseInOut option when swiping to dismiss the view, it is the same in default animation option
214
+ UIViewPropertyAnimator *animator =
215
+ [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
216
+ curve:UIViewAnimationCurveLinear
217
+ animations:animationBlock];
218
+
219
+ [animator addCompletion:completionBlock];
220
+ [animator setUserInteractionEnabled:YES];
221
+ _inFlightAnimator = animator;
222
+ }
223
+ }
224
+ }
225
+
226
+ - (void)animateSlideFromLeftWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
227
+ toVC:(UIViewController *)toViewController
228
+ fromVC:(UIViewController *)fromViewController
229
+ {
230
+ float containerWidth = transitionContext.containerView.bounds.size.width;
231
+ float belowViewWidth = containerWidth * 0.3;
232
+
233
+ CGAffineTransform rightTransform = CGAffineTransformMakeTranslation(-containerWidth, 0);
234
+ CGAffineTransform leftTransform = CGAffineTransformMakeTranslation(belowViewWidth, 0);
235
+
236
+ if (toViewController.navigationController.view.semanticContentAttribute ==
237
+ UISemanticContentAttributeForceRightToLeft) {
238
+ rightTransform = CGAffineTransformMakeTranslation(containerWidth, 0);
239
+ leftTransform = CGAffineTransformMakeTranslation(-belowViewWidth, 0);
240
+ }
241
+
242
+ if (_operation == UINavigationControllerOperationPush) {
243
+ toViewController.view.transform = rightTransform;
244
+ [[transitionContext containerView] addSubview:toViewController.view];
245
+
246
+ UIViewPropertyAnimator *animator =
247
+ [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
248
+ timingParameters:[RNSScreenStackAnimator defaultSpringTimingParametersApprox]];
249
+
250
+ [animator addAnimations:^{
251
+ fromViewController.view.transform = leftTransform;
252
+ toViewController.view.transform = CGAffineTransformIdentity;
253
+ }];
254
+ [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
255
+ fromViewController.view.transform = CGAffineTransformIdentity;
256
+ toViewController.view.transform = CGAffineTransformIdentity;
257
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
258
+ }];
259
+ _inFlightAnimator = animator;
260
+ [animator startAnimation];
118
261
  } else if (_operation == UINavigationControllerOperationPop) {
119
262
  toViewController.view.transform = leftTransform;
120
263
  [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
@@ -123,23 +266,30 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
123
266
  toViewController.view.transform = CGAffineTransformIdentity;
124
267
  fromViewController.view.transform = rightTransform;
125
268
  };
126
- void (^completionBlock)(BOOL) = ^(BOOL finished) {
269
+ void (^completionBlock)(UIViewAnimatingPosition) = ^(UIViewAnimatingPosition finalPosition) {
127
270
  fromViewController.view.transform = CGAffineTransformIdentity;
128
271
  toViewController.view.transform = CGAffineTransformIdentity;
129
272
  [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
130
273
  };
131
274
 
132
275
  if (!transitionContext.isInteractive) {
133
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
134
- animations:animationBlock
135
- completion:completionBlock];
276
+ UIViewPropertyAnimator *animator = [[UIViewPropertyAnimator alloc]
277
+ initWithDuration:[self transitionDuration:transitionContext]
278
+ timingParameters:[RNSScreenStackAnimator defaultSpringTimingParametersApprox]];
279
+
280
+ [animator addAnimations:animationBlock];
281
+ [animator addCompletion:completionBlock];
282
+ _inFlightAnimator = animator;
283
+ [animator startAnimation];
136
284
  } else {
137
285
  // we don't want the EaseInOut option when swiping to dismiss the view, it is the same in default animation option
138
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
139
- delay:0.0
140
- options:UIViewAnimationOptionCurveLinear
141
- animations:animationBlock
142
- completion:completionBlock];
286
+ UIViewPropertyAnimator *animator =
287
+ [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
288
+ curve:UIViewAnimationCurveLinear
289
+ animations:animationBlock];
290
+ [animator addCompletion:completionBlock];
291
+ [animator setUserInteractionEnabled:YES];
292
+ _inFlightAnimator = animator;
143
293
  }
144
294
  }
145
295
  }
@@ -153,26 +303,30 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
153
303
  if (_operation == UINavigationControllerOperationPush) {
154
304
  [[transitionContext containerView] addSubview:toViewController.view];
155
305
  toViewController.view.alpha = 0.0;
156
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
157
- animations:^{
158
- toViewController.view.alpha = 1.0;
159
- }
160
- completion:^(BOOL finished) {
161
- toViewController.view.alpha = 1.0;
162
- [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
163
- }];
306
+ auto animator = [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
307
+ curve:UIViewAnimationCurveEaseInOut
308
+ animations:^{
309
+ toViewController.view.alpha = 1.0;
310
+ }];
311
+ [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
312
+ toViewController.view.alpha = 1.0;
313
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
314
+ }];
315
+ _inFlightAnimator = animator;
316
+ [animator startAnimation];
164
317
  } else if (_operation == UINavigationControllerOperationPop) {
165
318
  [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
166
-
167
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
168
- animations:^{
169
- fromViewController.view.alpha = 0.0;
170
- }
171
- completion:^(BOOL finished) {
172
- fromViewController.view.alpha = 1.0;
173
-
174
- [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
175
- }];
319
+ auto animator = [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
320
+ curve:UIViewAnimationCurveEaseInOut
321
+ animations:^{
322
+ fromViewController.view.alpha = 0.0;
323
+ }];
324
+ [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
325
+ fromViewController.view.alpha = 1.0;
326
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
327
+ }];
328
+ _inFlightAnimator = animator;
329
+ [animator startAnimation];
176
330
  }
177
331
  }
178
332
 
@@ -186,16 +340,21 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
186
340
  if (_operation == UINavigationControllerOperationPush) {
187
341
  toViewController.view.transform = topBottomTransform;
188
342
  [[transitionContext containerView] addSubview:toViewController.view];
189
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
190
- animations:^{
191
- fromViewController.view.transform = CGAffineTransformIdentity;
192
- toViewController.view.transform = CGAffineTransformIdentity;
193
- }
194
- completion:^(BOOL finished) {
195
- fromViewController.view.transform = CGAffineTransformIdentity;
196
- toViewController.view.transform = CGAffineTransformIdentity;
197
- [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
198
- }];
343
+
344
+ auto animator = [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
345
+ curve:UIViewAnimationCurveEaseInOut
346
+ animations:^{
347
+ fromViewController.view.transform =
348
+ CGAffineTransformIdentity;
349
+ toViewController.view.transform = CGAffineTransformIdentity;
350
+ }];
351
+ [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
352
+ fromViewController.view.transform = CGAffineTransformIdentity;
353
+ toViewController.view.transform = CGAffineTransformIdentity;
354
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
355
+ }];
356
+ _inFlightAnimator = animator;
357
+ [animator startAnimation];
199
358
  } else if (_operation == UINavigationControllerOperationPop) {
200
359
  toViewController.view.transform = CGAffineTransformIdentity;
201
360
  [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
@@ -204,23 +363,26 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
204
363
  toViewController.view.transform = CGAffineTransformIdentity;
205
364
  fromViewController.view.transform = topBottomTransform;
206
365
  };
207
- void (^completionBlock)(BOOL) = ^(BOOL finished) {
366
+ void (^completionBlock)(UIViewAnimatingPosition) = ^(UIViewAnimatingPosition finalPosition) {
208
367
  fromViewController.view.transform = CGAffineTransformIdentity;
209
368
  toViewController.view.transform = CGAffineTransformIdentity;
210
369
  [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
211
370
  };
212
371
 
213
372
  if (!transitionContext.isInteractive) {
214
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
215
- animations:animationBlock
216
- completion:completionBlock];
373
+ auto animator = [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
374
+ curve:UIViewAnimationCurveEaseInOut
375
+ animations:animationBlock];
376
+ [animator addCompletion:completionBlock];
377
+ _inFlightAnimator = animator;
378
+ [animator startAnimation];
217
379
  } else {
218
380
  // we don't want the EaseInOut option when swiping to dismiss the view, it is the same in default animation option
219
- [UIView animateWithDuration:[self transitionDuration:transitionContext]
220
- delay:0.0
221
- options:UIViewAnimationOptionCurveLinear
222
- animations:animationBlock
223
- completion:completionBlock];
381
+ auto animator = [[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
382
+ curve:UIViewAnimationCurveLinear
383
+ animations:animationBlock];
384
+ [animator addCompletion:completionBlock];
385
+ _inFlightAnimator = animator;
224
386
  }
225
387
  }
226
388
  }
@@ -232,7 +394,7 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
232
394
  CGAffineTransform topBottomTransform =
233
395
  CGAffineTransformMakeTranslation(0, 0.08 * transitionContext.containerView.bounds.size.height);
234
396
 
235
- const float transitionDuration = [self transitionDuration:transitionContext];
397
+ const float baseTransitionDuration = [self transitionDuration:transitionContext];
236
398
 
237
399
  if (_operation == UINavigationControllerOperationPush) {
238
400
  toViewController.view.transform = topBottomTransform;
@@ -241,80 +403,183 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
241
403
 
242
404
  // Android Nougat open animation
243
405
  // http://aosp.opersys.com/xref/android-7.1.2_r37/xref/frameworks/base/core/res/res/anim/activity_open_enter.xml
244
- [UIView animateWithDuration:transitionDuration * RNSSlideOpenTransitionDurationProportion // defaults to 0.35 s
245
- delay:0
246
- options:UIViewAnimationOptionCurveEaseOut
406
+ auto slideAnimator = [[UIViewPropertyAnimator alloc]
407
+ initWithDuration:baseTransitionDuration * RNSSlideOpenTransitionDurationProportion
408
+ curve:UIViewAnimationCurveEaseOut
409
+ animations:^{
410
+ fromViewController.view.transform = CGAffineTransformIdentity;
411
+ toViewController.view.transform = CGAffineTransformIdentity;
412
+ }];
413
+ [slideAnimator addCompletion:^(UIViewAnimatingPosition finalPosition) {
414
+ fromViewController.view.transform = CGAffineTransformIdentity;
415
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
416
+ }];
417
+
418
+ auto fadeAnimator = [[UIViewPropertyAnimator alloc]
419
+ initWithDuration:baseTransitionDuration * RNSFadeOpenTransitionDurationProportion
420
+ curve:UIViewAnimationCurveEaseOut
421
+ animations:^{
422
+ toViewController.view.alpha = 1.0;
423
+ }];
424
+
425
+ _inFlightAnimator = slideAnimator;
426
+ [slideAnimator startAnimation];
427
+ [fadeAnimator startAnimation];
428
+ } else if (_operation == UINavigationControllerOperationPop) {
429
+ toViewController.view.transform = CGAffineTransformIdentity;
430
+ [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
431
+
432
+ // Android Nougat exit animation
433
+ // http://aosp.opersys.com/xref/android-7.1.2_r37/xref/frameworks/base/core/res/res/anim/activity_close_exit.xml
434
+ auto slideAnimator = [[UIViewPropertyAnimator alloc]
435
+ initWithDuration:baseTransitionDuration * RNSSlideCloseTransitionDurationProportion
436
+ curve:UIViewAnimationCurveEaseIn
437
+ animations:^{
438
+ toViewController.view.transform = CGAffineTransformIdentity;
439
+ fromViewController.view.transform = topBottomTransform;
440
+ }];
441
+ [slideAnimator addCompletion:^(UIViewAnimatingPosition finalPosition) {
442
+ fromViewController.view.transform = CGAffineTransformIdentity;
443
+ toViewController.view.transform = CGAffineTransformIdentity;
444
+ fromViewController.view.alpha = 1.0;
445
+ toViewController.view.alpha = 1.0;
446
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
447
+ }];
448
+
449
+ auto fadeAnimator = [[UIViewPropertyAnimator alloc]
450
+ initWithDuration:baseTransitionDuration * RNSFadeCloseTransitionDurationProportion
451
+ curve:UIViewAnimationCurveLinear
452
+ animations:^{
453
+ fromViewController.view.alpha = 0.0;
454
+ }];
455
+
456
+ _inFlightAnimator = slideAnimator;
457
+ [slideAnimator startAnimation];
458
+ [fadeAnimator startAnimationAfterDelay:baseTransitionDuration * RNSFadeCloseDelayTransitionDurationProportion];
459
+ }
460
+ }
461
+
462
+ - (void)animateWithNoAnimation:(id<UIViewControllerContextTransitioning>)transitionContext
463
+ toVC:(UIViewController *)toViewController
464
+ fromVC:(UIViewController *)fromViewController
465
+ {
466
+ if (_operation == UINavigationControllerOperationPush) {
467
+ [[transitionContext containerView] addSubview:toViewController.view];
468
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
247
469
  animations:^{
248
- fromViewController.view.transform = CGAffineTransformIdentity;
249
- toViewController.view.transform = CGAffineTransformIdentity;
250
470
  }
251
471
  completion:^(BOOL finished) {
252
- fromViewController.view.transform = CGAffineTransformIdentity;
253
472
  [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
254
473
  }];
255
- [UIView animateWithDuration:transitionDuration * RNSFadeOpenTransitionDurationProportion // defaults to 0.2 s
256
- delay:0
257
- options:UIViewAnimationOptionCurveEaseOut
258
- animations:^{
259
- toViewController.view.alpha = 1.0;
260
- }
261
- completion:nil];
474
+ } else if (_operation == UINavigationControllerOperationPop) {
475
+ [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
262
476
 
477
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
478
+ animations:^{
479
+ }
480
+ completion:^(BOOL finished) {
481
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
482
+ }];
483
+ }
484
+ }
485
+
486
+ - (void)animateNoneWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
487
+ toVC:(UIViewController *)toViewController
488
+ fromVC:(UIViewController *)fromViewController
489
+ {
490
+ toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController];
491
+
492
+ if (_operation == UINavigationControllerOperationPush) {
493
+ [[transitionContext containerView] addSubview:toViewController.view];
494
+ toViewController.view.alpha = 0.0;
495
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
496
+ animations:^{
497
+ toViewController.view.alpha = 1.0;
498
+ }
499
+ completion:^(BOOL finished) {
500
+ toViewController.view.alpha = 1.0;
501
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
502
+ }];
263
503
  } else if (_operation == UINavigationControllerOperationPop) {
264
- toViewController.view.transform = CGAffineTransformIdentity;
265
504
  [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
266
505
 
267
- // Android Nougat exit animation
268
- // http://aosp.opersys.com/xref/android-7.1.2_r37/xref/frameworks/base/core/res/res/anim/activity_close_exit.xml
269
- [UIView animateWithDuration:transitionDuration * RNSSlideCloseTransitionDurationProportion // defaults to 0.25 s
270
- delay:0
271
- options:UIViewAnimationOptionCurveEaseIn
506
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
272
507
  animations:^{
273
- toViewController.view.transform = CGAffineTransformIdentity;
274
- fromViewController.view.transform = topBottomTransform;
508
+ fromViewController.view.alpha = 0.0;
275
509
  }
276
510
  completion:^(BOOL finished) {
277
- fromViewController.view.transform = CGAffineTransformIdentity;
278
- toViewController.view.transform = CGAffineTransformIdentity;
279
511
  fromViewController.view.alpha = 1.0;
280
- toViewController.view.alpha = 1.0;
512
+
281
513
  [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
282
514
  }];
283
- [UIView animateWithDuration:transitionDuration * RNSFadeCloseTransitionDurationProportion // defaults to 0.15 s
284
- delay:transitionDuration * RNSFadeCloseDelayTransitionDurationProportion // defaults to 0.1 s
285
- options:UIViewAnimationOptionCurveLinear
286
- animations:^{
287
- fromViewController.view.alpha = 0.0;
288
- }
289
- completion:nil];
290
515
  }
291
516
  }
292
517
 
518
+ #pragma mark - Public API
519
+
520
+ - (nullable id<UITimingCurveProvider>)timingParamsForAnimationCompletion
521
+ {
522
+ return [RNSScreenStackAnimator defaultSpringTimingParametersApprox];
523
+ }
524
+
293
525
  + (BOOL)isCustomAnimation:(RNSScreenStackAnimation)animation
294
526
  {
295
527
  return (animation != RNSScreenStackAnimationFlip && animation != RNSScreenStackAnimationDefault);
296
528
  }
297
529
 
530
+ #pragma mark - Helpers
531
+
298
532
  - (void)animateTransitionWithStackAnimation:(RNSScreenStackAnimation)animation
533
+ shadowEnabled:(BOOL)shadowEnabled
299
534
  transitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
300
535
  toVC:(UIViewController *)toVC
301
536
  fromVC:(UIViewController *)fromVC
302
537
  {
303
- if (animation == RNSScreenStackAnimationSimplePush) {
304
- [self animateSimplePushWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
305
- return;
306
- } else if (animation == RNSScreenStackAnimationFade || animation == RNSScreenStackAnimationNone) {
307
- [self animateFadeWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
308
- return;
309
- } else if (animation == RNSScreenStackAnimationSlideFromBottom) {
310
- [self animateSlideFromBottomWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
311
- return;
312
- } else if (animation == RNSScreenStackAnimationFadeFromBottom) {
313
- [self animateFadeFromBottomWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
314
- return;
538
+ switch (animation) {
539
+ case RNSScreenStackAnimationSimplePush:
540
+ [self animateSimplePushWithShadowEnabled:shadowEnabled
541
+ transitionContext:transitionContext
542
+ toVC:toVC
543
+ fromVC:fromVC];
544
+ return;
545
+ case RNSScreenStackAnimationSlideFromLeft:
546
+ [self animateSlideFromLeftWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
547
+ return;
548
+ case RNSScreenStackAnimationFade:
549
+ [self animateFadeWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
550
+ return;
551
+ case RNSScreenStackAnimationSlideFromBottom:
552
+ [self animateSlideFromBottomWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
553
+ return;
554
+ case RNSScreenStackAnimationFadeFromBottom:
555
+ [self animateFadeFromBottomWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
556
+ return;
557
+ case RNSScreenStackAnimationNone:
558
+ [self animateNoneWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
559
+ return;
560
+ default:
561
+ // simple_push is the default custom animation
562
+ [self animateSimplePushWithShadowEnabled:shadowEnabled
563
+ transitionContext:transitionContext
564
+ toVC:toVC
565
+ fromVC:fromVC];
315
566
  }
316
- // simple_push is the default custom animation
317
- [self animateSimplePushWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
567
+ }
568
+
569
+ + (UISpringTimingParameters *)defaultSpringTimingParametersApprox
570
+ {
571
+ // Default curve provider is as defined below, however spring timing defined this way
572
+ // ignores the requested duration of the animation, effectively impairing our `animationDuration` prop.
573
+ // We want to keep `animationDuration` functional.
574
+ // id<UITimingCurveProvider> timingCurveProvider = [[UISpringTimingParameters alloc] init];
575
+
576
+ // According to "Programming iOS 14" by Matt Neuburg, the params for the default spring are as follows:
577
+ // mass = 3, stiffness = 1000, damping = 500. Damping ratio is computed using formula
578
+ // ratio = damping / (2 * sqrt(stiffness * mass)) ==> default damping ratio should be ~= 4,56.
579
+ // I've found afterwards that this is even indicated here:
580
+ // https://developer.apple.com/documentation/uikit/uispringtimingparameters/1649802-init?language=objc
581
+
582
+ return [[UISpringTimingParameters alloc] initWithDampingRatio:4.56];
318
583
  }
319
584
 
320
585
  @end