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
62 KiB
1 line
62 KiB
{"ast":null,"code":"import _defineProperty2 from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\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) { _defineProperty2(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 _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nimport { Background, getDefaultHeaderHeight, SafeAreaProviderCompat } from '@react-navigation/elements';\nimport Color from 'color';\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport { forModalPresentationIOS, forNoAnimation as forNoAnimationCard } from \"../../TransitionConfigs/CardStyleInterpolators\";\nimport { DefaultTransition, ModalFadeTransition, ModalTransition } from \"../../TransitionConfigs/TransitionPresets\";\nimport getDistanceForDirection from \"../../utils/getDistanceForDirection\";\nimport { MaybeScreen, MaybeScreenContainer } from \"../Screens\";\nimport { getIsModalPresentation } from \"./Card\";\nimport CardContainer from \"./CardContainer\";\nvar EPSILON = 1e-5;\nvar STATE_INACTIVE = 0;\nvar STATE_TRANSITIONING_OR_BELOW_TOP = 1;\nvar STATE_ON_TOP = 2;\nvar FALLBACK_DESCRIPTOR = Object.freeze({\n options: {}\n});\nvar getInterpolationIndex = function getInterpolationIndex(scenes, index) {\n var cardStyleInterpolator = scenes[index].descriptor.options.cardStyleInterpolator;\n var interpolationIndex = 0;\n for (var i = index - 1; i >= 0; i--) {\n var _scenes$i;\n var cardStyleInterpolatorCurrent = (_scenes$i = scenes[i]) === null || _scenes$i === void 0 ? void 0 : _scenes$i.descriptor.options.cardStyleInterpolator;\n if (cardStyleInterpolatorCurrent !== cardStyleInterpolator) {\n break;\n }\n interpolationIndex++;\n }\n return interpolationIndex;\n};\nvar getIsModal = function getIsModal(scene, interpolationIndex, isParentModal) {\n if (isParentModal) {\n return true;\n }\n var cardStyleInterpolator = scene.descriptor.options.cardStyleInterpolator;\n var isModalPresentation = getIsModalPresentation(cardStyleInterpolator);\n var isModal = isModalPresentation && interpolationIndex !== 0;\n return isModal;\n};\nvar getHeaderHeights = function getHeaderHeights(scenes, insets, isParentHeaderShown, isParentModal, layout, previous) {\n return scenes.reduce(function (acc, curr, index) {\n var _curr$descriptor$opti = curr.descriptor.options,\n _curr$descriptor$opti2 = _curr$descriptor$opti.headerStatusBarHeight,\n headerStatusBarHeight = _curr$descriptor$opti2 === void 0 ? isParentHeaderShown ? 0 : insets.top : _curr$descriptor$opti2,\n headerStyle = _curr$descriptor$opti.headerStyle;\n var style = StyleSheet.flatten(headerStyle || {});\n var height = 'height' in style && typeof style.height === 'number' ? style.height : previous[curr.route.key];\n var interpolationIndex = getInterpolationIndex(scenes, index);\n var isModal = getIsModal(curr, interpolationIndex, isParentModal);\n acc[curr.route.key] = typeof height === 'number' ? height : getDefaultHeaderHeight(layout, isModal, headerStatusBarHeight);\n return acc;\n }, {});\n};\nvar getDistanceFromOptions = function getDistanceFromOptions(layout, descriptor) {\n var _ref4 = (descriptor === null || descriptor === void 0 ? void 0 : descriptor.options) || {},\n presentation = _ref4.presentation,\n _ref4$gestureDirectio = _ref4.gestureDirection,\n gestureDirection = _ref4$gestureDirectio === void 0 ? presentation === 'modal' ? ModalTransition.gestureDirection : DefaultTransition.gestureDirection : _ref4$gestureDirectio;\n return getDistanceForDirection(layout, gestureDirection);\n};\nvar getProgressFromGesture = function getProgressFromGesture(gesture, layout, descriptor) {\n var distance = getDistanceFromOptions({\n width: Math.max(1, layout.width),\n height: Math.max(1, layout.height)\n }, descriptor);\n if (distance > 0) {\n return gesture.interpolate({\n inputRange: [0, distance],\n outputRange: [1, 0]\n });\n }\n return gesture.interpolate({\n inputRange: [distance, 0],\n outputRange: [0, 1]\n });\n};\nvar CardStack = function (_React$Component) {\n _inherits(CardStack, _React$Component);\n var _super = _createSuper(CardStack);\n function CardStack(_props) {\n var _this;\n _classCallCheck(this, CardStack);\n _this = _super.call(this, _props);\n _defineProperty(_assertThisInitialized(_this), \"handleLayout\", function (e) {\n var _e$nativeEvent$layout = e.nativeEvent.layout,\n height = _e$nativeEvent$layout.height,\n width = _e$nativeEvent$layout.width;\n var layout = {\n width: width,\n height: height\n };\n _this.setState(function (state, props) {\n if (height === state.layout.height && width === state.layout.width) {\n return null;\n }\n return {\n layout: layout,\n headerHeights: getHeaderHeights(state.scenes, props.insets, props.isParentHeaderShown, props.isParentModal, layout, state.headerHeights)\n };\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"handleHeaderLayout\", function (_ref) {\n var route = _ref.route,\n height = _ref.height;\n _this.setState(function (_ref2) {\n var headerHeights = _ref2.headerHeights;\n var previousHeight = headerHeights[route.key];\n if (previousHeight === height) {\n return null;\n }\n return {\n headerHeights: _objectSpread(_objectSpread({}, headerHeights), {}, _defineProperty2({}, route.key, height))\n };\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"getFocusedRoute\", function () {\n var state = _this.props.state;\n return state.routes[state.index];\n });\n _defineProperty(_assertThisInitialized(_this), \"getPreviousScene\", function (_ref3) {\n var route = _ref3.route;\n var getPreviousRoute = _this.props.getPreviousRoute;\n var scenes = _this.state.scenes;\n var previousRoute = getPreviousRoute({\n route: route\n });\n if (previousRoute) {\n var previousScene = scenes.find(function (scene) {\n return scene.descriptor.route.key === previousRoute.key;\n });\n return previousScene;\n }\n return undefined;\n });\n _this.state = {\n routes: [],\n scenes: [],\n gestures: {},\n layout: SafeAreaProviderCompat.initialMetrics.frame,\n descriptors: _this.props.descriptors,\n headerHeights: {}\n };\n return _this;\n }\n _createClass(CardStack, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var _this$props = this.props,\n insets = _this$props.insets,\n state = _this$props.state,\n routes = _this$props.routes,\n closingRouteKeys = _this$props.closingRouteKeys,\n onOpenRoute = _this$props.onOpenRoute,\n onCloseRoute = _this$props.onCloseRoute,\n renderHeader = _this$props.renderHeader,\n renderScene = _this$props.renderScene,\n isParentHeaderShown = _this$props.isParentHeaderShown,\n isParentModal = _this$props.isParentModal,\n onTransitionStart = _this$props.onTransitionStart,\n onTransitionEnd = _this$props.onTransitionEnd,\n onGestureStart = _this$props.onGestureStart,\n onGestureEnd = _this$props.onGestureEnd,\n onGestureCancel = _this$props.onGestureCancel,\n _this$props$detachIna = _this$props.detachInactiveScreens,\n detachInactiveScreens = _this$props$detachIna === void 0 ? Platform.OS === 'web' || Platform.OS === 'android' || Platform.OS === 'ios' : _this$props$detachIna;\n var _this$state = this.state,\n scenes = _this$state.scenes,\n layout = _this$state.layout,\n gestures = _this$state.gestures,\n headerHeights = _this$state.headerHeights;\n var focusedRoute = state.routes[state.index];\n var focusedHeaderHeight = headerHeights[focusedRoute.key];\n var isFloatHeaderAbsolute = this.state.scenes.slice(-2).some(function (scene) {\n var _scene$descriptor$opt;\n var options = (_scene$descriptor$opt = scene.descriptor.options) != null ? _scene$descriptor$opt : {};\n var headerMode = options.headerMode,\n headerTransparent = options.headerTransparent,\n _options$headerShown = options.headerShown,\n headerShown = _options$headerShown === void 0 ? true : _options$headerShown;\n if (headerTransparent || headerShown === false || headerMode === 'screen') {\n return true;\n }\n return false;\n });\n var activeScreensLimit = 1;\n for (var i = scenes.length - 1; i >= 0; i--) {\n var options = scenes[i].descriptor.options;\n var _options$detachPrevio = options.detachPreviousScreen,\n detachPreviousScreen = _options$detachPrevio === void 0 ? options.presentation === 'transparentModal' ? false : getIsModalPresentation(options.cardStyleInterpolator) ? i !== scenes.map(function (scene) {\n return scene.descriptor.options.cardStyleInterpolator;\n }).lastIndexOf(forModalPresentationIOS) : true : _options$detachPrevio;\n if (detachPreviousScreen === false) {\n activeScreensLimit++;\n } else {\n if (i <= scenes.length - 2) {\n break;\n }\n }\n }\n var floatingHeader = React.createElement(React.Fragment, {\n key: \"header\"\n }, renderHeader({\n mode: 'float',\n layout: layout,\n scenes: scenes,\n getPreviousScene: this.getPreviousScene,\n getFocusedRoute: this.getFocusedRoute,\n onContentHeightChange: this.handleHeaderLayout,\n style: [styles.floating, isFloatHeaderAbsolute && [{\n height: focusedHeaderHeight\n }, styles.absolute]]\n }));\n return React.createElement(Background, null, isFloatHeaderAbsolute ? null : floatingHeader, React.createElement(MaybeScreenContainer, {\n enabled: detachInactiveScreens,\n style: styles.container,\n onLayout: this.handleLayout\n }, routes.map(function (route, index, self) {\n var _scenes, _scenes2;\n var focused = focusedRoute.key === route.key;\n var gesture = gestures[route.key];\n var scene = scenes[index];\n var isScreenActive = 1;\n if (index < self.length - activeScreensLimit - 1) {\n isScreenActive = STATE_INACTIVE;\n } else {\n var sceneForActivity = scenes[self.length - 1];\n var outputValue = index === self.length - 1 ? STATE_ON_TOP : index >= self.length - activeScreensLimit ? STATE_TRANSITIONING_OR_BELOW_TOP : STATE_INACTIVE;\n isScreenActive = sceneForActivity ? sceneForActivity.progress.current.interpolate({\n inputRange: [0, 1 - EPSILON, 1],\n outputRange: [1, 1, outputValue],\n extrapolate: 'clamp'\n }) : STATE_TRANSITIONING_OR_BELOW_TOP;\n }\n var _scene$descriptor$opt2 = scene.descriptor.options,\n _scene$descriptor$opt3 = _scene$descriptor$opt2.headerShown,\n headerShown = _scene$descriptor$opt3 === void 0 ? true : _scene$descriptor$opt3,\n headerTransparent = _scene$descriptor$opt2.headerTransparent,\n headerStyle = _scene$descriptor$opt2.headerStyle,\n headerTintColor = _scene$descriptor$opt2.headerTintColor,\n freezeOnBlur = _scene$descriptor$opt2.freezeOnBlur;\n var safeAreaInsetTop = insets.top;\n var safeAreaInsetRight = insets.right;\n var safeAreaInsetBottom = insets.bottom;\n var safeAreaInsetLeft = insets.left;\n var headerHeight = headerShown !== false ? headerHeights[route.key] : 0;\n var headerDarkContent;\n if (headerShown) {\n if (typeof headerTintColor === 'string') {\n headerDarkContent = Color(headerTintColor).isDark();\n } else {\n var flattenedHeaderStyle = StyleSheet.flatten(headerStyle);\n if (flattenedHeaderStyle && 'backgroundColor' in flattenedHeaderStyle && typeof flattenedHeaderStyle.backgroundColor === 'string') {\n headerDarkContent = !Color(flattenedHeaderStyle.backgroundColor).isDark();\n }\n }\n }\n var interpolationIndex = getInterpolationIndex(scenes, index);\n var isModal = getIsModal(scene, interpolationIndex, isParentModal);\n var isNextScreenTransparent = ((_scenes = scenes[index + 1]) === null || _scenes === void 0 ? void 0 : _scenes.descriptor.options.presentation) === 'transparentModal';\n var detachCurrentScreen = ((_scenes2 = scenes[index + 1]) === null || _scenes2 === void 0 ? void 0 : _scenes2.descriptor.options.detachPreviousScreen) !== false;\n return React.createElement(MaybeScreen, {\n key: route.key,\n style: StyleSheet.absoluteFill,\n enabled: detachInactiveScreens,\n active: isScreenActive,\n freezeOnBlur: freezeOnBlur,\n pointerEvents: \"box-none\"\n }, React.createElement(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: _this2.handleHeaderLayout,\n getPreviousScene: _this2.getPreviousScene,\n getFocusedRoute: _this2.getFocusedRoute,\n headerDarkContent: headerDarkContent,\n hasAbsoluteFloatHeader: isFloatHeaderAbsolute && !headerTransparent,\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 })), isFloatHeaderAbsolute ? floatingHeader : null);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n if (props.routes === state.routes && props.descriptors === state.descriptors) {\n return null;\n }\n var gestures = props.routes.reduce(function (acc, curr) {\n var descriptor = props.descriptors[curr.key];\n var _ref5 = (descriptor === null || descriptor === void 0 ? void 0 : descriptor.options) || {},\n animationEnabled = _ref5.animationEnabled;\n acc[curr.key] = state.gestures[curr.key] || new Animated.Value(props.openingRouteKeys.includes(curr.key) && animationEnabled !== false ? getDistanceFromOptions(state.layout, descriptor) : 0);\n return acc;\n }, {});\n var scenes = props.routes.map(function (route, index, self) {\n var _descriptor$options$h;\n var previousRoute = self[index - 1];\n var nextRoute = self[index + 1];\n var oldScene = state.scenes[index];\n var currentGesture = gestures[route.key];\n var previousGesture = previousRoute ? gestures[previousRoute.key] : undefined;\n var nextGesture = nextRoute ? gestures[nextRoute.key] : undefined;\n var descriptor = props.descriptors[route.key] || state.descriptors[route.key] || (oldScene ? oldScene.descriptor : FALLBACK_DESCRIPTOR);\n var nextDescriptor = props.descriptors[nextRoute === null || nextRoute === void 0 ? void 0 : nextRoute.key] || state.descriptors[nextRoute === null || nextRoute === void 0 ? void 0 : nextRoute.key];\n var previousDescriptor = props.descriptors[previousRoute === null || previousRoute === void 0 ? void 0 : previousRoute.key] || state.descriptors[previousRoute === null || previousRoute === void 0 ? void 0 : previousRoute.key];\n var optionsForTransitionConfig = index !== self.length - 1 && nextDescriptor && nextDescriptor.options.presentation !== 'transparentModal' ? nextDescriptor.options : descriptor.options;\n var defaultTransitionPreset = optionsForTransitionConfig.presentation === 'modal' ? ModalTransition : optionsForTransitionConfig.presentation === 'transparentModal' ? ModalFadeTransition : DefaultTransition;\n var _optionsForTransition = optionsForTransitionConfig.animationEnabled,\n animationEnabled = _optionsForTransition === void 0 ? Platform.OS !== 'web' && Platform.OS !== 'windows' && Platform.OS !== 'macos' : _optionsForTransition,\n _optionsForTransition2 = optionsForTransitionConfig.gestureEnabled,\n gestureEnabled = _optionsForTransition2 === void 0 ? Platform.OS === 'ios' && animationEnabled : _optionsForTransition2,\n _optionsForTransition3 = optionsForTransitionConfig.gestureDirection,\n gestureDirection = _optionsForTransition3 === void 0 ? defaultTransitionPreset.gestureDirection : _optionsForTransition3,\n _optionsForTransition4 = optionsForTransitionConfig.transitionSpec,\n transitionSpec = _optionsForTransition4 === void 0 ? defaultTransitionPreset.transitionSpec : _optionsForTransition4,\n _optionsForTransition5 = optionsForTransitionConfig.cardStyleInterpolator,\n cardStyleInterpolator = _optionsForTransition5 === void 0 ? animationEnabled === false ? forNoAnimationCard : defaultTransitionPreset.cardStyleInterpolator : _optionsForTransition5,\n _optionsForTransition6 = optionsForTransitionConfig.headerStyleInterpolator,\n headerStyleInterpolator = _optionsForTransition6 === void 0 ? defaultTransitionPreset.headerStyleInterpolator : _optionsForTransition6,\n _optionsForTransition7 = optionsForTransitionConfig.cardOverlayEnabled,\n cardOverlayEnabled = _optionsForTransition7 === void 0 ? Platform.OS !== 'ios' && optionsForTransitionConfig.presentation !== 'transparentModal' || getIsModalPresentation(cardStyleInterpolator) : _optionsForTransition7;\n var headerMode = (_descriptor$options$h = descriptor.options.headerMode) != null ? _descriptor$options$h : !(optionsForTransitionConfig.presentation === 'modal' || optionsForTransitionConfig.presentation === 'transparentModal' || (nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation) === 'modal' || (nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation) === 'transparentModal' || getIsModalPresentation(cardStyleInterpolator)) && Platform.OS === 'ios' && descriptor.options.header === undefined ? 'float' : 'screen';\n var scene = {\n route: route,\n descriptor: _objectSpread(_objectSpread({}, descriptor), {}, {\n options: _objectSpread(_objectSpread({}, descriptor.options), {}, {\n animationEnabled: animationEnabled,\n cardOverlayEnabled: cardOverlayEnabled,\n cardStyleInterpolator: cardStyleInterpolator,\n gestureDirection: gestureDirection,\n gestureEnabled: gestureEnabled,\n headerStyleInterpolator: headerStyleInterpolator,\n transitionSpec: transitionSpec,\n headerMode: headerMode\n })\n }),\n progress: {\n current: getProgressFromGesture(currentGesture, state.layout, descriptor),\n next: nextGesture && (nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation) !== 'transparentModal' ? getProgressFromGesture(nextGesture, state.layout, nextDescriptor) : undefined,\n previous: previousGesture ? getProgressFromGesture(previousGesture, state.layout, previousDescriptor) : undefined\n },\n __memo: [state.layout, descriptor, nextDescriptor, previousDescriptor, currentGesture, nextGesture, previousGesture]\n };\n if (oldScene && scene.__memo.every(function (it, i) {\n return oldScene.__memo[i] === it;\n })) {\n return oldScene;\n }\n return scene;\n });\n return {\n routes: props.routes,\n scenes: scenes,\n gestures: gestures,\n descriptors: props.descriptors,\n headerHeights: getHeaderHeights(scenes, props.insets, props.isParentHeaderShown, props.isParentModal, state.layout, state.headerHeights)\n };\n }\n }]);\n return CardStack;\n}(React.Component);\nexport { CardStack as default };\nvar 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});","map":{"version":3,"sources":["CardStack.tsx"],"names":["Background","getDefaultHeaderHeight","SafeAreaProviderCompat","Color","React","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","StyleSheet","flatten","height","route","key","getDistanceFromOptions","presentation","gestureDirection","getProgressFromGesture","gesture","distance","width","Math","max","interpolate","inputRange","outputRange","CardStack","Component","props","state","routes","descriptors","gestures","animationEnabled","Animated","Value","openingRouteKeys","includes","map","self","previousRoute","nextRoute","oldScene","currentGesture","previousGesture","undefined","nextGesture","nextDescriptor","previousDescriptor","optionsForTransitionConfig","length","defaultTransitionPreset","Platform","OS","gestureEnabled","transitionSpec","headerStyleInterpolator","cardOverlayEnabled","headerMode","header","progress","current","next","__memo","every","it","headerHeights","constructor","initialMetrics","frame","e","nativeEvent","setState","previousHeight","getPreviousRoute","previousScene","find","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","freezeOnBlur","safeAreaInsetTop","safeAreaInsetRight","right","safeAreaInsetBottom","bottom","safeAreaInsetLeft","left","headerHeight","headerDarkContent","isDark","flattenedHeaderStyle","backgroundColor","isNextScreenTransparent","detachCurrentScreen","absoluteFill","create","flex","position","zIndex"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SACEA,UAAU,EACVC,sBAAsB,EACtBC,sBAAsB,QACjB,4BAA4B;AAMnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA;AAAA;AAAA;AAS9B,SACEC,uBAAuB,EACvBC,cAAc,IAAIC,kBAAkB;AAEtC,SACEC,iBAAiB,EACjBC,mBAA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AAGhG,UAAU,CAAC2H,MAAM,CAAC;EAC/BxB,SAAS,EAAE;IACTyB,IAAI,EAAE;EACR,CAAC;EACD1B,QAAQ,EAAE;IACR2B,QAAQ,EAAE,UAAU;IACpBhI,GAAG,EAAE,CAAC;IACNqH,IAAI,EAAE,CAAC;IACPJ,KAAK,EAAE;EACT,CAAC;EACDb,QAAQ,EAAE;IACR6B,MAAM,EAAE;EACV;AACF,CAAC,CAAC","sourceRoot":"../../src","sourcesContent":["function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { Background, getDefaultHeaderHeight, SafeAreaProviderCompat } from '@react-navigation/elements';\nimport Color from 'color';\nimport * as React from 'react';\nimport { Animated, Platform, StyleSheet } from 'react-native';\nimport { forModalPresentationIOS, forNoAnimation as forNoAnimationCard } from '../../TransitionConfigs/CardStyleInterpolators';\nimport { DefaultTransition, ModalFadeTransition, ModalTransition } from '../../TransitionConfigs/TransitionPresets';\nimport getDistanceForDirection from '../../utils/getDistanceForDirection';\nimport { MaybeScreen, MaybeScreenContainer } from '../Screens';\nimport { getIsModalPresentation } from './Card';\nimport CardContainer from './CardContainer';\nconst EPSILON = 1e-5;\nconst STATE_INACTIVE = 0;\nconst STATE_TRANSITIONING_OR_BELOW_TOP = 1;\nconst STATE_ON_TOP = 2;\nconst FALLBACK_DESCRIPTOR = Object.freeze({\n options: {}\n});\nconst getInterpolationIndex = (scenes, index) => {\n const {\n cardStyleInterpolator\n } = 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 for (let i = index - 1; i >= 0; i--) {\n var _scenes$i;\n const cardStyleInterpolatorCurrent = (_scenes$i = scenes[i]) === null || _scenes$i === void 0 ? void 0 : _scenes$i.descriptor.options.cardStyleInterpolator;\n if (cardStyleInterpolatorCurrent !== cardStyleInterpolator) {\n break;\n }\n interpolationIndex++;\n }\n return interpolationIndex;\n};\nconst getIsModal = (scene, interpolationIndex, isParentModal) => {\n if (isParentModal) {\n return true;\n }\n const {\n cardStyleInterpolator\n } = scene.descriptor.options;\n const isModalPresentation = getIsModalPresentation(cardStyleInterpolator);\n const isModal = isModalPresentation && interpolationIndex !== 0;\n return isModal;\n};\nconst getHeaderHeights = (scenes, insets, isParentHeaderShown, isParentModal, layout, previous) => {\n return scenes.reduce((acc, curr, index) => {\n const {\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n headerStyle\n } = curr.descriptor.options;\n const style = StyleSheet.flatten(headerStyle || {});\n const height = 'height' in style && typeof style.height === 'number' ? style.height : previous[curr.route.key];\n const interpolationIndex = getInterpolationIndex(scenes, index);\n const isModal = getIsModal(curr, interpolationIndex, isParentModal);\n acc[curr.route.key] = typeof height === 'number' ? height : getDefaultHeaderHeight(layout, isModal, headerStatusBarHeight);\n return acc;\n }, {});\n};\nconst getDistanceFromOptions = (layout, descriptor) => {\n const {\n presentation,\n gestureDirection = presentation === 'modal' ? ModalTransition.gestureDirection : DefaultTransition.gestureDirection\n } = (descriptor === null || descriptor === void 0 ? void 0 : descriptor.options) || {};\n return getDistanceForDirection(layout, gestureDirection);\n};\nconst getProgressFromGesture = (gesture, layout, descriptor) => {\n const distance = getDistanceFromOptions({\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 }, descriptor);\n if (distance > 0) {\n return gesture.interpolate({\n inputRange: [0, distance],\n outputRange: [1, 0]\n });\n }\n return gesture.interpolate({\n inputRange: [distance, 0],\n outputRange: [0, 1]\n });\n};\nexport default class CardStack extends React.Component {\n static getDerivedStateFromProps(props, state) {\n if (props.routes === state.routes && props.descriptors === state.descriptors) {\n return null;\n }\n const gestures = props.routes.reduce((acc, curr) => {\n const descriptor = props.descriptors[curr.key];\n const {\n animationEnabled\n } = (descriptor === null || descriptor === void 0 ? void 0 : descriptor.options) || {};\n acc[curr.key] = state.gestures[curr.key] || new Animated.Value(props.openingRouteKeys.includes(curr.key) && animationEnabled !== false ? getDistanceFromOptions(state.layout, descriptor) : 0);\n return acc;\n }, {});\n const scenes = props.routes.map((route, index, self) => {\n const previousRoute = self[index - 1];\n const nextRoute = self[index + 1];\n const oldScene = state.scenes[index];\n const currentGesture = gestures[route.key];\n const previousGesture = previousRoute ? gestures[previousRoute.key] : undefined;\n const nextGesture = nextRoute ? gestures[nextRoute.key] : undefined;\n const descriptor = props.descriptors[route.key] || state.descriptors[route.key] || (oldScene ? oldScene.descriptor : FALLBACK_DESCRIPTOR);\n const nextDescriptor = props.descriptors[nextRoute === null || nextRoute === void 0 ? void 0 : nextRoute.key] || state.descriptors[nextRoute === null || nextRoute === void 0 ? void 0 : nextRoute.key];\n const previousDescriptor = props.descriptors[previousRoute === null || previousRoute === void 0 ? void 0 : previousRoute.key] || state.descriptors[previousRoute === null || previousRoute === void 0 ? void 0 : 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 = index !== self.length - 1 && nextDescriptor && nextDescriptor.options.presentation !== 'transparentModal' ? nextDescriptor.options : descriptor.options;\n let defaultTransitionPreset = optionsForTransitionConfig.presentation === 'modal' ? ModalTransition : optionsForTransitionConfig.presentation === 'transparentModal' ? ModalFadeTransition : DefaultTransition;\n const {\n animationEnabled = Platform.OS !== 'web' && Platform.OS !== 'windows' && Platform.OS !== 'macos',\n gestureEnabled = Platform.OS === 'ios' && animationEnabled,\n gestureDirection = defaultTransitionPreset.gestureDirection,\n transitionSpec = defaultTransitionPreset.transitionSpec,\n cardStyleInterpolator = animationEnabled === false ? forNoAnimationCard : defaultTransitionPreset.cardStyleInterpolator,\n headerStyleInterpolator = defaultTransitionPreset.headerStyleInterpolator,\n cardOverlayEnabled = Platform.OS !== 'ios' && optionsForTransitionConfig.presentation !== 'transparentModal' || getIsModalPresentation(cardStyleInterpolator)\n } = optionsForTransitionConfig;\n const headerMode = descriptor.options.headerMode ?? (!(optionsForTransitionConfig.presentation === 'modal' || optionsForTransitionConfig.presentation === 'transparentModal' || (nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation) === 'modal' || (nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation) === 'transparentModal' || getIsModalPresentation(cardStyleInterpolator)) && Platform.OS === 'ios' && descriptor.options.header === undefined ? 'float' : 'screen');\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(currentGesture, state.layout, descriptor),\n next: nextGesture && (nextDescriptor === null || nextDescriptor === void 0 ? void 0 : nextDescriptor.options.presentation) !== 'transparentModal' ? getProgressFromGesture(nextGesture, state.layout, nextDescriptor) : undefined,\n previous: previousGesture ? getProgressFromGesture(previousGesture, state.layout, previousDescriptor) : undefined\n },\n __memo: [state.layout, descriptor, nextDescriptor, previousDescriptor, currentGesture, nextGesture, previousGesture]\n };\n if (oldScene && 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 return oldScene;\n }\n return scene;\n });\n return {\n routes: props.routes,\n scenes,\n gestures,\n descriptors: props.descriptors,\n headerHeights: getHeaderHeights(scenes, props.insets, props.isParentHeaderShown, props.isParentModal, state.layout, state.headerHeights)\n };\n }\n constructor(_props) {\n super(_props);\n _defineProperty(this, \"handleLayout\", e => {\n const {\n height,\n width\n } = e.nativeEvent.layout;\n const layout = {\n width,\n height\n };\n this.setState((state, props) => {\n if (height === state.layout.height && width === state.layout.width) {\n return null;\n }\n return {\n layout,\n headerHeights: getHeaderHeights(state.scenes, props.insets, props.isParentHeaderShown, props.isParentModal, layout, state.headerHeights)\n };\n });\n });\n _defineProperty(this, \"handleHeaderLayout\", _ref => {\n let {\n route,\n height\n } = _ref;\n this.setState(_ref2 => {\n let {\n headerHeights\n } = _ref2;\n const previousHeight = headerHeights[route.key];\n if (previousHeight === height) {\n return null;\n }\n return {\n headerHeights: {\n ...headerHeights,\n [route.key]: height\n }\n };\n });\n });\n _defineProperty(this, \"getFocusedRoute\", () => {\n const {\n state\n } = this.props;\n return state.routes[state.index];\n });\n _defineProperty(this, \"getPreviousScene\", _ref3 => {\n let {\n route\n } = _ref3;\n const {\n getPreviousRoute\n } = this.props;\n const {\n scenes\n } = this.state;\n const previousRoute = getPreviousRoute({\n route\n });\n if (previousRoute) {\n const previousScene = scenes.find(scene => scene.descriptor.route.key === previousRoute.key);\n return previousScene;\n }\n return undefined;\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 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' || Platform.OS === 'android' || Platform.OS === 'ios'\n } = this.props;\n const {\n scenes,\n layout,\n gestures,\n headerHeights\n } = this.state;\n const focusedRoute = state.routes[state.index];\n const focusedHeaderHeight = headerHeights[focusedRoute.key];\n const isFloatHeaderAbsolute = this.state.scenes.slice(-2).some(scene => {\n const options = scene.descriptor.options ?? {};\n const {\n headerMode,\n headerTransparent,\n headerShown = true\n } = options;\n if (headerTransparent || headerShown === false || headerMode === 'screen') {\n return true;\n }\n return false;\n });\n let activeScreensLimit = 1;\n for (let i = scenes.length - 1; i >= 0; i--) {\n const {\n options\n } = 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' ? false : getIsModalPresentation(options.cardStyleInterpolator) ? i !== scenes.map(scene => scene.descriptor.options.cardStyleInterpolator).lastIndexOf(forModalPresentationIOS) : true\n } = options;\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 const floatingHeader = /*#__PURE__*/React.createElement(React.Fragment, {\n 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: [styles.floating, isFloatHeaderAbsolute && [\n // Without this, the header buttons won't be touchable on Android when headerTransparent: true\n {\n height: focusedHeaderHeight\n }, styles.absolute]]\n }));\n return /*#__PURE__*/React.createElement(Background, null, isFloatHeaderAbsolute ? null : floatingHeader, /*#__PURE__*/React.createElement(MaybeScreenContainer, {\n enabled: detachInactiveScreens,\n style: styles.container,\n onLayout: this.handleLayout\n }, routes.map((route, index, self) => {\n var _scenes, _scenes2;\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 = 1;\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 = index === self.length - 1 ? STATE_ON_TOP // the screen is on top after the transition\n : index >= self.length - activeScreensLimit ? 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 ? sceneForActivity.progress.current.interpolate({\n inputRange: [0, 1 - EPSILON, 1],\n outputRange: [1, 1, outputValue],\n extrapolate: 'clamp'\n }) : STATE_TRANSITIONING_OR_BELOW_TOP;\n }\n const {\n headerShown = true,\n headerTransparent,\n headerStyle,\n headerTintColor,\n freezeOnBlur\n } = scene.descriptor.options;\n const safeAreaInsetTop = insets.top;\n const safeAreaInsetRight = insets.right;\n const safeAreaInsetBottom = insets.bottom;\n const safeAreaInsetLeft = insets.left;\n const headerHeight = headerShown !== false ? headerHeights[route.key] : 0;\n let headerDarkContent;\n if (headerShown) {\n if (typeof headerTintColor === 'string') {\n headerDarkContent = Color(headerTintColor).isDark();\n } else {\n const flattenedHeaderStyle = StyleSheet.flatten(headerStyle);\n if (flattenedHeaderStyle && 'backgroundColor' in flattenedHeaderStyle && typeof flattenedHeaderStyle.backgroundColor === 'string') {\n headerDarkContent = !Color(flattenedHeaderStyle.backgroundColor).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(scene, interpolationIndex, isParentModal);\n const isNextScreenTransparent = ((_scenes = scenes[index + 1]) === null || _scenes === void 0 ? void 0 : _scenes.descriptor.options.presentation) === 'transparentModal';\n const detachCurrentScreen = ((_scenes2 = scenes[index + 1]) === null || _scenes2 === void 0 ? void 0 : _scenes2.descriptor.options.detachPreviousScreen) !== false;\n return /*#__PURE__*/React.createElement(MaybeScreen, {\n key: route.key,\n style: StyleSheet.absoluteFill,\n enabled: detachInactiveScreens,\n active: isScreenActive,\n freezeOnBlur: freezeOnBlur,\n pointerEvents: \"box-none\"\n }, /*#__PURE__*/React.createElement(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: isFloatHeaderAbsolute && !headerTransparent,\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 })), isFloatHeaderAbsolute ? floatingHeader : null);\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//# sourceMappingURL=CardStack.js.map"]},"metadata":{},"sourceType":"module"} |