repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 10.5 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"style\", \"visible\", \"size\"],\n _excluded2 = [\"backgroundColor\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { useTheme } from '@react-navigation/native';\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 { jsx as _jsx } from \"react/jsx-runtime\";\nvar useNativeDriver = Platform.OS !== 'web';\nexport function Badge(_ref) {\n var children = _ref.children,\n style = _ref.style,\n _ref$visible = _ref.visible,\n visible = _ref$visible === void 0 ? true : _ref$visible,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 18 : _ref$size,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _React$useState = React.useState(function () {\n return new Animated.Value(visible ? 1 : 0);\n }),\n _React$useState2 = _slicedToArray(_React$useState, 1),\n opacity = _React$useState2[0];\n var _React$useState3 = React.useState(visible),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n rendered = _React$useState4[0],\n setRendered = _React$useState4[1];\n var _useTheme = useTheme(),\n colors = _useTheme.colors,\n fonts = _useTheme.fonts;\n React.useEffect(function () {\n if (!rendered) {\n return;\n }\n Animated.timing(opacity, {\n toValue: visible ? 1 : 0,\n duration: 150,\n useNativeDriver: useNativeDriver\n }).start(function (_ref2) {\n var finished = _ref2.finished;\n if (finished && !visible) {\n setRendered(false);\n }\n });\n return function () {\n return opacity.stopAnimation();\n };\n }, [opacity, rendered, visible]);\n if (!rendered) {\n if (visible) {\n setRendered(true);\n } else {\n return null;\n }\n }\n var _ref3 = StyleSheet.flatten(style) || {},\n _ref3$backgroundColor = _ref3.backgroundColor,\n backgroundColor = _ref3$backgroundColor === void 0 ? colors.notification : _ref3$backgroundColor,\n restStyle = _objectWithoutProperties(_ref3, _excluded2);\n var textColor = color(backgroundColor).isLight() ? 'black' : 'white';\n var borderRadius = size / 2;\n var fontSize = Math.floor(size * 3 / 4);\n return _jsx(Animated.Text, _objectSpread(_objectSpread({\n numberOfLines: 1,\n style: [{\n transform: [{\n scale: opacity.interpolate({\n inputRange: [0, 1],\n outputRange: [0.5, 1]\n })\n }],\n color: textColor,\n lineHeight: size - 1,\n height: size,\n minWidth: size,\n opacity: opacity,\n backgroundColor: backgroundColor,\n fontSize: fontSize,\n borderRadius: borderRadius\n }, fonts.regular, styles.container, restStyle]\n }, rest), {}, {\n children: children\n }));\n}\nvar styles = StyleSheet.create({\n container: {\n alignSelf: 'flex-end',\n textAlign: 'center',\n paddingHorizontal: 4,\n overflow: 'hidden'\n }\n});","map":{"version":3,"names":["useTheme","color","React","Animated","Platform","StyleSheet","jsx","_jsx","useNativeDriver","OS","Badge","_ref","children","style","_ref$visible","visible","_ref$size","size","rest","_objectWithoutProperties","_excluded","_React$useState","useState","Value","_React$useState2","_slicedToArray","opacity","_React$useState3","_React$useState4","rendered","setRendered","_useTheme","colors","fonts","useEffect","timing","toValue","duration","start","_ref2","finished","stopAnimation","_ref3","flatten","_ref3$backgroundColor","backgroundColor","notification","restStyle","_excluded2","textColor","isLight","borderRadius","fontSize","Math","floor","Text","_objectSpread","numberOfLines","transform","scale","interpolate","inputRange","outputRange","lineHeight","height","minWidth","regular","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/bottom-tabs/src/views/Badge.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport color from 'color';\nimport * as React from 'react';\nimport {\n Animated,\n Platform,\n type StyleProp,\n StyleSheet,\n type TextProps,\n type TextStyle,\n} from 'react-native';\n\ntype Props = TextProps & {\n /**\n * Whether the badge is visible\n */\n visible: boolean;\n /**\n * Content of the `Badge`.\n */\n children?: string | number;\n /**\n * Size of the `Badge`.\n */\n size?: number;\n /**\n * Style object for the tab bar container.\n */\n style?: Animated.WithAnimatedValue<StyleProp<TextStyle>>;\n};\n\nconst useNativeDriver = Platform.OS !== 'web';\n\nexport function Badge({\n children,\n style,\n visible = true,\n size = 18,\n ...rest\n}: Props) {\n const [opacity] = React.useState(() => new Animated.Value(visible ? 1 : 0));\n const [rendered, setRendered] = React.useState(visible);\n\n const { colors, fonts } = useTheme();\n\n React.useEffect(() => {\n if (!rendered) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue: visible ? 1 : 0,\n duration: 150,\n useNativeDriver,\n }).start(({ finished }) => {\n if (finished && !visible) {\n setRendered(false);\n }\n });\n\n return () => opacity.stopAnimation();\n }, [opacity, rendered, visible]);\n\n if (!rendered) {\n if (visible) {\n setRendered(true);\n } else {\n return null;\n }\n }\n\n // @ts-expect-error: backgroundColor definitely exists\n const { backgroundColor = colors.notification, ...restStyle } =\n StyleSheet.flatten(style) || {};\n const textColor = color(backgroundColor).isLight() ? 'black' : 'white';\n\n const borderRadius = size / 2;\n const fontSize = Math.floor((size * 3) / 4);\n\n return (\n <Animated.Text\n numberOfLines={1}\n style={[\n {\n transform: [\n {\n scale: opacity.interpolate({\n inputRange: [0, 1],\n outputRange: [0.5, 1],\n }),\n },\n ],\n color: textColor,\n lineHeight: size - 1,\n height: size,\n minWidth: size,\n opacity,\n backgroundColor,\n fontSize,\n borderRadius,\n },\n fonts.regular,\n styles.container,\n restStyle,\n ]}\n {...rest}\n >\n {children}\n </Animated.Text>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'flex-end',\n textAlign: 'center',\n paddingHorizontal: 4,\n overflow: 'hidden',\n },\n});\n"],"mappings":";;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,QAAA;AAAA,OAAAC,UAAA;AAQR,SAAAC,GAAA,IAAAC,IAAA;AAqBtB,IAAMC,eAAe,GAAGJ,QAAQ,CAACK,EAAE,KAAK,KAAK;AAE7C,OAAO,SAASC,KAAKA,CAAAC,IAAA,EAMX;EAAA,IALRC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAAC,YAAA,GAAAH,IAAA,CACLI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,IAAI,GAAAA,YAAA;IAAAE,SAAA,GAAAL,IAAA,CACdM,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,EAAE,GAAAA,SAAA;IACNE,IAAA,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA;EAEH,IAAAC,eAAA,GAAkBnB,KAAK,CAACoB,QAAQ,CAAC;MAAA,OAAM,IAAInB,QAAQ,CAACoB,KAAK,CAACR,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;IAAA,EAAC;IAAAS,gBAAA,GAAAC,cAAA,CAAAJ,eAAA;IAApEK,OAAO,GAAAF,gBAAA;EACd,IAAAG,gBAAA,GAAgCzB,KAAK,CAACoB,QAAQ,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