You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
50 KiB

{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nvar _excluded = [\"styleInterpolator\", \"interpolationIndex\", \"current\", \"gesture\", \"next\", \"layout\", \"insets\", \"overlay\", \"overlayEnabled\", \"shadowEnabled\", \"gestureEnabled\", \"gestureDirection\", \"pageOverflowEnabled\", \"headerDarkContent\", \"children\", \"containerStyle\", \"contentStyle\"];\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nimport Color from 'color';\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport InteractionManager from \"react-native-web/dist/exports/InteractionManager\";\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { forModalPresentationIOS } from \"../../TransitionConfigs/CardStyleInterpolators\";\nimport CardAnimationContext from \"../../utils/CardAnimationContext\";\nimport getDistanceForDirection from \"../../utils/getDistanceForDirection\";\nimport getInvertedMultiplier from \"../../utils/getInvertedMultiplier\";\nimport memoize from \"../../utils/memoize\";\nimport { GestureState, PanGestureHandler } from \"../GestureHandler\";\nimport ModalStatusBarManager from \"../ModalStatusBarManager\";\nimport CardSheet from \"./CardSheet\";\nvar GESTURE_VELOCITY_IMPACT = 0.3;\nvar TRUE = 1;\nvar FALSE = 0;\nvar GESTURE_RESPONSE_DISTANCE_HORIZONTAL = 50;\nvar GESTURE_RESPONSE_DISTANCE_VERTICAL = 135;\nvar useNativeDriver = Platform.OS !== 'web';\nvar hasOpacityStyle = function hasOpacityStyle(style) {\n if (style) {\n var flattenedStyle = StyleSheet.flatten(style);\n return flattenedStyle.opacity != null;\n }\n return false;\n};\nvar Card = function (_React$Component) {\n _inherits(Card, _React$Component);\n var _super = _createSuper(Card);\n function Card() {\n var _this;\n _classCallCheck(this, Card);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.isCurrentlyMounted = false;\n _this.isClosing = new Animated.Value(FALSE);\n _this.inverted = new Animated.Value(getInvertedMultiplier(_this.props.gestureDirection));\n _this.layout = {\n width: new Animated.Value(_this.props.layout.width),\n height: new Animated.Value(_this.props.layout.height)\n };\n _this.isSwiping = new Animated.Value(FALSE);\n _this.animate = function (_ref2) {\n var closing = _ref2.closing,\n velocity = _ref2.velocity;\n var _this$props = _this.props,\n gesture = _this$props.gesture,\n transitionSpec = _this$props.transitionSpec,\n onOpen = _this$props.onOpen,\n onClose = _this$props.onClose,\n onTransition = _this$props.onTransition;\n var toValue = _this.getAnimateToValue(_objectSpread(_objectSpread({}, _this.props), {}, {\n closing: closing\n }));\n _this.lastToValue = toValue;\n _this.isClosing.setValue(closing ? TRUE : FALSE);\n var spec = closing ? transitionSpec.close : transitionSpec.open;\n var animation = spec.animation === 'spring' ? Animated.spring : Animated.timing;\n _this.setPointerEventsEnabled(!closing);\n _this.handleStartInteraction();\n clearTimeout(_this.pendingGestureCallback);\n onTransition === null || onTransition === void 0 ? void 0 : onTransition({\n closing: closing,\n gesture: velocity !== undefined\n });\n animation(gesture, _objectSpread(_objectSpread({}, spec.config), {}, {\n velocity: velocity,\n toValue: toValue,\n useNativeDriver: useNativeDriver,\n isInteraction: false\n })).start(function (_ref3) {\n var finished = _ref3.finished;\n _this.handleEndInteraction();\n clearTimeout(_this.pendingGestureCallback);\n if (finished) {\n if (closing) {\n onClose();\n } else {\n onOpen();\n }\n if (_this.isCurrentlyMounted) {\n _this.forceUpdate();\n }\n }\n });\n };\n _this.getAnimateToValue = function (_ref4) {\n var closing = _ref4.closing,\n layout = _ref4.layout,\n gestureDirection = _ref4.gestureDirection;\n if (!closing) {\n return 0;\n }\n return getDistanceForDirection(layout, gestureDirection);\n };\n _this.setPointerEventsEnabled = function (enabled) {\n var _this$ref$current;\n var pointerEvents = enabled ? 'box-none' : 'none';\n (_this$ref$current = _this.ref.current) === null || _this$ref$current === void 0 ? void 0 : _this$ref$current.setPointerEvents(pointerEvents);\n };\n _this.handleStartInteraction = function () {\n if (_this.interactionHandle === undefined) {\n _this.interactionHandle = InteractionManager.createInteractionHandle();\n }\n };\n _this.handleEndInteraction = function () {\n if (_this.interactionHandle !== undefined) {\n InteractionManager.clearInteractionHandle(_this.interactionHandle);\n _this.interactionHandle = undefined;\n }\n };\n _this.handleGestureStateChange = function (_ref5) {\n var nativeEvent = _ref5.nativeEvent;\n var _this$props2 = _this.props,\n layout = _this$props2.layout,\n onClose = _this$props2.onClose,\n onGestureBegin = _this$props2.onGestureBegin,\n onGestureCanceled = _this$props2.onGestureCanceled,\n onGestureEnd = _this$props2.onGestureEnd,\n gestureDirection = _this$props2.gestureDirection,\n gestureVelocityImpact = _this$props2.gestureVelocityImpact;\n switch (nativeEvent.state) {\n case GestureState.ACTIVE:\n _this.isSwiping.setValue(TRUE);\n _this.handleStartInteraction();\n onGestureBegin === null || onGestureBegin === void 0 ? void 0 : onGestureBegin();\n break;\n case GestureState.CANCELLED:\n {\n _this.isSwiping.setValue(FALSE);\n _this.handleEndInteraction();\n var velocity = gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? nativeEvent.velocityY : nativeEvent.velocityX;\n _this.animate({\n closing: _this.props.closing,\n velocity: velocity\n });\n onGestureCanceled === null || onGestureCanceled === void 0 ? void 0 : onGestureCanceled();\n break;\n }\n case GestureState.END:\n {\n _this.isSwiping.setValue(FALSE);\n var distance;\n var translation;\n var _velocity;\n if (gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted') {\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 var closing = (translation + _velocity * gestureVelocityImpact) * getInvertedMultiplier(gestureDirection) > distance / 2 ? _velocity !== 0 || translation !== 0 : _this.props.closing;\n _this.animate({\n closing: closing,\n velocity: _velocity\n });\n if (closing) {\n _this.pendingGestureCallback = setTimeout(function () {\n onClose();\n _this.forceUpdate();\n }, 32);\n }\n onGestureEnd === null || onGestureEnd === void 0 ? void 0 : onGestureEnd();\n break;\n }\n }\n };\n _this.getInterpolatedStyle = memoize(function (styleInterpolator, animation) {\n return styleInterpolator(animation);\n });\n _this.getCardAnimation = memoize(function (interpolationIndex, current, next, layout, insetTop, insetRight, insetBottom, insetLeft) {\n return {\n index: interpolationIndex,\n current: {\n progress: current\n },\n next: next && {\n progress: next\n },\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 _this.ref = React.createRef();\n return _this;\n }\n _createClass(Card, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.animate({\n closing: this.props.closing\n });\n this.isCurrentlyMounted = true;\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props3 = this.props,\n layout = _this$props3.layout,\n gestureDirection = _this$props3.gestureDirection,\n closing = _this$props3.closing;\n var width = layout.width,\n height = layout.height;\n if (width !== prevProps.layout.width) {\n this.layout.width.setValue(width);\n }\n if (height !== prevProps.layout.height) {\n this.layout.height.setValue(height);\n }\n if (gestureDirection !== prevProps.gestureDirection) {\n this.inverted.setValue(getInvertedMultiplier(gestureDirection));\n }\n var toValue = this.getAnimateToValue(this.props);\n if (this.getAnimateToValue(prevProps) !== toValue || this.lastToValue !== toValue) {\n this.animate({\n closing: closing\n });\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.props.gesture.stopAnimation();\n this.isCurrentlyMounted = false;\n this.handleEndInteraction();\n }\n }, {\n key: \"gestureActivationCriteria\",\n value: function gestureActivationCriteria() {\n var _this$props4 = this.props,\n layout = _this$props4.layout,\n gestureDirection = _this$props4.gestureDirection,\n gestureResponseDistance = _this$props4.gestureResponseDistance;\n var enableTrackpadTwoFingerGesture = true;\n var distance = gestureResponseDistance !== undefined ? gestureResponseDistance : gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? GESTURE_RESPONSE_DISTANCE_VERTICAL : GESTURE_RESPONSE_DISTANCE_HORIZONTAL;\n if (gestureDirection === 'vertical') {\n return {\n maxDeltaX: 15,\n minOffsetY: 5,\n hitSlop: {\n bottom: -layout.height + distance\n },\n enableTrackpadTwoFingerGesture: enableTrackpadTwoFingerGesture\n };\n } else if (gestureDirection === 'vertical-inverted') {\n return {\n maxDeltaX: 15,\n minOffsetY: -5,\n hitSlop: {\n top: -layout.height + distance\n },\n enableTrackpadTwoFingerGesture: enableTrackpadTwoFingerGesture\n };\n } else {\n var hitSlop = -layout.width + distance;\n var invertedMultiplier = getInvertedMultiplier(gestureDirection);\n if (invertedMultiplier === 1) {\n return {\n minOffsetX: 5,\n maxDeltaY: 20,\n hitSlop: {\n right: hitSlop\n },\n enableTrackpadTwoFingerGesture: enableTrackpadTwoFingerGesture\n };\n } else {\n return {\n minOffsetX: -5,\n maxDeltaY: 20,\n hitSlop: {\n left: hitSlop\n },\n enableTrackpadTwoFingerGesture: enableTrackpadTwoFingerGesture\n };\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n styleInterpolator = _this$props5.styleInterpolator,\n interpolationIndex = _this$props5.interpolationIndex,\n current = _this$props5.current,\n gesture = _this$props5.gesture,\n next = _this$props5.next,\n layout = _this$props5.layout,\n insets = _this$props5.insets,\n overlay = _this$props5.overlay,\n overlayEnabled = _this$props5.overlayEnabled,\n shadowEnabled = _this$props5.shadowEnabled,\n gestureEnabled = _this$props5.gestureEnabled,\n gestureDirection = _this$props5.gestureDirection,\n pageOverflowEnabled = _this$props5.pageOverflowEnabled,\n headerDarkContent = _this$props5.headerDarkContent,\n children = _this$props5.children,\n customContainerStyle = _this$props5.containerStyle,\n contentStyle = _this$props5.contentStyle,\n rest = _objectWithoutProperties(_this$props5, _excluded);\n var interpolationProps = this.getCardAnimation(interpolationIndex, current, next, layout, insets.top, insets.right, insets.bottom, insets.left);\n var interpolatedStyle = this.getInterpolatedStyle(styleInterpolator, interpolationProps);\n var containerStyle = interpolatedStyle.containerStyle,\n cardStyle = interpolatedStyle.cardStyle,\n overlayStyle = interpolatedStyle.overlayStyle,\n shadowStyle = interpolatedStyle.shadowStyle;\n var handleGestureEvent = gestureEnabled ? Animated.event([{\n nativeEvent: gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? {\n translationY: gesture\n } : {\n translationX: gesture\n }\n }], {\n useNativeDriver: useNativeDriver\n }) : undefined;\n var _StyleSheet$flatten = StyleSheet.flatten(contentStyle || {}),\n backgroundColor = _StyleSheet$flatten.backgroundColor;\n var isTransparent = typeof backgroundColor === 'string' ? Color(backgroundColor).alpha() === 0 : false;\n return React.createElement(CardAnimationContext.Provider, {\n value: interpolationProps\n }, Platform.OS === 'ios' && overlayEnabled && next && getIsModalPresentation(styleInterpolator) ? React.createElement(ModalStatusBarManager, {\n dark: headerDarkContent,\n layout: layout,\n insets: insets,\n style: cardStyle\n }) : null, React.createElement(Animated.View, {\n style: {\n opacity: current\n },\n collapsable: false\n }), React.createElement(View, _extends({\n pointerEvents: \"box-none\"\n }, rest), overlayEnabled ? React.createElement(View, {\n pointerEvents: \"box-none\",\n style: StyleSheet.absoluteFill\n }, overlay({\n style: overlayStyle\n })) : null, React.createElement(Animated.View, {\n style: [styles.container, containerStyle, customContainerStyle],\n pointerEvents: \"box-none\"\n }, React.createElement(PanGestureHandler, _extends({\n enabled: layout.width !== 0 && gestureEnabled,\n onGestureEvent: handleGestureEvent,\n onHandlerStateChange: this.handleGestureStateChange\n }, this.gestureActivationCriteria()), React.createElement(Animated.View, {\n needsOffscreenAlphaCompositing: hasOpacityStyle(cardStyle),\n style: [styles.container, cardStyle]\n }, shadowEnabled && shadowStyle && !isTransparent ? React.createElement(Animated.View, {\n style: [styles.shadow, gestureDirection === 'horizontal' ? [styles.shadowHorizontal, styles.shadowLeft] : gestureDirection === 'horizontal-inverted' ? [styles.shadowHorizontal, styles.shadowRight] : gestureDirection === 'vertical' ? [styles.shadowVertical, styles.shadowTop] : [styles.shadowVertical, styles.shadowBottom], {\n backgroundColor: backgroundColor\n }, shadowStyle],\n pointerEvents: \"none\"\n }) : null, React.createElement(CardSheet, {\n ref: this.ref,\n enabled: pageOverflowEnabled,\n layout: layout,\n style: contentStyle\n }, children))))));\n }\n }]);\n return Card;\n}(React.Component);\nCard.defaultProps = {\n shadowEnabled: false,\n gestureEnabled: true,\n gestureVelocityImpact: GESTURE_VELOCITY_IMPACT,\n overlay: function overlay(_ref) {\n var style = _ref.style;\n return style ? React.createElement(Animated.View, {\n pointerEvents: \"none\",\n style: [styles.overlay, style]\n }) : null;\n }\n};\nexport { Card as default };\nexport var getIsModalPresentation = function getIsModalPresentation(cardStyleInterpolator) {\n return cardStyleInterpolator === forModalPresentationIOS || cardStyleInterpolator.name === 'forModalPresentationIOS';\n};\nvar 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: {\n width: -1,\n height: 1\n }\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: {\n width: 1,\n height: -1\n }\n },\n shadowTop: {\n top: 0\n },\n shadowBottom: {\n bottom: 0\n }\n});","map":{"version":3,"sources":["views/Stack/Card.tsx"],"names":["Color","React","forModalPresentationIOS","CardAnimationContext","getDistanceForDirection","getInvertedMultiplier","memoize","GestureState","PanGestureHandler","ModalStatusBarManager","CardSheet","GESTURE_VELOCITY_IMPACT","TRUE","FALSE","GESTURE_RESPONSE_DISTANCE_HORIZONTAL","GESTURE_RESPONSE_DISTANCE_VERTICAL","useNativeDriver","Platform","OS","hasOpacityStyle","style","flattenedStyle","StyleSheet","flatten","opacity","Card","Component","defaultProps","shadowEnabled","gestureEnabled","gestureVelocityImpact","overlay","styles","componentDidMount","animate","closing","props","isCurrentlyMounted","componentDidUpdate","prevProps","layout","gestureDirection","width","height","setValue","inverted","toValue","getAnimateToValue","lastToValue","componentWillUnmount","gesture","stopAnimation","handleEndInteraction","isClosing","Animated","Value","isSwiping","velocity","transitionSpec","onOpen","onClose","onTransition","spec","close","open","animation","spring","timing","setPointerEventsEnabled","handleStartInteraction","clearTimeout","pendingGestureCallback","undefined","config","isInteraction","start","finished","forceUpdate","enabled","pointerEvents","ref","current","setPointerEvents","interactionHandle","InteractionManager","createInteractionHandle","clearInteractionHandle","handleGestureStateChange","nativeEvent","onGestureBegin","onGestureCanceled","onGestureEnd","state","ACTIVE","CANCELLED","velocityY","velocityX","END","distance","translation","translationY","translationX","setTimeout","getInterpolatedStyle","styleInterpolator","getCardAnimation","interpolationIndex","next","insetTop","insetRight","insetBottom","insetLeft","index","progress","swiping","layouts","screen","insets","top","right","bottom","left","gestureActivationCriteria","gestureResponseDistance","enableTrackpadTwoFingerGesture","maxDeltaX","minOffsetY","hitSlop","invertedMultiplier","minOffsetX","maxDeltaY","createRef","render","overlayEnabled","pageOverflowEnabled","headerDarkContent","children","containerStyle","customContainerStyle","contentStyle","rest","interpolationProps","interpolatedStyle","cardStyle","overlayStyle","shadowStyle","handleGestureEvent","event","backgroundColor","isTransparent","alpha","getIsModalPresentation","absoluteFill","container","shadow","shadowHorizontal","shadowLeft","shadowRight","shadowVertical","shadowTop","shadowBottom","cardStyleInterpolator","name","create","flex","position","shadowRadius","shadowColor","shadowOpacity","shadowOffset"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AA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CAACD,OAAO,EAAEX,KAAK;IAAE,CAAA,CAAG,GACpE,IAAI;EAAA;AACZ,CAAC;AAAA,SAbkBK,IAAI;AAkezB,OAAO,IAAM8H,sBAAsB,GACjCU,SADWV,sBAAsB,CACjCU,qBAAiD,EAC9C;EACH,OACEA,qBAAqB,KAAK/J,uBAAuB,IAEjD+J,qBAAqB,CAACC,IAAI,KAAK,yBAAyB;AAE5D,CAAC;AAED,IAAMlI,MAAM,GAAGV,UAAU,CAAC6I,MAAM,CAAC;EAC/BV,SAAS,EAAE;IACTW,IAAI,EAAE;EACR,CAAC;EACDrI,OAAO,EAAE;IACPqI,IAAI,EAAE,CAAC;IACPhB,eAAe,EAAE;EACnB,CAAC;EACDM,MAAM,EAAE;IACNW,QAAQ,EAAE,UAAU;IACpBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,MAAM;IACnBC,aAAa,EAAE;EACjB,CAAC;EACDb,gBAAgB,EAAE;IAChBrC,GAAG,EAAE,CAAC;IACNE,MAAM,EAAE,CAAC;IACT9E,KAAK,EAAE,CAAC;IACR+H,YAAY,EAAE;MAAE/H,KAAK,EAAE,CAAC,CAAC;MAAEC,MAAM,EAAE;IAAE;EACvC,CAAC;EACDiH,UAAU,EAAE;IACVnC,IAAI,EAAE;EACR,CAAC;EACDoC,WAAW,EAAE;IACXtC,KAAK,EAAE;EACT,CAAC;EACDuC,cAAc,EAAE;IACdrC,IAAI,EAAE,CAAC;IACPF,KAAK,EAAE,CAAC;IACR5E,MAAM,EAAE,CAAC;IACT8H,YAAY,EAAE;MAAE/H,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE,CAAC;IAAE;EACvC,CAAC;EACDoH,SAAS,EAAE;IACTzC,GAAG,EAAE;EACP,CAAC;EACD0C,YAAY,EAAE;IACZxC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","sourceRoot":"../../../../src","sourcesContent":["function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport Color from 'color';\nimport * as React from 'react';\nimport { Animated, InteractionManager, Platform, StyleSheet, View } from 'react-native';\nimport { forModalPresentationIOS } from '../../TransitionConfigs/CardStyleInterpolators';\nimport CardAnimationContext from '../../utils/CardAnimationContext';\nimport getDistanceForDirection from '../../utils/getDistanceForDirection';\nimport getInvertedMultiplier from '../../utils/getInvertedMultiplier';\nimport memoize from '../../utils/memoize';\nimport { GestureState, PanGestureHandler } from '../GestureHandler';\nimport ModalStatusBarManager from '../ModalStatusBarManager';\nimport CardSheet from './CardSheet';\nconst GESTURE_VELOCITY_IMPACT = 0.3;\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;\nconst useNativeDriver = Platform.OS !== 'web';\nconst hasOpacityStyle = style => {\n if (style) {\n const flattenedStyle = StyleSheet.flatten(style);\n return flattenedStyle.opacity != null;\n }\n return false;\n};\nexport default class Card extends React.Component {\n static defaultProps = {\n shadowEnabled: false,\n gestureEnabled: true,\n gestureVelocityImpact: GESTURE_VELOCITY_IMPACT,\n overlay: _ref => {\n let {\n style\n } = _ref;\n return style ? /*#__PURE__*/React.createElement(Animated.View, {\n pointerEvents: \"none\",\n style: [styles.overlay, style]\n }) : null;\n }\n };\n componentDidMount() {\n this.animate({\n closing: this.props.closing\n });\n this.isCurrentlyMounted = true;\n }\n componentDidUpdate(prevProps) {\n const {\n layout,\n gestureDirection,\n closing\n } = this.props;\n const {\n width,\n height\n } = layout;\n if (width !== prevProps.layout.width) {\n this.layout.width.setValue(width);\n }\n if (height !== prevProps.layout.height) {\n this.layout.height.setValue(height);\n }\n if (gestureDirection !== prevProps.gestureDirection) {\n this.inverted.setValue(getInvertedMultiplier(gestureDirection));\n }\n const toValue = this.getAnimateToValue(this.props);\n if (this.getAnimateToValue(prevProps) !== toValue || this.lastToValue !== toValue) {\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({\n closing\n });\n }\n }\n componentWillUnmount() {\n this.props.gesture.stopAnimation();\n this.isCurrentlyMounted = false;\n this.handleEndInteraction();\n }\n isCurrentlyMounted = false;\n isClosing = new Animated.Value(FALSE);\n inverted = new Animated.Value(getInvertedMultiplier(this.props.gestureDirection));\n layout = {\n width: new Animated.Value(this.props.layout.width),\n height: new Animated.Value(this.props.layout.height)\n };\n isSwiping = new Animated.Value(FALSE);\n animate = _ref2 => {\n let {\n closing,\n velocity\n } = _ref2;\n const {\n gesture,\n transitionSpec,\n onOpen,\n onClose,\n onTransition\n } = this.props;\n const toValue = this.getAnimateToValue({\n ...this.props,\n closing\n });\n this.lastToValue = toValue;\n this.isClosing.setValue(closing ? TRUE : FALSE);\n const spec = closing ? transitionSpec.close : transitionSpec.open;\n const animation = spec.animation === 'spring' ? Animated.spring : Animated.timing;\n this.setPointerEventsEnabled(!closing);\n this.handleStartInteraction();\n clearTimeout(this.pendingGestureCallback);\n onTransition === null || onTransition === void 0 ? void 0 : onTransition({\n closing,\n gesture: velocity !== undefined\n });\n animation(gesture, {\n ...spec.config,\n velocity,\n toValue,\n useNativeDriver,\n isInteraction: false\n }).start(_ref3 => {\n let {\n finished\n } = _ref3;\n this.handleEndInteraction();\n clearTimeout(this.pendingGestureCallback);\n if (finished) {\n if (closing) {\n onClose();\n } else {\n onOpen();\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 getAnimateToValue = _ref4 => {\n let {\n closing,\n layout,\n gestureDirection\n } = _ref4;\n if (!closing) {\n return 0;\n }\n return getDistanceForDirection(layout, gestureDirection);\n };\n setPointerEventsEnabled = enabled => {\n var _this$ref$current;\n const pointerEvents = enabled ? 'box-none' : 'none';\n (_this$ref$current = this.ref.current) === null || _this$ref$current === void 0 ? void 0 : _this$ref$current.setPointerEvents(pointerEvents);\n };\n handleStartInteraction = () => {\n if (this.interactionHandle === undefined) {\n this.interactionHandle = InteractionManager.createInteractionHandle();\n }\n };\n handleEndInteraction = () => {\n if (this.interactionHandle !== undefined) {\n InteractionManager.clearInteractionHandle(this.interactionHandle);\n this.interactionHandle = undefined;\n }\n };\n handleGestureStateChange = _ref5 => {\n let {\n nativeEvent\n } = _ref5;\n const {\n layout,\n onClose,\n onGestureBegin,\n onGestureCanceled,\n onGestureEnd,\n gestureDirection,\n gestureVelocityImpact\n } = this.props;\n switch (nativeEvent.state) {\n case GestureState.ACTIVE:\n this.isSwiping.setValue(TRUE);\n this.handleStartInteraction();\n onGestureBegin === null || onGestureBegin === void 0 ? void 0 : onGestureBegin();\n break;\n case GestureState.CANCELLED:\n {\n this.isSwiping.setValue(FALSE);\n this.handleEndInteraction();\n const velocity = gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? nativeEvent.velocityY : nativeEvent.velocityX;\n this.animate({\n closing: this.props.closing,\n velocity\n });\n onGestureCanceled === null || onGestureCanceled === void 0 ? void 0 : onGestureCanceled();\n break;\n }\n case GestureState.END:\n {\n this.isSwiping.setValue(FALSE);\n let distance;\n let translation;\n let velocity;\n if (gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted') {\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 const closing = (translation + velocity * gestureVelocityImpact) * getInvertedMultiplier(gestureDirection) > distance / 2 ? velocity !== 0 || translation !== 0 : this.props.closing;\n this.animate({\n closing,\n 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);\n }\n onGestureEnd === null || onGestureEnd === void 0 ? void 0 : onGestureEnd();\n break;\n }\n }\n };\n\n // Memoize this to avoid extra work on re-render\n getInterpolatedStyle = memoize((styleInterpolator, animation) => styleInterpolator(animation));\n\n // Keep track of the animation context when deps changes.\n getCardAnimation = memoize((interpolationIndex, current, next, layout, insetTop, insetRight, insetBottom, insetLeft) => ({\n index: interpolationIndex,\n current: {\n progress: current\n },\n next: next && {\n progress: next\n },\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 gestureActivationCriteria() {\n const {\n layout,\n gestureDirection,\n gestureResponseDistance\n } = this.props;\n const enableTrackpadTwoFingerGesture = true;\n const distance = gestureResponseDistance !== undefined ? gestureResponseDistance : gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? GESTURE_RESPONSE_DISTANCE_VERTICAL : GESTURE_RESPONSE_DISTANCE_HORIZONTAL;\n if (gestureDirection === 'vertical') {\n return {\n maxDeltaX: 15,\n minOffsetY: 5,\n hitSlop: {\n bottom: -layout.height + distance\n },\n enableTrackpadTwoFingerGesture\n };\n } else if (gestureDirection === 'vertical-inverted') {\n return {\n maxDeltaX: 15,\n minOffsetY: -5,\n hitSlop: {\n top: -layout.height + distance\n },\n enableTrackpadTwoFingerGesture\n };\n } else {\n const hitSlop = -layout.width + distance;\n const invertedMultiplier = getInvertedMultiplier(gestureDirection);\n if (invertedMultiplier === 1) {\n return {\n minOffsetX: 5,\n maxDeltaY: 20,\n hitSlop: {\n right: hitSlop\n },\n enableTrackpadTwoFingerGesture\n };\n } else {\n return {\n minOffsetX: -5,\n maxDeltaY: 20,\n hitSlop: {\n left: hitSlop\n },\n enableTrackpadTwoFingerGesture\n };\n }\n }\n }\n ref = /*#__PURE__*/React.createRef();\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 const interpolationProps = this.getCardAnimation(interpolationIndex, current, next, layout, insets.top, insets.right, insets.bottom, insets.left);\n const interpolatedStyle = this.getInterpolatedStyle(styleInterpolator, interpolationProps);\n const {\n containerStyle,\n cardStyle,\n overlayStyle,\n shadowStyle\n } = interpolatedStyle;\n const handleGestureEvent = gestureEnabled ? Animated.event([{\n nativeEvent: gestureDirection === 'vertical' || gestureDirection === 'vertical-inverted' ? {\n translationY: gesture\n } : {\n translationX: gesture\n }\n }], {\n useNativeDriver\n }) : undefined;\n const {\n backgroundColor\n } = StyleSheet.flatten(contentStyle || {});\n const isTransparent = typeof backgroundColor === 'string' ? Color(backgroundColor).alpha() === 0 : false;\n return /*#__PURE__*/React.createElement(CardAnimationContext.Provider, {\n 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' && overlayEnabled && next && getIsModalPresentation(styleInterpolator) ? /*#__PURE__*/React.createElement(ModalStatusBarManager, {\n dark: headerDarkContent,\n layout: layout,\n insets: insets,\n style: cardStyle\n }) : null, /*#__PURE__*/React.createElement(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 ,\n collapsable: false\n }), /*#__PURE__*/React.createElement(View, _extends({\n pointerEvents: \"box-none\"\n }, rest), overlayEnabled ? /*#__PURE__*/React.createElement(View, {\n pointerEvents: \"box-none\",\n style: StyleSheet.absoluteFill\n }, overlay({\n style: overlayStyle\n })) : null, /*#__PURE__*/React.createElement(Animated.View, {\n style: [styles.container, containerStyle, customContainerStyle],\n pointerEvents: \"box-none\"\n }, /*#__PURE__*/React.createElement(PanGestureHandler, _extends({\n enabled: layout.width !== 0 && gestureEnabled,\n onGestureEvent: handleGestureEvent,\n onHandlerStateChange: this.handleGestureStateChange\n }, this.gestureActivationCriteria()), /*#__PURE__*/React.createElement(Animated.View, {\n needsOffscreenAlphaCompositing: hasOpacityStyle(cardStyle),\n style: [styles.container, cardStyle]\n }, shadowEnabled && shadowStyle && !isTransparent ? /*#__PURE__*/React.createElement(Animated.View, {\n style: [styles.shadow, gestureDirection === 'horizontal' ? [styles.shadowHorizontal, styles.shadowLeft] : gestureDirection === 'horizontal-inverted' ? [styles.shadowHorizontal, styles.shadowRight] : gestureDirection === 'vertical' ? [styles.shadowVertical, styles.shadowTop] : [styles.shadowVertical, styles.shadowBottom], {\n backgroundColor\n }, shadowStyle],\n pointerEvents: \"none\"\n }) : null, /*#__PURE__*/React.createElement(CardSheet, {\n ref: this.ref,\n enabled: pageOverflowEnabled,\n layout: layout,\n style: contentStyle\n }, children))))));\n }\n}\nexport const getIsModalPresentation = cardStyleInterpolator => {\n return cardStyleInterpolator === forModalPresentationIOS ||\n // Handle custom modal presentation interpolators as well\n cardStyleInterpolator.name === 'forModalPresentationIOS';\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: {\n width: -1,\n height: 1\n }\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: {\n width: 1,\n height: -1\n }\n },\n shadowTop: {\n top: 0\n },\n shadowBottom: {\n bottom: 0\n }\n});\n//# sourceMappingURL=Card.js.map"]},"metadata":{},"sourceType":"module"}