react-native-screens 3.28.0 → 3.30.0
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.
- package/README.md +7 -7
- package/RNScreens.podspec +3 -3
- package/android/CMakeLists.txt +27 -0
- package/android/build.gradle +21 -2
- package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +17 -14
- package/android/src/main/cpp/jni-adapter.cpp +110 -0
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +13 -8
- package/android/src/main/java/com/swmansion/rnscreens/FragmentBackPressOverrider.kt +8 -8
- package/android/src/main/java/com/swmansion/rnscreens/ModalScreenViewManager.kt +12 -0
- package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +38 -5
- package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +32 -42
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt +76 -48
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt +38 -35
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +43 -37
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +23 -23
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +73 -71
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +3 -3
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt +5 -5
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubviewManager.kt +3 -3
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt +3 -3
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +4 -4
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +13 -16
- package/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt +105 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +2 -2
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +1 -0
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +14 -10
- package/android/src/main/java/com/swmansion/rnscreens/SearchViewFormatter.kt +8 -8
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt +4 -8
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +3 -3
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt +9 -13
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +3 -7
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +3 -7
- package/android/src/main/jni/rnscreens.h +1 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +0 -1
- package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +2 -2
- package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +1 -1
- package/android/src/paper/java/com/swmansion/rnscreens/NativeScreensModuleSpec.java +32 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenComponentDescriptor.h +41 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.cpp +15 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.h +31 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +6 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +1 -5
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +1 -1
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +8 -3
- package/cpp/RNScreensTurboModule.cpp +107 -0
- package/cpp/RNScreensTurboModule.h +43 -0
- package/gesture-handler/package.json +6 -0
- package/ios/RNSConvert.h +2 -0
- package/ios/RNSConvert.mm +5 -2
- package/ios/RNSEnums.h +1 -0
- package/ios/RNSModalScreen.h +8 -0
- package/ios/RNSModalScreen.mm +36 -0
- package/ios/RNSModule.h +19 -0
- package/ios/RNSModule.mm +174 -0
- package/ios/RNSScreen.h +4 -1
- package/ios/RNSScreen.mm +48 -26
- package/ios/RNSScreenStack.h +6 -0
- package/ios/RNSScreenStack.mm +150 -23
- package/ios/RNSScreenStackAnimator.mm +89 -1
- package/ios/RNSScreenStackHeaderConfig.mm +7 -1
- package/ios/RNSScreenWindowTraits.h +1 -1
- package/ios/RNSScreenWindowTraits.mm +24 -50
- package/ios/RNSSearchBar.mm +24 -0
- package/ios/utils/RNSUIBarButtonItem.h +2 -0
- package/lib/commonjs/TransitionProgressContext.js +3 -4
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/components/FullWindowOverlay.js +28 -0
- package/lib/commonjs/components/FullWindowOverlay.js.map +1 -0
- package/lib/commonjs/components/FullWindowOverlay.web.js +9 -0
- package/lib/commonjs/components/FullWindowOverlay.web.js.map +1 -0
- package/lib/commonjs/components/Screen.js +161 -0
- package/lib/commonjs/components/Screen.js.map +1 -0
- package/lib/commonjs/components/Screen.web.js +46 -0
- package/lib/commonjs/components/Screen.web.js.map +1 -0
- package/lib/commonjs/components/ScreenContainer.js +33 -0
- package/lib/commonjs/components/ScreenContainer.js.map +1 -0
- package/lib/commonjs/components/ScreenContainer.web.js +11 -0
- package/lib/commonjs/components/ScreenContainer.web.js.map +1 -0
- package/lib/commonjs/components/ScreenStack.js +45 -0
- package/lib/commonjs/components/ScreenStack.js.map +1 -0
- package/lib/commonjs/components/ScreenStack.web.js +9 -0
- package/lib/commonjs/components/ScreenStack.web.js.map +1 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.js +53 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.js.map +1 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.web.js +27 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.web.js.map +1 -0
- package/lib/commonjs/components/SearchBar.js +59 -0
- package/lib/commonjs/components/SearchBar.js.map +1 -0
- package/lib/commonjs/components/SearchBar.web.js +11 -0
- package/lib/commonjs/components/SearchBar.web.js.map +1 -0
- package/lib/commonjs/components/helpers/DelayedFreeze.js +32 -0
- package/lib/commonjs/components/helpers/DelayedFreeze.js.map +1 -0
- package/lib/commonjs/core.js +41 -0
- package/lib/commonjs/core.js.map +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +1 -2
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js +13 -0
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/NativeScreensModule.js +10 -0
- package/lib/commonjs/fabric/NativeScreensModule.js.map +1 -0
- package/lib/commonjs/fabric/NativeScreensModule.web.js +8 -0
- package/lib/commonjs/fabric/NativeScreensModule.web.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +1 -2
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNativeComponent.js +1 -2
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +1 -2
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +1 -2
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +1 -2
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +1 -2
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +3 -5
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +19 -0
- package/lib/commonjs/gesture-handler/GestureDetectorProvider.js.map +1 -0
- package/lib/commonjs/gesture-handler/RNScreensTurboModule.js +8 -0
- package/lib/commonjs/gesture-handler/RNScreensTurboModule.js.map +1 -0
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js +202 -0
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js.map +1 -0
- package/lib/commonjs/gesture-handler/constraints.js +64 -0
- package/lib/commonjs/gesture-handler/constraints.js.map +1 -0
- package/lib/commonjs/gesture-handler/defaults.js +38 -0
- package/lib/commonjs/gesture-handler/defaults.js.map +1 -0
- package/lib/commonjs/gesture-handler/fabricUtils.js +30 -0
- package/lib/commonjs/gesture-handler/fabricUtils.js.map +1 -0
- package/lib/commonjs/gesture-handler/fabricUtils.web.js +17 -0
- package/lib/commonjs/gesture-handler/fabricUtils.web.js.map +1 -0
- package/lib/commonjs/gesture-handler/index.js +14 -0
- package/lib/commonjs/gesture-handler/index.js.map +1 -0
- package/lib/commonjs/index.js +183 -100
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-stack/contexts/GHContext.js +11 -0
- package/lib/commonjs/native-stack/contexts/GHContext.js.map +1 -0
- package/lib/commonjs/native-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +20 -24
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/native-stack/types.js.map +1 -1
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js +3 -4
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +3 -4
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +2 -2
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getStatusBarHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js +2 -2
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +2 -4
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js +2 -2
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/FontProcessor.js +1 -2
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +11 -7
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +50 -15
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js +3 -4
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +6 -9
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js +1 -2
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +6 -14
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +3 -4
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +2 -2
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +2 -2
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js +2 -2
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/commonjs/utils.js +2 -4
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/TransitionProgressContext.js.map +1 -1
- package/lib/module/components/FullWindowOverlay.js +21 -0
- package/lib/module/components/FullWindowOverlay.js.map +1 -0
- package/lib/module/components/FullWindowOverlay.web.js +3 -0
- package/lib/module/components/FullWindowOverlay.web.js.map +1 -0
- package/lib/module/components/Screen.js +156 -0
- package/lib/module/components/Screen.js.map +1 -0
- package/lib/module/components/Screen.web.js +38 -0
- package/lib/module/components/Screen.web.js.map +1 -0
- package/lib/module/components/ScreenContainer.js +26 -0
- package/lib/module/components/ScreenContainer.js.map +1 -0
- package/lib/module/components/ScreenContainer.web.js +5 -0
- package/lib/module/components/ScreenContainer.web.js.map +1 -0
- package/lib/module/components/ScreenStack.js +40 -0
- package/lib/module/components/ScreenStack.js.map +1 -0
- package/lib/module/components/ScreenStack.web.js +3 -0
- package/lib/module/components/ScreenStack.web.js.map +1 -0
- package/lib/module/components/ScreenStackHeaderConfig.js +43 -0
- package/lib/module/components/ScreenStackHeaderConfig.js.map +1 -0
- package/lib/module/components/ScreenStackHeaderConfig.web.js +14 -0
- package/lib/module/components/ScreenStackHeaderConfig.web.js.map +1 -0
- package/lib/module/components/SearchBar.js +52 -0
- package/lib/module/components/SearchBar.js.map +1 -0
- package/lib/module/components/SearchBar.web.js +5 -0
- package/lib/module/components/SearchBar.web.js.map +1 -0
- package/lib/module/components/helpers/DelayedFreeze.js +25 -0
- package/lib/module/components/helpers/DelayedFreeze.js.map +1 -0
- package/lib/module/core.js +31 -0
- package/lib/module/core.js.map +1 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ModalScreenNativeComponent.js +8 -0
- package/lib/module/fabric/ModalScreenNativeComponent.js.map +1 -0
- package/lib/module/fabric/NativeScreensModule.js +5 -0
- package/lib/module/fabric/NativeScreensModule.js.map +1 -0
- package/lib/module/fabric/NativeScreensModule.web.js +2 -0
- package/lib/module/fabric/NativeScreensModule.web.js.map +1 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/gesture-handler/GestureDetectorProvider.js +12 -0
- package/lib/module/gesture-handler/GestureDetectorProvider.js.map +1 -0
- package/lib/module/gesture-handler/RNScreensTurboModule.js +2 -0
- package/lib/module/gesture-handler/RNScreensTurboModule.js.map +1 -0
- package/lib/module/gesture-handler/ScreenGestureDetector.js +194 -0
- package/lib/module/gesture-handler/ScreenGestureDetector.js.map +1 -0
- package/lib/module/gesture-handler/constraints.js +56 -0
- package/lib/module/gesture-handler/constraints.js.map +1 -0
- package/lib/module/gesture-handler/defaults.js +32 -0
- package/lib/module/gesture-handler/defaults.js.map +1 -0
- package/lib/module/gesture-handler/fabricUtils.js +23 -0
- package/lib/module/gesture-handler/fabricUtils.js.map +1 -0
- package/lib/module/gesture-handler/fabricUtils.web.js +10 -0
- package/lib/module/gesture-handler/fabricUtils.web.js.map +1 -0
- package/lib/module/gesture-handler/index.js +5 -0
- package/lib/module/gesture-handler/index.js.map +1 -0
- package/lib/module/index.js +31 -64
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-stack/contexts/GHContext.js +4 -0
- package/lib/module/native-stack/contexts/GHContext.js.map +1 -0
- package/lib/module/native-stack/index.js.map +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +17 -20
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/native-stack/types.js.map +1 -1
- package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
- package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/getStatusBarHeight.js.map +1 -1
- package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/useBackPressSubscription.js +2 -4
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/views/FontProcessor.js +1 -2
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +8 -5
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +49 -14
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +2 -4
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +6 -14
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/module/reanimated/index.js.map +1 -1
- package/lib/module/reanimated/useReanimatedHeaderHeight.js.map +1 -1
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useTransitionProgress.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/TransitionProgressContext.d.ts +1 -0
- package/lib/typescript/TransitionProgressContext.d.ts.map +1 -0
- package/lib/typescript/components/FullWindowOverlay.d.ts +6 -0
- package/lib/typescript/components/FullWindowOverlay.d.ts.map +1 -0
- package/lib/typescript/components/FullWindowOverlay.web.d.ts +6 -0
- package/lib/typescript/components/FullWindowOverlay.web.d.ts.map +1 -0
- package/lib/typescript/components/Screen.d.ts +20 -0
- package/lib/typescript/components/Screen.d.ts.map +1 -0
- package/lib/typescript/components/Screen.web.d.ts +11 -0
- package/lib/typescript/components/Screen.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenContainer.d.ts +7 -0
- package/lib/typescript/components/ScreenContainer.d.ts.map +1 -0
- package/lib/typescript/components/ScreenContainer.web.d.ts +5 -0
- package/lib/typescript/components/ScreenContainer.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStack.d.ts +5 -0
- package/lib/typescript/components/ScreenStack.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStack.web.d.ts +3 -0
- package/lib/typescript/components/ScreenStack.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +13 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +13 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -0
- package/lib/typescript/components/SearchBar.d.ts +26 -0
- package/lib/typescript/components/SearchBar.d.ts.map +1 -0
- package/lib/typescript/components/SearchBar.web.d.ts +5 -0
- package/lib/typescript/components/SearchBar.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/DelayedFreeze.d.ts +8 -0
- package/lib/typescript/components/helpers/DelayedFreeze.d.ts.map +1 -0
- package/lib/typescript/core.d.ts +7 -0
- package/lib/typescript/core.d.ts.map +1 -0
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +1 -0
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts +68 -0
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/NativeScreensModule.d.ts +6 -0
- package/lib/typescript/fabric/NativeScreensModule.d.ts.map +1 -0
- package/lib/typescript/fabric/NativeScreensModule.web.d.ts +3 -0
- package/lib/typescript/fabric/NativeScreensModule.web.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +1 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +2 -1
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +1 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +1 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +1 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +1 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +3 -1
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts +5 -0
- package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts +13 -0
- package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts +5 -0
- package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/constraints.d.ts +6 -0
- package/lib/typescript/gesture-handler/constraints.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/defaults.d.ts +20 -0
- package/lib/typescript/gesture-handler/defaults.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/fabricUtils.d.ts +8 -0
- package/lib/typescript/gesture-handler/fabricUtils.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/fabricUtils.web.d.ts +6 -0
- package/lib/typescript/gesture-handler/fabricUtils.web.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/index.d.ts +2 -0
- package/lib/typescript/gesture-handler/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +11 -31
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/native-stack/contexts/GHContext.d.ts +4 -0
- package/lib/typescript/native-stack/contexts/GHContext.d.ts.map +1 -0
- package/lib/typescript/native-stack/index.d.ts +1 -0
- package/lib/typescript/native-stack/index.d.ts.map +1 -0
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -0
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -0
- package/lib/typescript/native-stack/types.d.ts +39 -2
- package/lib/typescript/native-stack/types.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts +1 -0
- package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts +1 -0
- package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +1 -0
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts +1 -0
- package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts +1 -0
- package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/views/FontProcessor.d.ts +1 -0
- package/lib/typescript/native-stack/views/FontProcessor.d.ts.map +1 -0
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +1 -0
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -0
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -0
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts +1 -0
- package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +2 -2
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +2 -2
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts +1 -0
- package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +1 -0
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts.map +1 -0
- package/lib/typescript/reanimated/index.d.ts +1 -0
- package/lib/typescript/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts +2 -3
- package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts +4 -9
- package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +11 -2
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/useTransitionProgress.d.ts +1 -0
- package/lib/typescript/useTransitionProgress.d.ts.map +1 -0
- package/lib/typescript/utils.d.ts +1 -0
- package/lib/typescript/utils.d.ts.map +1 -0
- package/native-stack/README.md +2 -1
- package/native-stack/package.json +1 -1
- package/package.json +18 -11
- package/react-native.config.js +2 -1
- package/reanimated/package.json +1 -1
- package/src/components/FullWindowOverlay.tsx +25 -0
- package/src/components/FullWindowOverlay.web.tsx +6 -0
- package/src/components/Screen.tsx +218 -0
- package/src/components/Screen.web.tsx +43 -0
- package/src/components/ScreenContainer.tsx +33 -0
- package/src/components/ScreenContainer.web.tsx +6 -0
- package/src/components/ScreenStack.tsx +41 -0
- package/src/components/ScreenStack.web.tsx +3 -0
- package/src/components/ScreenStackHeaderConfig.tsx +76 -0
- package/src/components/ScreenStackHeaderConfig.web.tsx +39 -0
- package/src/components/SearchBar.tsx +91 -0
- package/src/components/SearchBar.web.tsx +6 -0
- package/src/components/helpers/DelayedFreeze.tsx +27 -0
- package/src/core.ts +43 -0
- package/src/fabric/ModalScreenNativeComponent.ts +104 -0
- package/src/fabric/NativeScreensModule.ts +7 -0
- package/src/fabric/NativeScreensModule.web.ts +1 -0
- package/src/fabric/ScreenNativeComponent.ts +1 -1
- package/src/fabric/SearchBarNativeComponent.ts +2 -0
- package/src/gesture-handler/GestureDetectorProvider.tsx +16 -0
- package/src/gesture-handler/RNScreensTurboModule.ts +13 -0
- package/src/gesture-handler/ScreenGestureDetector.tsx +241 -0
- package/src/gesture-handler/constraints.ts +87 -0
- package/src/gesture-handler/defaults.ts +38 -0
- package/src/gesture-handler/fabricUtils.ts +39 -0
- package/src/gesture-handler/fabricUtils.web.ts +10 -0
- package/src/gesture-handler/index.tsx +4 -0
- package/src/index.tsx +65 -112
- package/src/native-stack/contexts/GHContext.tsx +7 -0
- package/src/native-stack/types.tsx +62 -1
- package/src/native-stack/views/HeaderConfig.tsx +11 -0
- package/src/native-stack/views/NativeStackView.tsx +65 -13
- package/src/types.tsx +13 -1
- package/lib/commonjs/index.native.js +0 -418
- package/lib/commonjs/index.native.js.map +0 -1
- package/lib/module/index.native.js +0 -415
- package/lib/module/index.native.js.map +0 -1
- package/lib/typescript/index.native.d.ts +0 -2
- package/src/index.native.tsx +0 -619
package/ios/RNSScreenStack.mm
CHANGED
|
@@ -92,7 +92,7 @@ namespace react = facebook::react;
|
|
|
92
92
|
|
|
93
93
|
@end
|
|
94
94
|
|
|
95
|
-
#if !TARGET_OS_TV
|
|
95
|
+
#if !TARGET_OS_TV && !TARGET_OS_VISION
|
|
96
96
|
@interface RNSScreenEdgeGestureRecognizer : UIScreenEdgePanGestureRecognizer
|
|
97
97
|
@end
|
|
98
98
|
|
|
@@ -150,7 +150,7 @@ namespace react = facebook::react;
|
|
|
150
150
|
_presentedModals = [NSMutableArray new];
|
|
151
151
|
_controller = [RNSNavigationController new];
|
|
152
152
|
_controller.delegate = self;
|
|
153
|
-
#if !TARGET_OS_TV
|
|
153
|
+
#if !TARGET_OS_TV && !TARGET_OS_VISION
|
|
154
154
|
[self setupGestureHandlers];
|
|
155
155
|
#endif
|
|
156
156
|
// we have to initialize viewControllers with a non empty array for
|
|
@@ -323,6 +323,38 @@ namespace react = facebook::react;
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
+
+ (UIViewController *)findTopMostPresentedViewControllerFromViewController:(UIViewController *)controller
|
|
327
|
+
{
|
|
328
|
+
auto presentedVc = controller;
|
|
329
|
+
while (presentedVc.presentedViewController != nil) {
|
|
330
|
+
presentedVc = presentedVc.presentedViewController;
|
|
331
|
+
}
|
|
332
|
+
return presentedVc;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
- (UIViewController *)findReactRootViewController
|
|
336
|
+
{
|
|
337
|
+
UIView *parent = self;
|
|
338
|
+
while (parent) {
|
|
339
|
+
parent = parent.reactSuperview;
|
|
340
|
+
if (parent.isReactRootView) {
|
|
341
|
+
return parent.reactViewController;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return nil;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
- (UIViewController *)lastFromPresentedViewControllerChainStartingFrom:(UIViewController *)vc
|
|
348
|
+
{
|
|
349
|
+
UIViewController *lastNonNullVc = vc;
|
|
350
|
+
UIViewController *lastVc = vc.presentedViewController;
|
|
351
|
+
while (lastVc != nil) {
|
|
352
|
+
lastNonNullVc = lastVc;
|
|
353
|
+
lastVc = lastVc.presentedViewController;
|
|
354
|
+
}
|
|
355
|
+
return lastNonNullVc;
|
|
356
|
+
}
|
|
357
|
+
|
|
326
358
|
- (void)setModalViewControllers:(NSArray<UIViewController *> *)controllers
|
|
327
359
|
{
|
|
328
360
|
// prevent re-entry
|
|
@@ -349,9 +381,15 @@ namespace react = facebook::react;
|
|
|
349
381
|
NSMutableArray<UIViewController *> *newControllers = [NSMutableArray arrayWithArray:controllers];
|
|
350
382
|
[newControllers removeObjectsInArray:_presentedModals];
|
|
351
383
|
|
|
352
|
-
// find bottom-most controller that should stay on the stack
|
|
384
|
+
// We need to find bottom-most view controller that should stay on the stack
|
|
385
|
+
// for the duration of transition. There are couple of scenarios:
|
|
386
|
+
// (1) No modals are presented or all modals were presented by this RNSNavigationController,
|
|
387
|
+
// (2) There are modals presented by other RNSNavigationControllers (nested/outer)
|
|
388
|
+
|
|
389
|
+
// Last controller that is common for both _presentedModals & controllers
|
|
390
|
+
__block UIViewController *changeRootController = _controller;
|
|
391
|
+
// Last common controller index + 1
|
|
353
392
|
NSUInteger changeRootIndex = 0;
|
|
354
|
-
UIViewController *changeRootController = _controller;
|
|
355
393
|
for (NSUInteger i = 0; i < MIN(_presentedModals.count, controllers.count); i++) {
|
|
356
394
|
if (_presentedModals[i] == controllers[i]) {
|
|
357
395
|
changeRootController = controllers[i];
|
|
@@ -403,6 +441,7 @@ namespace react = facebook::react;
|
|
|
403
441
|
return;
|
|
404
442
|
} else {
|
|
405
443
|
UIViewController *previous = changeRootController;
|
|
444
|
+
|
|
406
445
|
for (NSUInteger i = changeRootIndex; i < controllers.count; i++) {
|
|
407
446
|
UIViewController *next = controllers[i];
|
|
408
447
|
BOOL lastModal = (i == controllers.count - 1);
|
|
@@ -440,16 +479,50 @@ namespace react = facebook::react;
|
|
|
440
479
|
}
|
|
441
480
|
};
|
|
442
481
|
|
|
443
|
-
|
|
444
|
-
|
|
482
|
+
UIViewController *firstModalToBeDismissed = changeRootController.presentedViewController;
|
|
483
|
+
if (firstModalToBeDismissed != nil) {
|
|
445
484
|
BOOL shouldAnimate = changeRootIndex == controllers.count &&
|
|
446
|
-
[
|
|
447
|
-
((RNSScreen *)
|
|
448
|
-
|
|
449
|
-
[
|
|
450
|
-
|
|
451
|
-
|
|
485
|
+
[firstModalToBeDismissed isKindOfClass:[RNSScreen class]] &&
|
|
486
|
+
((RNSScreen *)firstModalToBeDismissed).screenView.stackAnimation != RNSScreenStackAnimationNone;
|
|
487
|
+
|
|
488
|
+
if ([_presentedModals containsObject:firstModalToBeDismissed]) {
|
|
489
|
+
// We dismiss every VC that was presented by changeRootController VC or its descendant.
|
|
490
|
+
// After the series of dismissals is completed we run completion block in which
|
|
491
|
+
// we present modals on top of changeRootController (which may be the this stack VC)
|
|
492
|
+
[changeRootController dismissViewControllerAnimated:shouldAnimate completion:finish];
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
UIViewController *lastModalVc = [self lastFromPresentedViewControllerChainStartingFrom:firstModalToBeDismissed];
|
|
497
|
+
|
|
498
|
+
if (lastModalVc != firstModalToBeDismissed) {
|
|
499
|
+
[lastModalVc dismissViewControllerAnimated:shouldAnimate completion:finish];
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
452
502
|
}
|
|
503
|
+
|
|
504
|
+
// changeRootController does not have presentedViewController but it does not mean that no modals are in presentation;
|
|
505
|
+
// modals could be presented by another stack (nested / outer), third-party view controller or they could be using
|
|
506
|
+
// UIModalPresentationCurrentContext / UIModalPresentationOverCurrentContext presentation styles; in the last case
|
|
507
|
+
// for some reason system asks top-level (react root) vc to present instead of our stack, despite the fact that
|
|
508
|
+
// `definesPresentationContext` returns `YES` for UINavigationController.
|
|
509
|
+
// So we first need to find top-level controller manually:
|
|
510
|
+
UIViewController *reactRootVc = [self findReactRootViewController];
|
|
511
|
+
UIViewController *topMostVc = [RNSScreenStackView findTopMostPresentedViewControllerFromViewController:reactRootVc];
|
|
512
|
+
|
|
513
|
+
if (topMostVc != reactRootVc) {
|
|
514
|
+
changeRootController = topMostVc;
|
|
515
|
+
|
|
516
|
+
// Here we handle just the simplest case where the top level VC was dismissed. In any more complex
|
|
517
|
+
// scenario we will still have problems, see: https://github.com/software-mansion/react-native-screens/issues/1813
|
|
518
|
+
if ([_presentedModals containsObject:topMostVc] && ![controllers containsObject:topMostVc]) {
|
|
519
|
+
[changeRootController dismissViewControllerAnimated:YES completion:finish];
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// We didn't detect any controllers for dismissal, thus we start presenting new VCs
|
|
525
|
+
finish();
|
|
453
526
|
}
|
|
454
527
|
|
|
455
528
|
- (void)setPushViewControllers:(NSArray<UIViewController *> *)controllers
|
|
@@ -573,6 +646,22 @@ namespace react = facebook::react;
|
|
|
573
646
|
{
|
|
574
647
|
[super layoutSubviews];
|
|
575
648
|
_controller.view.frame = self.bounds;
|
|
649
|
+
|
|
650
|
+
// We need to update the bounds of the modal views here, since
|
|
651
|
+
// for contained modals they are not updated by modals themselves.
|
|
652
|
+
for (UIViewController *modal in _presentedModals) {
|
|
653
|
+
// Because `layoutSubviews` method is also called on grabbing the modal,
|
|
654
|
+
// we don't want to update the frame when modal is being dismissed.
|
|
655
|
+
// We also want to get the frame in correct position. In the best case, it
|
|
656
|
+
// should be modal's superview (UITransitionView), which frame is being changed correctly.
|
|
657
|
+
// Otherwise, when superview is nil, we will fallback to the bounds of the ScreenStack.
|
|
658
|
+
BOOL isModalBeingDismissed = [modal isKindOfClass:[RNSScreen class]] && ((RNSScreen *)modal).isBeingDismissed;
|
|
659
|
+
CGRect correctFrame = modal.view.superview != nil ? modal.view.superview.frame : self.bounds;
|
|
660
|
+
|
|
661
|
+
if (!CGRectEqualToRect(modal.view.frame, correctFrame) && !isModalBeingDismissed) {
|
|
662
|
+
modal.view.frame = correctFrame;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
576
665
|
}
|
|
577
666
|
|
|
578
667
|
- (void)dismissOnReload
|
|
@@ -608,7 +697,7 @@ namespace react = facebook::react;
|
|
|
608
697
|
// Also, we need to return the animator when full width swiping even if the animation is not custom,
|
|
609
698
|
// otherwise the screen will be just popped immediately due to no animation
|
|
610
699
|
((operation == UINavigationControllerOperationPop && shouldCancelDismiss) || _isFullWidthSwiping ||
|
|
611
|
-
[RNSScreenStackAnimator isCustomAnimation:screen.stackAnimation])) {
|
|
700
|
+
[RNSScreenStackAnimator isCustomAnimation:screen.stackAnimation] || _customAnimation)) {
|
|
612
701
|
return [[RNSScreenStackAnimator alloc] initWithOperation:operation];
|
|
613
702
|
}
|
|
614
703
|
return nil;
|
|
@@ -637,9 +726,12 @@ namespace react = facebook::react;
|
|
|
637
726
|
|
|
638
727
|
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
|
|
639
728
|
{
|
|
729
|
+
if (_disableSwipeBack) {
|
|
730
|
+
return NO;
|
|
731
|
+
}
|
|
640
732
|
RNSScreenView *topScreen = _reactSubviews.lastObject;
|
|
641
733
|
|
|
642
|
-
#if TARGET_OS_TV
|
|
734
|
+
#if TARGET_OS_TV || TARGET_OS_VISION
|
|
643
735
|
[self cancelTouchesInParent];
|
|
644
736
|
return YES;
|
|
645
737
|
#else
|
|
@@ -657,12 +749,14 @@ namespace react = facebook::react;
|
|
|
657
749
|
// Now we're dealing with RNSScreenEdgeGestureRecognizer (or _UIParallaxTransitionPanGestureRecognizer)
|
|
658
750
|
if (topScreen.customAnimationOnSwipe && [RNSScreenStackAnimator isCustomAnimation:topScreen.stackAnimation]) {
|
|
659
751
|
if ([gestureRecognizer isKindOfClass:[RNSScreenEdgeGestureRecognizer class]]) {
|
|
752
|
+
UIRectEdge edges = ((RNSScreenEdgeGestureRecognizer *)gestureRecognizer).edges;
|
|
753
|
+
BOOL isRTL = _controller.view.semanticContentAttribute == UISemanticContentAttributeForceRightToLeft;
|
|
754
|
+
BOOL isSlideFromLeft = topScreen.stackAnimation == RNSScreenStackAnimationSlideFromLeft;
|
|
660
755
|
// if we do not set any explicit `semanticContentAttribute`, it is `UISemanticContentAttributeUnspecified` instead
|
|
661
756
|
// of `UISemanticContentAttributeForceLeftToRight`, so we just check if it is RTL or not
|
|
662
|
-
BOOL isCorrectEdge = (
|
|
663
|
-
|
|
664
|
-
(
|
|
665
|
-
((RNSScreenEdgeGestureRecognizer *)gestureRecognizer).edges == UIRectEdgeLeft);
|
|
757
|
+
BOOL isCorrectEdge = (isRTL && edges == UIRectEdgeRight) ||
|
|
758
|
+
(!isRTL && isSlideFromLeft && edges == UIRectEdgeRight) ||
|
|
759
|
+
(isRTL && isSlideFromLeft && edges == UIRectEdgeLeft) || (!isRTL && edges == UIRectEdgeLeft);
|
|
666
760
|
if (isCorrectEdge) {
|
|
667
761
|
[self cancelTouchesInParent];
|
|
668
762
|
return YES;
|
|
@@ -682,7 +776,7 @@ namespace react = facebook::react;
|
|
|
682
776
|
#endif // TARGET_OS_TV
|
|
683
777
|
}
|
|
684
778
|
|
|
685
|
-
#if !TARGET_OS_TV
|
|
779
|
+
#if !TARGET_OS_TV && !TARGET_OS_VISION
|
|
686
780
|
- (void)setupGestureHandlers
|
|
687
781
|
{
|
|
688
782
|
// gesture recognizers for custom stack animations
|
|
@@ -726,7 +820,10 @@ namespace react = facebook::react;
|
|
|
726
820
|
}
|
|
727
821
|
}
|
|
728
822
|
|
|
823
|
+
bool isInverted = topScreen.stackAnimation == RNSScreenStackAnimationSlideFromLeft;
|
|
824
|
+
|
|
729
825
|
float transitionProgress = (translation / distance);
|
|
826
|
+
transitionProgress = isInverted ? transitionProgress * -1 : transitionProgress;
|
|
730
827
|
|
|
731
828
|
switch (gestureRecognizer.state) {
|
|
732
829
|
case UIGestureRecognizerStateBegan: {
|
|
@@ -748,7 +845,10 @@ namespace react = facebook::react;
|
|
|
748
845
|
case UIGestureRecognizerStateEnded: {
|
|
749
846
|
// values taken from
|
|
750
847
|
// https://github.com/react-navigation/react-navigation/blob/54739828598d7072c1bf7b369659e3682db3edc5/packages/stack/src/views/Stack/Card.tsx#L316
|
|
751
|
-
|
|
848
|
+
float snapPoint = distance / 2;
|
|
849
|
+
float gestureDistance = translation + velocity * 0.3;
|
|
850
|
+
gestureDistance = isInverted ? gestureDistance * -1 : gestureDistance;
|
|
851
|
+
BOOL shouldFinishTransition = gestureDistance > snapPoint;
|
|
752
852
|
if (shouldFinishTransition) {
|
|
753
853
|
[_interactionController finishInteractiveTransition];
|
|
754
854
|
} else {
|
|
@@ -847,8 +947,8 @@ namespace react = facebook::react;
|
|
|
847
947
|
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
|
|
848
948
|
{
|
|
849
949
|
if (CGRectContainsPoint(_controller.navigationBar.frame, point)) {
|
|
850
|
-
|
|
851
|
-
UIView *headerConfig =
|
|
950
|
+
RNSScreenView *topMostScreen = (RNSScreenView *)_reactSubviews.lastObject;
|
|
951
|
+
UIView *headerConfig = topMostScreen.findHeaderConfig;
|
|
852
952
|
if ([headerConfig isKindOfClass:[RNSScreenStackHeaderConfig class]]) {
|
|
853
953
|
UIView *headerHitTestResult = [headerConfig hitTest:point withEvent:event];
|
|
854
954
|
if (headerHitTestResult != nil) {
|
|
@@ -859,7 +959,7 @@ namespace react = facebook::react;
|
|
|
859
959
|
return [super hitTest:point withEvent:event];
|
|
860
960
|
}
|
|
861
961
|
|
|
862
|
-
#if !TARGET_OS_TV
|
|
962
|
+
#if !TARGET_OS_TV && !TARGET_OS_VISION
|
|
863
963
|
|
|
864
964
|
- (BOOL)isScrollViewPanGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
|
|
865
965
|
{
|
|
@@ -960,6 +1060,33 @@ namespace react = facebook::react;
|
|
|
960
1060
|
});
|
|
961
1061
|
}
|
|
962
1062
|
|
|
1063
|
+
- (void)startScreenTransition
|
|
1064
|
+
{
|
|
1065
|
+
if (_interactionController == nil) {
|
|
1066
|
+
_customAnimation = YES;
|
|
1067
|
+
_interactionController = [UIPercentDrivenInteractiveTransition new];
|
|
1068
|
+
[_controller popViewControllerAnimated:YES];
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
- (void)updateScreenTransition:(double)progress
|
|
1073
|
+
{
|
|
1074
|
+
[_interactionController updateInteractiveTransition:progress];
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
- (void)finishScreenTransition:(BOOL)canceled
|
|
1078
|
+
{
|
|
1079
|
+
_customAnimation = NO;
|
|
1080
|
+
if (canceled) {
|
|
1081
|
+
[_interactionController updateInteractiveTransition:0.0];
|
|
1082
|
+
[_interactionController cancelInteractiveTransition];
|
|
1083
|
+
} else {
|
|
1084
|
+
[_interactionController updateInteractiveTransition:1.0];
|
|
1085
|
+
[_interactionController finishInteractiveTransition];
|
|
1086
|
+
}
|
|
1087
|
+
_interactionController = nil;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
963
1090
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
964
1091
|
#pragma mark - Fabric specific
|
|
965
1092
|
|
|
@@ -64,7 +64,10 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
if (screen != nil) {
|
|
67
|
-
if (screen.
|
|
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
|
@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
|
-
|
|
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 =
|
|
140
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|
package/ios/RNSSearchBar.mm
CHANGED
|
@@ -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
|
|
@@ -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(
|
|
9
|
-
function _interopRequireWildcard(
|
|
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","
|
|
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"}
|