1 | {"version":3,"sources":["CardContainer.tsx"],"names":["getHeaderTitle","HeaderBackContext","HeaderHeightContext","HeaderShownContext","useTheme","React","StyleSheet","View","ModalPresentationContext","useKeyboardManager","Card","EPSILON","CardContainer","interpolationIndex","index","active","closing","gesture","focused","modal","getPreviousScene","getFocusedRoute","headerDarkContent","hasAbsoluteFloatHeader","headerHeight","onHeaderHeightChange","isParentHeaderShown","isNextScreenTransparent","detachCurrentScreen","layout","onCloseRoute","onOpenRoute","onGestureCancel","onGestureEnd","onGestureStart","onTransitionEnd","onTransitionStart","renderHeader","renderScene","safeAreaInsetBottom","safeAreaInsetLeft","safeAreaInsetRight","safeAreaInsetTop","scene","parentHeaderHeight","useContext","onPageChangeStart","onPageChangeCancel","onPageChangeConfirm","useCallback","options","navigation","descriptor","isFocused","keyboardHandlingEnabled","handleOpen","route","handleClose","handleGestureBegin","handleGestureCanceled","handleGestureEnd","handleTransition","insets","top","right","bottom","left","colors","pointerEvents","setPointerEvents","useState","useEffect","listener","progress","next","addListener","value","removeListener","presentation","animationEnabled","cardOverlay","cardOverlayEnabled","cardShadowEnabled","cardStyle","cardStyleInterpolator","gestureDirection","gestureEnabled","gestureResponseDistance","gestureVelocityImpact","headerMode","headerShown","transitionSpec","previousScene","backTitle","name","headerBack","useMemo","undefined","title","current","marginTop","backgroundColor","background","overflow","display","absoluteFill","styles","container","mode","scenes","onContentHeightChange","memo","create","flex","flexDirection"],"mappings":"AAAA,SACEA,cADF,EAEEC,iBAFF,EAGEC,mBAHF,EAIEC,kBAJF,QAKO,4BALP;AAMA,SAAgBC,QAAhB,QAAgC,0BAAhC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAAmBC,UAAnB,EAA+BC,IAA/B,QAA2C,cAA3C;AAGA,OAAOC,wBAAP,MAAqC,sCAArC;AACA,OAAOC,kBAAP,MAA+B,gCAA/B;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AA0CA,MAAMC,OAAO,GAAG,GAAhB;;AAEA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I,EAAE,CADG;AAETC,IAAAA,aAAa,EAAE;AAFN,GADoB;AAK/BvE,EAAAA,KAAK,EAAE;AACLsE,IAAAA,IAAI,EAAE;AADD;AALwB,CAAlB,CAAf","sourcesContent":["import {\n getHeaderTitle,\n HeaderBackContext,\n HeaderHeightContext,\n HeaderShownContext,\n} from '@react-navigation/elements';\nimport { Route, useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport { Animated, StyleSheet, View } from 'react-native';\n\nimport type { Layout, Scene } from '../../types';\nimport ModalPresentationContext from '../../utils/ModalPresentationContext';\nimport useKeyboardManager from '../../utils/useKeyboardManager';\nimport type { Props as HeaderContainerProps } from '../Header/HeaderContainer';\nimport Card from './Card';\n\ntype Props = {\n interpolationIndex: number;\n index: number;\n active: boolean;\n focused: boolean;\n closing: boolean;\n modal: boolean;\n layout: Layout;\n gesture: Animated.Value;\n scene: Scene;\n headerDarkContent: boolean | undefined;\n safeAreaInsetTop: number;\n safeAreaInsetRight: number;\n safeAreaInsetBottom: number;\n safeAreaInsetLeft: number;\n getPreviousScene: (props: { route: Route<string> }) => Scene | undefined;\n getFocusedRoute: () => Route<string>;\n renderHeader: (props: HeaderContainerProps) => React.ReactNode;\n renderScene: (props: { route: Route<string> }) => React.ReactNode;\n onOpenRoute: (props: { route: Route<string> }) => void;\n onCloseRoute: (props: { route: Route<string> }) => void;\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 hasAbsoluteFloatHeader: boolean;\n headerHeight: number;\n onHeaderHeightChange: (props: {\n route: Route<string>;\n height: number;\n }) => void;\n isParentHeaderShown: boolean;\n isNextScreenTransparent: boolean;\n detachCurrentScreen: boolean;\n};\n\nconst EPSILON = 0.1;\n\nfunction CardContainer({\n interpolationIndex,\n index,\n active,\n closing,\n gesture,\n focused,\n modal,\n getPreviousScene,\n getFocusedRoute,\n headerDarkContent,\n hasAbsoluteFloatHeader,\n headerHeight,\n onHeaderHeightChange,\n isParentHeaderShown,\n isNextScreenTransparent,\n detachCurrentScreen,\n layout,\n onCloseRoute,\n onOpenRoute,\n onGestureCancel,\n onGestureEnd,\n onGestureStart,\n onTransitionEnd,\n onTransitionStart,\n renderHeader,\n renderScene,\n safeAreaInsetBottom,\n safeAreaInsetLeft,\n safeAreaInsetRight,\n safeAreaInsetTop,\n scene,\n}: Props) {\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n\n const { onPageChangeStart, onPageChangeCancel, onPageChangeConfirm } =\n useKeyboardManager(\n React.useCallback(() => {\n const { options, navigation } = scene.descriptor;\n\n return (\n navigation.isFocused() && options.keyboardHandlingEnabled !== false\n );\n }, [scene.descriptor])\n );\n\n const handleOpen = () => {\n const { route } = scene.descriptor;\n\n onTransitionEnd({ route }, false);\n onOpenRoute({ route });\n };\n\n const handleClose = () => {\n const { route } = scene.descriptor;\n\n onTransitionEnd({ route }, true);\n onCloseRoute({ route });\n };\n\n const handleGestureBegin = () => {\n const { route } = scene.descriptor;\n\n onPageChangeStart();\n onGestureStart({ route });\n };\n\n const handleGestureCanceled = () => {\n const { route } = scene.descriptor;\n\n onPageChangeCancel();\n onGestureCancel({ route });\n };\n\n const handleGestureEnd = () => {\n const { route } = scene.descriptor;\n\n onGestureEnd({ route });\n };\n\n const handleTransition = ({\n closing,\n gesture,\n }: {\n closing: boolean;\n gesture: boolean;\n }) => {\n const { route } = scene.descriptor;\n\n if (!gesture) {\n onPageChangeConfirm?.(true);\n } else if (active && closing) {\n onPageChangeConfirm?.(false);\n } else {\n onPageChangeCancel?.();\n }\n\n onTransitionStart?.({ route }, closing);\n };\n\n const insets = {\n top: safeAreaInsetTop,\n right: safeAreaInsetRight,\n bottom: safeAreaInsetBottom,\n left: safeAreaInsetLeft,\n };\n\n const { colors } = useTheme();\n\n const [pointerEvents, setPointerEvents] = React.useState<'box-none' | 'none'>(\n 'box-none'\n );\n\n React.useEffect(() => {\n const listener = scene.progress.next?.addListener?.(\n ({ value }: { value: number }) => {\n setPointerEvents(value <= EPSILON ? 'box-none' : 'none');\n }\n );\n\n return () => {\n if (listener) {\n scene.progress.next?.removeListener?.(listener);\n }\n };\n }, [pointerEvents, scene.progress.next]);\n\n const {\n presentation,\n animationEnabled,\n cardOverlay,\n cardOverlayEnabled,\n cardShadowEnabled,\n cardStyle,\n cardStyleInterpolator,\n gestureDirection,\n gestureEnabled,\n gestureResponseDistance,\n gestureVelocityImpact,\n headerMode,\n headerShown,\n transitionSpec,\n } = scene.descriptor.options;\n\n const previousScene = getPreviousScene({ route: scene.descriptor.route });\n\n let backTitle: string | undefined;\n\n if (previousScene) {\n const { options, route } = previousScene.descriptor;\n\n backTitle = getHeaderTitle(options, route.name);\n }\n\n const headerBack = React.useMemo(\n () => (backTitle !== undefined ? { title: backTitle } : undefined),\n [backTitle]\n );\n\n return (\n <Card\n interpolationIndex={interpolationIndex}\n gestureDirection={gestureDirection}\n layout={layout}\n insets={insets}\n gesture={gesture}\n current={scene.progress.current}\n next={scene.progress.next}\n closing={closing}\n onOpen={handleOpen}\n onClose={handleClose}\n overlay={cardOverlay}\n overlayEnabled={cardOverlayEnabled}\n shadowEnabled={cardShadowEnabled}\n onTransition={handleTransition}\n onGestureBegin={handleGestureBegin}\n onGestureCanceled={handleGestureCanceled}\n onGestureEnd={handleGestureEnd}\n gestureEnabled={index === 0 ? false : gestureEnabled}\n gestureResponseDistance={gestureResponseDistance}\n gestureVelocityImpact={gestureVelocityImpact}\n transitionSpec={transitionSpec}\n styleInterpolator={cardStyleInterpolator}\n accessibilityElementsHidden={!focused}\n importantForAccessibility={focused ? 'auto' : 'no-hide-descendants'}\n pointerEvents={active ? 'box-none' : pointerEvents}\n pageOverflowEnabled={headerMode !== 'float' && presentation !== 'modal'}\n headerDarkContent={headerDarkContent}\n containerStyle={\n hasAbsoluteFloatHeader && headerMode !== 'screen'\n ? { marginTop: headerHeight }\n : null\n }\n contentStyle={[\n {\n backgroundColor:\n presentation === 'transparentModal'\n ? 'transparent'\n : colors.background,\n },\n cardStyle,\n ]}\n style={[\n {\n // This is necessary to avoid unfocused larger pages increasing scroll area\n // The issue can be seen on the web when a smaller screen is pushed over a larger one\n overflow: active ? undefined : 'hidden',\n display:\n // Hide unfocused screens when animation isn't enabled\n // This is also necessary for a11y on web\n animationEnabled === false &&\n isNextScreenTransparent === false &&\n detachCurrentScreen !== false &&\n !focused\n ? 'none'\n : 'flex',\n },\n StyleSheet.absoluteFill,\n ]}\n >\n <View style={styles.container}>\n <ModalPresentationContext.Provider value={modal}>\n <View style={styles.scene}>\n <HeaderBackContext.Provider value={headerBack}>\n <HeaderShownContext.Provider\n value={isParentHeaderShown || headerShown !== false}\n >\n <HeaderHeightContext.Provider\n value={headerShown ? headerHeight : parentHeaderHeight ?? 0}\n >\n {renderScene({ route: scene.descriptor.route })}\n </HeaderHeightContext.Provider>\n </HeaderShownContext.Provider>\n </HeaderBackContext.Provider>\n </View>\n {headerMode !== 'float'\n ? renderHeader({\n mode: 'screen',\n layout,\n scenes: [previousScene, scene],\n getPreviousScene,\n getFocusedRoute,\n onContentHeightChange: onHeaderHeightChange,\n })\n : null}\n </ModalPresentationContext.Provider>\n </View>\n </Card>\n );\n}\n\nexport default React.memo(CardContainer);\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column-reverse',\n },\n scene: {\n flex: 1,\n },\n});\n"]} |