@planningcenter/chat-react-native 3.13.0-rc.3 → 3.13.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
  2. package/build/components/conversation/attachments/expanded_link.js +2 -1
  3. package/build/components/conversation/attachments/expanded_link.js.map +1 -1
  4. package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
  5. package/build/components/conversation/attachments/generic_file_attachment.js +2 -1
  6. package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
  7. package/build/components/conversation/message_markdown.d.ts.map +1 -1
  8. package/build/components/conversation/message_markdown.js +2 -1
  9. package/build/components/conversation/message_markdown.js.map +1 -1
  10. package/build/utils/native_adapters/configuration.d.ts +3 -0
  11. package/build/utils/native_adapters/configuration.d.ts.map +1 -1
  12. package/build/utils/native_adapters/configuration.js +4 -0
  13. package/build/utils/native_adapters/configuration.js.map +1 -1
  14. package/build/utils/native_adapters/index.d.ts +3 -2
  15. package/build/utils/native_adapters/index.d.ts.map +1 -1
  16. package/build/utils/native_adapters/index.js +3 -2
  17. package/build/utils/native_adapters/index.js.map +1 -1
  18. package/build/utils/native_adapters/linking.d.ts +7 -0
  19. package/build/utils/native_adapters/linking.d.ts.map +1 -0
  20. package/build/utils/native_adapters/linking.js +9 -0
  21. package/build/utils/native_adapters/linking.js.map +1 -0
  22. package/package.json +2 -2
  23. package/src/components/conversation/attachments/expanded_link.tsx +2 -1
  24. package/src/components/conversation/attachments/generic_file_attachment.tsx +2 -1
  25. package/src/components/conversation/message_markdown.tsx +2 -1
  26. package/src/utils/native_adapters/configuration.ts +6 -0
  27. package/src/utils/native_adapters/index.ts +3 -2
  28. package/src/utils/native_adapters/linking.ts +11 -0
@@ -1 +1 @@
1
- {"version":3,"file":"expanded_link.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/expanded_link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,0CAA0C,EAAE,MAAM,2DAA2D,CAAA;AAGtH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,kBAAkB,GACnB,EAAE;IACD,UAAU,EAAE,0CAA0C,CAAA;IACtD,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,qBA8BA"}
1
+ {"version":3,"file":"expanded_link.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/expanded_link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,0CAA0C,EAAE,MAAM,2DAA2D,CAAA;AAItH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,kBAAkB,GACnB,EAAE;IACD,UAAU,EAAE,0CAA0C,CAAA;IACtD,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,qBA8BA"}
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import { Image, Linking, StyleSheet, Text, View } from 'react-native';
2
+ import { Image, StyleSheet, Text, View } from 'react-native';
3
3
  import { useTheme } from '../../../hooks';
4
4
  import { tokens } from '../../../vendor/tapestry/tokens';
5
5
  import { PlatformPressable } from '@react-navigation/elements';
6
+ import { Linking } from '../../../utils';
6
7
  export function ExpandedLink({ attachment, onMessageLongPress, }) {
7
8
  const styles = useStyles();
8
9
  const { colors } = useTheme();
@@ -1 +1 @@
1
- {"version":3,"file":"expanded_link.js","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/expanded_link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,OAAO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,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CACnD;UAAA,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,CACvE;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,iBAAiB,CAAC,CACrB,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;YACf,KAAK,EAAE,MAAM;SACd;QACD,WAAW,EAAE;YACX,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,CAAC;SACX;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,UAAU,EAAE,MAAM,CAAC,gBAAgB;YACnC,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,WAAW,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Image, Linking, StyleSheet, Text, View } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { DenormalizedExpandedLinkAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'\nimport { PlatformPressable } from '@react-navigation/elements'\n\nexport function ExpandedLink({\n attachment,\n onMessageLongPress,\n}: {\n attachment: DenormalizedExpandedLinkAttachmentResource\n onMessageLongPress: () => void\n}) {\n const styles = useStyles()\n const { colors } = useTheme()\n const { attributes } = attachment\n const { url, title, description, imageUrl, imageHeight, imageWidth } = attributes\n\n const aspectRatio = imageWidth && imageHeight ? imageWidth / imageHeight : 1\n\n async function openUrl() {\n if (url) Linking.openURL(url)\n }\n\n return (\n <PlatformPressable\n style={styles.container}\n android_ripple={{ color: colors.androidRippleNeutral, foreground: true }}\n onPress={openUrl}\n onLongPress={onMessageLongPress}\n >\n {imageUrl && (\n <Image source={{ uri: imageUrl }} style={[styles.image, { aspectRatio }]} alt={title} />\n )}\n {(title || description) && (\n <View style={styles.textWrapper}>\n {title && <Text style={styles.title}>{title}</Text>}\n {description && <Text style={styles.description}>{description}</Text>}\n </View>\n )}\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {},\n image: {\n borderRadius: 8,\n width: '100%',\n },\n textWrapper: {\n gap: 4,\n padding: 8,\n },\n title: {\n fontSize: tokens.fontSizeSm,\n fontWeight: tokens.fontWeightMedium,\n color: colors.textColorDefaultPrimary,\n },\n description: {\n fontSize: tokens.fontSizeXs,\n color: colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"expanded_link.js","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/expanded_link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,UAAU,YAAY,CAAC,EAC3B,UAAU,EACV,kBAAkB,GAInB;IACC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ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AC,WAAW,CAAC,EAAE,IAAI,CAAC,CACvE;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,iBAAiB,CAAC,CACrB,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;YACf,KAAK,EAAE,MAAM;SACd;QACD,WAAW,EAAE;YACX,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,CAAC;SACX;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,UAAU,EAAE,MAAM,CAAC,gBAAgB;YACnC,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,WAAW,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Image, StyleSheet, Text, View } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { DenormalizedExpandedLinkAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'\nimport { PlatformPressable } from '@react-navigation/elements'\nimport { Linking } from '../../../utils'\n\nexport function ExpandedLink({\n attachment,\n onMessageLongPress,\n}: {\n attachment: DenormalizedExpandedLinkAttachmentResource\n onMessageLongPress: () => void\n}) {\n const styles = useStyles()\n const { colors } = useTheme()\n const { attributes } = attachment\n const { url, title, description, imageUrl, imageHeight, imageWidth } = attributes\n\n const aspectRatio = imageWidth && imageHeight ? imageWidth / imageHeight : 1\n\n async function openUrl() {\n if (url) Linking.openURL(url)\n }\n\n return (\n <PlatformPressable\n style={styles.container}\n android_ripple={{ color: colors.androidRippleNeutral, foreground: true }}\n onPress={openUrl}\n onLongPress={onMessageLongPress}\n >\n {imageUrl && (\n <Image source={{ uri: imageUrl }} style={[styles.image, { aspectRatio }]} alt={title} />\n )}\n {(title || description) && (\n <View style={styles.textWrapper}>\n {title && <Text style={styles.title}>{title}</Text>}\n {description && <Text style={styles.description}>{description}</Text>}\n </View>\n )}\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {},\n image: {\n borderRadius: 8,\n width: '100%',\n },\n textWrapper: {\n gap: 4,\n padding: 8,\n },\n title: {\n fontSize: tokens.fontSizeSm,\n fontWeight: tokens.fontWeightMedium,\n color: colors.textColorDefaultPrimary,\n },\n description: {\n fontSize: tokens.fontSizeXs,\n color: colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"generic_file_attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/generic_file_attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,qCAAqC,EAAE,MAAM,2DAA2D,CAAA;AAOjH,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,4BAA4B,GAC7B,EAAE;IACD,UAAU,EAAE,qCAAqC,CAAA;IACjD,4BAA4B,EAAE,CAAC,UAAU,EAAE,qCAAqC,KAAK,IAAI,CAAA;CAC1F,qBAiCA;AAwBD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,uJAWjD"}
1
+ {"version":3,"file":"generic_file_attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/generic_file_attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,qCAAqC,EAAE,MAAM,2DAA2D,CAAA;AAQjH,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,4BAA4B,GAC7B,EAAE;IACD,UAAU,EAAE,qCAAqC,CAAA;IACjD,4BAA4B,EAAE,CAAC,UAAU,EAAE,qCAAqC,KAAK,IAAI,CAAA;CAC1F,qBAiCA;AAwBD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,uJAWjD"}
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
- import { Linking, StyleSheet, View } from 'react-native';
2
+ import { StyleSheet, View } from 'react-native';
3
3
  import { AttachmentCard, AttachmentCardTitle } from './attachment_card';
4
4
  import { Icon } from '../../display';
5
5
  import { useTheme } from '../../../hooks';
6
6
  import { PlatformPressable } from '@react-navigation/elements';
7
7
  import { tokens } from '../../../vendor/tapestry/tokens';
8
+ import { Linking } from '../../../utils';
8
9
  export function GenericFileAttachment({ attachment, onMessageAttachmentLongPress, }) {
9
10
  const styles = useStyles();
10
11
  const { colors } = useTheme();
@@ -1 +1 @@
1
- {"version":3,"file":"generic_file_attachment.js","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/generic_file_attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExD,MAAM,UAAU,qBAAqB,CAAC,EACpC,UAAU,EACV,4BAA4B,GAI7B;IACC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,UAAU,CAAA;I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E;YACT,GAAG,EAAE,CAAC;YACN,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,eAAe;SAChC;QACD,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;SACrB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,uBAAuB;YACrC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IACzC,MAAM,KAAK,GAAG,IAAI,KAAK,iBAAiB,CAAA;IAExC,IAAI,OAAO;QAAE,OAAO,2BAA2B,CAAA;IAC/C,IAAI,OAAO;QAAE,OAAO,2BAA2B,CAAA;IAC/C,IAAI,OAAO;QAAE,OAAO,2BAA2B,CAAA;IAC/C,IAAI,KAAK;QAAE,OAAO,yBAAyB,CAAA;IAC3C,OAAO,6BAA6B,CAAA;AACtC,CAAC","sourcesContent":["import React from 'react'\nimport { Linking, StyleSheet, View } from 'react-native'\nimport { DenormalizedMessageAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'\nimport { AttachmentCard, AttachmentCardTitle } from './attachment_card'\nimport { Icon } from '../../display'\nimport { useTheme } from '../../../hooks'\nimport { PlatformPressable } from '@react-navigation/elements'\nimport { tokens } from '../../../vendor/tapestry/tokens'\n\nexport function GenericFileAttachment({\n attachment,\n onMessageAttachmentLongPress,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n onMessageAttachmentLongPress: (attachment: DenormalizedMessageAttachmentResource) => void\n}) {\n const styles = useStyles()\n const { colors } = useTheme()\n\n const { url, filename, contentType } = attachment.attributes\n const iconName = getAttachmentIconName(contentType)\n const fileTypeLabel = contentType === 'application/pdf' ? 'PDF' : 'file'\n\n async function handleDownload() {\n if (url) {\n // Open link in the default web browser\n Linking.openURL(url)\n }\n }\n\n return (\n <PlatformPressable\n onPress={handleDownload}\n onLongPress={() => onMessageAttachmentLongPress(attachment)}\n android_ripple={{ color: colors.androidRippleNeutral, foreground: true }}\n accessibilityRole=\"link\"\n accessibilityHint={`Press to open ${fileTypeLabel} in a browser. Long press for more options`}\n >\n <AttachmentCard>\n <View style={styles.container}>\n <View style={styles.stack}>\n <Icon name={iconName} style={styles.icon} />\n <AttachmentCardTitle>{filename}</AttachmentCardTitle>\n </View>\n </View>\n </AttachmentCard>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n gap: 4,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n stack: {\n gap: 4,\n flexDirection: 'row',\n alignItems: 'center',\n },\n icon: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n })\n}\n\nexport function getAttachmentIconName(type: string) {\n const isImage = type.startsWith('image/')\n const isVideo = type.startsWith('video/')\n const isAudio = type.startsWith('audio/')\n const isPdf = type === 'application/pdf'\n\n if (isImage) return 'general.outlinedImageFile'\n if (isVideo) return 'general.outlinedVideoFile'\n if (isAudio) return 'general.outlinedMusicFile'\n if (isPdf) return 'general.outlinedPdfFile'\n return 'general.outlinedGenericFile'\n}\n"]}
1
+ {"version":3,"file":"generic_file_attachment.js","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/generic_file_attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,mBA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/C,IAAI,OAAO;QAAE,OAAO,2BAA2B,CAAA;IAC/C,IAAI,KAAK;QAAE,OAAO,yBAAyB,CAAA;IAC3C,OAAO,6BAA6B,CAAA;AACtC,CAAC","sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { DenormalizedMessageAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'\nimport { AttachmentCard, AttachmentCardTitle } from './attachment_card'\nimport { Icon } from '../../display'\nimport { useTheme } from '../../../hooks'\nimport { PlatformPressable } from '@react-navigation/elements'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { Linking } from '../../../utils'\n\nexport function GenericFileAttachment({\n attachment,\n onMessageAttachmentLongPress,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n onMessageAttachmentLongPress: (attachment: DenormalizedMessageAttachmentResource) => void\n}) {\n const styles = useStyles()\n const { colors } = useTheme()\n\n const { url, filename, contentType } = attachment.attributes\n const iconName = getAttachmentIconName(contentType)\n const fileTypeLabel = contentType === 'application/pdf' ? 'PDF' : 'file'\n\n async function handleDownload() {\n if (url) {\n // Open link in the default web browser\n Linking.openURL(url)\n }\n }\n\n return (\n <PlatformPressable\n onPress={handleDownload}\n onLongPress={() => onMessageAttachmentLongPress(attachment)}\n android_ripple={{ color: colors.androidRippleNeutral, foreground: true }}\n accessibilityRole=\"link\"\n accessibilityHint={`Press to open ${fileTypeLabel} in a browser. Long press for more options`}\n >\n <AttachmentCard>\n <View style={styles.container}>\n <View style={styles.stack}>\n <Icon name={iconName} style={styles.icon} />\n <AttachmentCardTitle>{filename}</AttachmentCardTitle>\n </View>\n </View>\n </AttachmentCard>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n gap: 4,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n stack: {\n gap: 4,\n flexDirection: 'row',\n alignItems: 'center',\n },\n icon: {\n color: colors.textColorDefaultPrimary,\n fontSize: tokens.fontSizeMd,\n },\n })\n}\n\nexport function getAttachmentIconName(type: string) {\n const isImage = type.startsWith('image/')\n const isVideo = type.startsWith('video/')\n const isAudio = type.startsWith('audio/')\n const isPdf = type === 'application/pdf'\n\n if (isImage) return 'general.outlinedImageFile'\n if (isVideo) return 'general.outlinedVideoFile'\n if (isAudio) return 'general.outlinedMusicFile'\n if (isPdf) return 'general.outlinedPdfFile'\n return 'general.outlinedGenericFile'\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"message_markdown.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,4BAyC9C"}
1
+ {"version":3,"file":"message_markdown.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,4BAyC9C"}
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import { Linking, StyleSheet } from 'react-native';
2
+ import { StyleSheet } from 'react-native';
3
3
  import { Text, TextInlineButton } from '../display';
4
4
  import { parseSimpleMarkdown } from '../../utils/parse_simple_markdown';
5
+ import { Linking } from '../../utils/native_adapters';
5
6
  export function MessageMarkdown({ text }) {
6
7
  if (!text)
7
8
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"message_markdown.js","sourceRoot":"","sources":["../../../src/components/conversation/message_markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE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AA,EAAE,gBAAgB,CAAC,CACpB,CAAA;gBACH;oBACE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAA;YAC9C,CAAC;QACH,CAAC,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;IAC5B,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;CAChC,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Linking, StyleSheet } from 'react-native'\nimport { Text, TextInlineButton } from '../display'\nimport { parseSimpleMarkdown } from '../../utils/parse_simple_markdown'\n\ninterface Props {\n text: string\n}\n\nexport function MessageMarkdown({ text }: Props) {\n if (!text) return null\n\n // Skip markdown for excessively long messages for performance reasons\n if (text.length > 5000) return <Text>{text}</Text>\n\n const parsed = parseSimpleMarkdown(text)\n\n return (\n <Text>\n {parsed.map((part, i) => {\n switch (part.type) {\n case 'bold':\n return (\n <Text key={i} style={styles.bold}>\n {part.content}\n </Text>\n )\n case 'italic':\n return (\n <Text key={i} style={styles.italic}>\n {part.content}\n </Text>\n )\n case 'link':\n return (\n <TextInlineButton\n key={i}\n onPress={() => Linking.openURL(part.content)}\n accessibilityRole=\"link\"\n accessibilityHint=\"Opens browser\"\n >\n {part.content}\n </TextInlineButton>\n )\n default:\n return <Text key={i}>{part.content}</Text>\n }\n })}\n </Text>\n )\n}\n\nconst styles = StyleSheet.create({\n bold: { fontWeight: 'bold' },\n italic: { fontStyle: 'italic' },\n})\n"]}
1
+ {"version":3,"file":"message_markdown.js","sourceRoot":"","sources":["../../../src/components/conversation/message_markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,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,MAAM,CACxB,iBAAiB,CAAC,eAAe,CAEjC;gBAAA,CAAC,IAAI,CAAC,OAAO,CACf;cAAA,EAAE,gBAAgB,CAAC,CACpB,CAAA;gBACH;oBACE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAA;YAC9C,CAAC;QACH,CAAC,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;IAC5B,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;CAChC,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet } from 'react-native'\nimport { Text, TextInlineButton } from '../display'\nimport { parseSimpleMarkdown } from '../../utils/parse_simple_markdown'\nimport { Linking } from '../../utils/native_adapters'\n\ninterface Props {\n text: string\n}\n\nexport function MessageMarkdown({ text }: Props) {\n if (!text) return null\n\n // Skip markdown for excessively long messages for performance reasons\n if (text.length > 5000) return <Text>{text}</Text>\n\n const parsed = parseSimpleMarkdown(text)\n\n return (\n <Text>\n {parsed.map((part, i) => {\n switch (part.type) {\n case 'bold':\n return (\n <Text key={i} style={styles.bold}>\n {part.content}\n </Text>\n )\n case 'italic':\n return (\n <Text key={i} style={styles.italic}>\n {part.content}\n </Text>\n )\n case 'link':\n return (\n <TextInlineButton\n key={i}\n onPress={() => Linking.openURL(part.content)}\n accessibilityRole=\"link\"\n accessibilityHint=\"Opens browser\"\n >\n {part.content}\n </TextInlineButton>\n )\n default:\n return <Text key={i}>{part.content}</Text>\n }\n })}\n </Text>\n )\n}\n\nconst styles = StyleSheet.create({\n bold: { fontWeight: 'bold' },\n italic: { fontStyle: 'italic' },\n})\n"]}
@@ -3,12 +3,14 @@ import { AudioAdapter } from './audio';
3
3
  import { ClipboardAdapter } from './clipboard';
4
4
  import { ImagePickerAdapter } from './image_picker';
5
5
  import { VideoAdapter } from './video';
6
+ import { LinkingAdapter } from './linking';
6
7
  type ChatConfigurations = {
7
8
  clipboard: ClipboardAdapter;
8
9
  audio: AudioAdapter;
9
10
  video: VideoAdapter;
10
11
  imagePicker: ImagePickerAdapter;
11
12
  log?: LogAdapter;
13
+ linking?: LinkingAdapter;
12
14
  };
13
15
  export declare class ChatAdapters {
14
16
  static configure(configurations: ChatConfigurations): void;
@@ -18,5 +20,6 @@ export declare let Audio: AudioAdapter;
18
20
  export declare let Video: VideoAdapter;
19
21
  export declare let ImagePicker: ImagePickerAdapter;
20
22
  export declare let Log: LogAdapter;
23
+ export declare let Linking: LinkingAdapter;
21
24
  export {};
22
25
  //# sourceMappingURL=configuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,gBAAgB,CAAA;IAC3B,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,GAAG,CAAC,EAAE,UAAU,CAAA;CACjB,CAAA;AAED,qBAAa,YAAY;IACvB,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB;CAOpD;AAMD,eAAO,IAAI,SAAS,EAAE,gBAMpB,CAAA;AAEF,eAAO,IAAI,KAAK,EAAE,YAKhB,CAAA;AAEF,eAAO,IAAI,KAAK,EAAE,YAQhB,CAAA;AAEF,eAAO,IAAI,WAAW,EAAE,kBAStB,CAAA;AAEF,eAAO,IAAI,GAAG,EAAE,UAA6B,CAAA"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,gBAAgB,CAAA;IAC3B,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,GAAG,CAAC,EAAE,UAAU,CAAA;IAChB,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB,CAAA;AAED,qBAAa,YAAY;IACvB,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB;CAQpD;AAMD,eAAO,IAAI,SAAS,EAAE,gBAMpB,CAAA;AAEF,eAAO,IAAI,KAAK,EAAE,YAKhB,CAAA;AAEF,eAAO,IAAI,KAAK,EAAE,YAQhB,CAAA;AAEF,eAAO,IAAI,WAAW,EAAE,kBAStB,CAAA;AAEF,eAAO,IAAI,GAAG,EAAE,UAA6B,CAAA;AAE7C,eAAO,IAAI,OAAO,EAAE,cAA8C,CAAA"}
@@ -3,6 +3,8 @@ import { AudioAdapter } from './audio';
3
3
  import { ClipboardAdapter } from './clipboard';
4
4
  import { ImagePickerAdapter } from './image_picker';
5
5
  import { VideoAdapter } from './video';
6
+ import { Linking as RNLinking } from 'react-native';
7
+ import { LinkingAdapter } from './linking';
6
8
  export class ChatAdapters {
7
9
  static configure(configurations) {
8
10
  Clipboard = configurations.clipboard;
@@ -10,6 +12,7 @@ export class ChatAdapters {
10
12
  Video = configurations.video;
11
13
  ImagePicker = configurations.imagePicker;
12
14
  Log = configurations.log || new LogAdapter();
15
+ Linking = configurations.linking || new LinkingAdapter(RNLinking);
13
16
  }
14
17
  }
15
18
  const methodMissing = () => {
@@ -45,4 +48,5 @@ export let ImagePicker = new ImagePickerAdapter({
45
48
  },
46
49
  });
47
50
  export let Log = new LogAdapter();
51
+ export let Linking = new LinkingAdapter(RNLinking);
48
52
  //# sourceMappingURL=configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAUtC,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,SAAS,CAAC,cAAkC;QACjD,SAAS,GAAG,cAAc,CAAC,SAAS,CAAA;QACpC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAA;QAC5B,KAAK,GAAG,cAAc,CAAC,KAAK,CAAA;QAC5B,WAAW,GAAG,cAAc,CAAC,WAAW,CAAA;QACxC,GAAG,GAAG,cAAc,CAAC,GAAG,IAAI,IAAI,UAAU,EAAE,CAAA;IAC9C,CAAC;CACF;AAED,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,OAAO,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAA;AACnF,CAAC,CAAA;AAED,MAAM,CAAC,IAAI,SAAS,GAAqB,IAAI,gBAAgB,CAAC;IAC5D,cAAc,EAAE,KAAK,IAAI,EAAE;QACzB,aAAa,EAAE,CAAA;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IACD,cAAc,EAAE,KAAK,EAAE,CAAS,EAAE,EAAE,CAAC,aAAa,EAAE;CACrD,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,KAAK,GAAiB,IAAI,YAAY,CAAC;IAChD,QAAQ,EAAE,CAAC,CAAS,EAAE,EAAE;QACtB,aAAa,EAAE,CAAA;QACf,OAAO,EAAS,CAAA;IAClB,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,KAAK,GAAiB,IAAI,YAAY,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC,MAAM,CACnB,GAAG,EAAE;QACH,aAAa,EAAE,CAAA;QACf,OAAO,IAAI,CAAA;IACb,CAAC,EACD,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAC9C;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,WAAW,GAAuB,IAAI,kBAAkB,CAAC;IAClE,eAAe,EAAE,KAAK,IAAI,EAAE;QAC1B,aAAa,EAAE,CAAA;QACf,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;IACzC,CAAC;IACD,qBAAqB,EAAE,KAAK,IAAI,EAAE;QAChC,aAAa,EAAE,CAAA;QACf,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;IACzC,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,GAAG,GAAe,IAAI,UAAU,EAAE,CAAA","sourcesContent":["import { LogAdapter } from './log'\nimport { AudioAdapter } from './audio'\nimport { ClipboardAdapter } from './clipboard'\nimport { ImagePickerAdapter } from './image_picker'\nimport { VideoAdapter } from './video'\n\ntype ChatConfigurations = {\n clipboard: ClipboardAdapter\n audio: AudioAdapter\n video: VideoAdapter\n imagePicker: ImagePickerAdapter\n log?: LogAdapter\n}\n\nexport class ChatAdapters {\n static configure(configurations: ChatConfigurations) {\n Clipboard = configurations.clipboard\n Audio = configurations.audio\n Video = configurations.video\n ImagePicker = configurations.imagePicker\n Log = configurations.log || new LogAdapter()\n }\n}\n\nconst methodMissing = () => {\n console.warn('ChatAdapters.configure() must be called before using any adapters')\n}\n\nexport let Clipboard: ClipboardAdapter = new ClipboardAdapter({\n getStringAsync: async () => {\n methodMissing()\n return ''\n },\n setStringAsync: async (_: string) => methodMissing(),\n})\n\nexport let Audio: AudioAdapter = new AudioAdapter({\n useAudio: (_: string) => {\n methodMissing()\n return {} as any\n },\n})\n\nexport let Video: VideoAdapter = new VideoAdapter({\n Player: Object.assign(\n () => {\n methodMissing()\n return null\n },\n { $$typeof: Symbol.for('react.forward_ref') }\n ),\n})\n\nexport let ImagePicker: ImagePickerAdapter = new ImagePickerAdapter({\n openCameraAsync: async () => {\n methodMissing()\n return { canceled: true, assets: null }\n },\n openImageLibraryAsync: async () => {\n methodMissing()\n return { canceled: true, assets: null }\n },\n})\n\nexport let Log: LogAdapter = new LogAdapter()\n"]}
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAW1C,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,SAAS,CAAC,cAAkC;QACjD,SAAS,GAAG,cAAc,CAAC,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AE,MAAM,EAAE,IAAI,EAAE,CAAA;IACzC,CAAC;IACD,qBAAqB,EAAE,KAAK,IAAI,EAAE;QAChC,aAAa,EAAE,CAAA;QACf,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;IACzC,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,GAAG,GAAe,IAAI,UAAU,EAAE,CAAA;AAE7C,MAAM,CAAC,IAAI,OAAO,GAAmB,IAAI,cAAc,CAAC,SAAS,CAAC,CAAA","sourcesContent":["import { LogAdapter } from './log'\nimport { AudioAdapter } from './audio'\nimport { ClipboardAdapter } from './clipboard'\nimport { ImagePickerAdapter } from './image_picker'\nimport { VideoAdapter } from './video'\nimport { Linking as RNLinking } from 'react-native'\nimport { LinkingAdapter } from './linking'\n\ntype ChatConfigurations = {\n clipboard: ClipboardAdapter\n audio: AudioAdapter\n video: VideoAdapter\n imagePicker: ImagePickerAdapter\n log?: LogAdapter\n linking?: LinkingAdapter\n}\n\nexport class ChatAdapters {\n static configure(configurations: ChatConfigurations) {\n Clipboard = configurations.clipboard\n Audio = configurations.audio\n Video = configurations.video\n ImagePicker = configurations.imagePicker\n Log = configurations.log || new LogAdapter()\n Linking = configurations.linking || new LinkingAdapter(RNLinking)\n }\n}\n\nconst methodMissing = () => {\n console.warn('ChatAdapters.configure() must be called before using any adapters')\n}\n\nexport let Clipboard: ClipboardAdapter = new ClipboardAdapter({\n getStringAsync: async () => {\n methodMissing()\n return ''\n },\n setStringAsync: async (_: string) => methodMissing(),\n})\n\nexport let Audio: AudioAdapter = new AudioAdapter({\n useAudio: (_: string) => {\n methodMissing()\n return {} as any\n },\n})\n\nexport let Video: VideoAdapter = new VideoAdapter({\n Player: Object.assign(\n () => {\n methodMissing()\n return null\n },\n { $$typeof: Symbol.for('react.forward_ref') }\n ),\n})\n\nexport let ImagePicker: ImagePickerAdapter = new ImagePickerAdapter({\n openCameraAsync: async () => {\n methodMissing()\n return { canceled: true, assets: null }\n },\n openImageLibraryAsync: async () => {\n methodMissing()\n return { canceled: true, assets: null }\n },\n})\n\nexport let Log: LogAdapter = new LogAdapter()\n\nexport let Linking: LinkingAdapter = new LinkingAdapter(RNLinking)\n"]}
@@ -1,7 +1,8 @@
1
+ export * from './audio';
1
2
  export * from './clipboard';
2
3
  export * from './configuration';
3
- export * from './audio';
4
4
  export * from './image_picker';
5
- export * from './video';
5
+ export * from './linking';
6
6
  export * from './log';
7
+ export * from './video';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA"}
@@ -1,7 +1,8 @@
1
+ export * from './audio';
1
2
  export * from './clipboard';
2
3
  export * from './configuration';
3
- export * from './audio';
4
4
  export * from './image_picker';
5
- export * from './video';
5
+ export * from './linking';
6
6
  export * from './log';
7
+ export * from './video';
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA","sourcesContent":["export * from './clipboard'\nexport * from './configuration'\nexport * from './audio'\nexport * from './image_picker'\nexport * from './video'\nexport * from './log'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA","sourcesContent":["export * from './audio'\nexport * from './clipboard'\nexport * from './configuration'\nexport * from './image_picker'\nexport * from './linking'\nexport * from './log'\nexport * from './video'\n"]}
@@ -0,0 +1,7 @@
1
+ import { Linking } from 'react-native';
2
+ export declare class LinkingAdapter {
3
+ openURL: Linking['openURL'];
4
+ canOpenURL: Linking['canOpenURL'];
5
+ constructor(methods: Pick<Linking, 'openURL' | 'canOpenURL'>);
6
+ }
7
+ //# sourceMappingURL=linking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linking.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/linking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,qBAAa,cAAc;IACzB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;gBAErB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,YAAY,CAAC;CAI7D"}
@@ -0,0 +1,9 @@
1
+ export class LinkingAdapter {
2
+ openURL;
3
+ canOpenURL;
4
+ constructor(methods) {
5
+ this.openURL = methods.openURL;
6
+ this.canOpenURL = methods.canOpenURL;
7
+ }
8
+ }
9
+ //# sourceMappingURL=linking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linking.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/linking.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IACzB,OAAO,CAAoB;IAC3B,UAAU,CAAuB;IAEjC,YAAY,OAAgD;QAC1D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC9B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;IACtC,CAAC;CACF","sourcesContent":["import { Linking } from 'react-native'\n\nexport class LinkingAdapter {\n openURL: Linking['openURL']\n canOpenURL: Linking['canOpenURL']\n\n constructor(methods: Pick<Linking, 'openURL' | 'canOpenURL'>) {\n this.openURL = methods.openURL\n this.canOpenURL = methods.canOpenURL\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.13.0-rc.3",
3
+ "version": "3.13.0-rc.4",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "react-native-url-polyfill": "^2.0.0",
56
56
  "typescript": "<5.6.0"
57
57
  },
58
- "gitHead": "6b2dc3ef26cc7ddd1ed48268ca55fbd606f29f8c"
58
+ "gitHead": "b3c6396dafcf5a073c936f1e923a474e74c8a61a"
59
59
  }
@@ -1,9 +1,10 @@
1
1
  import React from 'react'
2
- import { Image, Linking, StyleSheet, Text, View } from 'react-native'
2
+ import { Image, StyleSheet, Text, View } from 'react-native'
3
3
  import { useTheme } from '../../../hooks'
4
4
  import { tokens } from '../../../vendor/tapestry/tokens'
5
5
  import { DenormalizedExpandedLinkAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'
6
6
  import { PlatformPressable } from '@react-navigation/elements'
7
+ import { Linking } from '../../../utils'
7
8
 
8
9
  export function ExpandedLink({
9
10
  attachment,
@@ -1,11 +1,12 @@
1
1
  import React from 'react'
2
- import { Linking, StyleSheet, View } from 'react-native'
2
+ import { StyleSheet, View } from 'react-native'
3
3
  import { DenormalizedMessageAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'
4
4
  import { AttachmentCard, AttachmentCardTitle } from './attachment_card'
5
5
  import { Icon } from '../../display'
6
6
  import { useTheme } from '../../../hooks'
7
7
  import { PlatformPressable } from '@react-navigation/elements'
8
8
  import { tokens } from '../../../vendor/tapestry/tokens'
9
+ import { Linking } from '../../../utils'
9
10
 
10
11
  export function GenericFileAttachment({
11
12
  attachment,
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
- import { Linking, StyleSheet } from 'react-native'
2
+ import { StyleSheet } from 'react-native'
3
3
  import { Text, TextInlineButton } from '../display'
4
4
  import { parseSimpleMarkdown } from '../../utils/parse_simple_markdown'
5
+ import { Linking } from '../../utils/native_adapters'
5
6
 
6
7
  interface Props {
7
8
  text: string
@@ -3,6 +3,8 @@ import { AudioAdapter } from './audio'
3
3
  import { ClipboardAdapter } from './clipboard'
4
4
  import { ImagePickerAdapter } from './image_picker'
5
5
  import { VideoAdapter } from './video'
6
+ import { Linking as RNLinking } from 'react-native'
7
+ import { LinkingAdapter } from './linking'
6
8
 
7
9
  type ChatConfigurations = {
8
10
  clipboard: ClipboardAdapter
@@ -10,6 +12,7 @@ type ChatConfigurations = {
10
12
  video: VideoAdapter
11
13
  imagePicker: ImagePickerAdapter
12
14
  log?: LogAdapter
15
+ linking?: LinkingAdapter
13
16
  }
14
17
 
15
18
  export class ChatAdapters {
@@ -19,6 +22,7 @@ export class ChatAdapters {
19
22
  Video = configurations.video
20
23
  ImagePicker = configurations.imagePicker
21
24
  Log = configurations.log || new LogAdapter()
25
+ Linking = configurations.linking || new LinkingAdapter(RNLinking)
22
26
  }
23
27
  }
24
28
 
@@ -63,3 +67,5 @@ export let ImagePicker: ImagePickerAdapter = new ImagePickerAdapter({
63
67
  })
64
68
 
65
69
  export let Log: LogAdapter = new LogAdapter()
70
+
71
+ export let Linking: LinkingAdapter = new LinkingAdapter(RNLinking)
@@ -1,6 +1,7 @@
1
+ export * from './audio'
1
2
  export * from './clipboard'
2
3
  export * from './configuration'
3
- export * from './audio'
4
4
  export * from './image_picker'
5
- export * from './video'
5
+ export * from './linking'
6
6
  export * from './log'
7
+ export * from './video'
@@ -0,0 +1,11 @@
1
+ import { Linking } from 'react-native'
2
+
3
+ export class LinkingAdapter {
4
+ openURL: Linking['openURL']
5
+ canOpenURL: Linking['canOpenURL']
6
+
7
+ constructor(methods: Pick<Linking, 'openURL' | 'canOpenURL'>) {
8
+ this.openURL = methods.openURL
9
+ this.canOpenURL = methods.canOpenURL
10
+ }
11
+ }