UNPKG

32.9 kBSource Map (JSON)View Raw
1{"version":3,"sources":["Card.tsx"],"names":["Color","React","Animated","InteractionManager","Platform","StyleSheet","View","forModalPresentationIOS","CardAnimationContext","getDistanceForDirection","getInvertedMultiplier","memoize","GestureState","PanGestureHandler","ModalStatusBarManager","CardSheet","GESTURE_VELOCITY_IMPACT","TRUE","FALSE","GESTURE_RESPONSE_DISTANCE_HORIZONTAL","GESTURE_RESPONSE_DISTANCE_VERTICAL","useNativeDriver","OS","hasOpacityStyle","style","flattenedStyle","flatten","opacity","Card","Component","Value","props","gestureDirection","width","layout","height","closing","velocity","gesture","transitionSpec","onOpen","onClose","onTransition","toValue","getAnimateToValue","lastToValue","isClosing","setValue","spec","close","open","animation","spring","timing","setPointerEventsEnabled","handleStartInteraction","clearTimeout","pendingGestureCallback","undefined","config","isInteraction","start","finished","handleEndInteraction","isCurrentlyMounted","forceUpdate","enabled","pointerEvents","contentRef","current","setNativeProps","interactionHandle","createInteractionHandle","clearInteractionHandle","nativeEvent","onGestureBegin","onGestureCanceled","onGestureEnd","gestureVelocityImpact","state","ACTIVE","isSwiping","CANCELLED","velocityY","velocityX","animate","END","distance","translation","translationY","translationX","setTimeout","styleInterpolator","interpolationIndex","next","insetTop","insetRight","insetBottom","insetLeft","index","progress","swiping","inverted","layouts","screen","insets","top","right","bottom","left","createRef","componentDidMount","componentDidUpdate","prevProps","componentWillUnmount","stopAnimation","gestureActivationCriteria","gestureResponseDistance","enableTrackpadTwoFingerGesture","maxDeltaX","minOffsetY","hitSlop","invertedMultiplier","minOffsetX","maxDeltaY","render","overlay","overlayEnabled","shadowEnabled","gestureEnabled","pageOverflowEnabled","headerDarkContent","children","containerStyle","customContainerStyle","contentStyle","rest","interpolationProps","getCardAnimation","interpolatedStyle","getInterpolatedStyle","cardStyle","overlayStyle","shadowStyle","handleGestureEvent","event","backgroundColor","isTransparent","alpha","getIsModalPresentation","absoluteFill","styles","container","handleGestureStateChange","shadow","shadowHorizontal","shadowLeft","shadowRight","shadowVertical","shadowTop","shadowBottom","cardStyleInterpolator","name","create","flex","position","shadowRadius","shadowColor","shadowOpacity","shadowOffset"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SACEC,QADF,EAEEC,kBAFF,EAGEC,QAHF,EAKEC,UALF,EAMEC,IANF,QASO,cATP;AAYA,SAASC,uBAAT,QAAwC,gDAAxC;AAQA,OAAOC,oBAAP,MAAiC,kCAAjC;AACA,OAAOC,uBAAP,MAAoC,qCAApC;AACA,OAAOC,qBAAP,MAAkC,mCAAlC;AACA,OAAOC,OAAP,MAAoB,qBAApB;AACA,SACEC,YADF,EAEEC,iBAFF,QAIO,mBAJP;AAKA,OAAOC,qBAAP,MAAkC,0BAAlC;AACA,OAAOC,SAAP,MAAsB,aAAtB;AAqCA,MAAMC,uBAAuB,GAAG,GAAhC;AAEA,MAAMC,IAAI,GAAG,CAAb;AACA,MAAMC,KAAK,GAAG,CAAd;AAEA;AACA;AACA;;AACA,MAAMC,oCAAoC,GAAG,EAA7C;AACA,MAAMC,kCAAkC,GAAG,GAA3C;AAEA,MAAMC,eAAe,GAAGjB,QAAQ,CAACkB,EAAT,KAAgB,KAAxC;;AAEA,MAAMC,eAAe,GAAIC,KAAD,IAAgB;AACtC,MAAIA,KAAJ,EAAW;AACT,UAAMC,cAAc,GAAGpB,UAAU,CAACqB,OAAX,CAAmBF,KAAnB,CAAvB;AACA,WAAOC,cAAc,CAACE,OAAf,IAA0B,IAAjC;AACD;;AAED,SAAO,KAAP;AACD,CAPD;;AASA,eAAe,MAAMC,IAAN,SAAmB3B,KAAK,CAAC4B,SAAzB,CAA0C;AAAA;AAAA;;AAAA,gDAyD1B,KAzD0B;;AAAA,uCA2DnC,IAAI3B,QAAQ,CAAC4B,KAAb,CAAmBZ,KAAnB,CA3DmC;;AAAA,sCA6DpC,IAAIhB,QAAQ,CAAC4B,KAAb,CACjBpB,qBAAqB,CAAC,K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Q,EAAAA,MAAM,EAAE;AACNW,IAAAA,QAAQ,EAAE,UADJ;AAENC,IAAAA,YAAY,EAAE,CAFR;AAGNC,IAAAA,WAAW,EAAE,MAHP;AAINC,IAAAA,aAAa,EAAE;AAJT,GARuB;AAc/Bb,EAAAA,gBAAgB,EAAE;AAChBjD,IAAAA,GAAG,EAAE,CADW;AAEhBE,IAAAA,MAAM,EAAE,CAFQ;AAGhB3E,IAAAA,KAAK,EAAE,CAHS;AAIhBwI,IAAAA,YAAY,EAAE;AAAExI,MAAAA,KAAK,EAAE,CAAC,CAAV;AAAaE,MAAAA,MAAM,EAAE;AAArB;AAJE,GAda;AAoB/ByH,EAAAA,UAAU,EAAE;AACV/C,IAAAA,IAAI,EAAE;AADI,GApBmB;AAuB/BgD,EAAAA,WAAW,EAAE;AACXlD,IAAAA,KAAK,EAAE;AADI,GAvBkB;AA0B/BmD,EAAAA,cAAc,EAAE;AACdjD,IAAAA,IAAI,EAAE,CADQ;AAEdF,IAAAA,KAAK,EAAE,CAFO;AAGdxE,IAAAA,MAAM,EAAE,CAHM;AAIdsI,IAAAA,YAAY,EAAE;AAAExI,MAAAA,KAAK,EAAE,CAAT;AAAYE,MAAAA,MAAM,EAAE,CAAC;AAArB;AAJA,GA1Be;AAgC/B4H,EAAAA,SAAS,EAAE;AACTrD,IAAAA,GAAG,EAAE;AADI,GAhCoB;AAmC/BsD,EAAAA,YAAY,EAAE;AACZpD,IAAAA,MAAM,EAAE;AADI;AAnCiB,CAAlB,CAAf","sourcesContent":["import Color from 'color';\nimport * as React from 'react';\nimport {\n Animated,\n InteractionManager,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport type { EdgeInsets } from 'react-native-safe-area-context';\n\nimport { forModalPresentationIOS } from '../../TransitionConfigs/CardStyleInterpolators';\nimport type {\n GestureDirection,\n Layout,\n StackCardInterpolationProps,\n StackCardStyleInterpolator,\n TransitionSpec,\n} from '../../types';\nimport CardAnimationContext from '../../utils/CardAnimationContext';\nimport getDistanceForDirection from '../../utils/getDistanceForDirection';\nimport getInvertedMultiplier from '../../utils/getInvertedMultiplier';\nimport memoize from '../../utils/memoize';\nimport {\n GestureState,\n PanGestureHandler,\n PanGestureHandlerGestureEvent,\n} from '../GestureHandler';\nimport ModalStatusBarManager from '../ModalStatusBarManager';\nimport CardSheet from './CardSheet';\n\ntype Props = ViewProps & {\n interpolationIndex: number;\n closing: boolean;\n next?: Animated.AnimatedInterpolation;\n current: Animated.AnimatedInterpolation;\n gesture: Animated.Value;\n layout: Layout;\n insets: EdgeInsets;\n headerDarkContent: boolean | undefined;\n pageOverflowEnabled: boolean;\n gestureDirection: GestureDirection;\n onOpen: () => void;\n onClose: () => void;\n onTransition: (props: { closing: boolean; gesture: boolean }) => void;\n onGestureBegin: () => void;\n onGestureCanceled: () => void;\n onGestureEnd: () => void;\n children: React.ReactNode;\n overlay: (props: {\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n }) => React.ReactNode;\n overlayEnabled: boolean;\n shadowEnabled: boolean;\n gestureEnabled: boolean;\n gestureResponseDistance?: number;\n gestureVelocityImpact: number;\n transitionSpec: {\n open: TransitionSpec;\n close: TransitionSpec;\n };\n styleInterpolator: StackCardStyleInterpolator;\n containerStyle?: StyleProp<ViewStyle>;\n contentStyle?: StyleProp<ViewStyle>;\n};\n\nconst GESTURE_VELOCITY_IMPACT = 0.3;\n\nconst TRUE = 1;\nconst FALSE = 0;\n\n/**\n * The distance of touch start from the edge of the screen where the gesture will be recognized\n */\nconst GESTURE_RESPONSE_DISTANCE_HORIZONTAL = 50;\nconst GESTURE_RESPONSE_DISTANCE_VERTICAL = 135;\n\nconst useNativeDriver = Platform.OS !== 'web';\n\nconst hasOpacityStyle = (style: any) => {\n if (style) {\n const flattenedStyle = StyleSheet.flatten(style);\n return flattenedStyle.opacity != null;\n }\n\n return false;\n};\n\nexport default class Card extends React.Component<Props> {\n static defaultProps = {\n shadowEnabled: false,\n gestureEnabled: true,\n gestureVelocityImpact: GESTURE_VELOCITY_IMPACT,\n overlay: ({\n style,\n }: {\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n }) =>\n style ? (\n <Animated.View pointerEvents=\"none\" style={[styles.overlay, style]} />\n ) : null,\n };\n\n componentDidMount() {\n this.animate({ closing: this.props.closing });\n this.isCurrentlyMounted = true;\n }\n\n componentDidUpdate(prevProps: Props) {\n const { layout, gestureDirection, closing } = this.props;\n const { width, height } = layout;\n\n if (width !== prevProps.layout.width) {\n this.layout.width.setValue(width);\n }\n\n if (height !== prevProps.layout.height) {\n this.layout.height.setValue(height);\n }\n\n if (gestureDirection !== prevProps.gestureDirection) {\n this.inverted.setValue(getInvertedMultiplier(gestureDirection));\n }\n\n const toValue = this.getAnimateToValue(this.props);\n\n if (\n this.getAnimateToValue(prevProps) !== toValue ||\n this.lastToValue !== toValue\n ) {\n // We need to trigger the animation when route was closed\n // Thr route might have been closed by a `POP` action or by a gesture\n // When route was closed due to a gesture, the animation would've happened already\n // It's still important to trigger the animation so that `onClose` is called\n // If `onClose` is not called, cleanup step won't be performed for gestures\n this.animate({ closing });\n }\n }\n\n componentWillUnmount() {\n this.props.gesture.stopAnimation();\n this.isCurrentlyMounted = false;\n this.handleEndInteraction();\n }\n\n private isCurrentlyMounted = false;\n\n private isClosing = new Animated.Value(FALSE);\n\n private inverted = new Animated.Value(\n getInvertedMultiplier(this.props.gestureDirection)\n );\n\n private layout = {\n width: new Animated.Value(this.props.layout.width),\n height: new Animated.Value(this.props.layout.height),\n };\n\n private isSwiping = new Animated.Value(FALSE);\n\n private interactionHandle: number | undefined;\n\n private pendingGestureCallback: number | undefined;\n\n private lastToValue: number | undefined;\n\n private animate = ({\n closing,\n velocity,\n }: {\n closing: boolean;\n velocity?: number;\n }) => {\n const { gesture, transitionSpec, onOpen, onClose, onTransition } =\n this.props;\n\n const toValue = this.getAnimateToValue({\n ...this.props,\n closing,\n });\n\n this.lastToValue = toValue;\n\n this.isClosing.setValue(closing ? TRUE : FALSE);\n\n const spec = closing ? transitionSpec.close : transitionSpec.open;\n\n const animation =\n spec.animation === 'spring' ? Animated.spring : Animated.timing;\n\n this.setPointerEventsEnabled(!closing);\n this.handleStartInteraction();\n\n clearTimeout(this.pendingGestureCallback);\n\n onTransition?.({ closing, gesture: velocity !== undefined });\n animation(gesture, {\n ...spec.config,\n velocity,\n toValue,\n useNativeDriver,\n isInteraction: false,\n }).start(({ finished }) => {\n this.handleEndInteraction();\n\n clearTimeout(this.pendingGestureCallback);\n\n if (finished) {\n if (closing) {\n onClose();\n } else {\n onOpen();\n }\n\n if (this.isCurrentlyMounted) {\n // Make sure to re-open screen if it wasn't removed\n this.forceUpdate();\n }\n }\n });\n };\n\n private getAnimateToValue = ({\n closing,\n layout,\n gestureDirection,\n }: {\n closing?: boolean;\n layout: Layout;\n gestureDirection: GestureDirection;\n }) => {\n if (!closing) {\n return 0;\n }\n\n return getDistanceForDirection(layout, gestureDirection);\n };\n\n private setPointerEventsEnabled = (enabled: boolean) => {\n const pointerEvents = enabled ? 'box-none' : 'none';\n\n this.contentRef.current?.setNativeProps({ pointerEvents });\n };\n\n private handleStartInteraction = () => {\n if (this.interactionHandle === undefined) {\n this.interactionHandle = InteractionManager.createInteractionHandle();\n }\n };\n\n private handleEndInteraction = () => {\n if (this.interactionHandle !== undefined) {\n InteractionManager.clearInteractionHandle(this.interactionHandle);\n this.interactionHandle = undefined;\n }\n };\n\n private handleGestureStateChange = ({\n nativeEvent,\n }: PanGestureHandlerGestureEvent) => {\n const {\n layout,\n onClose,\n onGestureBegin,\n onGestureCanceled,\n onGestureEnd,\n gestureDirection,\n gestureVelocityImpact,\n } = this.props;\n\n switch (nativeEvent.state) {\n case GestureState.ACTIVE:\n this.isSwiping.setValue(TRUE);\n this.handleStartInteraction();\n onGestureBegin?.();\n break;\n case GestureState.CANCELLED: {\n this.isSwiping.setValue(FALSE);\n this.handleEndInteraction();\n\n const velocity =\n gestureDirection === 'vertical' ||\n gestureDirection === 'vertical-inverted'\n ? nativeEvent.velocityY\n : nativeEvent.velocityX;\n\n this.animate({ closing: this.props.closing, velocity });\n\n onGestureCanceled?.();\n break;\n }\n case GestureState.END: {\n this.isSwiping.setValue(FALSE);\n\n let distance;\n let translation;\n let velocity;\n\n if (\n gestureDirection === 'vertical' ||\n gestureDirection === 'vertical-inverted'\n ) {\n distance = layout.height;\n translation = nativeEvent.translationY;\n velocity = nativeEvent.velocityY;\n } else {\n distance = layout.width;\n translation = nativeEvent.translationX;\n velocity = nativeEvent.velocityX;\n }\n\n const closing =\n (translation + velocity * gestureVelocityImpact) *\n getInvertedMultiplier(gestureDirection) >\n distance / 2\n ? velocity !== 0 || translation !== 0\n : this.props.closing;\n\n this.animate({ closing, velocity });\n\n if (closing) {\n // We call onClose with a delay to make sure that the animation has already started\n // This will make sure that the state update caused by this doesn't affect start of animation\n this.pendingGestureCallback = setTimeout(() => {\n onClose();\n\n // Trigger an update after we dispatch the action to remove the screen\n // This will make sure that we check if the screen didn't get removed so we can cancel the animation\n this.forceUpdate();\n }, 32) as any as number;\n }\n\n onGestureEnd?.();\n break;\n }\n }\n };\n\n // Memoize this to avoid extra work on re-render\n private getInterpolatedStyle = memoize(\n (\n styleInterpolator: StackCardStyleInterpolator,\n animation: StackCardInterpolationProps\n ) => styleInterpolator(animation)\n );\n\n // Keep track of the animation context when deps changes.\n private getCardAnimation = memoize(\n (\n interpolationIndex: number,\n current: Animated.AnimatedInterpolation,\n next: Animated.AnimatedInterpolation | undefined,\n layout: Layout,\n insetTop: number,\n insetRight: number,\n insetBottom: number,\n insetLeft: number\n ) => ({\n index: interpolationIndex,\n current: { progress: current },\n next: next && { progress: next },\n closing: this.isClosing,\n swiping: this.isSwiping,\n inverted: this.inverted,\n layouts: {\n screen: layout,\n },\n insets: {\n top: insetTop,\n right: insetRight,\n bottom: insetBottom,\n left: insetLeft,\n },\n })\n );\n\n private gestureActivationCriteria() {\n const { layout, gestureDirection, gestureResponseDistance } = this.props;\n const enableTrackpadTwoFingerGesture = true;\n\n const distance =\n gestureResponseDistance !== undefined\n ? gestureResponseDistance\n : gestureDirection === 'vertical' ||\n gestureDirection === 'vertical-inverted'\n ? GESTURE_RESPONSE_DISTANCE_VERTICAL\n : GESTURE_RESPONSE_DISTANCE_HORIZONTAL;\n\n if (gestureDirection === 'vertical') {\n return {\n maxDeltaX: 15,\n minOffsetY: 5,\n hitSlop: { bottom: -layout.height + distance },\n enableTrackpadTwoFingerGesture,\n };\n } else if (gestureDirection === 'vertical-inverted') {\n return {\n maxDeltaX: 15,\n minOffsetY: -5,\n hitSlop: { top: -layout.height + distance },\n enableTrackpadTwoFingerGesture,\n };\n } else {\n const hitSlop = -layout.width + distance;\n const invertedMultiplier = getInvertedMultiplier(gestureDirection);\n\n if (invertedMultiplier === 1) {\n return {\n minOffsetX: 5,\n maxDeltaY: 20,\n hitSlop: { right: hitSlop },\n enableTrackpadTwoFingerGesture,\n };\n } else {\n return {\n minOffsetX: -5,\n maxDeltaY: 20,\n hitSlop: { left: hitSlop },\n enableTrackpadTwoFingerGesture,\n };\n }\n }\n }\n\n private contentRef = React.createRef<View>();\n\n render() {\n const {\n styleInterpolator,\n interpolationIndex,\n current,\n gesture,\n next,\n layout,\n insets,\n overlay,\n overlayEnabled,\n shadowEnabled,\n gestureEnabled,\n gestureDirection,\n pageOverflowEnabled,\n headerDarkContent,\n children,\n containerStyle: customContainerStyle,\n contentStyle,\n ...rest\n } = this.props;\n\n const interpolationProps = this.getCardAnimation(\n interpolationIndex,\n current,\n next,\n layout,\n insets.top,\n insets.right,\n insets.bottom,\n insets.left\n );\n\n const interpolatedStyle = this.getInterpolatedStyle(\n styleInterpolator,\n interpolationProps\n );\n\n const { containerStyle, cardStyle, overlayStyle, shadowStyle } =\n interpolatedStyle;\n\n const handleGestureEvent = gestureEnabled\n ? Animated.event(\n [\n {\n nativeEvent:\n gestureDirection === 'vertical' ||\n gestureDirection === 'vertical-inverted'\n ? { translationY: gesture }\n : { translationX: gesture },\n },\n ],\n { useNativeDriver }\n )\n : undefined;\n\n const { backgroundColor } = StyleSheet.flatten(contentStyle || {});\n const isTransparent =\n typeof backgroundColor === 'string'\n ? Color(backgroundColor).alpha() === 0\n : false;\n\n return (\n <CardAnimationContext.Provider value={interpolationProps}>\n {\n // StatusBar messes with translucent status bar on Android\n // So we should only enable it on iOS\n Platform.OS === 'ios' &&\n overlayEnabled &&\n next &&\n getIsModalPresentation(styleInterpolator) ? (\n <ModalStatusBarManager\n dark={headerDarkContent}\n layout={layout}\n insets={insets}\n style={cardStyle}\n />\n ) : null\n }\n <Animated.View\n style={{\n // This is a dummy style that doesn't actually change anything visually.\n // Animated needs the animated value to be used somewhere, otherwise things don't update properly.\n // If we disable animations and hide header, it could end up making the value unused.\n // So we have this dummy style that will always be used regardless of what else changed.\n opacity: current,\n }}\n // Make sure that this view isn't removed. If this view is removed, our style with animated value won't apply\n collapsable={false}\n />\n <View pointerEvents=\"box-none\" {...rest}>\n {overlayEnabled ? (\n <View pointerEvents=\"box-none\" style={StyleSheet.absoluteFill}>\n {overlay({ style: overlayStyle })}\n </View>\n ) : null}\n <Animated.View\n style={[styles.container, containerStyle, customContainerStyle]}\n pointerEvents=\"box-none\"\n >\n <PanGestureHandler\n enabled={layout.width !== 0 && gestureEnabled}\n onGestureEvent={handleGestureEvent}\n onHandlerStateChange={this.handleGestureStateChange}\n {...this.gestureActivationCriteria()}\n >\n <Animated.View\n needsOffscreenAlphaCompositing={hasOpacityStyle(cardStyle)}\n style={[styles.container, cardStyle]}\n >\n {shadowEnabled && shadowStyle && !isTransparent ? (\n <Animated.View\n style={[\n styles.shadow,\n gestureDirection === 'horizontal'\n ? [styles.shadowHorizontal, styles.shadowLeft]\n : gestureDirection === 'horizontal-inverted'\n ? [styles.shadowHorizontal, styles.shadowRight]\n : gestureDirection === 'vertical'\n ? [styles.shadowVertical, styles.shadowTop]\n : [styles.shadowVertical, styles.shadowBottom],\n { backgroundColor },\n shadowStyle,\n ]}\n pointerEvents=\"none\"\n />\n ) : null}\n <CardSheet\n ref={this.contentRef}\n enabled={pageOverflowEnabled}\n layout={layout}\n style={contentStyle}\n >\n {children}\n </CardSheet>\n </Animated.View>\n </PanGestureHandler>\n </Animated.View>\n </View>\n </CardAnimationContext.Provider>\n );\n }\n}\n\nexport const getIsModalPresentation = (\n cardStyleInterpolator: StackCardStyleInterpolator\n) => {\n return (\n cardStyleInterpolator === forModalPresentationIOS ||\n // Handle custom modal presentation interpolators as well\n cardStyleInterpolator.name === 'forModalPresentationIOS'\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n overlay: {\n flex: 1,\n backgroundColor: '#000',\n },\n shadow: {\n position: 'absolute',\n shadowRadius: 5,\n shadowColor: '#000',\n shadowOpacity: 0.3,\n },\n shadowHorizontal: {\n top: 0,\n bottom: 0,\n width: 3,\n shadowOffset: { width: -1, height: 1 },\n },\n shadowLeft: {\n left: 0,\n },\n shadowRight: {\n right: 0,\n },\n shadowVertical: {\n left: 0,\n right: 0,\n height: 3,\n shadowOffset: { width: 1, height: -1 },\n },\n shadowTop: {\n top: 0,\n },\n shadowBottom: {\n bottom: 0,\n },\n});\n"]}
\No newline at end of file