@amazon-devices/react-native-screens 3.0.9000000000 → 3.0.9000000003
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/SystemModules/amzn__react-native-screens-3.private.modules.txt +116 -61
- package/kepler-compatibility.json +5 -2
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/components/DebugContainer.js.map +1 -1
- package/lib/commonjs/components/DebugContainer.web.js.map +1 -1
- package/lib/commonjs/components/Screen.web.js.map +1 -1
- package/lib/commonjs/components/ScreenStackHeaderConfig.js.map +1 -1
- package/lib/commonjs/components/ScreenStackHeaderConfig.web.js.map +1 -1
- package/lib/commonjs/components/ScreenStackItem.js.map +1 -1
- package/lib/commonjs/components/SearchBar.js.map +1 -1
- package/lib/commonjs/components/helpers/usePrevious.js.map +1 -1
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js.map +1 -1
- package/lib/commonjs/index.js +0 -210
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/module/components/Screen.web.js.map +1 -1
- package/lib/module/components/ScreenStackHeaderConfig.js.map +1 -1
- package/lib/module/components/ScreenStackHeaderConfig.web.js.map +1 -1
- package/lib/module/components/SearchBar.js.map +1 -1
- package/lib/module/components/helpers/usePrevious.js.map +1 -1
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/typescript/components/Screen.web.d.ts +1 -1
- package/lib/typescript/components/Screen.web.d.ts.map +1 -1
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +5 -5
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -1
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +6 -6
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -1
- package/lib/typescript/components/SearchBar.d.ts.map +1 -1
- package/lib/typescript/components/helpers/usePrevious.d.ts.map +1 -1
- package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +2 -2
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +2 -2
- package/lib/typescript/types.d.ts.map +1 -1
- package/oss-attribution/attribution.txt +77 -0
- package/oss-attribution/licenseInfos.json +27 -0
- package/package.json +1 -1
- package/src/index.tsx +0 -55
- package/SystemBundles/31d5b6b69618249f6233b73a1de7c4d890c86be7ccb031ce7cf2dcc41783f9f7.bundle +0 -45301
- package/SystemBundles/31d5b6b69618249f6233b73a1de7c4d890c86be7ccb031ce7cf2dcc41783f9f7.map +0 -13711
- package/lib/commonjs/TransitionProgressContext.js +0 -12
- package/lib/commonjs/components/DebugContainer.js +0 -39
- package/lib/commonjs/components/DebugContainer.web.js +0 -15
- package/lib/commonjs/components/FullWindowOverlay.js +0 -31
- package/lib/commonjs/components/FullWindowOverlay.web.js +0 -9
- package/lib/commonjs/components/Screen.js +0 -286
- package/lib/commonjs/components/Screen.web.js +0 -47
- package/lib/commonjs/components/ScreenContainer.js +0 -32
- package/lib/commonjs/components/ScreenContainer.web.js +0 -10
- package/lib/commonjs/components/ScreenContentWrapper.js +0 -17
- package/lib/commonjs/components/ScreenContentWrapper.web.js +0 -10
- package/lib/commonjs/components/ScreenFooter.js +0 -25
- package/lib/commonjs/components/ScreenFooter.web.js +0 -11
- package/lib/commonjs/components/ScreenStack.js +0 -67
- package/lib/commonjs/components/ScreenStack.web.js +0 -10
- package/lib/commonjs/components/ScreenStackHeaderConfig.js +0 -90
- package/lib/commonjs/components/ScreenStackHeaderConfig.web.js +0 -27
- package/lib/commonjs/components/ScreenStackItem.js +0 -107
- package/lib/commonjs/components/SearchBar.js +0 -63
- package/lib/commonjs/components/SearchBar.web.js +0 -10
- package/lib/commonjs/components/helpers/DelayedFreeze.js +0 -31
- package/lib/commonjs/components/helpers/usePrevious.js +0 -15
- package/lib/commonjs/contexts.js +0 -11
- package/lib/commonjs/core.js +0 -40
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +0 -26
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js +0 -14
- package/lib/commonjs/fabric/NativeScreensModule.js +0 -10
- package/lib/commonjs/fabric/NativeScreensModule.web.js +0 -8
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +0 -30
- package/lib/commonjs/fabric/ScreenContentWrapperNativeComponent.js +0 -18
- package/lib/commonjs/fabric/ScreenFooterNativeComponent.js +0 -10
- package/lib/commonjs/fabric/ScreenNativeComponent.js +0 -70
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +0 -12
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -32
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -15
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +0 -32
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +0 -18
- package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +0 -19
- package/lib/commonjs/gesture-handler/RNScreensTurboModule.js +0 -8
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js +0 -201
- package/lib/commonjs/gesture-handler/constraints.js +0 -64
- package/lib/commonjs/gesture-handler/defaults.js +0 -45
- package/lib/commonjs/gesture-handler/fabricUtils.js +0 -66
- package/lib/commonjs/gesture-handler/fabricUtils.web.js +0 -17
- package/lib/commonjs/gesture-handler/index.js +0 -14
- package/lib/commonjs/native-stack/contexts/GHContext.js +0 -12
- package/lib/commonjs/native-stack/index.js +0 -49
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +0 -76
- package/lib/commonjs/native-stack/types.js +0 -6
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js +0 -12
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +0 -12
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +0 -75
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js +0 -35
- package/lib/commonjs/native-stack/utils/getStatusBarHeight.js +0 -22
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js +0 -19
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +0 -52
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js +0 -19
- package/lib/commonjs/native-stack/views/FontProcessor.js +0 -19
- package/lib/commonjs/native-stack/views/FooterComponent.js +0 -17
- package/lib/commonjs/native-stack/views/HeaderConfig.js +0 -149
- package/lib/commonjs/native-stack/views/NativeStackView.js +0 -420
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js +0 -12
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +0 -95
- package/lib/commonjs/reanimated/ReanimatedScreen.js +0 -22
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +0 -39
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +0 -12
- package/lib/commonjs/reanimated/index.js +0 -28
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +0 -19
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +0 -19
- package/lib/commonjs/types.js +0 -6
- package/lib/commonjs/useTransitionProgress.js +0 -19
- package/lib/commonjs/utils.js +0 -43
- package/lib/module/TransitionProgressContext.js +0 -5
- package/lib/module/components/DebugContainer.js +0 -30
- package/lib/module/components/DebugContainer.web.js +0 -6
- package/lib/module/components/FullWindowOverlay.js +0 -24
- package/lib/module/components/FullWindowOverlay.web.js +0 -3
- package/lib/module/components/Screen.js +0 -282
- package/lib/module/components/Screen.web.js +0 -40
- package/lib/module/components/ScreenContainer.js +0 -26
- package/lib/module/components/ScreenContainer.web.js +0 -4
- package/lib/module/components/ScreenContentWrapper.js +0 -10
- package/lib/module/components/ScreenContentWrapper.web.js +0 -4
- package/lib/module/components/ScreenFooter.js +0 -18
- package/lib/module/components/ScreenFooter.web.js +0 -6
- package/lib/module/components/ScreenStack.js +0 -63
- package/lib/module/components/ScreenStack.web.js +0 -4
- package/lib/module/components/ScreenStackHeaderConfig.js +0 -81
- package/lib/module/components/ScreenStackHeaderConfig.web.js +0 -14
- package/lib/module/components/ScreenStackItem.js +0 -98
- package/lib/module/components/SearchBar.js +0 -57
- package/lib/module/components/SearchBar.web.js +0 -4
- package/lib/module/components/helpers/DelayedFreeze.js +0 -24
- package/lib/module/components/helpers/usePrevious.js +0 -9
- package/lib/module/contexts.js +0 -4
- package/lib/module/core.js +0 -31
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +0 -20
- package/lib/module/fabric/ModalScreenNativeComponent.js +0 -10
- package/lib/module/fabric/NativeScreensModule.js +0 -5
- package/lib/module/fabric/NativeScreensModule.web.js +0 -2
- package/lib/module/fabric/ScreenContainerNativeComponent.js +0 -24
- package/lib/module/fabric/ScreenContentWrapperNativeComponent.js +0 -10
- package/lib/module/fabric/ScreenFooterNativeComponent.js +0 -3
- package/lib/module/fabric/ScreenNativeComponent.js +0 -66
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +0 -6
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -29
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -11
- package/lib/module/fabric/ScreenStackNativeComponent.js +0 -28
- package/lib/module/fabric/SearchBarNativeComponent.js +0 -12
- package/lib/module/gesture-handler/GestureDetectorProvider.js +0 -12
- package/lib/module/gesture-handler/RNScreensTurboModule.js +0 -2
- package/lib/module/gesture-handler/ScreenGestureDetector.js +0 -193
- package/lib/module/gesture-handler/constraints.js +0 -56
- package/lib/module/gesture-handler/defaults.js +0 -39
- package/lib/module/gesture-handler/fabricUtils.js +0 -61
- package/lib/module/gesture-handler/fabricUtils.web.js +0 -10
- package/lib/module/gesture-handler/index.js +0 -5
- package/lib/module/index.js +0 -33
- package/lib/module/native-stack/contexts/GHContext.js +0 -6
- package/lib/module/native-stack/index.js +0 -22
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +0 -73
- package/lib/module/native-stack/types.js +0 -2
- package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js +0 -4
- package/lib/module/native-stack/utils/HeaderHeightContext.js +0 -4
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js +0 -68
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js +0 -29
- package/lib/module/native-stack/utils/getStatusBarHeight.js +0 -16
- package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js +0 -10
- package/lib/module/native-stack/utils/useBackPressSubscription.js +0 -45
- package/lib/module/native-stack/utils/useHeaderHeight.js +0 -10
- package/lib/module/native-stack/views/FontProcessor.js +0 -12
- package/lib/module/native-stack/views/FooterComponent.js +0 -10
- package/lib/module/native-stack/views/HeaderConfig.js +0 -139
- package/lib/module/native-stack/views/NativeStackView.js +0 -423
- package/lib/module/reanimated/ReanimatedHeaderHeightContext.js +0 -5
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +0 -93
- package/lib/module/reanimated/ReanimatedScreen.js +0 -16
- package/lib/module/reanimated/ReanimatedScreenProvider.js +0 -32
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js +0 -5
- package/lib/module/reanimated/index.js +0 -4
- package/lib/module/reanimated/useReanimatedHeaderHeight.js +0 -10
- package/lib/module/reanimated/useReanimatedTransitionProgress.js +0 -10
- package/lib/module/types.js +0 -2
- package/lib/module/useTransitionProgress.js +0 -10
- package/lib/module/utils.js +0 -35
- package/src/TransitionProgressContext.tsx +0 -14
- package/src/components/DebugContainer.tsx +0 -46
- package/src/components/DebugContainer.web.tsx +0 -7
- package/src/components/FullWindowOverlay.tsx +0 -33
- package/src/components/FullWindowOverlay.web.tsx +0 -6
- package/src/components/Screen.tsx +0 -392
- package/src/components/Screen.web.tsx +0 -46
- package/src/components/ScreenContainer.tsx +0 -28
- package/src/components/ScreenContainer.web.tsx +0 -5
- package/src/components/ScreenContentWrapper.tsx +0 -9
- package/src/components/ScreenContentWrapper.web.tsx +0 -5
- package/src/components/ScreenFooter.tsx +0 -20
- package/src/components/ScreenFooter.web.tsx +0 -7
- package/src/components/ScreenStack.tsx +0 -112
- package/src/components/ScreenStack.web.tsx +0 -5
- package/src/components/ScreenStackHeaderConfig.tsx +0 -122
- package/src/components/ScreenStackHeaderConfig.web.tsx +0 -39
- package/src/components/ScreenStackItem.tsx +0 -174
- package/src/components/SearchBar.tsx +0 -102
- package/src/components/SearchBar.web.tsx +0 -5
- package/src/components/helpers/DelayedFreeze.tsx +0 -27
- package/src/components/helpers/usePrevious.tsx +0 -11
- package/src/contexts.tsx +0 -9
- package/src/core.ts +0 -45
- package/src/fabric/FullWindowOverlayNativeComponent.ts +0 -23
- package/src/fabric/ModalScreenNativeComponent.ts +0 -115
- package/src/fabric/NativeScreensModule.ts +0 -8
- package/src/fabric/NativeScreensModule.web.ts +0 -1
- package/src/fabric/ScreenContainerNativeComponent.ts +0 -28
- package/src/fabric/ScreenContentWrapperNativeComponent.ts +0 -14
- package/src/fabric/ScreenFooterNativeComponent.ts +0 -6
- package/src/fabric/ScreenNativeComponent.ts +0 -171
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +0 -12
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +0 -97
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +0 -26
- package/src/fabric/ScreenStackNativeComponent.ts +0 -34
- package/src/fabric/SearchBarNativeComponent.ts +0 -83
- package/src/gesture-handler/GestureDetectorProvider.tsx +0 -16
- package/src/gesture-handler/RNScreensTurboModule.ts +0 -13
- package/src/gesture-handler/ScreenGestureDetector.tsx +0 -241
- package/src/gesture-handler/constraints.ts +0 -87
- package/src/gesture-handler/defaults.ts +0 -46
- package/src/gesture-handler/fabricUtils.ts +0 -86
- package/src/gesture-handler/fabricUtils.web.ts +0 -10
- package/src/gesture-handler/index.tsx +0 -4
- package/src/native-stack/contexts/GHContext.tsx +0 -9
- package/src/native-stack/index.tsx +0 -27
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +0 -110
- package/src/native-stack/types.tsx +0 -659
- package/src/native-stack/utils/AnimatedHeaderHeightContext.tsx +0 -8
- package/src/native-stack/utils/HeaderHeightContext.tsx +0 -5
- package/src/native-stack/utils/SafeAreaProviderCompat.tsx +0 -78
- package/src/native-stack/utils/getDefaultHeaderHeight.tsx +0 -41
- package/src/native-stack/utils/getStatusBarHeight.tsx +0 -22
- package/src/native-stack/utils/useAnimatedHeaderHeight.tsx +0 -15
- package/src/native-stack/utils/useBackPressSubscription.tsx +0 -66
- package/src/native-stack/utils/useHeaderHeight.tsx +0 -15
- package/src/native-stack/views/FontProcessor.tsx +0 -14
- package/src/native-stack/views/FooterComponent.tsx +0 -10
- package/src/native-stack/views/HeaderConfig.tsx +0 -202
- package/src/native-stack/views/NativeStackView.tsx +0 -550
- package/src/reanimated/ReanimatedHeaderHeightContext.tsx +0 -7
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +0 -132
- package/src/reanimated/ReanimatedScreen.tsx +0 -26
- package/src/reanimated/ReanimatedScreenProvider.tsx +0 -43
- package/src/reanimated/ReanimatedTransitionProgressContext.tsx +0 -13
- package/src/reanimated/index.tsx +0 -3
- package/src/reanimated/useReanimatedHeaderHeight.tsx +0 -14
- package/src/reanimated/useReanimatedTransitionProgress.tsx +0 -14
- package/src/types.tsx +0 -869
- package/src/useTransitionProgress.tsx +0 -15
- package/src/utils.ts +0 -40
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BackHandler } from 'react-native';
|
|
3
|
-
/**
|
|
4
|
-
* This hook is an abstraction for keeping back press subscription
|
|
5
|
-
* logic in one place.
|
|
6
|
-
*/
|
|
7
|
-
export function useBackPressSubscription({
|
|
8
|
-
onBackPress,
|
|
9
|
-
isDisabled
|
|
10
|
-
}) {
|
|
11
|
-
const [isActive, setIsActive] = React.useState(false);
|
|
12
|
-
const subscription = React.useRef();
|
|
13
|
-
const clearSubscription = React.useCallback((shouldSetActive = true) => {
|
|
14
|
-
subscription.current?.remove();
|
|
15
|
-
subscription.current = undefined;
|
|
16
|
-
if (shouldSetActive) setIsActive(false);
|
|
17
|
-
}, []);
|
|
18
|
-
const createSubscription = React.useCallback(() => {
|
|
19
|
-
if (!isDisabled) {
|
|
20
|
-
subscription.current?.remove();
|
|
21
|
-
subscription.current = BackHandler.addEventListener('hardwareBackPress', onBackPress);
|
|
22
|
-
setIsActive(true);
|
|
23
|
-
}
|
|
24
|
-
}, [isDisabled, onBackPress]);
|
|
25
|
-
const handleAttached = React.useCallback(() => {
|
|
26
|
-
if (isActive) {
|
|
27
|
-
createSubscription();
|
|
28
|
-
}
|
|
29
|
-
}, [createSubscription, isActive]);
|
|
30
|
-
const handleDetached = React.useCallback(() => {
|
|
31
|
-
clearSubscription(false);
|
|
32
|
-
}, [clearSubscription]);
|
|
33
|
-
React.useEffect(() => {
|
|
34
|
-
if (isDisabled) {
|
|
35
|
-
clearSubscription();
|
|
36
|
-
}
|
|
37
|
-
}, [isDisabled, clearSubscription]);
|
|
38
|
-
return {
|
|
39
|
-
handleAttached,
|
|
40
|
-
handleDetached,
|
|
41
|
-
createSubscription,
|
|
42
|
-
clearSubscription
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=useBackPressSubscription.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import HeaderHeightContext from './HeaderHeightContext';
|
|
3
|
-
export default function useHeaderHeight() {
|
|
4
|
-
const height = React.useContext(HeaderHeightContext);
|
|
5
|
-
if (height === undefined) {
|
|
6
|
-
throw new Error("Couldn't find the header height. Are you inside a screen in a navigator with a header?");
|
|
7
|
-
}
|
|
8
|
-
return height;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=useHeaderHeight.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @ts-ignore: No declaration available
|
|
2
|
-
|
|
3
|
-
import ReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';
|
|
4
|
-
export function processFonts(fontFamilies) {
|
|
5
|
-
// @ts-ignore: React Native types are incorrect here and don't consider fontFamily a style value
|
|
6
|
-
const fontFamilyProcessor = ReactNativeStyleAttributes.fontFamily?.process;
|
|
7
|
-
if (typeof fontFamilyProcessor === 'function') {
|
|
8
|
-
return fontFamilies.map(fontFamilyProcessor);
|
|
9
|
-
}
|
|
10
|
-
return fontFamilies;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=FontProcessor.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ScreenFooter from '../../components/ScreenFooter';
|
|
3
|
-
export default function FooterComponent({
|
|
4
|
-
children
|
|
5
|
-
}) {
|
|
6
|
-
return /*#__PURE__*/React.createElement(ScreenFooter, {
|
|
7
|
-
collapsable: false
|
|
8
|
-
}, children);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=FooterComponent.js.map
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.
|
|
5
|
-
*
|
|
6
|
-
* Amazon modifications are indicated by [amznmod_* comments].
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* Changelog:
|
|
11
|
-
* Set up react-native-screens package to build for Kepler
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
// amznmod_react - change imports to kepler packages
|
|
15
|
-
import { useTheme } from '@amazon-devices/react-navigation__native';
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import { Platform } from 'react-native';
|
|
18
|
-
import { isSearchBarAvailableForCurrentPlatform, executeNativeBackPress } from '../../utils';
|
|
19
|
-
import { ScreenStackHeaderBackButtonImage, ScreenStackHeaderCenterView, ScreenStackHeaderConfig, ScreenStackHeaderLeftView, ScreenStackHeaderRightView, ScreenStackHeaderSearchBarView } from '../../components/ScreenStackHeaderConfig';
|
|
20
|
-
import SearchBar from '../../components/SearchBar';
|
|
21
|
-
import { useBackPressSubscription } from '../utils/useBackPressSubscription';
|
|
22
|
-
import { processFonts } from './FontProcessor';
|
|
23
|
-
import warnOnce from 'warn-once';
|
|
24
|
-
export default function HeaderConfig({
|
|
25
|
-
backButtonImage,
|
|
26
|
-
backButtonInCustomView,
|
|
27
|
-
direction,
|
|
28
|
-
disableBackButtonMenu,
|
|
29
|
-
backButtonDisplayMode = 'default',
|
|
30
|
-
headerBackTitle,
|
|
31
|
-
headerBackTitleStyle = {},
|
|
32
|
-
headerBackTitleVisible = true,
|
|
33
|
-
headerCenter,
|
|
34
|
-
headerHideBackButton,
|
|
35
|
-
headerHideShadow,
|
|
36
|
-
headerLargeStyle = {},
|
|
37
|
-
headerLargeTitle,
|
|
38
|
-
headerLargeTitleHideShadow,
|
|
39
|
-
headerLargeTitleStyle = {},
|
|
40
|
-
headerLeft,
|
|
41
|
-
headerRight,
|
|
42
|
-
headerShown,
|
|
43
|
-
headerStyle = {},
|
|
44
|
-
headerTintColor,
|
|
45
|
-
headerTitle,
|
|
46
|
-
headerTitleStyle = {},
|
|
47
|
-
headerTopInsetEnabled = true,
|
|
48
|
-
headerTranslucent,
|
|
49
|
-
route,
|
|
50
|
-
searchBar,
|
|
51
|
-
title
|
|
52
|
-
}) {
|
|
53
|
-
const {
|
|
54
|
-
colors
|
|
55
|
-
} = useTheme();
|
|
56
|
-
const tintColor = headerTintColor ?? colors.primary;
|
|
57
|
-
|
|
58
|
-
// We need to use back press subscription here to override back button behavior on JS side.
|
|
59
|
-
// Because screens are usually used with react-navigation and this library overrides back button
|
|
60
|
-
// we need to handle it first in case when search bar is open
|
|
61
|
-
const {
|
|
62
|
-
handleAttached,
|
|
63
|
-
handleDetached,
|
|
64
|
-
clearSubscription,
|
|
65
|
-
createSubscription
|
|
66
|
-
} = useBackPressSubscription({
|
|
67
|
-
onBackPress: executeNativeBackPress,
|
|
68
|
-
isDisabled: !searchBar || !!searchBar.disableBackButtonOverride
|
|
69
|
-
});
|
|
70
|
-
const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = processFonts([headerBackTitleStyle.fontFamily, headerLargeTitleStyle.fontFamily, headerTitleStyle.fontFamily]);
|
|
71
|
-
|
|
72
|
-
// We want to clear clearSubscription only when components unmounts or search bar changes
|
|
73
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
|
-
React.useEffect(() => clearSubscription, [searchBar]);
|
|
75
|
-
const processedSearchBarOptions = React.useMemo(() => {
|
|
76
|
-
if (Platform.OS === 'android' && searchBar && !searchBar.disableBackButtonOverride) {
|
|
77
|
-
const onFocus = (...args) => {
|
|
78
|
-
createSubscription();
|
|
79
|
-
searchBar.onFocus?.(...args);
|
|
80
|
-
};
|
|
81
|
-
const onClose = (...args) => {
|
|
82
|
-
clearSubscription();
|
|
83
|
-
searchBar.onClose?.(...args);
|
|
84
|
-
};
|
|
85
|
-
return {
|
|
86
|
-
...searchBar,
|
|
87
|
-
onFocus,
|
|
88
|
-
onClose
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return searchBar;
|
|
92
|
-
}, [searchBar, createSubscription, clearSubscription]);
|
|
93
|
-
|
|
94
|
-
// @ts-ignore isVision is not yet in the type definitions (RN 0.74+)
|
|
95
|
-
const isVisionOS = Platform?.isVision;
|
|
96
|
-
warnOnce(isVisionOS && (headerTitleStyle.color !== undefined || headerTintColor !== undefined), 'headerTitleStyle.color and headerTintColor are not supported on visionOS.');
|
|
97
|
-
return /*#__PURE__*/React.createElement(ScreenStackHeaderConfig, {
|
|
98
|
-
backButtonInCustomView: backButtonInCustomView,
|
|
99
|
-
backgroundColor: headerStyle.backgroundColor ? headerStyle.backgroundColor : colors.card,
|
|
100
|
-
backTitle: headerBackTitle,
|
|
101
|
-
backTitleFontFamily: backTitleFontFamily,
|
|
102
|
-
backTitleFontSize: headerBackTitleStyle.fontSize,
|
|
103
|
-
backTitleVisible: headerBackTitleVisible,
|
|
104
|
-
blurEffect: headerStyle.blurEffect,
|
|
105
|
-
color: tintColor,
|
|
106
|
-
direction: direction,
|
|
107
|
-
disableBackButtonMenu: disableBackButtonMenu,
|
|
108
|
-
backButtonDisplayMode: backButtonDisplayMode,
|
|
109
|
-
hidden: headerShown === false,
|
|
110
|
-
hideBackButton: headerHideBackButton,
|
|
111
|
-
hideShadow: headerHideShadow,
|
|
112
|
-
largeTitle: headerLargeTitle,
|
|
113
|
-
largeTitleBackgroundColor: headerLargeStyle.backgroundColor,
|
|
114
|
-
largeTitleColor: headerLargeTitleStyle.color,
|
|
115
|
-
largeTitleFontFamily: largeTitleFontFamily,
|
|
116
|
-
largeTitleFontSize: headerLargeTitleStyle.fontSize,
|
|
117
|
-
largeTitleFontWeight: headerLargeTitleStyle.fontWeight,
|
|
118
|
-
largeTitleHideShadow: headerLargeTitleHideShadow,
|
|
119
|
-
title: headerTitle !== undefined ? headerTitle : title !== undefined ? title : route.name,
|
|
120
|
-
titleColor: headerTitleStyle.color !== undefined ? headerTitleStyle.color : headerTintColor !== undefined ? headerTintColor : colors.text,
|
|
121
|
-
titleFontFamily: titleFontFamily,
|
|
122
|
-
titleFontSize: headerTitleStyle.fontSize,
|
|
123
|
-
titleFontWeight: headerTitleStyle.fontWeight,
|
|
124
|
-
topInsetEnabled: headerTopInsetEnabled,
|
|
125
|
-
translucent: headerTranslucent === true,
|
|
126
|
-
onAttached: handleAttached,
|
|
127
|
-
onDetached: handleDetached
|
|
128
|
-
}, headerRight !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderRightView, null, headerRight({
|
|
129
|
-
tintColor
|
|
130
|
-
})) : null, backButtonImage !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderBackButtonImage, {
|
|
131
|
-
key: "backImage",
|
|
132
|
-
source: backButtonImage
|
|
133
|
-
}) : null, headerLeft !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderLeftView, null, headerLeft({
|
|
134
|
-
tintColor
|
|
135
|
-
})) : null, headerCenter !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderCenterView, null, headerCenter({
|
|
136
|
-
tintColor
|
|
137
|
-
})) : null, isSearchBarAvailableForCurrentPlatform && processedSearchBarOptions !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderSearchBarView, null, /*#__PURE__*/React.createElement(SearchBar, processedSearchBarOptions)) : null);
|
|
138
|
-
}
|
|
139
|
-
//# sourceMappingURL=HeaderConfig.js.map
|
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/*
|
|
3
|
-
* Portions of this file are copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* PORTIONS OF THIS FILE ARE AMAZON PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS.
|
|
6
|
-
*
|
|
7
|
-
* Amazon modifications are indicated by [amznmod_* comments].
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
* Changelog:
|
|
12
|
-
* Set up react-native-screens package to build for Kepler
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/* eslint-disable camelcase */
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import { Animated, Platform, StyleSheet } from 'react-native';
|
|
18
|
-
// @ts-ignore Getting private component
|
|
19
|
-
|
|
20
|
-
import AppContainer from 'react-native/Libraries/ReactNative/AppContainer';
|
|
21
|
-
import warnOnce from 'warn-once';
|
|
22
|
-
import ScreenStack from '../../components/ScreenStack';
|
|
23
|
-
import ScreenContentWrapper from '../../components/ScreenContentWrapper';
|
|
24
|
-
import { ScreenContext } from '../../components/Screen';
|
|
25
|
-
import { StackActions, useTheme
|
|
26
|
-
|
|
27
|
-
// amznmod_react - change imports to kepler packages
|
|
28
|
-
} from '@amazon-devices/react-navigation__native';
|
|
29
|
-
import { useSafeAreaFrame, useSafeAreaInsets
|
|
30
|
-
// amznmod_react - change imports to kepler packages
|
|
31
|
-
} from '@amazon-devices/react-native-safe-area-context';
|
|
32
|
-
import HeaderConfig from './HeaderConfig';
|
|
33
|
-
import SafeAreaProviderCompat from '../utils/SafeAreaProviderCompat';
|
|
34
|
-
import getDefaultHeaderHeight from '../utils/getDefaultHeaderHeight';
|
|
35
|
-
import getStatusBarHeight from '../utils/getStatusBarHeight';
|
|
36
|
-
import HeaderHeightContext from '../utils/HeaderHeightContext';
|
|
37
|
-
import AnimatedHeaderHeightContext from '../utils/AnimatedHeaderHeightContext';
|
|
38
|
-
import FooterComponent from './FooterComponent';
|
|
39
|
-
const isAndroid = Platform.OS === 'android';
|
|
40
|
-
// amznmod_react - add isKepler flag
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
const isKepler = Platform.OS === 'kepler';
|
|
43
|
-
let Container = ScreenContentWrapper;
|
|
44
|
-
if (__DEV__) {
|
|
45
|
-
const DebugContainer = props => {
|
|
46
|
-
const {
|
|
47
|
-
stackPresentation,
|
|
48
|
-
...rest
|
|
49
|
-
} = props;
|
|
50
|
-
if (Platform.OS === 'ios' && stackPresentation !== 'push' && stackPresentation !== 'formSheet') {
|
|
51
|
-
return /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(ScreenContentWrapper, rest));
|
|
52
|
-
}
|
|
53
|
-
return /*#__PURE__*/React.createElement(ScreenContentWrapper, rest);
|
|
54
|
-
};
|
|
55
|
-
// @ts-ignore Wrong props
|
|
56
|
-
Container = DebugContainer;
|
|
57
|
-
}
|
|
58
|
-
const MaybeNestedStack = ({
|
|
59
|
-
options,
|
|
60
|
-
route,
|
|
61
|
-
stackPresentation,
|
|
62
|
-
children,
|
|
63
|
-
internalScreenStyle
|
|
64
|
-
}) => {
|
|
65
|
-
const {
|
|
66
|
-
colors
|
|
67
|
-
} = useTheme();
|
|
68
|
-
const {
|
|
69
|
-
headerShown = true,
|
|
70
|
-
contentStyle
|
|
71
|
-
} = options;
|
|
72
|
-
const Screen = React.useContext(ScreenContext);
|
|
73
|
-
|
|
74
|
-
// amznmod_react - return false for Modal on kepler because native component is not implemented yet
|
|
75
|
-
const isHeaderInModal = isAndroid || isKepler ? false : stackPresentation !== 'push' && headerShown === true;
|
|
76
|
-
const headerShownPreviousRef = React.useRef(headerShown);
|
|
77
|
-
React.useEffect(() => {
|
|
78
|
-
warnOnce(!isAndroid && stackPresentation !== 'push' && headerShownPreviousRef.current !== headerShown, `Dynamically changing 'headerShown' in modals will result in remounting the screen and losing all local state. See options for the screen '${route.name}'.`);
|
|
79
|
-
headerShownPreviousRef.current = headerShown;
|
|
80
|
-
}, [headerShown, stackPresentation, route.name]);
|
|
81
|
-
const content = /*#__PURE__*/React.createElement(Container, {
|
|
82
|
-
style: [stackPresentation === 'formSheet' ? Platform.OS === 'ios' ? styles.absoluteFillNoBottom : null : styles.container, stackPresentation !== 'transparentModal' && stackPresentation !== 'containedTransparentModal' && {
|
|
83
|
-
backgroundColor: colors.background
|
|
84
|
-
}, contentStyle]
|
|
85
|
-
// @ts-ignore Wrong props passed to View
|
|
86
|
-
,
|
|
87
|
-
stackPresentation: stackPresentation
|
|
88
|
-
// This view must *not* be flattened.
|
|
89
|
-
// See https://github.com/software-mansion/react-native-screens/pull/1825
|
|
90
|
-
// for detailed explanation.
|
|
91
|
-
,
|
|
92
|
-
collapsable: false
|
|
93
|
-
}, children);
|
|
94
|
-
const dimensions = useSafeAreaFrame();
|
|
95
|
-
const topInset = useSafeAreaInsets().top;
|
|
96
|
-
const isStatusBarTranslucent = options.statusBarTranslucent ?? false;
|
|
97
|
-
const statusBarHeight = getStatusBarHeight(topInset, dimensions, isStatusBarTranslucent);
|
|
98
|
-
const hasLargeHeader = options.headerLargeTitle ?? false;
|
|
99
|
-
const headerHeight = getDefaultHeaderHeight(dimensions, statusBarHeight, stackPresentation, hasLargeHeader);
|
|
100
|
-
if (isHeaderInModal) {
|
|
101
|
-
return /*#__PURE__*/React.createElement(ScreenStack, {
|
|
102
|
-
style: styles.container
|
|
103
|
-
}, /*#__PURE__*/React.createElement(Screen, {
|
|
104
|
-
enabled: true,
|
|
105
|
-
isNativeStack: true,
|
|
106
|
-
hasLargeHeader: hasLargeHeader,
|
|
107
|
-
style: [StyleSheet.absoluteFill, internalScreenStyle]
|
|
108
|
-
}, /*#__PURE__*/React.createElement(HeaderHeightContext.Provider, {
|
|
109
|
-
value: headerHeight
|
|
110
|
-
}, /*#__PURE__*/React.createElement(HeaderConfig, _extends({}, options, {
|
|
111
|
-
route: route
|
|
112
|
-
})), content)));
|
|
113
|
-
}
|
|
114
|
-
return content;
|
|
115
|
-
};
|
|
116
|
-
const RouteView = ({
|
|
117
|
-
descriptors,
|
|
118
|
-
route,
|
|
119
|
-
index,
|
|
120
|
-
navigation,
|
|
121
|
-
stateKey,
|
|
122
|
-
screensRefs
|
|
123
|
-
}) => {
|
|
124
|
-
const {
|
|
125
|
-
options,
|
|
126
|
-
render: renderScene
|
|
127
|
-
} = descriptors[route.key];
|
|
128
|
-
const {
|
|
129
|
-
fullScreenSwipeShadowEnabled = true,
|
|
130
|
-
gestureEnabled,
|
|
131
|
-
headerShown,
|
|
132
|
-
hideKeyboardOnSwipe,
|
|
133
|
-
homeIndicatorHidden,
|
|
134
|
-
sheetLargestUndimmedDetentIndex = 'none',
|
|
135
|
-
sheetGrabberVisible = false,
|
|
136
|
-
sheetCornerRadius = -1.0,
|
|
137
|
-
sheetElevation = 24,
|
|
138
|
-
sheetExpandsWhenScrolledToEdge = true,
|
|
139
|
-
sheetInitialDetentIndex = 0,
|
|
140
|
-
nativeBackButtonDismissalEnabled = false,
|
|
141
|
-
navigationBarColor,
|
|
142
|
-
navigationBarTranslucent,
|
|
143
|
-
navigationBarHidden,
|
|
144
|
-
replaceAnimation = 'pop',
|
|
145
|
-
screenOrientation,
|
|
146
|
-
statusBarAnimation,
|
|
147
|
-
statusBarColor,
|
|
148
|
-
statusBarHidden,
|
|
149
|
-
statusBarStyle,
|
|
150
|
-
statusBarTranslucent,
|
|
151
|
-
swipeDirection = 'horizontal',
|
|
152
|
-
transitionDuration,
|
|
153
|
-
freezeOnBlur,
|
|
154
|
-
unstable_sheetFooter = null,
|
|
155
|
-
contentStyle
|
|
156
|
-
} = options;
|
|
157
|
-
let {
|
|
158
|
-
sheetAllowedDetents = [1.0],
|
|
159
|
-
customAnimationOnSwipe,
|
|
160
|
-
fullScreenSwipeEnabled,
|
|
161
|
-
gestureResponseDistance,
|
|
162
|
-
stackAnimation,
|
|
163
|
-
stackPresentation = 'push'
|
|
164
|
-
} = options;
|
|
165
|
-
|
|
166
|
-
// We take backgroundColor from contentStyle and apply it on Screen.
|
|
167
|
-
// This allows to workaround one issue with truncated
|
|
168
|
-
// content with formSheet presentation.
|
|
169
|
-
let internalScreenStyle;
|
|
170
|
-
if (stackPresentation === 'formSheet' && contentStyle) {
|
|
171
|
-
const flattenContentStyles = StyleSheet.flatten(contentStyle);
|
|
172
|
-
internalScreenStyle = {
|
|
173
|
-
backgroundColor: flattenContentStyles?.backgroundColor
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
if (sheetAllowedDetents === 'fitToContents') {
|
|
177
|
-
sheetAllowedDetents = [-1];
|
|
178
|
-
}
|
|
179
|
-
if (swipeDirection === 'vertical') {
|
|
180
|
-
// for `vertical` direction to work, we need to set `fullScreenSwipeEnabled` to `true`
|
|
181
|
-
// so the screen can be dismissed from any point on screen.
|
|
182
|
-
// `customAnimationOnSwipe` needs to be set to `true` so the `stackAnimation` set by user can be used,
|
|
183
|
-
// otherwise `simple_push` will be used.
|
|
184
|
-
// Also, the default animation for this direction seems to be `slide_from_bottom`.
|
|
185
|
-
if (fullScreenSwipeEnabled === undefined) {
|
|
186
|
-
fullScreenSwipeEnabled = true;
|
|
187
|
-
}
|
|
188
|
-
if (customAnimationOnSwipe === undefined) {
|
|
189
|
-
customAnimationOnSwipe = true;
|
|
190
|
-
}
|
|
191
|
-
if (stackAnimation === undefined) {
|
|
192
|
-
stackAnimation = 'slide_from_bottom';
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
if (index === 0) {
|
|
196
|
-
// first screen should always be treated as `push`, it resolves problems with no header animation
|
|
197
|
-
// for navigator with first screen as `modal` and the next as `push`
|
|
198
|
-
stackPresentation = 'push';
|
|
199
|
-
}
|
|
200
|
-
const dimensions = useSafeAreaFrame();
|
|
201
|
-
const topInset = useSafeAreaInsets().top;
|
|
202
|
-
const isStatusBarTranslucent = options.statusBarTranslucent ?? false;
|
|
203
|
-
const statusBarHeight = getStatusBarHeight(topInset, dimensions, isStatusBarTranslucent);
|
|
204
|
-
const hasLargeHeader = options.headerLargeTitle ?? false;
|
|
205
|
-
const defaultHeaderHeight = getDefaultHeaderHeight(dimensions, statusBarHeight, stackPresentation, hasLargeHeader);
|
|
206
|
-
const parentHeaderHeight = React.useContext(HeaderHeightContext);
|
|
207
|
-
const isHeaderInPush = isAndroid ? headerShown : stackPresentation === 'push' && headerShown !== false;
|
|
208
|
-
const staticHeaderHeight = isHeaderInPush !== false ? defaultHeaderHeight : parentHeaderHeight ?? 0;
|
|
209
|
-
|
|
210
|
-
// We need to ensure the first retrieved header height will be cached and set in animatedHeaderHeight.
|
|
211
|
-
// We're caching the header height here, as on iOS native side events are not always coming to the JS on first notify.
|
|
212
|
-
// TODO: Check why first event is not being received once it is cached on the native side.
|
|
213
|
-
const cachedAnimatedHeaderHeight = React.useRef(defaultHeaderHeight);
|
|
214
|
-
const animatedHeaderHeight = React.useRef(
|
|
215
|
-
// amznmod_react - change imports to kepler packages
|
|
216
|
-
// @ts-ignore
|
|
217
|
-
new Animated.Value(staticHeaderHeight, {
|
|
218
|
-
useNativeDriver: true
|
|
219
|
-
})).current;
|
|
220
|
-
const Screen = React.useContext(ScreenContext);
|
|
221
|
-
const {
|
|
222
|
-
dark
|
|
223
|
-
} = useTheme();
|
|
224
|
-
const screenRef = React.useRef(null);
|
|
225
|
-
React.useEffect(() => {
|
|
226
|
-
screensRefs.current[route.key] = screenRef;
|
|
227
|
-
return () => {
|
|
228
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
229
|
-
delete screensRefs.current[route.key];
|
|
230
|
-
};
|
|
231
|
-
});
|
|
232
|
-
return /*#__PURE__*/React.createElement(Screen, {
|
|
233
|
-
key: route.key,
|
|
234
|
-
ref: screenRef,
|
|
235
|
-
enabled: true,
|
|
236
|
-
isNativeStack: true,
|
|
237
|
-
hasLargeHeader: hasLargeHeader,
|
|
238
|
-
style: [StyleSheet.absoluteFill, internalScreenStyle],
|
|
239
|
-
sheetAllowedDetents: sheetAllowedDetents,
|
|
240
|
-
sheetLargestUndimmedDetentIndex: sheetLargestUndimmedDetentIndex,
|
|
241
|
-
sheetGrabberVisible: sheetGrabberVisible,
|
|
242
|
-
sheetInitialDetentIndex: sheetInitialDetentIndex,
|
|
243
|
-
sheetCornerRadius: sheetCornerRadius,
|
|
244
|
-
sheetElevation: sheetElevation,
|
|
245
|
-
sheetExpandsWhenScrolledToEdge: sheetExpandsWhenScrolledToEdge,
|
|
246
|
-
customAnimationOnSwipe: customAnimationOnSwipe,
|
|
247
|
-
freezeOnBlur: freezeOnBlur,
|
|
248
|
-
fullScreenSwipeEnabled: fullScreenSwipeEnabled,
|
|
249
|
-
fullScreenSwipeShadowEnabled: fullScreenSwipeShadowEnabled,
|
|
250
|
-
hideKeyboardOnSwipe: hideKeyboardOnSwipe,
|
|
251
|
-
homeIndicatorHidden: homeIndicatorHidden,
|
|
252
|
-
gestureEnabled: isAndroid ? false : gestureEnabled,
|
|
253
|
-
gestureResponseDistance: gestureResponseDistance,
|
|
254
|
-
nativeBackButtonDismissalEnabled: nativeBackButtonDismissalEnabled,
|
|
255
|
-
navigationBarColor: navigationBarColor,
|
|
256
|
-
navigationBarTranslucent: navigationBarTranslucent,
|
|
257
|
-
navigationBarHidden: navigationBarHidden,
|
|
258
|
-
replaceAnimation: replaceAnimation,
|
|
259
|
-
screenOrientation: screenOrientation,
|
|
260
|
-
stackAnimation: stackAnimation,
|
|
261
|
-
stackPresentation: stackPresentation,
|
|
262
|
-
statusBarAnimation: statusBarAnimation,
|
|
263
|
-
statusBarColor: statusBarColor,
|
|
264
|
-
statusBarHidden: statusBarHidden,
|
|
265
|
-
statusBarStyle: statusBarStyle ?? (dark ? 'light' : 'dark'),
|
|
266
|
-
statusBarTranslucent: statusBarTranslucent,
|
|
267
|
-
swipeDirection: swipeDirection,
|
|
268
|
-
transitionDuration: transitionDuration,
|
|
269
|
-
onHeaderBackButtonClicked: () => {
|
|
270
|
-
navigation.dispatch({
|
|
271
|
-
...StackActions.pop(),
|
|
272
|
-
source: route.key,
|
|
273
|
-
target: stateKey
|
|
274
|
-
});
|
|
275
|
-
},
|
|
276
|
-
onWillAppear: () => {
|
|
277
|
-
navigation.emit({
|
|
278
|
-
type: 'transitionStart',
|
|
279
|
-
data: {
|
|
280
|
-
closing: false
|
|
281
|
-
},
|
|
282
|
-
target: route.key
|
|
283
|
-
});
|
|
284
|
-
},
|
|
285
|
-
onWillDisappear: () => {
|
|
286
|
-
navigation.emit({
|
|
287
|
-
type: 'transitionStart',
|
|
288
|
-
data: {
|
|
289
|
-
closing: true
|
|
290
|
-
},
|
|
291
|
-
target: route.key
|
|
292
|
-
});
|
|
293
|
-
},
|
|
294
|
-
onAppear: () => {
|
|
295
|
-
navigation.emit({
|
|
296
|
-
type: 'appear',
|
|
297
|
-
target: route.key
|
|
298
|
-
});
|
|
299
|
-
navigation.emit({
|
|
300
|
-
type: 'transitionEnd',
|
|
301
|
-
data: {
|
|
302
|
-
closing: false
|
|
303
|
-
},
|
|
304
|
-
target: route.key
|
|
305
|
-
});
|
|
306
|
-
},
|
|
307
|
-
onDisappear: () => {
|
|
308
|
-
navigation.emit({
|
|
309
|
-
type: 'transitionEnd',
|
|
310
|
-
data: {
|
|
311
|
-
closing: true
|
|
312
|
-
},
|
|
313
|
-
target: route.key
|
|
314
|
-
});
|
|
315
|
-
},
|
|
316
|
-
onHeaderHeightChange: e => {
|
|
317
|
-
const headerHeight = e.nativeEvent.headerHeight;
|
|
318
|
-
if (cachedAnimatedHeaderHeight.current !== headerHeight) {
|
|
319
|
-
// Currently, we're setting value by Animated#setValue, because we want to cache animated value.
|
|
320
|
-
// Also, in React Native 0.72 there was a bug on Fabric causing a large delay between the screen transition,
|
|
321
|
-
// which should not occur.
|
|
322
|
-
// TODO: Check if it's possible to replace animated#setValue to Animated#event.
|
|
323
|
-
animatedHeaderHeight.setValue(headerHeight);
|
|
324
|
-
cachedAnimatedHeaderHeight.current = headerHeight;
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
onDismissed: e => {
|
|
328
|
-
navigation.emit({
|
|
329
|
-
type: 'dismiss',
|
|
330
|
-
target: route.key
|
|
331
|
-
});
|
|
332
|
-
const dismissCount = e.nativeEvent.dismissCount > 0 ? e.nativeEvent.dismissCount : 1;
|
|
333
|
-
navigation.dispatch({
|
|
334
|
-
...StackActions.pop(dismissCount),
|
|
335
|
-
source: route.key,
|
|
336
|
-
target: stateKey
|
|
337
|
-
});
|
|
338
|
-
},
|
|
339
|
-
onSheetDetentChanged: e => {
|
|
340
|
-
navigation.emit({
|
|
341
|
-
type: 'sheetDetentChange',
|
|
342
|
-
target: route.key,
|
|
343
|
-
data: {
|
|
344
|
-
index: e.nativeEvent.index,
|
|
345
|
-
isStable: e.nativeEvent.isStable
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
},
|
|
349
|
-
onGestureCancel: () => {
|
|
350
|
-
navigation.emit({
|
|
351
|
-
type: 'gestureCancel',
|
|
352
|
-
target: route.key
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
}, /*#__PURE__*/React.createElement(AnimatedHeaderHeightContext.Provider, {
|
|
356
|
-
value: animatedHeaderHeight
|
|
357
|
-
}, /*#__PURE__*/React.createElement(HeaderHeightContext.Provider, {
|
|
358
|
-
value: staticHeaderHeight
|
|
359
|
-
}, /*#__PURE__*/React.createElement(MaybeNestedStack, {
|
|
360
|
-
options: options,
|
|
361
|
-
route: route,
|
|
362
|
-
stackPresentation: stackPresentation,
|
|
363
|
-
internalScreenStyle: internalScreenStyle
|
|
364
|
-
}, renderScene()), /*#__PURE__*/React.createElement(HeaderConfig, _extends({}, options, {
|
|
365
|
-
route: route,
|
|
366
|
-
headerShown: isHeaderInPush
|
|
367
|
-
})), stackPresentation === 'formSheet' && unstable_sheetFooter && /*#__PURE__*/React.createElement(FooterComponent, null, unstable_sheetFooter()))));
|
|
368
|
-
};
|
|
369
|
-
function NativeStackViewInner({
|
|
370
|
-
state,
|
|
371
|
-
navigation,
|
|
372
|
-
descriptors
|
|
373
|
-
}) {
|
|
374
|
-
const {
|
|
375
|
-
key,
|
|
376
|
-
routes
|
|
377
|
-
} = state;
|
|
378
|
-
const currentRouteKey = routes[state.index].key;
|
|
379
|
-
const {
|
|
380
|
-
goBackGesture,
|
|
381
|
-
transitionAnimation,
|
|
382
|
-
screenEdgeGesture
|
|
383
|
-
} = descriptors[currentRouteKey].options;
|
|
384
|
-
const screensRefs = React.useRef({});
|
|
385
|
-
return /*#__PURE__*/React.createElement(ScreenStack, {
|
|
386
|
-
style: styles.container,
|
|
387
|
-
goBackGesture: goBackGesture,
|
|
388
|
-
transitionAnimation: transitionAnimation,
|
|
389
|
-
screenEdgeGesture: screenEdgeGesture ?? false,
|
|
390
|
-
screensRefs: screensRefs,
|
|
391
|
-
currentScreenId: currentRouteKey
|
|
392
|
-
}, routes.map((route, index) => /*#__PURE__*/React.createElement(RouteView, {
|
|
393
|
-
key: route.key,
|
|
394
|
-
descriptors: descriptors,
|
|
395
|
-
route: route,
|
|
396
|
-
index: index,
|
|
397
|
-
navigation: navigation,
|
|
398
|
-
stateKey: key,
|
|
399
|
-
screensRefs: screensRefs
|
|
400
|
-
})));
|
|
401
|
-
}
|
|
402
|
-
export default function NativeStackView(props) {
|
|
403
|
-
return /*#__PURE__*/React.createElement(SafeAreaProviderCompat, null, /*#__PURE__*/React.createElement(NativeStackViewInner, props));
|
|
404
|
-
}
|
|
405
|
-
const styles = StyleSheet.create({
|
|
406
|
-
container: {
|
|
407
|
-
flex: 1
|
|
408
|
-
},
|
|
409
|
-
absoluteFill: {
|
|
410
|
-
position: 'absolute',
|
|
411
|
-
top: 0,
|
|
412
|
-
left: 0,
|
|
413
|
-
right: 0,
|
|
414
|
-
bottom: 0
|
|
415
|
-
},
|
|
416
|
-
absoluteFillNoBottom: {
|
|
417
|
-
position: 'absolute',
|
|
418
|
-
top: 0,
|
|
419
|
-
left: 0,
|
|
420
|
-
right: 0
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
//# sourceMappingURL=NativeStackView.js.map
|