UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 15.1 kB
{"ast":null,"code":"\"use strict\";\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"disabled\", \"onPress\", \"onPressIn\", \"onPressOut\", \"android_ripple\", \"pressColor\", \"pressOpacity\", \"hoverEffect\", \"style\", \"children\"];\nimport { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport Easing from \"react-native-web/dist/exports/Easing\";\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport Pressable from \"react-native-web/dist/exports/Pressable\";\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\nconst ANDROID_VERSION_LOLLIPOP = 21;\nconst ANDROID_SUPPORTS_RIPPLE = Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;\nconst useNativeDriver = Platform.OS !== 'web';\nfunction PlatformPressableInternal(_ref, ref) {\n let {\n disabled,\n onPress,\n onPressIn,\n onPressOut,\n android_ripple,\n pressColor,\n pressOpacity = 0.3,\n hoverEffect,\n style,\n children\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const {\n dark\n } = useTheme();\n const [opacity] = React.useState(() => new Animated.Value(1));\n const animateTo = (toValue, duration) => {\n if (ANDROID_SUPPORTS_RIPPLE) {\n return;\n }\n Animated.timing(opacity, {\n toValue,\n duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver\n }).start();\n };\n const handlePress = e => {\n if (Platform.OS === 'web' && rest.href !== null) {\n const hasModifierKey = 'metaKey' in e && e.metaKey || 'altKey' in e && e.altKey || 'ctrlKey' in e && e.ctrlKey || 'shiftKey' in e && e.shiftKey;\n const isLeftClick = 'button' in e ? e.button == null || e.button === 0 : true;\n const isSelfTarget = e.currentTarget && 'target' in e.currentTarget ? [undefined, null, '', 'self'].includes(e.currentTarget.target) : true;\n if (!hasModifierKey && isLeftClick && isSelfTarget) {\n e.preventDefault();\n onPress?.(e);\n }\n } else {\n onPress?.(e);\n }\n };\n const handlePressIn = e => {\n animateTo(pressOpacity, 0);\n onPressIn?.(e);\n };\n const handlePressOut = e => {\n animateTo(1, 200);\n onPressOut?.(e);\n };\n return _jsxs(AnimatedPressable, Object.assign({\n ref: ref,\n accessible: true,\n role: Platform.OS === 'web' && rest.href != null ? 'link' : 'button',\n onPress: disabled ? undefined : handlePress,\n onPressIn: handlePressIn,\n onPressOut: handlePressOut,\n android_ripple: ANDROID_SUPPORTS_RIPPLE ? Object.assign({\n color: pressColor !== undefined ? pressColor : dark ? 'rgba(255, 255, 255, .32)' : 'rgba(0, 0, 0, .32)'\n }, android_ripple) : undefined,\n style: [{\n cursor: Platform.OS === 'web' || Platform.OS === 'ios' ? 'pointer' : 'auto',\n opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1\n }, style]\n }, rest, {\n children: [_jsx(HoverEffect, Object.assign({}, hoverEffect)), children]\n }));\n}\nexport const PlatformPressable = React.forwardRef(PlatformPressableInternal);\nPlatformPressable.displayName = 'PlatformPressable';\nconst css = String.raw;\nconst CLASS_NAME = `__react-navigation_elements_Pressable_hover`;\nconst CSS_TEXT = css`\n .${CLASS_NAME} {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background-color: var(--overlay-color);\n opacity: 0;\n transition: opacity 0.15s;\n }\n\n a:hover > .${CLASS_NAME}, button:hover > .${CLASS_NAME} {\n opacity: var(--overlay-hover-opacity);\n }\n\n a:active > .${CLASS_NAME}, button:active > .${CLASS_NAME} {\n opacity: var(--overlay-active-opacity);\n }\n`;\nconst HoverEffect = ({\n color,\n hoverOpacity = 0.08,\n activeOpacity = 0.16\n}) => {\n if (Platform.OS !== 'web' || color == null) {\n return null;\n }\n return _jsxs(_Fragment, {\n children: [_jsx(\"style\", {\n href: CLASS_NAME,\n precedence: \"elements\",\n children: CSS_TEXT\n }), _jsx(\"div\", {\n className: CLASS_NAME,\n style: {\n '--overlay-color': color,\n '--overlay-hover-opacity': hoverOpacity,\n '--overlay-active-opacity': activeOpacity\n }\n })]\n });\n};","map":{"version":3,"names":["useTheme","React","Animated","Easing","Platform","Pressable","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","AnimatedPressable","createAnimatedComponent","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","OS","Version","useNativeDriver","PlatformPressableInternal","_ref","ref","disabled","onPress","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","hoverEffect","style","children","rest","_objectWithoutPropertiesLoose","_excluded","dark","opacity","useState","Value","animateTo","toValue","duration","timing","easing","inOut","quad","start","handlePress","e","href","hasModifierKey","metaKey","altKey","ctrlKey","shiftKey","isLeftClick","button","isSelfTarget","currentTarget","undefined","includes","target","preventDefault","handlePressIn","handlePressOut","Object","assign","accessible","role","color","cursor","HoverEffect","PlatformPressable","forwardRef","displayName","css","String","raw","CLASS_NAME","CSS_TEXT","hoverOpacity","activeOpacity","precedence","className"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/elements/src/PlatformPressable.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n Animated,\n Easing,\n type GestureResponderEvent,\n Platform,\n Pressable,\n type PressableProps,\n type StyleProp,\n type ViewStyle,\n} from 'react-native';\n\ntype HoverEffectProps = {\n color?: string;\n hoverOpacity?: number;\n activeOpacity?: number;\n};\n\nexport type Props = Omit<PressableProps, 'style' | 'onPress'> & {\n href?: string;\n pressColor?: string;\n pressOpacity?: number;\n hoverEffect?: HoverEffectProps;\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n children: React.ReactNode;\n};\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nconst ANDROID_VERSION_LOLLIPOP = 21;\nconst ANDROID_SUPPORTS_RIPPLE =\n Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;\n\nconst useNativeDriver = Platform.OS !== 'web';\n\n/**\n * PlatformPressable provides an abstraction on top of Pressable to handle platform differences.\n */\nfunction PlatformPressableInternal(\n {\n disabled,\n onPress,\n onPressIn,\n onPressOut,\n android_ripple,\n pressColor,\n pressOpacity = 0.3,\n hoverEffect,\n style,\n children,\n ...rest\n }: Props,\n ref: React.Ref<React.ComponentRef<typeof AnimatedPressable>>\n) {\n const { dark } = useTheme();\n const [opacity] = React.useState(() => new Animated.Value(1));\n\n const animateTo = (toValue: number, duration: number) => {\n if (ANDROID_SUPPORTS_RIPPLE) {\n return;\n }\n\n Animated.timing(opacity, {\n toValue,\n duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver,\n }).start();\n };\n\n const handlePress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if (Platform.OS === 'web' && rest.href !== null) {\n // ignore clicks with modifier keys\n const hasModifierKey =\n ('metaKey' in e && e.metaKey) ||\n ('altKey' in e && e.altKey) ||\n ('ctrlKey' in e && e.ctrlKey) ||\n ('shiftKey' in e && e.shiftKey);\n\n // only handle left clicks\n const isLeftClick =\n 'button' in e ? e.button == null || e.button === 0 : true;\n\n // let browser handle \"target=_blank\" etc.\n const isSelfTarget =\n e.currentTarget && 'target' in e.currentTarget\n ? [undefined, null, '', 'self'].includes(e.currentTarget.target)\n : true;\n\n if (!hasModifierKey && isLeftClick && isSelfTarget) {\n e.preventDefault();\n // call `onPress` only when browser default is prevented\n // this prevents app from handling the click when a link is being opened\n onPress?.(e);\n }\n } else {\n onPress?.(e);\n }\n };\n\n const handlePressIn = (e: GestureResponderEvent) => {\n animateTo(pressOpacity, 0);\n onPressIn?.(e);\n };\n\n const handlePressOut = (e: GestureResponderEvent) => {\n animateTo(1, 200);\n onPressOut?.(e);\n };\n\n return (\n <AnimatedPressable\n ref={ref}\n accessible\n role={Platform.OS === 'web' && rest.href != null ? 'link' : 'button'}\n onPress={disabled ? undefined : handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n android_ripple={\n ANDROID_SUPPORTS_RIPPLE\n ? {\n color:\n pressColor !== undefined\n ? pressColor\n : dark\n ? 'rgba(255, 255, 255, .32)'\n : 'rgba(0, 0, 0, .32)',\n ...android_ripple,\n }\n : undefined\n }\n style={[\n {\n cursor:\n Platform.OS === 'web' || Platform.OS === 'ios'\n ? // Pointer cursor on web\n // Hover effect on iPad and visionOS\n 'pointer'\n : 'auto',\n opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1,\n },\n style,\n ]}\n {...rest}\n >\n <HoverEffect {...hoverEffect} />\n {children}\n </AnimatedPressable>\n );\n}\n\nexport const PlatformPressable = React.forwardRef(PlatformPressableInternal);\n\nPlatformPressable.displayName = 'PlatformPressable';\n\nconst css = String.raw;\n\nconst CLASS_NAME = `__react-navigation_elements_Pressable_hover`;\n\nconst CSS_TEXT = css`\n .${CLASS_NAME} {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n background-color: var(--overlay-color);\n opacity: 0;\n transition: opacity 0.15s;\n }\n\n a:hover > .${CLASS_NAME}, button:hover > .${CLASS_NAME} {\n opacity: var(--overlay-hover-opacity);\n }\n\n a:active > .${CLASS_NAME}, button:active > .${CLASS_NAME} {\n opacity: var(--overlay-active-opacity);\n }\n`;\n\nconst HoverEffect = ({\n color,\n hoverOpacity = 0.08,\n activeOpacity = 0.16,\n}: HoverEffectProps) => {\n if (Platform.OS !== 'web' || color == null) {\n return null;\n }\n\n return (\n <>\n <style href={CLASS_NAME} precedence=\"elements\">\n {CSS_TEXT}\n </style>\n <div\n className={CLASS_NAME}\n style={{\n // @ts-expect-error: CSS variables are not typed\n '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