@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
package/src/utils.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BackHandler, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const isSearchBarAvailableForCurrentPlatform = [
|
|
4
|
+
'ios',
|
|
5
|
+
'android',
|
|
6
|
+
].includes(Platform.OS);
|
|
7
|
+
|
|
8
|
+
export function executeNativeBackPress() {
|
|
9
|
+
// This function invokes the native back press event
|
|
10
|
+
BackHandler.exitApp();
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Because of a bug introduced in https://github.com/software-mansion/react-native-screens/pull/1646
|
|
15
|
+
// react-native-screens v3.21 changed how header's backTitle handles whitespace strings in https://github.com/software-mansion/react-native-screens/pull/1726
|
|
16
|
+
// To allow for backwards compatibility in @react-navigation/native-stack we need a way to check if this version or newer is used.
|
|
17
|
+
// See https://github.com/react-navigation/react-navigation/pull/11423 for more context.
|
|
18
|
+
export const isNewBackTitleImplementation = true;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# react-native-screens Windows Implementation
|
|
2
|
+
|
|
3
|
+
## Module Installation
|
|
4
|
+
You can either use autolinking on react-native-windows 0.63 and later or manually link the module on earlier releases.
|
|
5
|
+
|
|
6
|
+
## Automatic install with autolinking on RNW >= 0.63
|
|
7
|
+
RNScreens supports autolinking. Just call: `npm i react-native-screens --save`
|
|
8
|
+
|
|
9
|
+
## Manual installation on RNW >= 0.62
|
|
10
|
+
1. `npm install react-native-screens --save`
|
|
11
|
+
2. Open your solution in Visual Studio 2019 (eg. `windows\yourapp.sln`)
|
|
12
|
+
3. Right-click Solution icon in Solution Explorer > Add > Existing Project...
|
|
13
|
+
4. Add `node_modules\react-native-screens\windows\RNScreens\RNScreens.vcxproj`
|
|
14
|
+
5. Right-click main application project > Add > Reference...
|
|
15
|
+
6. Select `RNScreens` in Solution Projects
|
|
16
|
+
7. In app `pch.h` add `#include "winrt/RNScreens.h"`
|
|
17
|
+
8. In `App.cpp` add `PackageProviders().Append(winrt::RNScreens::ReactPackageProvider());` before `InitializeComponent();`
|
|
18
|
+
|
|
19
|
+
## Module development
|
|
20
|
+
|
|
21
|
+
If you want to contribute to this module Windows implementation, first you must install the [Windows Development Dependencies](https://aka.ms/rnw-deps).
|
|
22
|
+
|
|
23
|
+
You must temporarily install the `react-native-windows` package. Versions of `react-native-windows` and `react-native` must match, e.g. if the module uses `react-native@0.62`, install `npm i react-native-windows@^0.62 --dev`.
|
|
24
|
+
|
|
25
|
+
Now, you will be able to open corresponding `RNScreens...sln` file, e.g. `RNScreens62.sln` for `react-native-windows@0.62`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<ImportGroup Label="PropertySheets" />
|
|
4
|
+
<PropertyGroup Label="UserMacros" />
|
|
5
|
+
<!--
|
|
6
|
+
To customize common C++/WinRT project properties:
|
|
7
|
+
* right-click the project node
|
|
8
|
+
* expand the Common Properties item
|
|
9
|
+
* select the C++/WinRT property page
|
|
10
|
+
|
|
11
|
+
For more advanced scenarios, and complete documentation, please see:
|
|
12
|
+
https://github.com/Microsoft/xlang/tree/master/src/package/cppwinrt/nuget
|
|
13
|
+
-->
|
|
14
|
+
<PropertyGroup />
|
|
15
|
+
<ItemDefinitionGroup />
|
|
16
|
+
</Project>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "RNScreens.h"
|
|
3
|
+
#include "JSValueXaml.h"
|
|
4
|
+
#include "RNScreensModule.g.cpp"
|
|
5
|
+
|
|
6
|
+
namespace winrt {
|
|
7
|
+
using namespace Microsoft::ReactNative;
|
|
8
|
+
using namespace Windows::Data::Json;
|
|
9
|
+
using namespace Windows::Foundation;
|
|
10
|
+
using namespace Windows::UI;
|
|
11
|
+
using namespace Windows::UI::Popups;
|
|
12
|
+
using namespace Windows::UI::Xaml;
|
|
13
|
+
using namespace Windows::UI::Xaml::Controls;
|
|
14
|
+
using namespace Windows::UI::Xaml::Input;
|
|
15
|
+
using namespace Windows::UI::Xaml::Media;
|
|
16
|
+
} // namespace winrt
|
|
17
|
+
|
|
18
|
+
namespace winrt::RNScreens::implementation {
|
|
19
|
+
|
|
20
|
+
RNScreensModule::RNScreensModule(winrt::IReactContext const &reactContext)
|
|
21
|
+
: m_reactContext(reactContext) {}
|
|
22
|
+
|
|
23
|
+
winrt::Windows::Foundation::Collections::IMapView<
|
|
24
|
+
winrt::hstring,
|
|
25
|
+
winrt::Microsoft::ReactNative::ViewManagerPropertyType>
|
|
26
|
+
RNScreensModule::NativeProps() noexcept {
|
|
27
|
+
auto nativeProps =
|
|
28
|
+
winrt::single_threaded_map<hstring, ViewManagerPropertyType>();
|
|
29
|
+
return nativeProps.GetView();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
void RNScreensModule::UpdateProperties(
|
|
33
|
+
winrt::Microsoft::ReactNative::IJSValueReader const
|
|
34
|
+
&propertyMapReader) noexcept {
|
|
35
|
+
const JSValueObject &propertyMap = JSValue::ReadObjectFrom(propertyMapReader);
|
|
36
|
+
for (auto const &pair : propertyMap) {
|
|
37
|
+
auto const &propertyName = pair.first;
|
|
38
|
+
auto const &propertyValue = pair.second;
|
|
39
|
+
(void)propertyName;
|
|
40
|
+
(void)propertyValue;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
45
|
+
RNScreensModule::ExportedCustomBubblingEventTypeConstants() noexcept {
|
|
46
|
+
return nullptr;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
50
|
+
RNScreensModule::ExportedCustomDirectEventTypeConstants() noexcept {
|
|
51
|
+
return nullptr;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring>
|
|
55
|
+
RNScreensModule::Commands() noexcept {
|
|
56
|
+
return nullptr;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
void RNScreensModule::DispatchCommand(
|
|
60
|
+
winrt::hstring const &commandId,
|
|
61
|
+
winrt::Microsoft::ReactNative::IJSValueReader const
|
|
62
|
+
&commandArgsReader) noexcept {
|
|
63
|
+
(void)commandId;
|
|
64
|
+
(void)commandArgsReader;
|
|
65
|
+
}
|
|
66
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "NativeModules.h"
|
|
4
|
+
#include "RNScreensModule.g.h"
|
|
5
|
+
#include "pch.h"
|
|
6
|
+
#include "winrt/Microsoft.ReactNative.h"
|
|
7
|
+
|
|
8
|
+
namespace winrt::RNScreens::implementation {
|
|
9
|
+
|
|
10
|
+
class RNScreensModule : public RNScreensModuleT<RNScreensModule> {
|
|
11
|
+
public:
|
|
12
|
+
RNScreensModule(Microsoft::ReactNative::IReactContext const &reactContext);
|
|
13
|
+
|
|
14
|
+
static winrt::Windows::Foundation::Collections::IMapView<
|
|
15
|
+
winrt::hstring,
|
|
16
|
+
winrt::Microsoft::ReactNative::ViewManagerPropertyType>
|
|
17
|
+
NativeProps() noexcept;
|
|
18
|
+
void UpdateProperties(winrt::Microsoft::ReactNative::IJSValueReader const
|
|
19
|
+
&propertyMapReader) noexcept;
|
|
20
|
+
|
|
21
|
+
static winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
22
|
+
ExportedCustomBubblingEventTypeConstants() noexcept;
|
|
23
|
+
static winrt::Microsoft::ReactNative::ConstantProviderDelegate
|
|
24
|
+
ExportedCustomDirectEventTypeConstants() noexcept;
|
|
25
|
+
|
|
26
|
+
static winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring>
|
|
27
|
+
Commands() noexcept;
|
|
28
|
+
void DispatchCommand(
|
|
29
|
+
winrt::hstring const &commandId,
|
|
30
|
+
winrt::Microsoft::ReactNative::IJSValueReader const
|
|
31
|
+
&commandArgsReader) noexcept;
|
|
32
|
+
|
|
33
|
+
private:
|
|
34
|
+
Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
|
|
35
|
+
};
|
|
36
|
+
} // namespace winrt::RNScreens::implementation
|
|
37
|
+
|
|
38
|
+
namespace winrt::RNScreens::factory_implementation {
|
|
39
|
+
struct RNScreensModule
|
|
40
|
+
: RNScreensModuleT<RNScreensModule, implementation::RNScreensModule> {};
|
|
41
|
+
} // namespace winrt::RNScreens::factory_implementation
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
namespace RNScreens {
|
|
2
|
+
[default_interface]
|
|
3
|
+
runtimeclass RNScreensModule : Windows.UI.Xaml.Controls.TextBox {
|
|
4
|
+
RNScreensModule(Microsoft.ReactNative.IReactContext context);
|
|
5
|
+
void UpdateProperties(Microsoft.ReactNative.IJSValueReader reader);
|
|
6
|
+
void DispatchCommand(String commandId, Microsoft.ReactNative.IJSValueReader commandArgsReader);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
|
|
4
|
+
<PropertyGroup Label="Globals">
|
|
5
|
+
<CppWinRTOptimized>true</CppWinRTOptimized>
|
|
6
|
+
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
|
|
7
|
+
<MinimalCoreWin>true</MinimalCoreWin>
|
|
8
|
+
<ProjectGuid>{d638f49e-29d2-4699-ac52-facd82fa7138}</ProjectGuid>
|
|
9
|
+
<ProjectName>RNScreens</ProjectName>
|
|
10
|
+
<RootNamespace>RNScreens</RootNamespace>
|
|
11
|
+
<DefaultLanguage>en-US</DefaultLanguage>
|
|
12
|
+
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
|
|
13
|
+
<AppContainerApplication>true</AppContainerApplication>
|
|
14
|
+
<ApplicationType>Windows Store</ApplicationType>
|
|
15
|
+
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
|
16
|
+
</PropertyGroup>
|
|
17
|
+
<PropertyGroup Label="ReactNativeWindowsProps">
|
|
18
|
+
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
|
|
19
|
+
</PropertyGroup>
|
|
20
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props')" />
|
|
21
|
+
<PropertyGroup Label="Fallback Windows SDK Versions">
|
|
22
|
+
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
|
|
23
|
+
<WindowsTargetPlatformMinVersion Condition=" '$(WindowsTargetPlatformMinVersion)' == '' ">10.0.16299.0</WindowsTargetPlatformMinVersion>
|
|
24
|
+
</PropertyGroup>
|
|
25
|
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
26
|
+
<ItemGroup Label="ProjectConfigurations">
|
|
27
|
+
<ProjectConfiguration Include="Debug|ARM">
|
|
28
|
+
<Configuration>Debug</Configuration>
|
|
29
|
+
<Platform>ARM</Platform>
|
|
30
|
+
</ProjectConfiguration>
|
|
31
|
+
<ProjectConfiguration Include="Debug|ARM64">
|
|
32
|
+
<Configuration>Debug</Configuration>
|
|
33
|
+
<Platform>ARM64</Platform>
|
|
34
|
+
</ProjectConfiguration>
|
|
35
|
+
<ProjectConfiguration Include="Debug|Win32">
|
|
36
|
+
<Configuration>Debug</Configuration>
|
|
37
|
+
<Platform>Win32</Platform>
|
|
38
|
+
</ProjectConfiguration>
|
|
39
|
+
<ProjectConfiguration Include="Debug|x64">
|
|
40
|
+
<Configuration>Debug</Configuration>
|
|
41
|
+
<Platform>x64</Platform>
|
|
42
|
+
</ProjectConfiguration>
|
|
43
|
+
<ProjectConfiguration Include="Release|ARM">
|
|
44
|
+
<Configuration>Release</Configuration>
|
|
45
|
+
<Platform>ARM</Platform>
|
|
46
|
+
</ProjectConfiguration>
|
|
47
|
+
<ProjectConfiguration Include="Release|ARM64">
|
|
48
|
+
<Configuration>Release</Configuration>
|
|
49
|
+
<Platform>ARM64</Platform>
|
|
50
|
+
</ProjectConfiguration>
|
|
51
|
+
<ProjectConfiguration Include="Release|Win32">
|
|
52
|
+
<Configuration>Release</Configuration>
|
|
53
|
+
<Platform>Win32</Platform>
|
|
54
|
+
</ProjectConfiguration>
|
|
55
|
+
<ProjectConfiguration Include="Release|x64">
|
|
56
|
+
<Configuration>Release</Configuration>
|
|
57
|
+
<Platform>x64</Platform>
|
|
58
|
+
</ProjectConfiguration>
|
|
59
|
+
</ItemGroup>
|
|
60
|
+
<PropertyGroup Label="Configuration">
|
|
61
|
+
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
62
|
+
<CharacterSet>Unicode</CharacterSet>
|
|
63
|
+
<GenerateManifest>false</GenerateManifest>
|
|
64
|
+
</PropertyGroup>
|
|
65
|
+
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
|
|
66
|
+
<UseDebugLibraries>true</UseDebugLibraries>
|
|
67
|
+
<LinkIncremental>true</LinkIncremental>
|
|
68
|
+
</PropertyGroup>
|
|
69
|
+
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
|
|
70
|
+
<UseDebugLibraries>false</UseDebugLibraries>
|
|
71
|
+
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
72
|
+
<LinkIncremental>false</LinkIncremental>
|
|
73
|
+
</PropertyGroup>
|
|
74
|
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
75
|
+
<ImportGroup Label="ExtensionSettings">
|
|
76
|
+
</ImportGroup>
|
|
77
|
+
<ImportGroup Label="PropertySheets">
|
|
78
|
+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
79
|
+
</ImportGroup>
|
|
80
|
+
<ImportGroup Label="PropertySheets">
|
|
81
|
+
<Import Project="PropertySheet.props" />
|
|
82
|
+
</ImportGroup>
|
|
83
|
+
<ImportGroup Label="ReactNativeWindowsPropertySheets">
|
|
84
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" />
|
|
85
|
+
</ImportGroup>
|
|
86
|
+
<PropertyGroup Label="UserMacros" />
|
|
87
|
+
<PropertyGroup />
|
|
88
|
+
<ItemDefinitionGroup>
|
|
89
|
+
<ClCompile>
|
|
90
|
+
<PrecompiledHeader>Use</PrecompiledHeader>
|
|
91
|
+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
|
92
|
+
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
|
93
|
+
<WarningLevel>Level4</WarningLevel>
|
|
94
|
+
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
|
|
95
|
+
<!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
|
|
96
|
+
<AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
|
|
97
|
+
<DisableSpecificWarnings>28204</DisableSpecificWarnings>
|
|
98
|
+
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
99
|
+
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
|
100
|
+
</ClCompile>
|
|
101
|
+
<Link>
|
|
102
|
+
<SubSystem>Console</SubSystem>
|
|
103
|
+
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
|
|
104
|
+
<ModuleDefinitionFile>RNScreens.def</ModuleDefinitionFile>
|
|
105
|
+
</Link>
|
|
106
|
+
</ItemDefinitionGroup>
|
|
107
|
+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
|
108
|
+
<ClCompile>
|
|
109
|
+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
110
|
+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
111
|
+
</ClCompile>
|
|
112
|
+
</ItemDefinitionGroup>
|
|
113
|
+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
|
114
|
+
<ClCompile>
|
|
115
|
+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
116
|
+
</ClCompile>
|
|
117
|
+
</ItemDefinitionGroup>
|
|
118
|
+
<ItemGroup>
|
|
119
|
+
<ClInclude Include="pch.h" />
|
|
120
|
+
<ClInclude Include="Screen.h" />
|
|
121
|
+
<ClInclude Include="ScreenContainer.h" />
|
|
122
|
+
<ClInclude Include="ScreenContainerViewManager.h" />
|
|
123
|
+
<ClInclude Include="ScreenStack.h" />
|
|
124
|
+
<ClInclude Include="ScreenStackHeaderConfigViewManager.h" />
|
|
125
|
+
<ClInclude Include="ScreenViewManager.h" />
|
|
126
|
+
<ClInclude Include="RNScreens.h">
|
|
127
|
+
<DependentUpon>RNScreens.idl</DependentUpon>
|
|
128
|
+
</ClInclude>
|
|
129
|
+
<ClInclude Include="ReactPackageProvider.h">
|
|
130
|
+
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
|
|
131
|
+
</ClInclude>
|
|
132
|
+
<ClCompile Include="RNScreens.cpp">
|
|
133
|
+
<DependentUpon>RNScreens.idl</DependentUpon>
|
|
134
|
+
</ClCompile>
|
|
135
|
+
<ClInclude Include="ScreenStackHeaderConfig.h" />
|
|
136
|
+
<ClInclude Include="ScreenStackViewManager.h" />
|
|
137
|
+
</ItemGroup>
|
|
138
|
+
<ItemGroup>
|
|
139
|
+
<ClCompile Include="pch.cpp">
|
|
140
|
+
<PrecompiledHeader>Create</PrecompiledHeader>
|
|
141
|
+
</ClCompile>
|
|
142
|
+
<ClCompile Include="Screen.cpp" />
|
|
143
|
+
<ClCompile Include="ScreenContainer.cpp" />
|
|
144
|
+
<ClCompile Include="ScreenContainerViewManager.cpp" />
|
|
145
|
+
<ClCompile Include="ScreenStack.cpp" />
|
|
146
|
+
<ClCompile Include="ScreenStackHeaderConfigViewManager.cpp" />
|
|
147
|
+
<ClCompile Include="ScreenViewManager.cpp" />
|
|
148
|
+
<ClCompile Include="ReactPackageProvider.cpp">
|
|
149
|
+
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
|
|
150
|
+
</ClCompile>
|
|
151
|
+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
|
152
|
+
<ClCompile Include="ScreenStackHeaderConfig.cpp" />
|
|
153
|
+
<ClCompile Include="ScreenStackViewManager.cpp" />
|
|
154
|
+
</ItemGroup>
|
|
155
|
+
<ItemGroup>
|
|
156
|
+
<Midl Include="ReactPackageProvider.idl" />
|
|
157
|
+
<Midl Include="RNScreens.idl" />
|
|
158
|
+
</ItemGroup>
|
|
159
|
+
<ItemGroup>
|
|
160
|
+
<None Include="packages.config" />
|
|
161
|
+
<None Include="RNScreens.def" />
|
|
162
|
+
</ItemGroup>
|
|
163
|
+
<ItemGroup>
|
|
164
|
+
<None Include="PropertySheet.props" />
|
|
165
|
+
</ItemGroup>
|
|
166
|
+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
167
|
+
<ImportGroup Label="ReactNativeWindowsTargets">
|
|
168
|
+
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" />
|
|
169
|
+
</ImportGroup>
|
|
170
|
+
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
|
|
171
|
+
<PropertyGroup>
|
|
172
|
+
<ErrorText>This project references targets in your node_modules\react-native-windows folder. The missing file is {0}.</ErrorText>
|
|
173
|
+
</PropertyGroup>
|
|
174
|
+
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props'))" />
|
|
175
|
+
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets'))" />
|
|
176
|
+
</Target>
|
|
177
|
+
<ImportGroup Label="ExtensionTargets">
|
|
178
|
+
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
|
179
|
+
</ImportGroup>
|
|
180
|
+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
181
|
+
<PropertyGroup>
|
|
182
|
+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
183
|
+
</PropertyGroup>
|
|
184
|
+
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
|
185
|
+
<Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
|
186
|
+
</Target>
|
|
187
|
+
</Project>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
+
<ItemGroup>
|
|
4
|
+
<Filter Include="Resources">
|
|
5
|
+
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
|
|
6
|
+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
7
|
+
</Filter>
|
|
8
|
+
<Filter Include="Generated Files">
|
|
9
|
+
<UniqueIdentifier>{926ab91d-31b5-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
|
|
10
|
+
</Filter>
|
|
11
|
+
</ItemGroup>
|
|
12
|
+
<ItemGroup>
|
|
13
|
+
<ClCompile Include="pch.cpp" />
|
|
14
|
+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
|
|
15
|
+
<ClCompile Include="ReactPackageProvider.cpp" />
|
|
16
|
+
<ClCompile Include="RNScreens.cpp" />
|
|
17
|
+
<ClCompile Include="RNScreens.cpp" />
|
|
18
|
+
<ClCompile Include="Screen.cpp" />
|
|
19
|
+
<ClCompile Include="ScreenStackHeaderConfigViewManager.cpp" />
|
|
20
|
+
<ClCompile Include="ScreenViewManager.cpp" />
|
|
21
|
+
<ClCompile Include="ScreenStackHeaderConfig.cpp" />
|
|
22
|
+
<ClCompile Include="ScreenStackViewManager.cpp" />
|
|
23
|
+
<ClCompile Include="ScreenStack.cpp" />
|
|
24
|
+
<ClCompile Include="ScreenContainerViewManager.cpp" />
|
|
25
|
+
<ClCompile Include="ScreenContainer.cpp" />
|
|
26
|
+
</ItemGroup>
|
|
27
|
+
<ItemGroup>
|
|
28
|
+
<ClInclude Include="pch.h" />
|
|
29
|
+
<ClInclude Include="ReactPackageProvider.h" />
|
|
30
|
+
<ClInclude Include="RNScreens.h" />
|
|
31
|
+
<ClInclude Include="RNScreens.h" />
|
|
32
|
+
<ClInclude Include="Screen.h" />
|
|
33
|
+
<ClInclude Include="ScreenStackHeaderConfigViewManager.h" />
|
|
34
|
+
<ClInclude Include="ScreenViewManager.h" />
|
|
35
|
+
<ClInclude Include="ScreenStackHeaderConfig.h" />
|
|
36
|
+
<ClInclude Include="ScreenStackViewManager.h" />
|
|
37
|
+
<ClInclude Include="ScreenStack.h" />
|
|
38
|
+
<ClInclude Include="ScreenContainer.h" />
|
|
39
|
+
<ClInclude Include="ScreenContainerViewManager.h" />
|
|
40
|
+
</ItemGroup>
|
|
41
|
+
<ItemGroup>
|
|
42
|
+
<None Include="RNScreens.def" />
|
|
43
|
+
<None Include="packages.config" />
|
|
44
|
+
</ItemGroup>
|
|
45
|
+
<ItemGroup>
|
|
46
|
+
<None Include="PropertySheet.props" />
|
|
47
|
+
</ItemGroup>
|
|
48
|
+
<ItemGroup>
|
|
49
|
+
<Midl Include="ReactPackageProvider.idl" />
|
|
50
|
+
<Midl Include="RNScreens.idl" />
|
|
51
|
+
</ItemGroup>
|
|
52
|
+
</Project>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "ReactPackageProvider.h"
|
|
3
|
+
#if __has_include("ReactPackageProvider.g.cpp")
|
|
4
|
+
#include "ReactPackageProvider.g.cpp"
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#include "ScreenContainerViewManager.h"
|
|
8
|
+
#include "ScreenStackHeaderConfigViewManager.h"
|
|
9
|
+
#include "ScreenStackViewManager.h"
|
|
10
|
+
#include "ScreenViewManager.h"
|
|
11
|
+
|
|
12
|
+
using namespace winrt::Microsoft::ReactNative;
|
|
13
|
+
|
|
14
|
+
namespace winrt::RNScreens::implementation {
|
|
15
|
+
void ReactPackageProvider::CreatePackage(
|
|
16
|
+
IReactPackageBuilder const &packageBuilder) noexcept {
|
|
17
|
+
packageBuilder.AddViewManager(L"RNScreensViewManager", []() {
|
|
18
|
+
return winrt::make<ScreenViewManager>();
|
|
19
|
+
});
|
|
20
|
+
packageBuilder.AddViewManager(L"RNScreensStackHeaderConfigViewManager", []() {
|
|
21
|
+
return winrt::make<ScreenStackHeaderConfigViewManager>();
|
|
22
|
+
});
|
|
23
|
+
packageBuilder.AddViewManager(L"RNSScreenStackViewManager", []() {
|
|
24
|
+
return winrt::make<ScreenStackViewManager>();
|
|
25
|
+
});
|
|
26
|
+
packageBuilder.AddViewManager(L"RNSScreenContainerViewManager", []() {
|
|
27
|
+
return winrt::make<ScreenContainerViewManager>();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
} // namespace winrt::RNScreens::implementation
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#include "ReactPackageProvider.g.h"
|
|
3
|
+
|
|
4
|
+
using namespace winrt::Microsoft::ReactNative;
|
|
5
|
+
|
|
6
|
+
namespace winrt::RNScreens::implementation {
|
|
7
|
+
struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider> {
|
|
8
|
+
ReactPackageProvider() = default;
|
|
9
|
+
void CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept;
|
|
10
|
+
};
|
|
11
|
+
} // namespace winrt::RNScreens::implementation
|
|
12
|
+
|
|
13
|
+
namespace winrt::RNScreens::factory_implementation {
|
|
14
|
+
struct ReactPackageProvider : ReactPackageProviderT<
|
|
15
|
+
ReactPackageProvider,
|
|
16
|
+
implementation::ReactPackageProvider> {};
|
|
17
|
+
} // namespace winrt::RNScreens::factory_implementation
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#include "pch.h"
|
|
2
|
+
#include "Screen.h"
|
|
3
|
+
#include "JSValueXaml.h"
|
|
4
|
+
#include "NativeModules.h"
|
|
5
|
+
|
|
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
|
+
Screen::Screen(winrt::Microsoft::ReactNative::IReactContext reactContext)
|
|
18
|
+
: m_reactContext(reactContext) {
|
|
19
|
+
onLoadingRevoker = Loading({this, &Screen::onLoading});
|
|
20
|
+
onLoadedRevoker = Loaded({this, &Screen::onLoaded});
|
|
21
|
+
onUnloadedRevoker = Unloaded({this, &Screen::onUnloaded});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Screen::~Screen() {
|
|
25
|
+
Loading(onLoadingRevoker);
|
|
26
|
+
Loaded(onLoadedRevoker);
|
|
27
|
+
Unloaded(onUnloadedRevoker);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
void Screen::addView(winrt::Windows::UI::Xaml::UIElement element) {
|
|
31
|
+
Children().Append(element);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
void Screen::removeAllChildren() {
|
|
35
|
+
Children().Clear();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
void Screen::removeChildAt(int64_t index) {
|
|
39
|
+
Children().RemoveAt(static_cast<uint32_t>(index));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
void Screen::replaceChild(
|
|
43
|
+
winrt::Windows::UI::Xaml::UIElement oldChild,
|
|
44
|
+
winrt::Windows::UI::Xaml::UIElement newChild) {
|
|
45
|
+
uint32_t index;
|
|
46
|
+
if (!Children().IndexOf(oldChild, index))
|
|
47
|
+
return;
|
|
48
|
+
|
|
49
|
+
Children().SetAt(index, newChild);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void Screen::onLoading(
|
|
53
|
+
winrt::Windows::UI::Xaml::FrameworkElement const &sender,
|
|
54
|
+
winrt::Windows::Foundation::IInspectable const &) {
|
|
55
|
+
auto screen = sender.try_as<Screen>();
|
|
56
|
+
if (!screen)
|
|
57
|
+
return;
|
|
58
|
+
|
|
59
|
+
screen->dispatchOnWillAppear();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
void Screen::onLoaded(
|
|
63
|
+
winrt::Windows::Foundation::IInspectable const &sender,
|
|
64
|
+
winrt::Windows::UI::Xaml::RoutedEventArgs const &) {
|
|
65
|
+
auto screen = sender.try_as<Screen>();
|
|
66
|
+
if (!screen)
|
|
67
|
+
return;
|
|
68
|
+
|
|
69
|
+
screen->dispatchOnAppear();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
void Screen::onUnloaded(
|
|
73
|
+
winrt::Windows::Foundation::IInspectable const &sender,
|
|
74
|
+
winrt::Windows::UI::Xaml::RoutedEventArgs const &) {
|
|
75
|
+
auto screen = sender.try_as<Screen>();
|
|
76
|
+
if (!screen)
|
|
77
|
+
return;
|
|
78
|
+
|
|
79
|
+
screen->dispatchOnWillDisappear();
|
|
80
|
+
screen->dispatchOnDisappear();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
void Screen::dispatchOnWillAppear() {
|
|
84
|
+
m_reactContext.DispatchEvent(
|
|
85
|
+
*this,
|
|
86
|
+
L"topWillAppear",
|
|
87
|
+
[&](winrt::IJSValueWriter const &eventDataWriter) noexcept {
|
|
88
|
+
eventDataWriter.WriteObjectBegin();
|
|
89
|
+
eventDataWriter.WriteObjectEnd();
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
void Screen::dispatchOnWillDisappear() {
|
|
94
|
+
m_reactContext.DispatchEvent(
|
|
95
|
+
*this,
|
|
96
|
+
L"topWillDisappear",
|
|
97
|
+
[&](winrt::IJSValueWriter const &eventDataWriter) noexcept {
|
|
98
|
+
eventDataWriter.WriteObjectBegin();
|
|
99
|
+
eventDataWriter.WriteObjectEnd();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
void Screen::dispatchOnAppear() {
|
|
104
|
+
m_reactContext.DispatchEvent(
|
|
105
|
+
*this,
|
|
106
|
+
L"topAppear",
|
|
107
|
+
[&](winrt::IJSValueWriter const &eventDataWriter) noexcept {
|
|
108
|
+
eventDataWriter.WriteObjectBegin();
|
|
109
|
+
eventDataWriter.WriteObjectEnd();
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
void Screen::dispatchOnDisappear() {
|
|
114
|
+
m_reactContext.DispatchEvent(
|
|
115
|
+
*this,
|
|
116
|
+
L"topDisappear",
|
|
117
|
+
[&](winrt::IJSValueWriter const &eventDataWriter) noexcept {
|
|
118
|
+
eventDataWriter.WriteObjectBegin();
|
|
119
|
+
eventDataWriter.WriteObjectEnd();
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
} // namespace winrt::RNScreens::implementation
|