GT2/Ejectable/node_modules/@react-navigation/bottom-tabs/lib/commonjs/views/ResourceSavingScene.js.map

1 line
3.8 KiB
Plaintext

{"version":3,"sources":["ResourceSavingScene.tsx"],"names":["FAR_FAR_AWAY","ResourceSavingScene","React","Component","render","Platform","OS","isVisible","rest","props","shouldUseActivityState","children","style","styles","container","display","attached","detached","StyleSheet","create","flex","overflow","top"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAcA,MAAMA,YAAY,GAAG,KAArB,C,CAA4B;;AAEb,MAAMC,mBAAN,SAAkCC,KAAK,CAACC,SAAxC,CAAyD;AACtEC,EAAAA,MAAM,GAAG;AACP;AACA,QAAI,uJAAsBC,sBAASC,EAAT,KAAgB,KAA1C,EAAiD;AAC/C,YAAM;AAAEC,QAAAA,SAAF;AAAa,WAAGC;AAAhB,UAAyB,KAAKC,KAApC;;AAEA,UAAIC,0CAAJ,EAA4B;AAC1B;AAAA;AACE;AACA,8BAAC,0BAAD;AAAQ,YAAA,aAAa,EAAEH,SAAS,GAAG,CAAH,GAAO;AAAvC,aAA8CC,IAA9C;AAFF;AAID,OALD,MAKO;AACL;AAAA;AACE;AACA,8BAAC,0BAAD;AAAQ,YAAA,MAAM,EAAED,SAAS,GAAG,CAAH,GAAO;AAAhC,aAAuCC,IAAvC;AAFF;AAID;AACF;;AAED,UAAM;AAAED,MAAAA,SAAF;AAAaI,MAAAA,QAAb;AAAuBC,MAAAA,KAAvB;AAA8B,SAAGJ;AAAjC,QAA0C,KAAKC,KAArD;AAEA,wBACE,oBAAC,iBAAD;AACE,MAAA,KAAK,EAAE,CACLI,MAAM,CAACC,SADF,EAELT,sBAASC,EAAT,KAAgB,KAAhB,GACI;AAAES,QAAAA,OAAO,EAAER,SAAS,GAAG,MAAH,GAAY;AAAhC,OADJ,GAEI,IAJC,EAKLK,KALK,CADT;AAQE,MAAA,WAAW,EAAE,KARf;AASE,MAAA,qBAAqB,EACnB;AACA;AACAP,4BAASC,EAAT,KAAgB,KAAhB,GAAwB,CAACC,SAAzB,GAAqC,IAZzC;AAcE,MAAA,aAAa,EAAEA,SAAS,GAAG,MAAH,GAAY;AAdtC,OAeMC,IAfN,gBAiBE,oBAAC,iBAAD;AAAM,MAAA,KAAK,EAAED,SAAS,GAAGM,MAAM,CAACG,QAAV,GAAqBH,MAAM,CAACI;AAAlD,OACGN,QADH,CAjBF,CADF;AAuBD;;AA5CqE;;;;AA+CxE,MAAME,MAAM,GAAGK,wBAAWC,MAAX,CAAkB;AAC/BL,EAAAA,SAAS,EAAE;AACTM,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,QAAQ,EAAE;AAFD,GADoB;AAK/BL,EAAAA,QAAQ,EAAE;AACRI,IAAAA,IAAI,EAAE;AADE,GALqB;AAQ/BH,EAAAA,QAAQ,EAAE;AACRG,IAAAA,IAAI,EAAE,CADE;AAERE,IAAAA,GAAG,EAAEtB;AAFG;AARqB,CAAlB,CAAf","sourcesContent":["import * as React from 'react';\nimport { Platform, StyleSheet, View } from 'react-native';\nimport {\n Screen,\n screensEnabled,\n // @ts-ignore\n shouldUseActivityState,\n} from 'react-native-screens';\n\ntype Props = {\n isVisible: boolean;\n children: React.ReactNode;\n enabled: boolean;\n style?: any;\n};\n\nconst FAR_FAR_AWAY = 30000; // 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 // react-native-screens is buggy on web\n if (screensEnabled?.() && Platform.OS !== 'web') {\n const { isVisible, ...rest } = this.props;\n\n if (shouldUseActivityState) {\n return (\n // @ts-expect-error: there was an `active` prop and no `activityState` in older version and stackPresentation was required\n <Screen activityState={isVisible ? 2 : 0} {...rest} />\n );\n } else {\n return (\n // @ts-expect-error: there was an `active` prop and no `activityState` in older version and stackPresentation was required\n <Screen active={isVisible ? 1 : 0} {...rest} />\n );\n }\n }\n\n const { isVisible, children, style, ...rest } = this.props;\n\n return (\n <View\n style={[\n styles.container,\n Platform.OS === 'web'\n ? { display: isVisible ? 'flex' : 'none' }\n : null,\n style,\n ]}\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"]}