repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 4.87 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"screen\", \"params\", \"action\", \"href\", \"style\"];\nimport { useTheme } from '@react-navigation/core';\nimport * as React from 'react';\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport Text from \"react-native-web/dist/exports/Text\";\nimport { useLinkProps } from \"./useLinkProps.js\";\nexport function Link(_ref) {\n let {\n screen,\n params,\n action,\n href,\n style\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const {\n colors,\n fonts\n } = useTheme();\n const props = useLinkProps({\n screen,\n params,\n action,\n href\n });\n const onPress = e => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n if (!e.defaultPrevented) {\n props.onPress(e);\n }\n };\n return React.createElement(Text, Object.assign({}, props, rest, Platform.select({\n web: {\n onClick: onPress\n },\n default: {\n onPress\n }\n }), {\n style: [{\n color: colors.primary\n }, fonts.regular, style]\n }));\n}","map":{"version":3,"names":["useTheme","React","Platform","Text","useLinkProps","Link","_ref","screen","params","action","href","style","rest","_objectWithoutPropertiesLoose","_excluded","colors","fonts","props","onPress","e","defaultPrevented","createElement","Object","assign","select","web","onClick","default","color","primary","regular"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/native/src/Link.tsx"],"sourcesContent":["import { useTheme } from '@react-navigation/core';\nimport * as React from 'react';\nimport {\n type GestureResponderEvent,\n Platform,\n Text,\n type TextProps,\n} from 'react-native';\n\nimport { type LinkProps, useLinkProps } from './useLinkProps';\n\ntype Props<ParamList extends ReactNavigation.RootParamList> =\n LinkProps<ParamList> &\n Omit<TextProps, 'disabled'> & {\n target?: string;\n onPress?: (\n e:\n | React.MouseEvent<HTMLAnchorElement, MouseEvent>\n | GestureResponderEvent\n ) => void;\n disabled?: boolean | null;\n children: React.ReactNode;\n };\n\n/**\n * Component to render link to another screen using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).\n * @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).\n * @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).\n * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.\n * @param props.children Child elements to render the content.\n */\nexport function Link<ParamList extends ReactNavigation.RootParamList>({\n screen,\n params,\n action,\n href,\n style,\n ...rest\n}: Props<ParamList>) {\n const { colors, fonts } = useTheme();\n // @ts-expect-error: This is already type-checked by the prop types\n const props = useLinkProps<ParamList>({ screen, params, action, href });\n\n const onPress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n\n // Let user prevent default behavior\n if (!e.defaultPrevented) {\n props.onPress(e);\n }\n };\n\n return React.createElement(Text, {\n ...props,\n ...rest,\n ...Platform.select({\n web: { onClick: onPress } as any,\n default: { onPress },\n }),\n style: [{ color: colors.primary }, fonts.regular, style],\n });\n}\n"],"mappings":";;;;AAAA,SAASA,QAAQ,QAAQ,wBAAwB;AACjD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,IAAA;AAQ9B,SAAyBC,YAAY;AAyBrC,OAAO,SAASC,IAAIA,CAAAC,IAAA,EAOC;EAAA,IAPiD;MACpEC,MAAM;MACNC,MAAM;MACNC,MAAM;MACNC,IAAI;MACJC;IAEgB,CAAC,GAAAL,IAAA;IADdM,IAAA,GAAAC,6BAAA,CAAAP,IAAA,EAAAQ,SAAA;EAEH,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGhB,QAAQ,CAAC,CAAC;EAEpC,MAAMiB,KAAK,GAAGb,YAAY,CAAY;IAAEG,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAK,CAAC,CAAC;EAEvE,MAAMQ,OAAO,GACXC,CAA0E,IACvE;IACH,IAAI,SAAS,IAAIP,IAAI,EAAE;MACrBA,IAAI,CAACM,OAAO,GAAGC,CAAC,CAAC;IACnB;IAGA,IAAI,CAACA,CAAC,CAACC,gBAAgB,EAAE;MACvBH,KAAK,CAACC,OAAO,CAACC,CAAC,CAAC;IAClB;EACF,CAAC;EAED,OAAOlB,KAAK,CAACoB,aAAa,CAAClB,IAAI,EAAAmB,MAAA,CAAAC,MAAA,KAC1BN,KAAK,EACLL,IAAI,EACJV,QAAQ,CAACsB,MAAM,CAAC;IACjBC,GAAG,EAAE;MAAEC,OAAO,EAAER;IAAQ,CAAQ;IAChCS,OAAO,EAAE;MAAET;IAAQ;EACrB,CAAC,CAAC;IACFP,KAAK,EAAE,CAAC;MAAEiB,KAAK,EAAEb,MAAM,CAACc;IAAQ,CAAC,EAAEb,KAAK,CAACc,OAAO,EAAEnB,KAAK;EAAA,EACxD,CAAC;AACJ","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}