@amazon-devices/react-native-screens 2.0.1758683737
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +223 -0
- package/RNScreens.podspec +53 -0
- package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.bundle +33668 -0
- package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.map +1 -0
- package/SystemModules/amzn__react-native-screens.modules.txt +101 -0
- package/SystemModules/amzn__react-native-screens.private.modules.txt +244 -0
- package/SystemModules/keplerscript-system-bundle-config.json +7 -0
- package/THIRD_PARTY_NOTICES.txt +707 -0
- package/android/build.gradle +133 -0
- package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +49 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +77 -0
- package/android/src/main/java/com/swmansion/rnscreens/CustomToolbar.kt +7 -0
- package/android/src/main/java/com/swmansion/rnscreens/FragmentBackPressOverrider.kt +29 -0
- package/android/src/main/java/com/swmansion/rnscreens/FragmentHolder.kt +7 -0
- package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +21 -0
- package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +289 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt +372 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainerViewManager.kt +40 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenEventDispatcher.kt +21 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt +331 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFragmentWrapper.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +336 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +282 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragmentWrapper.kt +15 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +398 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +204 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt +38 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubviewManager.kt +41 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt +75 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +186 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +296 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +19 -0
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +133 -0
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +178 -0
- package/android/src/main/java/com/swmansion/rnscreens/SearchViewFormatter.kt +67 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +26 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt +20 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt +32 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +28 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/utils/DeviceUtils.kt +12 -0
- package/android/src/main/jni/CMakeLists.txt +72 -0
- package/android/src/main/jni/rnscreens.cpp +16 -0
- package/android/src/main/jni/rnscreens.h +28 -0
- package/android/src/main/res/base/anim/rns_default_enter_in.xml +18 -0
- package/android/src/main/res/base/anim/rns_default_enter_out.xml +19 -0
- package/android/src/main/res/base/anim/rns_default_exit_in.xml +17 -0
- package/android/src/main/res/base/anim/rns_default_exit_out.xml +18 -0
- package/android/src/main/res/base/anim/rns_fade_from_bottom.xml +14 -0
- package/android/src/main/res/base/anim/rns_fade_in.xml +7 -0
- package/android/src/main/res/base/anim/rns_fade_out.xml +7 -0
- package/android/src/main/res/base/anim/rns_fade_to_bottom.xml +15 -0
- package/android/src/main/res/base/anim/rns_no_animation_20.xml +6 -0
- package/android/src/main/res/base/anim/rns_no_animation_250.xml +7 -0
- package/android/src/main/res/base/anim/rns_no_animation_350.xml +6 -0
- package/android/src/main/res/base/anim/rns_no_animation_medium.xml +7 -0
- package/android/src/main/res/base/anim/rns_slide_in_from_bottom.xml +7 -0
- package/android/src/main/res/base/anim/rns_slide_in_from_left.xml +5 -0
- package/android/src/main/res/base/anim/rns_slide_in_from_right.xml +5 -0
- package/android/src/main/res/base/anim/rns_slide_out_to_bottom.xml +7 -0
- package/android/src/main/res/base/anim/rns_slide_out_to_left.xml +5 -0
- package/android/src/main/res/base/anim/rns_slide_out_to_right.xml +5 -0
- package/android/src/main/res/base/anim/rns_standard_accelerate_interpolator.xml +6 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_out.xml +38 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +111 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +44 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +107 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +42 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerDelegate.java +31 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerInterface.java +17 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerInterface.java +16 -0
- package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +10 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +41 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +9 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +30 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +14 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +45 -0
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.h +11 -0
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.mm +14 -0
- package/ios/RNSConvert.h +36 -0
- package/ios/RNSConvert.mm +154 -0
- package/ios/RNSEnums.h +71 -0
- package/ios/RNSFullWindowOverlay.h +34 -0
- package/ios/RNSFullWindowOverlay.mm +241 -0
- package/ios/RNSScreen.h +144 -0
- package/ios/RNSScreen.mm +1599 -0
- package/ios/RNSScreenContainer.h +45 -0
- package/ios/RNSScreenContainer.mm +343 -0
- package/ios/RNSScreenNavigationContainer.h +16 -0
- package/ios/RNSScreenNavigationContainer.mm +66 -0
- package/ios/RNSScreenStack.h +37 -0
- package/ios/RNSScreenStack.mm +1111 -0
- package/ios/RNSScreenStackAnimator.h +8 -0
- package/ios/RNSScreenStackAnimator.mm +320 -0
- package/ios/RNSScreenStackHeaderConfig.h +74 -0
- package/ios/RNSScreenStackHeaderConfig.mm +967 -0
- package/ios/RNSScreenStackHeaderSubview.h +44 -0
- package/ios/RNSScreenStackHeaderSubview.mm +147 -0
- package/ios/RNSScreenWindowTraits.h +26 -0
- package/ios/RNSScreenWindowTraits.mm +266 -0
- package/ios/RNSSearchBar.h +43 -0
- package/ios/RNSSearchBar.mm +465 -0
- package/ios/RNScreens.xcodeproj/project.pbxproj +461 -0
- package/ios/UIViewController+RNScreens.h +9 -0
- package/ios/UIViewController+RNScreens.mm +78 -0
- package/ios/UIWindow+RNScreens.h +9 -0
- package/ios/UIWindow+RNScreens.mm +17 -0
- package/ios/events/RNSHeaderHeightChangeEvent.h +8 -0
- package/ios/events/RNSHeaderHeightChangeEvent.mm +44 -0
- package/ios/events/RNSScreenViewEvent.h +12 -0
- package/ios/events/RNSScreenViewEvent.mm +59 -0
- package/ios/utils/RNSUIBarButtonItem.h +5 -0
- package/ios/utils/RNSUIBarButtonItem.mm +22 -0
- package/kepler-compatibility.json +8 -0
- package/kepler-transformed-package-info.json +3 -0
- package/lib/commonjs/TransitionProgressContext.js +11 -0
- package/lib/commonjs/TransitionProgressContext.js.map +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +11 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +33 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js +70 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +11 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +31 -0
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +12 -0
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +35 -0
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +19 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/commonjs/index.js +147 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.native.js +407 -0
- package/lib/commonjs/index.native.js.map +1 -0
- package/lib/commonjs/native-stack/index.js +49 -0
- package/lib/commonjs/native-stack/index.js.map +1 -0
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +75 -0
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
- package/lib/commonjs/native-stack/types.js +6 -0
- package/lib/commonjs/native-stack/types.js.map +1 -0
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js +12 -0
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -0
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +12 -0
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -0
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +75 -0
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -0
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js +35 -0
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -0
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js +19 -0
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +54 -0
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -0
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js +19 -0
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -0
- package/lib/commonjs/native-stack/views/FontProcessor.js +21 -0
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -0
- package/lib/commonjs/native-stack/views/HeaderConfig.js +141 -0
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js +354 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js +12 -0
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +101 -0
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedScreen.js +22 -0
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +47 -0
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +12 -0
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -0
- package/lib/commonjs/reanimated/index.js +28 -0
- package/lib/commonjs/reanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +19 -0
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -0
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +19 -0
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/useTransitionProgress.js +19 -0
- package/lib/commonjs/useTransitionProgress.js.map +1 -0
- package/lib/commonjs/utils.js +21 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/module/TransitionProgressContext.js +3 -0
- package/lib/module/TransitionProgressContext.js.map +1 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +4 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js +25 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNativeComponent.js +63 -0
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +4 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +23 -0
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +7 -0
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackNativeComponent.js +28 -0
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -0
- package/lib/module/fabric/SearchBarNativeComponent.js +10 -0
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/module/index.js +67 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.native.js +410 -0
- package/lib/module/index.native.js.map +1 -0
- package/lib/module/native-stack/index.js +22 -0
- package/lib/module/native-stack/index.js.map +1 -0
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +72 -0
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
- package/lib/module/native-stack/types.js +2 -0
- package/lib/module/native-stack/types.js.map +1 -0
- package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js +4 -0
- package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -0
- package/lib/module/native-stack/utils/HeaderHeightContext.js +4 -0
- package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -0
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js +68 -0
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -0
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js +29 -0
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -0
- package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js +10 -0
- package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
- package/lib/module/native-stack/utils/useBackPressSubscription.js +47 -0
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -0
- package/lib/module/native-stack/utils/useHeaderHeight.js +10 -0
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -0
- package/lib/module/native-stack/views/FontProcessor.js +13 -0
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -0
- package/lib/module/native-stack/views/HeaderConfig.js +132 -0
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -0
- package/lib/module/native-stack/views/NativeStackView.js +355 -0
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -0
- package/lib/module/reanimated/ReanimatedHeaderHeightContext.js +5 -0
- package/lib/module/reanimated/ReanimatedHeaderHeightContext.js.map +1 -0
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +97 -0
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -0
- package/lib/module/reanimated/ReanimatedScreen.js +17 -0
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -0
- package/lib/module/reanimated/ReanimatedScreenProvider.js +40 -0
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js +5 -0
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -0
- package/lib/module/reanimated/index.js +4 -0
- package/lib/module/reanimated/index.js.map +1 -0
- package/lib/module/reanimated/useReanimatedHeaderHeight.js +10 -0
- package/lib/module/reanimated/useReanimatedHeaderHeight.js.map +1 -0
- package/lib/module/reanimated/useReanimatedTransitionProgress.js +10 -0
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useTransitionProgress.js +10 -0
- package/lib/module/useTransitionProgress.js.map +1 -0
- package/lib/module/utils.js +14 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/TransitionProgressContext.d.ts +9 -0
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +7 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +5 -0
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +66 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +7 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +33 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +10 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +8 -0
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +49 -0
- package/lib/typescript/index.d.ts +33 -0
- package/lib/typescript/index.native.d.ts +2 -0
- package/lib/typescript/native-stack/index.d.ts +19 -0
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +6 -0
- package/lib/typescript/native-stack/types.d.ts +438 -0
- package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts +4 -0
- package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts +3 -0
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +11 -0
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +7 -0
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts +16 -0
- package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/views/FontProcessor.d.ts +1 -0
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +8 -0
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +10 -0
- package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts +4 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +5 -0
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +5 -0
- package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts +2 -0
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +9 -0
- package/lib/typescript/reanimated/index.d.ts +3 -0
- package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts +3 -0
- package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts +11 -0
- package/lib/typescript/types.d.ts +612 -0
- package/lib/typescript/useTransitionProgress.d.ts +5 -0
- package/lib/typescript/utils.d.ts +3 -0
- package/native-stack/README.md +814 -0
- package/native-stack/package.json +6 -0
- package/package.json +1 -0
- package/react-native.config.js +42 -0
- package/reanimated/package.json +6 -0
- package/src/TransitionProgressContext.tsx +12 -0
- package/src/fabric/FullWindowOverlayNativeComponent.ts +7 -0
- package/src/fabric/ScreenContainerNativeComponent.ts +28 -0
- package/src/fabric/ScreenNativeComponent.ts +158 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +10 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +61 -0
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +22 -0
- package/src/fabric/ScreenStackNativeComponent.ts +33 -0
- package/src/fabric/SearchBarNativeComponent.ts +79 -0
- package/src/index.native.tsx +599 -0
- package/src/index.tsx +119 -0
- package/src/native-stack/index.tsx +27 -0
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +107 -0
- package/src/native-stack/types.tsx +486 -0
- package/src/native-stack/utils/AnimatedHeaderHeightContext.tsx +8 -0
- package/src/native-stack/utils/HeaderHeightContext.tsx +5 -0
- package/src/native-stack/utils/SafeAreaProviderCompat.tsx +78 -0
- package/src/native-stack/utils/getDefaultHeaderHeight.tsx +41 -0
- package/src/native-stack/utils/useAnimatedHeaderHeight.tsx +15 -0
- package/src/native-stack/utils/useBackPressSubscription.tsx +66 -0
- package/src/native-stack/utils/useHeaderHeight.tsx +15 -0
- package/src/native-stack/views/FontProcessor.tsx +14 -0
- package/src/native-stack/views/HeaderConfig.tsx +187 -0
- package/src/native-stack/views/NativeStackView.tsx +466 -0
- package/src/reanimated/ReanimatedHeaderHeightContext.tsx +7 -0
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +130 -0
- package/src/reanimated/ReanimatedScreen.tsx +25 -0
- package/src/reanimated/ReanimatedScreenProvider.tsx +42 -0
- package/src/reanimated/ReanimatedTransitionProgressContext.tsx +13 -0
- package/src/reanimated/index.tsx +3 -0
- package/src/reanimated/useReanimatedHeaderHeight.tsx +14 -0
- package/src/reanimated/useReanimatedTransitionProgress.tsx +14 -0
- package/src/types.tsx +699 -0
- package/src/useTransitionProgress.tsx +15 -0
- package/src/utils.ts +18 -0
- package/windows/README.md +25 -0
- package/windows/RNScreens/PropertySheet.props +16 -0
- package/windows/RNScreens/RNScreens.cpp +66 -0
- package/windows/RNScreens/RNScreens.def +3 -0
- package/windows/RNScreens/RNScreens.h +41 -0
- package/windows/RNScreens/RNScreens.idl +8 -0
- package/windows/RNScreens/RNScreens.vcxproj +187 -0
- package/windows/RNScreens/RNScreens.vcxproj.filters +52 -0
- package/windows/RNScreens/ReactPackageProvider.cpp +30 -0
- package/windows/RNScreens/ReactPackageProvider.h +17 -0
- package/windows/RNScreens/ReactPackageProvider.idl +9 -0
- package/windows/RNScreens/Screen.cpp +122 -0
- package/windows/RNScreens/Screen.h +64 -0
- package/windows/RNScreens/ScreenContainer.cpp +49 -0
- package/windows/RNScreens/ScreenContainer.h +23 -0
- package/windows/RNScreens/ScreenContainerViewManager.cpp +133 -0
- package/windows/RNScreens/ScreenContainerViewManager.h +78 -0
- package/windows/RNScreens/ScreenStack.cpp +65 -0
- package/windows/RNScreens/ScreenStack.h +23 -0
- package/windows/RNScreens/ScreenStackHeaderConfig.cpp +19 -0
- package/windows/RNScreens/ScreenStackHeaderConfig.h +14 -0
- package/windows/RNScreens/ScreenStackHeaderConfigViewManager.cpp +89 -0
- package/windows/RNScreens/ScreenStackHeaderConfigViewManager.h +62 -0
- package/windows/RNScreens/ScreenStackViewManager.cpp +132 -0
- package/windows/RNScreens/ScreenStackViewManager.h +78 -0
- package/windows/RNScreens/ScreenViewManager.cpp +154 -0
- package/windows/RNScreens/ScreenViewManager.h +78 -0
- package/windows/RNScreens/packages.config +4 -0
- package/windows/RNScreens/pch.cpp +1 -0
- package/windows/RNScreens/pch.h +9 -0
- package/windows/RNScreens62.sln +254 -0
- package/windows/RNScreens63.sln +225 -0
- package/windows/RNScreens65.sln +144 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#import <React/RCTViewComponentView.h>
|
|
3
|
+
#else
|
|
4
|
+
#endif
|
|
5
|
+
|
|
6
|
+
#import <React/RCTViewManager.h>
|
|
7
|
+
|
|
8
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
@protocol RNSScreenContainerDelegate
|
|
11
|
+
|
|
12
|
+
- (void)markChildUpdated;
|
|
13
|
+
- (void)updateContainer;
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
@protocol RNSViewControllerDelegate
|
|
18
|
+
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
@interface RNSViewController : UIViewController <RNSViewControllerDelegate>
|
|
22
|
+
|
|
23
|
+
- (UIViewController *)findActiveChildVC;
|
|
24
|
+
|
|
25
|
+
@end
|
|
26
|
+
|
|
27
|
+
@interface RNSScreenContainerManager : RCTViewManager
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
@interface RNSScreenContainerView :
|
|
32
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
33
|
+
RCTViewComponentView <RNSScreenContainerDelegate>
|
|
34
|
+
#else
|
|
35
|
+
UIView <RNSScreenContainerDelegate, RCTInvalidating>
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
@property (nonatomic, retain) UIViewController *controller;
|
|
39
|
+
@property (nonatomic, retain) NSMutableArray *reactSubviews;
|
|
40
|
+
|
|
41
|
+
- (void)maybeDismissVC;
|
|
42
|
+
|
|
43
|
+
@end
|
|
44
|
+
|
|
45
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
#import "RNSScreenContainer.h"
|
|
2
|
+
#import "RNSScreen.h"
|
|
3
|
+
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
|
+
#import <React/RCTConversions.h>
|
|
6
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
7
|
+
#import <react/renderer/components/rnscreens/ComponentDescriptors.h>
|
|
8
|
+
#import <react/renderer/components/rnscreens/Props.h>
|
|
9
|
+
|
|
10
|
+
namespace react = facebook::react;
|
|
11
|
+
|
|
12
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
13
|
+
|
|
14
|
+
@implementation RNSViewController
|
|
15
|
+
|
|
16
|
+
#if !TARGET_OS_TV
|
|
17
|
+
- (UIViewController *)childViewControllerForStatusBarStyle
|
|
18
|
+
{
|
|
19
|
+
return [self findActiveChildVC];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation
|
|
23
|
+
{
|
|
24
|
+
return [self findActiveChildVC].preferredStatusBarUpdateAnimation;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
- (UIViewController *)childViewControllerForStatusBarHidden
|
|
28
|
+
{
|
|
29
|
+
return [self findActiveChildVC];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
|
|
33
|
+
{
|
|
34
|
+
return [self findActiveChildVC].supportedInterfaceOrientations;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (UIViewController *)childViewControllerForHomeIndicatorAutoHidden
|
|
38
|
+
{
|
|
39
|
+
return [self findActiveChildVC];
|
|
40
|
+
}
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
- (UIViewController *)findActiveChildVC
|
|
44
|
+
{
|
|
45
|
+
for (UIViewController *childVC in self.childViewControllers) {
|
|
46
|
+
if ([childVC isKindOfClass:[RNSScreen class]] &&
|
|
47
|
+
((RNSScreen *)childVC).screenView.activityState == RNSActivityStateOnTop) {
|
|
48
|
+
return childVC;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return [[self childViewControllers] lastObject];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@end
|
|
55
|
+
|
|
56
|
+
@implementation RNSScreenContainerView {
|
|
57
|
+
BOOL _invalidated;
|
|
58
|
+
NSMutableSet *_activeScreens;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
- (instancetype)init
|
|
62
|
+
{
|
|
63
|
+
if (self = [super init]) {
|
|
64
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
65
|
+
static const auto defaultProps = std::make_shared<const react::RNSScreenContainerProps>();
|
|
66
|
+
_props = defaultProps;
|
|
67
|
+
#endif
|
|
68
|
+
_activeScreens = [NSMutableSet new];
|
|
69
|
+
_reactSubviews = [NSMutableArray new];
|
|
70
|
+
[self setupController];
|
|
71
|
+
_invalidated = NO;
|
|
72
|
+
}
|
|
73
|
+
return self;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
- (void)setupController
|
|
77
|
+
{
|
|
78
|
+
_controller = [[RNSViewController alloc] init];
|
|
79
|
+
[self addSubview:_controller.view];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
- (void)markChildUpdated
|
|
83
|
+
{
|
|
84
|
+
// We want the attaching/detaching of children to be always made on main queue, which
|
|
85
|
+
// is currently true for `react-navigation` since this method is triggered
|
|
86
|
+
// by the changes of `Animated` value in stack's transition or adding/removing screens
|
|
87
|
+
// in all navigators
|
|
88
|
+
RCTAssertMainQueue();
|
|
89
|
+
[self updateContainer];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
- (void)insertReactSubview:(RNSScreenView *)subview atIndex:(NSInteger)atIndex
|
|
93
|
+
{
|
|
94
|
+
subview.reactSuperview = self;
|
|
95
|
+
[_reactSubviews insertObject:subview atIndex:atIndex];
|
|
96
|
+
[subview reactSetFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
- (void)removeReactSubview:(RNSScreenView *)subview
|
|
100
|
+
{
|
|
101
|
+
subview.reactSuperview = nil;
|
|
102
|
+
[_reactSubviews removeObject:subview];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
- (NSArray<UIView *> *)reactSubviews
|
|
106
|
+
{
|
|
107
|
+
return _reactSubviews;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
- (UIViewController *)reactViewController
|
|
111
|
+
{
|
|
112
|
+
return _controller;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
- (UIViewController *)findChildControllerForScreen:(RNSScreenView *)screen
|
|
116
|
+
{
|
|
117
|
+
for (UIViewController *vc in _controller.childViewControllers) {
|
|
118
|
+
if (vc.view == screen) {
|
|
119
|
+
return vc;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return nil;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
- (void)prepareDetach:(RNSScreenView *)screen
|
|
126
|
+
{
|
|
127
|
+
[[self findChildControllerForScreen:screen] willMoveToParentViewController:nil];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
- (void)detachScreen:(RNSScreenView *)screen
|
|
131
|
+
{
|
|
132
|
+
// We use findChildControllerForScreen method instead of directly accesing
|
|
133
|
+
// screen.controller because screen.controller may be reset to nil when the
|
|
134
|
+
// original screen view gets detached from the view hierarchy (we reset controller
|
|
135
|
+
// reference to avoid reference loops)
|
|
136
|
+
UIViewController *detachController = [self findChildControllerForScreen:screen];
|
|
137
|
+
[detachController willMoveToParentViewController:nil];
|
|
138
|
+
[screen removeFromSuperview];
|
|
139
|
+
[detachController removeFromParentViewController];
|
|
140
|
+
[_activeScreens removeObject:screen];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
- (void)attachScreen:(RNSScreenView *)screen atIndex:(NSInteger)index
|
|
144
|
+
{
|
|
145
|
+
[_controller addChildViewController:screen.controller];
|
|
146
|
+
// the frame is already set at this moment because we adjust it in insertReactSubview. We don't
|
|
147
|
+
// want to update it here as react-driven animations may already run and hence changing the frame
|
|
148
|
+
// would result in visual glitches
|
|
149
|
+
[_controller.view insertSubview:screen.controller.view atIndex:index];
|
|
150
|
+
[screen.controller didMoveToParentViewController:_controller];
|
|
151
|
+
[_activeScreens addObject:screen];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
- (void)updateContainer
|
|
155
|
+
{
|
|
156
|
+
BOOL screenRemoved = NO;
|
|
157
|
+
// remove screens that are no longer active
|
|
158
|
+
NSMutableSet *orphaned = [NSMutableSet setWithSet:_activeScreens];
|
|
159
|
+
for (RNSScreenView *screen in _reactSubviews) {
|
|
160
|
+
if (screen.activityState == RNSActivityStateInactive && [_activeScreens containsObject:screen]) {
|
|
161
|
+
screenRemoved = YES;
|
|
162
|
+
[self detachScreen:screen];
|
|
163
|
+
}
|
|
164
|
+
[orphaned removeObject:screen];
|
|
165
|
+
}
|
|
166
|
+
for (RNSScreenView *screen in orphaned) {
|
|
167
|
+
screenRemoved = YES;
|
|
168
|
+
[self detachScreen:screen];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// detect if new screen is going to be activated
|
|
172
|
+
BOOL screenAdded = NO;
|
|
173
|
+
for (RNSScreenView *screen in _reactSubviews) {
|
|
174
|
+
if (screen.activityState != RNSActivityStateInactive && ![_activeScreens containsObject:screen]) {
|
|
175
|
+
screenAdded = YES;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (screenAdded) {
|
|
180
|
+
// add new screens in order they are placed in subviews array
|
|
181
|
+
NSInteger index = 0;
|
|
182
|
+
for (RNSScreenView *screen in _reactSubviews) {
|
|
183
|
+
if (screen.activityState != RNSActivityStateInactive) {
|
|
184
|
+
if ([_activeScreens containsObject:screen] && screen.activityState == RNSActivityStateTransitioningOrBelowTop) {
|
|
185
|
+
// for screens that were already active we want to mimick the effect UINavigationController
|
|
186
|
+
// has when willMoveToWindow:nil is triggered before the animation starts
|
|
187
|
+
[self prepareDetach:screen];
|
|
188
|
+
} else if (![_activeScreens containsObject:screen]) {
|
|
189
|
+
[self attachScreen:screen atIndex:index];
|
|
190
|
+
}
|
|
191
|
+
index += 1;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
for (RNSScreenView *screen in _reactSubviews) {
|
|
197
|
+
if (screen.activityState == RNSActivityStateOnTop) {
|
|
198
|
+
[screen notifyFinishTransitioning];
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (screenRemoved || screenAdded) {
|
|
203
|
+
[self maybeDismissVC];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
- (void)maybeDismissVC
|
|
208
|
+
{
|
|
209
|
+
if (_controller.presentedViewController == nil && _controller.presentingViewController == nil) {
|
|
210
|
+
// if user has reachability enabled (one hand use) and the window is slided down the below
|
|
211
|
+
// method will force it to slide back up as it is expected to happen with UINavController when
|
|
212
|
+
// we push or pop views.
|
|
213
|
+
// We only do that if `presentedViewController` is nil, as otherwise it'd mean that modal has
|
|
214
|
+
// been presented on top of recently changed controller in which case the below method would
|
|
215
|
+
// dismiss such a modal (e.g., permission modal or alert)
|
|
216
|
+
[_controller dismissViewControllerAnimated:NO completion:nil];
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
- (void)didUpdateReactSubviews
|
|
221
|
+
{
|
|
222
|
+
[self markChildUpdated];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
- (void)didMoveToWindow
|
|
226
|
+
{
|
|
227
|
+
if (self.window && !_invalidated) {
|
|
228
|
+
// We check whether the view has been invalidated before running side-effects in didMoveToWindow
|
|
229
|
+
// This is needed because when LayoutAnimations are used it is possible for view to be re-attached
|
|
230
|
+
// to a window despite the fact it has been removed from the React Native view hierarchy.
|
|
231
|
+
[self reactAddControllerToClosestParent:_controller];
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
- (void)layoutSubviews
|
|
236
|
+
{
|
|
237
|
+
[super layoutSubviews];
|
|
238
|
+
_controller.view.frame = self.bounds;
|
|
239
|
+
for (RNSScreenView *subview in _reactSubviews) {
|
|
240
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
241
|
+
react::LayoutMetrics screenLayoutMetrics = subview.newLayoutMetrics;
|
|
242
|
+
screenLayoutMetrics.frame = RCTRectFromCGRect(CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height));
|
|
243
|
+
[subview updateLayoutMetrics:screenLayoutMetrics oldLayoutMetrics:subview.oldLayoutMetrics];
|
|
244
|
+
#else
|
|
245
|
+
[subview reactSetFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)];
|
|
246
|
+
#endif
|
|
247
|
+
[subview setNeedsLayout];
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
#pragma mark-- Fabric specific
|
|
252
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
253
|
+
|
|
254
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
255
|
+
{
|
|
256
|
+
if (![childComponentView isKindOfClass:[RNSScreenView class]]) {
|
|
257
|
+
RCTLogError(@"ScreenContainer only accepts children of type Screen");
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
RNSScreenView *screenView = (RNSScreenView *)childComponentView;
|
|
262
|
+
|
|
263
|
+
RCTAssert(
|
|
264
|
+
childComponentView.reactSuperview == nil,
|
|
265
|
+
@"Attempt to mount already mounted component view. (parent: %@, child: %@, index: %@, existing parent: %@)",
|
|
266
|
+
self,
|
|
267
|
+
childComponentView,
|
|
268
|
+
@(index),
|
|
269
|
+
@([childComponentView.superview tag]));
|
|
270
|
+
|
|
271
|
+
[_reactSubviews insertObject:screenView atIndex:index];
|
|
272
|
+
screenView.reactSuperview = self;
|
|
273
|
+
react::LayoutMetrics screenLayoutMetrics = screenView.newLayoutMetrics;
|
|
274
|
+
screenLayoutMetrics.frame = RCTRectFromCGRect(CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height));
|
|
275
|
+
[screenView updateLayoutMetrics:screenLayoutMetrics oldLayoutMetrics:screenView.oldLayoutMetrics];
|
|
276
|
+
[self markChildUpdated];
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
280
|
+
{
|
|
281
|
+
RCTAssert(
|
|
282
|
+
childComponentView.reactSuperview == self,
|
|
283
|
+
@"Attempt to unmount a view which is mounted inside different view. (parent: %@, child: %@, index: %@)",
|
|
284
|
+
self,
|
|
285
|
+
childComponentView,
|
|
286
|
+
@(index));
|
|
287
|
+
RCTAssert(
|
|
288
|
+
(_reactSubviews.count > index) && [_reactSubviews objectAtIndex:index] == childComponentView,
|
|
289
|
+
@"Attempt to unmount a view which has a different index. (parent: %@, child: %@, index: %@, actual index: %@, tag at index: %@)",
|
|
290
|
+
self,
|
|
291
|
+
childComponentView,
|
|
292
|
+
@(index),
|
|
293
|
+
@([_reactSubviews indexOfObject:childComponentView]),
|
|
294
|
+
@([[_reactSubviews objectAtIndex:index] tag]));
|
|
295
|
+
((RNSScreenView *)childComponentView).reactSuperview = nil;
|
|
296
|
+
[_reactSubviews removeObject:childComponentView];
|
|
297
|
+
[childComponentView removeFromSuperview];
|
|
298
|
+
[self markChildUpdated];
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
+ (react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
302
|
+
{
|
|
303
|
+
return react::concreteComponentDescriptorProvider<react::RNSScreenContainerComponentDescriptor>();
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
- (void)prepareForRecycle
|
|
307
|
+
{
|
|
308
|
+
[super prepareForRecycle];
|
|
309
|
+
[_controller willMoveToParentViewController:nil];
|
|
310
|
+
[_controller removeFromParentViewController];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
#pragma mark-- Paper specific
|
|
314
|
+
#else
|
|
315
|
+
|
|
316
|
+
- (void)invalidate
|
|
317
|
+
{
|
|
318
|
+
_invalidated = YES;
|
|
319
|
+
[_controller willMoveToParentViewController:nil];
|
|
320
|
+
[_controller removeFromParentViewController];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
#endif
|
|
324
|
+
|
|
325
|
+
@end
|
|
326
|
+
|
|
327
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
328
|
+
Class<RCTComponentViewProtocol> RNSScreenContainerCls(void)
|
|
329
|
+
{
|
|
330
|
+
return RNSScreenContainerView.class;
|
|
331
|
+
}
|
|
332
|
+
#endif
|
|
333
|
+
|
|
334
|
+
@implementation RNSScreenContainerManager
|
|
335
|
+
|
|
336
|
+
RCT_EXPORT_MODULE()
|
|
337
|
+
|
|
338
|
+
- (UIView *)view
|
|
339
|
+
{
|
|
340
|
+
return [[RNSScreenContainerView alloc] init];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#import <React/RCTViewManager.h>
|
|
2
|
+
|
|
3
|
+
#import "RNSScreenContainer.h"
|
|
4
|
+
#import "RNSScreenStack.h"
|
|
5
|
+
|
|
6
|
+
@interface RNSContainerNavigationController : RNSNavigationController
|
|
7
|
+
|
|
8
|
+
@end
|
|
9
|
+
|
|
10
|
+
@interface RNSScreenNavigationContainerView : RNSScreenContainerView
|
|
11
|
+
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
@interface RNSScreenNavigationContainerManager : RNSScreenContainerManager
|
|
15
|
+
|
|
16
|
+
@end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#import "RNSScreenNavigationContainer.h"
|
|
2
|
+
#import "RNSScreen.h"
|
|
3
|
+
#import "RNSScreenContainer.h"
|
|
4
|
+
|
|
5
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
6
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
7
|
+
#import <react/renderer/components/rnscreens/ComponentDescriptors.h>
|
|
8
|
+
#import <react/renderer/components/rnscreens/Props.h>
|
|
9
|
+
|
|
10
|
+
namespace react = facebook::react;
|
|
11
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
12
|
+
|
|
13
|
+
@implementation RNSContainerNavigationController
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
@implementation RNSScreenNavigationContainerView
|
|
18
|
+
|
|
19
|
+
- (void)setupController
|
|
20
|
+
{
|
|
21
|
+
self.controller = [[RNSContainerNavigationController alloc] init];
|
|
22
|
+
[(RNSContainerNavigationController *)self.controller setNavigationBarHidden:YES animated:NO];
|
|
23
|
+
[self addSubview:self.controller.view];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
- (void)updateContainer
|
|
27
|
+
{
|
|
28
|
+
for (RNSScreenView *screen in self.reactSubviews) {
|
|
29
|
+
if (screen.activityState == RNSActivityStateOnTop) {
|
|
30
|
+
// there should never be more than one screen with `RNSActivityStateOnTop`
|
|
31
|
+
// since this component should be used for `tabs` and `drawer` navigators
|
|
32
|
+
[(RNSContainerNavigationController *)self.controller setViewControllers:@[ screen.controller ] animated:NO];
|
|
33
|
+
[screen notifyFinishTransitioning];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[self maybeDismissVC];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#pragma mark-- Fabric specific
|
|
41
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
42
|
+
+ (react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
43
|
+
{
|
|
44
|
+
return react::concreteComponentDescriptorProvider<react::RNSScreenNavigationContainerComponentDescriptor>();
|
|
45
|
+
}
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
@end
|
|
49
|
+
|
|
50
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
51
|
+
Class<RCTComponentViewProtocol> RNSScreenNavigationContainerCls(void)
|
|
52
|
+
{
|
|
53
|
+
return RNSScreenNavigationContainerView.class;
|
|
54
|
+
}
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
@implementation RNSScreenNavigationContainerManager
|
|
58
|
+
|
|
59
|
+
RCT_EXPORT_MODULE()
|
|
60
|
+
|
|
61
|
+
- (UIView *)view
|
|
62
|
+
{
|
|
63
|
+
return [[RNSScreenNavigationContainerView alloc] init];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#import <React/RCTViewComponentView.h>
|
|
3
|
+
#else
|
|
4
|
+
#import <React/RCTUIManagerObserverCoordinator.h>
|
|
5
|
+
#import <React/RCTViewManager.h>
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#import "RNSScreenContainer.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface RNSNavigationController : UINavigationController <RNSViewControllerDelegate>
|
|
13
|
+
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
@interface RNSScreenStackView :
|
|
17
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
18
|
+
RCTViewComponentView <RNSScreenContainerDelegate>
|
|
19
|
+
#else
|
|
20
|
+
UIView <RNSScreenContainerDelegate, RCTInvalidating>
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
- (void)markChildUpdated;
|
|
24
|
+
- (void)didUpdateChildren;
|
|
25
|
+
|
|
26
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
27
|
+
#else
|
|
28
|
+
@property (nonatomic, copy) RCTDirectEventBlock onFinishTransitioning;
|
|
29
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
30
|
+
|
|
31
|
+
@end
|
|
32
|
+
|
|
33
|
+
@interface RNSScreenStackManager : RCTViewManager <RCTInvalidating>
|
|
34
|
+
|
|
35
|
+
@end
|
|
36
|
+
|
|
37
|
+
NS_ASSUME_NONNULL_END
|