@react-navigation/stack 6.0.11 → 6.2.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 (81) hide show
  1. package/lib/commonjs/TransitionConfigs/CardStyleInterpolators.js +72 -64
  2. package/lib/commonjs/TransitionConfigs/CardStyleInterpolators.js.map +1 -1
  3. package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js +37 -32
  4. package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
  5. package/lib/commonjs/TransitionConfigs/TransitionPresets.js +1 -1
  6. package/lib/commonjs/TransitionConfigs/TransitionSpecs.js +1 -1
  7. package/lib/commonjs/index.js +13 -11
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/navigators/createStackNavigator.js +26 -21
  10. package/lib/commonjs/navigators/createStackNavigator.js.map +1 -1
  11. package/lib/commonjs/utils/debounce.js +5 -1
  12. package/lib/commonjs/utils/debounce.js.map +1 -1
  13. package/lib/commonjs/utils/memoize.js +5 -1
  14. package/lib/commonjs/utils/memoize.js.map +1 -1
  15. package/lib/commonjs/views/GestureHandler.js +7 -4
  16. package/lib/commonjs/views/GestureHandler.js.map +1 -1
  17. package/lib/commonjs/views/GestureHandlerNative.js +1 -1
  18. package/lib/commonjs/views/Header/Header.js +10 -9
  19. package/lib/commonjs/views/Header/Header.js.map +1 -1
  20. package/lib/commonjs/views/Header/HeaderContainer.js +10 -9
  21. package/lib/commonjs/views/Header/HeaderContainer.js.map +1 -1
  22. package/lib/commonjs/views/Header/HeaderSegment.js +5 -0
  23. package/lib/commonjs/views/Header/HeaderSegment.js.map +1 -1
  24. package/lib/commonjs/views/ModalStatusBarManager.js +11 -9
  25. package/lib/commonjs/views/ModalStatusBarManager.js.map +1 -1
  26. package/lib/commonjs/views/Screens.js +14 -10
  27. package/lib/commonjs/views/Screens.js.map +1 -1
  28. package/lib/commonjs/views/Stack/Card.js +32 -24
  29. package/lib/commonjs/views/Stack/Card.js.map +1 -1
  30. package/lib/commonjs/views/Stack/CardContainer.js +43 -40
  31. package/lib/commonjs/views/Stack/CardContainer.js.map +1 -1
  32. package/lib/commonjs/views/Stack/CardSheet.js +7 -6
  33. package/lib/commonjs/views/Stack/CardSheet.js.map +1 -1
  34. package/lib/commonjs/views/Stack/CardStack.js +26 -17
  35. package/lib/commonjs/views/Stack/CardStack.js.map +1 -1
  36. package/lib/commonjs/views/Stack/StackView.js +62 -46
  37. package/lib/commonjs/views/Stack/StackView.js.map +1 -1
  38. package/lib/module/TransitionConfigs/CardStyleInterpolators.js +67 -59
  39. package/lib/module/TransitionConfigs/CardStyleInterpolators.js.map +1 -1
  40. package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js +35 -30
  41. package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
  42. package/lib/module/index.js.map +1 -1
  43. package/lib/module/navigators/createStackNavigator.js +25 -20
  44. package/lib/module/navigators/createStackNavigator.js.map +1 -1
  45. package/lib/module/utils/debounce.js +5 -1
  46. package/lib/module/utils/debounce.js.map +1 -1
  47. package/lib/module/utils/memoize.js +5 -1
  48. package/lib/module/utils/memoize.js.map +1 -1
  49. package/lib/module/views/GestureHandler.js +6 -3
  50. package/lib/module/views/GestureHandler.js.map +1 -1
  51. package/lib/module/views/Header/Header.js +10 -9
  52. package/lib/module/views/Header/Header.js.map +1 -1
  53. package/lib/module/views/Header/HeaderContainer.js +10 -9
  54. package/lib/module/views/Header/HeaderContainer.js.map +1 -1
  55. package/lib/module/views/Header/HeaderSegment.js +5 -0
  56. package/lib/module/views/Header/HeaderSegment.js.map +1 -1
  57. package/lib/module/views/ModalStatusBarManager.js +11 -9
  58. package/lib/module/views/ModalStatusBarManager.js.map +1 -1
  59. package/lib/module/views/Screens.js +13 -9
  60. package/lib/module/views/Screens.js.map +1 -1
  61. package/lib/module/views/Stack/Card.js +32 -24
  62. package/lib/module/views/Stack/Card.js.map +1 -1
  63. package/lib/module/views/Stack/CardContainer.js +43 -40
  64. package/lib/module/views/Stack/CardContainer.js.map +1 -1
  65. package/lib/module/views/Stack/CardSheet.js +7 -6
  66. package/lib/module/views/Stack/CardSheet.js.map +1 -1
  67. package/lib/module/views/Stack/CardStack.js +26 -17
  68. package/lib/module/views/Stack/CardStack.js.map +1 -1
  69. package/lib/module/views/Stack/StackView.js +62 -46
  70. package/lib/module/views/Stack/StackView.js.map +1 -1
  71. package/lib/typescript/src/index.d.ts +1 -1
  72. package/lib/typescript/src/navigators/createStackNavigator.d.ts +1 -1
  73. package/lib/typescript/src/types.d.ts +9 -5
  74. package/package.json +9 -9
  75. package/src/index.tsx +1 -0
  76. package/src/navigators/createStackNavigator.tsx +4 -1
  77. package/src/types.tsx +12 -4
  78. package/src/views/Header/HeaderSegment.tsx +16 -4
  79. package/src/views/Stack/Card.tsx +1 -1
  80. package/src/views/Stack/CardContainer.tsx +3 -2
  81. package/src/views/Stack/CardStack.tsx +19 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["CardStack.tsx"],"names":["Background","getDefaultHeaderHeight","SafeAreaProviderCompat","Color","React","Animated","Platform","StyleSheet","forModalPresentationIOS","forNoAnimation","forNoAnimationCard","DefaultTransition","ModalFadeTransition","ModalTransition","getDistanceForDirection","MaybeScreen","MaybeScreenContainer","getIsModalPresentation","CardContainer","EPSILON","STATE_INACTIVE","STATE_TRANSITIONING_OR_BELOW_TOP","STATE_ON_TOP","FALLBACK_DESCRIPTOR","Object","freeze","options","getInterpolationIndex","scenes","index","cardStyleInterpolator","descriptor","interpolationIndex","i","cardStyleInterpolatorCurrent","getIsModal","scene","isParentModal","isModalPresentation","isModal","getHeaderHeights","insets","isParentHeaderShown","layout","previous","reduce","acc","curr","headerStatusBarHeight","top","headerStyle","style","flatten","height","route","key","getDistanceFromOptions","presentation","gestureDirection","getProgressFromGesture","gesture","distance","width","Math","max","interpolate","inputRange","outputRange","CardStack","Component","getDerivedStateFromProps","props","state","routes","descriptors","gestures","animationEnabled","Value","openingRouteKeys","includes","map","self","previousRoute","nextRoute","oldScene","currentGesture","previousGesture","undefined","nextGesture","nextDescriptor","previousDescriptor","optionsForTransitionConfig","length","defaultTransitionPreset","OS","gestureEnabled","transitionSpec","headerStyleInterpolator","cardOverlayEnabled","headerMode","header","progress","current","next","__memo","every","it","headerHeights","constructor","e","nativeEvent","setState","previousHeight","getPreviousRoute","previousScene","find","initialMetrics","frame","render","closingRouteKeys","onOpenRoute","onCloseRoute","renderHeader","renderScene","onTransitionStart","onTransitionEnd","onGestureStart","onGestureEnd","onGestureCancel","detachInactiveScreens","focusedRoute","focusedHeaderHeight","isFloatHeaderAbsolute","slice","some","headerTransparent","headerShown","activeScreensLimit","detachPreviousScreen","lastIndexOf","floatingHeader","mode","getPreviousScene","getFocusedRoute","onContentHeightChange","handleHeaderLayout","styles","floating","absolute","container","handleLayout","focused","isScreenActive","sceneForActivity","outputValue","extrapolate","headerTintColor","safeAreaInsetTop","safeAreaInsetRight","right","safeAreaInsetBottom","bottom","safeAreaInsetLeft","left","headerHeight","backgroundColor","headerBackgroundColor","headerDarkContent","isDark","isNextScreenTransparent","detachCurrentScreen","absoluteFill","create","flex","position","zIndex"],"mappings":";;AAAA,SACEA,UADF,EAEEC,sBAFF,EAGEC,sBAHF,QAIO,4BAJP;AAUA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAGEC,QAHF,EAIEC,UAJF,QAKO,cALP;AAQA,SACEC,uBADF,EAEEC,cAAc,IAAIC,kBAFpB,QAGO,gDAHP;AAIA,SACEC,iBADF,EAEEC,mBAFF,EAGEC,eAHF,QAIO,2CAJP;AAaA,OAAOC,uBAAP,MAAoC,qCAApC;AAEA,SAASC,WAAT,EAAsBC,oBAAtB,QAAkD,YAAlD;AACA,SAASC,sBAAT,QAAuC,QAAvC;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AA0CA,MAAMC,OAAO,GAAG,IAAhB;AAEA,MAAMC,c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GQ,cAAH,GAAoB,IAjI5C,CADF;AAqID;;AAxekE;AA2erE,MAAMM,MAAM,GAAG3I,UAAU,CAACqK,MAAX,CAAkB;AAC/BvB,EAAAA,SAAS,EAAE;AACTwB,IAAAA,IAAI,EAAE;AADG,GADoB;AAI/BzB,EAAAA,QAAQ,EAAE;AACR0B,IAAAA,QAAQ,EAAE,UADF;AAER7H,IAAAA,GAAG,EAAE,CAFG;AAGRkH,IAAAA,IAAI,EAAE,CAHE;AAIRJ,IAAAA,KAAK,EAAE;AAJC,GAJqB;AAU/BZ,EAAAA,QAAQ,EAAE;AACR4B,IAAAA,MAAM,EAAE;AADA;AAVqB,CAAlB,CAAf","sourcesContent":["import {\n Background,\n getDefaultHeaderHeight,\n SafeAreaProviderCompat,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n Route,\n StackNavigationState,\n} from '@react-navigation/native';\nimport Color from 'color';\nimport * as React from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n Platform,\n StyleSheet,\n} from 'react-native';\nimport type { EdgeInsets } from 'react-native-safe-area-context';\n\nimport {\n forModalPresentationIOS,\n forNoAnimation as forNoAnimationCard,\n} from '../../TransitionConfigs/CardStyleInterpolators';\nimport {\n DefaultTransition,\n ModalFadeTransition,\n ModalTransition,\n} from '../../TransitionConfigs/TransitionPresets';\nimport type {\n Layout,\n Scene,\n StackDescriptor,\n StackDescriptorMap,\n StackHeaderMode,\n StackNavigationOptions,\n} from '../../types';\nimport getDistanceForDirection from '../../utils/getDistanceForDirection';\nimport type { Props as HeaderContainerProps } from '../Header/HeaderContainer';\nimport { MaybeScreen, MaybeScreenContainer } from '../Screens';\nimport { getIsModalPresentation } from './Card';\nimport CardContainer from './CardContainer';\n\ntype GestureValues = {\n [key: string]: Animated.Value;\n};\n\ntype Props = {\n insets: EdgeInsets;\n state: StackNavigationState<ParamListBase>;\n descriptors: StackDescriptorMap;\n routes: Route<string>[];\n openingRouteKeys: string[];\n closingRouteKeys: string[];\n onOpenRoute: (props: { route: Route<string> }) => void;\n onCloseRoute: (props: { route: Route<string> }) => void;\n getPreviousRoute: (props: {\n route: Route<string>;\n }) => Route<string> | undefined;\n renderHeader: (props: HeaderContainerProps) => React.ReactNode;\n renderScene: (props: { route: Route<string> }) => React.ReactNode;\n isParentHeaderShown: boolean;\n isParentModal: boolean;\n onTransitionStart: (\n props: { route: Route<string> },\n closing: boolean\n ) => void;\n onTransitionEnd: (props: { route: Route<string> }, closing: boolean) => void;\n onGestureStart: (props: { route: Route<string> }) => void;\n onGestureEnd: (props: { route: Route<string> }) => void;\n onGestureCancel: (props: { route: Route<string> }) => void;\n detachInactiveScreens?: boolean;\n};\n\ntype State = {\n routes: Route<string>[];\n descriptors: StackDescriptorMap;\n scenes: Scene[];\n gestures: GestureValues;\n layout: Layout;\n headerHeights: Record<string, number>;\n};\n\nconst EPSILON = 0.01;\n\nconst STATE_INACTIVE = 0;\nconst STATE_TRANSITIONING_OR_BELOW_TOP = 1;\nconst STATE_ON_TOP = 2;\n\nconst FALLBACK_DESCRIPTOR = Object.freeze({ options: {} });\n\nconst getInterpolationIndex = (scenes: Scene[], index: number) => {\n const { cardStyleInterpolator } = scenes[index].descriptor.options;\n\n // Start from current card and count backwards the number of cards with same interpolation\n let interpolationIndex = 0;\n\n for (let i = index - 1; i >= 0; i--) {\n const cardStyleInterpolatorCurrent =\n scenes[i]?.descriptor.options.cardStyleInterpolator;\n\n if (cardStyleInterpolatorCurrent !== cardStyleInterpolator) {\n break;\n }\n\n interpolationIndex++;\n }\n\n return interpolationIndex;\n};\n\nconst getIsModal = (\n scene: Scene,\n interpolationIndex: number,\n isParentModal: boolean\n) => {\n if (isParentModal) {\n return true;\n }\n\n const { cardStyleInterpolator } = scene.descriptor.options;\n const isModalPresentation = getIsModalPresentation(cardStyleInterpolator);\n const isModal = isModalPresentation && interpolationIndex !== 0;\n\n return isModal;\n};\n\nconst getHeaderHeights = (\n scenes: Scene[],\n insets: EdgeInsets,\n isParentHeaderShown: boolean,\n isParentModal: boolean,\n layout: Layout,\n previous: Record<string, number>\n) => {\n return scenes.reduce<Record<string, number>>((acc, curr, index) => {\n const {\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n headerStyle,\n } = curr.descriptor.options;\n\n const style = StyleSheet.flatten(headerStyle || {});\n\n const height =\n typeof style.height === 'number'\n ? style.height\n : previous[curr.route.key];\n\n const interpolationIndex = getInterpolationIndex(scenes, index);\n const isModal = getIsModal(curr, interpolationIndex, isParentModal);\n\n acc[curr.route.key] =\n typeof height === 'number'\n ? height\n : getDefaultHeaderHeight(layout, isModal, headerStatusBarHeight);\n\n return acc;\n }, {});\n};\n\nconst getDistanceFromOptions = (\n layout: Layout,\n descriptor?: StackDescriptor\n) => {\n const {\n presentation,\n gestureDirection = presentation === 'modal'\n ? ModalTransition.gestureDirection\n : DefaultTransition.gestureDirection,\n } = (descriptor?.options || {}) as StackNavigationOptions;\n\n return getDistanceForDirection(layout, gestureDirection);\n};\n\nconst getProgressFromGesture = (\n gesture: Animated.Value,\n layout: Layout,\n descriptor?: StackDescriptor\n) => {\n const distance = getDistanceFromOptions(\n {\n // Make sure that we have a non-zero distance, otherwise there will be incorrect progress\n // This causes blank screen on web if it was previously inside container with display: none\n width: Math.max(1, layout.width),\n height: Math.max(1, layout.height),\n },\n descriptor\n );\n\n if (distance > 0) {\n return gesture.interpolate({\n inputRange: [0, distance],\n outputRange: [1, 0],\n });\n }\n\n return gesture.interpolate({\n inputRange: [distance, 0],\n outputRange: [0, 1],\n });\n};\n\nexport default class CardStack extends React.Component<Props, State> {\n static getDerivedStateFromProps(\n props: Props,\n state: State\n ): Partial<State> | null {\n if (\n props.routes === state.routes &&\n props.descriptors === state.descriptors\n ) {\n return null;\n }\n\n const gestures = props.routes.reduce<GestureValues>((acc, curr) => {\n const descriptor = props.descriptors[curr.key];\n const { animationEnabled } = descriptor?.options || {};\n\n acc[curr.key] =\n state.gestures[curr.key] ||\n new Animated.Value(\n props.openingRouteKeys.includes(curr.key) &&\n animationEnabled !== false\n ? getDistanceFromOptions(state.layout, descriptor)\n : 0\n );\n\n return acc;\n }, {});\n\n const scenes = props.routes.map((route, index, self) => {\n const previousRoute = self[index - 1];\n const nextRoute = self[index + 1];\n\n const oldScene = state.scenes[index];\n\n const currentGesture = gestures[route.key];\n const previousGesture = previousRoute\n ? gestures[previousRoute.key]\n : undefined;\n const nextGesture = nextRoute ? gestures[nextRoute.key] : undefined;\n\n const descriptor =\n props.descriptors[route.key] ||\n state.descriptors[route.key] ||\n (oldScene ? oldScene.descriptor : FALLBACK_DESCRIPTOR);\n\n const nextDescriptor =\n props.descriptors[nextRoute?.key] || state.descriptors[nextRoute?.key];\n\n const previousDescriptor =\n props.descriptors[previousRoute?.key] ||\n state.descriptors[previousRoute?.key];\n\n // When a screen is not the last, it should use next screen's transition config\n // Many transitions also animate the previous screen, so using 2 different transitions doesn't look right\n // For example combining a slide and a modal transition would look wrong otherwise\n // With this approach, combining different transition styles in the same navigator mostly looks right\n // This will still be broken when 2 transitions have different idle state (e.g. modal presentation),\n // but majority of the transitions look alright\n const optionsForTransitionConfig =\n index !== self.length - 1 &&\n nextDescriptor &&\n nextDescriptor.options.presentation !== 'transparentModal'\n ? nextDescriptor.options\n : descriptor.options;\n\n let defaultTransitionPreset =\n optionsForTransitionConfig.presentation === 'modal'\n ? ModalTransition\n : optionsForTransitionConfig.presentation === 'transparentModal'\n ? ModalFadeTransition\n : DefaultTransition;\n\n const {\n animationEnabled = Platform.OS !== 'web' &&\n Platform.OS !== 'windows' &&\n Platform.OS !== 'macos',\n gestureEnabled = Platform.OS === 'ios' && animationEnabled,\n gestureDirection = defaultTransitionPreset.gestureDirection,\n transitionSpec = defaultTransitionPreset.transitionSpec,\n cardStyleInterpolator = animationEnabled === false\n ? forNoAnimationCard\n : defaultTransitionPreset.cardStyleInterpolator,\n headerStyleInterpolator = defaultTransitionPreset.headerStyleInterpolator,\n cardOverlayEnabled = (Platform.OS !== 'ios' &&\n optionsForTransitionConfig.presentation !== 'transparentModal') ||\n getIsModalPresentation(cardStyleInterpolator),\n } = optionsForTransitionConfig;\n\n const headerMode: StackHeaderMode =\n descriptor.options.headerMode ??\n (!(\n optionsForTransitionConfig.presentation === 'modal' ||\n optionsForTransitionConfig.presentation === 'transparentModal' ||\n nextDescriptor?.options.presentation === 'modal' ||\n nextDescriptor?.options.presentation === 'transparentModal' ||\n getIsModalPresentation(cardStyleInterpolator)\n ) &&\n Platform.OS === 'ios' &&\n descriptor.options.header === undefined\n ? 'float'\n : 'screen');\n\n const scene = {\n route,\n descriptor: {\n ...descriptor,\n options: {\n ...descriptor.options,\n animationEnabled,\n cardOverlayEnabled,\n cardStyleInterpolator,\n gestureDirection,\n gestureEnabled,\n headerStyleInterpolator,\n transitionSpec,\n headerMode,\n },\n },\n progress: {\n current: getProgressFromGesture(\n currentGesture,\n state.layout,\n descriptor\n ),\n next:\n nextGesture &&\n nextDescriptor?.options.presentation !== 'transparentModal'\n ? getProgressFromGesture(\n nextGesture,\n state.layout,\n nextDescriptor\n )\n : undefined,\n previous: previousGesture\n ? getProgressFromGesture(\n previousGesture,\n state.layout,\n previousDescriptor\n )\n : undefined,\n },\n __memo: [\n state.layout,\n descriptor,\n nextDescriptor,\n previousDescriptor,\n currentGesture,\n nextGesture,\n previousGesture,\n ],\n };\n\n if (\n oldScene &&\n scene.__memo.every((it, i) => {\n // @ts-expect-error: we haven't added __memo to the annotation to prevent usage elsewhere\n return oldScene.__memo[i] === it;\n })\n ) {\n return oldScene;\n }\n\n return scene;\n });\n\n return {\n routes: props.routes,\n scenes,\n gestures,\n descriptors: props.descriptors,\n headerHeights: getHeaderHeights(\n scenes,\n props.insets,\n props.isParentHeaderShown,\n props.isParentModal,\n state.layout,\n state.headerHeights\n ),\n };\n }\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n routes: [],\n scenes: [],\n gestures: {},\n layout: SafeAreaProviderCompat.initialMetrics.frame,\n descriptors: this.props.descriptors,\n // Used when card's header is null and mode is float to make transition\n // between screens with headers and those without headers smooth.\n // This is not a great heuristic here. We don't know synchronously\n // on mount what the header height is so we have just used the most\n // common cases here.\n headerHeights: {},\n };\n }\n\n private handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n const layout = { width, height };\n\n this.setState((state, props) => {\n if (height === state.layout.height && width === state.layout.width) {\n return null;\n }\n\n return {\n layout,\n headerHeights: getHeaderHeights(\n state.scenes,\n props.insets,\n props.isParentHeaderShown,\n props.isParentModal,\n layout,\n state.headerHeights\n ),\n };\n });\n };\n\n private handleHeaderLayout = ({\n route,\n height,\n }: {\n route: Route<string>;\n height: number;\n }) => {\n this.setState(({ headerHeights }) => {\n const previousHeight = headerHeights[route.key];\n\n if (previousHeight === height) {\n return null;\n }\n\n return {\n headerHeights: {\n ...headerHeights,\n [route.key]: height,\n },\n };\n });\n };\n\n private getFocusedRoute = () => {\n const { state } = this.props;\n\n return state.routes[state.index];\n };\n\n private getPreviousScene = ({ route }: { route: Route<string> }) => {\n const { getPreviousRoute } = this.props;\n const { scenes } = this.state;\n\n const previousRoute = getPreviousRoute({ route });\n\n if (previousRoute) {\n const previousScene = scenes.find(\n (scene) => scene.descriptor.route.key === previousRoute.key\n );\n\n return previousScene;\n }\n\n return undefined;\n };\n\n render() {\n const {\n insets,\n state,\n routes,\n closingRouteKeys,\n onOpenRoute,\n onCloseRoute,\n renderHeader,\n renderScene,\n isParentHeaderShown,\n isParentModal,\n onTransitionStart,\n onTransitionEnd,\n onGestureStart,\n onGestureEnd,\n onGestureCancel,\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n } = this.props;\n\n const { scenes, layout, gestures, headerHeights } = this.state;\n\n const focusedRoute = state.routes[state.index];\n const focusedHeaderHeight = headerHeights[focusedRoute.key];\n\n const isFloatHeaderAbsolute = this.state.scenes.slice(-2).some((scene) => {\n const options = scene.descriptor.options ?? {};\n const { headerMode, headerTransparent, headerShown = true } = options;\n\n if (\n headerTransparent ||\n headerShown === false ||\n headerMode === 'screen'\n ) {\n return true;\n }\n\n return false;\n });\n\n let activeScreensLimit = 1;\n\n for (let i = scenes.length - 1; i >= 0; i--) {\n const { options } = scenes[i].descriptor;\n const {\n // By default, we don't want to detach the previous screen of the active one for modals\n detachPreviousScreen = options.presentation === 'transparentModal'\n ? false\n : getIsModalPresentation(options.cardStyleInterpolator)\n ? i !==\n scenes\n .map((scene) => scene.descriptor.options.cardStyleInterpolator)\n .lastIndexOf(forModalPresentationIOS)\n : true,\n } = options;\n\n if (detachPreviousScreen === false) {\n activeScreensLimit++;\n } else {\n break;\n }\n }\n\n const floatingHeader = (\n <React.Fragment key=\"header\">\n {renderHeader({\n mode: 'float',\n layout,\n scenes,\n getPreviousScene: this.getPreviousScene,\n getFocusedRoute: this.getFocusedRoute,\n onContentHeightChange: this.handleHeaderLayout,\n style: [\n styles.floating,\n isFloatHeaderAbsolute && [\n // Without this, the header buttons won't be touchable on Android when headerTransparent: true\n { height: focusedHeaderHeight },\n styles.absolute,\n ],\n ],\n })}\n </React.Fragment>\n );\n\n return (\n <Background>\n {isFloatHeaderAbsolute ? null : floatingHeader}\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n style={styles.container}\n onLayout={this.handleLayout}\n >\n {routes.map((route, index, self) => {\n const focused = focusedRoute.key === route.key;\n const gesture = gestures[route.key];\n const scene = scenes[index];\n\n // For the screens that shouldn't be active, the value is 0\n // For those that should be active, but are not the top screen, the value is 1\n // For those on top of the stack and with interaction enabled, the value is 2\n // For the old implementation, it stays the same it was\n let isScreenActive: Animated.AnimatedInterpolation | 2 | 1 | 0 = 1;\n\n if (index < self.length - activeScreensLimit - 1) {\n // screen should be inactive because it is too deep in the stack\n isScreenActive = STATE_INACTIVE;\n } else {\n const sceneForActivity = scenes[self.length - 1];\n const outputValue =\n index === self.length - 1\n ? STATE_ON_TOP // the screen is on top after the transition\n : index >= self.length - activeScreensLimit\n ? STATE_TRANSITIONING_OR_BELOW_TOP // the screen should stay active after the transition, it is not on top but is in activeLimit\n : STATE_INACTIVE; // the screen should be active only during the transition, it is at the edge of activeLimit\n isScreenActive = sceneForActivity\n ? sceneForActivity.progress.current.interpolate({\n inputRange: [0, 1 - EPSILON, 1],\n outputRange: [1, 1, outputValue],\n extrapolate: 'clamp',\n })\n : STATE_TRANSITIONING_OR_BELOW_TOP;\n }\n\n const {\n headerShown = true,\n headerTransparent,\n headerStyle,\n headerTintColor,\n } = scene.descriptor.options;\n\n const safeAreaInsetTop = insets.top;\n const safeAreaInsetRight = insets.right;\n const safeAreaInsetBottom = insets.bottom;\n const safeAreaInsetLeft = insets.left;\n\n const headerHeight =\n headerShown !== false ? headerHeights[route.key] : 0;\n\n const { backgroundColor: headerBackgroundColor } =\n StyleSheet.flatten(headerStyle) || {};\n\n let headerDarkContent: boolean | undefined;\n\n if (headerShown) {\n if (typeof headerTintColor === 'string') {\n headerDarkContent = Color(headerTintColor).isDark();\n } else if (typeof headerBackgroundColor === 'string') {\n headerDarkContent = !Color(headerBackgroundColor).isDark();\n }\n }\n\n // Start from current card and count backwards the number of cards with same interpolation\n const interpolationIndex = getInterpolationIndex(scenes, index);\n const isModal = getIsModal(\n scene,\n interpolationIndex,\n isParentModal\n );\n\n const isNextScreenTransparent =\n scenes[index + 1]?.descriptor.options.presentation ===\n 'transparentModal';\n\n const detachCurrentScreen =\n scenes[index + 1]?.descriptor.options.detachPreviousScreen !==\n false;\n\n return (\n <MaybeScreen\n key={route.key}\n style={StyleSheet.absoluteFill}\n enabled={detachInactiveScreens}\n active={isScreenActive}\n pointerEvents=\"box-none\"\n >\n <CardContainer\n index={index}\n interpolationIndex={interpolationIndex}\n modal={isModal}\n active={index === self.length - 1}\n focused={focused}\n closing={closingRouteKeys.includes(route.key)}\n layout={layout}\n gesture={gesture}\n scene={scene}\n safeAreaInsetTop={safeAreaInsetTop}\n safeAreaInsetRight={safeAreaInsetRight}\n safeAreaInsetBottom={safeAreaInsetBottom}\n safeAreaInsetLeft={safeAreaInsetLeft}\n onGestureStart={onGestureStart}\n onGestureCancel={onGestureCancel}\n onGestureEnd={onGestureEnd}\n headerHeight={headerHeight}\n isParentHeaderShown={isParentHeaderShown}\n onHeaderHeightChange={this.handleHeaderLayout}\n getPreviousScene={this.getPreviousScene}\n getFocusedRoute={this.getFocusedRoute}\n headerDarkContent={headerDarkContent}\n hasAbsoluteFloatHeader={\n isFloatHeaderAbsolute && !headerTransparent\n }\n renderHeader={renderHeader}\n renderScene={renderScene}\n onOpenRoute={onOpenRoute}\n onCloseRoute={onCloseRoute}\n onTransitionStart={onTransitionStart}\n onTransitionEnd={onTransitionEnd}\n isNextScreenTransparent={isNextScreenTransparent}\n detachCurrentScreen={detachCurrentScreen}\n />\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n {isFloatHeaderAbsolute ? floatingHeader : null}\n </Background>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n },\n floating: {\n zIndex: 1,\n },\n});\n"]}
1
+ {"version":3,"sources":["CardStack.tsx"],"names":["Background","getDefaultHeaderHeight","SafeAreaProviderCompat","Color","React","Animated","Platform","StyleSheet","forModalPresentationIOS","forNoAnimation","forNoAnimationCard","DefaultTransition","ModalFadeTransition","ModalTransition","getDistanceForDirection","MaybeScreen","MaybeScreenContainer","getIsModalPresentation","CardContainer","EPSILON","STATE_INACTIVE","STATE_TRANSITIONING_OR_BELOW_TOP","STATE_ON_TOP","FALLBACK_DESCRIPTOR","Object","freeze","options","getInterpolationIndex","scenes","index","cardStyleInterpolator","descriptor","interpolationIndex","i","cardStyleInterpolatorCurrent","getIsModal","scene","isParentModal","isModalPresentation","isModal","getHeaderHeights","insets","isParentHeaderShown","layout","previous","reduce","acc","curr","headerStatusBarHeight","top","headerStyle","style","flatten","height","route","key","getDistanceFromOptions","presentation","gestureDirection","getProgressFromGesture","gesture","distance","width","Math","max","interpolate","inputRange","outputRange","CardStack","Component","getDerivedStateFromProps","props","state","routes","descriptors","gestures","animationEnabled","Value","openingRouteKeys","includes","map","self","previousRoute","nextRoute","oldScene","currentGesture","previousGesture","undefined","nextGesture","nextDescriptor","previousDescriptor","optionsForTransitionConfig","length","defaultTransitionPreset","OS","gestureEnabled","transitionSpec","headerStyleInterpolator","cardOverlayEnabled","headerMode","header","progress","current","next","__memo","every","it","headerHeights","constructor","e","nativeEvent","setState","previousHeight","getPreviousRoute","previousScene","find","initialMetrics","frame","render","closingRouteKeys","onOpenRoute","onCloseRoute","renderHeader","renderScene","onTransitionStart","onTransitionEnd","onGestureStart","onGestureEnd","onGestureCancel","detachInactiveScreens","focusedRoute","focusedHeaderHeight","isFloatHeaderAbsolute","slice","some","headerTransparent","headerShown","activeScreensLimit","detachPreviousScreen","lastIndexOf","floatingHeader","mode","getPreviousScene","getFocusedRoute","onContentHeightChange","handleHeaderLayout","styles","floating","absolute","container","handleLayout","focused","isScreenActive","sceneForActivity","outputValue","extrapolate","headerTintColor","safeAreaInsetTop","safeAreaInsetRight","right","safeAreaInsetBottom","bottom","safeAreaInsetLeft","left","headerHeight","headerDarkContent","isDark","flattenedHeaderStyle","backgroundColor","isNextScreenTransparent","detachCurrentScreen","absoluteFill","create","flex","position","zIndex"],"mappings":";;AAAA,SACEA,UADF,EAEEC,sBAFF,EAGEC,sBAHF,QAIO,4BAJP;AAUA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAGEC,QAHF,EAIEC,UAJF,QAKO,cALP;AAQA,SACEC,uBADF,EAEEC,cAAc,IAAIC,kBAFpB,QAGO,gDAHP;AAIA,SACEC,iBADF,EAEEC,mBAFF,EAGEC,eAHF,QAIO,2CAJP;AAaA,OAAOC,uBAAP,MAAoC,qCAApC;AAEA,SAASC,WAAT,EAAsBC,oBAAtB,QAAkD,YAAlD;AACA,SAASC,sBAAT,QAAuC,QAAvC;AACA,OAAOC,aAAP,MA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A6BE,QAAA,YAAY,EAAEC,YA7BhB;AA8BE,QAAA,iBAAiB,EAAEG,iBA9BrB;AA+BE,QAAA,eAAe,EAAEC,eA/BnB;AAgCE,QAAA,uBAAuB,EAAE4C,uBAhC3B;AAiCE,QAAA,mBAAmB,EAAEC;AAjCvB,QAPF,CADF;AA6CD,KA/HA,CALH,CAFF,EAwIGtC,qBAAqB,GAAGQ,cAAH,GAAoB,IAxI5C,CADF;AA4ID;;AApfkE;AAufrE,MAAMM,MAAM,GAAG3I,UAAU,CAACqK,MAAX,CAAkB;AAC/BvB,EAAAA,SAAS,EAAE;AACTwB,IAAAA,IAAI,EAAE;AADG,GADoB;AAI/BzB,EAAAA,QAAQ,EAAE;AACR0B,IAAAA,QAAQ,EAAE,UADF;AAER7H,IAAAA,GAAG,EAAE,CAFG;AAGRkH,IAAAA,IAAI,EAAE,CAHE;AAIRJ,IAAAA,KAAK,EAAE;AAJC,GAJqB;AAU/BZ,EAAAA,QAAQ,EAAE;AACR4B,IAAAA,MAAM,EAAE;AADA;AAVqB,CAAlB,CAAf","sourcesContent":["import {\n Background,\n getDefaultHeaderHeight,\n SafeAreaProviderCompat,\n} from '@react-navigation/elements';\nimport type {\n ParamListBase,\n Route,\n StackNavigationState,\n} from '@react-navigation/native';\nimport Color from 'color';\nimport * as React from 'react';\nimport {\n Animated,\n LayoutChangeEvent,\n Platform,\n StyleSheet,\n} from 'react-native';\nimport type { EdgeInsets } from 'react-native-safe-area-context';\n\nimport {\n forModalPresentationIOS,\n forNoAnimation as forNoAnimationCard,\n} from '../../TransitionConfigs/CardStyleInterpolators';\nimport {\n DefaultTransition,\n ModalFadeTransition,\n ModalTransition,\n} from '../../TransitionConfigs/TransitionPresets';\nimport type {\n Layout,\n Scene,\n StackDescriptor,\n StackDescriptorMap,\n StackHeaderMode,\n StackNavigationOptions,\n} from '../../types';\nimport getDistanceForDirection from '../../utils/getDistanceForDirection';\nimport type { Props as HeaderContainerProps } from '../Header/HeaderContainer';\nimport { MaybeScreen, MaybeScreenContainer } from '../Screens';\nimport { getIsModalPresentation } from './Card';\nimport CardContainer from './CardContainer';\n\ntype GestureValues = {\n [key: string]: Animated.Value;\n};\n\ntype Props = {\n insets: EdgeInsets;\n state: StackNavigationState<ParamListBase>;\n descriptors: StackDescriptorMap;\n routes: Route<string>[];\n openingRouteKeys: string[];\n closingRouteKeys: string[];\n onOpenRoute: (props: { route: Route<string> }) => void;\n onCloseRoute: (props: { route: Route<string> }) => void;\n getPreviousRoute: (props: {\n route: Route<string>;\n }) => Route<string> | undefined;\n renderHeader: (props: HeaderContainerProps) => React.ReactNode;\n renderScene: (props: { route: Route<string> }) => React.ReactNode;\n isParentHeaderShown: boolean;\n isParentModal: boolean;\n onTransitionStart: (\n props: { route: Route<string> },\n closing: boolean\n ) => void;\n onTransitionEnd: (props: { route: Route<string> }, closing: boolean) => void;\n onGestureStart: (props: { route: Route<string> }) => void;\n onGestureEnd: (props: { route: Route<string> }) => void;\n onGestureCancel: (props: { route: Route<string> }) => void;\n detachInactiveScreens?: boolean;\n};\n\ntype State = {\n routes: Route<string>[];\n descriptors: StackDescriptorMap;\n scenes: Scene[];\n gestures: GestureValues;\n layout: Layout;\n headerHeights: Record<string, number>;\n};\n\nconst EPSILON = 0.01;\n\nconst STATE_INACTIVE = 0;\nconst STATE_TRANSITIONING_OR_BELOW_TOP = 1;\nconst STATE_ON_TOP = 2;\n\nconst FALLBACK_DESCRIPTOR = Object.freeze({ options: {} });\n\nconst getInterpolationIndex = (scenes: Scene[], index: number) => {\n const { cardStyleInterpolator } = scenes[index].descriptor.options;\n\n // Start from current card and count backwards the number of cards with same interpolation\n let interpolationIndex = 0;\n\n for (let i = index - 1; i >= 0; i--) {\n const cardStyleInterpolatorCurrent =\n scenes[i]?.descriptor.options.cardStyleInterpolator;\n\n if (cardStyleInterpolatorCurrent !== cardStyleInterpolator) {\n break;\n }\n\n interpolationIndex++;\n }\n\n return interpolationIndex;\n};\n\nconst getIsModal = (\n scene: Scene,\n interpolationIndex: number,\n isParentModal: boolean\n) => {\n if (isParentModal) {\n return true;\n }\n\n const { cardStyleInterpolator } = scene.descriptor.options;\n const isModalPresentation = getIsModalPresentation(cardStyleInterpolator);\n const isModal = isModalPresentation && interpolationIndex !== 0;\n\n return isModal;\n};\n\nconst getHeaderHeights = (\n scenes: Scene[],\n insets: EdgeInsets,\n isParentHeaderShown: boolean,\n isParentModal: boolean,\n layout: Layout,\n previous: Record<string, number>\n) => {\n return scenes.reduce<Record<string, number>>((acc, curr, index) => {\n const {\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n headerStyle,\n } = curr.descriptor.options;\n\n const style = StyleSheet.flatten(headerStyle || {});\n\n const height =\n 'height' in style && typeof style.height === 'number'\n ? style.height\n : previous[curr.route.key];\n\n const interpolationIndex = getInterpolationIndex(scenes, index);\n const isModal = getIsModal(curr, interpolationIndex, isParentModal);\n\n acc[curr.route.key] =\n typeof height === 'number'\n ? height\n : getDefaultHeaderHeight(layout, isModal, headerStatusBarHeight);\n\n return acc;\n }, {});\n};\n\nconst getDistanceFromOptions = (\n layout: Layout,\n descriptor?: StackDescriptor\n) => {\n const {\n presentation,\n gestureDirection = presentation === 'modal'\n ? ModalTransition.gestureDirection\n : DefaultTransition.gestureDirection,\n } = (descriptor?.options || {}) as StackNavigationOptions;\n\n return getDistanceForDirection(layout, gestureDirection);\n};\n\nconst getProgressFromGesture = (\n gesture: Animated.Value,\n layout: Layout,\n descriptor?: StackDescriptor\n) => {\n const distance = getDistanceFromOptions(\n {\n // Make sure that we have a non-zero distance, otherwise there will be incorrect progress\n // This causes blank screen on web if it was previously inside container with display: none\n width: Math.max(1, layout.width),\n height: Math.max(1, layout.height),\n },\n descriptor\n );\n\n if (distance > 0) {\n return gesture.interpolate({\n inputRange: [0, distance],\n outputRange: [1, 0],\n });\n }\n\n return gesture.interpolate({\n inputRange: [distance, 0],\n outputRange: [0, 1],\n });\n};\n\nexport default class CardStack extends React.Component<Props, State> {\n static getDerivedStateFromProps(\n props: Props,\n state: State\n ): Partial<State> | null {\n if (\n props.routes === state.routes &&\n props.descriptors === state.descriptors\n ) {\n return null;\n }\n\n const gestures = props.routes.reduce<GestureValues>((acc, curr) => {\n const descriptor = props.descriptors[curr.key];\n const { animationEnabled } = descriptor?.options || {};\n\n acc[curr.key] =\n state.gestures[curr.key] ||\n new Animated.Value(\n props.openingRouteKeys.includes(curr.key) &&\n animationEnabled !== false\n ? getDistanceFromOptions(state.layout, descriptor)\n : 0\n );\n\n return acc;\n }, {});\n\n const scenes = props.routes.map((route, index, self) => {\n const previousRoute = self[index - 1];\n const nextRoute = self[index + 1];\n\n const oldScene = state.scenes[index];\n\n const currentGesture = gestures[route.key];\n const previousGesture = previousRoute\n ? gestures[previousRoute.key]\n : undefined;\n const nextGesture = nextRoute ? gestures[nextRoute.key] : undefined;\n\n const descriptor =\n props.descriptors[route.key] ||\n state.descriptors[route.key] ||\n (oldScene ? oldScene.descriptor : FALLBACK_DESCRIPTOR);\n\n const nextDescriptor =\n props.descriptors[nextRoute?.key] || state.descriptors[nextRoute?.key];\n\n const previousDescriptor =\n props.descriptors[previousRoute?.key] ||\n state.descriptors[previousRoute?.key];\n\n // When a screen is not the last, it should use next screen's transition config\n // Many transitions also animate the previous screen, so using 2 different transitions doesn't look right\n // For example combining a slide and a modal transition would look wrong otherwise\n // With this approach, combining different transition styles in the same navigator mostly looks right\n // This will still be broken when 2 transitions have different idle state (e.g. modal presentation),\n // but majority of the transitions look alright\n const optionsForTransitionConfig =\n index !== self.length - 1 &&\n nextDescriptor &&\n nextDescriptor.options.presentation !== 'transparentModal'\n ? nextDescriptor.options\n : descriptor.options;\n\n let defaultTransitionPreset =\n optionsForTransitionConfig.presentation === 'modal'\n ? ModalTransition\n : optionsForTransitionConfig.presentation === 'transparentModal'\n ? ModalFadeTransition\n : DefaultTransition;\n\n const {\n animationEnabled = Platform.OS !== 'web' &&\n Platform.OS !== 'windows' &&\n Platform.OS !== 'macos',\n gestureEnabled = Platform.OS === 'ios' && animationEnabled,\n gestureDirection = defaultTransitionPreset.gestureDirection,\n transitionSpec = defaultTransitionPreset.transitionSpec,\n cardStyleInterpolator = animationEnabled === false\n ? forNoAnimationCard\n : defaultTransitionPreset.cardStyleInterpolator,\n headerStyleInterpolator = defaultTransitionPreset.headerStyleInterpolator,\n cardOverlayEnabled = (Platform.OS !== 'ios' &&\n optionsForTransitionConfig.presentation !== 'transparentModal') ||\n getIsModalPresentation(cardStyleInterpolator),\n } = optionsForTransitionConfig;\n\n const headerMode: StackHeaderMode =\n descriptor.options.headerMode ??\n (!(\n optionsForTransitionConfig.presentation === 'modal' ||\n optionsForTransitionConfig.presentation === 'transparentModal' ||\n nextDescriptor?.options.presentation === 'modal' ||\n nextDescriptor?.options.presentation === 'transparentModal' ||\n getIsModalPresentation(cardStyleInterpolator)\n ) &&\n Platform.OS === 'ios' &&\n descriptor.options.header === undefined\n ? 'float'\n : 'screen');\n\n const scene = {\n route,\n descriptor: {\n ...descriptor,\n options: {\n ...descriptor.options,\n animationEnabled,\n cardOverlayEnabled,\n cardStyleInterpolator,\n gestureDirection,\n gestureEnabled,\n headerStyleInterpolator,\n transitionSpec,\n headerMode,\n },\n },\n progress: {\n current: getProgressFromGesture(\n currentGesture,\n state.layout,\n descriptor\n ),\n next:\n nextGesture &&\n nextDescriptor?.options.presentation !== 'transparentModal'\n ? getProgressFromGesture(\n nextGesture,\n state.layout,\n nextDescriptor\n )\n : undefined,\n previous: previousGesture\n ? getProgressFromGesture(\n previousGesture,\n state.layout,\n previousDescriptor\n )\n : undefined,\n },\n __memo: [\n state.layout,\n descriptor,\n nextDescriptor,\n previousDescriptor,\n currentGesture,\n nextGesture,\n previousGesture,\n ],\n };\n\n if (\n oldScene &&\n scene.__memo.every((it, i) => {\n // @ts-expect-error: we haven't added __memo to the annotation to prevent usage elsewhere\n return oldScene.__memo[i] === it;\n })\n ) {\n return oldScene;\n }\n\n return scene;\n });\n\n return {\n routes: props.routes,\n scenes,\n gestures,\n descriptors: props.descriptors,\n headerHeights: getHeaderHeights(\n scenes,\n props.insets,\n props.isParentHeaderShown,\n props.isParentModal,\n state.layout,\n state.headerHeights\n ),\n };\n }\n\n constructor(props: Props) {\n super(props);\n\n this.state = {\n routes: [],\n scenes: [],\n gestures: {},\n layout: SafeAreaProviderCompat.initialMetrics.frame,\n descriptors: this.props.descriptors,\n // Used when card's header is null and mode is float to make transition\n // between screens with headers and those without headers smooth.\n // This is not a great heuristic here. We don't know synchronously\n // on mount what the header height is so we have just used the most\n // common cases here.\n headerHeights: {},\n };\n }\n\n private handleLayout = (e: LayoutChangeEvent) => {\n const { height, width } = e.nativeEvent.layout;\n\n const layout = { width, height };\n\n this.setState((state, props) => {\n if (height === state.layout.height && width === state.layout.width) {\n return null;\n }\n\n return {\n layout,\n headerHeights: getHeaderHeights(\n state.scenes,\n props.insets,\n props.isParentHeaderShown,\n props.isParentModal,\n layout,\n state.headerHeights\n ),\n };\n });\n };\n\n private handleHeaderLayout = ({\n route,\n height,\n }: {\n route: Route<string>;\n height: number;\n }) => {\n this.setState(({ headerHeights }) => {\n const previousHeight = headerHeights[route.key];\n\n if (previousHeight === height) {\n return null;\n }\n\n return {\n headerHeights: {\n ...headerHeights,\n [route.key]: height,\n },\n };\n });\n };\n\n private getFocusedRoute = () => {\n const { state } = this.props;\n\n return state.routes[state.index];\n };\n\n private getPreviousScene = ({ route }: { route: Route<string> }) => {\n const { getPreviousRoute } = this.props;\n const { scenes } = this.state;\n\n const previousRoute = getPreviousRoute({ route });\n\n if (previousRoute) {\n const previousScene = scenes.find(\n (scene) => scene.descriptor.route.key === previousRoute.key\n );\n\n return previousScene;\n }\n\n return undefined;\n };\n\n render() {\n const {\n insets,\n state,\n routes,\n closingRouteKeys,\n onOpenRoute,\n onCloseRoute,\n renderHeader,\n renderScene,\n isParentHeaderShown,\n isParentModal,\n onTransitionStart,\n onTransitionEnd,\n onGestureStart,\n onGestureEnd,\n onGestureCancel,\n detachInactiveScreens = Platform.OS === 'web' ||\n Platform.OS === 'android' ||\n Platform.OS === 'ios',\n } = this.props;\n\n const { scenes, layout, gestures, headerHeights } = this.state;\n\n const focusedRoute = state.routes[state.index];\n const focusedHeaderHeight = headerHeights[focusedRoute.key];\n\n const isFloatHeaderAbsolute = this.state.scenes.slice(-2).some((scene) => {\n const options = scene.descriptor.options ?? {};\n const { headerMode, headerTransparent, headerShown = true } = options;\n\n if (\n headerTransparent ||\n headerShown === false ||\n headerMode === 'screen'\n ) {\n return true;\n }\n\n return false;\n });\n\n let activeScreensLimit = 1;\n\n for (let i = scenes.length - 1; i >= 0; i--) {\n const { options } = scenes[i].descriptor;\n const {\n // By default, we don't want to detach the previous screen of the active one for modals\n detachPreviousScreen = options.presentation === 'transparentModal'\n ? false\n : getIsModalPresentation(options.cardStyleInterpolator)\n ? i !==\n scenes\n .map((scene) => scene.descriptor.options.cardStyleInterpolator)\n .lastIndexOf(forModalPresentationIOS)\n : true,\n } = options;\n\n if (detachPreviousScreen === false) {\n activeScreensLimit++;\n } else {\n // Check at least last 2 screens before stopping\n // This will make sure that screen isn't detached when another screen is animating on top of the transparent one\n // For example, (Opaque -> Transparent -> Opaque)\n if (i <= scenes.length - 2) {\n break;\n }\n }\n }\n\n const floatingHeader = (\n <React.Fragment key=\"header\">\n {renderHeader({\n mode: 'float',\n layout,\n scenes,\n getPreviousScene: this.getPreviousScene,\n getFocusedRoute: this.getFocusedRoute,\n onContentHeightChange: this.handleHeaderLayout,\n style: [\n styles.floating,\n isFloatHeaderAbsolute && [\n // Without this, the header buttons won't be touchable on Android when headerTransparent: true\n { height: focusedHeaderHeight },\n styles.absolute,\n ],\n ],\n })}\n </React.Fragment>\n );\n\n return (\n <Background>\n {isFloatHeaderAbsolute ? null : floatingHeader}\n <MaybeScreenContainer\n enabled={detachInactiveScreens}\n style={styles.container}\n onLayout={this.handleLayout}\n >\n {routes.map((route, index, self) => {\n const focused = focusedRoute.key === route.key;\n const gesture = gestures[route.key];\n const scene = scenes[index];\n\n // For the screens that shouldn't be active, the value is 0\n // For those that should be active, but are not the top screen, the value is 1\n // For those on top of the stack and with interaction enabled, the value is 2\n // For the old implementation, it stays the same it was\n let isScreenActive: Animated.AnimatedInterpolation | 2 | 1 | 0 = 1;\n\n if (index < self.length - activeScreensLimit - 1) {\n // screen should be inactive because it is too deep in the stack\n isScreenActive = STATE_INACTIVE;\n } else {\n const sceneForActivity = scenes[self.length - 1];\n const outputValue =\n index === self.length - 1\n ? STATE_ON_TOP // the screen is on top after the transition\n : index >= self.length - activeScreensLimit\n ? STATE_TRANSITIONING_OR_BELOW_TOP // the screen should stay active after the transition, it is not on top but is in activeLimit\n : STATE_INACTIVE; // the screen should be active only during the transition, it is at the edge of activeLimit\n isScreenActive = sceneForActivity\n ? sceneForActivity.progress.current.interpolate({\n inputRange: [0, 1 - EPSILON, 1],\n outputRange: [1, 1, outputValue],\n extrapolate: 'clamp',\n })\n : STATE_TRANSITIONING_OR_BELOW_TOP;\n }\n\n const {\n headerShown = true,\n headerTransparent,\n headerStyle,\n headerTintColor,\n } = scene.descriptor.options;\n\n const safeAreaInsetTop = insets.top;\n const safeAreaInsetRight = insets.right;\n const safeAreaInsetBottom = insets.bottom;\n const safeAreaInsetLeft = insets.left;\n\n const headerHeight =\n headerShown !== false ? headerHeights[route.key] : 0;\n\n let headerDarkContent: boolean | undefined;\n\n if (headerShown) {\n if (typeof headerTintColor === 'string') {\n headerDarkContent = Color(headerTintColor).isDark();\n } else {\n const flattenedHeaderStyle = StyleSheet.flatten(headerStyle);\n\n if (\n flattenedHeaderStyle &&\n 'backgroundColor' in flattenedHeaderStyle &&\n typeof flattenedHeaderStyle.backgroundColor === 'string'\n ) {\n headerDarkContent = !Color(\n flattenedHeaderStyle.backgroundColor\n ).isDark();\n }\n }\n }\n\n // Start from current card and count backwards the number of cards with same interpolation\n const interpolationIndex = getInterpolationIndex(scenes, index);\n const isModal = getIsModal(\n scene,\n interpolationIndex,\n isParentModal\n );\n\n const isNextScreenTransparent =\n scenes[index + 1]?.descriptor.options.presentation ===\n 'transparentModal';\n\n const detachCurrentScreen =\n scenes[index + 1]?.descriptor.options.detachPreviousScreen !==\n false;\n\n return (\n <MaybeScreen\n key={route.key}\n style={StyleSheet.absoluteFill}\n enabled={detachInactiveScreens}\n active={isScreenActive}\n pointerEvents=\"box-none\"\n >\n <CardContainer\n index={index}\n interpolationIndex={interpolationIndex}\n modal={isModal}\n active={index === self.length - 1}\n focused={focused}\n closing={closingRouteKeys.includes(route.key)}\n layout={layout}\n gesture={gesture}\n scene={scene}\n safeAreaInsetTop={safeAreaInsetTop}\n safeAreaInsetRight={safeAreaInsetRight}\n safeAreaInsetBottom={safeAreaInsetBottom}\n safeAreaInsetLeft={safeAreaInsetLeft}\n onGestureStart={onGestureStart}\n onGestureCancel={onGestureCancel}\n onGestureEnd={onGestureEnd}\n headerHeight={headerHeight}\n isParentHeaderShown={isParentHeaderShown}\n onHeaderHeightChange={this.handleHeaderLayout}\n getPreviousScene={this.getPreviousScene}\n getFocusedRoute={this.getFocusedRoute}\n headerDarkContent={headerDarkContent}\n hasAbsoluteFloatHeader={\n isFloatHeaderAbsolute && !headerTransparent\n }\n renderHeader={renderHeader}\n renderScene={renderScene}\n onOpenRoute={onOpenRoute}\n onCloseRoute={onCloseRoute}\n onTransitionStart={onTransitionStart}\n onTransitionEnd={onTransitionEnd}\n isNextScreenTransparent={isNextScreenTransparent}\n detachCurrentScreen={detachCurrentScreen}\n />\n </MaybeScreen>\n );\n })}\n </MaybeScreenContainer>\n {isFloatHeaderAbsolute ? floatingHeader : null}\n </Background>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n },\n floating: {\n zIndex: 1,\n },\n});\n"]}
@@ -20,8 +20,8 @@ const GestureHandlerWrapper = GestureHandlerRootView !== null && GestureHandlerR
20
20
  const isArrayEqual = (a, b) => a.length === b.length && a.every((it, index) => it === b[index]);
21
21
 
22
22
  export default class StackView extends React.Component {
23
- constructor(...args) {
24
- super(...args);
23
+ constructor() {
24
+ super(...arguments);
25
25
 
26
26
  _defineProperty(this, "state", {
27
27
  routes: [],
@@ -33,9 +33,10 @@ export default class StackView extends React.Component {
33
33
  descriptors: {}
34
34
  });
35
35
 
36
- _defineProperty(this, "getPreviousRoute", ({
37
- route
38
- }) => {
36
+ _defineProperty(this, "getPreviousRoute", _ref => {
37
+ let {
38
+ route
39
+ } = _ref;
39
40
  const {
40
41
  closingRouteKeys,
41
42
  replacingRouteKeys
@@ -45,9 +46,10 @@ export default class StackView extends React.Component {
45
46
  return routes[index - 1];
46
47
  });
47
48
 
48
- _defineProperty(this, "renderScene", ({
49
- route
50
- }) => {
49
+ _defineProperty(this, "renderScene", _ref2 => {
50
+ let {
51
+ route
52
+ } = _ref2;
51
53
  const descriptor = this.state.descriptors[route.key] || this.props.descriptors[route.key];
52
54
 
53
55
  if (!descriptor) {
@@ -61,9 +63,10 @@ export default class StackView extends React.Component {
61
63
  return /*#__PURE__*/React.createElement(HeaderContainer, props);
62
64
  });
63
65
 
64
- _defineProperty(this, "handleOpenRoute", ({
65
- route
66
- }) => {
66
+ _defineProperty(this, "handleOpenRoute", _ref3 => {
67
+ let {
68
+ route
69
+ } = _ref3;
67
70
  const {
68
71
  state,
69
72
  navigation
@@ -87,9 +90,10 @@ export default class StackView extends React.Component {
87
90
  }
88
91
  });
89
92
 
90
- _defineProperty(this, "handleCloseRoute", ({
91
- route
92
- }) => {
93
+ _defineProperty(this, "handleCloseRoute", _ref4 => {
94
+ let {
95
+ route
96
+ } = _ref4;
93
97
  const {
94
98
  state,
95
99
  navigation
@@ -113,47 +117,56 @@ export default class StackView extends React.Component {
113
117
  }
114
118
  });
115
119
 
116
- _defineProperty(this, "handleTransitionStart", ({
117
- route
118
- }, closing) => this.props.navigation.emit({
119
- type: 'transitionStart',
120
- data: {
121
- closing
122
- },
123
- target: route.key
124
- }));
125
-
126
- _defineProperty(this, "handleTransitionEnd", ({
127
- route
128
- }, closing) => this.props.navigation.emit({
129
- type: 'transitionEnd',
130
- data: {
131
- closing
132
- },
133
- target: route.key
134
- }));
135
-
136
- _defineProperty(this, "handleGestureStart", ({
137
- route
138
- }) => {
120
+ _defineProperty(this, "handleTransitionStart", (_ref5, closing) => {
121
+ let {
122
+ route
123
+ } = _ref5;
124
+ return this.props.navigation.emit({
125
+ type: 'transitionStart',
126
+ data: {
127
+ closing
128
+ },
129
+ target: route.key
130
+ });
131
+ });
132
+
133
+ _defineProperty(this, "handleTransitionEnd", (_ref6, closing) => {
134
+ let {
135
+ route
136
+ } = _ref6;
137
+ return this.props.navigation.emit({
138
+ type: 'transitionEnd',
139
+ data: {
140
+ closing
141
+ },
142
+ target: route.key
143
+ });
144
+ });
145
+
146
+ _defineProperty(this, "handleGestureStart", _ref7 => {
147
+ let {
148
+ route
149
+ } = _ref7;
139
150
  this.props.navigation.emit({
140
151
  type: 'gestureStart',
141
152
  target: route.key
142
153
  });
143
154
  });
144
155
 
145
- _defineProperty(this, "handleGestureEnd", ({
146
- route
147
- }) => {
156
+ _defineProperty(this, "handleGestureEnd", _ref8 => {
157
+ let {
158
+ route
159
+ } = _ref8;
148
160
  this.props.navigation.emit({
149
161
  type: 'gestureEnd',
150
162
  target: route.key
151
163
  });
152
164
  });
153
165
 
154
- _defineProperty(this, "handleGestureCancel", ({
155
- route
156
- }) => {
166
+ _defineProperty(this, "handleGestureCancel", _ref9 => {
167
+ let {
168
+ route
169
+ } = _ref9;
157
170
  this.props.navigation.emit({
158
171
  type: 'gestureCancel',
159
172
  target: route.key
@@ -276,9 +289,12 @@ export default class StackView extends React.Component {
276
289
  } else if (replacingRouteKeys.length || closingRouteKeys.length) {
277
290
  // Keep the routes we are closing or replacing if animation is enabled for them
278
291
  routes = routes.slice();
279
- routes.splice(routes.length - 1, 0, ...state.routes.filter(({
280
- key
281
- }) => isAnimationEnabled(key) ? replacingRouteKeys.includes(key) || closingRouteKeys.includes(key) : false));
292
+ routes.splice(routes.length - 1, 0, ...state.routes.filter(_ref10 => {
293
+ let {
294
+ key
295
+ } = _ref10;
296
+ return isAnimationEnabled(key) ? replacingRouteKeys.includes(key) || closingRouteKeys.includes(key) : false;
297
+ }));
282
298
  }
283
299
 
284
300
  if (!routes.length) {
@@ -1 +1 @@
1
- {"version":3,"sources":["StackView.tsx"],"names":["HeaderShownContext","SafeAreaProviderCompat","StackActions","React","StyleSheet","View","SafeAreaInsetsContext","ModalPresentationContext","GestureHandlerRootView","HeaderContainer","CardStack","GestureHandlerWrapper","isArrayEqual","a","b","length","every","it","index","StackView","Component","routes","previousRoutes","previousDescriptors","openingRouteKeys","closingRouteKeys","replacingRouteKeys","descriptors","route","state","filter","r","key","includes","findIndex","descriptor","props","render","navigation","some","routeNames","name","navigate","setState","dispatch","pop","source","target","closing","emit","type","data","getDerivedStateFromProps","map","reduce","acc","slice","previousFocusedRoute","nextFocusedRoute","isAnimationEnabled","options","animationEnabled","getAnimationTypeForReplace","animationTypeForReplace","splice","Error","_","rest","styles","container","insets","isParentModal","isParentHeaderShown","getPreviousRoute","handleOpenRoute","handleCloseRoute","handleTransitionStart","handleTransitionEnd","renderHeader","renderScene","handleGestureStart","handleGestureEnd","handleGestureCancel","create","flex"],"mappings":";;;;AAAA,SACEA,kBADF,EAEEC,sBAFF,QAGO,4BAHP;AAIA,SAGEC,YAHF,QAKO,0BALP;AAMA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AACA,SAEEC,qBAFF,QAGO,gCAHP;AAUA,OAAOC,wBAAP,MAAqC,sCAArC;AACA,SAASC,sBAAT,QAAuC,mBAAvC;AACA,OAAOC,eAAP,MAEO,2BAFP;AAGA,OAAOC,SAAP,MAAsB,aAAtB;AA0BA,MAAMC,qBAAqB,GAAGH,sBAAH,aAAGA,sBAAH,cAAGA,sBAAH,GAA6BH,IAAxD;AAEA;AACA;AACA;AACA;;AACA,MAAMO,YAAY,GAAG,CAACC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AAY,EAAE,KAAKC,gBAjBrB;AAkBE,MAAA,eAAe,EAAE,KAAKC;AAlBxB,OAmBMf,IAnBN,EAFJ,CAFJ,CAFJ,CADF,CADF,CADF;AAuCD;;AApZkE;AAuZrE,MAAMC,MAAM,GAAGhE,UAAU,CAAC+E,MAAX,CAAkB;AAC/Bd,EAAAA,SAAS,EAAE;AACTe,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import {\n HeaderShownContext,\n SafeAreaProviderCompat,\n} from '@react-navigation/elements';\nimport {\n ParamListBase,\n Route,\n StackActions,\n StackNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport {\n EdgeInsets,\n SafeAreaInsetsContext,\n} from 'react-native-safe-area-context';\n\nimport type {\n StackDescriptorMap,\n StackNavigationConfig,\n StackNavigationHelpers,\n} from '../../types';\nimport ModalPresentationContext from '../../utils/ModalPresentationContext';\nimport { GestureHandlerRootView } from '../GestureHandler';\nimport HeaderContainer, {\n Props as HeaderContainerProps,\n} from '../Header/HeaderContainer';\nimport CardStack from './CardStack';\n\ntype Props = StackNavigationConfig & {\n state: StackNavigationState<ParamListBase>;\n navigation: StackNavigationHelpers;\n descriptors: StackDescriptorMap;\n};\n\ntype State = {\n // Local copy of the routes which are actually rendered\n routes: Route<string>[];\n // Previous routes, to compare whether routes have changed or not\n previousRoutes: Route<string>[];\n // Previous descriptors, to compare whether descriptors have changed or not\n previousDescriptors: StackDescriptorMap;\n // List of routes being opened, we need to animate pushing of these new routes\n openingRouteKeys: string[];\n // List of routes being closed, we need to animate popping of these routes\n closingRouteKeys: string[];\n // List of routes being replaced, we need to keep a copy until the new route animates in\n replacingRouteKeys: string[];\n // Since the local routes can vary from the routes from props, we need to keep the descriptors for old routes\n // Otherwise we won't be able to access the options for routes that were removed\n descriptors: StackDescriptorMap;\n};\n\nconst GestureHandlerWrapper = GestureHandlerRootView ?? View;\n\n/**\n * Compare two arrays with primitive values as the content.\n * We need to make sure that both values and order match.\n */\nconst isArrayEqual = (a: any[], b: any[]) =>\n a.length === b.length && a.every((it, index) => it === b[index]);\n\nexport default class StackView extends React.Component<Props, State> {\n static getDerivedStateFromProps(\n props: Readonly<Props>,\n state: Readonly<State>\n ) {\n // If there was no change in routes, we don't need to compute anything\n if (\n (props.state.routes === state.previousRoutes ||\n isArrayEqual(\n props.state.routes.map((r) => r.key),\n state.previousRoutes.map((r) => r.key)\n )) &&\n state.routes.length\n ) {\n let routes = state.routes;\n let previousRoutes = state.previousRoutes;\n let descriptors = props.descriptors;\n let previousDescriptors = state.previousDescriptors;\n\n if (props.descriptors !== state.previousDescriptors) {\n descriptors = state.routes.reduce<StackDescriptorMap>((acc, route) => {\n acc[route.key] =\n props.descriptors[route.key] || state.descriptors[route.key];\n\n return acc;\n }, {});\n\n previousDescriptors = props.descriptors;\n }\n\n if (props.state.routes !== state.previousRoutes) {\n // if any route objects have changed, we should update them\n const map = props.state.routes.reduce<Record<string, Route<string>>>(\n (acc, route) => {\n acc[route.key] = route;\n return acc;\n },\n {}\n );\n\n routes = state.routes.map((route) => map[route.key] || route);\n previousRoutes = props.state.routes;\n }\n\n return {\n routes,\n previousRoutes,\n descriptors,\n previousDescriptors,\n };\n }\n\n // Here we determine which routes were added or removed to animate them\n // We keep a copy of the route being removed in local state to be able to animate it\n\n let routes =\n props.state.index < props.state.routes.length - 1\n ? // Remove any extra routes from the state\n // The last visible route should be the focused route, i.e. at current index\n props.state.routes.slice(0, props.state.index + 1)\n : props.state.routes;\n\n // Now we need to determine which routes were added and removed\n let {\n openingRouteKeys,\n closingRouteKeys,\n replacingRouteKeys,\n previousRoutes,\n } = state;\n\n const previousFocusedRoute = previousRoutes[previousRoutes.length - 1] as\n | Route<string>\n | undefined;\n const nextFocusedRoute = routes[routes.length - 1];\n\n const isAnimationEnabled = (key: string) => {\n const descriptor = props.descriptors[key] || state.descriptors[key];\n\n return descriptor ? descriptor.options.animationEnabled !== false : true;\n };\n\n const getAnimationTypeForReplace = (key: string) => {\n const descriptor = props.descriptors[key] || state.descriptors[key];\n\n return descriptor.options.animationTypeForReplace ?? 'push';\n };\n\n if (\n previousFocusedRoute &&\n previousFocusedRoute.key !== nextFocusedRoute.key\n ) {\n // We only need to animate routes if the focused route changed\n // Animating previous routes won't be visible coz the focused route is on top of everything\n\n if (!previousRoutes.some((r) => r.key === nextFocusedRoute.key)) {\n // A new route has come to the focus, we treat this as a push\n // A replace can also trigger this, the animation should look like push\n\n if (\n isAnimationEnabled(nextFocusedRoute.key) &&\n !openingRouteKeys.includes(nextFocusedRoute.key)\n ) {\n // In this case, we need to animate pushing the focused route\n // We don't care about animating any other added routes because they won't be visible\n openingRouteKeys = [...openingRouteKeys, nextFocusedRoute.key];\n\n closingRouteKeys = closingRouteKeys.filter(\n (key) => key !== nextFocusedRoute.key\n );\n replacingRouteKeys = replacingRouteKeys.filter(\n (key) => key !== nextFocusedRoute.key\n );\n\n if (!routes.some((r) => r.key === previousFocusedRoute.key)) {\n // The previous focused route isn't present in state, we treat this as a replace\n\n openingRouteKeys = openingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n\n if (getAnimationTypeForReplace(nextFocusedRoute.key) === 'pop') {\n closingRouteKeys = [\n ...closingRouteKeys,\n previousFocusedRoute.key,\n ];\n\n // By default, new routes have a push animation, so we add it to `openingRouteKeys` before\n // But since user configured it to animate the old screen like a pop, we need to add this without animation\n // So remove it from `openingRouteKeys` which will remove the animation\n openingRouteKeys = openingRouteKeys.filter(\n (key) => key !== nextFocusedRoute.key\n );\n\n // Keep the route being removed at the end to animate it out\n routes = [...routes, previousFocusedRoute];\n } else {\n replacingRouteKeys = [\n ...replacingRouteKeys,\n previousFocusedRoute.key,\n ];\n\n closingRouteKeys = closingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n\n // Keep the old route in the state because it's visible under the new route, and removing it will feel abrupt\n // We need to insert it just before the focused one (the route being pushed)\n // After the push animation is completed, routes being replaced will be removed completely\n routes = routes.slice();\n routes.splice(routes.length - 1, 0, previousFocusedRoute);\n }\n }\n }\n } else if (!routes.some((r) => r.key === previousFocusedRoute.key)) {\n // The previously focused route was removed, we treat this as a pop\n\n if (\n isAnimationEnabled(previousFocusedRoute.key) &&\n !closingRouteKeys.includes(previousFocusedRoute.key)\n ) {\n closingRouteKeys = [...closingRouteKeys, previousFocusedRoute.key];\n\n // Sometimes a route can be closed before the opening animation finishes\n // So we also need to remove it from the opening list\n openingRouteKeys = openingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n replacingRouteKeys = replacingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n\n // Keep a copy of route being removed in the state to be able to animate it\n routes = [...routes, previousFocusedRoute];\n }\n } else {\n // Looks like some routes were re-arranged and no focused routes were added/removed\n // i.e. the currently focused route already existed and the previously focused route still exists\n // We don't know how to animate this\n }\n } else if (replacingRouteKeys.length || closingRouteKeys.length) {\n // Keep the routes we are closing or replacing if animation is enabled for them\n routes = routes.slice();\n routes.splice(\n routes.length - 1,\n 0,\n ...state.routes.filter(({ key }) =>\n isAnimationEnabled(key)\n ? replacingRouteKeys.includes(key) || closingRouteKeys.includes(key)\n : false\n )\n );\n }\n\n if (!routes.length) {\n throw new Error(\n 'There should always be at least one route in the navigation state.'\n );\n }\n\n const descriptors = routes.reduce<StackDescriptorMap>((acc, route) => {\n acc[route.key] =\n props.descriptors[route.key] || state.descriptors[route.key];\n\n return acc;\n }, {});\n\n return {\n routes,\n previousRoutes: props.state.routes,\n previousDescriptors: props.descriptors,\n openingRouteKeys,\n closingRouteKeys,\n replacingRouteKeys,\n descriptors,\n };\n }\n\n state: State = {\n routes: [],\n previousRoutes: [],\n previousDescriptors: {},\n openingRouteKeys: [],\n closingRouteKeys: [],\n replacingRouteKeys: [],\n descriptors: {},\n };\n\n private getPreviousRoute = ({ route }: { route: Route<string> }) => {\n const { closingRouteKeys, replacingRouteKeys } = this.state;\n const routes = this.state.routes.filter(\n (r) =>\n r.key === route.key ||\n (!closingRouteKeys.includes(r.key) &&\n !replacingRouteKeys.includes(r.key))\n );\n\n const index = routes.findIndex((r) => r.key === route.key);\n\n return routes[index - 1];\n };\n\n private renderScene = ({ route }: { route: Route<string> }) => {\n const descriptor =\n this.state.descriptors[route.key] || this.props.descriptors[route.key];\n\n if (!descriptor) {\n return null;\n }\n\n return descriptor.render();\n };\n\n private renderHeader = (props: HeaderContainerProps) => {\n return <HeaderContainer {...props} />;\n };\n\n private handleOpenRoute = ({ route }: { route: Route<string> }) => {\n const { state, navigation } = this.props;\n const { closingRouteKeys, replacingRouteKeys } = this.state;\n\n if (\n closingRouteKeys.some((key) => key === route.key) &&\n replacingRouteKeys.every((key) => key !== route.key) &&\n state.routeNames.includes(route.name) &&\n !state.routes.some((r) => r.key === route.key)\n ) {\n // If route isn't present in current state, but was closing, assume that a close animation was cancelled\n // So we need to add this route back to the state\n navigation.navigate(route);\n } else {\n this.setState((state) => ({\n routes: state.replacingRouteKeys.length\n ? state.routes.filter(\n (r) => !state.replacingRouteKeys.includes(r.key)\n )\n : state.routes,\n openingRouteKeys: state.openingRouteKeys.filter(\n (key) => key !== route.key\n ),\n closingRouteKeys: state.closingRouteKeys.filter(\n (key) => key !== route.key\n ),\n replacingRouteKeys: [],\n }));\n }\n };\n\n private handleCloseRoute = ({ route }: { route: Route<string> }) => {\n const { state, navigation } = this.props;\n\n if (state.routes.some((r) => r.key === route.key)) {\n // If a route exists in state, trigger a pop\n // This will happen in when the route was closed from the card component\n // e.g. When the close animation triggered from a gesture ends\n navigation.dispatch({\n ...StackActions.pop(),\n source: route.key,\n target: state.key,\n });\n } else {\n // We need to clean up any state tracking the route and pop it immediately\n this.setState((state) => ({\n routes: state.routes.filter((r) => r.key !== route.key),\n openingRouteKeys: state.openingRouteKeys.filter(\n (key) => key !== route.key\n ),\n closingRouteKeys: state.closingRouteKeys.filter(\n (key) => key !== route.key\n ),\n }));\n }\n };\n\n private handleTransitionStart = (\n { route }: { route: Route<string> },\n closing: boolean\n ) =>\n this.props.navigation.emit({\n type: 'transitionStart',\n data: { closing },\n target: route.key,\n });\n\n private handleTransitionEnd = (\n { route }: { route: Route<string> },\n closing: boolean\n ) =>\n this.props.navigation.emit({\n type: 'transitionEnd',\n data: { closing },\n target: route.key,\n });\n\n private handleGestureStart = ({ route }: { route: Route<string> }) => {\n this.props.navigation.emit({\n type: 'gestureStart',\n target: route.key,\n });\n };\n\n private handleGestureEnd = ({ route }: { route: Route<string> }) => {\n this.props.navigation.emit({\n type: 'gestureEnd',\n target: route.key,\n });\n };\n\n private handleGestureCancel = ({ route }: { route: Route<string> }) => {\n this.props.navigation.emit({\n type: 'gestureCancel',\n target: route.key,\n });\n };\n\n render() {\n const {\n state,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n descriptors: _,\n ...rest\n } = this.props;\n\n const { routes, descriptors, openingRouteKeys, closingRouteKeys } =\n this.state;\n\n return (\n <GestureHandlerWrapper style={styles.container}>\n <SafeAreaProviderCompat>\n <SafeAreaInsetsContext.Consumer>\n {(insets) => (\n <ModalPresentationContext.Consumer>\n {(isParentModal) => (\n <HeaderShownContext.Consumer>\n {(isParentHeaderShown) => (\n <CardStack\n insets={insets as EdgeInsets}\n isParentHeaderShown={isParentHeaderShown}\n isParentModal={isParentModal}\n getPreviousRoute={this.getPreviousRoute}\n routes={routes}\n openingRouteKeys={openingRouteKeys}\n closingRouteKeys={closingRouteKeys}\n onOpenRoute={this.handleOpenRoute}\n onCloseRoute={this.handleCloseRoute}\n onTransitionStart={this.handleTransitionStart}\n onTransitionEnd={this.handleTransitionEnd}\n renderHeader={this.renderHeader}\n renderScene={this.renderScene}\n state={state}\n descriptors={descriptors}\n onGestureStart={this.handleGestureStart}\n onGestureEnd={this.handleGestureEnd}\n onGestureCancel={this.handleGestureCancel}\n {...rest}\n />\n )}\n </HeaderShownContext.Consumer>\n )}\n </ModalPresentationContext.Consumer>\n )}\n </SafeAreaInsetsContext.Consumer>\n </SafeAreaProviderCompat>\n </GestureHandlerWrapper>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
1
+ {"version":3,"sources":["StackView.tsx"],"names":["HeaderShownContext","SafeAreaProviderCompat","StackActions","React","StyleSheet","View","SafeAreaInsetsContext","ModalPresentationContext","GestureHandlerRootView","HeaderContainer","CardStack","GestureHandlerWrapper","isArrayEqual","a","b","length","every","it","index","StackView","Component","routes","previousRoutes","previousDescriptors","openingRouteKeys","closingRouteKeys","replacingRouteKeys","descriptors","route","state","filter","r","key","includes","findIndex","descriptor","props","render","navigation","some","routeNames","name","navigate","setState","dispatch","pop","source","target","closing","emit","type","data","getDerivedStateFromProps","map","reduce","acc","slice","previousFocusedRoute","nextFocusedRoute","isAnimationEnabled","options","animationEnabled","getAnimationTypeForReplace","animationTypeForReplace","splice","Error","_","rest","styles","container","insets","isParentModal","isParentHeaderShown","getPreviousRoute","handleOpenRoute","handleCloseRoute","handleTransitionStart","handleTransitionEnd","renderHeader","renderScene","handleGestureStart","handleGestureEnd","handleGestureCancel","create","flex"],"mappings":";;;;AAAA,SACEA,kBADF,EAEEC,sBAFF,QAGO,4BAHP;AAIA,SAGEC,YAHF,QAKO,0BALP;AAMA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AACA,SAEEC,qBAFF,QAGO,gCAHP;AAUA,OAAOC,wBAAP,MAAqC,sCAArC;AACA,SAASC,sBAAT,QAAuC,mBAAvC;AACA,OAAOC,eAAP,MAEO,2BAFP;AAGA,OAAOC,SAAP,MAAsB,aAAtB;AA0BA,MAAMC,qBAAqB,GAAGH,sBAAH,aAAGA,sBAAH,cAAGA,sBAAH,GAA6BH,IAAxD;AAEA;AACA;AACA;AACA;;AACA,MAAMO,YAAY,GAAG,CAACC,CAAD,EAAWC,CAAX,KACnBD,CAAC,CAACE,MAAF,KAAaD,CAAC,CAACC,MAAf,IAAyBF,CAAC,CAACG,KAAF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c,EAAE,KAAKqD,kBAhBvB;AAiBE,MAAA,YAAY,EAAE,KAAKC,gBAjBrB;AAkBE,MAAA,eAAe,EAAE,KAAKC;AAlBxB,OAmBMf,IAnBN,EAFJ,CAFJ,CAFJ,CADF,CADF,CADF;AAuCD;;AApZkE;AAuZrE,MAAMC,MAAM,GAAGhE,UAAU,CAAC+E,MAAX,CAAkB;AAC/Bd,EAAAA,SAAS,EAAE;AACTe,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import {\n HeaderShownContext,\n SafeAreaProviderCompat,\n} from '@react-navigation/elements';\nimport {\n ParamListBase,\n Route,\n StackActions,\n StackNavigationState,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport {\n EdgeInsets,\n SafeAreaInsetsContext,\n} from 'react-native-safe-area-context';\n\nimport type {\n StackDescriptorMap,\n StackNavigationConfig,\n StackNavigationHelpers,\n} from '../../types';\nimport ModalPresentationContext from '../../utils/ModalPresentationContext';\nimport { GestureHandlerRootView } from '../GestureHandler';\nimport HeaderContainer, {\n Props as HeaderContainerProps,\n} from '../Header/HeaderContainer';\nimport CardStack from './CardStack';\n\ntype Props = StackNavigationConfig & {\n state: StackNavigationState<ParamListBase>;\n navigation: StackNavigationHelpers;\n descriptors: StackDescriptorMap;\n};\n\ntype State = {\n // Local copy of the routes which are actually rendered\n routes: Route<string>[];\n // Previous routes, to compare whether routes have changed or not\n previousRoutes: Route<string>[];\n // Previous descriptors, to compare whether descriptors have changed or not\n previousDescriptors: StackDescriptorMap;\n // List of routes being opened, we need to animate pushing of these new routes\n openingRouteKeys: string[];\n // List of routes being closed, we need to animate popping of these routes\n closingRouteKeys: string[];\n // List of routes being replaced, we need to keep a copy until the new route animates in\n replacingRouteKeys: string[];\n // Since the local routes can vary from the routes from props, we need to keep the descriptors for old routes\n // Otherwise we won't be able to access the options for routes that were removed\n descriptors: StackDescriptorMap;\n};\n\nconst GestureHandlerWrapper = GestureHandlerRootView ?? View;\n\n/**\n * Compare two arrays with primitive values as the content.\n * We need to make sure that both values and order match.\n */\nconst isArrayEqual = (a: any[], b: any[]) =>\n a.length === b.length && a.every((it, index) => it === b[index]);\n\nexport default class StackView extends React.Component<Props, State> {\n static getDerivedStateFromProps(\n props: Readonly<Props>,\n state: Readonly<State>\n ) {\n // If there was no change in routes, we don't need to compute anything\n if (\n (props.state.routes === state.previousRoutes ||\n isArrayEqual(\n props.state.routes.map((r) => r.key),\n state.previousRoutes.map((r) => r.key)\n )) &&\n state.routes.length\n ) {\n let routes = state.routes;\n let previousRoutes = state.previousRoutes;\n let descriptors = props.descriptors;\n let previousDescriptors = state.previousDescriptors;\n\n if (props.descriptors !== state.previousDescriptors) {\n descriptors = state.routes.reduce<StackDescriptorMap>((acc, route) => {\n acc[route.key] =\n props.descriptors[route.key] || state.descriptors[route.key];\n\n return acc;\n }, {});\n\n previousDescriptors = props.descriptors;\n }\n\n if (props.state.routes !== state.previousRoutes) {\n // if any route objects have changed, we should update them\n const map = props.state.routes.reduce<Record<string, Route<string>>>(\n (acc, route) => {\n acc[route.key] = route;\n return acc;\n },\n {}\n );\n\n routes = state.routes.map((route) => map[route.key] || route);\n previousRoutes = props.state.routes;\n }\n\n return {\n routes,\n previousRoutes,\n descriptors,\n previousDescriptors,\n };\n }\n\n // Here we determine which routes were added or removed to animate them\n // We keep a copy of the route being removed in local state to be able to animate it\n\n let routes =\n props.state.index < props.state.routes.length - 1\n ? // Remove any extra routes from the state\n // The last visible route should be the focused route, i.e. at current index\n props.state.routes.slice(0, props.state.index + 1)\n : props.state.routes;\n\n // Now we need to determine which routes were added and removed\n let {\n openingRouteKeys,\n closingRouteKeys,\n replacingRouteKeys,\n previousRoutes,\n } = state;\n\n const previousFocusedRoute = previousRoutes[previousRoutes.length - 1] as\n | Route<string>\n | undefined;\n const nextFocusedRoute = routes[routes.length - 1];\n\n const isAnimationEnabled = (key: string) => {\n const descriptor = props.descriptors[key] || state.descriptors[key];\n\n return descriptor ? descriptor.options.animationEnabled !== false : true;\n };\n\n const getAnimationTypeForReplace = (key: string) => {\n const descriptor = props.descriptors[key] || state.descriptors[key];\n\n return descriptor.options.animationTypeForReplace ?? 'push';\n };\n\n if (\n previousFocusedRoute &&\n previousFocusedRoute.key !== nextFocusedRoute.key\n ) {\n // We only need to animate routes if the focused route changed\n // Animating previous routes won't be visible coz the focused route is on top of everything\n\n if (!previousRoutes.some((r) => r.key === nextFocusedRoute.key)) {\n // A new route has come to the focus, we treat this as a push\n // A replace can also trigger this, the animation should look like push\n\n if (\n isAnimationEnabled(nextFocusedRoute.key) &&\n !openingRouteKeys.includes(nextFocusedRoute.key)\n ) {\n // In this case, we need to animate pushing the focused route\n // We don't care about animating any other added routes because they won't be visible\n openingRouteKeys = [...openingRouteKeys, nextFocusedRoute.key];\n\n closingRouteKeys = closingRouteKeys.filter(\n (key) => key !== nextFocusedRoute.key\n );\n replacingRouteKeys = replacingRouteKeys.filter(\n (key) => key !== nextFocusedRoute.key\n );\n\n if (!routes.some((r) => r.key === previousFocusedRoute.key)) {\n // The previous focused route isn't present in state, we treat this as a replace\n\n openingRouteKeys = openingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n\n if (getAnimationTypeForReplace(nextFocusedRoute.key) === 'pop') {\n closingRouteKeys = [\n ...closingRouteKeys,\n previousFocusedRoute.key,\n ];\n\n // By default, new routes have a push animation, so we add it to `openingRouteKeys` before\n // But since user configured it to animate the old screen like a pop, we need to add this without animation\n // So remove it from `openingRouteKeys` which will remove the animation\n openingRouteKeys = openingRouteKeys.filter(\n (key) => key !== nextFocusedRoute.key\n );\n\n // Keep the route being removed at the end to animate it out\n routes = [...routes, previousFocusedRoute];\n } else {\n replacingRouteKeys = [\n ...replacingRouteKeys,\n previousFocusedRoute.key,\n ];\n\n closingRouteKeys = closingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n\n // Keep the old route in the state because it's visible under the new route, and removing it will feel abrupt\n // We need to insert it just before the focused one (the route being pushed)\n // After the push animation is completed, routes being replaced will be removed completely\n routes = routes.slice();\n routes.splice(routes.length - 1, 0, previousFocusedRoute);\n }\n }\n }\n } else if (!routes.some((r) => r.key === previousFocusedRoute.key)) {\n // The previously focused route was removed, we treat this as a pop\n\n if (\n isAnimationEnabled(previousFocusedRoute.key) &&\n !closingRouteKeys.includes(previousFocusedRoute.key)\n ) {\n closingRouteKeys = [...closingRouteKeys, previousFocusedRoute.key];\n\n // Sometimes a route can be closed before the opening animation finishes\n // So we also need to remove it from the opening list\n openingRouteKeys = openingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n replacingRouteKeys = replacingRouteKeys.filter(\n (key) => key !== previousFocusedRoute.key\n );\n\n // Keep a copy of route being removed in the state to be able to animate it\n routes = [...routes, previousFocusedRoute];\n }\n } else {\n // Looks like some routes were re-arranged and no focused routes were added/removed\n // i.e. the currently focused route already existed and the previously focused route still exists\n // We don't know how to animate this\n }\n } else if (replacingRouteKeys.length || closingRouteKeys.length) {\n // Keep the routes we are closing or replacing if animation is enabled for them\n routes = routes.slice();\n routes.splice(\n routes.length - 1,\n 0,\n ...state.routes.filter(({ key }) =>\n isAnimationEnabled(key)\n ? replacingRouteKeys.includes(key) || closingRouteKeys.includes(key)\n : false\n )\n );\n }\n\n if (!routes.length) {\n throw new Error(\n 'There should always be at least one route in the navigation state.'\n );\n }\n\n const descriptors = routes.reduce<StackDescriptorMap>((acc, route) => {\n acc[route.key] =\n props.descriptors[route.key] || state.descriptors[route.key];\n\n return acc;\n }, {});\n\n return {\n routes,\n previousRoutes: props.state.routes,\n previousDescriptors: props.descriptors,\n openingRouteKeys,\n closingRouteKeys,\n replacingRouteKeys,\n descriptors,\n };\n }\n\n state: State = {\n routes: [],\n previousRoutes: [],\n previousDescriptors: {},\n openingRouteKeys: [],\n closingRouteKeys: [],\n replacingRouteKeys: [],\n descriptors: {},\n };\n\n private getPreviousRoute = ({ route }: { route: Route<string> }) => {\n const { closingRouteKeys, replacingRouteKeys } = this.state;\n const routes = this.state.routes.filter(\n (r) =>\n r.key === route.key ||\n (!closingRouteKeys.includes(r.key) &&\n !replacingRouteKeys.includes(r.key))\n );\n\n const index = routes.findIndex((r) => r.key === route.key);\n\n return routes[index - 1];\n };\n\n private renderScene = ({ route }: { route: Route<string> }) => {\n const descriptor =\n this.state.descriptors[route.key] || this.props.descriptors[route.key];\n\n if (!descriptor) {\n return null;\n }\n\n return descriptor.render();\n };\n\n private renderHeader = (props: HeaderContainerProps) => {\n return <HeaderContainer {...props} />;\n };\n\n private handleOpenRoute = ({ route }: { route: Route<string> }) => {\n const { state, navigation } = this.props;\n const { closingRouteKeys, replacingRouteKeys } = this.state;\n\n if (\n closingRouteKeys.some((key) => key === route.key) &&\n replacingRouteKeys.every((key) => key !== route.key) &&\n state.routeNames.includes(route.name) &&\n !state.routes.some((r) => r.key === route.key)\n ) {\n // If route isn't present in current state, but was closing, assume that a close animation was cancelled\n // So we need to add this route back to the state\n navigation.navigate(route);\n } else {\n this.setState((state) => ({\n routes: state.replacingRouteKeys.length\n ? state.routes.filter(\n (r) => !state.replacingRouteKeys.includes(r.key)\n )\n : state.routes,\n openingRouteKeys: state.openingRouteKeys.filter(\n (key) => key !== route.key\n ),\n closingRouteKeys: state.closingRouteKeys.filter(\n (key) => key !== route.key\n ),\n replacingRouteKeys: [],\n }));\n }\n };\n\n private handleCloseRoute = ({ route }: { route: Route<string> }) => {\n const { state, navigation } = this.props;\n\n if (state.routes.some((r) => r.key === route.key)) {\n // If a route exists in state, trigger a pop\n // This will happen in when the route was closed from the card component\n // e.g. When the close animation triggered from a gesture ends\n navigation.dispatch({\n ...StackActions.pop(),\n source: route.key,\n target: state.key,\n });\n } else {\n // We need to clean up any state tracking the route and pop it immediately\n this.setState((state) => ({\n routes: state.routes.filter((r) => r.key !== route.key),\n openingRouteKeys: state.openingRouteKeys.filter(\n (key) => key !== route.key\n ),\n closingRouteKeys: state.closingRouteKeys.filter(\n (key) => key !== route.key\n ),\n }));\n }\n };\n\n private handleTransitionStart = (\n { route }: { route: Route<string> },\n closing: boolean\n ) =>\n this.props.navigation.emit({\n type: 'transitionStart',\n data: { closing },\n target: route.key,\n });\n\n private handleTransitionEnd = (\n { route }: { route: Route<string> },\n closing: boolean\n ) =>\n this.props.navigation.emit({\n type: 'transitionEnd',\n data: { closing },\n target: route.key,\n });\n\n private handleGestureStart = ({ route }: { route: Route<string> }) => {\n this.props.navigation.emit({\n type: 'gestureStart',\n target: route.key,\n });\n };\n\n private handleGestureEnd = ({ route }: { route: Route<string> }) => {\n this.props.navigation.emit({\n type: 'gestureEnd',\n target: route.key,\n });\n };\n\n private handleGestureCancel = ({ route }: { route: Route<string> }) => {\n this.props.navigation.emit({\n type: 'gestureCancel',\n target: route.key,\n });\n };\n\n render() {\n const {\n state,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n descriptors: _,\n ...rest\n } = this.props;\n\n const { routes, descriptors, openingRouteKeys, closingRouteKeys } =\n this.state;\n\n return (\n <GestureHandlerWrapper style={styles.container}>\n <SafeAreaProviderCompat>\n <SafeAreaInsetsContext.Consumer>\n {(insets) => (\n <ModalPresentationContext.Consumer>\n {(isParentModal) => (\n <HeaderShownContext.Consumer>\n {(isParentHeaderShown) => (\n <CardStack\n insets={insets as EdgeInsets}\n isParentHeaderShown={isParentHeaderShown}\n isParentModal={isParentModal}\n getPreviousRoute={this.getPreviousRoute}\n routes={routes}\n openingRouteKeys={openingRouteKeys}\n closingRouteKeys={closingRouteKeys}\n onOpenRoute={this.handleOpenRoute}\n onCloseRoute={this.handleCloseRoute}\n onTransitionStart={this.handleTransitionStart}\n onTransitionEnd={this.handleTransitionEnd}\n renderHeader={this.renderHeader}\n renderScene={this.renderScene}\n state={state}\n descriptors={descriptors}\n onGestureStart={this.handleGestureStart}\n onGestureEnd={this.handleGestureEnd}\n onGestureCancel={this.handleGestureCancel}\n {...rest}\n />\n )}\n </HeaderShownContext.Consumer>\n )}\n </ModalPresentationContext.Consumer>\n )}\n </SafeAreaInsetsContext.Consumer>\n </SafeAreaProviderCompat>\n </GestureHandlerWrapper>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
@@ -25,4 +25,4 @@ export { default as useGestureHandlerRef } from './utils/useGestureHandlerRef';
25
25
  /**
26
26
  * Types
27
27
  */
28
- export type { StackCardInterpolatedStyle, StackCardInterpolationProps, StackCardStyleInterpolator, StackHeaderInterpolatedStyle, StackHeaderInterpolationProps, StackHeaderProps, StackHeaderStyleInterpolator, StackNavigationOptions, StackNavigationProp, StackScreenProps, TransitionPreset, } from './types';
28
+ export type { StackCardInterpolatedStyle, StackCardInterpolationProps, StackCardStyleInterpolator, StackHeaderInterpolatedStyle, StackHeaderInterpolationProps, StackHeaderProps, StackHeaderStyleInterpolator, StackNavigationEventMap, StackNavigationOptions, StackNavigationProp, StackScreenProps, TransitionPreset, } from './types';
@@ -2,6 +2,6 @@
2
2
  import { DefaultNavigatorOptions, ParamListBase, StackNavigationState, StackRouterOptions } from '@react-navigation/native';
3
3
  import type { StackNavigationConfig, StackNavigationEventMap, StackNavigationOptions } from '../types';
4
4
  declare type Props = DefaultNavigatorOptions<ParamListBase, StackNavigationState<ParamListBase>, StackNavigationOptions, StackNavigationEventMap> & StackRouterOptions & StackNavigationConfig;
5
- declare function StackNavigator({ initialRouteName, children, screenListeners, screenOptions, ...rest }: Props): JSX.Element;
5
+ declare function StackNavigator({ id, initialRouteName, children, screenListeners, screenOptions, ...rest }: Props): JSX.Element;
6
6
  declare const _default: <ParamList extends ParamListBase>() => import("@react-navigation/native").TypedNavigator<ParamList, StackNavigationState<ParamListBase>, StackNavigationOptions, StackNavigationEventMap, typeof StackNavigator>;
7
7
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { HeaderBackButton, HeaderBackButtonProps, HeaderOptions, HeaderTitleProps } from '@react-navigation/elements';
1
+ import type { HeaderBackButton, HeaderBackButtonProps, HeaderButtonProps, HeaderOptions, HeaderTitleProps } from '@react-navigation/elements';
2
2
  import type { Descriptor, NavigationHelpers, NavigationProp, ParamListBase, Route, RouteProp, StackActionHelpers, StackNavigationState } from '@react-navigation/native';
3
3
  import type * as React from 'react';
4
4
  import type { Animated, StyleProp, TextStyle, ViewStyle } from 'react-native';
@@ -39,9 +39,9 @@ export declare type StackNavigationEventMap = {
39
39
  };
40
40
  };
41
41
  export declare type StackNavigationHelpers = NavigationHelpers<ParamListBase, StackNavigationEventMap> & StackActionHelpers<ParamListBase>;
42
- export declare type StackNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList> = NavigationProp<ParamList, RouteName, StackNavigationState<ParamList>, StackNavigationOptions, StackNavigationEventMap> & StackActionHelpers<ParamList>;
43
- export declare type StackScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList> = {
44
- navigation: StackNavigationProp<ParamList, RouteName>;
42
+ export declare type StackNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, StackNavigationState<ParamList>, StackNavigationOptions, StackNavigationEventMap> & StackActionHelpers<ParamList>;
43
+ export declare type StackScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = {
44
+ navigation: StackNavigationProp<ParamList, RouteName, NavigatorID>;
45
45
  route: RouteProp<ParamList, RouteName>;
46
46
  };
47
47
  export declare type Layout = {
@@ -89,7 +89,7 @@ export declare type SceneProgress = {
89
89
  };
90
90
  export declare type StackHeaderMode = 'float' | 'screen';
91
91
  export declare type StackPresentationMode = 'card' | 'modal';
92
- export declare type StackHeaderOptions = Omit<HeaderOptions, 'headerLeft' | 'headerTitle'> & {
92
+ export declare type StackHeaderOptions = Omit<HeaderOptions, 'headerLeft' | 'headerTitle' | 'headerRight'> & {
93
93
  /**
94
94
  * String or a function that returns a React Element to be used by the header.
95
95
  * Defaults to screen `title` or route name.
@@ -102,6 +102,10 @@ export declare type StackHeaderOptions = Omit<HeaderOptions, 'headerLeft' | 'hea
102
102
  * Function which returns a React Element to display on the left side of the header.
103
103
  */
104
104
  headerLeft?: (props: HeaderBackButtonProps) => React.ReactNode;
105
+ /**
106
+ * Function which returns a React Element to display on the right side of the header.
107
+ */
108
+ headerRight?: (props: HeaderButtonProps) => React.ReactNode;
105
109
  /**
106
110
  * Whether back button title font should scale to respect Text Size accessibility settings. Defaults to `false`.
107
111
  */