@react-navigation/stack 8.0.0-alpha.30 → 8.0.0-alpha.32

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.
@@ -24,7 +24,7 @@ export function HeaderContainer({
24
24
  } = useLinkBuilder();
25
25
  return /*#__PURE__*/_jsx(View, {
26
26
  style: [styles.container, style],
27
- children: scenes.slice(-2).map((scene, i, self) => {
27
+ children: scenes.map((scene, i, self) => {
28
28
  if (mode === 'screen' && i !== self.length - 1 || !scene) {
29
29
  return null;
30
30
  }
@@ -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 || nextHeaderlessScene;
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
- onLayout: onContentHeightChange ? e => {
108
- const {
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","absolute","minHeight","pointerEvents","onLayout","e","height","nativeEvent","layout","undefined","visible","create","position","top","start","end"],"sourceRoot":"../../../../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IAAA,CAACP,IAAI;YACHgE,QAAQ,EACNlD,qBAAqB,GAChBmD,CAAC,IAAK;cACL,MAAM;gBAAEC;cAAO,CAAC,GAAGD,CAAC,CAACE,WAAW,CAACC,MAAM;cAEvCtD,qBAAqB,CAAC;gBACpBwB,KAAK,EAAEb,KAAK,CAACS,UAAU,CAACI,KAAK;gBAC7B4B;cACF,CAAC,CAAC;YACJ,CAAC,GACDG,SACL;YACDtD,KAAK,EAAE;cAAEgD,aAAa,EAAE;YAAW,CAAE;YAAAzC,QAAA,eAErCf,IAAA,CAACZ,YAAY;cACXc,IAAI,EAAE2B,SAAS,GAAG,QAAQ,GAAG,OAAQ;cACrCkC,OAAO,EAAE,IAAK;cAAAhD,QAAA,EAEbO,MAAM,KAAKwC,SAAS,GAAGxC,MAAM,CAAC2B,KAAK,CAAC,gBAAGjD,IAAA,CAACF,MAAM;gBAAA,GAAKmD;cAAK,CAAG;YAAC,CACjD;UAAC,CACX;QAAC,CACH;MAAC,GA9CF/B,KAAK,CAACS,UAAU,CAACI,KAAK,CAACD,GA+CV,CAAC;IAEzB,CAAC;EAAC,CACE,CAAC;AAEX;AAEA,MAAMjB,MAAM,GAAGrB,UAAU,CAACwE,MAAM,CAAC;EAC/BlD,SAAS,EAAE;IACT0C,aAAa,EAAE;EACjB,CAAC;EACDF,QAAQ,EAAE;IACRW,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
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","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","slice","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,EACpCZ,MAAM,CAACa,GAAG,CAAC,CAACC,KAAK,EAAEC,CAAC,EAAEC,IAAI,KAAK;MAC9B,IAAKjB,IAAI,KAAK,QAAQ,IAAIgB,CA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AKoD,SAAS,GAAGpD,MAAM,CAAC6B,KAAK,CAAC,gBAAGlD,IAAA,CAACF,MAAM;gBAAA,GAAKoD;cAAK,CAAG;YAAC,CACjD;UAAC,CACX;QAAC,CACH;MAAC,GApCFjC,KAAK,CAACS,UAAU,CAACI,KAAK,CAACD,GAqCV,CAAC;IAEzB,CAAC;EAAC,CACE,CAAC;AAEX;AAEA,MAAMhB,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(CardA11yWrapper, {
193
- ref: wrapperRef,
194
- focused: focused,
195
- active: active,
174
+ return /*#__PURE__*/_jsx(Card, {
196
175
  animated: animated,
197
- isNextScreenTransparent: isNextScreenTransparent,
198
- children: /*#__PURE__*/_jsx(Card, {
199
- animated: animated,
200
- interpolationIndex: interpolationIndex,
201
- gestureDirection: gestureDirection,
202
- layout: layout,
203
- insets: insets,
204
- direction: direction,
205
- gesture: gesture,
206
- current: scene.progress.current,
207
- next: scene.progress.next,
208
- opening: opening,
209
- closing: closing,
210
- onOpen: handleOpen,
211
- onClose: handleClose,
212
- overlay: cardOverlay,
213
- overlayEnabled: cardOverlayEnabled,
214
- shadowEnabled: cardShadowEnabled,
215
- onTransition: handleTransition,
216
- onGestureBegin: handleGestureBegin,
217
- onGestureCanceled: handleGestureCanceled,
218
- onGestureEnd: handleGestureEnd,
219
- gestureEnabled: index === 0 ? false : gestureEnabled,
220
- gestureResponseDistance: gestureResponseDistance,
221
- gestureVelocityImpact: gestureVelocityImpact,
222
- transitionSpec: transitionSpec,
223
- styleInterpolator: cardStyleInterpolator,
224
- pageOverflowEnabled: headerMode !== 'float' && presentation !== 'modal',
225
- preloaded: preloaded,
226
- containerStyle: hasAbsoluteFloatHeader && headerMode !== 'screen' ? {
227
- marginTop: headerHeight
228
- } : null,
229
- contentStyle: [{
230
- backgroundColor: presentation === 'transparentModal' ? 'transparent' : colors.background
231
- }, cardStyle],
232
- children: /*#__PURE__*/_jsx(View, {
233
- style: styles.container,
234
- children: /*#__PURE__*/_jsxs(ModalPresentationContext.Provider, {
235
- value: modal,
236
- children: [headerMode !== 'float' ? renderHeader({
237
- mode: 'screen',
238
- scenes: [previousScene, scene],
239
- getPreviousScene,
240
- getFocusedRoute,
241
- contentHeight: headerHeight,
242
- onContentHeightChange: onHeaderHeightChange,
243
- style: styles.header
244
- }) : null, /*#__PURE__*/_jsx(View, {
245
- style: styles.scene,
246
- children: /*#__PURE__*/_jsx(HeaderBackContext.Provider, {
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","CardA11yWrapper","jsx","_jsx","jsxs","_jsxs","EPSILON","CardContainerInner","interpolationIndex","index","active","opening","closing","gesture","focused","modal","getPreviousScene","getFocusedRoute","hasAbsoluteFloatHeader","headerHeight","onHeaderHeightChange","isParentHeaderShown","isNextScreenTransparent","layout","onCloseRoute","onOpenRoute","onGestureCancel","onGestureEnd","onGestureStart","onTransitionEnd","onTransitionStart","preloaded","renderHeader","safeAreaInsetBottom","safeAreaInsetLeft","safeAreaInsetRight","safeAreaInsetTop","scene","children","wrapperRef","useRef","direction","parentHeaderHeight","use","options","descriptor","enabled","keyboardHandlingEnabled","onPageChangeStart","onPageChangeCancel","onPageChangeConfirm","handleOpen","route","handleClose","handleGestureBegin","handleGestureCanceled","handleGestureEnd","handleTransition","current","setInert","insets","top","right","bottom","left","colors","useEffect","listener","progress","next","addListener","value","removeListener","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","ref","onOpen","onClose","overlay","overlayEnabled","shadowEnabled","onTransition","onGestureBegin","onGestureCanceled","styleInterpolator","pageOverflowEnabled","containerStyle","marginTop","contentStyle","backgroundColor","background","style","styles","container","Provider","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,yCAAsC;AAC/E,SAASC,kBAAkB,QAAQ,mCAAgC;AAEnE,SAASC,IAAI,QAAQ,WAAQ;AAC7B,SAASC,eAAe,QAAiC,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA0C7E,MAAMC,OAAO,GAAG,GAAG;AAEnB,SAASC,kBAAkBA,CAAC;EAC1BC,kBAAkB;EAClBC,KAAK;EACLC,MAAM;EACNC,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC,KAAK;EACLC,gBAAgB;EAChBC,eAAe;EACfC,sBAAsB;EACtBC,YAAY;EACZC,oBAAoB;EACpBC,mBAAmB;EACnBC,uBAAuB;EACvBC,MAAM;EACNC,YAAY;EACZC,WAAW;EACXC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AAC;AAE3D,MAAM6G,MAAM,GAAGxH,UAAU,CAACkI,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE;EACR,CAAC;EACDJ,MAAM,EAAE;IACNK,MAAM,EAAE;EACV,CAAC;EACD3F,KAAK,EAAE;IACL0F,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
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,m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ESCRIPTOR = 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 : previous[curr.route.key];
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
- acc[curr.route.key] = typeof height === 'number' ? height : getDefaultHeaderHeight({
74
- landscape: layout.width > layout.height,
75
- modalPresentation: isModal,
76
- topInset: headerStatusBarHeight
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]: height
290
+ [route.key]: {
291
+ measured: true,
292
+ value: height
293
+ }
269
294
  }
270
295
  };
271
296
  });
@@ -321,7 +346,12 @@ export class CardStack extends React.Component {
321
346
  } = this.state;
322
347
  const allRoutes = getAllRoutes(routes, state);
323
348
  const focusedRoute = state.routes[state.index];
324
- const isFloatHeaderAbsolute = scenes.slice(-2).some(scene => {
349
+
350
+ // Render only two top-most active headers as a workaround for
351
+ // https://github.com/react-navigation/react-navigation/issues/12456.
352
+ // If the header is persisted, it might be placed incorrectly when navigating back
353
+ const activeHeaderScenes = scenes.filter(scene => !isInactiveRoute(scene.route, routes)).slice(-2);
354
+ const isFloatHeaderAbsolute = activeHeaderScenes.some(scene => {
325
355
  const options = scene.descriptor.options ?? {};
326
356
  const {
327
357
  headerMode,
@@ -334,11 +364,12 @@ export class CardStack extends React.Component {
334
364
  return false;
335
365
  });
336
366
  const isFloatHeaderFocused = scenes.findLast(scene => scene.route.key === focusedRoute.key)?.descriptor.options.headerMode === 'float';
367
+ const focusedHeaderHeight = headerHeights[focusedRoute.key];
337
368
  return /*#__PURE__*/_jsxs(View, {
338
369
  style: styles.container,
339
370
  children: [renderHeader({
340
371
  mode: 'float',
341
- scenes,
372
+ scenes: activeHeaderScenes,
342
373
  getPreviousScene: this.getPreviousScene,
343
374
  getFocusedRoute: this.getFocusedRoute,
344
375
  contentHeight: headerHeights[focusedRoute.key],
@@ -347,7 +378,7 @@ export class CardStack extends React.Component {
347
378
  // The header title can't be found with maestro without this
348
379
  // In some cases, header buttons may not be touchable as well
349
380
  isFloatHeaderFocused && {
350
- height: headerHeights[focusedRoute.key]
381
+ height: focusedHeaderHeight?.value
351
382
  }]]
352
383
  }), /*#__PURE__*/_jsx(View, {
353
384
  style: styles.container,
@@ -356,18 +387,18 @@ export class CardStack extends React.Component {
356
387
  const focused = focusedRoute.key === route.key;
357
388
  const gesture = gestures[route.key];
358
389
  const scene = scenes[index];
359
- const isInactive = isInactiveRoute(route, this.props.routes);
360
390
  const {
361
391
  inactiveBehavior = 'pause',
362
392
  animation,
363
393
  headerShown = true,
394
+ headerMode,
364
395
  headerTransparent
365
396
  } = scene.descriptor.options;
366
397
  const safeAreaInsetTop = insets.top;
367
398
  const safeAreaInsetRight = insets.right;
368
399
  const safeAreaInsetBottom = insets.bottom;
369
400
  const safeAreaInsetLeft = insets.left;
370
- const headerHeight = headerShown !== false ? headerHeights[route.key] : 0;
401
+ const headerHeight = headerShown !== false ? headerHeights[route.key] : HIDDEN_HEADER_HEIGHT;
371
402
 
372
403
  // Start from current card and count backwards the number of cards with same interpolation
373
404
  const interpolationIndex = getInterpolationIndex(scenes, index);
@@ -379,19 +410,28 @@ export class CardStack extends React.Component {
379
410
  const isNextScreenTransparent = scenes[index + 1]?.descriptor.options.presentation === 'transparentModal';
380
411
  const isRemoving = replacingRouteKeys.includes(route.key) || closingRouteKeys.includes(route.key);
381
412
  const isFocusing = openingRouteKeys.includes(route.key) || [...closingRouteKeys, ...replacingRouteKeys].includes(self[index + 1]?.key);
413
+ const isInactive = isInactiveRoute(route, this.props.routes);
414
+ const isRetained = state.retainedRouteKeys?.includes(route.key);
415
+ const isPreloaded = isInactive && !isRetained;
416
+ const isTopmost = index === routes.length - 1;
382
417
  const isBeforeLast = index === routes.length - 2;
383
418
 
384
419
  // Keep animating and the last two rendered routes visible for smoother transitions
385
420
  const isVisible = focused || isNextScreenTransparent ||
421
+ // React native destroys the view when hidden
422
+ // So we keep retained screens visible
423
+ // This makes sure any videos being played don't stop etc.
424
+ isRetained ||
386
425
  // We only need to keep other screens visible when animation is enabled
387
426
  isAnimationEnabled && (isFocusing || isRemoving ||
388
- // Preloaded and retained screens should stay mounted, but remain hidden until focused
389
- !isInactive && index >= routes.length - 2);
427
+ // Preloaded screens should stay mounted, but remain hidden until focused
428
+ !isPreloaded && index >= routes.length - 2);
390
429
  const activityMode =
391
430
  // Render focused and animating screens normally
392
431
  focused || isFocusing ? 'normal' : inactiveBehavior === 'none' ||
393
432
  // Unpause preloaded or retained screens so updates are visible
394
- isInactive ||
433
+ // Handle retained explicitly as isInactive won't be updated until animation end
434
+ isInactive || isRetained ||
395
435
  // Keep the screen before transparent screen active
396
436
  // This lets the screen under the transparent screen update and animate
397
437
  isNextScreenTransparent ||
@@ -406,41 +446,52 @@ export class CardStack extends React.Component {
406
446
  if (activityMode === 'unmounted') {
407
447
  return null;
408
448
  }
409
- return /*#__PURE__*/_jsx(CardContainer, {
410
- index: index,
411
- interpolationIndex: interpolationIndex,
412
- modal: isModal,
413
- active: index === routes.length - 1,
414
- focused: focused,
415
- opening: openingRouteKeys.includes(route.key),
416
- closing: closingRouteKeys.includes(route.key),
417
- layout: layout,
418
- gesture: gesture,
419
- scene: scene,
420
- safeAreaInsetTop: safeAreaInsetTop,
421
- safeAreaInsetRight: safeAreaInsetRight,
422
- safeAreaInsetBottom: safeAreaInsetBottom,
423
- safeAreaInsetLeft: safeAreaInsetLeft,
424
- onGestureStart: onGestureStart,
425
- onGestureCancel: onGestureCancel,
426
- onGestureEnd: onGestureEnd,
427
- headerHeight: headerHeight,
428
- isParentHeaderShown: isParentHeaderShown,
429
- onHeaderHeightChange: this.handleHeaderLayout,
430
- getPreviousScene: this.getPreviousScene,
431
- getFocusedRoute: this.getFocusedRoute,
432
- hasAbsoluteFloatHeader: isFloatHeaderAbsolute && !headerTransparent,
433
- renderHeader: renderHeader,
434
- onOpenRoute: onOpenRoute,
435
- onCloseRoute: onCloseRoute,
436
- onTransitionStart: onTransitionStart,
437
- onTransitionEnd: onTransitionEnd,
438
- isNextScreenTransparent: isNextScreenTransparent,
439
- preloaded: isInactive,
440
- children: /*#__PURE__*/_jsx(ActivityView, {
441
- mode: activityMode,
442
- visible: isVisible,
443
- style: StyleSheet.absoluteFill,
449
+ return /*#__PURE__*/_jsx(ActivityView, {
450
+ mode: activityMode,
451
+ visible: isVisible,
452
+ style: {
453
+ ...StyleSheet.absoluteFill,
454
+ // Avoid unfocused larger pages increasing scroll area
455
+ // e.g. when a smaller screen is pushed over a larger one on web
456
+ overflow: isTopmost ? undefined : 'hidden',
457
+ marginTop: headerTransparent || headerMode === 'screen' ? 0 :
458
+ // Add offset for non-transparent floating header
459
+ isFloatHeaderAbsolute ?
460
+ // If header is absolute, offset the card by the header height
461
+ headerHeight?.value :
462
+ // Otherwise, the in-flow float header already takes the
463
+ // focused header's space, so offset by the difference
464
+ headerHeight && focusedHeaderHeight ? headerHeight.value - focusedHeaderHeight.value : 0
465
+ },
466
+ children: /*#__PURE__*/_jsx(CardContainer, {
467
+ index: index,
468
+ interpolationIndex: interpolationIndex,
469
+ modal: isModal,
470
+ active: isTopmost,
471
+ focused: focused,
472
+ opening: openingRouteKeys.includes(route.key),
473
+ closing: closingRouteKeys.includes(route.key),
474
+ layout: layout,
475
+ gesture: gesture,
476
+ scene: scene,
477
+ safeAreaInsetTop: safeAreaInsetTop,
478
+ safeAreaInsetRight: safeAreaInsetRight,
479
+ safeAreaInsetBottom: safeAreaInsetBottom,
480
+ safeAreaInsetLeft: safeAreaInsetLeft,
481
+ onGestureStart: onGestureStart,
482
+ onGestureCancel: onGestureCancel,
483
+ onGestureEnd: onGestureEnd,
484
+ headerHeight: headerHeight,
485
+ isParentHeaderShown: isParentHeaderShown,
486
+ onHeaderHeightChange: this.handleHeaderLayout,
487
+ getPreviousScene: this.getPreviousScene,
488
+ getFocusedRoute: this.getFocusedRoute,
489
+ renderHeader: renderHeader,
490
+ onOpenRoute: onOpenRoute,
491
+ onCloseRoute: onCloseRoute,
492
+ onTransitionStart: onTransitionStart,
493
+ onTransitionEnd: onTransitionEnd,
494
+ preloaded: isInactive,
444
495
  children: scene.descriptor.render()
445
496
  })
446
497
  }, route.key);