c13f1b6f046c5b8007705eb78a4ef8e5.json
6.34 KB
{"ast":null,"code":"var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));var _objectWithoutProperties2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf2=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var React=_interopRequireWildcard(require(\"react\"));var _Platform=_interopRequireDefault(require(\"react-native-web/dist/exports/Platform\"));var _StyleSheet=_interopRequireDefault(require(\"react-native-web/dist/exports/StyleSheet\"));var _View=_interopRequireDefault(require(\"react-native-web/dist/exports/View\"));var _reactNativeScreens=require(\"react-native-screens\");var _jsxFileName=\"/Users/satya/Workspace/Callstack/react-navigation-tabs/src/views/ResourceSavingScene.tsx\";var FAR_FAR_AWAY=3000;var ResourceSavingScene=function(_React$Component){(0,_inherits2.default)(ResourceSavingScene,_React$Component);function ResourceSavingScene(){(0,_classCallCheck2.default)(this,ResourceSavingScene);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(ResourceSavingScene).apply(this,arguments));}(0,_createClass2.default)(ResourceSavingScene,[{key:\"render\",value:function render(){if(_reactNativeScreens.screensEnabled&&(0,_reactNativeScreens.screensEnabled)()){var _this$props=this.props,_isVisible=_this$props.isVisible,_rest=(0,_objectWithoutProperties2.default)(_this$props,[\"isVisible\"]);return React.createElement(_reactNativeScreens.Screen,(0,_extends2.default)({active:_isVisible?1:0},_rest,{__source:{fileName:_jsxFileName,lineNumber:20}}));}var _this$props2=this.props,isVisible=_this$props2.isVisible,children=_this$props2.children,style=_this$props2.style,rest=(0,_objectWithoutProperties2.default)(_this$props2,[\"isVisible\",\"children\",\"style\"]);return React.createElement(_View.default,(0,_extends2.default)({style:[styles.container,style,{opacity:isVisible?1:0}],collapsable:false,removeClippedSubviews:_Platform.default.OS==='ios'?!isVisible:true,pointerEvents:isVisible?'auto':'none'},rest,{__source:{fileName:_jsxFileName,lineNumber:26}}),React.createElement(_View.default,{style:isVisible?styles.attached:styles.detached,__source:{fileName:_jsxFileName,lineNumber:37}},children));}}]);return ResourceSavingScene;}(React.Component);exports.default=ResourceSavingScene;var styles=_StyleSheet.default.create({container:{flex:1,overflow:'hidden'},attached:{flex:1},detached:{flex:1,top:FAR_FAR_AWAY}});","map":{"version":3,"sources":["ResourceSavingScene.tsx"],"names":["FAR_FAR_AWAY","ResourceSavingScene","React","screensEnabled","isVisible","rest","children","style","styles","opacity","Platform","StyleSheet","container","flex","overflow","attached","detached","top"],"mappings":"k5BAAA,oD,oQAIA,wD,4GAQA,GAAMA,CAAAA,YAAY,CAAlB,IAAA,CAEqBC,GAAAA,CAAAA,mB,gYACV,CACP,GAAIE,oCAAJ,wCAAA,CAAwC,CAAA,GAAA,CAAA,WAAA,CACP,KADO,KAAA,CAC9BC,UAD8B,CAAA,WAAA,CAAA,SAAA,CAChBC,KADgB,CAAA,sCAAA,WAAA,CAAA,CAAA,WAAA,CAAA,CAAA,CAGtC,MAAO,CAAA,KAAA,CAAA,aAAA,CAAA,0BAAA,CAAA,sBAAA,CAAQ,MAAM,CAAED,UAAS,CAAA,CAAA,CAAzB,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,YAAA,CAAA,UAAA,CAAP,EAAO,CAAA,CAAA,CAAA,CAAP,CAJK,IAAA,CAAA,YAAA,CAOyC,KAPzC,KAAA,CAOCA,SAPD,C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';\n\n// eslint-disable-next-line import/no-unresolved\nimport { Screen, screensEnabled } from 'react-native-screens';\n\ntype Props = {\n isVisible: boolean;\n children: React.ReactNode;\n style?: any;\n};\n\nconst FAR_FAR_AWAY = 3000; // this should be big enough to move the whole view out of its container\n\nexport default class ResourceSavingScene extends React.Component<Props> {\n render() {\n if (screensEnabled && screensEnabled()) {\n const { isVisible, ...rest } = this.props;\n // @ts-ignore\n return <Screen active={isVisible ? 1 : 0} {...rest} />;\n }\n\n const { isVisible, children, style, ...rest } = this.props;\n\n return (\n <View\n style={[styles.container, style, { opacity: isVisible ? 1 : 0 }]}\n collapsable={false}\n removeClippedSubviews={\n // On iOS, set removeClippedSubviews to true only when not focused\n // This is an workaround for a bug where the clipped view never re-appears\n Platform.OS === 'ios' ? !isVisible : true\n }\n pointerEvents={isVisible ? 'auto' : 'none'}\n {...rest}\n >\n <View style={isVisible ? styles.attached : styles.detached}>\n {children}\n </View>\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n overflow: 'hidden',\n },\n attached: {\n flex: 1,\n },\n detached: {\n flex: 1,\n top: FAR_FAR_AWAY,\n },\n});\n"]},"metadata":{},"sourceType":"script"}