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
8.3 KiB
1 line
8.3 KiB
{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport { NavigationContext, NavigationRouteContext } from '@react-navigation/native';\nimport * as React from 'react';\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { useSafeAreaFrame, useSafeAreaInsets } from 'react-native-safe-area-context';\nimport Background from \"./Background\";\nimport getDefaultHeaderHeight from \"./Header/getDefaultHeaderHeight\";\nimport HeaderHeightContext from \"./Header/HeaderHeightContext\";\nimport HeaderShownContext from \"./Header/HeaderShownContext\";\nexport default function Screen(props) {\n var dimensions = useSafeAreaFrame();\n var insets = useSafeAreaInsets();\n var isParentHeaderShown = React.useContext(HeaderShownContext);\n var parentHeaderHeight = React.useContext(HeaderHeightContext);\n var focused = props.focused,\n _props$modal = props.modal,\n modal = _props$modal === void 0 ? false : _props$modal,\n header = props.header,\n _props$headerShown = props.headerShown,\n headerShown = _props$headerShown === void 0 ? true : _props$headerShown,\n headerTransparent = props.headerTransparent,\n _props$headerStatusBa = props.headerStatusBarHeight,\n headerStatusBarHeight = _props$headerStatusBa === void 0 ? isParentHeaderShown ? 0 : insets.top : _props$headerStatusBa,\n navigation = props.navigation,\n route = props.route,\n children = props.children,\n style = props.style;\n var _React$useState = React.useState(function () {\n return getDefaultHeaderHeight(dimensions, modal, headerStatusBarHeight);\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n headerHeight = _React$useState2[0],\n setHeaderHeight = _React$useState2[1];\n return React.createElement(Background, {\n accessibilityElementsHidden: !focused,\n importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',\n style: [styles.container, style]\n }, React.createElement(View, {\n style: styles.content\n }, React.createElement(HeaderShownContext.Provider, {\n value: isParentHeaderShown || headerShown !== false\n }, React.createElement(HeaderHeightContext.Provider, {\n value: headerShown ? headerHeight : parentHeaderHeight != null ? parentHeaderHeight : 0\n }, children))), headerShown ? React.createElement(NavigationContext.Provider, {\n value: navigation\n }, React.createElement(NavigationRouteContext.Provider, {\n value: route\n }, React.createElement(View, {\n onLayout: function onLayout(e) {\n var height = e.nativeEvent.layout.height;\n setHeaderHeight(height);\n },\n style: headerTransparent ? styles.absolute : null\n }, header))) : null);\n}\nvar styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column-reverse'\n },\n content: {\n flex: 1\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0\n }\n});","map":{"version":3,"sources":["Screen.tsx"],"names":["NavigationContext","NavigationRouteContext","React","useSafeAreaFrame","useSafeAreaInsets","Background","getDefaultHeaderHeight","HeaderHeightContext","HeaderShownContext","Screen","props","dimensions","insets","isParentHeaderShown","useContext","parentHeaderHeight","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","styles","container","content","e","height","nativeEvent","layout","absolute","StyleSheet","create","flex","flexDirection","position","left","right"],"mappings":";AAAA,SACEA,iBAAiB,EAEjBC,sBAAsB,QAGjB,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA;AAAA;AAE9B,SACEC,gBAAgB,EAChBC,iBAAiB,QACZ,gCAAgC;AAEvC,OAAOC,UAAU;AACjB,OAAOC,sBAAsB;AAC7B,OAAOC,mBAAmB;AAC1B,OAAOC,kBAAkB;AAezB,eAAe,SAASC,MAAM,CAACC,KAAY,EAAE;EAC3C,IAAMC,UAAU,GAAGR,gBAAgB,EAAE;EACrC,IAAMS,MAAM,GAAGR,iBAAiB,EAAE;EAElC,IAAMS,mBAAmB,GAAGX,KAAK,CAACY,UAAU,CAACN,kBAAkB,CAAC;EAChE,IAAMO,kBAAkB,GAAGb,KAAK,CAACY,UAAU,CAACP,mBAAmB,CAAC;EAEhE,IACES,OAAO,GAULN,KAAK,CAVPM,OAAO;IAAA,eAULN,KAAK,CATPO,KA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BAAiB,CAAC,QAAQ,EAAA;IAAC,KAAK,EAAEI;EAAW,CAAA,EAC5C,KAAA,CAAA,aAAA,CAAC,sBAAsB,CAAC,QAAQ,EAAA;IAAC,KAAK,EAAEC;EAAM,CAAA,EAC5C,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA;IACH,QAAQ,EAAGS,kBAAAA,CAAC,EAAK;MACf,IAAQC,MAAAA,GAAWD,CAAC,CAACE,WAAW,CAACC,MAAM,CAA/BF,MAAAA;MAERN,eAAe,CAACM,MAAM,CAAC;IACzB,CAAE;IACF,KAAK,EAAEd,iBAAiB,GAAGU,MAAM,CAACO,QAAQ,GAAG;EAAK,CAAA,EAEjDnB,MAAM,CACF,CACyB,CACP,GAC3B,IAAI,CACG;AAEjB;AAEA,IAAMY,MAAM,GAAGQ,UAAU,CAACC,MAAM,CAAC;EAC/BR,SAAS,EAAE;IACTS,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE;EACjB,CAAC;EAEDT,OAAO,EAAE;IACPQ,IAAI,EAAE;EACR,CAAC;EACDH,QAAQ,EAAE;IACRK,QAAQ,EAAE,UAAU;IACpBpB,GAAG,EAAE,CAAC;IACNqB,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","sourceRoot":"../../src","sourcesContent":["import { NavigationContext, NavigationRouteContext } from '@react-navigation/native';\nimport * as React from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { useSafeAreaFrame, useSafeAreaInsets } from 'react-native-safe-area-context';\nimport Background from './Background';\nimport getDefaultHeaderHeight from './Header/getDefaultHeaderHeight';\nimport HeaderHeightContext from './Header/HeaderHeightContext';\nimport HeaderShownContext from './Header/HeaderShownContext';\nexport default function Screen(props) {\n const dimensions = useSafeAreaFrame();\n const insets = useSafeAreaInsets();\n const isParentHeaderShown = React.useContext(HeaderShownContext);\n const parentHeaderHeight = React.useContext(HeaderHeightContext);\n const {\n focused,\n modal = false,\n header,\n headerShown = true,\n headerTransparent,\n headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n navigation,\n route,\n children,\n style\n } = props;\n const [headerHeight, setHeaderHeight] = React.useState(() => getDefaultHeaderHeight(dimensions, modal, headerStatusBarHeight));\n return /*#__PURE__*/React.createElement(Background, {\n accessibilityElementsHidden: !focused,\n importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',\n style: [styles.container, style]\n }, /*#__PURE__*/React.createElement(View, {\n style: styles.content\n }, /*#__PURE__*/React.createElement(HeaderShownContext.Provider, {\n value: isParentHeaderShown || headerShown !== false\n }, /*#__PURE__*/React.createElement(HeaderHeightContext.Provider, {\n value: headerShown ? headerHeight : parentHeaderHeight ?? 0\n }, children))), headerShown ? /*#__PURE__*/React.createElement(NavigationContext.Provider, {\n value: navigation\n }, /*#__PURE__*/React.createElement(NavigationRouteContext.Provider, {\n value: route\n }, /*#__PURE__*/React.createElement(View, {\n onLayout: e => {\n const {\n height\n } = e.nativeEvent.layout;\n setHeaderHeight(height);\n },\n style: headerTransparent ? styles.absolute : null\n }, header))) : null);\n}\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column-reverse'\n },\n // This is necessary to avoid applying 'column-reverse' to screen content\n content: {\n flex: 1\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0\n }\n});\n//# sourceMappingURL=Screen.js.map"]},"metadata":{},"sourceType":"module"} |