@react-navigation/stack 7.0.0-rc.20 → 7.0.0-rc.21
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/lib/commonjs/views/Header/HeaderSegment.js +4 -4
- package/lib/commonjs/views/Header/HeaderSegment.js.map +1 -1
- package/lib/commonjs/views/Stack/CardContainer.js +1 -1
- package/lib/commonjs/views/Stack/CardContainer.js.map +1 -1
- package/lib/module/views/Header/HeaderSegment.js +4 -4
- package/lib/module/views/Header/HeaderSegment.js.map +1 -1
- package/lib/module/views/Stack/CardContainer.js +1 -1
- package/lib/module/views/Stack/CardContainer.js.map +1 -1
- package/lib/typescript/commonjs/src/types.d.ts +17 -9
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/views/Stack/CardContainer.d.ts.map +1 -1
- package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -1
- package/lib/typescript/module/src/types.d.ts +17 -9
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/lib/typescript/module/src/views/Stack/CardContainer.d.ts.map +1 -1
- package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/types.tsx +17 -8
- package/src/views/Header/HeaderSegment.tsx +4 -4
- package/src/views/Stack/CardContainer.tsx +5 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/stack",
|
|
3
3
|
"description": "Stack navigator component for iOS and Android with animated transitions and gestures",
|
|
4
|
-
"version": "7.0.0-rc.
|
|
4
|
+
"version": "7.0.0-rc.21",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"clean": "del lib"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@react-navigation/elements": "^2.0.0-rc.
|
|
54
|
+
"@react-navigation/elements": "^2.0.0-rc.19",
|
|
55
55
|
"color": "^4.2.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@jest/globals": "^29.7.0",
|
|
59
|
-
"@react-navigation/native": "^7.0.0-rc.
|
|
59
|
+
"@react-navigation/native": "^7.0.0-rc.17",
|
|
60
60
|
"@testing-library/react-native": "^12.4.3",
|
|
61
61
|
"@types/color": "^3.0.6",
|
|
62
62
|
"@types/react": "~18.2.79",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"react-native-builder-bob": "^0.29.0",
|
|
67
67
|
"react-native-gesture-handler": "~2.16.1",
|
|
68
68
|
"react-native-safe-area-context": "4.10.1",
|
|
69
|
-
"react-native-screens": "3.
|
|
69
|
+
"react-native-screens": "3.32.0",
|
|
70
70
|
"typescript": "^5.5.2"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@react-navigation/native": "^7.0.0-rc.
|
|
73
|
+
"@react-navigation/native": "^7.0.0-rc.17",
|
|
74
74
|
"react": ">= 18.2.0",
|
|
75
75
|
"react-native": ">= 0.72.0",
|
|
76
76
|
"react-native-gesture-handler": ">= 2.0.0",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
]
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "1a26dd67e4b9625075e6e5229736d1c679c67ccb"
|
|
106
106
|
}
|
package/src/types.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
HeaderBackButton,
|
|
3
|
+
HeaderBackButtonDisplayMode,
|
|
3
4
|
HeaderBackButtonProps,
|
|
4
5
|
HeaderOptions,
|
|
5
6
|
HeaderTitleProps,
|
|
@@ -180,23 +181,31 @@ export type StackHeaderOptions = Omit<
|
|
|
180
181
|
/**
|
|
181
182
|
* Title string used by the back button on iOS.
|
|
182
183
|
* Defaults to the previous screen's title, or "Back" if there's not enough space.
|
|
183
|
-
* Use `
|
|
184
|
+
* Use `headerBackButtonDisplayMode` to customize the behavior.
|
|
184
185
|
*/
|
|
185
186
|
headerBackTitle?: string;
|
|
186
187
|
/**
|
|
187
|
-
*
|
|
188
|
+
* Title string used by the back button when `headerBackTitle` doesn't fit on the screen.
|
|
189
|
+
* Use `headerBackButtonDisplayMode` to customize the behavior.
|
|
188
190
|
*
|
|
189
|
-
* Defaults to
|
|
191
|
+
* Defaults to "Back".
|
|
190
192
|
*/
|
|
191
|
-
|
|
193
|
+
headerBackTruncatedTitle?: string;
|
|
192
194
|
/**
|
|
193
|
-
*
|
|
195
|
+
* How the back button displays icon and title.
|
|
196
|
+
*
|
|
197
|
+
* Supported values:
|
|
198
|
+
* - "default" - Displays one of the following depending on the available space: previous screen's title, truncated title (e.g. 'Back') or no title (only icon).
|
|
199
|
+
* - "generic" – Displays one of the following depending on the available space: truncated title (e.g. 'Back') or no title (only icon).
|
|
200
|
+
* - "minimal" – Always displays only the icon without a title.
|
|
201
|
+
*
|
|
202
|
+
* Defaults to "default" on iOS, and "minimal" on Android.
|
|
194
203
|
*/
|
|
195
|
-
|
|
204
|
+
headerBackButtonDisplayMode?: HeaderBackButtonDisplayMode;
|
|
196
205
|
/**
|
|
197
|
-
*
|
|
206
|
+
* Style object for the back title.
|
|
198
207
|
*/
|
|
199
|
-
|
|
208
|
+
headerBackTitleStyle?: StyleProp<TextStyle>;
|
|
200
209
|
/**
|
|
201
210
|
* Function which returns a React Element to display custom image in header's back button.
|
|
202
211
|
* It receives the `tintColor` in in the options object as an argument. object.
|
|
@@ -114,8 +114,8 @@ export function HeaderSegment(props: Props) {
|
|
|
114
114
|
headerRight: right,
|
|
115
115
|
headerBackImage,
|
|
116
116
|
headerBackTitle,
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
headerBackButtonDisplayMode = Platform.OS === 'ios' ? 'default' : 'minimal',
|
|
118
|
+
headerBackTruncatedTitle,
|
|
119
119
|
headerBackAccessibilityLabel,
|
|
120
120
|
headerBackTestID,
|
|
121
121
|
headerBackAllowFontScaling,
|
|
@@ -167,7 +167,7 @@ export function HeaderSegment(props: Props) {
|
|
|
167
167
|
allowFontScaling: headerBackAllowFontScaling,
|
|
168
168
|
onPress: onGoBack,
|
|
169
169
|
label: headerBackTitle,
|
|
170
|
-
truncatedLabel:
|
|
170
|
+
truncatedLabel: headerBackTruncatedTitle,
|
|
171
171
|
labelStyle: [leftLabelStyle, headerBackTitleStyle],
|
|
172
172
|
onLabelLayout: handleLeftLabelLayout,
|
|
173
173
|
screenLayout: layout,
|
|
@@ -195,11 +195,11 @@ export function HeaderSegment(props: Props) {
|
|
|
195
195
|
layout={layout}
|
|
196
196
|
headerTitle={headerTitle}
|
|
197
197
|
headerLeft={headerLeft}
|
|
198
|
-
headerLeftLabelVisible={headerBackTitleVisible}
|
|
199
198
|
headerRight={headerRight}
|
|
200
199
|
headerTitleContainerStyle={[titleStyle, headerTitleContainerStyle]}
|
|
201
200
|
headerLeftContainerStyle={[leftButtonStyle, headerLeftContainerStyle]}
|
|
202
201
|
headerRightContainerStyle={[rightButtonStyle, headerRightContainerStyle]}
|
|
202
|
+
headerBackButtonDisplayMode={headerBackButtonDisplayMode}
|
|
203
203
|
headerBackgroundContainerStyle={[
|
|
204
204
|
backgroundStyle,
|
|
205
205
|
headerBackgroundContainerStyle,
|
|
@@ -293,7 +293,11 @@ function CardContainerInner({
|
|
|
293
293
|
value={isParentHeaderShown || headerShown !== false}
|
|
294
294
|
>
|
|
295
295
|
<HeaderHeightContext.Provider
|
|
296
|
-
value={
|
|
296
|
+
value={
|
|
297
|
+
headerShown !== false
|
|
298
|
+
? headerHeight
|
|
299
|
+
: parentHeaderHeight ?? 0
|
|
300
|
+
}
|
|
297
301
|
>
|
|
298
302
|
{scene.descriptor.render()}
|
|
299
303
|
</HeaderHeightContext.Provider>
|