@react-navigation/stack 8.0.0-alpha.30 → 8.0.0-alpha.31
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/module/views/Header/HeaderContainer.js +29 -11
- package/lib/module/views/Header/HeaderContainer.js.map +1 -1
- package/lib/module/views/Stack/CardContainer.js +53 -81
- package/lib/module/views/Stack/CardContainer.js.map +1 -1
- package/lib/module/views/Stack/CardStack.js +95 -49
- package/lib/module/views/Stack/CardStack.js.map +1 -1
- package/lib/typescript/src/views/Header/HeaderContainer.d.ts +6 -2
- package/lib/typescript/src/views/Header/HeaderContainer.d.ts.map +1 -1
- package/lib/typescript/src/views/Stack/CardContainer.d.ts +3 -5
- package/lib/typescript/src/views/Stack/CardContainer.d.ts.map +1 -1
- package/lib/typescript/src/views/Stack/CardStack.d.ts +3 -2
- package/lib/typescript/src/views/Stack/CardStack.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/views/Header/HeaderContainer.tsx +43 -16
- package/src/views/Stack/CardContainer.tsx +73 -108
- package/src/views/Stack/CardStack.tsx +112 -59
- package/lib/module/views/Stack/CardA11yWrapper.js +0 -42
- package/lib/module/views/Stack/CardA11yWrapper.js.map +0 -1
- package/lib/typescript/src/views/Stack/CardA11yWrapper.d.ts +0 -15
- package/lib/typescript/src/views/Stack/CardA11yWrapper.d.ts.map +0 -1
- package/src/views/Stack/CardA11yWrapper.tsx +0 -56
|
@@ -62,6 +62,9 @@ export function HeaderContainer({
|
|
|
62
62
|
headerShown: previousHeaderShown = true,
|
|
63
63
|
headerMode: previousHeaderMode
|
|
64
64
|
} = previousDescriptor?.options || {};
|
|
65
|
+
const {
|
|
66
|
+
headerTransparent: nextHeaderTransparent
|
|
67
|
+
} = nextDescriptor?.options || {};
|
|
65
68
|
|
|
66
69
|
// If any of the next screens don't have a header or header is part of the screen
|
|
67
70
|
// Then we need to move this header offscreen so that it doesn't cover it
|
|
@@ -78,7 +81,10 @@ export function HeaderContainer({
|
|
|
78
81
|
const isHeaderStatic = (previousHeaderShown === false || previousHeaderMode === 'screen') &&
|
|
79
82
|
// We still need to animate when coming back from next scene
|
|
80
83
|
// A hacky way to check this is if the next scene exists
|
|
81
|
-
!nextDescriptor ||
|
|
84
|
+
!nextDescriptor ||
|
|
85
|
+
// If next header is tranparent, we want to treat this header as static
|
|
86
|
+
// Otherwise it may show through the next header
|
|
87
|
+
nextHeaderTransparent || nextHeaderlessScene;
|
|
82
88
|
const props = {
|
|
83
89
|
back: headerBack,
|
|
84
90
|
progress: scene.progress,
|
|
@@ -87,6 +93,25 @@ export function HeaderContainer({
|
|
|
87
93
|
navigation: scene.descriptor.navigation,
|
|
88
94
|
styleInterpolator: mode === 'float' ? isHeaderStatic ? nextHeaderlessGestureDirection === 'vertical' || nextHeaderlessGestureDirection === 'vertical-inverted' ? forSlideUp : nextHeaderlessGestureDirection === 'horizontal-inverted' ? forSlideRight : forSlideLeft : headerStyleInterpolator : forNoAnimation
|
|
89
95
|
};
|
|
96
|
+
const onRef = node => {
|
|
97
|
+
node?.measure((_x, _y, _width, height) => {
|
|
98
|
+
if (height && !contentHeight?.measured) {
|
|
99
|
+
onContentHeightChange({
|
|
100
|
+
route: scene.descriptor.route,
|
|
101
|
+
height
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
const onLayout = e => {
|
|
107
|
+
const {
|
|
108
|
+
height
|
|
109
|
+
} = e.nativeEvent.layout;
|
|
110
|
+
onContentHeightChange({
|
|
111
|
+
route: scene.descriptor.route,
|
|
112
|
+
height
|
|
113
|
+
});
|
|
114
|
+
};
|
|
90
115
|
return /*#__PURE__*/_jsx(NavigationProvider, {
|
|
91
116
|
navigation: scene.descriptor.navigation,
|
|
92
117
|
route: scene.descriptor.route,
|
|
@@ -99,20 +124,13 @@ export function HeaderContainer({
|
|
|
99
124
|
// This is needed for screen readers, and testing tools on Android
|
|
100
125
|
// For float header, it's handled in CardStack
|
|
101
126
|
{
|
|
102
|
-
minHeight: contentHeight
|
|
127
|
+
minHeight: contentHeight?.value
|
|
103
128
|
} : null] : null, {
|
|
104
129
|
pointerEvents: isFocused ? 'box-none' : 'none'
|
|
105
130
|
}],
|
|
106
131
|
children: /*#__PURE__*/_jsx(View, {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
height
|
|
110
|
-
} = e.nativeEvent.layout;
|
|
111
|
-
onContentHeightChange({
|
|
112
|
-
route: scene.descriptor.route,
|
|
113
|
-
height
|
|
114
|
-
});
|
|
115
|
-
} : undefined,
|
|
132
|
+
ref: onRef,
|
|
133
|
+
onLayout: onLayout,
|
|
116
134
|
style: {
|
|
117
135
|
pointerEvents: 'box-none'
|
|
118
136
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getHeaderTitle","HeaderBackContext","ActivityView","NavigationProvider","useLinkBuilder","React","StyleSheet","View","forNoAnimation","forSlideLeft","forSlideRight","forSlideUp","Header","jsx","_jsx","HeaderContainer","mode","scenes","getPreviousScene","getFocusedRoute","contentHeight","onContentHeightChange","style","focusedRoute","parentHeaderBack","use","buildHref","styles","container","children","slice","map","scene","i","self","length","header","headerMode","headerShown","headerTransparent","headerStyleInterpolator","descriptor","options","isFocused","key","route","previousScene","headerBack","title","name","href","params","previousDescriptor","nextDescriptor","previousHeaderShown","previousHeaderMode","nextHeaderlessScene","find","currentHeaderShown","currentHeaderMode","gestureDirection","nextHeaderlessGestureDirection","isHeaderStatic","props","back","progress","navigation","styleInterpolator","
|
|
1
|
+
{"version":3,"names":["getHeaderTitle","HeaderBackContext","ActivityView","NavigationProvider","useLinkBuilder","React","StyleSheet","View","forNoAnimation","forSlideLeft","forSlideRight","forSlideUp","Header","jsx","_jsx","HeaderContainer","mode","scenes","getPreviousScene","getFocusedRoute","contentHeight","onContentHeightChange","style","focusedRoute","parentHeaderBack","use","buildHref","styles","container","children","slice","map","scene","i","self","length","header","headerMode","headerShown","headerTransparent","headerStyleInterpolator","descriptor","options","isFocused","key","route","previousScene","headerBack","title","name","href","params","previousDescriptor","nextDescriptor","previousHeaderShown","previousHeaderMode","nextHeaderTransparent","nextHeaderlessScene","find","currentHeaderShown","currentHeaderMode","gestureDirection","nextHeaderlessGestureDirection","isHeaderStatic","props","back","progress","navigation","styleInterpolator","onRef","node","measure","_x","_y","_width","height","measured","onLayout","e","nativeEvent","layout","absolute","minHeight","value","pointerEvents","ref","visible","undefined","create","position","top","start","end"],"sourceRoot":"../../../../src","sources":["views/Header/HeaderContainer.tsx"],"mappings":";;AAAA,SAASA,cAAc,EAAEC,iBAAiB,QAAQ,4BAA4B;AAC9E,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SACEC,kBAAkB,EAGlBC,cAAc,QACT,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAGEC,UAAU,EACVC,IAAI,QAEC,cAAc;AAErB,SACEC,cAAc,EACdC,YAAY,EACZC,aAAa,EACbC,UAAU,QACL,qDAAkD;AAOzD,SAASC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAoBlC,OAAO,SAASC,eAAeA,CAAC;EAC9BC,IAAI;EACJC,MAAM;EACNC,gBAAgB;EAChBC,eAAe;EACfC,aAAa;EACbC,qBAAqB;EACrBC;AACK,CAAC,EAAE;EACR,MAAMC,YAAY,GAAGJ,eAAe,CAAC,CAAC;EACtC,MAAMK,gBAAgB,GAAGnB,KAAK,CAACoB,GAAG,CAACxB,iBAAiB,CAAC;EACrD,MAAM;IAAEyB;EAAU,CAAC,GAAGtB,cAAc,CAAC,CAAC;EAEtC,oBACEU,IAAA,CAACP,IAAI;IAACe,KAAK,EAAE,CAACK,MAAM,CAACC,SAAS,EAAEN,KAAK,CAAE;IAAAO,QAAA,EAIpCZ,MAAM,CAACa,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,CAACC,KAAK,EAAEC,CAAC,EAAEC,IAAI,KAAK;MACxC,IAAKlB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AAzD,QAAA,EAEbO,MAAM,KAAKmD,SAAS,GAAGnD,MAAM,CAAC4B,KAAK,CAAC,gBAAGlD,IAAA,CAACF,MAAM;gBAAA,GAAKoD;cAAK,CAAG;YAAC,CACjD;UAAC,CACX;QAAC,CACH;MAAC,GApCFhC,KAAK,CAACS,UAAU,CAACI,KAAK,CAACD,GAqCV,CAAC;IAEzB,CAAC;EAAC,CACE,CAAC;AAEX;AAEA,MAAMjB,MAAM,GAAGrB,UAAU,CAACkF,MAAM,CAAC;EAC/B5D,SAAS,EAAE;IACTwD,aAAa,EAAE;EACjB,CAAC;EACDH,QAAQ,EAAE;IACRQ,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -7,9 +7,7 @@ import { StyleSheet, View } from 'react-native';
|
|
|
7
7
|
import { ModalPresentationContext } from "../../utils/ModalPresentationContext.js";
|
|
8
8
|
import { useKeyboardManager } from "../../utils/useKeyboardManager.js";
|
|
9
9
|
import { Card } from "./Card.js";
|
|
10
|
-
import { CardA11yWrapper } from "./CardA11yWrapper.js";
|
|
11
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
const EPSILON = 0.1;
|
|
13
11
|
function CardContainerInner({
|
|
14
12
|
interpolationIndex,
|
|
15
13
|
index,
|
|
@@ -21,11 +19,9 @@ function CardContainerInner({
|
|
|
21
19
|
modal,
|
|
22
20
|
getPreviousScene,
|
|
23
21
|
getFocusedRoute,
|
|
24
|
-
hasAbsoluteFloatHeader,
|
|
25
22
|
headerHeight,
|
|
26
23
|
onHeaderHeightChange,
|
|
27
24
|
isParentHeaderShown,
|
|
28
|
-
isNextScreenTransparent,
|
|
29
25
|
layout,
|
|
30
26
|
onCloseRoute,
|
|
31
27
|
onOpenRoute,
|
|
@@ -43,7 +39,6 @@ function CardContainerInner({
|
|
|
43
39
|
scene,
|
|
44
40
|
children
|
|
45
41
|
}) {
|
|
46
|
-
const wrapperRef = React.useRef(null);
|
|
47
42
|
const {
|
|
48
43
|
direction
|
|
49
44
|
} = useLocale();
|
|
@@ -112,7 +107,6 @@ function CardContainerInner({
|
|
|
112
107
|
closing,
|
|
113
108
|
gesture
|
|
114
109
|
}) => {
|
|
115
|
-
wrapperRef.current?.setInert(closing);
|
|
116
110
|
const {
|
|
117
111
|
route
|
|
118
112
|
} = scene.descriptor;
|
|
@@ -134,18 +128,6 @@ function CardContainerInner({
|
|
|
134
128
|
const {
|
|
135
129
|
colors
|
|
136
130
|
} = useTheme();
|
|
137
|
-
React.useEffect(() => {
|
|
138
|
-
const listener = scene.progress.next?.addListener?.(({
|
|
139
|
-
value
|
|
140
|
-
}) => {
|
|
141
|
-
wrapperRef.current?.setInert(value > EPSILON);
|
|
142
|
-
});
|
|
143
|
-
return () => {
|
|
144
|
-
if (listener) {
|
|
145
|
-
scene.progress.next?.removeListener?.(listener);
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
}, [scene.progress.next]);
|
|
149
131
|
const {
|
|
150
132
|
presentation,
|
|
151
133
|
animation,
|
|
@@ -189,72 +171,62 @@ function CardContainerInner({
|
|
|
189
171
|
return undefined;
|
|
190
172
|
}, [canGoBack, backTitle, href]);
|
|
191
173
|
const animated = animation !== 'none';
|
|
192
|
-
return /*#__PURE__*/_jsx(
|
|
193
|
-
ref: wrapperRef,
|
|
194
|
-
focused: focused,
|
|
195
|
-
active: active,
|
|
174
|
+
return /*#__PURE__*/_jsx(Card, {
|
|
196
175
|
animated: animated,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
value: headerBack,
|
|
248
|
-
children: /*#__PURE__*/_jsx(HeaderShownContext.Provider, {
|
|
249
|
-
value: isParentHeaderShown || headerShown !== false,
|
|
250
|
-
children: /*#__PURE__*/_jsx(HeaderHeightContext.Provider, {
|
|
251
|
-
value: headerShown !== false ? headerHeight : parentHeaderHeight ?? 0,
|
|
252
|
-
children: children
|
|
253
|
-
})
|
|
176
|
+
interpolationIndex: interpolationIndex,
|
|
177
|
+
gestureDirection: gestureDirection,
|
|
178
|
+
layout: layout,
|
|
179
|
+
insets: insets,
|
|
180
|
+
direction: direction,
|
|
181
|
+
gesture: gesture,
|
|
182
|
+
current: scene.progress.current,
|
|
183
|
+
next: scene.progress.next,
|
|
184
|
+
opening: opening,
|
|
185
|
+
closing: closing,
|
|
186
|
+
onOpen: handleOpen,
|
|
187
|
+
onClose: handleClose,
|
|
188
|
+
overlay: cardOverlay,
|
|
189
|
+
overlayEnabled: cardOverlayEnabled,
|
|
190
|
+
shadowEnabled: cardShadowEnabled,
|
|
191
|
+
onTransition: handleTransition,
|
|
192
|
+
onGestureBegin: handleGestureBegin,
|
|
193
|
+
onGestureCanceled: handleGestureCanceled,
|
|
194
|
+
onGestureEnd: handleGestureEnd,
|
|
195
|
+
gestureEnabled: index === 0 ? false : gestureEnabled,
|
|
196
|
+
gestureResponseDistance: gestureResponseDistance,
|
|
197
|
+
gestureVelocityImpact: gestureVelocityImpact,
|
|
198
|
+
transitionSpec: transitionSpec,
|
|
199
|
+
styleInterpolator: cardStyleInterpolator,
|
|
200
|
+
pageOverflowEnabled: headerMode !== 'float' && presentation !== 'modal',
|
|
201
|
+
preloaded: preloaded,
|
|
202
|
+
contentStyle: [{
|
|
203
|
+
backgroundColor: presentation === 'transparentModal' ? 'transparent' : colors.background
|
|
204
|
+
}, cardStyle],
|
|
205
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
206
|
+
style: styles.container,
|
|
207
|
+
children: /*#__PURE__*/_jsxs(ModalPresentationContext.Provider, {
|
|
208
|
+
value: modal,
|
|
209
|
+
children: [headerMode !== 'float' ? renderHeader({
|
|
210
|
+
mode: 'screen',
|
|
211
|
+
scenes: [previousScene, scene],
|
|
212
|
+
getPreviousScene,
|
|
213
|
+
getFocusedRoute,
|
|
214
|
+
contentHeight: headerHeight,
|
|
215
|
+
onContentHeightChange: onHeaderHeightChange,
|
|
216
|
+
style: styles.header
|
|
217
|
+
}) : null, /*#__PURE__*/_jsx(View, {
|
|
218
|
+
style: styles.scene,
|
|
219
|
+
children: /*#__PURE__*/_jsx(HeaderBackContext.Provider, {
|
|
220
|
+
value: headerBack,
|
|
221
|
+
children: /*#__PURE__*/_jsx(HeaderShownContext.Provider, {
|
|
222
|
+
value: isParentHeaderShown || headerShown !== false,
|
|
223
|
+
children: /*#__PURE__*/_jsx(HeaderHeightContext.Provider, {
|
|
224
|
+
value: headerShown !== false ? headerHeight?.value ?? 0 : parentHeaderHeight ?? 0,
|
|
225
|
+
children: children
|
|
254
226
|
})
|
|
255
227
|
})
|
|
256
|
-
})
|
|
257
|
-
})
|
|
228
|
+
})
|
|
229
|
+
})]
|
|
258
230
|
})
|
|
259
231
|
})
|
|
260
232
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getHeaderTitle","HeaderBackContext","HeaderHeightContext","HeaderShownContext","useLinkBuilder","useLocale","useTheme","React","StyleSheet","View","ModalPresentationContext","useKeyboardManager","Card","
|
|
1
|
+
{"version":3,"names":["getHeaderTitle","HeaderBackContext","HeaderHeightContext","HeaderShownContext","useLinkBuilder","useLocale","useTheme","React","StyleSheet","View","ModalPresentationContext","useKeyboardManager","Card","jsx","_jsx","jsxs","_jsxs","CardContainerInner","interpolationIndex","index","active","opening","closing","gesture","focused","modal","getPreviousScene","getFocusedRoute","headerHeight","onHeaderHeightChange","isParentHeaderShown","layout","onCloseRoute","onOpenRoute","onGestureCancel","onGestureEnd","onGestureStart","onTransitionEnd","onTransitionStart","preloaded","renderHeader","safeAreaInsetBottom","safeAreaInsetLeft","safeAreaInsetRight","safeAreaInsetTop","scene","children","direction","parentHeaderHeight","use","options","descriptor","enabled","keyboardHandlingEnabled","onPageChangeStart","onPageChangeCancel","onPageChangeConfirm","handleOpen","route","handleClose","handleGestureBegin","handleGestureCanceled","handleGestureEnd","handleTransition","insets","top","right","bottom","left","colors","presentation","animation","cardOverlay","cardOverlayEnabled","cardShadowEnabled","cardStyle","cardStyleInterpolator","gestureDirection","gestureEnabled","gestureResponseDistance","gestureVelocityImpact","headerMode","headerShown","transitionSpec","buildHref","previousScene","backTitle","href","name","params","canGoBack","headerBack","useMemo","title","undefined","animated","current","progress","next","onOpen","onClose","overlay","overlayEnabled","shadowEnabled","onTransition","onGestureBegin","onGestureCanceled","styleInterpolator","pageOverflowEnabled","contentStyle","backgroundColor","background","style","styles","container","Provider","value","mode","scenes","contentHeight","onContentHeightChange","header","CardContainer","memo","create","flex","zIndex"],"sourceRoot":"../../../../src","sources":["views/Stack/CardContainer.tsx"],"mappings":";;AAAA,SACEA,cAAc,EACdC,iBAAiB,EACjBC,mBAAmB,EACnBC,kBAAkB,QACb,4BAA4B;AACnC,SAEEC,cAAc,EACdC,SAAS,EACTC,QAAQ,QACH,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAAmBC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAGzD,SAASC,wBAAwB,QAAQ,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3B4F,qBAAqB,EAAE3F,oBAAoB;UAC3CmF,KAAK,EAAEC,MAAM,CAACQ;QAChB,CAAC,CAAC,GACF,IAAI,eACR3G,IAAA,CAACL,IAAI;UAACuG,KAAK,EAAEC,MAAM,CAACpE,KAAM;UAAAC,QAAA,eACxBhC,IAAA,CAACb,iBAAiB,CAACkH,QAAQ;YAACC,KAAK,EAAEzB,UAAW;YAAA7C,QAAA,eAC5ChC,IAAA,CAACX,kBAAkB,CAACgH,QAAQ;cAC1BC,KAAK,EAAEtF,mBAAmB,IAAIoD,WAAW,KAAK,KAAM;cAAApC,QAAA,eAEpDhC,IAAA,CAACZ,mBAAmB,CAACiH,QAAQ;gBAC3BC,KAAK,EACHlC,WAAW,KAAK,KAAK,GAChBtD,YAAY,EAAEwF,KAAK,IAAI,CAAC,GACxBpE,kBAAkB,IAAI,CAC5B;gBAAAF,QAAA,EAEAA;cAAQ,CACmB;YAAC,CACJ;UAAC,CACJ;QAAC,CACzB,CAAC;MAAA,CAC0B;IAAC,CAChC;EAAC,CACH,CAAC;AAEX;AAEA,OAAO,MAAM4E,aAAa,gBAAGnH,KAAK,CAACoH,IAAI,CAAC1G,kBAAkB,CAAC;AAE3D,MAAMgG,MAAM,GAAGzG,UAAU,CAACoH,MAAM,CAAC;EAC/BV,SAAS,EAAE;IACTW,IAAI,EAAE;EACR,CAAC;EACDJ,MAAM,EAAE;IACNK,MAAM,EAAE;EACV,CAAC;EACDjF,KAAK,EAAE;IACLgF,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -28,6 +28,10 @@ const NAMED_TRANSITIONS_PRESETS = {
|
|
|
28
28
|
const FALLBACK_DESCRIPTOR = Object.freeze({
|
|
29
29
|
options: {}
|
|
30
30
|
});
|
|
31
|
+
const HIDDEN_HEADER_HEIGHT = {
|
|
32
|
+
measured: false,
|
|
33
|
+
value: 0
|
|
34
|
+
};
|
|
31
35
|
const getInterpolationIndex = (scenes, index) => {
|
|
32
36
|
const {
|
|
33
37
|
cardStyleInterpolator
|
|
@@ -67,14 +71,32 @@ const getHeaderHeights = (scenes, insets, isParentHeaderShown, isParentModal, la
|
|
|
67
71
|
headerStyle
|
|
68
72
|
} = curr.descriptor.options;
|
|
69
73
|
const style = StyleSheet.flatten(headerStyle || {});
|
|
70
|
-
const height = 'height' in style && typeof style.height === 'number' ? style.height :
|
|
74
|
+
const height = 'height' in style && typeof style.height === 'number' ? style.height : undefined;
|
|
71
75
|
const interpolationIndex = getInterpolationIndex(scenes, index);
|
|
72
76
|
const isModal = getIsModal(curr, interpolationIndex, isParentModal);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
if (typeof height === 'number') {
|
|
78
|
+
acc[curr.route.key] = {
|
|
79
|
+
measured: true,
|
|
80
|
+
value: height
|
|
81
|
+
};
|
|
82
|
+
} else {
|
|
83
|
+
const previousHeight = previous[curr.route.key];
|
|
84
|
+
const defaultHeight = getDefaultHeaderHeight({
|
|
85
|
+
landscape: layout.width > layout.height,
|
|
86
|
+
modalPresentation: isModal,
|
|
87
|
+
topInset: headerStatusBarHeight
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// If we hadn't measured before, use re-computed default height
|
|
91
|
+
if (!previousHeight?.measured && defaultHeight !== previousHeight?.value) {
|
|
92
|
+
acc[curr.route.key] = {
|
|
93
|
+
measured: false,
|
|
94
|
+
value: defaultHeight
|
|
95
|
+
};
|
|
96
|
+
} else if (previousHeight) {
|
|
97
|
+
acc[curr.route.key] = previousHeight;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
78
100
|
return acc;
|
|
79
101
|
}, {});
|
|
80
102
|
};
|
|
@@ -259,13 +281,16 @@ export class CardStack extends React.Component {
|
|
|
259
281
|
headerHeights
|
|
260
282
|
}) => {
|
|
261
283
|
const previousHeight = headerHeights[route.key];
|
|
262
|
-
if (previousHeight === height) {
|
|
284
|
+
if (previousHeight?.value === height) {
|
|
263
285
|
return null;
|
|
264
286
|
}
|
|
265
287
|
return {
|
|
266
288
|
headerHeights: {
|
|
267
289
|
...headerHeights,
|
|
268
|
-
[route.key]:
|
|
290
|
+
[route.key]: {
|
|
291
|
+
measured: true,
|
|
292
|
+
value: height
|
|
293
|
+
}
|
|
269
294
|
}
|
|
270
295
|
};
|
|
271
296
|
});
|
|
@@ -334,6 +359,7 @@ export class CardStack extends React.Component {
|
|
|
334
359
|
return false;
|
|
335
360
|
});
|
|
336
361
|
const isFloatHeaderFocused = scenes.findLast(scene => scene.route.key === focusedRoute.key)?.descriptor.options.headerMode === 'float';
|
|
362
|
+
const focusedHeaderHeight = headerHeights[focusedRoute.key];
|
|
337
363
|
return /*#__PURE__*/_jsxs(View, {
|
|
338
364
|
style: styles.container,
|
|
339
365
|
children: [renderHeader({
|
|
@@ -347,7 +373,7 @@ export class CardStack extends React.Component {
|
|
|
347
373
|
// The header title can't be found with maestro without this
|
|
348
374
|
// In some cases, header buttons may not be touchable as well
|
|
349
375
|
isFloatHeaderFocused && {
|
|
350
|
-
height:
|
|
376
|
+
height: focusedHeaderHeight?.value
|
|
351
377
|
}]]
|
|
352
378
|
}), /*#__PURE__*/_jsx(View, {
|
|
353
379
|
style: styles.container,
|
|
@@ -356,18 +382,18 @@ export class CardStack extends React.Component {
|
|
|
356
382
|
const focused = focusedRoute.key === route.key;
|
|
357
383
|
const gesture = gestures[route.key];
|
|
358
384
|
const scene = scenes[index];
|
|
359
|
-
const isInactive = isInactiveRoute(route, this.props.routes);
|
|
360
385
|
const {
|
|
361
386
|
inactiveBehavior = 'pause',
|
|
362
387
|
animation,
|
|
363
388
|
headerShown = true,
|
|
389
|
+
headerMode,
|
|
364
390
|
headerTransparent
|
|
365
391
|
} = scene.descriptor.options;
|
|
366
392
|
const safeAreaInsetTop = insets.top;
|
|
367
393
|
const safeAreaInsetRight = insets.right;
|
|
368
394
|
const safeAreaInsetBottom = insets.bottom;
|
|
369
395
|
const safeAreaInsetLeft = insets.left;
|
|
370
|
-
const headerHeight = headerShown !== false ? headerHeights[route.key] :
|
|
396
|
+
const headerHeight = headerShown !== false ? headerHeights[route.key] : HIDDEN_HEADER_HEIGHT;
|
|
371
397
|
|
|
372
398
|
// Start from current card and count backwards the number of cards with same interpolation
|
|
373
399
|
const interpolationIndex = getInterpolationIndex(scenes, index);
|
|
@@ -379,19 +405,28 @@ export class CardStack extends React.Component {
|
|
|
379
405
|
const isNextScreenTransparent = scenes[index + 1]?.descriptor.options.presentation === 'transparentModal';
|
|
380
406
|
const isRemoving = replacingRouteKeys.includes(route.key) || closingRouteKeys.includes(route.key);
|
|
381
407
|
const isFocusing = openingRouteKeys.includes(route.key) || [...closingRouteKeys, ...replacingRouteKeys].includes(self[index + 1]?.key);
|
|
408
|
+
const isInactive = isInactiveRoute(route, this.props.routes);
|
|
409
|
+
const isRetained = state.retainedRouteKeys?.includes(route.key);
|
|
410
|
+
const isPreloaded = isInactive && !isRetained;
|
|
411
|
+
const isTopmost = index === routes.length - 1;
|
|
382
412
|
const isBeforeLast = index === routes.length - 2;
|
|
383
413
|
|
|
384
414
|
// Keep animating and the last two rendered routes visible for smoother transitions
|
|
385
415
|
const isVisible = focused || isNextScreenTransparent ||
|
|
416
|
+
// React native destroys the view when hidden
|
|
417
|
+
// So we keep retained screens visible
|
|
418
|
+
// This makes sure any videos being played don't stop etc.
|
|
419
|
+
isRetained ||
|
|
386
420
|
// We only need to keep other screens visible when animation is enabled
|
|
387
421
|
isAnimationEnabled && (isFocusing || isRemoving ||
|
|
388
|
-
// Preloaded
|
|
389
|
-
!
|
|
422
|
+
// Preloaded screens should stay mounted, but remain hidden until focused
|
|
423
|
+
!isPreloaded && index >= routes.length - 2);
|
|
390
424
|
const activityMode =
|
|
391
425
|
// Render focused and animating screens normally
|
|
392
426
|
focused || isFocusing ? 'normal' : inactiveBehavior === 'none' ||
|
|
393
427
|
// Unpause preloaded or retained screens so updates are visible
|
|
394
|
-
isInactive
|
|
428
|
+
// Handle retained explicitly as isInactive won't be updated until animation end
|
|
429
|
+
isInactive || isRetained ||
|
|
395
430
|
// Keep the screen before transparent screen active
|
|
396
431
|
// This lets the screen under the transparent screen update and animate
|
|
397
432
|
isNextScreenTransparent ||
|
|
@@ -406,41 +441,52 @@ export class CardStack extends React.Component {
|
|
|
406
441
|
if (activityMode === 'unmounted') {
|
|
407
442
|
return null;
|
|
408
443
|
}
|
|
409
|
-
return /*#__PURE__*/_jsx(
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
+
return /*#__PURE__*/_jsx(ActivityView, {
|
|
445
|
+
mode: activityMode,
|
|
446
|
+
visible: isVisible,
|
|
447
|
+
style: {
|
|
448
|
+
...StyleSheet.absoluteFill,
|
|
449
|
+
// Avoid unfocused larger pages increasing scroll area
|
|
450
|
+
// e.g. when a smaller screen is pushed over a larger one on web
|
|
451
|
+
overflow: isTopmost ? undefined : 'hidden',
|
|
452
|
+
marginTop: headerTransparent || headerMode === 'screen' ? 0 :
|
|
453
|
+
// Add offset for non-transparent floating header
|
|
454
|
+
isFloatHeaderAbsolute ?
|
|
455
|
+
// If header is absolute, offset the card by the header height
|
|
456
|
+
headerHeight?.value :
|
|
457
|
+
// Otherwise, the in-flow float header already takes the
|
|
458
|
+
// focused header's space, so offset by the difference
|
|
459
|
+
headerHeight && focusedHeaderHeight ? headerHeight.value - focusedHeaderHeight.value : 0
|
|
460
|
+
},
|
|
461
|
+
children: /*#__PURE__*/_jsx(CardContainer, {
|
|
462
|
+
index: index,
|
|
463
|
+
interpolationIndex: interpolationIndex,
|
|
464
|
+
modal: isModal,
|
|
465
|
+
active: isTopmost,
|
|
466
|
+
focused: focused,
|
|
467
|
+
opening: openingRouteKeys.includes(route.key),
|
|
468
|
+
closing: closingRouteKeys.includes(route.key),
|
|
469
|
+
layout: layout,
|
|
470
|
+
gesture: gesture,
|
|
471
|
+
scene: scene,
|
|
472
|
+
safeAreaInsetTop: safeAreaInsetTop,
|
|
473
|
+
safeAreaInsetRight: safeAreaInsetRight,
|
|
474
|
+
safeAreaInsetBottom: safeAreaInsetBottom,
|
|
475
|
+
safeAreaInsetLeft: safeAreaInsetLeft,
|
|
476
|
+
onGestureStart: onGestureStart,
|
|
477
|
+
onGestureCancel: onGestureCancel,
|
|
478
|
+
onGestureEnd: onGestureEnd,
|
|
479
|
+
headerHeight: headerHeight,
|
|
480
|
+
isParentHeaderShown: isParentHeaderShown,
|
|
481
|
+
onHeaderHeightChange: this.handleHeaderLayout,
|
|
482
|
+
getPreviousScene: this.getPreviousScene,
|
|
483
|
+
getFocusedRoute: this.getFocusedRoute,
|
|
484
|
+
renderHeader: renderHeader,
|
|
485
|
+
onOpenRoute: onOpenRoute,
|
|
486
|
+
onCloseRoute: onCloseRoute,
|
|
487
|
+
onTransitionStart: onTransitionStart,
|
|
488
|
+
onTransitionEnd: onTransitionEnd,
|
|
489
|
+
preloaded: isInactive,
|
|
444
490
|
children: scene.descriptor.render()
|
|
445
491
|
})
|
|
446
492
|
}, route.key);
|