@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,64 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
namespace winrt::RNScreens::implementation {
|
|
4
|
+
|
|
5
|
+
enum class StackPresentation { PUSH, MODAL, TRANSPARENT_MODAL };
|
|
6
|
+
|
|
7
|
+
enum class StackAnimation {
|
|
8
|
+
DEFAULT,
|
|
9
|
+
NONE,
|
|
10
|
+
FADE,
|
|
11
|
+
SIMPLE_FROM_BOTTOM,
|
|
12
|
+
SLIDE_FROM_RIGHT,
|
|
13
|
+
SLIDE_FROM_LEFT
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
enum class ReplaceAnimation { PUSH, POP };
|
|
17
|
+
|
|
18
|
+
enum class ActivityState { INACTIVE, TRANSITIONING_OR_BELOW_TOP, ON_TOP };
|
|
19
|
+
|
|
20
|
+
enum class WindowTraits {
|
|
21
|
+
ORIENTATION,
|
|
22
|
+
COLOR,
|
|
23
|
+
STYLE,
|
|
24
|
+
TRANSLUCENT,
|
|
25
|
+
HIDDEN,
|
|
26
|
+
ANIMATED
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
class Screen : public winrt::Windows::UI::Xaml::Controls::StackPanelT<Screen> {
|
|
30
|
+
public:
|
|
31
|
+
Screen(winrt::Microsoft::ReactNative::IReactContext reactContext);
|
|
32
|
+
~Screen();
|
|
33
|
+
|
|
34
|
+
void addView(winrt::Windows::UI::Xaml::UIElement element);
|
|
35
|
+
void removeAllChildren();
|
|
36
|
+
void removeChildAt(int64_t index);
|
|
37
|
+
void replaceChild(
|
|
38
|
+
winrt::Windows::UI::Xaml::UIElement oldChild,
|
|
39
|
+
winrt::Windows::UI::Xaml::UIElement newChild);
|
|
40
|
+
|
|
41
|
+
winrt::event_token onLoadingRevoker;
|
|
42
|
+
void onLoading(
|
|
43
|
+
winrt::Windows::UI::Xaml::FrameworkElement const &sender,
|
|
44
|
+
winrt::Windows::Foundation::IInspectable const &args);
|
|
45
|
+
|
|
46
|
+
winrt::event_token onLoadedRevoker;
|
|
47
|
+
void onLoaded(
|
|
48
|
+
winrt::Windows::Foundation::IInspectable const &sender,
|
|
49
|
+
winrt::Windows::UI::Xaml::RoutedEventArgs const &args);
|
|
50
|
+
|
|
51
|
+
winrt::event_token onUnloadedRevoker;
|
|
52
|
+
void onUnloaded(
|
|
53
|
+
winrt::Windows::Foundation::IInspectable const &sender,
|
|
54
|
+
winrt::Windows::UI::Xaml::RoutedEventArgs const &args);
|
|
55
|
+
|
|
56
|
+
void dispatchOnAppear();
|
|
57
|
+
void dispatchOnDisappear();
|
|
58
|
+
void dispatchOnWillAppear();
|
|
59
|
+
void dispatchOnWillDisappear();
|
|
60
|
+
|
|
61
|
+
private:
|
|
62
|
+
winrt::Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
63
|
+
};
|
|
64
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "ScreenContainer.h"
|
|
3
|
+
#include "JSValueXaml.h"
|
|
4
|
+
#include "NativeModules.h"
|
|
5
|
+
|
|
6
|
+
namespace winrt {
|
|
7
|
+
using namespace Microsoft::ReactNative;
|
|
8
|
+
using namespace Windows::Foundation;
|
|
9
|
+
using namespace Windows::Foundation::Collections;
|
|
10
|
+
using namespace Windows::UI;
|
|
11
|
+
using namespace Windows::UI::Xaml;
|
|
12
|
+
using namespace Windows::UI::Xaml::Controls;
|
|
13
|
+
} // namespace winrt
|
|
14
|
+
|
|
15
|
+
namespace winrt::RNScreens::implementation {
|
|
16
|
+
ScreenContainer::ScreenContainer(
|
|
17
|
+
winrt::Microsoft::ReactNative::IReactContext reactContext)
|
|
18
|
+
: m_reactContext(reactContext),
|
|
19
|
+
m_children(
|
|
20
|
+
{winrt::single_threaded_vector<Windows::UI::Xaml::UIElement>()}) {}
|
|
21
|
+
|
|
22
|
+
void ScreenContainer::addScreen(Screen &screen, int64_t) {
|
|
23
|
+
auto uiElement = screen.try_as<UIElement>();
|
|
24
|
+
if (!uiElement)
|
|
25
|
+
return;
|
|
26
|
+
|
|
27
|
+
m_children.Append(uiElement);
|
|
28
|
+
Content(uiElement);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
void ScreenContainer::removeAllChildren() {
|
|
32
|
+
Content(nullptr);
|
|
33
|
+
m_children.Clear();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
void ScreenContainer::removeChildAt(int64_t index) {
|
|
37
|
+
m_children.RemoveAt(static_cast<uint32_t>(index));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
void ScreenContainer::replaceChild(
|
|
41
|
+
winrt::Windows::UI::Xaml::UIElement oldChild,
|
|
42
|
+
winrt::Windows::UI::Xaml::UIElement newChild) {
|
|
43
|
+
uint32_t index;
|
|
44
|
+
if (!m_children.IndexOf(oldChild, index))
|
|
45
|
+
return;
|
|
46
|
+
|
|
47
|
+
m_children.SetAt(index, newChild);
|
|
48
|
+
}
|
|
49
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include "Screen.h"
|
|
3
|
+
|
|
4
|
+
namespace winrt::RNScreens::implementation {
|
|
5
|
+
class ScreenContainer
|
|
6
|
+
: public winrt::Windows::UI::Xaml::Controls::ContentControlT<
|
|
7
|
+
ScreenContainer> {
|
|
8
|
+
public:
|
|
9
|
+
ScreenContainer(winrt::Microsoft::ReactNative::IReactContext reactContext);
|
|
10
|
+
void addScreen(Screen &screen, int64_t index);
|
|
11
|
+
void removeAllChildren();
|
|
12
|
+
void removeChildAt(int64_t index);
|
|
13
|
+
void replaceChild(
|
|
14
|
+
winrt::Windows::UI::Xaml::UIElement oldChild,
|
|
15
|
+
winrt::Windows::UI::Xaml::UIElement newChild);
|
|
16
|
+
|
|
17
|
+
winrt::Windows::Foundation::Collections::IVector<Windows::UI::Xaml::UIElement>
|
|
18
|
+
m_children;
|
|
19
|
+
|
|
20
|
+
private:
|
|
21
|
+
winrt::Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
22
|
+
};
|
|
23
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "ScreenContainerViewManager.h"
|
|
3
|
+
#include "JSValueXaml.h"
|
|
4
|
+
#include "NativeModules.h"
|
|
5
|
+
#include "Screen.h"
|
|
6
|
+
#include "ScreenContainer.h"
|
|
7
|
+
|
|
8
|
+
namespace winrt {
|
|
9
|
+
using namespace Microsoft::ReactNative;
|
|
10
|
+
using namespace Windows::Foundation;
|
|
11
|
+
using namespace Windows::Foundation::Collections;
|
|
12
|
+
using namespace Windows::UI;
|
|
13
|
+
using namespace Windows::UI::Xaml;
|
|
14
|
+
using namespace Windows::UI::Xaml::Controls;
|
|
15
|
+
} // namespace winrt
|
|
16
|
+
|
|
17
|
+
namespace winrt::RNScreens::implementation {
|
|
18
|
+
// IViewManager
|
|
19
|
+
winrt::hstring ScreenContainerViewManager::Name() noexcept {
|
|
20
|
+
return L"RNSScreenContainer";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
winrt::FrameworkElement ScreenContainerViewManager::CreateView() noexcept {
|
|
24
|
+
return winrt::make<ScreenContainer>(m_reactContext);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// IViewManagerRequiresNativeLayout
|
|
28
|
+
bool ScreenContainerViewManager::RequiresNativeLayout() {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// IViewManagerWithChildren
|
|
33
|
+
void ScreenContainerViewManager::AddView(
|
|
34
|
+
FrameworkElement parent,
|
|
35
|
+
UIElement child,
|
|
36
|
+
int64_t index) {
|
|
37
|
+
auto screenContainer = parent.as<ScreenContainer>();
|
|
38
|
+
if (!screenContainer)
|
|
39
|
+
return;
|
|
40
|
+
|
|
41
|
+
auto screen = child.as<Screen>();
|
|
42
|
+
if (!screen)
|
|
43
|
+
return;
|
|
44
|
+
|
|
45
|
+
screenContainer->addScreen(*screen, index);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
void ScreenContainerViewManager::RemoveAllChildren(FrameworkElement parent) {
|
|
49
|
+
auto screenContainer = parent.as<ScreenContainer>();
|
|
50
|
+
if (!screenContainer)
|
|
51
|
+
return;
|
|
52
|
+
|
|
53
|
+
screenContainer->removeAllChildren();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
void ScreenContainerViewManager::RemoveChildAt(
|
|
57
|
+
FrameworkElement parent,
|
|
58
|
+
int64_t index) {
|
|
59
|
+
auto screenContainer = parent.as<ScreenContainer>();
|
|
60
|
+
if (!screenContainer)
|
|
61
|
+
return;
|
|
62
|
+
|
|
63
|
+
screenContainer->removeChildAt(index);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void ScreenContainerViewManager::ReplaceChild(
|
|
67
|
+
FrameworkElement parent,
|
|
68
|
+
UIElement oldChild,
|
|
69
|
+
UIElement newChild) {
|
|
70
|
+
auto screenContainer = parent.as<ScreenContainer>();
|
|
71
|
+
if (!screenContainer)
|
|
72
|
+
return;
|
|
73
|
+
|
|
74
|
+
screenContainer->replaceChild(oldChild, newChild);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// IViewManagerWithReactContext
|
|
78
|
+
winrt::IReactContext ScreenContainerViewManager::ReactContext() noexcept {
|
|
79
|
+
return m_reactContext;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
void ScreenContainerViewManager::ReactContext(
|
|
83
|
+
IReactContext reactContext) noexcept {
|
|
84
|
+
m_reactContext = reactContext;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// IViewManagerWithNativeProperties
|
|
88
|
+
IMapView<hstring, ViewManagerPropertyType>
|
|
89
|
+
ScreenContainerViewManager::NativeProps() noexcept {
|
|
90
|
+
auto nativeProps =
|
|
91
|
+
winrt::single_threaded_map<hstring, ViewManagerPropertyType>();
|
|
92
|
+
return nativeProps.GetView();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void ScreenContainerViewManager::UpdateProperties(
|
|
96
|
+
FrameworkElement const &view,
|
|
97
|
+
IJSValueReader const &propertyMapReader) noexcept {
|
|
98
|
+
(void)view;
|
|
99
|
+
const JSValueObject &propertyMap = JSValue::ReadObjectFrom(propertyMapReader);
|
|
100
|
+
for (auto const &pair : propertyMap) {
|
|
101
|
+
auto const &propertyName = pair.first;
|
|
102
|
+
auto const &propertyValue = pair.second;
|
|
103
|
+
(void)propertyName;
|
|
104
|
+
(void)propertyValue;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// IViewManagerWithExportedEventTypeConstants
|
|
109
|
+
ConstantProviderDelegate ScreenContainerViewManager::
|
|
110
|
+
ExportedCustomBubblingEventTypeConstants() noexcept {
|
|
111
|
+
return nullptr;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
ConstantProviderDelegate
|
|
115
|
+
ScreenContainerViewManager::ExportedCustomDirectEventTypeConstants() noexcept {
|
|
116
|
+
return nullptr;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// IViewManagerWithCommands
|
|
120
|
+
IVectorView<hstring> ScreenContainerViewManager::Commands() noexcept {
|
|
121
|
+
auto commands = winrt::single_threaded_vector<hstring>();
|
|
122
|
+
return commands.GetView();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
void ScreenContainerViewManager::DispatchCommand(
|
|
126
|
+
FrameworkElement const &view,
|
|
127
|
+
winrt::hstring const &commandId,
|
|
128
|
+
winrt::IJSValueReader const &commandArgsReader) noexcept {
|
|
129
|
+
(void)view;
|
|
130
|
+
(void)commandId;
|
|
131
|
+
(void)commandArgsReader;
|
|
132
|
+
}
|
|
133
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "NativeModules.h"
|
|
4
|
+
#include "winrt/Microsoft.ReactNative.h"
|
|
5
|
+
|
|
6
|
+
namespace winrt::RNScreens::implementation {
|
|
7
|
+
|
|
8
|
+
class ScreenContainerViewManager
|
|
9
|
+
: public winrt::implements<
|
|
10
|
+
ScreenContainerViewManager,
|
|
11
|
+
winrt::Microsoft::ReactNative::IViewManager,
|
|
12
|
+
winrt::Microsoft::ReactNative::IViewManagerRequiresNativeLayout,
|
|
13
|
+
winrt::Microsoft::ReactNative::IViewManagerWithChildren,
|
|
14
|
+
winrt::Microsoft::ReactNative::IViewManagerWithReactContext,
|
|
15
|
+
winrt::Microsoft::ReactNative::IViewManagerWithNativeProperties,
|
|
16
|
+
winrt::Microsoft::ReactNative::
|
|
17
|
+
IViewManagerWithExportedEventTypeConstants,
|
|
18
|
+
winrt::Microsoft::ReactNative::IViewManagerWithCommands> {
|
|
19
|
+
public:
|
|
20
|
+
ScreenContainerViewManager() = default;
|
|
21
|
+
|
|
22
|
+
// IViewManager
|
|
23
|
+
winrt::hstring Name() noexcept;
|
|
24
|
+
winrt::Windows::UI::Xaml::FrameworkElement CreateView() noexcept;
|
|
25
|
+
|
|
26
|
+
// IViewManagerRequiresNativeLayout
|
|
27
|
+
bool RequiresNativeLayout();
|
|
28
|
+
|
|
29
|
+
// IViewManagerWithChildren
|
|
30
|
+
void AddView(
|
|
31
|
+
winrt::Windows::UI::Xaml::FrameworkElement parent,
|
|
32
|
+
winrt::Windows::UI::Xaml::UIElement child,
|
|
33
|
+
int64_t index);
|
|
34
|
+
void RemoveAllChildren(winrt::Windows::UI::Xaml::FrameworkElement parent);
|
|
35
|
+
void RemoveChildAt(
|
|
36
|
+
winrt::Windows::UI::Xaml::FrameworkElement parent,
|
|
37
|
+
int64_t index);
|
|
38
|
+
void ReplaceChild(
|
|
39
|
+
winrt::Windows::UI::Xaml::FrameworkElement parent,
|
|
40
|
+
winrt::Windows::UI::Xaml::UIElement oldChild,
|
|
41
|
+
winrt::Windows::UI::Xaml::UIElement newChild);
|
|
42
|
+
|
|
43
|
+
// IViewManagerWithReactContext
|
|
44
|
+
winrt::Microsoft::ReactNative::IReactContext ReactContext() noexcept;
|
|
45
|
+
void ReactContext(
|
|
46
|
+
winrt::Microsoft::ReactNative::IReactContext reactContext) noexcept;
|
|
47
|
+
|
|
48
|
+
// IViewManagerWithNativeProperties
|
|
49
|
+
winrt::Windows::Foundation::Collections::IMapView<
|
|
50
|
+
winrt::hstring,
|
|
51
|
+
winrt::Microsoft::ReactNative::ViewManagerPropertyType>
|
|
52
|
+
NativeProps() noexcept;
|
|
53
|
+
|
|
54
|
+
void UpdateProperties(
|
|
55
|
+
winrt::Windows::UI::Xaml::FrameworkElement const &view,
|
|
56
|
+
winrt::Microsoft::ReactNative::IJSValueReader const
|
|
57
|
+
&propertyMapReader) noexcept;
|
|
58
|
+
|
|
59
|
+
// IViewManagerWithExportedEventTypeConstants
|
|
60
|
+
winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
61
|
+
ExportedCustomBubblingEventTypeConstants() noexcept;
|
|
62
|
+
winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
63
|
+
ExportedCustomDirectEventTypeConstants() noexcept;
|
|
64
|
+
|
|
65
|
+
// IViewManagerWithCommands
|
|
66
|
+
winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring>
|
|
67
|
+
Commands() noexcept;
|
|
68
|
+
|
|
69
|
+
void DispatchCommand(
|
|
70
|
+
winrt::Windows::UI::Xaml::FrameworkElement const &view,
|
|
71
|
+
winrt::hstring const &commandId,
|
|
72
|
+
winrt::Microsoft::ReactNative::IJSValueReader const
|
|
73
|
+
&commandArgsReader) noexcept;
|
|
74
|
+
|
|
75
|
+
private:
|
|
76
|
+
winrt::Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
77
|
+
};
|
|
78
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "ScreenStack.h"
|
|
3
|
+
#include "JSValueXaml.h"
|
|
4
|
+
#include "NativeModules.h"
|
|
5
|
+
|
|
6
|
+
namespace winrt {
|
|
7
|
+
using namespace Microsoft::ReactNative;
|
|
8
|
+
using namespace Windows::Foundation;
|
|
9
|
+
using namespace Windows::Foundation::Collections;
|
|
10
|
+
using namespace Windows::UI;
|
|
11
|
+
using namespace Windows::UI::Xaml;
|
|
12
|
+
using namespace Windows::UI::Xaml::Controls;
|
|
13
|
+
} // namespace winrt
|
|
14
|
+
|
|
15
|
+
namespace winrt::RNScreens::implementation {
|
|
16
|
+
ScreenStack::ScreenStack(
|
|
17
|
+
winrt::Microsoft::ReactNative::IReactContext reactContext)
|
|
18
|
+
: m_reactContext(reactContext),
|
|
19
|
+
m_children(
|
|
20
|
+
{winrt::single_threaded_vector<Windows::UI::Xaml::UIElement>()}) {}
|
|
21
|
+
|
|
22
|
+
void ScreenStack::addScreen(Screen &screen, int64_t) {
|
|
23
|
+
auto uiElement = screen.try_as<UIElement>();
|
|
24
|
+
if (!uiElement)
|
|
25
|
+
return;
|
|
26
|
+
|
|
27
|
+
m_children.Append(uiElement);
|
|
28
|
+
Content(uiElement);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
void ScreenStack::removeAllChildren() {
|
|
32
|
+
Content(nullptr);
|
|
33
|
+
m_children.Clear();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
void ScreenStack::removeChildAt(int64_t index) {
|
|
37
|
+
m_children.RemoveAt(static_cast<uint32_t>(index));
|
|
38
|
+
onChildModified(index);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void ScreenStack::replaceChild(
|
|
42
|
+
winrt::Windows::UI::Xaml::UIElement oldChild,
|
|
43
|
+
winrt::Windows::UI::Xaml::UIElement newChild) {
|
|
44
|
+
uint32_t index;
|
|
45
|
+
if (!m_children.IndexOf(oldChild, index))
|
|
46
|
+
return;
|
|
47
|
+
|
|
48
|
+
m_children.SetAt(index, newChild);
|
|
49
|
+
onChildModified(index);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void ScreenStack::onChildModified(int64_t index) {
|
|
53
|
+
// Was it the topmost item in the stack?
|
|
54
|
+
if (index >= m_children.Size() - 1) {
|
|
55
|
+
if (m_children.Size() == 0) {
|
|
56
|
+
// Nobody left
|
|
57
|
+
Content(nullptr);
|
|
58
|
+
} else {
|
|
59
|
+
// Focus on the top item
|
|
60
|
+
auto uiElement = m_children.GetAt(m_children.Size() - 1);
|
|
61
|
+
Content(uiElement);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include "Screen.h"
|
|
3
|
+
|
|
4
|
+
namespace winrt::RNScreens::implementation {
|
|
5
|
+
class ScreenStack
|
|
6
|
+
: public winrt::Windows::UI::Xaml::Controls::ContentControlT<ScreenStack> {
|
|
7
|
+
public:
|
|
8
|
+
ScreenStack(winrt::Microsoft::ReactNative::IReactContext reactContext);
|
|
9
|
+
void addScreen(Screen &screen, int64_t index);
|
|
10
|
+
void removeAllChildren();
|
|
11
|
+
void removeChildAt(int64_t index);
|
|
12
|
+
void replaceChild(
|
|
13
|
+
winrt::Windows::UI::Xaml::UIElement oldChild,
|
|
14
|
+
winrt::Windows::UI::Xaml::UIElement newChild);
|
|
15
|
+
|
|
16
|
+
winrt::Windows::Foundation::Collections::IVector<Windows::UI::Xaml::UIElement>
|
|
17
|
+
m_children;
|
|
18
|
+
|
|
19
|
+
private:
|
|
20
|
+
void onChildModified(int64_t index);
|
|
21
|
+
winrt::Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
22
|
+
};
|
|
23
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "ScreenStackHeaderConfig.h"
|
|
3
|
+
#include "JSValueXaml.h"
|
|
4
|
+
#include "NativeModules.h"
|
|
5
|
+
|
|
6
|
+
namespace winrt {
|
|
7
|
+
using namespace Microsoft::ReactNative;
|
|
8
|
+
using namespace Windows::Foundation;
|
|
9
|
+
using namespace Windows::Foundation::Collections;
|
|
10
|
+
using namespace Windows::UI;
|
|
11
|
+
using namespace Windows::UI::Xaml;
|
|
12
|
+
using namespace Windows::UI::Xaml::Controls;
|
|
13
|
+
} // namespace winrt
|
|
14
|
+
|
|
15
|
+
namespace winrt::RNScreens::implementation {
|
|
16
|
+
ScreenStackHeaderConfig::ScreenStackHeaderConfig(
|
|
17
|
+
winrt::Microsoft::ReactNative::IReactContext reactContext)
|
|
18
|
+
: m_reactContext(reactContext) {}
|
|
19
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
namespace winrt::RNScreens::implementation {
|
|
4
|
+
class ScreenStackHeaderConfig
|
|
5
|
+
: public winrt::Windows::UI::Xaml::Controls::StackPanelT<
|
|
6
|
+
ScreenStackHeaderConfig> {
|
|
7
|
+
public:
|
|
8
|
+
ScreenStackHeaderConfig(
|
|
9
|
+
winrt::Microsoft::ReactNative::IReactContext m_reactContext);
|
|
10
|
+
|
|
11
|
+
private:
|
|
12
|
+
winrt::Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
13
|
+
};
|
|
14
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "ScreenStackHeaderConfigViewManager.h"
|
|
3
|
+
#include "JSValueXaml.h"
|
|
4
|
+
#include "NativeModules.h"
|
|
5
|
+
#include "ScreenStackHeaderConfig.h"
|
|
6
|
+
|
|
7
|
+
namespace winrt {
|
|
8
|
+
using namespace Microsoft::ReactNative;
|
|
9
|
+
using namespace Windows::Foundation;
|
|
10
|
+
using namespace Windows::Foundation::Collections;
|
|
11
|
+
using namespace Windows::UI;
|
|
12
|
+
using namespace Windows::UI::Xaml;
|
|
13
|
+
using namespace Windows::UI::Xaml::Controls;
|
|
14
|
+
} // namespace winrt
|
|
15
|
+
|
|
16
|
+
namespace winrt::RNScreens::implementation {
|
|
17
|
+
// IViewManager
|
|
18
|
+
winrt::hstring ScreenStackHeaderConfigViewManager::Name() noexcept {
|
|
19
|
+
return L"RNSScreenStackHeaderConfig";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
winrt::FrameworkElement
|
|
23
|
+
ScreenStackHeaderConfigViewManager::CreateView() noexcept {
|
|
24
|
+
return winrt::make<ScreenStackHeaderConfig>(m_reactContext);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// IViewManagerRequiresNativeLayout
|
|
28
|
+
bool ScreenStackHeaderConfigViewManager::RequiresNativeLayout() {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// IViewManagerWithReactContext
|
|
33
|
+
winrt::IReactContext
|
|
34
|
+
ScreenStackHeaderConfigViewManager::ReactContext() noexcept {
|
|
35
|
+
return m_reactContext;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
void ScreenStackHeaderConfigViewManager::ReactContext(
|
|
39
|
+
IReactContext reactContext) noexcept {
|
|
40
|
+
m_reactContext = reactContext;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// IViewManagerWithNativeProperties
|
|
44
|
+
IMapView<hstring, ViewManagerPropertyType>
|
|
45
|
+
ScreenStackHeaderConfigViewManager::NativeProps() noexcept {
|
|
46
|
+
auto nativeProps =
|
|
47
|
+
winrt::single_threaded_map<hstring, ViewManagerPropertyType>();
|
|
48
|
+
return nativeProps.GetView();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
void ScreenStackHeaderConfigViewManager::UpdateProperties(
|
|
52
|
+
FrameworkElement const &view,
|
|
53
|
+
IJSValueReader const &propertyMapReader) noexcept {
|
|
54
|
+
(void)view;
|
|
55
|
+
const JSValueObject &propertyMap = JSValue::ReadObjectFrom(propertyMapReader);
|
|
56
|
+
for (auto const &pair : propertyMap) {
|
|
57
|
+
auto const &propertyName = pair.first;
|
|
58
|
+
auto const &propertyValue = pair.second;
|
|
59
|
+
(void)propertyName;
|
|
60
|
+
(void)propertyValue;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// IViewManagerWithExportedEventTypeConstants
|
|
65
|
+
ConstantProviderDelegate ScreenStackHeaderConfigViewManager::
|
|
66
|
+
ExportedCustomBubblingEventTypeConstants() noexcept {
|
|
67
|
+
return nullptr;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ConstantProviderDelegate ScreenStackHeaderConfigViewManager::
|
|
71
|
+
ExportedCustomDirectEventTypeConstants() noexcept {
|
|
72
|
+
return nullptr;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// IViewManagerWithCommands
|
|
76
|
+
IVectorView<hstring> ScreenStackHeaderConfigViewManager::Commands() noexcept {
|
|
77
|
+
auto commands = winrt::single_threaded_vector<hstring>();
|
|
78
|
+
return commands.GetView();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void ScreenStackHeaderConfigViewManager::DispatchCommand(
|
|
82
|
+
FrameworkElement const &view,
|
|
83
|
+
winrt::hstring const &commandId,
|
|
84
|
+
winrt::IJSValueReader const &commandArgsReader) noexcept {
|
|
85
|
+
(void)view;
|
|
86
|
+
(void)commandId;
|
|
87
|
+
(void)commandArgsReader;
|
|
88
|
+
}
|
|
89
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include "NativeModules.h"
|
|
3
|
+
#include "winrt/Microsoft.ReactNative.h"
|
|
4
|
+
|
|
5
|
+
namespace winrt::RNScreens::implementation {
|
|
6
|
+
|
|
7
|
+
class ScreenStackHeaderConfigViewManager
|
|
8
|
+
: public winrt::implements<
|
|
9
|
+
ScreenStackHeaderConfigViewManager,
|
|
10
|
+
winrt::Microsoft::ReactNative::IViewManager,
|
|
11
|
+
winrt::Microsoft::ReactNative::IViewManagerRequiresNativeLayout,
|
|
12
|
+
winrt::Microsoft::ReactNative::IViewManagerWithReactContext,
|
|
13
|
+
winrt::Microsoft::ReactNative::IViewManagerWithNativeProperties,
|
|
14
|
+
winrt::Microsoft::ReactNative::
|
|
15
|
+
IViewManagerWithExportedEventTypeConstants,
|
|
16
|
+
winrt::Microsoft::ReactNative::IViewManagerWithCommands> {
|
|
17
|
+
public:
|
|
18
|
+
ScreenStackHeaderConfigViewManager() = default;
|
|
19
|
+
|
|
20
|
+
// IViewManager
|
|
21
|
+
winrt::hstring Name() noexcept;
|
|
22
|
+
winrt::Windows::UI::Xaml::FrameworkElement CreateView() noexcept;
|
|
23
|
+
|
|
24
|
+
// IViewManagerRequiresNativeLayout
|
|
25
|
+
bool RequiresNativeLayout();
|
|
26
|
+
|
|
27
|
+
// IViewManagerWithReactContext
|
|
28
|
+
winrt::Microsoft::ReactNative::IReactContext ReactContext() noexcept;
|
|
29
|
+
void ReactContext(
|
|
30
|
+
winrt::Microsoft::ReactNative::IReactContext reactContext) noexcept;
|
|
31
|
+
|
|
32
|
+
// IViewManagerWithNativeProperties
|
|
33
|
+
winrt::Windows::Foundation::Collections::IMapView<
|
|
34
|
+
winrt::hstring,
|
|
35
|
+
winrt::Microsoft::ReactNative::ViewManagerPropertyType>
|
|
36
|
+
NativeProps() noexcept;
|
|
37
|
+
|
|
38
|
+
void UpdateProperties(
|
|
39
|
+
winrt::Windows::UI::Xaml::FrameworkElement const &view,
|
|
40
|
+
winrt::Microsoft::ReactNative::IJSValueReader const
|
|
41
|
+
&propertyMapReader) noexcept;
|
|
42
|
+
|
|
43
|
+
// IViewManagerWithExportedEventTypeConstants
|
|
44
|
+
winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
45
|
+
ExportedCustomBubblingEventTypeConstants() noexcept;
|
|
46
|
+
winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
47
|
+
ExportedCustomDirectEventTypeConstants() noexcept;
|
|
48
|
+
|
|
49
|
+
// IViewManagerWithCommands
|
|
50
|
+
winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring>
|
|
51
|
+
Commands() noexcept;
|
|
52
|
+
|
|
53
|
+
void DispatchCommand(
|
|
54
|
+
winrt::Windows::UI::Xaml::FrameworkElement const &view,
|
|
55
|
+
winrt::hstring const &commandId,
|
|
56
|
+
winrt::Microsoft::ReactNative::IJSValueReader const
|
|
57
|
+
&commandArgsReader) noexcept;
|
|
58
|
+
|
|
59
|
+
private:
|
|
60
|
+
winrt::Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
61
|
+
};
|
|
62
|
+
} // namespace winrt::RNScreens::implementation
|