@react-navigation/native-stack 7.0.0-rc.8 → 7.0.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.
Files changed (173) hide show
  1. package/lib/commonjs/{index.cjs → index.js} +4 -4
  2. package/lib/commonjs/navigators/{createNativeStackNavigator.cjs → createNativeStackNavigator.js} +5 -3
  3. package/lib/commonjs/navigators/createNativeStackNavigator.js.map +1 -0
  4. package/lib/commonjs/package.json +1 -0
  5. package/lib/commonjs/{types.cjs → types.js} +1 -1
  6. package/lib/commonjs/utils/{debounce.cjs → debounce.js} +1 -1
  7. package/lib/commonjs/utils/{debounce.cjs.map → debounce.js.map} +1 -1
  8. package/lib/commonjs/utils/{getModalRoutesKeys.cjs → getModalRoutesKeys.js} +1 -1
  9. package/lib/commonjs/utils/{useAnimatedHeaderHeight.cjs → useAnimatedHeaderHeight.js} +1 -1
  10. package/lib/commonjs/utils/{useDismissedRouteError.cjs → useDismissedRouteError.js} +1 -1
  11. package/lib/commonjs/utils/{useInvalidPreventRemoveError.cjs → useInvalidPreventRemoveError.js} +1 -1
  12. package/lib/commonjs/views/{FontProcessor.cjs → FontProcessor.js} +1 -1
  13. package/lib/commonjs/views/{FontProcessor.native.cjs → FontProcessor.native.js} +1 -1
  14. package/lib/commonjs/views/FooterComponent.js +19 -0
  15. package/lib/commonjs/views/FooterComponent.js.map +1 -0
  16. package/lib/commonjs/views/{NativeStackView.cjs → NativeStackView.js} +46 -50
  17. package/lib/commonjs/views/NativeStackView.js.map +1 -0
  18. package/lib/commonjs/views/{NativeStackView.native.cjs → NativeStackView.native.js} +132 -145
  19. package/lib/commonjs/views/NativeStackView.native.js.map +1 -0
  20. package/lib/commonjs/views/{HeaderConfig.cjs → useHeaderConfigProps.js} +70 -49
  21. package/lib/commonjs/views/useHeaderConfigProps.js.map +1 -0
  22. package/lib/module/{index.mjs → index.js} +6 -4
  23. package/lib/module/index.js.map +1 -0
  24. package/lib/module/navigators/{createNativeStackNavigator.mjs → createNativeStackNavigator.js} +7 -3
  25. package/lib/module/navigators/createNativeStackNavigator.js.map +1 -0
  26. package/lib/module/package.json +1 -0
  27. package/lib/module/types.js +4 -0
  28. package/lib/module/utils/{debounce.mjs → debounce.js} +3 -1
  29. package/lib/module/utils/debounce.js.map +1 -0
  30. package/lib/module/utils/{getModalRoutesKeys.mjs → getModalRoutesKeys.js} +3 -1
  31. package/lib/module/utils/getModalRoutesKeys.js.map +1 -0
  32. package/lib/module/utils/{useAnimatedHeaderHeight.mjs → useAnimatedHeaderHeight.js} +3 -1
  33. package/lib/module/utils/useAnimatedHeaderHeight.js.map +1 -0
  34. package/lib/module/utils/{useDismissedRouteError.mjs → useDismissedRouteError.js} +3 -1
  35. package/lib/module/utils/useDismissedRouteError.js.map +1 -0
  36. package/lib/module/utils/{useInvalidPreventRemoveError.mjs → useInvalidPreventRemoveError.js} +3 -1
  37. package/lib/module/utils/useInvalidPreventRemoveError.js.map +1 -0
  38. package/lib/module/views/{FontProcessor.mjs → FontProcessor.js} +3 -1
  39. package/lib/module/views/{FontProcessor.mjs.map → FontProcessor.js.map} +1 -1
  40. package/lib/module/views/{FontProcessor.native.mjs → FontProcessor.native.js} +3 -1
  41. package/lib/module/views/FontProcessor.native.js.map +1 -0
  42. package/lib/module/views/FooterComponent.js +14 -0
  43. package/lib/module/views/FooterComponent.js.map +1 -0
  44. package/lib/module/views/{NativeStackView.mjs → NativeStackView.js} +50 -52
  45. package/lib/module/views/NativeStackView.js.map +1 -0
  46. package/lib/module/views/{NativeStackView.native.mjs → NativeStackView.native.js} +135 -145
  47. package/lib/module/views/NativeStackView.native.js.map +1 -0
  48. package/lib/module/views/{HeaderConfig.mjs → useHeaderConfigProps.js} +72 -49
  49. package/lib/module/views/useHeaderConfigProps.js.map +1 -0
  50. package/lib/typescript/commonjs/package.json +1 -0
  51. package/lib/typescript/{src → commonjs/src}/index.d.ts +1 -1
  52. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  53. package/lib/typescript/{src → commonjs/src}/navigators/createNativeStackNavigator.d.ts +2 -2
  54. package/lib/typescript/commonjs/src/navigators/createNativeStackNavigator.d.ts.map +1 -0
  55. package/lib/typescript/{src → commonjs/src}/types.d.ts +113 -35
  56. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  57. package/lib/typescript/commonjs/src/utils/debounce.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/utils/getModalRoutesKeys.d.ts.map +1 -0
  59. package/lib/typescript/commonjs/src/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/utils/useDismissedRouteError.d.ts.map +1 -0
  61. package/lib/typescript/commonjs/src/utils/useInvalidPreventRemoveError.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/views/FontProcessor.d.ts.map +1 -0
  63. package/lib/typescript/commonjs/src/views/FontProcessor.native.d.ts.map +1 -0
  64. package/lib/typescript/commonjs/src/views/FooterComponent.d.ts +7 -0
  65. package/lib/typescript/commonjs/src/views/FooterComponent.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/src/views/NativeStackView.d.ts +11 -0
  67. package/lib/typescript/commonjs/src/views/NativeStackView.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/src/views/NativeStackView.native.d.ts +11 -0
  69. package/lib/typescript/commonjs/src/views/NativeStackView.native.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/src/views/useHeaderConfigProps.d.ts +41 -0
  71. package/lib/typescript/commonjs/src/views/useHeaderConfigProps.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -0
  73. package/lib/typescript/module/package.json +1 -0
  74. package/lib/typescript/module/src/index.d.ts +17 -0
  75. package/lib/typescript/module/src/index.d.ts.map +1 -0
  76. package/lib/typescript/module/src/navigators/createNativeStackNavigator.d.ts +16 -0
  77. package/lib/typescript/module/src/navigators/createNativeStackNavigator.d.ts.map +1 -0
  78. package/lib/typescript/module/src/types.d.ts +623 -0
  79. package/lib/typescript/module/src/types.d.ts.map +1 -0
  80. package/lib/typescript/module/src/utils/debounce.d.ts +2 -0
  81. package/lib/typescript/module/src/utils/debounce.d.ts.map +1 -0
  82. package/lib/typescript/module/src/utils/getModalRoutesKeys.d.ts +4 -0
  83. package/lib/typescript/module/src/utils/getModalRoutesKeys.d.ts.map +1 -0
  84. package/lib/typescript/module/src/utils/useAnimatedHeaderHeight.d.ts +5 -0
  85. package/lib/typescript/module/src/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
  86. package/lib/typescript/module/src/utils/useDismissedRouteError.d.ts +6 -0
  87. package/lib/typescript/module/src/utils/useDismissedRouteError.d.ts.map +1 -0
  88. package/lib/typescript/module/src/utils/useInvalidPreventRemoveError.d.ts +3 -0
  89. package/lib/typescript/module/src/utils/useInvalidPreventRemoveError.d.ts.map +1 -0
  90. package/lib/typescript/module/src/views/FontProcessor.d.ts +2 -0
  91. package/lib/typescript/module/src/views/FontProcessor.d.ts.map +1 -0
  92. package/lib/typescript/module/src/views/FontProcessor.native.d.ts +2 -0
  93. package/lib/typescript/module/src/views/FontProcessor.native.d.ts.map +1 -0
  94. package/lib/typescript/module/src/views/FooterComponent.d.ts +7 -0
  95. package/lib/typescript/module/src/views/FooterComponent.d.ts.map +1 -0
  96. package/lib/typescript/module/src/views/NativeStackView.d.ts +11 -0
  97. package/lib/typescript/module/src/views/NativeStackView.d.ts.map +1 -0
  98. package/lib/typescript/module/src/views/NativeStackView.native.d.ts +11 -0
  99. package/lib/typescript/module/src/views/NativeStackView.native.d.ts.map +1 -0
  100. package/lib/typescript/module/src/views/useHeaderConfigProps.d.ts +41 -0
  101. package/lib/typescript/module/src/views/useHeaderConfigProps.d.ts.map +1 -0
  102. package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -0
  103. package/package.json +36 -19
  104. package/src/index.tsx +2 -0
  105. package/src/navigators/createNativeStackNavigator.tsx +6 -5
  106. package/src/types.tsx +107 -35
  107. package/src/utils/debounce.tsx +1 -1
  108. package/src/views/FooterComponent.tsx +10 -0
  109. package/src/views/NativeStackView.native.tsx +168 -202
  110. package/src/views/NativeStackView.tsx +62 -50
  111. package/src/views/{HeaderConfig.tsx → useHeaderConfigProps.tsx} +80 -63
  112. package/lib/commonjs/navigators/createNativeStackNavigator.cjs.map +0 -1
  113. package/lib/commonjs/views/DebugContainer.cjs +0 -22
  114. package/lib/commonjs/views/DebugContainer.cjs.map +0 -1
  115. package/lib/commonjs/views/DebugContainer.native.cjs +0 -49
  116. package/lib/commonjs/views/DebugContainer.native.cjs.map +0 -1
  117. package/lib/commonjs/views/HeaderConfig.cjs.map +0 -1
  118. package/lib/commonjs/views/NativeStackView.cjs.map +0 -1
  119. package/lib/commonjs/views/NativeStackView.native.cjs.map +0 -1
  120. package/lib/module/index.mjs.map +0 -1
  121. package/lib/module/navigators/createNativeStackNavigator.mjs.map +0 -1
  122. package/lib/module/types.mjs +0 -2
  123. package/lib/module/utils/debounce.mjs.map +0 -1
  124. package/lib/module/utils/getModalRoutesKeys.mjs.map +0 -1
  125. package/lib/module/utils/useAnimatedHeaderHeight.mjs.map +0 -1
  126. package/lib/module/utils/useDismissedRouteError.mjs.map +0 -1
  127. package/lib/module/utils/useInvalidPreventRemoveError.mjs.map +0 -1
  128. package/lib/module/views/DebugContainer.mjs +0 -14
  129. package/lib/module/views/DebugContainer.mjs.map +0 -1
  130. package/lib/module/views/DebugContainer.native.mjs +0 -38
  131. package/lib/module/views/DebugContainer.native.mjs.map +0 -1
  132. package/lib/module/views/FontProcessor.native.mjs.map +0 -1
  133. package/lib/module/views/HeaderConfig.mjs.map +0 -1
  134. package/lib/module/views/NativeStackView.mjs.map +0 -1
  135. package/lib/module/views/NativeStackView.native.mjs.map +0 -1
  136. package/lib/typescript/src/index.d.ts.map +0 -1
  137. package/lib/typescript/src/navigators/createNativeStackNavigator.d.ts.map +0 -1
  138. package/lib/typescript/src/types.d.ts.map +0 -1
  139. package/lib/typescript/src/utils/debounce.d.ts.map +0 -1
  140. package/lib/typescript/src/utils/getModalRoutesKeys.d.ts.map +0 -1
  141. package/lib/typescript/src/utils/useAnimatedHeaderHeight.d.ts.map +0 -1
  142. package/lib/typescript/src/utils/useDismissedRouteError.d.ts.map +0 -1
  143. package/lib/typescript/src/utils/useInvalidPreventRemoveError.d.ts.map +0 -1
  144. package/lib/typescript/src/views/DebugContainer.d.ts +0 -10
  145. package/lib/typescript/src/views/DebugContainer.d.ts.map +0 -1
  146. package/lib/typescript/src/views/DebugContainer.native.d.ts +0 -15
  147. package/lib/typescript/src/views/DebugContainer.native.d.ts.map +0 -1
  148. package/lib/typescript/src/views/FontProcessor.d.ts.map +0 -1
  149. package/lib/typescript/src/views/FontProcessor.native.d.ts.map +0 -1
  150. package/lib/typescript/src/views/HeaderConfig.d.ts +0 -11
  151. package/lib/typescript/src/views/HeaderConfig.d.ts.map +0 -1
  152. package/lib/typescript/src/views/NativeStackView.d.ts +0 -10
  153. package/lib/typescript/src/views/NativeStackView.d.ts.map +0 -1
  154. package/lib/typescript/src/views/NativeStackView.native.d.ts +0 -10
  155. package/lib/typescript/src/views/NativeStackView.native.d.ts.map +0 -1
  156. package/src/views/DebugContainer.native.tsx +0 -36
  157. package/src/views/DebugContainer.tsx +0 -14
  158. /package/lib/commonjs/{index.cjs.map → index.js.map} +0 -0
  159. /package/lib/commonjs/{types.cjs.map → types.js.map} +0 -0
  160. /package/lib/commonjs/utils/{getModalRoutesKeys.cjs.map → getModalRoutesKeys.js.map} +0 -0
  161. /package/lib/commonjs/utils/{useAnimatedHeaderHeight.cjs.map → useAnimatedHeaderHeight.js.map} +0 -0
  162. /package/lib/commonjs/utils/{useDismissedRouteError.cjs.map → useDismissedRouteError.js.map} +0 -0
  163. /package/lib/commonjs/utils/{useInvalidPreventRemoveError.cjs.map → useInvalidPreventRemoveError.js.map} +0 -0
  164. /package/lib/commonjs/views/{FontProcessor.cjs.map → FontProcessor.js.map} +0 -0
  165. /package/lib/commonjs/views/{FontProcessor.native.cjs.map → FontProcessor.native.js.map} +0 -0
  166. /package/lib/module/{types.mjs.map → types.js.map} +0 -0
  167. /package/lib/typescript/{src → commonjs/src}/utils/debounce.d.ts +0 -0
  168. /package/lib/typescript/{src → commonjs/src}/utils/getModalRoutesKeys.d.ts +0 -0
  169. /package/lib/typescript/{src → commonjs/src}/utils/useAnimatedHeaderHeight.d.ts +0 -0
  170. /package/lib/typescript/{src → commonjs/src}/utils/useDismissedRouteError.d.ts +0 -0
  171. /package/lib/typescript/{src → commonjs/src}/utils/useInvalidPreventRemoveError.d.ts +0 -0
  172. /package/lib/typescript/{src → commonjs/src}/views/FontProcessor.d.ts +0 -0
  173. /package/lib/typescript/{src → commonjs/src}/views/FontProcessor.native.d.ts +0 -0
@@ -10,68 +10,17 @@ var React = _interopRequireWildcard(require("react"));
10
10
  var _reactNative = require("react-native");
11
11
  var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
12
12
  var _reactNativeScreens = require("react-native-screens");
13
- var _warnOnce = _interopRequireDefault(require("warn-once"));
14
- var _debounce = require("../utils/debounce.cjs");
15
- var _getModalRoutesKeys = require("../utils/getModalRoutesKeys.cjs");
16
- var _useAnimatedHeaderHeight = require("../utils/useAnimatedHeaderHeight.cjs");
17
- var _useDismissedRouteError = require("../utils/useDismissedRouteError.cjs");
18
- var _useInvalidPreventRemoveError = require("../utils/useInvalidPreventRemoveError.cjs");
19
- var _DebugContainer = require("./DebugContainer.cjs");
20
- var _HeaderConfig = require("./HeaderConfig.cjs");
13
+ var _debounce = require("../utils/debounce.js");
14
+ var _getModalRoutesKeys = require("../utils/getModalRoutesKeys.js");
15
+ var _useAnimatedHeaderHeight = require("../utils/useAnimatedHeaderHeight.js");
16
+ var _useDismissedRouteError = require("../utils/useDismissedRouteError.js");
17
+ var _useInvalidPreventRemoveError = require("../utils/useInvalidPreventRemoveError.js");
18
+ var _FooterComponent = require("./FooterComponent.js");
19
+ var _useHeaderConfigProps = require("./useHeaderConfigProps.js");
21
20
  var _jsxRuntime = require("react/jsx-runtime");
22
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
23
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
- const isAndroid = _reactNative.Platform.OS === 'android';
26
- const MaybeNestedStack = ({
27
- options,
28
- route,
29
- presentation,
30
- headerHeight,
31
- headerTopInsetEnabled,
32
- children
33
- }) => {
34
- const {
35
- colors
36
- } = (0, _native.useTheme)();
37
- const {
38
- header,
39
- headerShown = true,
40
- contentStyle
41
- } = options;
42
- const isHeaderInModal = isAndroid ? false : presentation !== 'card' && headerShown === true && header === undefined;
43
- const headerShownPreviousRef = React.useRef(headerShown);
44
- React.useEffect(() => {
45
- (0, _warnOnce.default)(!isAndroid && presentation !== 'card' && 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}'.`);
46
- headerShownPreviousRef.current = headerShown;
47
- }, [headerShown, presentation, route.name]);
48
- const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_DebugContainer.DebugContainer, {
49
- style: [styles.container, presentation !== 'transparentModal' && presentation !== 'containedTransparentModal' && {
50
- backgroundColor: colors.background
51
- }, contentStyle],
52
- stackPresentation: presentation === 'card' ? 'push' : presentation,
53
- children: children
54
- });
55
- if (isHeaderInModal) {
56
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStack, {
57
- style: styles.container,
58
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeScreens.Screen, {
59
- enabled: true,
60
- isNativeStack: true,
61
- hasLargeHeader: options.headerLargeTitle ?? false,
62
- style: _reactNative.StyleSheet.absoluteFill,
63
- children: [content, /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderConfig.HeaderConfig, {
64
- ...options,
65
- route: route,
66
- headerHeight: headerHeight,
67
- headerTopInsetEnabled: headerTopInsetEnabled,
68
- canGoBack: true
69
- })]
70
- })
71
- });
72
- }
73
- return content;
74
- };
23
+ const ANDROID_DEFAULT_HEADER_HEIGHT = 56;
75
24
  const SceneView = ({
76
25
  index,
77
26
  focused,
@@ -79,6 +28,7 @@ const SceneView = ({
79
28
  previousDescriptor,
80
29
  nextDescriptor,
81
30
  isPresentationModal,
31
+ isPreloaded,
82
32
  onWillDisappear,
83
33
  onWillAppear,
84
34
  onAppear,
@@ -86,7 +36,8 @@ const SceneView = ({
86
36
  onDismissed,
87
37
  onHeaderBackButtonClicked,
88
38
  onNativeDismissCancelled,
89
- onGestureCancel
39
+ onGestureCancel,
40
+ onSheetDetentChanged
90
41
  }) => {
91
42
  const {
92
43
  route,
@@ -103,6 +54,7 @@ const SceneView = ({
103
54
  const {
104
55
  animationDuration,
105
56
  animationTypeForReplace = 'push',
57
+ fullScreenGestureShadowEnabled = true,
106
58
  gestureEnabled,
107
59
  gestureDirection = presentation === 'card' ? 'horizontal' : 'vertical',
108
60
  gestureResponseDistance,
@@ -117,17 +69,21 @@ const SceneView = ({
117
69
  navigationBarTranslucent,
118
70
  navigationBarHidden,
119
71
  orientation,
120
- sheetAllowedDetents = 'large',
121
- sheetLargestUndimmedDetent = 'all',
72
+ sheetAllowedDetents = [1.0],
73
+ sheetLargestUndimmedDetentIndex = -1,
122
74
  sheetGrabberVisible = false,
123
75
  sheetCornerRadius = -1.0,
76
+ sheetElevation = 24,
124
77
  sheetExpandsWhenScrolledToEdge = true,
78
+ sheetInitialDetentIndex = 0,
125
79
  statusBarAnimation,
126
80
  statusBarHidden,
127
81
  statusBarStyle,
128
82
  statusBarTranslucent,
129
83
  statusBarBackgroundColor,
130
- freezeOnBlur
84
+ unstable_sheetFooter = null,
85
+ freezeOnBlur,
86
+ contentStyle
131
87
  } = options;
132
88
  if (gestureDirection === 'vertical' && _reactNative.Platform.OS === 'ios') {
133
89
  // for `vertical` direction to work, we need to set `fullScreenGestureEnabled` to `true`
@@ -155,6 +111,9 @@ const SceneView = ({
155
111
  // for navigator with first screen as `modal` and the next as `card`
156
112
  presentation = 'card';
157
113
  }
114
+ const {
115
+ colors
116
+ } = (0, _native.useTheme)();
158
117
  const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
159
118
  const frame = (0, _reactNativeSafeAreaContext.useSafeAreaFrame)();
160
119
 
@@ -175,7 +134,7 @@ const SceneView = ({
175
134
  // FIXME: Currently screens isn't using Material 3
176
135
  // So our `getDefaultHeaderHeight` doesn't return the correct value
177
136
  // So we hardcode the value here for now until screens is updated
178
- android: 56 + topInset,
137
+ android: ANDROID_DEFAULT_HEADER_HEIGHT + topInset,
179
138
  default: (0, _elements.getDefaultHeaderHeight)(frame, isModal, topInset)
180
139
  });
181
140
  const [headerHeight, setHeaderHeight] = React.useState(defaultHeaderHeight);
@@ -186,7 +145,7 @@ const SceneView = ({
186
145
  (0, _debounce.debounce)(setHeaderHeight, 100), []);
187
146
  const hasCustomHeader = header !== undefined;
188
147
  let headerHeightCorrectionOffset = 0;
189
- if (isAndroid && !hasCustomHeader) {
148
+ if (_reactNative.Platform.OS === 'android' && !hasCustomHeader) {
190
149
  const statusBarHeight = _reactNative.StatusBar.currentHeight ?? 0;
191
150
 
192
151
  // FIXME: On Android, the native header height is not correctly calculated
@@ -205,29 +164,46 @@ const SceneView = ({
205
164
  // we apply additional padding in header only if its true.
206
165
  // For more details see: https://github.com/react-navigation/react-navigation/pull/12014
207
166
  const headerTopInsetEnabled = typeof statusBarTranslucent === 'boolean' ? statusBarTranslucent : topInset !== 0;
167
+ const canGoBack = previousDescriptor != null || parentHeaderBack != null;
208
168
  const backTitle = previousDescriptor ? (0, _elements.getHeaderTitle)(previousDescriptor.options, previousDescriptor.route.name) : parentHeaderBack?.title;
209
- const headerBack = React.useMemo(() => ({
210
- // No href needed for native
211
- href: undefined,
212
- title: backTitle
213
- }), [backTitle]);
169
+ const headerBack = React.useMemo(() => {
170
+ if (canGoBack) {
171
+ return {
172
+ href: undefined,
173
+ // No href needed for native
174
+ title: backTitle
175
+ };
176
+ }
177
+ return undefined;
178
+ }, [canGoBack, backTitle]);
214
179
  const isRemovePrevented = preventedRoutes[route.key]?.preventRemove;
215
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.Screen, {
216
- enabled: true,
217
- isNativeStack: true,
180
+ const headerConfig = (0, _useHeaderConfigProps.useHeaderConfigProps)({
181
+ ...options,
182
+ route,
183
+ canGoBack,
184
+ headerBackButtonMenuEnabled: isRemovePrevented !== undefined ? !isRemovePrevented : headerBackButtonMenuEnabled,
185
+ headerBackTitle: options.headerBackTitle !== undefined ? options.headerBackTitle : undefined,
186
+ headerHeight,
187
+ headerShown: header !== undefined ? false : headerShown,
188
+ headerTopInsetEnabled
189
+ });
190
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackItem, {
191
+ screenId: route.key,
192
+ activityState: isPreloaded ? 0 : 2,
218
193
  style: _reactNative.StyleSheet.absoluteFill,
219
- hasLargeHeader: options.headerLargeTitle ?? false,
194
+ accessibilityElementsHidden: !focused,
195
+ importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
220
196
  customAnimationOnSwipe: animationMatchesGesture,
221
197
  fullScreenSwipeEnabled: fullScreenGestureEnabled,
222
- gestureEnabled: isAndroid ?
198
+ fullScreenSwipeShadowEnabled: fullScreenGestureShadowEnabled,
199
+ freezeOnBlur: freezeOnBlur,
200
+ gestureEnabled: _reactNative.Platform.OS === 'android' ?
223
201
  // This prop enables handling of system back gestures on Android
224
202
  // Since we handle them in JS side, we disable this
225
203
  false : gestureEnabled,
226
204
  homeIndicatorHidden: autoHideHomeIndicator,
227
205
  hideKeyboardOnSwipe: keyboardHandlingEnabled,
228
- navigationBarColor: navigationBarColor
229
- // @ts-expect-error prop supported from react-native-screens 3.32.0 onwards
230
- ,
206
+ navigationBarColor: navigationBarColor,
231
207
  navigationBarTranslucent: navigationBarTranslucent,
232
208
  navigationBarHidden: navigationBarHidden,
233
209
  replaceAnimation: animationTypeForReplace,
@@ -235,9 +211,11 @@ const SceneView = ({
235
211
  stackAnimation: animation,
236
212
  screenOrientation: orientation,
237
213
  sheetAllowedDetents: sheetAllowedDetents,
238
- sheetLargestUndimmedDetent: sheetLargestUndimmedDetent,
214
+ sheetLargestUndimmedDetentIndex: sheetLargestUndimmedDetentIndex,
239
215
  sheetGrabberVisible: sheetGrabberVisible,
216
+ sheetInitialDetentIndex: sheetInitialDetentIndex,
240
217
  sheetCornerRadius: sheetCornerRadius,
218
+ sheetElevation: sheetElevation,
241
219
  sheetExpandsWhenScrolledToEdge: sheetExpandsWhenScrolledToEdge,
242
220
  statusBarAnimation: statusBarAnimation,
243
221
  statusBarHidden: statusBarHidden,
@@ -252,6 +230,7 @@ const SceneView = ({
252
230
  onDisappear: onDisappear,
253
231
  onDismissed: onDismissed,
254
232
  onGestureCancel: onGestureCancel,
233
+ onSheetDetentChanged: onSheetDetentChanged,
255
234
  gestureResponseDistance: gestureResponseDistance,
256
235
  nativeBackButtonDismissalEnabled: false // on Android
257
236
  ,
@@ -271,6 +250,12 @@ const SceneView = ({
271
250
  }], {
272
251
  useNativeDriver: true,
273
252
  listener: e => {
253
+ if (_reactNative.Platform.OS === 'android' && (options.headerBackground != null || options.headerTransparent)) {
254
+ // FIXME: On Android, we get 0 if the header is translucent
255
+ // So we set a default height in that case
256
+ setHeaderHeight(ANDROID_DEFAULT_HEADER_HEIGHT + topInset);
257
+ return;
258
+ }
274
259
  if (e.nativeEvent && typeof e.nativeEvent === 'object' && 'headerHeight' in e.nativeEvent && typeof e.nativeEvent.headerHeight === 'number') {
275
260
  const headerHeight = e.nativeEvent.headerHeight + headerHeightCorrectionOffset;
276
261
 
@@ -284,70 +269,56 @@ const SceneView = ({
284
269
  }
285
270
  }
286
271
  }
287
- })
288
- // this prop is available since rn-screens 3.16
272
+ }),
273
+ contentStyle: [presentation !== 'transparentModal' && presentation !== 'containedTransparentModal' && {
274
+ backgroundColor: colors.background
275
+ }, contentStyle],
276
+ headerConfig: headerConfig
277
+ // When ts-expect-error is added, it affects all the props below it
278
+ // So we keep any props that need it at the end
279
+ // Otherwise invalid props may not be caught by TypeScript
289
280
  ,
290
- freezeOnBlur: freezeOnBlur,
291
281
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_native.NavigationContext.Provider, {
292
282
  value: navigation,
293
283
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_native.NavigationRouteContext.Provider, {
294
284
  value: route,
295
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderShownContext.Provider, {
296
- value: isParentHeaderShown || headerShown !== false,
297
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_useAnimatedHeaderHeight.AnimatedHeaderHeightContext.Provider, {
298
- value: animatedHeaderHeight,
299
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_elements.HeaderHeightContext.Provider, {
300
- value: headerShown !== false ? headerHeight : parentHeaderHeight ?? 0,
301
- children: [headerBackground != null ?
302
- /*#__PURE__*/
303
- /**
304
- * To show a custom header background, we render it at the top of the screen below the header
305
- * The header also needs to be positioned absolutely (with `translucent` style)
306
- */
307
- (0, _jsxRuntime.jsx)(_reactNative.View, {
308
- style: [styles.background, headerTransparent ? styles.translucent : null, {
309
- height: headerHeight
310
- }],
311
- children: headerBackground()
312
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
313
- accessibilityElementsHidden: !focused,
314
- importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
315
- style: styles.scene,
316
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(MaybeNestedStack, {
317
- options: options,
318
- route: route,
319
- presentation: presentation,
320
- headerHeight: headerHeight,
321
- headerTopInsetEnabled: headerTopInsetEnabled,
322
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderBackContext.Provider, {
323
- value: headerBack,
324
- children: render()
325
- })
326
- }), header !== undefined && headerShown !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
327
- onLayout: e => {
328
- const headerHeight = e.nativeEvent.layout.height;
329
- setHeaderHeight(headerHeight);
330
- rawAnimatedHeaderHeight.setValue(headerHeight);
331
- },
332
- style: headerTransparent ? styles.absolute : null,
333
- children: header({
334
- back: headerBack,
335
- options,
336
- route,
337
- navigation
338
- })
339
- }) : null]
340
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderConfig.HeaderConfig, {
341
- ...options,
342
- route: route,
343
- headerBackButtonMenuEnabled: isRemovePrevented !== undefined ? !isRemovePrevented : headerBackButtonMenuEnabled,
344
- headerShown: header !== undefined ? false : headerShown,
345
- headerHeight: headerHeight,
346
- headerBackTitle: options.headerBackTitle !== undefined ? options.headerBackTitle : undefined,
347
- headerTopInsetEnabled: headerTopInsetEnabled,
348
- canGoBack: headerBack !== undefined
349
- })]
350
- })
285
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_useAnimatedHeaderHeight.AnimatedHeaderHeightContext.Provider, {
286
+ value: animatedHeaderHeight,
287
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_elements.HeaderHeightContext.Provider, {
288
+ value: headerShown !== false ? headerHeight : parentHeaderHeight ?? 0,
289
+ children: [headerBackground != null ?
290
+ /*#__PURE__*/
291
+ /**
292
+ * To show a custom header background, we render it at the top of the screen below the header
293
+ * The header also needs to be positioned absolutely (with `translucent` style)
294
+ */
295
+ (0, _jsxRuntime.jsx)(_reactNative.View, {
296
+ style: [styles.background, headerTransparent ? styles.translucent : null, {
297
+ height: headerHeight
298
+ }],
299
+ children: headerBackground()
300
+ }) : null, header !== undefined && headerShown !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
301
+ onLayout: e => {
302
+ const headerHeight = e.nativeEvent.layout.height;
303
+ setHeaderHeight(headerHeight);
304
+ rawAnimatedHeaderHeight.setValue(headerHeight);
305
+ },
306
+ style: [styles.header, headerTransparent ? styles.absolute : null],
307
+ children: header({
308
+ back: headerBack,
309
+ options,
310
+ route,
311
+ navigation
312
+ })
313
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderShownContext.Provider, {
314
+ value: isParentHeaderShown || headerShown !== false,
315
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderBackContext.Provider, {
316
+ value: headerBack,
317
+ children: render()
318
+ })
319
+ }), presentation === 'formSheet' && unstable_sheetFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FooterComponent.FooterComponent, {
320
+ children: unstable_sheetFooter()
321
+ })]
351
322
  })
352
323
  })
353
324
  })
@@ -357,7 +328,8 @@ const SceneView = ({
357
328
  function NativeStackView({
358
329
  state,
359
330
  navigation,
360
- descriptors
331
+ descriptors,
332
+ describe
361
333
  }) {
362
334
  const {
363
335
  setNextDismissedKey
@@ -367,20 +339,25 @@ function NativeStackView({
367
339
  } = (0, _native.useTheme)();
368
340
  (0, _useInvalidPreventRemoveError.useInvalidPreventRemoveError)(descriptors);
369
341
  const modalRouteKeys = (0, _getModalRoutesKeys.getModalRouteKeys)(state.routes, descriptors);
342
+ const preloadedDescriptors = state.preloadedRoutes.reduce((acc, route) => {
343
+ acc[route.key] = acc[route.key] || describe(route, true);
344
+ return acc;
345
+ }, {});
370
346
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.SafeAreaProviderCompat, {
371
347
  style: {
372
348
  backgroundColor: colors.background
373
349
  },
374
350
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStack, {
375
351
  style: styles.container,
376
- children: state.routes.map((route, index) => {
377
- const descriptor = descriptors[route.key];
352
+ children: state.routes.concat(state.preloadedRoutes).map((route, index) => {
353
+ const descriptor = descriptors[route.key] ?? preloadedDescriptors[route.key];
378
354
  const isFocused = state.index === index;
379
355
  const previousKey = state.routes[index - 1]?.key;
380
356
  const nextKey = state.routes[index + 1]?.key;
381
357
  const previousDescriptor = previousKey ? descriptors[previousKey] : undefined;
382
358
  const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
383
359
  const isModal = modalRouteKeys.includes(route.key);
360
+ const isPreloaded = preloadedDescriptors[route.key] !== undefined && descriptors[route.key] === undefined;
384
361
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(SceneView, {
385
362
  index: index,
386
363
  focused: isFocused,
@@ -388,6 +365,7 @@ function NativeStackView({
388
365
  previousDescriptor: previousDescriptor,
389
366
  nextDescriptor: nextDescriptor,
390
367
  isPresentationModal: isModal,
368
+ isPreloaded: isPreloaded,
391
369
  onWillDisappear: () => {
392
370
  navigation.emit({
393
371
  type: 'transitionStart',
@@ -451,6 +429,16 @@ function NativeStackView({
451
429
  type: 'gestureCancel',
452
430
  target: route.key
453
431
  });
432
+ },
433
+ onSheetDetentChanged: event => {
434
+ navigation.emit({
435
+ type: 'sheetDetentChange',
436
+ target: route.key,
437
+ data: {
438
+ index: event.nativeEvent.index,
439
+ stable: event.nativeEvent.isStable
440
+ }
441
+ });
454
442
  }
455
443
  }, route.key);
456
444
  })
@@ -461,9 +449,8 @@ const styles = _reactNative.StyleSheet.create({
461
449
  container: {
462
450
  flex: 1
463
451
  },
464
- scene: {
465
- flex: 1,
466
- flexDirection: 'column-reverse'
452
+ header: {
453
+ zIndex: 1
467
454
  },
468
455
  absolute: {
469
456
  position: 'absolute',
@@ -483,4 +470,4 @@ const styles = _reactNative.StyleSheet.create({
483
470
  overflow: 'hidden'
484
471
  }
485
472
  });
486
- //# sourceMappingURL=NativeStackView.native.cjs.map
473
+ //# sourceMappingURL=NativeStackView.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_elements","require","_native","React","_interopRequireWildcard","_reactNative","_reactNativeSafeAreaContext","_reactNativeScreens","_debounce","_getModalRoutesKeys","_useAnimatedHeaderHeight","_useDismissedRouteError","_useInvalidPreventRemoveError","_FooterComponent","_useHeaderConfigProps","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ANDROID_DEFAULT_HEADER_HEIGHT","SceneView","index","focused","descriptor","previousDescriptor","nextDescriptor","isPresentationModal","isPreloaded","onWillDisappear","onWillAppear","onAppear","onDisappear","onDismissed","onHeaderBackButtonClicked","onNativeDismissCancelled","onGestureCancel","onSheetDetentChanged","route","navigation","options","render","animation","animationMatchesGesture","presentation","fullScreenGestureEnabled","animationDuration","animationTypeForReplace","fullScreenGestureShadowEnabled","gestureEnabled","gestureDirection","gestureResponseDistance","header","headerBackButtonMenuEnabled","headerShown","headerBackground","headerTransparent","autoHideHomeIndicator","keyboardHandlingEnabled","navigationBarColor","navigationBarTranslucent","navigationBarHidden","orientation","sheetAllowedDetents","sheetLargestUndimmedDetentIndex","sheetGrabberVisible","sheetCornerRadius","sheetElevation","sheetExpandsWhenScrolledToEdge","sheetInitialDetentIndex","statusBarAnimation","statusBarHidden","statusBarStyle","statusBarTranslucent","statusBarBackgroundColor","unstable_sheetFooter","freezeOnBlur","contentStyle","Platform","OS","undefined","nextGestureDirection","gestureDirectionOverride","colors","useTheme","insets","useSafeAreaInsets","frame","useSafeAreaFrame","isModal","isIPhone","isPad","isTV","isLandscape","width","height","isParentHeaderShown","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","parentHeaderBack","HeaderBackContext","topInset","top","preventedRoutes","usePreventRemoveContext","defaultHeaderHeight","select","android","getDefaultHeaderHeight","headerHeight","setHeaderHeight","useState","setHeaderHeightDebounced","useCallback","debounce","hasCustomHeader","headerHeightCorrectionOffset","statusBarHeight","StatusBar","currentHeight","rawAnimatedHeaderHeight","useAnimatedValue","animatedHeaderHeight","useMemo","Animated","add","headerTopInsetEnabled","canGoBack","backTitle","getHeaderTitle","name","title","headerBack","href","isRemovePrevented","key","preventRemove","headerConfig","useHeaderConfigProps","headerBackTitle","jsx","ScreenStackItem","screenId","activityState","style","StyleSheet","absoluteFill","accessibilityElementsHidden","importantForAccessibility","customAnimationOnSwipe","fullScreenSwipeEnabled","fullScreenSwipeShadowEnabled","homeIndicatorHidden","hideKeyboardOnSwipe","replaceAnimation","stackPresentation","stackAnimation","screenOrientation","statusBarColor","swipeDirection","transitionDuration","nativeBackButtonDismissalEnabled","preventNativeDismiss","onHeaderHeightChange","event","nativeEvent","useNativeDriver","listener","doesHeaderAnimate","headerLargeTitle","headerSearchBarOptions","backgroundColor","background","children","NavigationContext","Provider","value","NavigationRouteContext","AnimatedHeaderHeightContext","jsxs","View","styles","translucent","onLayout","layout","setValue","absolute","back","FooterComponent","NativeStackView","state","descriptors","describe","setNextDismissedKey","useDismissedRouteError","useInvalidPreventRemoveError","modalRouteKeys","getModalRouteKeys","routes","preloadedDescriptors","preloadedRoutes","reduce","acc","SafeAreaProviderCompat","ScreenStack","container","concat","map","isFocused","previousKey","nextKey","includes","emit","type","data","closing","target","dispatch","StackActions","pop","dismissCount","source","stable","isStable","create","flex","zIndex","position","start","end","elevation","overflow"],"sourceRoot":"../../../src","sources":["views/NativeStackView.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAQA,IAAAC,OAAA,GAAAD,OAAA;AAUA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,mBAAA,GAAAN,OAAA;AAWA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA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,CAAC;cACdC,IAAI,EAAE,mBAAmB;cACzBG,MAAM,EAAEpL,KAAK,CAACmG,GAAG;cACjB+E,IAAI,EAAE;gBACJlM,KAAK,EAAEgJ,KAAK,CAACC,WAAW,CAACjJ,KAAK;gBAC9B0M,MAAM,EAAE1D,KAAK,CAACC,WAAW,CAAC0D;cAC5B;YACF,CAAC,CAAC;UACJ;QAAE,GA1EG3L,KAAK,CAACmG,GA2EZ,CAAC;MAEN,CAAC;IAAC,CACS;EAAC,CACQ,CAAC;AAE7B;AAEA,MAAM8C,MAAM,GAAGpC,uBAAU,CAAC+E,MAAM,CAAC;EAC/BnB,SAAS,EAAE;IACToB,IAAI,EAAE;EACR,CAAC;EACD/K,MAAM,EAAE;IACNgL,MAAM,EAAE;EACV,CAAC;EACDxC,QAAQ,EAAE;IACRyC,QAAQ,EAAE,UAAU;IACpB7H,GAAG,EAAE,CAAC;IACN8H,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP,CAAC;EACD/C,WAAW,EAAE;IACX6C,QAAQ,EAAE,UAAU;IACpB7H,GAAG,EAAE,CAAC;IACN8H,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE,CAAC;IACNH,MAAM,EAAE,CAAC;IACTI,SAAS,EAAE;EACb,CAAC;EACD1D,UAAU,EAAE;IACV2D,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -3,19 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.HeaderConfig = HeaderConfig;
6
+ exports.useHeaderConfigProps = useHeaderConfigProps;
7
7
  var _elements = require("@react-navigation/elements");
8
8
  var _native = require("@react-navigation/native");
9
9
  var _reactNative = require("react-native");
10
10
  var _reactNativeScreens = require("react-native-screens");
11
- var _FontProcessor = require("./FontProcessor.cjs");
11
+ var _FontProcessor = require("./FontProcessor");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
- function HeaderConfig({
13
+ function useHeaderConfigProps({
14
14
  headerBackImageSource,
15
+ headerBackButtonDisplayMode,
15
16
  headerBackButtonMenuEnabled,
16
17
  headerBackTitle,
17
18
  headerBackTitleStyle,
18
- headerBackTitleVisible = true,
19
19
  headerBackVisible,
20
20
  headerShadowVisible,
21
21
  headerLargeStyle,
@@ -112,40 +112,21 @@ function HeaderConfig({
112
112
  * - Back button should stay visible when `headerLeft` is specified
113
113
  * - If `headerTitle` for Android is specified, so we only need to remove the title and keep the back button
114
114
  */
115
- const backButtonInCustomView = headerBackVisible ? headerLeftElement != null : _reactNative.Platform.OS === 'android' && headerTitleElement != null;
115
+ const backButtonInCustomView = headerBackVisible || _reactNative.Platform.OS === 'android' && headerTitleElement != null && headerLeftElement == null;
116
116
  const translucent = headerBackground != null || headerTransparent ||
117
117
  // When using a SearchBar or large title, the header needs to be translucent for it to work on iOS
118
118
  (hasHeaderSearchBar || headerLargeTitle) && _reactNative.Platform.OS === 'ios' && headerTransparent !== false;
119
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeScreens.ScreenStackHeaderConfig, {
120
- backButtonInCustomView: backButtonInCustomView,
121
- backgroundColor: headerBackgroundColor,
122
- backTitle: headerBackTitle,
123
- backTitleVisible: headerBackTitleVisible,
124
- backTitleFontFamily: backTitleFontFamily,
125
- backTitleFontSize: backTitleFontSize,
126
- blurEffect: headerBlurEffect,
127
- color: tintColor,
128
- direction: direction,
129
- disableBackButtonMenu: headerBackButtonMenuEnabled === false,
130
- hidden: headerShown === false,
131
- hideBackButton: headerBackVisible === false,
132
- hideShadow: headerShadowVisible === false || headerBackground != null || headerTransparent && headerShadowVisible !== true,
133
- largeTitle: headerLargeTitle,
134
- largeTitleBackgroundColor: largeTitleBackgroundColor,
135
- largeTitleColor: largeTitleColor,
136
- largeTitleFontFamily: largeTitleFontFamily,
137
- largeTitleFontSize: largeTitleFontSize,
138
- largeTitleFontWeight: largeTitleFontWeight,
139
- largeTitleHideShadow: headerLargeTitleShadowVisible === false,
140
- title: titleText,
141
- titleColor: titleColor,
142
- titleFontFamily: titleFontFamily,
143
- titleFontSize: titleFontSize,
144
- titleFontWeight: String(titleFontWeight),
145
- topInsetEnabled: headerTopInsetEnabled,
146
- translucent:
147
- // This defaults to `true`, so we can't pass `undefined`
148
- translucent === true,
119
+ const isBackButtonDisplayModeAvailable =
120
+ // On iOS 14+
121
+ _reactNative.Platform.OS === 'ios' && parseInt(_reactNative.Platform.Version, 10) >= 14 &&
122
+ // Doesn't have custom back title
123
+ headerBackTitle == null &&
124
+ // Doesn't have custom styling
125
+ backTitleFontFamily == null && backTitleFontSize == null &&
126
+ // Back button menu is not disabled
127
+ headerBackButtonMenuEnabled !== false;
128
+ const isCenterViewRenderedAndroid = headerTitleAlign === 'center';
129
+ const children = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
149
130
  children: [_reactNative.Platform.OS === 'ios' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
150
131
  children: [headerLeftElement != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderLeftView, {
151
132
  children: headerLeftElement
@@ -153,16 +134,31 @@ function HeaderConfig({
153
134
  children: headerTitleElement
154
135
  }) : null]
155
136
  }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
156
- children: [headerLeftElement != null || typeof headerTitle === 'function' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderLeftView, {
157
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
158
- style: styles.row,
159
- children: [headerLeftElement, headerTitleAlign !== 'center' ? typeof headerTitle === 'function' ? headerTitleElement : /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderTitle, {
137
+ children: [headerLeftElement != null || typeof headerTitle === 'function' ?
138
+ /*#__PURE__*/
139
+ // The style passed to header left, together with title element being wrapped
140
+ // in flex view is reqruied for proper header layout, in particular,
141
+ // for the text truncation to work.
142
+ (0, _jsxRuntime.jsxs)(_reactNativeScreens.ScreenStackHeaderLeftView, {
143
+ style: !isCenterViewRenderedAndroid ? {
144
+ flex: 1
145
+ } : null,
146
+ children: [headerLeftElement, headerTitleAlign !== 'center' ? typeof headerTitle === 'function' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
147
+ style: {
148
+ flex: 1
149
+ },
150
+ children: headerTitleElement
151
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
152
+ style: {
153
+ flex: 1
154
+ },
155
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderTitle, {
160
156
  tintColor: tintColor,
161
157
  style: headerTitleStyleSupported,
162
158
  children: titleText
163
- }) : null]
164
- })
165
- }) : null, headerTitleAlign === 'center' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderCenterView, {
159
+ })
160
+ }) : null]
161
+ }) : null, isCenterViewRenderedAndroid ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeScreens.ScreenStackHeaderCenterView, {
166
162
  children: typeof headerTitle === 'function' ? headerTitleElement : /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.HeaderTitle, {
167
163
  tintColor: tintColor,
168
164
  style: headerTitleStyleSupported,
@@ -179,11 +175,36 @@ function HeaderConfig({
179
175
  })
180
176
  }) : null]
181
177
  });
178
+ return {
179
+ backButtonInCustomView,
180
+ backgroundColor: headerBackgroundColor,
181
+ backTitle: headerBackTitle,
182
+ backTitleVisible: isBackButtonDisplayModeAvailable ? undefined : headerBackButtonDisplayMode !== 'minimal',
183
+ backButtonDisplayMode: isBackButtonDisplayModeAvailable ? headerBackButtonDisplayMode : undefined,
184
+ backTitleFontFamily,
185
+ backTitleFontSize,
186
+ blurEffect: headerBlurEffect,
187
+ color: tintColor,
188
+ direction,
189
+ disableBackButtonMenu: headerBackButtonMenuEnabled === false,
190
+ hidden: headerShown === false,
191
+ hideBackButton: headerBackVisible === false,
192
+ hideShadow: headerShadowVisible === false || headerBackground != null || headerTransparent && headerShadowVisible !== true,
193
+ largeTitle: headerLargeTitle,
194
+ largeTitleBackgroundColor,
195
+ largeTitleColor,
196
+ largeTitleFontFamily,
197
+ largeTitleFontSize,
198
+ largeTitleFontWeight,
199
+ largeTitleHideShadow: headerLargeTitleShadowVisible === false,
200
+ title: titleText,
201
+ titleColor,
202
+ titleFontFamily,
203
+ titleFontSize,
204
+ titleFontWeight: String(titleFontWeight),
205
+ topInsetEnabled: headerTopInsetEnabled,
206
+ translucent: translucent === true,
207
+ children
208
+ };
182
209
  }
183
- const styles = _reactNative.StyleSheet.create({
184
- row: {
185
- flexDirection: 'row',
186
- alignItems: 'center'
187
- }
188
- });
189
- //# sourceMappingURL=HeaderConfig.cjs.map
210
+ //# sourceMappingURL=useHeaderConfigProps.js.map