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