stream-chat-react-native-core 4.7.0-beta.3 → 4.7.0-beta.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.
package/README.md CHANGED
@@ -11,6 +11,7 @@
11
11
  [![NPM](https://img.shields.io/npm/v/stream-chat-react-native.svg)](https://www.npmjs.com/package/stream-chat-react-native)
12
12
  [![Build Status](https://github.com/GetStream/stream-chat-react-native/workflows/test/badge.svg?branch=main)](https://github.com/GetStream/stream-chat-react-native/actions)
13
13
  [![Component Reference](https://img.shields.io/badge/docs-component%20reference-blue.svg)](https://getstream.io/chat/docs/sdk/reactnative)
14
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GetStream_stream-chat-react-native&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=GetStream_stream-chat-react-native)
14
15
 
15
16
  <img align="right" src="https://getstream.imgix.net/images/ios-chat-tutorial/iphone_chat_art@3x.png?auto=format,enhance" width="50%" />
16
17
 
@@ -214,13 +214,13 @@ var ReplyWithContext = function ReplyWithContext(props) {
214
214
  lineNumber: 185,
215
215
  columnNumber: 13
216
216
  }
217
- }) : null : null, messageType === 'video' ? _react["default"].createElement(_VideoThumbnail.VideoThumbnail, {
217
+ }) : null : null, messageType === 'video' && !lastAttachment.og_scrape_url ? _react["default"].createElement(_VideoThumbnail.VideoThumbnail, {
218
218
  style: [styles.videoAttachment],
219
219
  __self: _this,
220
220
  __source: {
221
221
  fileName: _jsxFileName,
222
- lineNumber: 206,
223
- columnNumber: 36
222
+ lineNumber: 207,
223
+ columnNumber: 11
224
224
  }
225
225
  }) : null, _react["default"].createElement(_MessageTextContainer.MessageTextContainer, {
226
226
  markdownStyles: quotedMessage.deleted_at ? (0, _merge["default"])({
@@ -242,7 +242,7 @@ var ReplyWithContext = function ReplyWithContext(props) {
242
242
  __self: _this,
243
243
  __source: {
244
244
  fileName: _jsxFileName,
245
- lineNumber: 207,
245
+ lineNumber: 209,
246
246
  columnNumber: 9
247
247
  }
248
248
  })));
@@ -286,7 +286,7 @@ var Reply = function Reply(props) {
286
286
  __self: _this,
287
287
  __source: {
288
288
  fileName: _jsxFileName,
289
- lineNumber: 314,
289
+ lineNumber: 316,
290
290
  columnNumber: 5
291
291
  }
292
292
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["Reply.tsx"],"names":["styles","StyleSheet","create","container","alignItems","flexDirection","fileAttachmentContainer","paddingLeft","paddingVertical","imageAttachment","borderRadius","height","marginLeft","marginVertical","width","messageContainer","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius","flexGrow","flexShrink","text","fontSize","textContainer","maxWidth","undefined","paddingHorizontal","videoAttachment","getMessageType","lastAttachment","messageType","isLastAttachmentFile","type","isLastAttachmentVideo","isLastAttachmentGiphy","isLastAttachmentImageOrGiphy","title_link","og_scrape_url","isLastAttachmentImage","image_url","thumb_url","ReplyWithContext","props","FileAttachmentIcon","attachmentSize","MessageAvatar","quotedMessage","stylesProp","t","error","setError","theme","colors","blue_alice","border","grey","transparent","white","deletedText","messageSimple","content","reply","markdownStyles","attachments","slice","hasImage","onlyEmojis","emojiRegex","test","backgroundColor","borderColor","borderWidth","mime_type","uri","url","deleted_at","em","color","length","title","marginRight","Number","areEqual","prevProps","nextProps","prevQuotedMessage","nextQuotedMessage","quotedMessageEqual","id","MemoizedReply","React","memo","Reply","message","FileIconDefault","MessageAvatarDefault","editing","quotedEditingMessage","quoted_message","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AACA;;AAIA;;AAIA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,UADH;AAETC,IAAAA,aAAa,EAAE;AAFN,GADoB;AAK/BC,EAAAA,uBAAuB,EAAE;AAAEC,IAAAA,WAAW,EAA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, ImageStyle, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport merge from 'lodash/merge';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { useMessageContext } from '../../contexts/messageContext/MessageContext';\nimport {\n MessageInputContextValue,\n useMessageInputContext,\n} from '../../contexts/messageInputContext/MessageInputContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport {\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { getResizedImageUrl } from '../../utils/getResizedImageUrl';\nimport { emojiRegex } from '../../utils/utils';\n\nimport { FileIcon as FileIconDefault } from '../Attachment/FileIcon';\nimport { VideoThumbnail } from '../Attachment/VideoThumbnail';\nimport { MessageAvatar as MessageAvatarDefault } from '../Message/MessageSimple/MessageAvatar';\nimport { MessageTextContainer } from '../Message/MessageSimple/MessageTextContainer';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n },\n fileAttachmentContainer: { paddingLeft: 8, paddingVertical: 8 },\n imageAttachment: {\n borderRadius: 8,\n height: 32,\n marginLeft: 8,\n marginVertical: 8,\n width: 32,\n },\n messageContainer: {\n alignItems: 'flex-start',\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 12,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n flexDirection: 'row',\n flexGrow: 1,\n flexShrink: 1,\n },\n text: { fontSize: 12 },\n textContainer: { maxWidth: undefined, paddingHorizontal: 8 },\n videoAttachment: {\n borderRadius: 8,\n height: 50,\n marginLeft: 8,\n marginVertical: 8,\n width: 50,\n },\n});\n\ntype ReplyPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageInputContextValue<StreamChatGenerics>, 'quotedMessage'> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'FileAttachmentIcon' | 'MessageAvatar'> &\n Pick<TranslationContextValue, 't'> & {\n attachmentSize?: number;\n styles?: Partial<{\n container: ViewStyle;\n fileAttachmentContainer: ViewStyle;\n imageAttachment: ImageStyle;\n messageContainer: ViewStyle;\n textContainer: ViewStyle;\n }>;\n };\n\nconst getMessageType = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n lastAttachment: Attachment<StreamChatGenerics>,\n) => {\n let messageType;\n\n const isLastAttachmentFile = lastAttachment.type === 'file' || lastAttachment.type === 'audio';\n\n const isLastAttachmentVideo = lastAttachment.type === 'video';\n\n const isLastAttachmentGiphy = lastAttachment.type === 'giphy' || lastAttachment.type === 'imgur';\n\n const isLastAttachmentImageOrGiphy =\n lastAttachment.type === 'image' && !lastAttachment.title_link && !lastAttachment.og_scrape_url;\n\n const isLastAttachmentImage = lastAttachment.image_url || lastAttachment.thumb_url;\n\n if (isLastAttachmentFile) {\n messageType = 'file';\n } else if (isLastAttachmentVideo) {\n messageType = 'video';\n } else if (isLastAttachmentImageOrGiphy) {\n if (isLastAttachmentImage) messageType = 'image';\n else messageType = undefined;\n } else if (isLastAttachmentGiphy) messageType = 'giphy';\n else messageType = 'other';\n\n return messageType;\n};\n\nconst ReplyWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n FileAttachmentIcon,\n attachmentSize = 40,\n MessageAvatar,\n quotedMessage,\n styles: stylesProp = {},\n t,\n } = props;\n\n const [error, setError] = useState(false);\n\n const {\n theme: {\n colors: { blue_alice, border, grey, transparent, white },\n messageSimple: {\n content: { deletedText },\n },\n reply: {\n container,\n fileAttachmentContainer,\n imageAttachment,\n markdownStyles,\n messageContainer,\n textContainer,\n },\n },\n } = useTheme();\n\n if (typeof quotedMessage === 'boolean') return null;\n\n const lastAttachment = quotedMessage.attachments?.slice(-1)[0] as Attachment<StreamChatGenerics>;\n const messageType = lastAttachment && getMessageType(lastAttachment);\n\n const hasImage =\n !error &&\n lastAttachment &&\n messageType !== 'file' &&\n (lastAttachment.image_url || lastAttachment.thumb_url || lastAttachment.og_scrape_url);\n\n const onlyEmojis = !lastAttachment && !!quotedMessage.text && emojiRegex.test(quotedMessage.text);\n\n return (\n <View style={[styles.container, container, stylesProp.container]}>\n <MessageAvatar alignment={'left'} lastGroupMessage message={quotedMessage} size={24} />\n <View\n style={[\n styles.messageContainer,\n {\n backgroundColor:\n messageType === 'other' ? blue_alice : messageType === 'giphy' ? transparent : white,\n borderColor: border,\n borderWidth: messageType === 'other' ? 0 : 1,\n },\n messageContainer,\n stylesProp.messageContainer,\n ]}\n >\n {!error && lastAttachment ? (\n messageType === 'file' ? (\n <View\n style={[\n styles.fileAttachmentContainer,\n fileAttachmentContainer,\n stylesProp.fileAttachmentContainer,\n ]}\n >\n <FileAttachmentIcon mimeType={lastAttachment.mime_type} size={attachmentSize} />\n </View>\n ) : hasImage ? (\n <Image\n onError={() => setError(true)}\n source={{\n uri: getResizedImageUrl({\n height:\n stylesProp.imageAttachment?.height ||\n imageAttachment?.height ||\n styles.imageAttachment.height,\n url: (lastAttachment.image_url ||\n lastAttachment.thumb_url ||\n lastAttachment.og_scrape_url) as string,\n width:\n stylesProp.imageAttachment?.width ||\n imageAttachment?.width ||\n styles.imageAttachment.width,\n }),\n }}\n style={[styles.imageAttachment, imageAttachment, stylesProp.imageAttachment]}\n />\n ) : null\n ) : null}\n {messageType === 'video' ? <VideoThumbnail style={[styles.videoAttachment]} /> : null}\n <MessageTextContainer<StreamChatGenerics>\n markdownStyles={\n quotedMessage.deleted_at\n ? merge({ em: { color: grey } }, deletedText)\n : { text: styles.text, ...markdownStyles }\n }\n message={{\n ...quotedMessage,\n text: quotedMessage.deleted_at\n ? `_${t('Message deleted')}_`\n : quotedMessage.text\n ? quotedMessage.text.length > 170\n ? `${quotedMessage.text.slice(0, 170)}...`\n : quotedMessage.text\n : messageType === 'image'\n ? t('Photo')\n : messageType === 'video'\n ? 'Video'\n : messageType === 'file'\n ? lastAttachment?.title || ''\n : '',\n }}\n onlyEmojis={onlyEmojis}\n styles={{\n textContainer: [\n {\n marginRight:\n hasImage || messageType === 'video'\n ? Number(\n stylesProp.imageAttachment?.height ||\n imageAttachment.height ||\n styles.imageAttachment.height,\n ) +\n Number(\n stylesProp.imageAttachment?.marginLeft ||\n imageAttachment.marginLeft ||\n styles.imageAttachment.marginLeft,\n )\n : messageType === 'file'\n ? attachmentSize +\n Number(\n stylesProp.fileAttachmentContainer?.paddingLeft ||\n fileAttachmentContainer.paddingLeft ||\n styles.fileAttachmentContainer.paddingLeft,\n )\n : undefined,\n },\n styles.textContainer,\n textContainer,\n stylesProp.textContainer,\n ],\n }}\n />\n </View>\n </View>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: ReplyPropsWithContext<StreamChatGenerics>,\n nextProps: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const { quotedMessage: prevQuotedMessage } = prevProps;\n const { quotedMessage: nextQuotedMessage } = nextProps;\n\n const quotedMessageEqual =\n !!prevQuotedMessage &&\n !!nextQuotedMessage &&\n typeof prevQuotedMessage !== 'boolean' &&\n typeof nextQuotedMessage !== 'boolean'\n ? prevQuotedMessage.id === nextQuotedMessage.id &&\n prevQuotedMessage.deleted_at === nextQuotedMessage.deleted_at\n : !!prevQuotedMessage === !!nextQuotedMessage;\n\n if (!quotedMessageEqual) return false;\n\n return true;\n};\n\nconst MemoizedReply = React.memo(ReplyWithContext, areEqual) as typeof ReplyWithContext;\n\nexport type ReplyProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<ReplyPropsWithContext<StreamChatGenerics>>;\n\n/**\n * UI Component for reply\n */\nexport const Reply = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyProps<StreamChatGenerics>,\n) => {\n const { message } = useMessageContext<StreamChatGenerics>();\n\n const { FileAttachmentIcon = FileIconDefault, MessageAvatar = MessageAvatarDefault } =\n useMessagesContext<StreamChatGenerics>();\n\n const { editing, quotedMessage } = useMessageInputContext<StreamChatGenerics>();\n\n const quotedEditingMessage = (\n typeof editing !== 'boolean' ? editing?.quoted_message || false : false\n ) as MessageInputContextValue<StreamChatGenerics>['quotedMessage'];\n\n const { t } = useTranslationContext();\n\n return (\n <MemoizedReply\n {...{\n FileAttachmentIcon,\n MessageAvatar,\n quotedMessage: message\n ? (message.quoted_message as MessageInputContextValue<StreamChatGenerics>['quotedMessage'])\n : quotedMessage || quotedEditingMessage,\n t,\n }}\n {...props}\n />\n );\n};\n\nReply.displayName = 'Reply{reply}';\n"]}
1
+ {"version":3,"sources":["Reply.tsx"],"names":["styles","StyleSheet","create","container","alignItems","flexDirection","fileAttachmentContainer","paddingLeft","paddingVertical","imageAttachment","borderRadius","height","marginLeft","marginVertical","width","messageContainer","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius","flexGrow","flexShrink","text","fontSize","textContainer","maxWidth","undefined","paddingHorizontal","videoAttachment","getMessageType","lastAttachment","messageType","isLastAttachmentFile","type","isLastAttachmentVideo","isLastAttachmentGiphy","isLastAttachmentImageOrGiphy","title_link","og_scrape_url","isLastAttachmentImage","image_url","thumb_url","ReplyWithContext","props","FileAttachmentIcon","attachmentSize","MessageAvatar","quotedMessage","stylesProp","t","error","setError","theme","colors","blue_alice","border","grey","transparent","white","deletedText","messageSimple","content","reply","markdownStyles","attachments","slice","hasImage","onlyEmojis","emojiRegex","test","backgroundColor","borderColor","borderWidth","mime_type","uri","url","deleted_at","em","color","length","title","marginRight","Number","areEqual","prevProps","nextProps","prevQuotedMessage","nextQuotedMessage","quotedMessageEqual","id","MemoizedReply","React","memo","Reply","message","FileIconDefault","MessageAvatarDefault","editing","quotedEditingMessage","quoted_message","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;AAC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,kBAFJ;AAGIE,IAAAA,aAAa,EAAbA,aAHJ;AAIIC,IAAAA,aAAa,EAAE+C,OAAO,GACjBA,OAAO,CAACK,cADS,GAElBpD,aAAa,IAAImD,oBANzB;AAOIjD,IAAAA,CAAC,EAADA;AAPJ,KASMN,KATN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAaD,CA/BM;;;AAiCPkD,KAAK,CAACO,WAAN,GAAoB,cAApB","sourcesContent":["import React, { useState } from 'react';\nimport { Image, ImageStyle, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport merge from 'lodash/merge';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { useMessageContext } from '../../contexts/messageContext/MessageContext';\nimport {\n MessageInputContextValue,\n useMessageInputContext,\n} from '../../contexts/messageInputContext/MessageInputContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport {\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { getResizedImageUrl } from '../../utils/getResizedImageUrl';\nimport { emojiRegex } from '../../utils/utils';\n\nimport { FileIcon as FileIconDefault } from '../Attachment/FileIcon';\nimport { VideoThumbnail } from '../Attachment/VideoThumbnail';\nimport { MessageAvatar as MessageAvatarDefault } from '../Message/MessageSimple/MessageAvatar';\nimport { MessageTextContainer } from '../Message/MessageSimple/MessageTextContainer';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n },\n fileAttachmentContainer: { paddingLeft: 8, paddingVertical: 8 },\n imageAttachment: {\n borderRadius: 8,\n height: 32,\n marginLeft: 8,\n marginVertical: 8,\n width: 32,\n },\n messageContainer: {\n alignItems: 'flex-start',\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 12,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n flexDirection: 'row',\n flexGrow: 1,\n flexShrink: 1,\n },\n text: { fontSize: 12 },\n textContainer: { maxWidth: undefined, paddingHorizontal: 8 },\n videoAttachment: {\n borderRadius: 8,\n height: 50,\n marginLeft: 8,\n marginVertical: 8,\n width: 50,\n },\n});\n\ntype ReplyPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageInputContextValue<StreamChatGenerics>, 'quotedMessage'> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'FileAttachmentIcon' | 'MessageAvatar'> &\n Pick<TranslationContextValue, 't'> & {\n attachmentSize?: number;\n styles?: Partial<{\n container: ViewStyle;\n fileAttachmentContainer: ViewStyle;\n imageAttachment: ImageStyle;\n messageContainer: ViewStyle;\n textContainer: ViewStyle;\n }>;\n };\n\nconst getMessageType = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n lastAttachment: Attachment<StreamChatGenerics>,\n) => {\n let messageType;\n\n const isLastAttachmentFile = lastAttachment.type === 'file' || lastAttachment.type === 'audio';\n\n const isLastAttachmentVideo = lastAttachment.type === 'video';\n\n const isLastAttachmentGiphy = lastAttachment.type === 'giphy' || lastAttachment.type === 'imgur';\n\n const isLastAttachmentImageOrGiphy =\n lastAttachment.type === 'image' && !lastAttachment.title_link && !lastAttachment.og_scrape_url;\n\n const isLastAttachmentImage = lastAttachment.image_url || lastAttachment.thumb_url;\n\n if (isLastAttachmentFile) {\n messageType = 'file';\n } else if (isLastAttachmentVideo) {\n messageType = 'video';\n } else if (isLastAttachmentImageOrGiphy) {\n if (isLastAttachmentImage) messageType = 'image';\n else messageType = undefined;\n } else if (isLastAttachmentGiphy) messageType = 'giphy';\n else messageType = 'other';\n\n return messageType;\n};\n\nconst ReplyWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n FileAttachmentIcon,\n attachmentSize = 40,\n MessageAvatar,\n quotedMessage,\n styles: stylesProp = {},\n t,\n } = props;\n\n const [error, setError] = useState(false);\n\n const {\n theme: {\n colors: { blue_alice, border, grey, transparent, white },\n messageSimple: {\n content: { deletedText },\n },\n reply: {\n container,\n fileAttachmentContainer,\n imageAttachment,\n markdownStyles,\n messageContainer,\n textContainer,\n },\n },\n } = useTheme();\n\n if (typeof quotedMessage === 'boolean') return null;\n\n const lastAttachment = quotedMessage.attachments?.slice(-1)[0] as Attachment<StreamChatGenerics>;\n const messageType = lastAttachment && getMessageType(lastAttachment);\n\n const hasImage =\n !error &&\n lastAttachment &&\n messageType !== 'file' &&\n (lastAttachment.image_url || lastAttachment.thumb_url || lastAttachment.og_scrape_url);\n\n const onlyEmojis = !lastAttachment && !!quotedMessage.text && emojiRegex.test(quotedMessage.text);\n\n return (\n <View style={[styles.container, container, stylesProp.container]}>\n <MessageAvatar alignment={'left'} lastGroupMessage message={quotedMessage} size={24} />\n <View\n style={[\n styles.messageContainer,\n {\n backgroundColor:\n messageType === 'other' ? blue_alice : messageType === 'giphy' ? transparent : white,\n borderColor: border,\n borderWidth: messageType === 'other' ? 0 : 1,\n },\n messageContainer,\n stylesProp.messageContainer,\n ]}\n >\n {!error && lastAttachment ? (\n messageType === 'file' ? (\n <View\n style={[\n styles.fileAttachmentContainer,\n fileAttachmentContainer,\n stylesProp.fileAttachmentContainer,\n ]}\n >\n <FileAttachmentIcon mimeType={lastAttachment.mime_type} size={attachmentSize} />\n </View>\n ) : hasImage ? (\n <Image\n onError={() => setError(true)}\n source={{\n uri: getResizedImageUrl({\n height:\n stylesProp.imageAttachment?.height ||\n imageAttachment?.height ||\n styles.imageAttachment.height,\n url: (lastAttachment.image_url ||\n lastAttachment.thumb_url ||\n lastAttachment.og_scrape_url) as string,\n width:\n stylesProp.imageAttachment?.width ||\n imageAttachment?.width ||\n styles.imageAttachment.width,\n }),\n }}\n style={[styles.imageAttachment, imageAttachment, stylesProp.imageAttachment]}\n />\n ) : null\n ) : null}\n {messageType === 'video' && !lastAttachment.og_scrape_url ? (\n <VideoThumbnail style={[styles.videoAttachment]} />\n ) : null}\n <MessageTextContainer<StreamChatGenerics>\n markdownStyles={\n quotedMessage.deleted_at\n ? merge({ em: { color: grey } }, deletedText)\n : { text: styles.text, ...markdownStyles }\n }\n message={{\n ...quotedMessage,\n text: quotedMessage.deleted_at\n ? `_${t('Message deleted')}_`\n : quotedMessage.text\n ? quotedMessage.text.length > 170\n ? `${quotedMessage.text.slice(0, 170)}...`\n : quotedMessage.text\n : messageType === 'image'\n ? t('Photo')\n : messageType === 'video'\n ? 'Video'\n : messageType === 'file'\n ? lastAttachment?.title || ''\n : '',\n }}\n onlyEmojis={onlyEmojis}\n styles={{\n textContainer: [\n {\n marginRight:\n hasImage || messageType === 'video'\n ? Number(\n stylesProp.imageAttachment?.height ||\n imageAttachment.height ||\n styles.imageAttachment.height,\n ) +\n Number(\n stylesProp.imageAttachment?.marginLeft ||\n imageAttachment.marginLeft ||\n styles.imageAttachment.marginLeft,\n )\n : messageType === 'file'\n ? attachmentSize +\n Number(\n stylesProp.fileAttachmentContainer?.paddingLeft ||\n fileAttachmentContainer.paddingLeft ||\n styles.fileAttachmentContainer.paddingLeft,\n )\n : undefined,\n },\n styles.textContainer,\n textContainer,\n stylesProp.textContainer,\n ],\n }}\n />\n </View>\n </View>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: ReplyPropsWithContext<StreamChatGenerics>,\n nextProps: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const { quotedMessage: prevQuotedMessage } = prevProps;\n const { quotedMessage: nextQuotedMessage } = nextProps;\n\n const quotedMessageEqual =\n !!prevQuotedMessage &&\n !!nextQuotedMessage &&\n typeof prevQuotedMessage !== 'boolean' &&\n typeof nextQuotedMessage !== 'boolean'\n ? prevQuotedMessage.id === nextQuotedMessage.id &&\n prevQuotedMessage.deleted_at === nextQuotedMessage.deleted_at\n : !!prevQuotedMessage === !!nextQuotedMessage;\n\n if (!quotedMessageEqual) return false;\n\n return true;\n};\n\nconst MemoizedReply = React.memo(ReplyWithContext, areEqual) as typeof ReplyWithContext;\n\nexport type ReplyProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<ReplyPropsWithContext<StreamChatGenerics>>;\n\n/**\n * UI Component for reply\n */\nexport const Reply = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyProps<StreamChatGenerics>,\n) => {\n const { message } = useMessageContext<StreamChatGenerics>();\n\n const { FileAttachmentIcon = FileIconDefault, MessageAvatar = MessageAvatarDefault } =\n useMessagesContext<StreamChatGenerics>();\n\n const { editing, quotedMessage } = useMessageInputContext<StreamChatGenerics>();\n\n const quotedEditingMessage = (\n typeof editing !== 'boolean' ? editing?.quoted_message || false : false\n ) as MessageInputContextValue<StreamChatGenerics>['quotedMessage'];\n\n const { t } = useTranslationContext();\n\n return (\n <MemoizedReply\n {...{\n FileAttachmentIcon,\n MessageAvatar,\n quotedMessage: message\n ? (message.quoted_message as MessageInputContextValue<StreamChatGenerics>['quotedMessage'])\n : quotedMessage || quotedEditingMessage,\n t,\n }}\n {...props}\n />\n );\n};\n\nReply.displayName = 'Reply{reply}';\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "4.7.0-beta.3"
2
+ "version": "4.7.0-beta.4"
3
3
  }
@@ -214,13 +214,13 @@ var ReplyWithContext = function ReplyWithContext(props) {
214
214
  lineNumber: 185,
215
215
  columnNumber: 13
216
216
  }
217
- }) : null : null, messageType === 'video' ? _react["default"].createElement(_VideoThumbnail.VideoThumbnail, {
217
+ }) : null : null, messageType === 'video' && !lastAttachment.og_scrape_url ? _react["default"].createElement(_VideoThumbnail.VideoThumbnail, {
218
218
  style: [styles.videoAttachment],
219
219
  __self: _this,
220
220
  __source: {
221
221
  fileName: _jsxFileName,
222
- lineNumber: 206,
223
- columnNumber: 36
222
+ lineNumber: 207,
223
+ columnNumber: 11
224
224
  }
225
225
  }) : null, _react["default"].createElement(_MessageTextContainer.MessageTextContainer, {
226
226
  markdownStyles: quotedMessage.deleted_at ? (0, _merge["default"])({
@@ -242,7 +242,7 @@ var ReplyWithContext = function ReplyWithContext(props) {
242
242
  __self: _this,
243
243
  __source: {
244
244
  fileName: _jsxFileName,
245
- lineNumber: 207,
245
+ lineNumber: 209,
246
246
  columnNumber: 9
247
247
  }
248
248
  })));
@@ -286,7 +286,7 @@ var Reply = function Reply(props) {
286
286
  __self: _this,
287
287
  __source: {
288
288
  fileName: _jsxFileName,
289
- lineNumber: 314,
289
+ lineNumber: 316,
290
290
  columnNumber: 5
291
291
  }
292
292
  }));
@@ -1 +1 @@
1
- {"version":3,"sources":["Reply.tsx"],"names":["styles","StyleSheet","create","container","alignItems","flexDirection","fileAttachmentContainer","paddingLeft","paddingVertical","imageAttachment","borderRadius","height","marginLeft","marginVertical","width","messageContainer","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius","flexGrow","flexShrink","text","fontSize","textContainer","maxWidth","undefined","paddingHorizontal","videoAttachment","getMessageType","lastAttachment","messageType","isLastAttachmentFile","type","isLastAttachmentVideo","isLastAttachmentGiphy","isLastAttachmentImageOrGiphy","title_link","og_scrape_url","isLastAttachmentImage","image_url","thumb_url","ReplyWithContext","props","FileAttachmentIcon","attachmentSize","MessageAvatar","quotedMessage","stylesProp","t","error","setError","theme","colors","blue_alice","border","grey","transparent","white","deletedText","messageSimple","content","reply","markdownStyles","attachments","slice","hasImage","onlyEmojis","emojiRegex","test","backgroundColor","borderColor","borderWidth","mime_type","uri","url","deleted_at","em","color","length","title","marginRight","Number","areEqual","prevProps","nextProps","prevQuotedMessage","nextQuotedMessage","quotedMessageEqual","id","MemoizedReply","React","memo","Reply","message","FileIconDefault","MessageAvatarDefault","editing","quotedEditingMessage","quoted_message","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA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bA,aAHJ;AAIIC,IAAAA,aAAa,EAAE+C,OAAO,GACjBA,OAAO,CAACK,cADS,GAElBpD,aAAa,IAAImD,oBANzB;AAOIjD,IAAAA,CAAC,EAADA;AAPJ,KASMN,KATN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAaD,CA/BM;;;AAiCPkD,KAAK,CAACO,WAAN,GAAoB,cAApB","sourcesContent":["import React, { useState } from 'react';\nimport { Image, ImageStyle, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport merge from 'lodash/merge';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { useMessageContext } from '../../contexts/messageContext/MessageContext';\nimport {\n MessageInputContextValue,\n useMessageInputContext,\n} from '../../contexts/messageInputContext/MessageInputContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport {\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { getResizedImageUrl } from '../../utils/getResizedImageUrl';\nimport { emojiRegex } from '../../utils/utils';\n\nimport { FileIcon as FileIconDefault } from '../Attachment/FileIcon';\nimport { VideoThumbnail } from '../Attachment/VideoThumbnail';\nimport { MessageAvatar as MessageAvatarDefault } from '../Message/MessageSimple/MessageAvatar';\nimport { MessageTextContainer } from '../Message/MessageSimple/MessageTextContainer';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n },\n fileAttachmentContainer: { paddingLeft: 8, paddingVertical: 8 },\n imageAttachment: {\n borderRadius: 8,\n height: 32,\n marginLeft: 8,\n marginVertical: 8,\n width: 32,\n },\n messageContainer: {\n alignItems: 'flex-start',\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 12,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n flexDirection: 'row',\n flexGrow: 1,\n flexShrink: 1,\n },\n text: { fontSize: 12 },\n textContainer: { maxWidth: undefined, paddingHorizontal: 8 },\n videoAttachment: {\n borderRadius: 8,\n height: 50,\n marginLeft: 8,\n marginVertical: 8,\n width: 50,\n },\n});\n\ntype ReplyPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageInputContextValue<StreamChatGenerics>, 'quotedMessage'> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'FileAttachmentIcon' | 'MessageAvatar'> &\n Pick<TranslationContextValue, 't'> & {\n attachmentSize?: number;\n styles?: Partial<{\n container: ViewStyle;\n fileAttachmentContainer: ViewStyle;\n imageAttachment: ImageStyle;\n messageContainer: ViewStyle;\n textContainer: ViewStyle;\n }>;\n };\n\nconst getMessageType = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n lastAttachment: Attachment<StreamChatGenerics>,\n) => {\n let messageType;\n\n const isLastAttachmentFile = lastAttachment.type === 'file' || lastAttachment.type === 'audio';\n\n const isLastAttachmentVideo = lastAttachment.type === 'video';\n\n const isLastAttachmentGiphy = lastAttachment.type === 'giphy' || lastAttachment.type === 'imgur';\n\n const isLastAttachmentImageOrGiphy =\n lastAttachment.type === 'image' && !lastAttachment.title_link && !lastAttachment.og_scrape_url;\n\n const isLastAttachmentImage = lastAttachment.image_url || lastAttachment.thumb_url;\n\n if (isLastAttachmentFile) {\n messageType = 'file';\n } else if (isLastAttachmentVideo) {\n messageType = 'video';\n } else if (isLastAttachmentImageOrGiphy) {\n if (isLastAttachmentImage) messageType = 'image';\n else messageType = undefined;\n } else if (isLastAttachmentGiphy) messageType = 'giphy';\n else messageType = 'other';\n\n return messageType;\n};\n\nconst ReplyWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n FileAttachmentIcon,\n attachmentSize = 40,\n MessageAvatar,\n quotedMessage,\n styles: stylesProp = {},\n t,\n } = props;\n\n const [error, setError] = useState(false);\n\n const {\n theme: {\n colors: { blue_alice, border, grey, transparent, white },\n messageSimple: {\n content: { deletedText },\n },\n reply: {\n container,\n fileAttachmentContainer,\n imageAttachment,\n markdownStyles,\n messageContainer,\n textContainer,\n },\n },\n } = useTheme();\n\n if (typeof quotedMessage === 'boolean') return null;\n\n const lastAttachment = quotedMessage.attachments?.slice(-1)[0] as Attachment<StreamChatGenerics>;\n const messageType = lastAttachment && getMessageType(lastAttachment);\n\n const hasImage =\n !error &&\n lastAttachment &&\n messageType !== 'file' &&\n (lastAttachment.image_url || lastAttachment.thumb_url || lastAttachment.og_scrape_url);\n\n const onlyEmojis = !lastAttachment && !!quotedMessage.text && emojiRegex.test(quotedMessage.text);\n\n return (\n <View style={[styles.container, container, stylesProp.container]}>\n <MessageAvatar alignment={'left'} lastGroupMessage message={quotedMessage} size={24} />\n <View\n style={[\n styles.messageContainer,\n {\n backgroundColor:\n messageType === 'other' ? blue_alice : messageType === 'giphy' ? transparent : white,\n borderColor: border,\n borderWidth: messageType === 'other' ? 0 : 1,\n },\n messageContainer,\n stylesProp.messageContainer,\n ]}\n >\n {!error && lastAttachment ? (\n messageType === 'file' ? (\n <View\n style={[\n styles.fileAttachmentContainer,\n fileAttachmentContainer,\n stylesProp.fileAttachmentContainer,\n ]}\n >\n <FileAttachmentIcon mimeType={lastAttachment.mime_type} size={attachmentSize} />\n </View>\n ) : hasImage ? (\n <Image\n onError={() => setError(true)}\n source={{\n uri: getResizedImageUrl({\n height:\n stylesProp.imageAttachment?.height ||\n imageAttachment?.height ||\n styles.imageAttachment.height,\n url: (lastAttachment.image_url ||\n lastAttachment.thumb_url ||\n lastAttachment.og_scrape_url) as string,\n width:\n stylesProp.imageAttachment?.width ||\n imageAttachment?.width ||\n styles.imageAttachment.width,\n }),\n }}\n style={[styles.imageAttachment, imageAttachment, stylesProp.imageAttachment]}\n />\n ) : null\n ) : null}\n {messageType === 'video' ? <VideoThumbnail style={[styles.videoAttachment]} /> : null}\n <MessageTextContainer<StreamChatGenerics>\n markdownStyles={\n quotedMessage.deleted_at\n ? merge({ em: { color: grey } }, deletedText)\n : { text: styles.text, ...markdownStyles }\n }\n message={{\n ...quotedMessage,\n text: quotedMessage.deleted_at\n ? `_${t('Message deleted')}_`\n : quotedMessage.text\n ? quotedMessage.text.length > 170\n ? `${quotedMessage.text.slice(0, 170)}...`\n : quotedMessage.text\n : messageType === 'image'\n ? t('Photo')\n : messageType === 'video'\n ? 'Video'\n : messageType === 'file'\n ? lastAttachment?.title || ''\n : '',\n }}\n onlyEmojis={onlyEmojis}\n styles={{\n textContainer: [\n {\n marginRight:\n hasImage || messageType === 'video'\n ? Number(\n stylesProp.imageAttachment?.height ||\n imageAttachment.height ||\n styles.imageAttachment.height,\n ) +\n Number(\n stylesProp.imageAttachment?.marginLeft ||\n imageAttachment.marginLeft ||\n styles.imageAttachment.marginLeft,\n )\n : messageType === 'file'\n ? attachmentSize +\n Number(\n stylesProp.fileAttachmentContainer?.paddingLeft ||\n fileAttachmentContainer.paddingLeft ||\n styles.fileAttachmentContainer.paddingLeft,\n )\n : undefined,\n },\n styles.textContainer,\n textContainer,\n stylesProp.textContainer,\n ],\n }}\n />\n </View>\n </View>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: ReplyPropsWithContext<StreamChatGenerics>,\n nextProps: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const { quotedMessage: prevQuotedMessage } = prevProps;\n const { quotedMessage: nextQuotedMessage } = nextProps;\n\n const quotedMessageEqual =\n !!prevQuotedMessage &&\n !!nextQuotedMessage &&\n typeof prevQuotedMessage !== 'boolean' &&\n typeof nextQuotedMessage !== 'boolean'\n ? prevQuotedMessage.id === nextQuotedMessage.id &&\n prevQuotedMessage.deleted_at === nextQuotedMessage.deleted_at\n : !!prevQuotedMessage === !!nextQuotedMessage;\n\n if (!quotedMessageEqual) return false;\n\n return true;\n};\n\nconst MemoizedReply = React.memo(ReplyWithContext, areEqual) as typeof ReplyWithContext;\n\nexport type ReplyProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<ReplyPropsWithContext<StreamChatGenerics>>;\n\n/**\n * UI Component for reply\n */\nexport const Reply = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyProps<StreamChatGenerics>,\n) => {\n const { message } = useMessageContext<StreamChatGenerics>();\n\n const { FileAttachmentIcon = FileIconDefault, MessageAvatar = MessageAvatarDefault } =\n useMessagesContext<StreamChatGenerics>();\n\n const { editing, quotedMessage } = useMessageInputContext<StreamChatGenerics>();\n\n const quotedEditingMessage = (\n typeof editing !== 'boolean' ? editing?.quoted_message || false : false\n ) as MessageInputContextValue<StreamChatGenerics>['quotedMessage'];\n\n const { t } = useTranslationContext();\n\n return (\n <MemoizedReply\n {...{\n FileAttachmentIcon,\n MessageAvatar,\n quotedMessage: message\n ? (message.quoted_message as MessageInputContextValue<StreamChatGenerics>['quotedMessage'])\n : quotedMessage || quotedEditingMessage,\n t,\n }}\n {...props}\n />\n );\n};\n\nReply.displayName = 'Reply{reply}';\n"]}
1
+ {"version":3,"sources":["Reply.tsx"],"names":["styles","StyleSheet","create","container","alignItems","flexDirection","fileAttachmentContainer","paddingLeft","paddingVertical","imageAttachment","borderRadius","height","marginLeft","marginVertical","width","messageContainer","borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius","flexGrow","flexShrink","text","fontSize","textContainer","maxWidth","undefined","paddingHorizontal","videoAttachment","getMessageType","lastAttachment","messageType","isLastAttachmentFile","type","isLastAttachmentVideo","isLastAttachmentGiphy","isLastAttachmentImageOrGiphy","title_link","og_scrape_url","isLastAttachmentImage","image_url","thumb_url","ReplyWithContext","props","FileAttachmentIcon","attachmentSize","MessageAvatar","quotedMessage","stylesProp","t","error","setError","theme","colors","blue_alice","border","grey","transparent","white","deletedText","messageSimple","content","reply","markdownStyles","attachments","slice","hasImage","onlyEmojis","emojiRegex","test","backgroundColor","borderColor","borderWidth","mime_type","uri","url","deleted_at","em","color","length","title","marginRight","Number","areEqual","prevProps","nextProps","prevQuotedMessage","nextQuotedMessage","quotedMessageEqual","id","MemoizedReply","React","memo","Reply","message","FileIconDefault","MessageAvatarDefault","editing","quotedEditingMessage","quoted_message","displayName"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AACA;;AAIA;;AAIA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;AAEA,IAAMA,MAAM,GAAGC,wBAAWC,MAAX,CAAkB;AAC/BC,EAAAA,SAAS,EAAE;AACTC,IAAAA,UAAU,EAAE,UADH;AAETC,IAAAA,aAAa,EAAE;AAFN,GADoB;AAK/BC,EAAAA,uBAAuB,EAAE;AAAEC,IAAAA,WAAW,EAAE,CAAf;AAAkBC,IAAAA,eAAe,EAAE;AAAnC,GALM;AAM/BC,EAAAA,eAAe,EAAE;AACfC,IAAAA,YAAY,EAAE,CADC;AAEfC,IAAAA,MAAM,EAAE,EAFO;AAGfC,IAAAA,UAAU,EAAE,CAHG;AAIfC,IAAAA,cAAc,EAAE,CAJD;AAKfC,IAAAA,KAAK,EAAE;AALQ,GANc;AAa/BC,EAAAA,gBAAgB,EAAE;AAChBX,IAAAA,UAAU,EAAE,YADI;AAEhBY,IAAAA,sBAAsB,EAAE,CAFR;AAGhBC,IAAAA,uBAAuB,EAAE,EAHT;AAIhBC,IAAAA,mBAAmB,EAAE,EAJL;AAKhBC,IAAAA,oBAAoB,EAAE,EALN;AAMhBd,IAAAA,aAAa,EAAE,KANC;AAOhBe,IAAAA,QAAQ,EAAE,CAPM;AAQhBC,IAAAA,UAAU,EAAE;AARI,GAba;AAuB/BC,EAAAA,IAAI,EAAE;AAAEC,IAAAA,QAAQ,EAAE;AAAZ,GAvByB;AAwB/BC,EAAAA,aAAa,EAAE;AAAEC,IAAAA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iBlD,aAAjB,yBAAiBA,aAAjB;;AAEA,MAAMmD,oBAAoB,GACxB,OAAOD,OAAP,KAAmB,SAAnB,GAA+B,CAAAA,OAAO,QAAP,YAAAA,OAAO,CAAEE,cAAT,KAA2B,KAA1D,GAAkE,KADpE;;AAIA,8BAAc,gDAAd;AAAA,MAAQlD,CAAR,yBAAQA,CAAR;;AAEA,SACE,gCAAC,aAAD;AAEIL,IAAAA,kBAAkB,EAAlBA,kBAFJ;AAGIE,IAAAA,aAAa,EAAbA,aAHJ;AAIIC,IAAAA,aAAa,EAAE+C,OAAO,GACjBA,OAAO,CAACK,cADS,GAElBpD,aAAa,IAAImD,oBANzB;AAOIjD,IAAAA,CAAC,EAADA;AAPJ,KASMN,KATN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAaD,CA/BM;;;AAiCPkD,KAAK,CAACO,WAAN,GAAoB,cAApB","sourcesContent":["import React, { useState } from 'react';\nimport { Image, ImageStyle, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport merge from 'lodash/merge';\n\nimport type { Attachment } from 'stream-chat';\n\nimport { useMessageContext } from '../../contexts/messageContext/MessageContext';\nimport {\n MessageInputContextValue,\n useMessageInputContext,\n} from '../../contexts/messageInputContext/MessageInputContext';\nimport {\n MessagesContextValue,\n useMessagesContext,\n} from '../../contexts/messagesContext/MessagesContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport {\n TranslationContextValue,\n useTranslationContext,\n} from '../../contexts/translationContext/TranslationContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { getResizedImageUrl } from '../../utils/getResizedImageUrl';\nimport { emojiRegex } from '../../utils/utils';\n\nimport { FileIcon as FileIconDefault } from '../Attachment/FileIcon';\nimport { VideoThumbnail } from '../Attachment/VideoThumbnail';\nimport { MessageAvatar as MessageAvatarDefault } from '../Message/MessageSimple/MessageAvatar';\nimport { MessageTextContainer } from '../Message/MessageSimple/MessageTextContainer';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n },\n fileAttachmentContainer: { paddingLeft: 8, paddingVertical: 8 },\n imageAttachment: {\n borderRadius: 8,\n height: 32,\n marginLeft: 8,\n marginVertical: 8,\n width: 32,\n },\n messageContainer: {\n alignItems: 'flex-start',\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 12,\n borderTopLeftRadius: 12,\n borderTopRightRadius: 12,\n flexDirection: 'row',\n flexGrow: 1,\n flexShrink: 1,\n },\n text: { fontSize: 12 },\n textContainer: { maxWidth: undefined, paddingHorizontal: 8 },\n videoAttachment: {\n borderRadius: 8,\n height: 50,\n marginLeft: 8,\n marginVertical: 8,\n width: 50,\n },\n});\n\ntype ReplyPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<MessageInputContextValue<StreamChatGenerics>, 'quotedMessage'> &\n Pick<MessagesContextValue<StreamChatGenerics>, 'FileAttachmentIcon' | 'MessageAvatar'> &\n Pick<TranslationContextValue, 't'> & {\n attachmentSize?: number;\n styles?: Partial<{\n container: ViewStyle;\n fileAttachmentContainer: ViewStyle;\n imageAttachment: ImageStyle;\n messageContainer: ViewStyle;\n textContainer: ViewStyle;\n }>;\n };\n\nconst getMessageType = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n lastAttachment: Attachment<StreamChatGenerics>,\n) => {\n let messageType;\n\n const isLastAttachmentFile = lastAttachment.type === 'file' || lastAttachment.type === 'audio';\n\n const isLastAttachmentVideo = lastAttachment.type === 'video';\n\n const isLastAttachmentGiphy = lastAttachment.type === 'giphy' || lastAttachment.type === 'imgur';\n\n const isLastAttachmentImageOrGiphy =\n lastAttachment.type === 'image' && !lastAttachment.title_link && !lastAttachment.og_scrape_url;\n\n const isLastAttachmentImage = lastAttachment.image_url || lastAttachment.thumb_url;\n\n if (isLastAttachmentFile) {\n messageType = 'file';\n } else if (isLastAttachmentVideo) {\n messageType = 'video';\n } else if (isLastAttachmentImageOrGiphy) {\n if (isLastAttachmentImage) messageType = 'image';\n else messageType = undefined;\n } else if (isLastAttachmentGiphy) messageType = 'giphy';\n else messageType = 'other';\n\n return messageType;\n};\n\nconst ReplyWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n FileAttachmentIcon,\n attachmentSize = 40,\n MessageAvatar,\n quotedMessage,\n styles: stylesProp = {},\n t,\n } = props;\n\n const [error, setError] = useState(false);\n\n const {\n theme: {\n colors: { blue_alice, border, grey, transparent, white },\n messageSimple: {\n content: { deletedText },\n },\n reply: {\n container,\n fileAttachmentContainer,\n imageAttachment,\n markdownStyles,\n messageContainer,\n textContainer,\n },\n },\n } = useTheme();\n\n if (typeof quotedMessage === 'boolean') return null;\n\n const lastAttachment = quotedMessage.attachments?.slice(-1)[0] as Attachment<StreamChatGenerics>;\n const messageType = lastAttachment && getMessageType(lastAttachment);\n\n const hasImage =\n !error &&\n lastAttachment &&\n messageType !== 'file' &&\n (lastAttachment.image_url || lastAttachment.thumb_url || lastAttachment.og_scrape_url);\n\n const onlyEmojis = !lastAttachment && !!quotedMessage.text && emojiRegex.test(quotedMessage.text);\n\n return (\n <View style={[styles.container, container, stylesProp.container]}>\n <MessageAvatar alignment={'left'} lastGroupMessage message={quotedMessage} size={24} />\n <View\n style={[\n styles.messageContainer,\n {\n backgroundColor:\n messageType === 'other' ? blue_alice : messageType === 'giphy' ? transparent : white,\n borderColor: border,\n borderWidth: messageType === 'other' ? 0 : 1,\n },\n messageContainer,\n stylesProp.messageContainer,\n ]}\n >\n {!error && lastAttachment ? (\n messageType === 'file' ? (\n <View\n style={[\n styles.fileAttachmentContainer,\n fileAttachmentContainer,\n stylesProp.fileAttachmentContainer,\n ]}\n >\n <FileAttachmentIcon mimeType={lastAttachment.mime_type} size={attachmentSize} />\n </View>\n ) : hasImage ? (\n <Image\n onError={() => setError(true)}\n source={{\n uri: getResizedImageUrl({\n height:\n stylesProp.imageAttachment?.height ||\n imageAttachment?.height ||\n styles.imageAttachment.height,\n url: (lastAttachment.image_url ||\n lastAttachment.thumb_url ||\n lastAttachment.og_scrape_url) as string,\n width:\n stylesProp.imageAttachment?.width ||\n imageAttachment?.width ||\n styles.imageAttachment.width,\n }),\n }}\n style={[styles.imageAttachment, imageAttachment, stylesProp.imageAttachment]}\n />\n ) : null\n ) : null}\n {messageType === 'video' && !lastAttachment.og_scrape_url ? (\n <VideoThumbnail style={[styles.videoAttachment]} />\n ) : null}\n <MessageTextContainer<StreamChatGenerics>\n markdownStyles={\n quotedMessage.deleted_at\n ? merge({ em: { color: grey } }, deletedText)\n : { text: styles.text, ...markdownStyles }\n }\n message={{\n ...quotedMessage,\n text: quotedMessage.deleted_at\n ? `_${t('Message deleted')}_`\n : quotedMessage.text\n ? quotedMessage.text.length > 170\n ? `${quotedMessage.text.slice(0, 170)}...`\n : quotedMessage.text\n : messageType === 'image'\n ? t('Photo')\n : messageType === 'video'\n ? 'Video'\n : messageType === 'file'\n ? lastAttachment?.title || ''\n : '',\n }}\n onlyEmojis={onlyEmojis}\n styles={{\n textContainer: [\n {\n marginRight:\n hasImage || messageType === 'video'\n ? Number(\n stylesProp.imageAttachment?.height ||\n imageAttachment.height ||\n styles.imageAttachment.height,\n ) +\n Number(\n stylesProp.imageAttachment?.marginLeft ||\n imageAttachment.marginLeft ||\n styles.imageAttachment.marginLeft,\n )\n : messageType === 'file'\n ? attachmentSize +\n Number(\n stylesProp.fileAttachmentContainer?.paddingLeft ||\n fileAttachmentContainer.paddingLeft ||\n styles.fileAttachmentContainer.paddingLeft,\n )\n : undefined,\n },\n styles.textContainer,\n textContainer,\n stylesProp.textContainer,\n ],\n }}\n />\n </View>\n </View>\n );\n};\n\nconst areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(\n prevProps: ReplyPropsWithContext<StreamChatGenerics>,\n nextProps: ReplyPropsWithContext<StreamChatGenerics>,\n) => {\n const { quotedMessage: prevQuotedMessage } = prevProps;\n const { quotedMessage: nextQuotedMessage } = nextProps;\n\n const quotedMessageEqual =\n !!prevQuotedMessage &&\n !!nextQuotedMessage &&\n typeof prevQuotedMessage !== 'boolean' &&\n typeof nextQuotedMessage !== 'boolean'\n ? prevQuotedMessage.id === nextQuotedMessage.id &&\n prevQuotedMessage.deleted_at === nextQuotedMessage.deleted_at\n : !!prevQuotedMessage === !!nextQuotedMessage;\n\n if (!quotedMessageEqual) return false;\n\n return true;\n};\n\nconst MemoizedReply = React.memo(ReplyWithContext, areEqual) as typeof ReplyWithContext;\n\nexport type ReplyProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<ReplyPropsWithContext<StreamChatGenerics>>;\n\n/**\n * UI Component for reply\n */\nexport const Reply = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ReplyProps<StreamChatGenerics>,\n) => {\n const { message } = useMessageContext<StreamChatGenerics>();\n\n const { FileAttachmentIcon = FileIconDefault, MessageAvatar = MessageAvatarDefault } =\n useMessagesContext<StreamChatGenerics>();\n\n const { editing, quotedMessage } = useMessageInputContext<StreamChatGenerics>();\n\n const quotedEditingMessage = (\n typeof editing !== 'boolean' ? editing?.quoted_message || false : false\n ) as MessageInputContextValue<StreamChatGenerics>['quotedMessage'];\n\n const { t } = useTranslationContext();\n\n return (\n <MemoizedReply\n {...{\n FileAttachmentIcon,\n MessageAvatar,\n quotedMessage: message\n ? (message.quoted_message as MessageInputContextValue<StreamChatGenerics>['quotedMessage'])\n : quotedMessage || quotedEditingMessage,\n t,\n }}\n {...props}\n />\n );\n};\n\nReply.displayName = 'Reply{reply}';\n"]}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "4.7.0-beta.3"
2
+ "version": "4.7.0-beta.4"
3
3
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native-core",
3
3
  "description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4
- "version": "4.7.0-beta.3",
4
+ "version": "4.7.0-beta.4",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -34,7 +34,7 @@
34
34
  "prepare-distribution": "cd examples/SampleApp && npm version patch && react-native-version && git add ./ && git commit -m 'Bump build version' --no-verify",
35
35
  "prettier": "prettier --list-different '**/*.{js,ts,tsx,md,json}' .eslintrc.json ../.prettierrc .babelrc",
36
36
  "prettier-fix": "prettier --write '**/*.{js,ts,tsx,md,json}' .eslintrc.json ../.prettierrc .babelrc",
37
- "test:unit": "TZ=UTC jest",
37
+ "test:unit": "TZ=UTC jest --coverage",
38
38
  "validate-translations": "node bin/validate-translations.js",
39
39
  "get-version": "echo $npm_package_version",
40
40
  "version": "bash ./bin/before-tag.sh",
@@ -203,7 +203,9 @@ const ReplyWithContext = <
203
203
  />
204
204
  ) : null
205
205
  ) : null}
206
- {messageType === 'video' ? <VideoThumbnail style={[styles.videoAttachment]} /> : null}
206
+ {messageType === 'video' && !lastAttachment.og_scrape_url ? (
207
+ <VideoThumbnail style={[styles.videoAttachment]} />
208
+ ) : null}
207
209
  <MessageTextContainer<StreamChatGenerics>
208
210
  markdownStyles={
209
211
  quotedMessage.deleted_at
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "4.7.0-beta.3"
2
+ "version": "4.7.0-beta.4"
3
3
  }