react-native-screens 3.18.2 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -38
- package/android/build.gradle +1 -5
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +10 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +15 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +5 -0
- package/ios/RNSConvert.h +6 -0
- package/ios/RNSConvert.mm +26 -0
- package/ios/RNSEnums.h +6 -0
- package/ios/RNSFullWindowOverlay.mm +32 -0
- package/ios/RNSScreen.h +10 -2
- package/ios/RNSScreen.mm +133 -2
- package/ios/RNSScreenStackHeaderConfig.mm +17 -1
- package/lib/commonjs/TransitionProgressContext.js +2 -7
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/createNativeStackNavigator.js +29 -76
- package/lib/commonjs/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +0 -5
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +2 -10
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +2 -10
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +0 -7
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/index.js +21 -45
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js +43 -103
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/index.js +6 -11
- package/lib/commonjs/native-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +18 -25
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/native-stack/types.js +4 -0
- package/lib/commonjs/native-stack/types.js.map +1 -1
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +2 -6
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +11 -19
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js +0 -7
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +7 -18
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js +2 -10
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/FontProcessor.js +1 -6
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +46 -50
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +32 -58
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +11 -21
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js +3 -10
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +3 -19
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +2 -7
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/index.js +0 -3
- package/lib/commonjs/reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +2 -10
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/types.js +4 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js +2 -10
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/commonjs/utils.js +0 -4
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/TransitionProgressContext.js.map +1 -1
- package/lib/module/createNativeStackNavigator.js +29 -67
- package/lib/module/createNativeStackNavigator.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +0 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js +0 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +0 -1
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/index.js +13 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +45 -93
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/index.js +3 -2
- package/lib/module/native-stack/index.js.map +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +16 -16
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/native-stack/types.js +1 -1
- package/lib/module/native-stack/types.js.map +1 -1
- package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js +8 -7
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js +0 -4
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/useBackPressSubscription.js +7 -8
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/module/native-stack/utils/useHeaderHeight.js +0 -2
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/views/FontProcessor.js +0 -3
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +44 -39
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +32 -42
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +12 -9
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js +5 -4
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +3 -14
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js +2 -1
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/module/reanimated/index.js.map +1 -1
- package/lib/module/reanimated/useReanimatedTransitionProgress.js +0 -2
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/module/types.js +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useTransitionProgress.js +0 -2
- package/lib/module/useTransitionProgress.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -0
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +1 -0
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +1 -0
- package/package.json +9 -1
- package/src/createNativeStackNavigator.tsx +4 -2
- package/src/fabric/ScreenNativeComponent.js +7 -0
- package/src/index.native.tsx +32 -16
- package/src/index.tsx +13 -8
- package/src/native-stack/types.tsx +4 -5
- package/src/native-stack/views/HeaderConfig.tsx +8 -10
- package/src/native-stack/views/NativeStackView.tsx +8 -4
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +5 -3
- package/src/reanimated/ReanimatedScreen.tsx +1 -1
|
@@ -4,27 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _native = require("@react-navigation/native");
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _NativeStackView = _interopRequireDefault(require("../views/NativeStackView"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
screenOptions,
|
|
26
|
-
...rest
|
|
27
|
-
}) {
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
function NativeStackNavigator(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
initialRouteName,
|
|
17
|
+
children,
|
|
18
|
+
screenOptions,
|
|
19
|
+
...rest
|
|
20
|
+
} = _ref;
|
|
28
21
|
const {
|
|
29
22
|
state,
|
|
30
23
|
descriptors,
|
|
@@ -33,9 +26,10 @@ function NativeStackNavigator({
|
|
|
33
26
|
initialRouteName,
|
|
34
27
|
children,
|
|
35
28
|
screenOptions
|
|
36
|
-
});
|
|
37
|
-
// `@react-navigation/native-stack` rather than `react-native-screens/native-stack`
|
|
29
|
+
});
|
|
38
30
|
|
|
31
|
+
// Starting from React Navigation v6, `native-stack` should be imported from
|
|
32
|
+
// `@react-navigation/native-stack` rather than `react-native-screens/native-stack`
|
|
39
33
|
React.useEffect(() => {
|
|
40
34
|
// @ts-ignore navigation.dangerouslyGetParent was removed in v6
|
|
41
35
|
if ((navigation === null || navigation === void 0 ? void 0 : navigation.dangerouslyGetParent) === undefined) {
|
|
@@ -44,16 +38,17 @@ function NativeStackNavigator({
|
|
|
44
38
|
}, [navigation]);
|
|
45
39
|
React.useEffect(() => {
|
|
46
40
|
var _navigation$addListen;
|
|
47
|
-
|
|
48
41
|
return navigation === null || navigation === void 0 ? void 0 : (_navigation$addListen = navigation.addListener) === null || _navigation$addListen === void 0 ? void 0 : _navigation$addListen.call(navigation, 'tabPress', e => {
|
|
49
|
-
const isFocused = navigation.isFocused();
|
|
50
|
-
// This is necessary to know if preventDefault() has been called
|
|
42
|
+
const isFocused = navigation.isFocused();
|
|
51
43
|
|
|
44
|
+
// Run the operation in the next frame so we're sure all listeners have been run
|
|
45
|
+
// This is necessary to know if preventDefault() has been called
|
|
52
46
|
requestAnimationFrame(() => {
|
|
53
47
|
if (state.index > 0 && isFocused && !e.defaultPrevented) {
|
|
54
48
|
// When user taps on already focused tab and we're inside the tab,
|
|
55
49
|
// reset the stack to replicate native behaviour
|
|
56
|
-
navigation.dispatch({
|
|
50
|
+
navigation.dispatch({
|
|
51
|
+
..._native.StackActions.popToTop(),
|
|
57
52
|
target: state.key
|
|
58
53
|
});
|
|
59
54
|
}
|
|
@@ -66,8 +61,6 @@ function NativeStackNavigator({
|
|
|
66
61
|
descriptors: descriptors
|
|
67
62
|
}));
|
|
68
63
|
}
|
|
69
|
-
|
|
70
64
|
var _default = (0, _native.createNavigatorFactory)(NativeStackNavigator);
|
|
71
|
-
|
|
72
65
|
exports.default = _default;
|
|
73
66
|
//# sourceMappingURL=createNativeStackNavigator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["NativeStackNavigator","initialRouteName","children","screenOptions","rest","state","descriptors","navigation","useNavigationBuilder","StackRouter","React","useEffect","dangerouslyGetParent","undefined","console","warn","addListener","e","isFocused","requestAnimationFrame","index","defaultPrevented","dispatch","StackActions","popToTop","target","key","createNavigatorFactory"],"sources":["createNativeStackNavigator.tsx"],"sourcesContent":["import {\n createNavigatorFactory,\n EventArg,\n StackActions,\n StackActionHelpers,\n StackNavigationState,\n StackRouter,\n StackRouterOptions,\n ParamListBase,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n NativeStackNavigatorProps,\n} from '../types';\nimport NativeStackView from '../views/NativeStackView';\n\nfunction NativeStackNavigator({\n initialRouteName,\n children,\n screenOptions,\n ...rest\n}: NativeStackNavigatorProps) {\n const { state, descriptors, navigation } = useNavigationBuilder<\n StackNavigationState<ParamListBase>,\n StackRouterOptions,\n StackActionHelpers<ParamListBase>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap\n >(StackRouter, {\n initialRouteName,\n children,\n screenOptions,\n });\n\n // Starting from React Navigation v6, `native-stack` should be imported from\n // `@react-navigation/native-stack` rather than `react-native-screens/native-stack`\n React.useEffect(() => {\n // @ts-ignore navigation.dangerouslyGetParent was removed in v6\n if (navigation?.dangerouslyGetParent === undefined) {\n console.warn(\n 'Looks like you are importing `native-stack` from `react-native-screens/native-stack`. Since version 6 of `react-navigation`, it should be imported from `@react-navigation/native-stack`.'\n );\n }\n }, [navigation]);\n\n React.useEffect(\n () =>\n navigation?.addListener?.('tabPress', (e) => {\n const isFocused = navigation.isFocused();\n\n // Run the operation in the next frame so we're sure all listeners have been run\n // This is necessary to know if preventDefault() has been called\n requestAnimationFrame(() => {\n if (\n state.index > 0 &&\n isFocused &&\n !(e as EventArg<'tabPress', true>).defaultPrevented\n ) {\n // When user taps on already focused tab and we're inside the tab,\n // reset the stack to replicate native behaviour\n navigation.dispatch({\n ...StackActions.popToTop(),\n target: state.key,\n });\n }\n });\n }),\n [navigation, state.index, state.key]\n );\n\n return (\n <NativeStackView\n {...rest}\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n />\n );\n}\n\nexport default createNavigatorFactory<\n StackNavigationState<ParamListBase>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap,\n typeof NativeStackNavigator\n>(NativeStackNavigator);\n"],"mappings":";;;;;;AAAA;AAWA;AAMA;AAAuD;AAAA;AAAA;AAAA;AAEvD,SAASA,oBAAoB,OAKC;EAAA,IALA;IAC5BC,gBAAgB;IAChBC,QAAQ;IACRC,aAAa;IACb,GAAGC;EACsB,CAAC;EAC1B,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC;EAAW,CAAC,GAAG,IAAAC,4BAAoB,EAM7DC,mBAAW,EAAE;IACbR,gBAAgB;IAChBC,QAAQ;IACRC;EACF,CAAC,CAAC;;EAEF;EACA;EACAO,KAAK,CAACC,SAAS,CAAC,MAAM;IACpB;IACA,IAAI,CAAAJ,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEK,oBAAoB,MAAKC,SAAS,EAAE;MAClDC,OAAO,CAACC,IAAI,CACV,2LAA2L,CAC5L;IACH;EACF,CAAC,EAAE,CAACR,UAAU,CAAC,CAAC;EAEhBG,KAAK,CAACC,SAAS,CACb;IAAA;IAAA,OACEJ,UAAU,aAAVA,UAAU,gDAAVA,UAAU,CAAES,WAAW,0DAAvB,2BAAAT,UAAU,EAAgB,UAAU,EAAGU,CAAC,IAAK;MAC3C,MAAMC,SAAS,GAAGX,UAAU,CAACW,SAAS,EAAE;;MAExC;MACA;MACAC,qBAAqB,CAAC,MAAM;QAC1B,IACEd,KAAK,CAACe,KAAK,GAAG,CAAC,IACfF,SAAS,IACT,CAAED,CAAC,CAAgCI,gBAAgB,EACnD;UACA;UACA;UACAd,UAAU,CAACe,QAAQ,CAAC;YAClB,GAAGC,oBAAY,CAACC,QAAQ,EAAE;YAC1BC,MAAM,EAAEpB,KAAK,CAACqB;UAChB,CAAC,CAAC;QACJ;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EAAA,GACJ,CAACnB,UAAU,EAAEF,KAAK,CAACe,KAAK,EAAEf,KAAK,CAACqB,GAAG,CAAC,CACrC;EAED,oBACE,oBAAC,wBAAe,eACVtB,IAAI;IACR,KAAK,EAAEC,KAAM;IACb,UAAU,EAAEE,UAAW;IACvB,WAAW,EAAED;EAAY,GACzB;AAEN;AAAC,eAEc,IAAAqB,8BAAsB,EAKnC3B,oBAAoB,CAAC;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import {\n DefaultNavigatorOptions,\n Descriptor,\n NavigationHelpers,\n NavigationProp,\n ParamListBase,\n StackNavigationState,\n StackRouterOptions,\n StackActionHelpers,\n RouteProp,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';\nimport {\n ScreenProps,\n ScreenStackHeaderConfigProps,\n SearchBarProps,\n} from 'react-native-screens';\n\nexport type NativeStackNavigationEventMap = {\n /**\n * Event which fires when the screen appears.\n *\n * @deprecated Use `transitionEnd` event with `data.closing: false` instead.\n */\n appear: { data: undefined };\n /**\n * Event which fires when the current screen is dismissed by hardware back (on Android) or dismiss gesture (swipe back or down).\n */\n dismiss: { data: undefined };\n /**\n * Event which fires when a transition animation starts.\n */\n transitionStart: { data: { closing: boolean } };\n /**\n * Event which fires when a transition animation ends.\n */\n transitionEnd: { data: { closing: boolean } };\n};\n\nexport type NativeStackNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = string\n> = NavigationProp<\n ParamList,\n RouteName,\n StackNavigationState<ParamList>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap\n> &\n StackActionHelpers<ParamList>;\n\nexport type NativeStackScreenProps<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = string\n> = {\n navigation: NativeStackNavigationProp<ParamList, RouteName>;\n route: RouteProp<ParamList, RouteName>;\n};\n\nexport type NativeStackNavigationHelpers = NavigationHelpers<\n ParamListBase,\n NativeStackNavigationEventMap\n>;\n\n// We want it to be an empty object beacuse navigator does not have any additional config\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type NativeStackNavigationConfig = {};\n\nexport type NativeStackNavigationOptions = {\n /**\n * Image to display in the header as the back button.\n * Defaults to back icon image for the platform (a chevron on iOS and an arrow on Android).\n */\n backButtonImage?: ImageSourcePropType;\n /**\n * Whether to show the back button with custom left side of the header.\n */\n backButtonInCustomView?: boolean;\n /**\n * Style object for the scene content.\n */\n contentStyle?: StyleProp<ViewStyle>;\n /**\n * Boolean indicating that swipe dismissal should trigger animation provided by `stackAnimation`. Defaults to `false`.\n *\n * @platform ios\n */\n customAnimationOnSwipe?: boolean;\n /**\n * Whether the stack should be in rtl or ltr form.\n */\n direction?: 'rtl' | 'ltr';\n /**\n * Boolean indicating whether to show the menu on longPress of iOS >= 14 back button.\n * @platform ios\n */\n disableBackButtonMenu?: boolean;\n /**\n * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.\n * Defaults to `true` when `enableFreeze()` is run at the top of the application.\n */\n freezeOnBlur?: boolean;\n /**\n * Boolean indicating whether the swipe gesture should work on whole screen. Swiping with this option results in the same transition animation as `simple_push` by default.\n * It can be changed to other custom animations with `customAnimationOnSwipe` prop, but default iOS swipe animation is not achievable due to usage of custom recognizer.\n * Defaults to `false`.\n *\n * @platform ios\n */\n fullScreenSwipeEnabled?: boolean;\n /**\n * Whether you can use gestures to dismiss this screen. Defaults to `true`.\n * Only supported on iOS.\n *\n * @platform ios\n */\n gestureEnabled?: boolean;\n /**\n * Use it to restrict the distance from the edges of screen in which the gesture should be recognized. To be used alongside `fullScreenSwipeEnabled`.\n *\n * @platform ios\n */\n gestureResponseDistance?: ScreenProps['gestureResponseDistance'];\n /**\n * Title to display in the back button.\n * Only supported on iOS.\n *\n * @platform ios\n */\n headerBackTitle?: string;\n /**\n * Style object for header back title. Supported properties:\n * - fontFamily\n * - fontSize\n *\n * Only supported on iOS.\n *\n * @platform ios\n */\n headerBackTitleStyle?: {\n fontFamily?: string;\n fontSize?: number;\n };\n /**\n * Whether the back button title should be visible or not. Defaults to `true`.\n * Only supported on iOS.\n *\n * @platform ios\n */\n headerBackTitleVisible?: boolean;\n /**\n * Function which returns a React Element to display in the center of the header.\n */\n headerCenter?: (props: { tintColor?: string }) => React.ReactNode;\n /**\n * Boolean indicating whether to hide the back button in header.\n */\n headerHideBackButton?: boolean;\n /**\n * Boolean indicating whether to hide the elevation shadow or the bottom border on the header.\n */\n headerHideShadow?: boolean;\n /**\n * Controls the style of the navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar. Supported properties:\n * - backgroundColor\n *\n * @platform ios\n */\n headerLargeStyle?: {\n backgroundColor?: string;\n };\n /**\n * Boolean to set native property to prefer large title header (like in iOS setting).\n * For large title to collapse on scroll, the content of the screen should be wrapped in a scrollable view such as `ScrollView` or `FlatList`.\n * If the scrollable area doesn't fill the screen, the large title won't collapse on scroll.\n * Only supported on iOS.\n *\n * @platform ios\n */\n headerLargeTitle?: boolean;\n /**\n * Boolean that allows for disabling drop shadow under navigation header when the edge of any scrollable content reaches the matching edge of the navigation bar.\n */\n headerLargeTitleHideShadow?: boolean;\n /**\n * Style object for header large title. Supported properties:\n * - fontFamily\n * - fontSize\n * - color\n *\n * Only supported on iOS.\n *\n * @platform ios\n */\n headerLargeTitleStyle?: {\n fontFamily?: string;\n fontSize?: number;\n fontWeight?: string;\n color?: string;\n };\n /**\n * Function which returns a React Element to display on the left side of the header.\n */\n headerLeft?: (props: { tintColor?: string }) => React.ReactNode;\n /**\n * Function which returns a React Element to display on the right side of the header.\n */\n headerRight?: (props: { tintColor?: string }) => React.ReactNode;\n /**\n * Whether to show the header.\n */\n headerShown?: boolean;\n /**\n * Style object for header title. Supported properties:\n * - backgroundColor\n * - blurEffect\n */\n headerStyle?: {\n backgroundColor?: string;\n blurEffect?: ScreenStackHeaderConfigProps['blurEffect'];\n };\n /**\n * Tint color for the header. Changes the color of back button and title.\n */\n headerTintColor?: string;\n /**\n * String to display in the header as title. Defaults to scene `title`.\n */\n headerTitle?: string;\n /**\n * Style object for header title. Supported properties:\n * - fontFamily\n * - fontSize\n * - fontWeight\n * - color\n */\n headerTitleStyle?: {\n fontFamily?: string;\n fontSize?: number;\n fontWeight?: string;\n color?: string;\n };\n /**\n * A flag to that lets you opt out of insetting the header. You may want to\n * set this to `false` if you use an opaque status bar. Defaults to `true`.\n * Only supported on Android. Insets are always applied on iOS because the\n * header cannot be opaque.\n *\n * @platform android\n */\n headerTopInsetEnabled?: boolean;\n /**\n * Boolean indicating whether the navigation bar is translucent.\n */\n headerTranslucent?: boolean;\n /**\n * Whether the home indicator should be hidden on this screen. Defaults to `false`.\n *\n * @platform ios\n */\n homeIndicatorHidden?: boolean;\n /**\n * Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.\n *\n * @platform ios\n */\n hideKeyboardOnSwipe?: boolean;\n /**\n * Boolean indicating whether, when the Android default back button is clicked, the `pop` action should be performed on the native side or on the JS side to be able to prevent it.\n * Unfortunately the same behavior is not available on iOS since the behavior of native back button cannot be changed there.\n * Defaults to `false`.\n *\n * @platform android\n */\n nativeBackButtonDismissalEnabled?: boolean;\n /**\n * Sets the navigation bar color. Defaults to initial status bar color.\n *\n * @platform android\n */\n navigationBarColor?: string;\n /**\n * Sets the visibility of the navigation bar. Defaults to `false`.\n *\n * @platform android\n */\n navigationBarHidden?: boolean;\n /**\n * How should the screen replacing another screen animate. Defaults to `pop`.\n * The following values are currently supported:\n * - \"push\" – the new screen will perform push animation.\n * - \"pop\" – the new screen will perform pop animation.\n */\n replaceAnimation?: ScreenProps['replaceAnimation'];\n /**\n * In which orientation should the screen appear.\n * The following values are currently supported:\n * - \"default\" - resolves to \"all\" without \"portrait_down\" on iOS. On Android, this lets the system decide the best orientation.\n * - \"all\" – all orientations are permitted\n * - \"portrait\" – portrait orientations are permitted\n * - \"portrait_up\" – right-side portrait orientation is permitted\n * - \"portrait_down\" – upside-down portrait orientation is permitted\n * - \"landscape\" – landscape orientations are permitted\n * - \"landscape_left\" – landscape-left orientation is permitted\n * - \"landscape_right\" – landscape-right orientation is permitted\n */\n screenOrientation?: ScreenProps['screenOrientation'];\n /**\n * Object in which you should pass props in order to render native iOS searchBar.\n */\n searchBar?: SearchBarProps;\n /**\n * How the screen should appear/disappear when pushed or popped at the top of the stack.\n * The following values are currently supported:\n * - \"default\" – uses a platform default animation\n * - \"fade\" – fades screen in or out\n * - \"fade_from_bottom\" – performs a fade from bottom animation\n * - \"flip\" – flips the screen, requires stackPresentation: \"modal\" (iOS only)\n * - \"simple_push\" – performs a default animation, but without shadow and native header transition (iOS only)\n * - \"slide_from_bottom\" – performs a slide from bottom animation\n * - \"slide_from_right\" - slide in the new screen from right to left (Android only, resolves to default transition on iOS)\n * - \"slide_from_left\" - slide in the new screen from left to right (Android only, resolves to default transition on iOS)\n * - \"none\" – the screen appears/dissapears without an animation\n */\n stackAnimation?: ScreenProps['stackAnimation'];\n /**\n * How should the screen be presented.\n * The following values are currently supported:\n * - \"push\" – the new screen will be pushed onto a stack which on iOS means that the default animation will be slide from the side, the animation on Android may vary depending on the OS version and theme.\n * - \"modal\" – the new screen will be presented modally. In addition this allow for a nested stack to be rendered inside such screens.\n * - \"transparentModal\" – the new screen will be presented modally but in addition the second to last screen will remain attached to the stack container such that if the top screen is non opaque the content below can still be seen. If \"modal\" is used instead the below screen will get unmounted as soon as the transition ends.\n * - \"containedModal\" – will use \"UIModalPresentationCurrentContext\" modal style on iOS and will fallback to \"modal\" on Android.\n * - \"containedTransparentModal\" – will use \"UIModalPresentationOverCurrentContext\" modal style on iOS and will fallback to \"transparentModal\" on Android.\n * - \"fullScreenModal\" – will use \"UIModalPresentationFullScreen\" modal style on iOS and will fallback to \"modal\" on Android.\n * - \"formSheet\" – will use \"UIModalPresentationFormSheet\" modal style on iOS and will fallback to \"modal\" on Android.\n */\n stackPresentation?: ScreenProps['stackPresentation'];\n /**\n * Sets the status bar animation (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS.\n */\n statusBarAnimation?: ScreenProps['statusBarAnimation'];\n /**\n * Sets the status bar color (similar to the `StatusBar` component). Defaults to initial status bar color.\n *\n * @platform android\n */\n statusBarColor?: string;\n /**\n * Whether the status bar should be hidden on this screen. Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `false`.\n */\n statusBarHidden?: boolean;\n /**\n * Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `auto`.\n */\n statusBarStyle?: ScreenProps['statusBarStyle'];\n /**\n * Sets the translucency of the status bar. Defaults to `false`.\n *\n * @platform android\n */\n statusBarTranslucent?: boolean;\n /**\n * Sets the direction in which you should swipe to dismiss the screen.\n * When using `vertical` option, options `fullScreenSwipeEnabled: true`, `customAnimationOnSwipe: true` and `stackAnimation: 'slide_from_bottom'` are set by default.\n * The following values are supported:\n * - `vertical` – dismiss screen vertically\n * - `horizontal` – dismiss screen horizontally (default)\n * @platform ios\n */\n swipeDirection?: ScreenProps['swipeDirection'];\n /**\n * String that can be displayed in the header as a fallback for `headerTitle`.\n */\n title?: string;\n /**\n * Changes the duration (in milliseconds) of `slide_from_bottom`, `fade_from_bottom`, `fade` and `simple_push` transitions on iOS. Defaults to `350`.\n * The duration of `default` and `flip` transitions isn't customizable.\n *\n * @platform ios\n */\n transitionDuration?: number;\n};\n\nexport type NativeStackNavigatorProps =\n DefaultNavigatorOptions<NativeStackNavigationOptions> &\n StackRouterOptions &\n NativeStackNavigationConfig;\n\nexport type NativeStackDescriptor = Descriptor<\n ParamListBase,\n string,\n StackNavigationState<ParamListBase>,\n NativeStackNavigationOptions\n>;\n\nexport type NativeStackDescriptorMap = {\n [key: string]: NativeStackDescriptor;\n};\n"],"mappings":""}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
|
|
8
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
10
|
const HeaderHeightContext = /*#__PURE__*/React.createContext(undefined);
|
|
15
11
|
var _default = HeaderHeightContext;
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["HeaderHeightContext","React","createContext","undefined"],"sources":["HeaderHeightContext.tsx"],"sourcesContent":["import * as React from 'react';\n\nconst HeaderHeightContext = React.createContext<number | undefined>(undefined);\n\nexport default HeaderHeightContext;\n"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAE/B,MAAMA,mBAAmB,gBAAGC,KAAK,CAACC,aAAa,CAAqBC,SAAS,CAAC;AAAC,eAEhEH,mBAAmB;AAAA"}
|
|
@@ -4,27 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = SafeAreaProviderCompat;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
12
|
// code taken from
|
|
19
13
|
// https://github.com/react-navigation/react-navigation/blob/ec0d113eb25c39ef9defb6c7215640f44e3569ae/packages/elements/src/SafeAreaProviderCompat.tsx
|
|
14
|
+
|
|
20
15
|
const {
|
|
21
16
|
width = 0,
|
|
22
17
|
height = 0
|
|
23
|
-
} = _reactNative.Dimensions.get('window');
|
|
18
|
+
} = _reactNative.Dimensions.get('window');
|
|
19
|
+
|
|
20
|
+
// To support SSR on web, we need to have empty insets for initial values
|
|
24
21
|
// Otherwise there can be mismatch between SSR and client output
|
|
25
22
|
// We also need to specify empty values to support tests environments
|
|
26
|
-
|
|
27
|
-
|
|
28
23
|
const initialMetrics = _reactNative.Platform.OS === 'web' || _reactNativeSafeAreaContext.initialWindowMetrics == null ? {
|
|
29
24
|
frame: {
|
|
30
25
|
x: 0,
|
|
@@ -39,11 +34,11 @@ const initialMetrics = _reactNative.Platform.OS === 'web' || _reactNativeSafeAre
|
|
|
39
34
|
bottom: 0
|
|
40
35
|
}
|
|
41
36
|
} : _reactNativeSafeAreaContext.initialWindowMetrics;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
37
|
+
function SafeAreaProviderCompat(_ref) {
|
|
38
|
+
let {
|
|
39
|
+
children,
|
|
40
|
+
style
|
|
41
|
+
} = _ref;
|
|
47
42
|
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaInsetsContext.Consumer, null, insets => {
|
|
48
43
|
if (insets) {
|
|
49
44
|
// If we already have insets, don't wrap the stack in another safe area provider
|
|
@@ -53,16 +48,13 @@ function SafeAreaProviderCompat({
|
|
|
53
48
|
style: [styles.container, style]
|
|
54
49
|
}, children);
|
|
55
50
|
}
|
|
56
|
-
|
|
57
51
|
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaProvider, {
|
|
58
52
|
initialMetrics: initialMetrics,
|
|
59
53
|
style: style
|
|
60
54
|
}, children);
|
|
61
55
|
});
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
SafeAreaProviderCompat.initialMetrics = initialMetrics;
|
|
65
|
-
|
|
66
58
|
const styles = _reactNative.StyleSheet.create({
|
|
67
59
|
container: {
|
|
68
60
|
flex: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["width","height","Dimensions","get","initialMetrics","Platform","OS","initialWindowMetrics","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","styles","container","StyleSheet","create","flex"],"sources":["SafeAreaProviderCompat.tsx"],"sourcesContent":["// code taken from\n// https://github.com/react-navigation/react-navigation/blob/ec0d113eb25c39ef9defb6c7215640f44e3569ae/packages/elements/src/SafeAreaProviderCompat.tsx\nimport * as React from 'react';\nimport {\n Dimensions,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\nimport {\n initialWindowMetrics,\n SafeAreaInsetsContext,\n SafeAreaProvider,\n} from 'react-native-safe-area-context';\n\ntype Props = {\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst { width = 0, height = 0 } = Dimensions.get('window');\n\n// To support SSR on web, we need to have empty insets for initial values\n// Otherwise there can be mismatch between SSR and client output\n// We also need to specify empty values to support tests environments\nconst initialMetrics =\n Platform.OS === 'web' || initialWindowMetrics == null\n ? {\n frame: { x: 0, y: 0, width, height },\n insets: { top: 0, left: 0, right: 0, bottom: 0 },\n }\n : initialWindowMetrics;\n\nexport default function SafeAreaProviderCompat({ children, style }: Props) {\n return (\n <SafeAreaInsetsContext.Consumer>\n {(insets) => {\n if (insets) {\n // If we already have insets, don't wrap the stack in another safe area provider\n // This avoids an issue with updates at the cost of potentially incorrect values\n // https://github.com/react-navigation/react-navigation/issues/174\n return <View style={[styles.container, style]}>{children}</View>;\n }\n\n return (\n <SafeAreaProvider initialMetrics={initialMetrics} style={style}>\n {children}\n </SafeAreaProvider>\n );\n }}\n </SafeAreaInsetsContext.Consumer>\n );\n}\n\nSafeAreaProviderCompat.initialMetrics = initialMetrics;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"],"mappings":";;;;;;AAEA;AACA;AAQA;AAIwC;AAAA;AAfxC;AACA;;AAqBA,MAAM;EAAEA,KAAK,GAAG,CAAC;EAAEC,MAAM,GAAG;AAAE,CAAC,GAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC;;AAE1D;AACA;AACA;AACA,MAAMC,cAAc,GAClBC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAIC,gDAAoB,IAAI,IAAI,GACjD;EACEC,KAAK,EAAE;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEV,KAAK;IAAEC;EAAO,CAAC;EACpCU,MAAM,EAAE;IAAEC,GAAG,EAAE,CAAC;IAAEC,IAAI,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE;AACjD,CAAC,GACDR,gDAAoB;AAEX,SAASS,sBAAsB,OAA6B;EAAA,IAA5B;IAAEC,QAAQ;IAAEC;EAAa,CAAC;EACvE,oBACE,oBAAC,iDAAqB,CAAC,QAAQ,QAC3BP,MAAM,IAAK;IACX,IAAIA,MAAM,EAAE;MACV;MACA;MACA;MACA,oBAAO,oBAAC,iBAAI;QAAC,KAAK,EAAE,CAACQ,MAAM,CAACC,SAAS,EAAEF,KAAK;MAAE,GAAED,QAAQ,CAAQ;IAClE;IAEA,oBACE,oBAAC,4CAAgB;MAAC,cAAc,EAAEb,cAAe;MAAC,KAAK,EAAEc;IAAM,GAC5DD,QAAQ,CACQ;EAEvB,CAAC,CAC8B;AAErC;AAEAD,sBAAsB,CAACZ,cAAc,GAAGA,cAAc;AAEtD,MAAMe,MAAM,GAAGE,uBAAU,CAACC,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getDefaultHeaderHeight;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
const formSheetModalHeight = 56;
|
|
11
|
-
|
|
12
9
|
function getDefaultHeaderHeight(layout, topInset, stackPresentation) {
|
|
13
10
|
// default header heights
|
|
14
11
|
let headerHeight = _reactNative.Platform.OS === 'android' ? 56 : 64;
|
|
15
12
|
let statusBarHeight = topInset;
|
|
16
|
-
|
|
17
13
|
if (_reactNative.Platform.OS === 'ios') {
|
|
18
14
|
const isLandscape = layout.width > layout.height;
|
|
19
15
|
const isFromSheetModal = stackPresentation === 'modal' || stackPresentation === 'formSheet';
|
|
20
|
-
|
|
21
16
|
if (isFromSheetModal && !isLandscape) {
|
|
22
17
|
// `modal` and `formSheet` presentations do not take whole screen, so should not take the inset.
|
|
23
18
|
statusBarHeight = 0;
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
if (_reactNative.Platform.isPad || _reactNative.Platform.isTV) {
|
|
27
21
|
headerHeight = isFromSheetModal ? formSheetModalHeight : 50;
|
|
28
22
|
} else {
|
|
@@ -33,7 +27,6 @@ function getDefaultHeaderHeight(layout, topInset, stackPresentation) {
|
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
29
|
}
|
|
36
|
-
|
|
37
30
|
return headerHeight + statusBarHeight;
|
|
38
31
|
}
|
|
39
32
|
//# sourceMappingURL=getDefaultHeaderHeight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["formSheetModalHeight","getDefaultHeaderHeight","layout","topInset","stackPresentation","headerHeight","Platform","OS","statusBarHeight","isLandscape","width","height","isFromSheetModal","isPad","isTV"],"sources":["getDefaultHeaderHeight.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport { StackPresentationTypes } from 'react-native-screens';\ntype Layout = { width: number; height: number };\n\nconst formSheetModalHeight = 56;\n\nexport default function getDefaultHeaderHeight(\n layout: Layout,\n topInset: number,\n stackPresentation: StackPresentationTypes\n): number {\n // default header heights\n let headerHeight = Platform.OS === 'android' ? 56 : 64;\n let statusBarHeight = topInset;\n\n if (Platform.OS === 'ios') {\n const isLandscape = layout.width > layout.height;\n const isFromSheetModal =\n stackPresentation === 'modal' || stackPresentation === 'formSheet';\n if (isFromSheetModal && !isLandscape) {\n // `modal` and `formSheet` presentations do not take whole screen, so should not take the inset.\n statusBarHeight = 0;\n }\n\n if (Platform.isPad || Platform.isTV) {\n headerHeight = isFromSheetModal ? formSheetModalHeight : 50;\n } else {\n if (isLandscape) {\n headerHeight = 32;\n } else {\n headerHeight = isFromSheetModal ? formSheetModalHeight : 44;\n }\n }\n }\n\n return headerHeight + statusBarHeight;\n}\n"],"mappings":";;;;;;AAAA;AAIA,MAAMA,oBAAoB,GAAG,EAAE;AAEhB,SAASC,sBAAsB,CAC5CC,MAAc,EACdC,QAAgB,EAChBC,iBAAyC,EACjC;EACR;EACA,IAAIC,YAAY,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE;EACtD,IAAIC,eAAe,GAAGL,QAAQ;EAE9B,IAAIG,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,MAAME,WAAW,GAAGP,MAAM,CAACQ,KAAK,GAAGR,MAAM,CAACS,MAAM;IAChD,MAAMC,gBAAgB,GACpBR,iBAAiB,KAAK,OAAO,IAAIA,iBAAiB,KAAK,WAAW;IACpE,IAAIQ,gBAAgB,IAAI,CAACH,WAAW,EAAE;MACpC;MACAD,eAAe,GAAG,CAAC;IACrB;IAEA,IAAIF,qBAAQ,CAACO,KAAK,IAAIP,qBAAQ,CAACQ,IAAI,EAAE;MACnCT,YAAY,GAAGO,gBAAgB,GAAGZ,oBAAoB,GAAG,EAAE;IAC7D,CAAC,MAAM;MACL,IAAIS,WAAW,EAAE;QACfJ,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACLA,YAAY,GAAGO,gBAAgB,GAAGZ,oBAAoB,GAAG,EAAE;MAC7D;IACF;EACF;EAEA,OAAOK,YAAY,GAAGG,eAAe;AACvC"}
|
|
@@ -4,59 +4,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useBackPressSubscription = useBackPressSubscription;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* This hook is an abstraction for keeping back press subscription
|
|
16
12
|
* logic in one place.
|
|
17
13
|
*/
|
|
18
|
-
function useBackPressSubscription({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
function useBackPressSubscription(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
onBackPress,
|
|
17
|
+
isDisabled
|
|
18
|
+
} = _ref;
|
|
22
19
|
const [isActive, setIsActive] = _react.default.useState(false);
|
|
23
|
-
|
|
24
20
|
const subscription = _react.default.useRef();
|
|
25
|
-
|
|
26
|
-
const clearSubscription = _react.default.useCallback((shouldSetActive = true) => {
|
|
21
|
+
const clearSubscription = _react.default.useCallback(function () {
|
|
27
22
|
var _subscription$current;
|
|
28
|
-
|
|
23
|
+
let shouldSetActive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
29
24
|
(_subscription$current = subscription.current) === null || _subscription$current === void 0 ? void 0 : _subscription$current.remove();
|
|
30
25
|
subscription.current = undefined;
|
|
31
26
|
if (shouldSetActive) setIsActive(false);
|
|
32
27
|
}, []);
|
|
33
|
-
|
|
34
28
|
const createSubscription = _react.default.useCallback(() => {
|
|
35
29
|
if (!isDisabled) {
|
|
36
30
|
var _subscription$current2;
|
|
37
|
-
|
|
38
31
|
(_subscription$current2 = subscription.current) === null || _subscription$current2 === void 0 ? void 0 : _subscription$current2.remove();
|
|
39
32
|
subscription.current = _reactNative.BackHandler.addEventListener('hardwareBackPress', onBackPress);
|
|
40
33
|
setIsActive(true);
|
|
41
34
|
}
|
|
42
35
|
}, [isDisabled, onBackPress]);
|
|
43
|
-
|
|
44
36
|
const handleAttached = _react.default.useCallback(() => {
|
|
45
37
|
if (isActive) {
|
|
46
38
|
createSubscription();
|
|
47
39
|
}
|
|
48
40
|
}, [createSubscription, isActive]);
|
|
49
|
-
|
|
50
41
|
const handleDetached = _react.default.useCallback(() => {
|
|
51
42
|
clearSubscription(false);
|
|
52
43
|
}, [clearSubscription]);
|
|
53
|
-
|
|
54
44
|
_react.default.useEffect(() => {
|
|
55
45
|
if (isDisabled) {
|
|
56
46
|
clearSubscription();
|
|
57
47
|
}
|
|
58
48
|
}, [isDisabled, clearSubscription]);
|
|
59
|
-
|
|
60
49
|
return {
|
|
61
50
|
handleAttached,
|
|
62
51
|
handleDetached,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useBackPressSubscription","onBackPress","isDisabled","isActive","setIsActive","React","useState","subscription","useRef","clearSubscription","useCallback","shouldSetActive","current","remove","undefined","createSubscription","BackHandler","addEventListener","handleAttached","handleDetached","useEffect"],"sources":["useBackPressSubscription.tsx"],"sourcesContent":["import React from 'react';\nimport { BackHandler, NativeEventSubscription } from 'react-native';\n\ninterface Args {\n onBackPress: () => boolean;\n isDisabled: boolean;\n}\n\ninterface UseBackPressSubscription {\n handleAttached: () => void;\n handleDetached: () => void;\n createSubscription: () => void;\n clearSubscription: () => void;\n}\n\n/**\n * This hook is an abstraction for keeping back press subscription\n * logic in one place.\n */\nexport function useBackPressSubscription({\n onBackPress,\n isDisabled,\n}: Args): UseBackPressSubscription {\n const [isActive, setIsActive] = React.useState(false);\n const subscription = React.useRef<NativeEventSubscription | undefined>();\n\n const clearSubscription = React.useCallback((shouldSetActive = true) => {\n subscription.current?.remove();\n subscription.current = undefined;\n if (shouldSetActive) setIsActive(false);\n }, []);\n\n const createSubscription = React.useCallback(() => {\n if (!isDisabled) {\n subscription.current?.remove();\n subscription.current = BackHandler.addEventListener(\n 'hardwareBackPress',\n onBackPress\n );\n setIsActive(true);\n }\n }, [isDisabled, onBackPress]);\n\n const handleAttached = React.useCallback(() => {\n if (isActive) {\n createSubscription();\n }\n }, [createSubscription, isActive]);\n\n const handleDetached = React.useCallback(() => {\n clearSubscription(false);\n }, [clearSubscription]);\n\n React.useEffect(() => {\n if (isDisabled) {\n clearSubscription();\n }\n }, [isDisabled, clearSubscription]);\n\n return {\n handleAttached,\n handleDetached,\n createSubscription,\n clearSubscription,\n };\n}\n"],"mappings":";;;;;;AAAA;AACA;AAAoE;AAcpE;AACA;AACA;AACA;AACO,SAASA,wBAAwB,OAGL;EAAA,IAHM;IACvCC,WAAW;IACXC;EACI,CAAC;EACL,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;EACrD,MAAMC,YAAY,GAAGF,cAAK,CAACG,MAAM,EAAuC;EAExE,MAAMC,iBAAiB,GAAGJ,cAAK,CAACK,WAAW,CAAC,YAA4B;IAAA;IAAA,IAA3BC,eAAe,uEAAG,IAAI;IACjE,yBAAAJ,YAAY,CAACK,OAAO,0DAApB,sBAAsBC,MAAM,EAAE;IAC9BN,YAAY,CAACK,OAAO,GAAGE,SAAS;IAChC,IAAIH,eAAe,EAAEP,WAAW,CAAC,KAAK,CAAC;EACzC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMW,kBAAkB,GAAGV,cAAK,CAACK,WAAW,CAAC,MAAM;IACjD,IAAI,CAACR,UAAU,EAAE;MAAA;MACf,0BAAAK,YAAY,CAACK,OAAO,2DAApB,uBAAsBC,MAAM,EAAE;MAC9BN,YAAY,CAACK,OAAO,GAAGI,wBAAW,CAACC,gBAAgB,CACjD,mBAAmB,EACnBhB,WAAW,CACZ;MACDG,WAAW,CAAC,IAAI,CAAC;IACnB;EACF,CAAC,EAAE,CAACF,UAAU,EAAED,WAAW,CAAC,CAAC;EAE7B,MAAMiB,cAAc,GAAGb,cAAK,CAACK,WAAW,CAAC,MAAM;IAC7C,IAAIP,QAAQ,EAAE;MACZY,kBAAkB,EAAE;IACtB;EACF,CAAC,EAAE,CAACA,kBAAkB,EAAEZ,QAAQ,CAAC,CAAC;EAElC,MAAMgB,cAAc,GAAGd,cAAK,CAACK,WAAW,CAAC,MAAM;IAC7CD,iBAAiB,CAAC,KAAK,CAAC;EAC1B,CAAC,EAAE,CAACA,iBAAiB,CAAC,CAAC;EAEvBJ,cAAK,CAACe,SAAS,CAAC,MAAM;IACpB,IAAIlB,UAAU,EAAE;MACdO,iBAAiB,EAAE;IACrB;EACF,CAAC,EAAE,CAACP,UAAU,EAAEO,iBAAiB,CAAC,CAAC;EAEnC,OAAO;IACLS,cAAc;IACdC,cAAc;IACdJ,kBAAkB;IAClBN;EACF,CAAC;AACH"}
|
|
@@ -4,24 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useHeaderHeight;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _HeaderHeightContext = _interopRequireDefault(require("./HeaderHeightContext"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
12
|
function useHeaderHeight() {
|
|
19
13
|
const height = React.useContext(_HeaderHeightContext.default);
|
|
20
|
-
|
|
21
14
|
if (height === undefined) {
|
|
22
15
|
throw new Error("Couldn't find the header height. Are you inside a screen in a navigator with a header?");
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
return height;
|
|
26
18
|
}
|
|
27
19
|
//# sourceMappingURL=useHeaderHeight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useHeaderHeight","height","React","useContext","HeaderHeightContext","undefined","Error"],"sources":["useHeaderHeight.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport HeaderHeightContext from './HeaderHeightContext';\n\nexport default function useHeaderHeight() {\n const height = React.useContext(HeaderHeightContext);\n\n if (height === undefined) {\n throw new Error(\n \"Couldn't find the header height. Are you inside a screen in a navigator with a header?\"\n );\n }\n\n return height;\n}\n"],"mappings":";;;;;;AAAA;AAEA;AAAwD;AAAA;AAAA;AAEzC,SAASA,eAAe,GAAG;EACxC,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAU,CAACC,4BAAmB,CAAC;EAEpD,IAAIH,MAAM,KAAKI,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,wFAAwF,CACzF;EACH;EAEA,OAAOL,MAAM;AACf"}
|
|
@@ -4,22 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.processFonts = processFonts;
|
|
7
|
-
|
|
8
7
|
var _ReactNativeStyleAttributes = _interopRequireDefault(require("react-native/Libraries/Components/View/ReactNativeStyleAttributes"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
// @ts-ignore: No declaration available
|
|
10
|
+
|
|
13
11
|
function processFonts(fontFamilies) {
|
|
14
12
|
var _ReactNativeStyleAttr;
|
|
15
|
-
|
|
16
13
|
// @ts-ignore: React Native types are incorrect here and don't consider fontFamily a style value
|
|
17
14
|
const fontFamilyProcessor = (_ReactNativeStyleAttr = _ReactNativeStyleAttributes.default.fontFamily) === null || _ReactNativeStyleAttr === void 0 ? void 0 : _ReactNativeStyleAttr.process;
|
|
18
|
-
|
|
19
15
|
if (typeof fontFamilyProcessor === 'function') {
|
|
20
16
|
return fontFamilies.map(fontFamilyProcessor);
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
return fontFamilies;
|
|
24
19
|
}
|
|
25
20
|
//# sourceMappingURL=FontProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["processFonts","fontFamilies","fontFamilyProcessor","ReactNativeStyleAttributes","fontFamily","process","map"],"sources":["FontProcessor.tsx"],"sourcesContent":["// @ts-ignore: No declaration available\nimport ReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';\n\nexport function processFonts(\n fontFamilies: (string | undefined)[]\n): (string | undefined)[] {\n // @ts-ignore: React Native types are incorrect here and don't consider fontFamily a style value\n const fontFamilyProcessor = ReactNativeStyleAttributes.fontFamily?.process;\n if (typeof fontFamilyProcessor === 'function') {\n return fontFamilies.map(fontFamilyProcessor);\n }\n return fontFamilies;\n}\n"],"mappings":";;;;;;AACA;AAA2G;AAD3G;;AAGO,SAASA,YAAY,CAC1BC,YAAoC,EACZ;EAAA;EACxB;EACA,MAAMC,mBAAmB,4BAAGC,mCAA0B,CAACC,UAAU,0DAArC,sBAAuCC,OAAO;EAC1E,IAAI,OAAOH,mBAAmB,KAAK,UAAU,EAAE;IAC7C,OAAOD,YAAY,CAACK,GAAG,CAACJ,mBAAmB,CAAC;EAC9C;EACA,OAAOD,YAAY;AACrB"}
|
|
@@ -4,58 +4,51 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = HeaderConfig;
|
|
7
|
-
|
|
8
7
|
var _native = require("@react-navigation/native");
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _reactNative = require("react-native");
|
|
13
|
-
|
|
14
10
|
var _reactNativeScreens = require("react-native-screens");
|
|
15
|
-
|
|
16
11
|
var _useBackPressSubscription = require("../utils/useBackPressSubscription");
|
|
17
|
-
|
|
18
12
|
var _FontProcessor = require("./FontProcessor");
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
title
|
|
51
|
-
}) {
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
function HeaderConfig(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
backButtonImage,
|
|
18
|
+
backButtonInCustomView,
|
|
19
|
+
direction,
|
|
20
|
+
disableBackButtonMenu,
|
|
21
|
+
headerBackTitle,
|
|
22
|
+
headerBackTitleStyle = {},
|
|
23
|
+
headerBackTitleVisible = true,
|
|
24
|
+
headerCenter,
|
|
25
|
+
headerHideBackButton,
|
|
26
|
+
headerHideShadow,
|
|
27
|
+
headerLargeStyle = {},
|
|
28
|
+
headerLargeTitle,
|
|
29
|
+
headerLargeTitleHideShadow,
|
|
30
|
+
headerLargeTitleStyle = {},
|
|
31
|
+
headerLeft,
|
|
32
|
+
headerRight,
|
|
33
|
+
headerShown,
|
|
34
|
+
headerStyle = {},
|
|
35
|
+
headerTintColor,
|
|
36
|
+
headerTitle,
|
|
37
|
+
headerTitleStyle = {},
|
|
38
|
+
headerTopInsetEnabled = true,
|
|
39
|
+
headerTranslucent,
|
|
40
|
+
route,
|
|
41
|
+
searchBar,
|
|
42
|
+
title
|
|
43
|
+
} = _ref;
|
|
52
44
|
const {
|
|
53
45
|
colors
|
|
54
46
|
} = (0, _native.useTheme)();
|
|
55
|
-
const tintColor = headerTintColor !== null && headerTintColor !== void 0 ? headerTintColor : colors.primary;
|
|
47
|
+
const tintColor = headerTintColor !== null && headerTintColor !== void 0 ? headerTintColor : colors.primary;
|
|
48
|
+
|
|
49
|
+
// We need to use back press subscription here to override back button behavior on JS side.
|
|
56
50
|
// Because screens are usually used with react-navigation and this library overrides back button
|
|
57
51
|
// we need to handle it first in case when search bar is open
|
|
58
|
-
|
|
59
52
|
const {
|
|
60
53
|
handleAttached,
|
|
61
54
|
handleDetached,
|
|
@@ -65,31 +58,34 @@ function HeaderConfig({
|
|
|
65
58
|
onBackPress: _reactNativeScreens.executeNativeBackPress,
|
|
66
59
|
isDisabled: !searchBar || !!searchBar.disableBackButtonOverride
|
|
67
60
|
});
|
|
68
|
-
const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = (0, _FontProcessor.processFonts)([headerBackTitleStyle.fontFamily, headerLargeTitleStyle.fontFamily, headerTitleStyle.fontFamily]);
|
|
61
|
+
const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = (0, _FontProcessor.processFonts)([headerBackTitleStyle.fontFamily, headerLargeTitleStyle.fontFamily, headerTitleStyle.fontFamily]);
|
|
69
62
|
|
|
63
|
+
// We want to clear clearSubscription only when components unmounts or search bar changes
|
|
70
64
|
React.useEffect(() => clearSubscription, [searchBar]);
|
|
71
65
|
const processedSearchBarOptions = React.useMemo(() => {
|
|
72
66
|
if (_reactNative.Platform.OS === 'android' && searchBar && !searchBar.disableBackButtonOverride) {
|
|
73
|
-
const onFocus = (
|
|
67
|
+
const onFocus = function () {
|
|
74
68
|
var _searchBar$onFocus;
|
|
75
|
-
|
|
76
69
|
createSubscription();
|
|
70
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
71
|
+
args[_key] = arguments[_key];
|
|
72
|
+
}
|
|
77
73
|
(_searchBar$onFocus = searchBar.onFocus) === null || _searchBar$onFocus === void 0 ? void 0 : _searchBar$onFocus.call(searchBar, ...args);
|
|
78
74
|
};
|
|
79
|
-
|
|
80
|
-
const onClose = (...args) => {
|
|
75
|
+
const onClose = function () {
|
|
81
76
|
var _searchBar$onClose;
|
|
82
|
-
|
|
83
77
|
clearSubscription();
|
|
78
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
79
|
+
args[_key2] = arguments[_key2];
|
|
80
|
+
}
|
|
84
81
|
(_searchBar$onClose = searchBar.onClose) === null || _searchBar$onClose === void 0 ? void 0 : _searchBar$onClose.call(searchBar, ...args);
|
|
85
82
|
};
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
return {
|
|
84
|
+
...searchBar,
|
|
88
85
|
onFocus,
|
|
89
86
|
onClose
|
|
90
87
|
};
|
|
91
88
|
}
|
|
92
|
-
|
|
93
89
|
return searchBar;
|
|
94
90
|
}, [searchBar, createSubscription, clearSubscription]);
|
|
95
91
|
return /*#__PURE__*/React.createElement(_reactNativeScreens.ScreenStackHeaderConfig, {
|