react-native-screens 3.29.0 → 3.30.1

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 (448) hide show
  1. package/README.md +7 -7
  2. package/RNScreens.podspec +3 -3
  3. package/android/CMakeLists.txt +27 -0
  4. package/android/build.gradle +21 -2
  5. package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +17 -14
  6. package/android/src/main/cpp/jni-adapter.cpp +110 -0
  7. package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +13 -8
  8. package/android/src/main/java/com/swmansion/rnscreens/FragmentBackPressOverrider.kt +8 -8
  9. package/android/src/main/java/com/swmansion/rnscreens/ModalScreenViewManager.kt +12 -0
  10. package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +38 -5
  11. package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +32 -42
  12. package/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt +76 -48
  13. package/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt +38 -35
  14. package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +43 -37
  15. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +23 -23
  16. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +73 -71
  17. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +3 -3
  18. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt +5 -5
  19. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubviewManager.kt +3 -3
  20. package/android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt +3 -3
  21. package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +4 -4
  22. package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +13 -16
  23. package/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt +105 -0
  24. package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +2 -2
  25. package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +1 -0
  26. package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +14 -10
  27. package/android/src/main/java/com/swmansion/rnscreens/SearchViewFormatter.kt +8 -8
  28. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +3 -7
  29. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt +4 -8
  30. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +3 -7
  31. package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +3 -3
  32. package/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt +9 -13
  33. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +3 -7
  34. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +3 -7
  35. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +3 -7
  36. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +3 -7
  37. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +3 -7
  38. package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +3 -7
  39. package/android/src/main/jni/rnscreens.h +1 -0
  40. package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +0 -1
  41. package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +2 -2
  42. package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +1 -1
  43. package/android/src/paper/java/com/swmansion/rnscreens/NativeScreensModuleSpec.java +32 -0
  44. package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenComponentDescriptor.h +41 -0
  45. package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.cpp +15 -0
  46. package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.h +31 -0
  47. package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +6 -0
  48. package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +1 -5
  49. package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +1 -1
  50. package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +8 -3
  51. package/cpp/RNScreensTurboModule.cpp +107 -0
  52. package/cpp/RNScreensTurboModule.h +43 -0
  53. package/gesture-handler/package.json +6 -0
  54. package/ios/RNSConvert.h +2 -0
  55. package/ios/RNSConvert.mm +5 -2
  56. package/ios/RNSEnums.h +1 -0
  57. package/ios/RNSModalScreen.h +8 -0
  58. package/ios/RNSModalScreen.mm +36 -0
  59. package/ios/RNSModule.h +19 -0
  60. package/ios/RNSModule.mm +174 -0
  61. package/ios/RNSScreen.h +4 -1
  62. package/ios/RNSScreen.mm +48 -26
  63. package/ios/RNSScreenStack.h +6 -0
  64. package/ios/RNSScreenStack.mm +81 -15
  65. package/ios/RNSScreenStackAnimator.mm +89 -1
  66. package/ios/RNSScreenStackHeaderConfig.mm +7 -1
  67. package/ios/RNSScreenWindowTraits.h +1 -1
  68. package/ios/RNSScreenWindowTraits.mm +24 -50
  69. package/ios/RNSSearchBar.mm +24 -0
  70. package/ios/utils/RNSUIBarButtonItem.h +2 -0
  71. package/lib/commonjs/TransitionProgressContext.js +3 -4
  72. package/lib/commonjs/TransitionProgressContext.js.map +1 -1
  73. package/lib/commonjs/components/FullWindowOverlay.js +28 -0
  74. package/lib/commonjs/components/FullWindowOverlay.js.map +1 -0
  75. package/lib/commonjs/components/FullWindowOverlay.web.js +9 -0
  76. package/lib/commonjs/components/FullWindowOverlay.web.js.map +1 -0
  77. package/lib/commonjs/components/Screen.js +161 -0
  78. package/lib/commonjs/components/Screen.js.map +1 -0
  79. package/lib/commonjs/components/Screen.web.js +46 -0
  80. package/lib/commonjs/components/Screen.web.js.map +1 -0
  81. package/lib/commonjs/components/ScreenContainer.js +33 -0
  82. package/lib/commonjs/components/ScreenContainer.js.map +1 -0
  83. package/lib/commonjs/components/ScreenContainer.web.js +11 -0
  84. package/lib/commonjs/components/ScreenContainer.web.js.map +1 -0
  85. package/lib/commonjs/components/ScreenStack.js +45 -0
  86. package/lib/commonjs/components/ScreenStack.js.map +1 -0
  87. package/lib/commonjs/components/ScreenStack.web.js +9 -0
  88. package/lib/commonjs/components/ScreenStack.web.js.map +1 -0
  89. package/lib/commonjs/components/ScreenStackHeaderConfig.js +53 -0
  90. package/lib/commonjs/components/ScreenStackHeaderConfig.js.map +1 -0
  91. package/lib/commonjs/components/ScreenStackHeaderConfig.web.js +27 -0
  92. package/lib/commonjs/components/ScreenStackHeaderConfig.web.js.map +1 -0
  93. package/lib/commonjs/components/SearchBar.js +59 -0
  94. package/lib/commonjs/components/SearchBar.js.map +1 -0
  95. package/lib/commonjs/components/SearchBar.web.js +11 -0
  96. package/lib/commonjs/components/SearchBar.web.js.map +1 -0
  97. package/lib/commonjs/components/helpers/DelayedFreeze.js +32 -0
  98. package/lib/commonjs/components/helpers/DelayedFreeze.js.map +1 -0
  99. package/lib/commonjs/core.js +41 -0
  100. package/lib/commonjs/core.js.map +1 -0
  101. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +1 -2
  102. package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
  103. package/lib/commonjs/fabric/ModalScreenNativeComponent.js +13 -0
  104. package/lib/commonjs/fabric/ModalScreenNativeComponent.js.map +1 -0
  105. package/lib/commonjs/fabric/NativeScreensModule.js +10 -0
  106. package/lib/commonjs/fabric/NativeScreensModule.js.map +1 -0
  107. package/lib/commonjs/fabric/NativeScreensModule.web.js +8 -0
  108. package/lib/commonjs/fabric/NativeScreensModule.web.js.map +1 -0
  109. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +1 -2
  110. package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
  111. package/lib/commonjs/fabric/ScreenNativeComponent.js +1 -2
  112. package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
  113. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +1 -2
  114. package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
  115. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +1 -2
  116. package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  117. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +1 -2
  118. package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
  119. package/lib/commonjs/fabric/ScreenStackNativeComponent.js +1 -2
  120. package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
  121. package/lib/commonjs/fabric/SearchBarNativeComponent.js +3 -5
  122. package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
  123. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +19 -0
  124. package/lib/commonjs/gesture-handler/GestureDetectorProvider.js.map +1 -0
  125. package/lib/commonjs/gesture-handler/RNScreensTurboModule.js +8 -0
  126. package/lib/commonjs/gesture-handler/RNScreensTurboModule.js.map +1 -0
  127. package/lib/commonjs/gesture-handler/ScreenGestureDetector.js +202 -0
  128. package/lib/commonjs/gesture-handler/ScreenGestureDetector.js.map +1 -0
  129. package/lib/commonjs/gesture-handler/constraints.js +64 -0
  130. package/lib/commonjs/gesture-handler/constraints.js.map +1 -0
  131. package/lib/commonjs/gesture-handler/defaults.js +38 -0
  132. package/lib/commonjs/gesture-handler/defaults.js.map +1 -0
  133. package/lib/commonjs/gesture-handler/fabricUtils.js +30 -0
  134. package/lib/commonjs/gesture-handler/fabricUtils.js.map +1 -0
  135. package/lib/commonjs/gesture-handler/fabricUtils.web.js +17 -0
  136. package/lib/commonjs/gesture-handler/fabricUtils.web.js.map +1 -0
  137. package/lib/commonjs/gesture-handler/index.js +14 -0
  138. package/lib/commonjs/gesture-handler/index.js.map +1 -0
  139. package/lib/commonjs/index.js +183 -100
  140. package/lib/commonjs/index.js.map +1 -1
  141. package/lib/commonjs/native-stack/contexts/GHContext.js +11 -0
  142. package/lib/commonjs/native-stack/contexts/GHContext.js.map +1 -0
  143. package/lib/commonjs/native-stack/index.js.map +1 -1
  144. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +20 -24
  145. package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  146. package/lib/commonjs/native-stack/types.js.map +1 -1
  147. package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js +3 -4
  148. package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
  149. package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +3 -4
  150. package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
  151. package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +2 -2
  152. package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
  153. package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
  154. package/lib/commonjs/native-stack/utils/getStatusBarHeight.js.map +1 -1
  155. package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js +2 -2
  156. package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
  157. package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +2 -4
  158. package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
  159. package/lib/commonjs/native-stack/utils/useHeaderHeight.js +2 -2
  160. package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
  161. package/lib/commonjs/native-stack/views/FontProcessor.js +1 -2
  162. package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
  163. package/lib/commonjs/native-stack/views/HeaderConfig.js +11 -7
  164. package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
  165. package/lib/commonjs/native-stack/views/NativeStackView.js +50 -15
  166. package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
  167. package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js +3 -4
  168. package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
  169. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +6 -9
  170. package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  171. package/lib/commonjs/reanimated/ReanimatedScreen.js +1 -2
  172. package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
  173. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +6 -14
  174. package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
  175. package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +3 -4
  176. package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
  177. package/lib/commonjs/reanimated/index.js.map +1 -1
  178. package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +2 -2
  179. package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -1
  180. package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +2 -2
  181. package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
  182. package/lib/commonjs/types.js.map +1 -1
  183. package/lib/commonjs/useTransitionProgress.js +2 -2
  184. package/lib/commonjs/useTransitionProgress.js.map +1 -1
  185. package/lib/commonjs/utils.js +2 -4
  186. package/lib/commonjs/utils.js.map +1 -1
  187. package/lib/module/TransitionProgressContext.js.map +1 -1
  188. package/lib/module/components/FullWindowOverlay.js +21 -0
  189. package/lib/module/components/FullWindowOverlay.js.map +1 -0
  190. package/lib/module/components/FullWindowOverlay.web.js +3 -0
  191. package/lib/module/components/FullWindowOverlay.web.js.map +1 -0
  192. package/lib/module/components/Screen.js +156 -0
  193. package/lib/module/components/Screen.js.map +1 -0
  194. package/lib/module/components/Screen.web.js +38 -0
  195. package/lib/module/components/Screen.web.js.map +1 -0
  196. package/lib/module/components/ScreenContainer.js +26 -0
  197. package/lib/module/components/ScreenContainer.js.map +1 -0
  198. package/lib/module/components/ScreenContainer.web.js +5 -0
  199. package/lib/module/components/ScreenContainer.web.js.map +1 -0
  200. package/lib/module/components/ScreenStack.js +40 -0
  201. package/lib/module/components/ScreenStack.js.map +1 -0
  202. package/lib/module/components/ScreenStack.web.js +3 -0
  203. package/lib/module/components/ScreenStack.web.js.map +1 -0
  204. package/lib/module/components/ScreenStackHeaderConfig.js +43 -0
  205. package/lib/module/components/ScreenStackHeaderConfig.js.map +1 -0
  206. package/lib/module/components/ScreenStackHeaderConfig.web.js +14 -0
  207. package/lib/module/components/ScreenStackHeaderConfig.web.js.map +1 -0
  208. package/lib/module/components/SearchBar.js +52 -0
  209. package/lib/module/components/SearchBar.js.map +1 -0
  210. package/lib/module/components/SearchBar.web.js +5 -0
  211. package/lib/module/components/SearchBar.web.js.map +1 -0
  212. package/lib/module/components/helpers/DelayedFreeze.js +25 -0
  213. package/lib/module/components/helpers/DelayedFreeze.js.map +1 -0
  214. package/lib/module/core.js +31 -0
  215. package/lib/module/core.js.map +1 -0
  216. package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
  217. package/lib/module/fabric/ModalScreenNativeComponent.js +8 -0
  218. package/lib/module/fabric/ModalScreenNativeComponent.js.map +1 -0
  219. package/lib/module/fabric/NativeScreensModule.js +5 -0
  220. package/lib/module/fabric/NativeScreensModule.js.map +1 -0
  221. package/lib/module/fabric/NativeScreensModule.web.js +2 -0
  222. package/lib/module/fabric/NativeScreensModule.web.js.map +1 -0
  223. package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
  224. package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
  225. package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
  226. package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
  227. package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
  228. package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
  229. package/lib/module/fabric/SearchBarNativeComponent.js +1 -1
  230. package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
  231. package/lib/module/gesture-handler/GestureDetectorProvider.js +12 -0
  232. package/lib/module/gesture-handler/GestureDetectorProvider.js.map +1 -0
  233. package/lib/module/gesture-handler/RNScreensTurboModule.js +2 -0
  234. package/lib/module/gesture-handler/RNScreensTurboModule.js.map +1 -0
  235. package/lib/module/gesture-handler/ScreenGestureDetector.js +194 -0
  236. package/lib/module/gesture-handler/ScreenGestureDetector.js.map +1 -0
  237. package/lib/module/gesture-handler/constraints.js +56 -0
  238. package/lib/module/gesture-handler/constraints.js.map +1 -0
  239. package/lib/module/gesture-handler/defaults.js +32 -0
  240. package/lib/module/gesture-handler/defaults.js.map +1 -0
  241. package/lib/module/gesture-handler/fabricUtils.js +23 -0
  242. package/lib/module/gesture-handler/fabricUtils.js.map +1 -0
  243. package/lib/module/gesture-handler/fabricUtils.web.js +10 -0
  244. package/lib/module/gesture-handler/fabricUtils.web.js.map +1 -0
  245. package/lib/module/gesture-handler/index.js +5 -0
  246. package/lib/module/gesture-handler/index.js.map +1 -0
  247. package/lib/module/index.js +31 -64
  248. package/lib/module/index.js.map +1 -1
  249. package/lib/module/native-stack/contexts/GHContext.js +4 -0
  250. package/lib/module/native-stack/contexts/GHContext.js.map +1 -0
  251. package/lib/module/native-stack/index.js.map +1 -1
  252. package/lib/module/native-stack/navigators/createNativeStackNavigator.js +17 -20
  253. package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  254. package/lib/module/native-stack/types.js.map +1 -1
  255. package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
  256. package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -1
  257. package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
  258. package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
  259. package/lib/module/native-stack/utils/getStatusBarHeight.js.map +1 -1
  260. package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
  261. package/lib/module/native-stack/utils/useBackPressSubscription.js +2 -4
  262. package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
  263. package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
  264. package/lib/module/native-stack/views/FontProcessor.js +1 -2
  265. package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
  266. package/lib/module/native-stack/views/HeaderConfig.js +8 -5
  267. package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
  268. package/lib/module/native-stack/views/NativeStackView.js +49 -14
  269. package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
  270. package/lib/module/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
  271. package/lib/module/reanimated/ReanimatedNativeStackScreen.js +2 -4
  272. package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
  273. package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
  274. package/lib/module/reanimated/ReanimatedScreenProvider.js +6 -14
  275. package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
  276. package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
  277. package/lib/module/reanimated/index.js.map +1 -1
  278. package/lib/module/reanimated/useReanimatedHeaderHeight.js.map +1 -1
  279. package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
  280. package/lib/module/types.js.map +1 -1
  281. package/lib/module/useTransitionProgress.js.map +1 -1
  282. package/lib/module/utils.js.map +1 -1
  283. package/lib/typescript/TransitionProgressContext.d.ts +1 -0
  284. package/lib/typescript/TransitionProgressContext.d.ts.map +1 -0
  285. package/lib/typescript/components/FullWindowOverlay.d.ts +6 -0
  286. package/lib/typescript/components/FullWindowOverlay.d.ts.map +1 -0
  287. package/lib/typescript/components/FullWindowOverlay.web.d.ts +6 -0
  288. package/lib/typescript/components/FullWindowOverlay.web.d.ts.map +1 -0
  289. package/lib/typescript/components/Screen.d.ts +20 -0
  290. package/lib/typescript/components/Screen.d.ts.map +1 -0
  291. package/lib/typescript/components/Screen.web.d.ts +11 -0
  292. package/lib/typescript/components/Screen.web.d.ts.map +1 -0
  293. package/lib/typescript/components/ScreenContainer.d.ts +7 -0
  294. package/lib/typescript/components/ScreenContainer.d.ts.map +1 -0
  295. package/lib/typescript/components/ScreenContainer.web.d.ts +5 -0
  296. package/lib/typescript/components/ScreenContainer.web.d.ts.map +1 -0
  297. package/lib/typescript/components/ScreenStack.d.ts +5 -0
  298. package/lib/typescript/components/ScreenStack.d.ts.map +1 -0
  299. package/lib/typescript/components/ScreenStack.web.d.ts +3 -0
  300. package/lib/typescript/components/ScreenStack.web.d.ts.map +1 -0
  301. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +13 -0
  302. package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -0
  303. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +13 -0
  304. package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -0
  305. package/lib/typescript/components/SearchBar.d.ts +26 -0
  306. package/lib/typescript/components/SearchBar.d.ts.map +1 -0
  307. package/lib/typescript/components/SearchBar.web.d.ts +5 -0
  308. package/lib/typescript/components/SearchBar.web.d.ts.map +1 -0
  309. package/lib/typescript/components/helpers/DelayedFreeze.d.ts +8 -0
  310. package/lib/typescript/components/helpers/DelayedFreeze.d.ts.map +1 -0
  311. package/lib/typescript/core.d.ts +7 -0
  312. package/lib/typescript/core.d.ts.map +1 -0
  313. package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +1 -0
  314. package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts.map +1 -0
  315. package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts +68 -0
  316. package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts.map +1 -0
  317. package/lib/typescript/fabric/NativeScreensModule.d.ts +6 -0
  318. package/lib/typescript/fabric/NativeScreensModule.d.ts.map +1 -0
  319. package/lib/typescript/fabric/NativeScreensModule.web.d.ts +3 -0
  320. package/lib/typescript/fabric/NativeScreensModule.web.d.ts.map +1 -0
  321. package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +1 -0
  322. package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts.map +1 -0
  323. package/lib/typescript/fabric/ScreenNativeComponent.d.ts +2 -1
  324. package/lib/typescript/fabric/ScreenNativeComponent.d.ts.map +1 -0
  325. package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +1 -0
  326. package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts.map +1 -0
  327. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +1 -0
  328. package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -0
  329. package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +1 -0
  330. package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts.map +1 -0
  331. package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +1 -0
  332. package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts.map +1 -0
  333. package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +3 -1
  334. package/lib/typescript/fabric/SearchBarNativeComponent.d.ts.map +1 -0
  335. package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts +5 -0
  336. package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts.map +1 -0
  337. package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts +13 -0
  338. package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts.map +1 -0
  339. package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts +5 -0
  340. package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts.map +1 -0
  341. package/lib/typescript/gesture-handler/constraints.d.ts +6 -0
  342. package/lib/typescript/gesture-handler/constraints.d.ts.map +1 -0
  343. package/lib/typescript/gesture-handler/defaults.d.ts +20 -0
  344. package/lib/typescript/gesture-handler/defaults.d.ts.map +1 -0
  345. package/lib/typescript/gesture-handler/fabricUtils.d.ts +8 -0
  346. package/lib/typescript/gesture-handler/fabricUtils.d.ts.map +1 -0
  347. package/lib/typescript/gesture-handler/fabricUtils.web.d.ts +6 -0
  348. package/lib/typescript/gesture-handler/fabricUtils.web.d.ts.map +1 -0
  349. package/lib/typescript/gesture-handler/index.d.ts +2 -0
  350. package/lib/typescript/gesture-handler/index.d.ts.map +1 -0
  351. package/lib/typescript/index.d.ts +11 -31
  352. package/lib/typescript/index.d.ts.map +1 -0
  353. package/lib/typescript/native-stack/contexts/GHContext.d.ts +4 -0
  354. package/lib/typescript/native-stack/contexts/GHContext.d.ts.map +1 -0
  355. package/lib/typescript/native-stack/index.d.ts +1 -0
  356. package/lib/typescript/native-stack/index.d.ts.map +1 -0
  357. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -0
  358. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -0
  359. package/lib/typescript/native-stack/types.d.ts +39 -2
  360. package/lib/typescript/native-stack/types.d.ts.map +1 -0
  361. package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts +1 -0
  362. package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts.map +1 -0
  363. package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts +1 -0
  364. package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts.map +1 -0
  365. package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +1 -0
  366. package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts.map +1 -0
  367. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +1 -0
  368. package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -0
  369. package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts +1 -0
  370. package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts.map +1 -0
  371. package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +1 -0
  372. package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
  373. package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts +1 -0
  374. package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts.map +1 -0
  375. package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts +1 -0
  376. package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts.map +1 -0
  377. package/lib/typescript/native-stack/views/FontProcessor.d.ts +1 -0
  378. package/lib/typescript/native-stack/views/FontProcessor.d.ts.map +1 -0
  379. package/lib/typescript/native-stack/views/HeaderConfig.d.ts +1 -0
  380. package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -0
  381. package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -0
  382. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -0
  383. package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts +1 -0
  384. package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts.map +1 -0
  385. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +2 -2
  386. package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts.map +1 -0
  387. package/lib/typescript/reanimated/ReanimatedScreen.d.ts +2 -2
  388. package/lib/typescript/reanimated/ReanimatedScreen.d.ts.map +1 -0
  389. package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts +1 -0
  390. package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts.map +1 -0
  391. package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +1 -0
  392. package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts.map +1 -0
  393. package/lib/typescript/reanimated/index.d.ts +1 -0
  394. package/lib/typescript/reanimated/index.d.ts.map +1 -0
  395. package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts +2 -3
  396. package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts.map +1 -0
  397. package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts +4 -9
  398. package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts.map +1 -0
  399. package/lib/typescript/types.d.ts +11 -2
  400. package/lib/typescript/types.d.ts.map +1 -0
  401. package/lib/typescript/useTransitionProgress.d.ts +1 -0
  402. package/lib/typescript/useTransitionProgress.d.ts.map +1 -0
  403. package/lib/typescript/utils.d.ts +1 -0
  404. package/lib/typescript/utils.d.ts.map +1 -0
  405. package/native-stack/README.md +2 -1
  406. package/native-stack/package.json +1 -1
  407. package/package.json +17 -11
  408. package/react-native.config.js +2 -1
  409. package/reanimated/package.json +1 -1
  410. package/src/components/FullWindowOverlay.tsx +25 -0
  411. package/src/components/FullWindowOverlay.web.tsx +6 -0
  412. package/src/components/Screen.tsx +218 -0
  413. package/src/components/Screen.web.tsx +43 -0
  414. package/src/components/ScreenContainer.tsx +33 -0
  415. package/src/components/ScreenContainer.web.tsx +6 -0
  416. package/src/components/ScreenStack.tsx +41 -0
  417. package/src/components/ScreenStack.web.tsx +3 -0
  418. package/src/components/ScreenStackHeaderConfig.tsx +76 -0
  419. package/src/components/ScreenStackHeaderConfig.web.tsx +39 -0
  420. package/src/components/SearchBar.tsx +91 -0
  421. package/src/components/SearchBar.web.tsx +6 -0
  422. package/src/components/helpers/DelayedFreeze.tsx +27 -0
  423. package/src/core.ts +43 -0
  424. package/src/fabric/ModalScreenNativeComponent.ts +104 -0
  425. package/src/fabric/NativeScreensModule.ts +7 -0
  426. package/src/fabric/NativeScreensModule.web.ts +1 -0
  427. package/src/fabric/ScreenNativeComponent.ts +1 -1
  428. package/src/fabric/SearchBarNativeComponent.ts +2 -0
  429. package/src/gesture-handler/GestureDetectorProvider.tsx +16 -0
  430. package/src/gesture-handler/RNScreensTurboModule.ts +13 -0
  431. package/src/gesture-handler/ScreenGestureDetector.tsx +241 -0
  432. package/src/gesture-handler/constraints.ts +87 -0
  433. package/src/gesture-handler/defaults.ts +38 -0
  434. package/src/gesture-handler/fabricUtils.ts +39 -0
  435. package/src/gesture-handler/fabricUtils.web.ts +10 -0
  436. package/src/gesture-handler/index.tsx +4 -0
  437. package/src/index.tsx +65 -112
  438. package/src/native-stack/contexts/GHContext.tsx +7 -0
  439. package/src/native-stack/types.tsx +62 -1
  440. package/src/native-stack/views/HeaderConfig.tsx +11 -0
  441. package/src/native-stack/views/NativeStackView.tsx +65 -13
  442. package/src/types.tsx +13 -1
  443. package/lib/commonjs/index.native.js +0 -418
  444. package/lib/commonjs/index.native.js.map +0 -1
  445. package/lib/module/index.native.js +0 -415
  446. package/lib/module/index.native.js.map +0 -1
  447. package/lib/typescript/index.native.d.ts +0 -2
  448. package/src/index.native.tsx +0 -619
@@ -64,7 +64,10 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
64
64
  }
65
65
 
66
66
  if (screen != nil) {
67
- if (screen.fullScreenSwipeEnabled && transitionContext.isInteractive) {
67
+ if ([screen.reactSuperview isKindOfClass:[RNSScreenStackView class]] &&
68
+ ((RNSScreenStackView *)(screen.reactSuperview)).customAnimation) {
69
+ [self animateWithNoAnimation:transitionContext toVC:toViewController fromVC:fromViewController];
70
+ } else if (screen.fullScreenSwipeEnabled && transitionContext.isInteractive) {
68
71
  // we are swiping with full width gesture
69
72
  if (screen.customAnimationOnSwipe) {
70
73
  [self animateTransitionWithStackAnimation:screen.stackAnimation
@@ -144,6 +147,64 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
144
147
  }
145
148
  }
146
149
 
150
+ - (void)animateSlideFromLeftWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
151
+ toVC:(UIViewController *)toViewController
152
+ fromVC:(UIViewController *)fromViewController
153
+ {
154
+ float containerWidth = transitionContext.containerView.bounds.size.width;
155
+ float belowViewWidth = containerWidth * 0.3;
156
+
157
+ CGAffineTransform rightTransform = CGAffineTransformMakeTranslation(-containerWidth, 0);
158
+ CGAffineTransform leftTransform = CGAffineTransformMakeTranslation(belowViewWidth, 0);
159
+
160
+ if (toViewController.navigationController.view.semanticContentAttribute ==
161
+ UISemanticContentAttributeForceRightToLeft) {
162
+ rightTransform = CGAffineTransformMakeTranslation(containerWidth, 0);
163
+ leftTransform = CGAffineTransformMakeTranslation(-belowViewWidth, 0);
164
+ }
165
+
166
+ if (_operation == UINavigationControllerOperationPush) {
167
+ toViewController.view.transform = rightTransform;
168
+ [[transitionContext containerView] addSubview:toViewController.view];
169
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
170
+ animations:^{
171
+ fromViewController.view.transform = leftTransform;
172
+ toViewController.view.transform = CGAffineTransformIdentity;
173
+ }
174
+ completion:^(BOOL finished) {
175
+ fromViewController.view.transform = CGAffineTransformIdentity;
176
+ toViewController.view.transform = CGAffineTransformIdentity;
177
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
178
+ }];
179
+ } else if (_operation == UINavigationControllerOperationPop) {
180
+ toViewController.view.transform = leftTransform;
181
+ [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
182
+
183
+ void (^animationBlock)(void) = ^{
184
+ toViewController.view.transform = CGAffineTransformIdentity;
185
+ fromViewController.view.transform = rightTransform;
186
+ };
187
+ void (^completionBlock)(BOOL) = ^(BOOL finished) {
188
+ fromViewController.view.transform = CGAffineTransformIdentity;
189
+ toViewController.view.transform = CGAffineTransformIdentity;
190
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
191
+ };
192
+
193
+ if (!transitionContext.isInteractive) {
194
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
195
+ animations:animationBlock
196
+ completion:completionBlock];
197
+ } else {
198
+ // we don't want the EaseInOut option when swiping to dismiss the view, it is the same in default animation option
199
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
200
+ delay:0.0
201
+ options:UIViewAnimationOptionCurveLinear
202
+ animations:animationBlock
203
+ completion:completionBlock];
204
+ }
205
+ }
206
+ }
207
+
147
208
  - (void)animateFadeWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
148
209
  toVC:(UIViewController *)toViewController
149
210
  fromVC:(UIViewController *)fromViewController
@@ -290,6 +351,30 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
290
351
  }
291
352
  }
292
353
 
354
+ - (void)animateWithNoAnimation:(id<UIViewControllerContextTransitioning>)transitionContext
355
+ toVC:(UIViewController *)toViewController
356
+ fromVC:(UIViewController *)fromViewController
357
+ {
358
+ if (_operation == UINavigationControllerOperationPush) {
359
+ [[transitionContext containerView] addSubview:toViewController.view];
360
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
361
+ animations:^{
362
+ }
363
+ completion:^(BOOL finished) {
364
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
365
+ }];
366
+ } else if (_operation == UINavigationControllerOperationPop) {
367
+ [[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
368
+
369
+ [UIView animateWithDuration:[self transitionDuration:transitionContext]
370
+ animations:^{
371
+ }
372
+ completion:^(BOOL finished) {
373
+ [transitionContext completeTransition:![transitionContext transitionWasCancelled]];
374
+ }];
375
+ }
376
+ }
377
+
293
378
  + (BOOL)isCustomAnimation:(RNSScreenStackAnimation)animation
294
379
  {
295
380
  return (animation != RNSScreenStackAnimationFlip && animation != RNSScreenStackAnimationDefault);
@@ -303,6 +388,9 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
303
388
  if (animation == RNSScreenStackAnimationSimplePush) {
304
389
  [self animateSimplePushWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
305
390
  return;
391
+ } else if (animation == RNSScreenStackAnimationSlideFromLeft) {
392
+ [self animateSlideFromLeftWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
393
+ return;
306
394
  } else if (animation == RNSScreenStackAnimationFade || animation == RNSScreenStackAnimationNone) {
307
395
  [self animateFadeWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
308
396
  return;
@@ -227,7 +227,7 @@ namespace react = facebook::react;
227
227
  [navbar setTitleTextAttributes:attrs];
228
228
  }
229
229
 
230
- #if !TARGET_OS_TV
230
+ #if !TARGET_OS_TV && !TARGET_OS_VISION
231
231
  if (@available(iOS 11.0, *)) {
232
232
  if (config.largeTitle &&
233
233
  (config.largeTitleFontFamily || config.largeTitleFontSize || config.largeTitleFontWeight ||
@@ -397,9 +397,12 @@ namespace react = facebook::react;
397
397
  if (config.titleFontFamily || config.titleFontSize || config.titleFontWeight || config.titleColor) {
398
398
  NSMutableDictionary *attrs = [NSMutableDictionary new];
399
399
 
400
+ // Ignore changing header title color on visionOS
401
+ #if !TARGET_OS_VISION
400
402
  if (config.titleColor) {
401
403
  attrs[NSForegroundColorAttributeName] = config.titleColor;
402
404
  }
405
+ #endif
403
406
 
404
407
  NSString *family = config.titleFontFamily ?: nil;
405
408
  NSNumber *size = config.titleFontSize ?: @17;
@@ -422,9 +425,12 @@ namespace react = facebook::react;
422
425
  config.largeTitleColor || config.titleColor) {
423
426
  NSMutableDictionary *largeAttrs = [NSMutableDictionary new];
424
427
 
428
+ // Ignore changing header title color on visionOS
429
+ #if !TARGET_OS_VISION
425
430
  if (config.largeTitleColor || config.titleColor) {
426
431
  largeAttrs[NSForegroundColorAttributeName] = config.largeTitleColor ? config.largeTitleColor : config.titleColor;
427
432
  }
433
+ #endif
428
434
 
429
435
  NSString *largeFamily = config.largeTitleFontFamily ?: nil;
430
436
  NSNumber *largeSize = config.largeTitleFontSize ?: @34;
@@ -4,7 +4,7 @@
4
4
 
5
5
  + (void)updateWindowTraits;
6
6
 
7
- #if !TARGET_OS_TV
7
+ #if !TARGET_OS_TV && !TARGET_OS_VISION
8
8
  + (void)assertViewControllerBasedStatusBarAppearenceSet;
9
9
  #endif
10
10
  + (void)updateStatusBarAppearance;
@@ -4,7 +4,7 @@
4
4
 
5
5
  @implementation RNSScreenWindowTraits
6
6
 
7
- #if !TARGET_OS_TV
7
+ #if !TARGET_OS_TV && !TARGET_OS_VISION
8
8
  + (void)assertViewControllerBasedStatusBarAppearenceSet
9
9
  {
10
10
  static dispatch_once_t once;
@@ -22,21 +22,10 @@
22
22
 
23
23
  + (void)updateStatusBarAppearance
24
24
  {
25
- #if !TARGET_OS_TV
25
+ #if !TARGET_OS_TV && !TARGET_OS_VISION
26
26
  [UIView animateWithDuration:0.4
27
27
  animations:^{ // duration based on "Programming iOS 13" p. 311 implementation
28
- #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
29
- __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
30
- if (@available(iOS 13, *)) {
31
- UIWindow *firstWindow = [[[UIApplication sharedApplication] windows] firstObject];
32
- if (firstWindow != nil) {
33
- [[firstWindow rootViewController] setNeedsStatusBarAppearanceUpdate];
34
- }
35
- } else
36
- #endif
37
- {
38
- [UIApplication.sharedApplication.keyWindow.rootViewController setNeedsStatusBarAppearanceUpdate];
39
- }
28
+ [RCTKeyWindow().rootViewController setNeedsStatusBarAppearanceUpdate];
40
29
  }];
41
30
  #endif
42
31
  }
@@ -44,21 +33,7 @@
44
33
  + (void)updateHomeIndicatorAutoHidden
45
34
  {
46
35
  #if !TARGET_OS_TV
47
-
48
- #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
49
- __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
50
- if (@available(iOS 13, *)) {
51
- UIWindow *firstWindow = [[[UIApplication sharedApplication] windows] firstObject];
52
- if (firstWindow != nil) {
53
- [[firstWindow rootViewController] setNeedsUpdateOfHomeIndicatorAutoHidden];
54
- }
55
- } else
56
- #endif
57
- {
58
- if (@available(iOS 11.0, *)) {
59
- [UIApplication.sharedApplication.keyWindow.rootViewController setNeedsUpdateOfHomeIndicatorAutoHidden];
60
- }
61
- }
36
+ [RCTKeyWindow().rootViewController setNeedsUpdateOfHomeIndicatorAutoHidden];
62
37
  #endif
63
38
  }
64
39
 
@@ -134,21 +109,10 @@
134
109
 
135
110
  + (void)enforceDesiredDeviceOrientation
136
111
  {
137
- #if !TARGET_OS_TV
112
+ #if !TARGET_OS_TV && !TARGET_OS_VISION
138
113
  dispatch_async(dispatch_get_main_queue(), ^{
139
- UIInterfaceOrientationMask orientationMask = UIInterfaceOrientationMaskAllButUpsideDown;
140
- #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
141
- __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
142
- if (@available(iOS 13, *)) {
143
- UIWindow *firstWindow = [[[UIApplication sharedApplication] windows] firstObject];
144
- if (firstWindow != nil) {
145
- orientationMask = [firstWindow rootViewController].supportedInterfaceOrientations;
146
- }
147
- } else
148
- #endif
149
- {
150
- orientationMask = UIApplication.sharedApplication.keyWindow.rootViewController.supportedInterfaceOrientations;
151
- }
114
+ UIInterfaceOrientationMask orientationMask = [RCTKeyWindow().rootViewController supportedInterfaceOrientations];
115
+
152
116
  UIInterfaceOrientation currentDeviceOrientation =
153
117
  [RNSScreenWindowTraits interfaceOrientationFromDeviceOrientation:[[UIDevice currentDevice] orientation]];
154
118
  UIInterfaceOrientation currentInterfaceOrientation = [RNSScreenWindowTraits interfaceOrientation];
@@ -178,7 +142,21 @@
178
142
  __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_16_0
179
143
  if (@available(iOS 16.0, *)) {
180
144
  NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects];
181
- UIWindowScene *scene = (UIWindowScene *)array[0];
145
+
146
+ // when an app supports multiple scenes (e.g. CarPlay), it is possible that
147
+ // UIWindowScene is not the first scene, or it may not be present at all
148
+ UIWindowScene *scene = nil;
149
+ for (id connectedScene in array) {
150
+ if ([connectedScene isKindOfClass:[UIWindowScene class]]) {
151
+ scene = connectedScene;
152
+ break;
153
+ }
154
+ }
155
+
156
+ if (scene == nil) {
157
+ return;
158
+ }
159
+
182
160
  UIWindowSceneGeometryPreferencesIOS *geometryPreferences =
183
161
  [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:orientationMask];
184
162
  [scene requestGeometryUpdateWithPreferences:geometryPreferences
@@ -211,7 +189,7 @@
211
189
  [RNSScreenWindowTraits updateHomeIndicatorAutoHidden];
212
190
  }
213
191
 
214
- #if !TARGET_OS_TV
192
+ #if !TARGET_OS_TV && !TARGET_OS_VISION
215
193
  // based on
216
194
  // https://stackoverflow.com/questions/57965701/statusbarorientation-was-deprecated-in-ios-13-0-when-attempting-to-get-app-ori/61249908#61249908
217
195
  + (UIInterfaceOrientation)interfaceOrientation
@@ -219,11 +197,7 @@
219
197
  #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
220
198
  __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
221
199
  if (@available(iOS 13.0, *)) {
222
- UIWindow *firstWindow = [[[UIApplication sharedApplication] windows] firstObject];
223
- if (firstWindow == nil) {
224
- return UIInterfaceOrientationUnknown;
225
- }
226
- UIWindowScene *windowScene = firstWindow.windowScene;
200
+ UIWindowScene *windowScene = RCTKeyWindow().windowScene;
227
201
  if (windowScene == nil) {
228
202
  return UIInterfaceOrientationUnknown;
229
203
  }
@@ -50,7 +50,13 @@ namespace react = facebook::react;
50
50
 
51
51
  - (void)initCommonProps
52
52
  {
53
+ #if !TARGET_OS_TV
53
54
  _controller = [[UISearchController alloc] initWithSearchResultsController:nil];
55
+ #else
56
+ // on TVOS UISearchController must contain searchResultsController.
57
+ _controller = [[UISearchController alloc] initWithSearchResultsController:[UIViewController new]];
58
+ #endif
59
+
54
60
  _controller.searchBar.delegate = self;
55
61
  _hideWhenScrolling = YES;
56
62
  _placement = RNSSearchBarPlacementStacked;
@@ -304,6 +310,14 @@ namespace react = facebook::react;
304
310
  [_controller.searchBar setText:text];
305
311
  }
306
312
 
313
+ - (void)cancelSearch
314
+ {
315
+ #if !TARGET_OS_TV
316
+ [self searchBarCancelButtonClicked:_controller.searchBar];
317
+ _controller.active = NO;
318
+ #endif
319
+ }
320
+
307
321
  #pragma mark-- Fabric specific
308
322
 
309
323
  #ifdef RCT_NEW_ARCH_ENABLED
@@ -330,9 +344,11 @@ namespace react = facebook::react;
330
344
  [self setPlaceholder:RCTNSStringFromStringNilIfEmpty(newScreenProps.placeholder)];
331
345
  }
332
346
 
347
+ #if !TARGET_OS_VISION
333
348
  if (oldScreenProps.autoCapitalize != newScreenProps.autoCapitalize) {
334
349
  [self setAutoCapitalize:[RNSConvert UITextAutocapitalizationTypeFromCppEquivalent:newScreenProps.autoCapitalize]];
335
350
  }
351
+ #endif
336
352
 
337
353
  if (oldScreenProps.tintColor != newScreenProps.tintColor) {
338
354
  [self setTintColor:RCTUIColorFromSharedColor(newScreenProps.tintColor)];
@@ -446,6 +462,14 @@ RCT_EXPORT_METHOD(setText : (NSNumber *_Nonnull)reactTag text : (NSString *)text
446
462
  }];
447
463
  }
448
464
 
465
+ RCT_EXPORT_METHOD(cancelSearch : (NSNumber *_Nonnull)reactTag)
466
+ {
467
+ [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) {
468
+ RNSSearchBar *searchBar = viewRegistry[reactTag];
469
+ [searchBar cancelSearch];
470
+ }];
471
+ }
472
+
449
473
  #endif /* !RCT_NEW_ARCH_ENABLED */
450
474
 
451
475
  @end
@@ -1,3 +1,5 @@
1
+ #import <UIKit/UIKit.h>
2
+
1
3
  @interface RNSUIBarButtonItem : UIBarButtonItem
2
4
 
3
5
  @property (nonatomic) BOOL menuHidden;
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
- var _default = /*#__PURE__*/React.createContext(undefined);
11
- exports.default = _default;
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ var _default = exports.default = /*#__PURE__*/React.createContext(undefined);
12
11
  //# sourceMappingURL=TransitionProgressContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_default","createContext","undefined","exports"],"sources":["TransitionProgressContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Animated } from 'react-native';\n\ntype TransitionProgressContextBody = {\n progress: Animated.Value;\n closing: Animated.Value;\n goingForward: Animated.Value;\n};\n\nexport default React.createContext<TransitionProgressContextBody | undefined>(\n undefined\n);\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,IAAAW,QAAA,gBAShBzB,KAAK,CAAC0B,aAAa,CAChCC,SACF,CAAC;AAAAC,OAAA,CAAAlB,OAAA,GAAAe,QAAA"}
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_default","exports","createContext","undefined"],"sourceRoot":"../../src","sources":["TransitionProgressContext.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAAA,IAAAY,QAAA,GAAAC,OAAA,CAAAhB,OAAA,gBAShBT,KAAK,CAAC0B,aAAa,CAChCC,SACF,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _FullWindowOverlayNativeComponent = _interopRequireDefault(require("../fabric/FullWindowOverlayNativeComponent"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ // Native components
12
+
13
+ const NativeFullWindowOverlay = _FullWindowOverlayNativeComponent.default;
14
+ function FullWindowOverlay(props) {
15
+ if (_reactNative.Platform.OS !== 'ios') {
16
+ console.warn('Using FullWindowOverlay is only valid on iOS devices.');
17
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, props);
18
+ }
19
+ return /*#__PURE__*/_react.default.createElement(NativeFullWindowOverlay, {
20
+ style: {
21
+ position: 'absolute',
22
+ width: '100%',
23
+ height: '100%'
24
+ }
25
+ }, props.children);
26
+ }
27
+ var _default = exports.default = FullWindowOverlay;
28
+ //# sourceMappingURL=FullWindowOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_FullWindowOverlayNativeComponent","obj","__esModule","default","NativeFullWindowOverlay","FullWindowOverlayNativeComponent","FullWindowOverlay","props","Platform","OS","console","warn","createElement","View","style","position","width","height","children","_default","exports"],"sourceRoot":"../../../src","sources":["components/FullWindowOverlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,iCAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0F,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAD1F;;AAEA,MAAMG,uBAIL,GAAGC,yCAAuC;AAE3C,SAASC,iBAAiBA,CAACC,KAA8B,EAAE;EACzD,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzBC,OAAO,CAACC,IAAI,CAAC,uDAAuD,CAAC;IACrE,oBAAOf,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACb,YAAA,CAAAc,IAAI,EAAKN,KAAQ,CAAC;EAC5B;EACA,oBACEX,MAAA,CAAAO,OAAA,CAAAS,aAAA,CAACR,uBAAuB;IACtBU,KAAK,EAAE;MAAEC,QAAQ,EAAE,UAAU;MAAEC,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE;IAAO;EAAE,GAC9DV,KAAK,CAACW,QACgB,CAAC;AAE9B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjB,OAAA,GAEcG,iBAAiB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _default = exports.default = _reactNative.View;
9
+ //# sourceMappingURL=FullWindowOverlay.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","View"],"sourceRoot":"../../../src","sources":["components/FullWindowOverlay.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAoC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGrBC,iBAAI"}
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.ScreenContext = exports.NativeScreen = exports.InnerScreen = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _TransitionProgressContext = _interopRequireDefault(require("../TransitionProgressContext"));
10
+ var _DelayedFreeze = _interopRequireDefault(require("./helpers/DelayedFreeze"));
11
+ var _core = require("../core");
12
+ var _ScreenNativeComponent = _interopRequireDefault(require("../fabric/ScreenNativeComponent"));
13
+ var _ModalScreenNativeComponent = _interopRequireDefault(require("../fabric/ModalScreenNativeComponent"));
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable @typescript-eslint/no-var-requires */ // Native components
16
+ const NativeScreen = exports.NativeScreen = _ScreenNativeComponent.default;
17
+ const AnimatedNativeScreen = _reactNative.Animated.createAnimatedComponent(NativeScreen);
18
+ const AnimatedNativeModalScreen = _reactNative.Animated.createAnimatedComponent(_ModalScreenNativeComponent.default);
19
+
20
+ // Incomplete type, all accessible properties available at:
21
+ // react-native/Libraries/Components/View/ReactNativeViewViewConfig.js
22
+ class InnerScreen extends _react.default.Component {
23
+ ref = null;
24
+ closing = new _reactNative.Animated.Value(0);
25
+ progress = new _reactNative.Animated.Value(0);
26
+ goingForward = new _reactNative.Animated.Value(0);
27
+ setNativeProps(props) {
28
+ this.ref?.setNativeProps(props);
29
+ }
30
+ setRef = ref => {
31
+ this.ref = ref;
32
+ this.props.onComponentRef?.(ref);
33
+ };
34
+ render() {
35
+ const {
36
+ enabled = (0, _core.screensEnabled)(),
37
+ freezeOnBlur = (0, _core.freezeEnabled)(),
38
+ ...rest
39
+ } = this.props;
40
+
41
+ // To maintain default behavior of formSheet stack presentation style and to have reasonable
42
+ // defaults for new medium-detent iOS API we need to set defaults here
43
+ const {
44
+ sheetAllowedDetents = 'large',
45
+ sheetLargestUndimmedDetent = 'all',
46
+ sheetGrabberVisible = false,
47
+ sheetCornerRadius = -1.0,
48
+ sheetExpandsWhenScrolledToEdge = true,
49
+ stackPresentation
50
+ } = rest;
51
+ if (enabled && _core.isNativePlatformSupported) {
52
+ // Due to how Yoga resolves layout, we need to have different components for modal nad non-modal screens
53
+ const AnimatedScreen = _reactNative.Platform.OS === 'android' || stackPresentation === 'push' || stackPresentation === 'containedModal' || stackPresentation === 'containedTransparentModal' ? AnimatedNativeScreen : AnimatedNativeModalScreen;
54
+ let {
55
+ // Filter out active prop in this case because it is unused and
56
+ // can cause problems depending on react-native version:
57
+ // https://github.com/react-navigation/react-navigation/issues/4886
58
+ active,
59
+ activityState,
60
+ children,
61
+ isNativeStack,
62
+ gestureResponseDistance,
63
+ onGestureCancel,
64
+ ...props
65
+ } = rest;
66
+ if (active !== undefined && activityState === undefined) {
67
+ console.warn('It appears that you are using old version of react-navigation library. Please update @react-navigation/bottom-tabs, @react-navigation/stack and @react-navigation/drawer to version 5.10.0 or above to take full advantage of new functionality added to react-native-screens');
68
+ activityState = active !== 0 ? 2 : 0; // in the new version, we need one of the screens to have value of 2 after the transition
69
+ }
70
+
71
+ const handleRef = ref => {
72
+ if (ref?.viewConfig?.validAttributes?.style) {
73
+ ref.viewConfig.validAttributes.style = {
74
+ ...ref.viewConfig.validAttributes.style,
75
+ display: false
76
+ };
77
+ this.setRef(ref);
78
+ } else if (ref?._viewConfig?.validAttributes?.style) {
79
+ ref._viewConfig.validAttributes.style = {
80
+ ...ref._viewConfig.validAttributes.style,
81
+ display: false
82
+ };
83
+ this.setRef(ref);
84
+ }
85
+ };
86
+ return /*#__PURE__*/_react.default.createElement(_DelayedFreeze.default, {
87
+ freeze: freezeOnBlur && activityState === 0
88
+ }, /*#__PURE__*/_react.default.createElement(AnimatedScreen, _extends({}, props, {
89
+ activityState: activityState,
90
+ sheetAllowedDetents: sheetAllowedDetents,
91
+ sheetLargestUndimmedDetent: sheetLargestUndimmedDetent,
92
+ sheetGrabberVisible: sheetGrabberVisible,
93
+ sheetCornerRadius: sheetCornerRadius,
94
+ sheetExpandsWhenScrolledToEdge: sheetExpandsWhenScrolledToEdge,
95
+ gestureResponseDistance: {
96
+ start: gestureResponseDistance?.start ?? -1,
97
+ end: gestureResponseDistance?.end ?? -1,
98
+ top: gestureResponseDistance?.top ?? -1,
99
+ bottom: gestureResponseDistance?.bottom ?? -1
100
+ }
101
+ // This prevents showing blank screen when navigating between multiple screens with freezing
102
+ // https://github.com/software-mansion/react-native-screens/pull/1208
103
+ ,
104
+ ref: handleRef,
105
+ onTransitionProgress: !isNativeStack ? undefined : _reactNative.Animated.event([{
106
+ nativeEvent: {
107
+ progress: this.progress,
108
+ closing: this.closing,
109
+ goingForward: this.goingForward
110
+ }
111
+ }], {
112
+ useNativeDriver: true
113
+ }),
114
+ onGestureCancel: onGestureCancel ?? (() => {
115
+ // for internal use
116
+ })
117
+ }), !isNativeStack ?
118
+ // see comment of this prop in types.tsx for information why it is needed
119
+ children : /*#__PURE__*/_react.default.createElement(_TransitionProgressContext.default.Provider, {
120
+ value: {
121
+ progress: this.progress,
122
+ closing: this.closing,
123
+ goingForward: this.goingForward
124
+ }
125
+ }, children)));
126
+ } else {
127
+ // same reason as above
128
+ let {
129
+ active,
130
+ activityState,
131
+ style,
132
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
133
+ onComponentRef,
134
+ ...props
135
+ } = rest;
136
+ if (active !== undefined && activityState === undefined) {
137
+ activityState = active !== 0 ? 2 : 0;
138
+ }
139
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, _extends({
140
+ style: [style, {
141
+ display: activityState !== 0 ? 'flex' : 'none'
142
+ }],
143
+ ref: this.setRef
144
+ }, props));
145
+ }
146
+ }
147
+ }
148
+
149
+ // context to be used when the user wants to use enhanced implementation
150
+ // e.g. to use `useReanimatedTransitionProgress` (see `reanimated` folder in repo)
151
+ exports.InnerScreen = InnerScreen;
152
+ const ScreenContext = exports.ScreenContext = /*#__PURE__*/_react.default.createContext(InnerScreen);
153
+ class Screen extends _react.default.Component {
154
+ static contextType = ScreenContext;
155
+ render() {
156
+ const ScreenWrapper = this.context || InnerScreen;
157
+ return /*#__PURE__*/_react.default.createElement(ScreenWrapper, this.props);
158
+ }
159
+ }
160
+ var _default = exports.default = Screen;
161
+ //# sourceMappingURL=Screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_TransitionProgressContext","_DelayedFreeze","_core","_ScreenNativeComponent","_ModalScreenNativeComponent","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","NativeScreen","exports","ScreenNativeComponent","AnimatedNativeScreen","Animated","createAnimatedComponent","AnimatedNativeModalScreen","ModalScreenNativeComponent","InnerScreen","React","Component","ref","closing","Value","progress","goingForward","setNativeProps","props","setRef","onComponentRef","render","enabled","screensEnabled","freezeOnBlur","freezeEnabled","rest","sheetAllowedDetents","sheetLargestUndimmedDetent","sheetGrabberVisible","sheetCornerRadius","sheetExpandsWhenScrolledToEdge","stackPresentation","isNativePlatformSupported","AnimatedScreen","Platform","OS","active","activityState","children","isNativeStack","gestureResponseDistance","onGestureCancel","undefined","console","warn","handleRef","viewConfig","validAttributes","style","display","_viewConfig","createElement","freeze","start","end","top","bottom","onTransitionProgress","event","nativeEvent","useNativeDriver","Provider","value","View","ScreenContext","createContext","Screen","contextType","ScreenWrapper","context","_default"],"sourceRoot":"../../../src","sources":["components/Screen.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,0BAAA,G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AA,GAAAA,WAAA;AACO,MAAMwD,aAAa,GAAA/D,OAAA,CAAA+D,aAAA,gBAAGvD,cAAK,CAACwD,aAAa,CAACzD,WAAW,CAAC;AAE7D,MAAM0D,MAAM,SAASzD,cAAK,CAACC,SAAS,CAAc;EAChD,OAAOyD,WAAW,GAAGH,aAAa;EAElC5C,MAAMA,CAAA,EAAG;IACP,MAAMgD,aAAa,GAAI,IAAI,CAACC,OAAO,IAAI7D,WAAiC;IACxE,oBAAOlC,MAAA,CAAAW,OAAA,CAAAkE,aAAA,CAACiB,aAAa,EAAK,IAAI,CAACnD,KAAQ,CAAC;EAC1C;AACF;AAAC,IAAAqD,QAAA,GAAArE,OAAA,CAAAhB,OAAA,GAEciF,MAAM"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.ScreenContext = exports.NativeScreen = exports.InnerScreen = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _core = require("../core");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
12
+ const InnerScreen = exports.InnerScreen = _reactNative.View;
13
+
14
+ // We're using class component here because of the error from reanimated:
15
+ // createAnimatedComponent` does not support stateless functional components; use a class component instead.
16
+ class NativeScreen extends _react.default.Component {
17
+ render() {
18
+ let {
19
+ active,
20
+ activityState,
21
+ style,
22
+ enabled = (0, _core.screensEnabled)(),
23
+ ...rest
24
+ } = this.props;
25
+ if (enabled) {
26
+ if (active !== undefined && activityState === undefined) {
27
+ activityState = active !== 0 ? 2 : 0; // change taken from index.native.tsx
28
+ }
29
+
30
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View
31
+ // @ts-expect-error: hidden exists on web, but not in React Native
32
+ , _extends({
33
+ hidden: activityState === 0,
34
+ style: [style, {
35
+ display: activityState !== 0 ? 'flex' : 'none'
36
+ }]
37
+ }, rest));
38
+ }
39
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, rest);
40
+ }
41
+ }
42
+ exports.NativeScreen = NativeScreen;
43
+ const Screen = _reactNative.Animated.createAnimatedComponent(NativeScreen);
44
+ const ScreenContext = exports.ScreenContext = /*#__PURE__*/_react.default.createContext(Screen);
45
+ var _default = exports.default = Screen;
46
+ //# sourceMappingURL=Screen.web.js.map