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
20 KiB
1 line
20 KiB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\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; }\nimport { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport I18nManager from \"react-native-web/dist/exports/I18nManager\";\nimport Image from \"react-native-web/dist/exports/Image\";\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 MaskedView from \"../MaskedView\";\nimport PlatformPressable from \"../PlatformPressable\";\nexport default function HeaderBackButton(_ref) {\n var disabled = _ref.disabled,\n allowFontScaling = _ref.allowFontScaling,\n backImage = _ref.backImage,\n label = _ref.label,\n labelStyle = _ref.labelStyle,\n labelVisible = _ref.labelVisible,\n onLabelLayout = _ref.onLabelLayout,\n onPress = _ref.onPress,\n pressColor = _ref.pressColor,\n pressOpacity = _ref.pressOpacity,\n screenLayout = _ref.screenLayout,\n customTintColor = _ref.tintColor,\n titleLayout = _ref.titleLayout,\n _ref$truncatedLabel = _ref.truncatedLabel,\n truncatedLabel = _ref$truncatedLabel === void 0 ? 'Back' : _ref$truncatedLabel,\n _ref$accessibilityLab = _ref.accessibilityLabel,\n accessibilityLabel = _ref$accessibilityLab === void 0 ? label && label !== 'Back' ? label + \", back\" : 'Go back' : _ref$accessibilityLab,\n testID = _ref.testID,\n style = _ref.style;\n var _useTheme = useTheme(),\n colors = _useTheme.colors;\n var _React$useState = React.useState(undefined),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n initialLabelWidth = _React$useState2[0],\n setInitialLabelWidth = _React$useState2[1];\n var tintColor = customTintColor !== undefined ? customTintColor : Platform.select({\n ios: colors.primary,\n default: colors.text\n });\n var handleLabelLayout = function handleLabelLayout(e) {\n onLabelLayout === null || onLabelLayout === void 0 ? void 0 : onLabelLayout(e);\n setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);\n };\n var shouldTruncateLabel = function shouldTruncateLabel() {\n return !label || initialLabelWidth && titleLayout && screenLayout && (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26;\n };\n var renderBackImage = function renderBackImage() {\n if (backImage) {\n return backImage({\n tintColor: tintColor\n });\n } else {\n return React.createElement(Image, {\n style: [styles.icon, Boolean(labelVisible) && styles.iconWithLabel, Boolean(tintColor) && {\n tintColor: tintColor\n }],\n source: require(\"../assets/back-icon.png\"),\n fadeDuration: 0\n });\n }\n };\n var renderLabel = function renderLabel() {\n var leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;\n if (!labelVisible || leftLabelText === undefined) {\n return null;\n }\n var labelElement = React.createElement(View, {\n style: screenLayout ? [styles.labelWrapper, {\n minWidth: screenLayout.width / 2 - 27\n }] : null\n }, React.createElement(Animated.Text, {\n accessible: false,\n onLayout: leftLabelText === label ? handleLabelLayout : undefined,\n style: [styles.label, tintColor ? {\n color: tintColor\n } : null, labelStyle],\n numberOfLines: 1,\n allowFontScaling: !!allowFontScaling\n }, leftLabelText));\n if (backImage || Platform.OS !== 'ios') {\n return labelElement;\n }\n return React.createElement(MaskedView, {\n maskElement: React.createElement(View, {\n style: styles.iconMaskContainer\n }, React.createElement(Image, {\n source: require(\"../assets/back-icon-mask.png\"),\n style: styles.iconMask\n }), React.createElement(View, {\n style: styles.iconMaskFillerRect\n }))\n }, labelElement);\n };\n var handlePress = function handlePress() {\n return onPress && requestAnimationFrame(onPress);\n };\n return React.createElement(PlatformPressable, {\n disabled: disabled,\n accessible: true,\n accessibilityRole: \"button\",\n accessibilityLabel: accessibilityLabel,\n testID: testID,\n onPress: disabled ? undefined : handlePress,\n pressColor: pressColor,\n pressOpacity: pressOpacity,\n android_ripple: {\n borderless: true\n },\n style: [styles.container, disabled && styles.disabled, style],\n hitSlop: Platform.select({\n ios: undefined,\n default: {\n top: 16,\n right: 16,\n bottom: 16,\n left: 16\n }\n })\n }, React.createElement(React.Fragment, null, renderBackImage(), renderLabel()));\n}\nvar styles = StyleSheet.create({\n container: _objectSpread({\n alignItems: 'center',\n flexDirection: 'row',\n minWidth: StyleSheet.hairlineWidth\n }, Platform.select({\n ios: null,\n default: {\n marginVertical: 3,\n marginHorizontal: 11\n }\n })),\n disabled: {\n opacity: 0.5\n },\n label: {\n fontSize: 17,\n letterSpacing: 0.35\n },\n labelWrapper: {\n flexDirection: 'row',\n alignItems: 'flex-start'\n },\n icon: Platform.select({\n ios: {\n height: 21,\n width: 13,\n marginLeft: 8,\n marginRight: 22,\n marginVertical: 12,\n resizeMode: 'contain',\n transform: [{\n scaleX: I18nManager.getConstants().isRTL ? -1 : 1\n }]\n },\n default: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n transform: [{\n scaleX: I18nManager.getConstants().isRTL ? -1 : 1\n }]\n }\n }),\n iconWithLabel: Platform.OS === 'ios' ? {\n marginRight: 6\n } : {},\n iconMaskContainer: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'center'\n },\n iconMaskFillerRect: {\n flex: 1,\n backgroundColor: '#000'\n },\n iconMask: {\n height: 21,\n width: 13,\n marginLeft: -14.5,\n marginVertical: 12,\n alignSelf: 'center',\n resizeMode: 'contain',\n transform: [{\n scaleX: I18nManager.getConstants().isRTL ? -1 : 1\n }]\n }\n});","map":{"version":3,"sources":["HeaderBackButton.tsx"],"names":["useTheme","React","MaskedView","PlatformPressable","HeaderBackButton","disabled","allowFontScaling","backImage","label","labelStyle","labelVisible","onLabelLayout","onPress","pressColor","pressOpacity","screenLayout","tintColor","customTintColor","titleLayout","truncatedLabel","accessibilityLabel","testID","style","colors","initialLabelWidth","setInitialLabelWidth","useState","undefined","Platform","select","ios","primary","default","text","handleLabelLayout","e","nativeEvent","layout","x","width","shouldTruncateLabel","renderBackImage","styles","icon","Boolean","iconWithLabel","require","renderLabel","leftLabelText","labelElement","labelWrapper","minWidth","color","OS","iconMaskContainer","iconMask","iconMaskFillerRect","handlePress","requestAnimationFrame","borderless","container","top","right","bottom","left","StyleSheet","create","alignItems","flexDirection","hairlineWidth","marginVertical","marginHorizontal","opacity","fontSize","letterSpacing","height","marginLeft","marginRight","resizeMode","transform","scaleX","I18nManager","getConstants","isRTL","margin","flex","justifyContent","backgroundColor","alignSelf"],"mappings":";;;;AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW9B,OAAOC,UAAU;AACjB,OAAOC,iBAAiB;AAGxB,eAAe,SAASC,gBAAgB,CAAA,IAAA,EAkBd;EAlBe,IACvCC,QAAQ,GAiBc,IAAA,CAjBtBA,QAAQ;IACRC,gBAAgB,GAgBM,IAAA,CAhBtBA,gBAAgB;IAChBC,SAAS,GAea,IAAA,CAftBA,SAAS;IACTC,KAAK,GAciB,IAAA,CAdtBA,KAAK;IACLC,UAAU,GAaY,IAAA,CAbtBA,UAAU;IACVC,YAAY,GAYU,IAAA,CAZtBA,YAAY;IACZC,aAAa,GAWS,IAAA,CAXtBA,aAAa;IACbC,OAAO,GAUe,IAAA,CAVtBA,OAAO;IACPC,UA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rBC,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAEC,WAAW,CAACC,YAAY,EAAE,CAACC,KAAK,GAAG,CAAC,CAAC,GAAG;MAAE,CAAC;IACnE;EACF,CAAC,CAAC;EACFtC,aAAa,EACXjB,QAAQ,CAACyB,EAAE,KAAK,KAAK,GACjB;IACEwB,WAAW,EAAE;EACf,CAAC,GACD,CAAC,CAAC;EACRvB,iBAAiB,EAAE;IACjB+B,IAAI,EAAE,CAAC;IACPjB,aAAa,EAAE,KAAK;IACpBkB,cAAc,EAAE;EAClB,CAAC;EACD9B,kBAAkB,EAAE;IAClB6B,IAAI,EAAE,CAAC;IACPE,eAAe,EAAE;EACnB,CAAC;EACDhC,QAAQ,EAAE;IACRoB,MAAM,EAAE,EAAE;IACVpC,KAAK,EAAE,EAAE;IACTqC,UAAU,EAAE,CAAC,IAAI;IACjBN,cAAc,EAAE,EAAE;IAClBkB,SAAS,EAAE,QAAQ;IACnBV,UAAU,EAAE,SAAS;IACrBC,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAEC,WAAW,CAACC,YAAY,EAAE,CAACC,KAAK,GAAG,CAAC,CAAC,GAAG;IAAE,CAAC;EACnE;AACF,CAAC,CAAC","sourceRoot":"../../src","sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport { Animated, I18nManager, Image, Platform, StyleSheet, View } from 'react-native';\nimport MaskedView from '../MaskedView';\nimport PlatformPressable from '../PlatformPressable';\nexport default function HeaderBackButton(_ref) {\n let {\n disabled,\n allowFontScaling,\n backImage,\n label,\n labelStyle,\n labelVisible,\n onLabelLayout,\n onPress,\n pressColor,\n pressOpacity,\n screenLayout,\n tintColor: customTintColor,\n titleLayout,\n truncatedLabel = 'Back',\n accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',\n testID,\n style\n } = _ref;\n const {\n colors\n } = useTheme();\n const [initialLabelWidth, setInitialLabelWidth] = React.useState(undefined);\n const tintColor = customTintColor !== undefined ? customTintColor : Platform.select({\n ios: colors.primary,\n default: colors.text\n });\n const handleLabelLayout = e => {\n onLabelLayout === null || onLabelLayout === void 0 ? void 0 : onLabelLayout(e);\n setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);\n };\n const shouldTruncateLabel = () => {\n return !label || initialLabelWidth && titleLayout && screenLayout && (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26;\n };\n const renderBackImage = () => {\n if (backImage) {\n return backImage({\n tintColor\n });\n } else {\n return /*#__PURE__*/React.createElement(Image, {\n style: [styles.icon, Boolean(labelVisible) && styles.iconWithLabel, Boolean(tintColor) && {\n tintColor\n }],\n source: require('../assets/back-icon.png'),\n fadeDuration: 0\n });\n }\n };\n const renderLabel = () => {\n const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;\n if (!labelVisible || leftLabelText === undefined) {\n return null;\n }\n const labelElement = /*#__PURE__*/React.createElement(View, {\n style: screenLayout ?\n // We make the button extend till the middle of the screen\n // Otherwise it appears to cut off when translating\n [styles.labelWrapper, {\n minWidth: screenLayout.width / 2 - 27\n }] : null\n }, /*#__PURE__*/React.createElement(Animated.Text, {\n accessible: false,\n onLayout:\n // This measurement is used to determine if we should truncate the label when it doesn't fit\n // Only measure it when label is not truncated because we want the measurement of full label\n leftLabelText === label ? handleLabelLayout : undefined,\n style: [styles.label, tintColor ? {\n color: tintColor\n } : null, labelStyle],\n numberOfLines: 1,\n allowFontScaling: !!allowFontScaling\n }, leftLabelText));\n if (backImage || Platform.OS !== 'ios') {\n // When a custom backimage is specified, we can't mask the label\n // Otherwise there might be weird effect due to our mask not being the same as the image\n return labelElement;\n }\n return /*#__PURE__*/React.createElement(MaskedView, {\n maskElement: /*#__PURE__*/React.createElement(View, {\n style: styles.iconMaskContainer\n }, /*#__PURE__*/React.createElement(Image, {\n source: require('../assets/back-icon-mask.png'),\n style: styles.iconMask\n }), /*#__PURE__*/React.createElement(View, {\n style: styles.iconMaskFillerRect\n }))\n }, labelElement);\n };\n const handlePress = () => onPress && requestAnimationFrame(onPress);\n return /*#__PURE__*/React.createElement(PlatformPressable, {\n disabled: disabled,\n accessible: true,\n accessibilityRole: \"button\",\n accessibilityLabel: accessibilityLabel,\n testID: testID,\n onPress: disabled ? undefined : handlePress,\n pressColor: pressColor,\n pressOpacity: pressOpacity,\n android_ripple: {\n borderless: true\n },\n style: [styles.container, disabled && styles.disabled, style],\n hitSlop: Platform.select({\n ios: undefined,\n default: {\n top: 16,\n right: 16,\n bottom: 16,\n left: 16\n }\n })\n }, /*#__PURE__*/React.createElement(React.Fragment, null, renderBackImage(), renderLabel()));\n}\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n minWidth: StyleSheet.hairlineWidth,\n // Avoid collapsing when title is long\n ...Platform.select({\n ios: null,\n default: {\n marginVertical: 3,\n marginHorizontal: 11\n }\n })\n },\n disabled: {\n opacity: 0.5\n },\n label: {\n fontSize: 17,\n // Title and back label are a bit different width due to title being bold\n // Adjusting the letterSpacing makes them coincide better\n letterSpacing: 0.35\n },\n labelWrapper: {\n // These styles will make sure that the label doesn't fill the available space\n // Otherwise it messes with the measurement of the label\n flexDirection: 'row',\n alignItems: 'flex-start'\n },\n icon: Platform.select({\n ios: {\n height: 21,\n width: 13,\n marginLeft: 8,\n marginRight: 22,\n marginVertical: 12,\n resizeMode: 'contain',\n transform: [{\n scaleX: I18nManager.getConstants().isRTL ? -1 : 1\n }]\n },\n default: {\n height: 24,\n width: 24,\n margin: 3,\n resizeMode: 'contain',\n transform: [{\n scaleX: I18nManager.getConstants().isRTL ? -1 : 1\n }]\n }\n }),\n iconWithLabel: Platform.OS === 'ios' ? {\n marginRight: 6\n } : {},\n iconMaskContainer: {\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'center'\n },\n iconMaskFillerRect: {\n flex: 1,\n backgroundColor: '#000'\n },\n iconMask: {\n height: 21,\n width: 13,\n marginLeft: -14.5,\n marginVertical: 12,\n alignSelf: 'center',\n resizeMode: 'contain',\n transform: [{\n scaleX: I18nManager.getConstants().isRTL ? -1 : 1\n }]\n }\n});\n//# sourceMappingURL=HeaderBackButton.js.map"]},"metadata":{},"sourceType":"module"} |