stream-chat-react-native-core 5.4.0-beta.5 → 5.4.0
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/lib/commonjs/components/Channel/Channel.js +15 -13
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +4 -2
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Channel/Channel.js +15 -13
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +4 -2
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +1 -1
- package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts +1 -2
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Channel/Channel.tsx +3 -0
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +2 -0
- package/src/components/MessageList/hooks/useMessageList.ts +4 -3
- package/src/contexts/messagesContext/MessagesContext.tsx +2 -0
- package/src/version.json +1 -1
|
@@ -27,6 +27,7 @@ var useCreateMessagesContext = function useCreateMessagesContext(_ref) {
|
|
|
27
27
|
forceAlignMessages = _ref.forceAlignMessages,
|
|
28
28
|
formatDate = _ref.formatDate,
|
|
29
29
|
Gallery = _ref.Gallery,
|
|
30
|
+
getMessagesGroupStyles = _ref.getMessagesGroupStyles,
|
|
30
31
|
Giphy = _ref.Giphy,
|
|
31
32
|
giphyVersion = _ref.giphyVersion,
|
|
32
33
|
handleBlock = _ref.handleBlock,
|
|
@@ -110,6 +111,7 @@ var useCreateMessagesContext = function useCreateMessagesContext(_ref) {
|
|
|
110
111
|
forceAlignMessages: forceAlignMessages,
|
|
111
112
|
formatDate: formatDate,
|
|
112
113
|
Gallery: Gallery,
|
|
114
|
+
getMessagesGroupStyles: getMessagesGroupStyles,
|
|
113
115
|
Giphy: Giphy,
|
|
114
116
|
giphyVersion: giphyVersion,
|
|
115
117
|
handleBlock: handleBlock,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCreateMessagesContext.ts"],"names":["useCreateMessagesContext","additionalTouchableProps","Attachment","AttachmentActions","AudioAttachment","Card","CardCover","CardFooter","CardHeader","channelId","DateHeader","deletedMessagesVisibilityType","disableTypingIndicator","dismissKeyboardOnMessageTouch","enableMessageGroupingByUser","FileAttachment","FileAttachmentGroup","FileAttachmentIcon","FlatList","forceAlignMessages","formatDate","Gallery","Giphy","giphyVersion","handleBlock","handleCopy","handleDelete","handleEdit","handleFlag","handleMute","handlePinMessage","handleQuotedReply","handleReaction","handleRetry","handleThreadReply","ImageLoadingFailedIndicator","ImageLoadingIndicator","initialScrollToFirstUnreadMessage","InlineDateSeparator","InlineUnreadIndicator","isAttachmentEqual","legacyImageViewerSwipeBehaviour","markdownRules","Message","messageActions","MessageAvatar","MessageContent","messageContentOrder","MessageDeleted","MessageFooter","MessageHeader","MessageList","MessagePinnedHeader","MessageReplies","MessageRepliesAvatars","MessageSimple","MessageStatus","MessageSystem","MessageText","myMessageTheme","onLongPressMessage","onPressInMessage","onPressMessage","OverlayReactionList","ReactionList","removeMessage","Reply","retrySendMessage","ScrollToBottomButton","selectReaction","setEditingState","setQuotedMessageState","supportedReactions","targetedMessage","TypingIndicator","TypingIndicatorContainer","updateMessage","UrlPreview","VideoThumbnail","additionalTouchablePropsLength","Object","keys","length","markdownRulesLength","messageContentOrderValue","join","supportedReactionsLength","messagesContext"],"mappings":";;;;;AAAA;;AAKO,IAAMA,wBAAwB,GAAG,SAA3BA,wBAA2B,OAsFlC;AAAA,MAnFJC,wBAmFI,QAnFJA,wBAmFI;AAAA,MAlFJC,UAkFI,QAlFJA,UAkFI;AAAA,MAjFJC,iBAiFI,QAjFJA,iBAiFI;AAAA,MAhFJC,eAgFI,QAhFJA,eAgFI;AAAA,MA/EJC,IA+EI,QA/EJA,IA+EI;AAAA,MA9EJC,SA8EI,QA9EJA,SA8EI;AAAA,MA7EJC,UA6EI,QA7EJA,UA6EI;AAAA,MA5EJC,UA4EI,QA5EJA,UA4EI;AAAA,MA3EJC,SA2EI,QA3EJA,SA2EI;AAAA,MA1EJC,UA0EI,QA1EJA,UA0EI;AAAA,MAzEJC,6BAyEI,QAzEJA,6BAyEI;AAAA,MAxEJC,sBAwEI,QAxEJA,sBAwEI;AAAA,MAvEJC,6BAuEI,QAvEJA,6BAuEI;AAAA,MAtEJC,2BAsEI,QAtEJA,2BAsEI;AAAA,MArEJC,cAqEI,QArEJA,cAqEI;AAAA,MApEJC,mBAoEI,QApEJA,mBAoEI;AAAA,MAnEJC,kBAmEI,QAnEJA,kBAmEI;AAAA,MAlEJC,QAkEI,QAlEJA,QAkEI;AAAA,MAjEJC,kBAiEI,QAjEJA,kBAiEI;AAAA,MAhEJC,UAgEI,QAhEJA,UAgEI;AAAA,MA/DJC,OA+DI,QA/DJA,OA+DI;AAAA,MA9DJC,KA8DI,QA9DJA,KA8DI;AAAA,MA7DJC,YA6DI,QA7DJA,YA6DI;AAAA,MA5DJC,WA4DI,QA5DJA,WA4DI;AAAA,MA3DJC,UA2DI,QA3D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AwELC,MAAAA,eAAe,EAAfA,eAxEK;AAyELC,MAAAA,eAAe,EAAfA,eAzEK;AA0ELC,MAAAA,wBAAwB,EAAxBA,wBA1EK;AA2ELC,MAAAA,aAAa,EAAbA,aA3EK;AA4ELC,MAAAA,UAAU,EAAVA,UA5EK;AA6ELC,MAAAA,cAAc,EAAdA;AA7EK,KAAP;AAAA,GADgE,EAgFhE,CACEC,8BADF,EAEEtE,SAFF,EAGEG,sBAHF,EAIEC,6BAJF,EAKEwB,iCALF,EAME8C,mBANF,EAOEC,wBAPF,EAQEE,wBARF,EASEb,eATF,CAhFgE,CAAlE;AA6FA,SAAOc,eAAP;AACD,CA1LM","sourcesContent":["import { useMemo } from 'react';\n\nimport type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateMessagesContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n additionalTouchableProps,\n Attachment,\n AttachmentActions,\n AudioAttachment,\n Card,\n CardCover,\n CardFooter,\n CardHeader,\n channelId,\n DateHeader,\n deletedMessagesVisibilityType,\n disableTypingIndicator,\n dismissKeyboardOnMessageTouch,\n enableMessageGroupingByUser,\n FileAttachment,\n FileAttachmentGroup,\n FileAttachmentIcon,\n FlatList,\n forceAlignMessages,\n formatDate,\n Gallery,\n Giphy,\n giphyVersion,\n handleBlock,\n handleCopy,\n handleDelete,\n handleEdit,\n handleFlag,\n handleMute,\n handlePinMessage,\n handleQuotedReply,\n handleReaction,\n handleRetry,\n handleThreadReply,\n ImageLoadingFailedIndicator,\n ImageLoadingIndicator,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isAttachmentEqual,\n legacyImageViewerSwipeBehaviour,\n markdownRules,\n Message,\n messageActions,\n MessageAvatar,\n MessageContent,\n messageContentOrder,\n MessageDeleted,\n MessageFooter,\n MessageHeader,\n MessageList,\n MessagePinnedHeader,\n MessageReplies,\n MessageRepliesAvatars,\n MessageSimple,\n MessageStatus,\n MessageSystem,\n MessageText,\n myMessageTheme,\n onLongPressMessage,\n onPressInMessage,\n onPressMessage,\n OverlayReactionList,\n ReactionList,\n removeMessage,\n Reply,\n retrySendMessage,\n ScrollToBottomButton,\n selectReaction,\n setEditingState,\n setQuotedMessageState,\n supportedReactions,\n targetedMessage,\n TypingIndicator,\n TypingIndicatorContainer,\n updateMessage,\n UrlPreview,\n VideoThumbnail,\n}: MessagesContextValue<StreamChatGenerics> & {\n /**\n * To ensure we allow re-render, when channel is changed\n */\n channelId?: string;\n}) => {\n const additionalTouchablePropsLength = Object.keys(additionalTouchableProps || {}).length;\n const markdownRulesLength = Object.keys(markdownRules || {}).length;\n const messageContentOrderValue = messageContentOrder.join();\n const supportedReactionsLength = supportedReactions.length;\n\n const messagesContext: MessagesContextValue<StreamChatGenerics> = useMemo(\n () => ({\n additionalTouchableProps,\n Attachment,\n AttachmentActions,\n AudioAttachment,\n Card,\n CardCover,\n CardFooter,\n CardHeader,\n DateHeader,\n deletedMessagesVisibilityType,\n disableTypingIndicator,\n dismissKeyboardOnMessageTouch,\n enableMessageGroupingByUser,\n FileAttachment,\n FileAttachmentGroup,\n FileAttachmentIcon,\n FlatList,\n forceAlignMessages,\n formatDate,\n Gallery,\n Giphy,\n giphyVersion,\n handleBlock,\n handleCopy,\n handleDelete,\n handleEdit,\n handleFlag,\n handleMute,\n handlePinMessage,\n handleQuotedReply,\n handleReaction,\n handleRetry,\n handleThreadReply,\n ImageLoadingFailedIndicator,\n ImageLoadingIndicator,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isAttachmentEqual,\n legacyImageViewerSwipeBehaviour,\n markdownRules,\n Message,\n messageActions,\n MessageAvatar,\n MessageContent,\n messageContentOrder,\n MessageDeleted,\n MessageFooter,\n MessageHeader,\n MessageList,\n MessagePinnedHeader,\n MessageReplies,\n MessageRepliesAvatars,\n MessageSimple,\n MessageStatus,\n MessageSystem,\n MessageText,\n myMessageTheme,\n onLongPressMessage,\n onPressInMessage,\n onPressMessage,\n OverlayReactionList,\n ReactionList,\n removeMessage,\n Reply,\n retrySendMessage,\n ScrollToBottomButton,\n selectReaction,\n setEditingState,\n setQuotedMessageState,\n supportedReactions,\n targetedMessage,\n TypingIndicator,\n TypingIndicatorContainer,\n updateMessage,\n UrlPreview,\n VideoThumbnail,\n }),\n [\n additionalTouchablePropsLength,\n channelId,\n disableTypingIndicator,\n dismissKeyboardOnMessageTouch,\n initialScrollToFirstUnreadMessage,\n markdownRulesLength,\n messageContentOrderValue,\n supportedReactionsLength,\n targetedMessage,\n ],\n );\n\n return messagesContext;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["useCreateMessagesContext.ts"],"names":["useCreateMessagesContext","additionalTouchableProps","Attachment","AttachmentActions","AudioAttachment","Card","CardCover","CardFooter","CardHeader","channelId","DateHeader","deletedMessagesVisibilityType","disableTypingIndicator","dismissKeyboardOnMessageTouch","enableMessageGroupingByUser","FileAttachment","FileAttachmentGroup","FileAttachmentIcon","FlatList","forceAlignMessages","formatDate","Gallery","getMessagesGroupStyles","Giphy","giphyVersion","handleBlock","handleCopy","handleDelete","handleEdit","handleFlag","handleMute","handlePinMessage","handleQuotedReply","handleReaction","handleRetry","handleThreadReply","ImageLoadingFailedIndicator","ImageLoadingIndicator","initialScrollToFirstUnreadMessage","InlineDateSeparator","InlineUnreadIndicator","isAttachmentEqual","legacyImageViewerSwipeBehaviour","markdownRules","Message","messageActions","MessageAvatar","MessageContent","messageContentOrder","MessageDeleted","MessageFooter","MessageHeader","MessageList","MessagePinnedHeader","MessageReplies","MessageRepliesAvatars","MessageSimple","MessageStatus","MessageSystem","MessageText","myMessageTheme","onLongPressMessage","onPressInMessage","onPressMessage","OverlayReactionList","ReactionList","removeMessage","Reply","retrySendMessage","ScrollToBottomButton","selectReaction","setEditingState","setQuotedMessageState","supportedReactions","targetedMessage","TypingIndicator","TypingIndicatorContainer","updateMessage","UrlPreview","VideoThumbnail","additionalTouchablePropsLength","Object","keys","length","markdownRulesLength","messageContentOrderValue","join","supportedReactionsLength","messagesContext"],"mappings":";;;;;AAAA;;AAKO,IAAMA,wBAAwB,GAAG,SAA3BA,wBAA2B,OAuFlC;AAAA,MApFJC,wBAoFI,QApFJA,wBAoFI;AAAA,MAnFJC,UAmFI,QAnFJA,UAmFI;AAAA,MAlFJC,iBAkFI,QAlFJA,iBAkFI;AAAA,MAjFJC,eAiFI,QAjFJA,eAiFI;AAAA,MAhFJC,IAgFI,QAhFJA,IAgFI;AAAA,MA/EJC,SA+EI,QA/EJA,SA+EI;AAAA,MA9EJC,UA8EI,QA9EJA,UA8EI;AAAA,MA7EJC,UA6EI,QA7EJA,UA6EI;AAAA,MA5EJC,SA4EI,QA5EJA,SA4EI;AAAA,MA3EJC,UA2EI,QA3EJA,UA2EI;AAAA,MA1EJC,6BA0EI,QA1EJA,6BA0EI;AAAA,MAzEJC,sBAyEI,QAzEJA,sBAyEI;AAAA,MAxEJC,6BAwEI,QAxEJA,6BAwEI;AAAA,MAvEJC,2BAuEI,QAvEJA,2BAuEI;AAAA,MAtEJC,cAsEI,QAtEJA,cAsEI;AAAA,MArEJC,mBAqEI,QArEJA,mBAqEI;AAAA,MApEJC,kBAoEI,QApEJA,kBAoEI;AAAA,MAnEJC,QAmEI,QAnEJA,QAmEI;AAAA,MAlEJC,kBAkEI,QAlEJA,kBAkEI;AAAA,MAjEJC,UAiEI,QAjEJA,UAiEI;AAAA,MAhEJC,OAgEI,QAhEJA,OAgEI;AAAA,MA/DJC,sBA+DI,QA/DJA,sBA+DI;AAAA,MA9DJC,KA8DI,QA9DJA,KA8DI;AAAA,MA7DJC,YA6DI,QA7DJA,YA6DI;AAAA,MA5DJC,WA4DI,QA5DJA,WA4DI;AAAA,MA3DJC,UA2DI,QA3DJA,UA2DI;AAAA,MA1DJC,YA0DI,QA1DJA,YA0DI;AAAA,MAzDJC,UAyDI,QAzDJA,UAyDI;AAAA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AAe,EAAfA,eA1EK;AA2ELC,MAAAA,wBAAwB,EAAxBA,wBA3EK;AA4ELC,MAAAA,aAAa,EAAbA,aA5EK;AA6ELC,MAAAA,UAAU,EAAVA,UA7EK;AA8ELC,MAAAA,cAAc,EAAdA;AA9EK,KAAP;AAAA,GADgE,EAiFhE,CACEC,8BADF,EAEEvE,SAFF,EAGEG,sBAHF,EAIEC,6BAJF,EAKEyB,iCALF,EAME8C,mBANF,EAOEC,wBAPF,EAQEE,wBARF,EASEb,eATF,CAjFgE,CAAlE;AA8FA,SAAOc,eAAP;AACD,CA5LM","sourcesContent":["import { useMemo } from 'react';\n\nimport type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateMessagesContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n additionalTouchableProps,\n Attachment,\n AttachmentActions,\n AudioAttachment,\n Card,\n CardCover,\n CardFooter,\n CardHeader,\n channelId,\n DateHeader,\n deletedMessagesVisibilityType,\n disableTypingIndicator,\n dismissKeyboardOnMessageTouch,\n enableMessageGroupingByUser,\n FileAttachment,\n FileAttachmentGroup,\n FileAttachmentIcon,\n FlatList,\n forceAlignMessages,\n formatDate,\n Gallery,\n getMessagesGroupStyles,\n Giphy,\n giphyVersion,\n handleBlock,\n handleCopy,\n handleDelete,\n handleEdit,\n handleFlag,\n handleMute,\n handlePinMessage,\n handleQuotedReply,\n handleReaction,\n handleRetry,\n handleThreadReply,\n ImageLoadingFailedIndicator,\n ImageLoadingIndicator,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isAttachmentEqual,\n legacyImageViewerSwipeBehaviour,\n markdownRules,\n Message,\n messageActions,\n MessageAvatar,\n MessageContent,\n messageContentOrder,\n MessageDeleted,\n MessageFooter,\n MessageHeader,\n MessageList,\n MessagePinnedHeader,\n MessageReplies,\n MessageRepliesAvatars,\n MessageSimple,\n MessageStatus,\n MessageSystem,\n MessageText,\n myMessageTheme,\n onLongPressMessage,\n onPressInMessage,\n onPressMessage,\n OverlayReactionList,\n ReactionList,\n removeMessage,\n Reply,\n retrySendMessage,\n ScrollToBottomButton,\n selectReaction,\n setEditingState,\n setQuotedMessageState,\n supportedReactions,\n targetedMessage,\n TypingIndicator,\n TypingIndicatorContainer,\n updateMessage,\n UrlPreview,\n VideoThumbnail,\n}: MessagesContextValue<StreamChatGenerics> & {\n /**\n * To ensure we allow re-render, when channel is changed\n */\n channelId?: string;\n}) => {\n const additionalTouchablePropsLength = Object.keys(additionalTouchableProps || {}).length;\n const markdownRulesLength = Object.keys(markdownRules || {}).length;\n const messageContentOrderValue = messageContentOrder.join();\n const supportedReactionsLength = supportedReactions.length;\n\n const messagesContext: MessagesContextValue<StreamChatGenerics> = useMemo(\n () => ({\n additionalTouchableProps,\n Attachment,\n AttachmentActions,\n AudioAttachment,\n Card,\n CardCover,\n CardFooter,\n CardHeader,\n DateHeader,\n deletedMessagesVisibilityType,\n disableTypingIndicator,\n dismissKeyboardOnMessageTouch,\n enableMessageGroupingByUser,\n FileAttachment,\n FileAttachmentGroup,\n FileAttachmentIcon,\n FlatList,\n forceAlignMessages,\n formatDate,\n Gallery,\n getMessagesGroupStyles,\n Giphy,\n giphyVersion,\n handleBlock,\n handleCopy,\n handleDelete,\n handleEdit,\n handleFlag,\n handleMute,\n handlePinMessage,\n handleQuotedReply,\n handleReaction,\n handleRetry,\n handleThreadReply,\n ImageLoadingFailedIndicator,\n ImageLoadingIndicator,\n initialScrollToFirstUnreadMessage,\n InlineDateSeparator,\n InlineUnreadIndicator,\n isAttachmentEqual,\n legacyImageViewerSwipeBehaviour,\n markdownRules,\n Message,\n messageActions,\n MessageAvatar,\n MessageContent,\n messageContentOrder,\n MessageDeleted,\n MessageFooter,\n MessageHeader,\n MessageList,\n MessagePinnedHeader,\n MessageReplies,\n MessageRepliesAvatars,\n MessageSimple,\n MessageStatus,\n MessageSystem,\n MessageText,\n myMessageTheme,\n onLongPressMessage,\n onPressInMessage,\n onPressMessage,\n OverlayReactionList,\n ReactionList,\n removeMessage,\n Reply,\n retrySendMessage,\n ScrollToBottomButton,\n selectReaction,\n setEditingState,\n setQuotedMessageState,\n supportedReactions,\n targetedMessage,\n TypingIndicator,\n TypingIndicatorContainer,\n updateMessage,\n UrlPreview,\n VideoThumbnail,\n }),\n [\n additionalTouchablePropsLength,\n channelId,\n disableTypingIndicator,\n dismissKeyboardOnMessageTouch,\n initialScrollToFirstUnreadMessage,\n markdownRulesLength,\n messageContentOrderValue,\n supportedReactionsLength,\n targetedMessage,\n ],\n );\n\n return messagesContext;\n};\n"]}
|
|
@@ -43,7 +43,9 @@ var useMessageList = function useMessageList(params) {
|
|
|
43
43
|
read = _useChannelContext.read;
|
|
44
44
|
|
|
45
45
|
var _useMessagesContext = (0, _MessagesContext.useMessagesContext)(),
|
|
46
|
-
deletedMessagesVisibilityType = _useMessagesContext.deletedMessagesVisibilityType
|
|
46
|
+
deletedMessagesVisibilityType = _useMessagesContext.deletedMessagesVisibilityType,
|
|
47
|
+
_useMessagesContext$g = _useMessagesContext.getMessagesGroupStyles,
|
|
48
|
+
getMessagesGroupStyles = _useMessagesContext$g === void 0 ? _getGroupStyles.getGroupStyles : _useMessagesContext$g;
|
|
47
49
|
|
|
48
50
|
var _usePaginatedMessageL = (0, _PaginatedMessageListContext.usePaginatedMessageListContext)(),
|
|
49
51
|
messages = _usePaginatedMessageL.messages;
|
|
@@ -59,7 +61,7 @@ var useMessageList = function useMessageList(params) {
|
|
|
59
61
|
messages: messageList,
|
|
60
62
|
userId: client.userID
|
|
61
63
|
});
|
|
62
|
-
var messageGroupStyles = (
|
|
64
|
+
var messageGroupStyles = getMessagesGroupStyles({
|
|
63
65
|
dateSeparators: dateSeparators,
|
|
64
66
|
hideDateSeparators: hideDateSeparators,
|
|
65
67
|
maxTimeBetweenGroupedMessages: maxTimeBetweenGroupedMessages,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useMessageList.ts"],"names":["isMessageWithStylesReadByAndDateSeparator","message","readBy","undefined","useMessageList","params","inverted","noGroupByUser","threadList","client","hideDateSeparators","maxTimeBetweenGroupedMessages","read","deletedMessagesVisibilityType","messages","threadMessages","messageList","readList","dateSeparators","userId","userID","messageGroupStyles","readData","messagesWithStylesReadByAndDateSeparator","filter","msg","isMessageTypeDeleted","type","user","id","map","dateSeparator","groupStyles","reverse"],"mappings":";;;;;;;;;AAEA;;AAIA;;AACA;;AAIA;;AACA;;AAEA;;AACA;;AACA;;AA0BO,IAAMA,yCAAyC,GAAG,SAA5CA,yCAA4C,CAGvDC,OAHuD;AAAA,SAKtDA,OAAD,CAA0EC,MAA1E,KAAqFC,SAL9B;AAAA,CAAlD;;;;AAOA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAG5BC,MAH4B,EAIzB;AACH,MAAQC,QAAR,GAAgDD,MAAhD,CAAQC,QAAR;AAAA,MAAkBC,aAAlB,GAAgDF,MAAhD,CAAkBE,aAAlB;AAAA,MAAiCC,UAAjC,GAAgDH,MAAhD,CAAiCG,UAAjC;;AACA,wBAAmB,kCAAnB;AAAA,MAAQC,MAAR,mBAAQA,MAAR;;AACA,2BACE,wCADF;AAAA,MAAQC,kBAAR,sBAAQA,kBAAR;AAAA,MAA4BC,6BAA5B,sBAA4BA,6BAA5B;AAAA,MAA2DC,IAA3D,sBAA2DA,IAA3D;;AAEA,
|
|
1
|
+
{"version":3,"sources":["useMessageList.ts"],"names":["isMessageWithStylesReadByAndDateSeparator","message","readBy","undefined","useMessageList","params","inverted","noGroupByUser","threadList","client","hideDateSeparators","maxTimeBetweenGroupedMessages","read","deletedMessagesVisibilityType","getMessagesGroupStyles","getGroupStyles","messages","threadMessages","messageList","readList","dateSeparators","userId","userID","messageGroupStyles","readData","messagesWithStylesReadByAndDateSeparator","filter","msg","isMessageTypeDeleted","type","user","id","map","dateSeparator","groupStyles","reverse"],"mappings":";;;;;;;;;AA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B,GAAqC;AAJ1C;AAAA,GAb0C,CAAjD;AAoBA,SACEzB,QAAQ,GACJmB,wCAAwC,CAACU,OAAzC,EADI,GAEJV,wCAHN;AAKD,CA9DM","sourcesContent":["import type { ChannelState, MessageResponse } from 'stream-chat';\n\nimport {\n ChannelContextValue,\n useChannelContext,\n} from '../../../contexts/channelContext/ChannelContext';\nimport { useChatContext } from '../../../contexts/chatContext/ChatContext';\nimport {\n DeletedMessagesVisibilityType,\n useMessagesContext,\n} from '../../../contexts/messagesContext/MessagesContext';\nimport { usePaginatedMessageListContext } from '../../../contexts/paginatedMessageListContext/PaginatedMessageListContext';\nimport { useThreadContext } from '../../../contexts/threadContext/ThreadContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\nimport { getDateSeparators } from '../utils/getDateSeparators';\nimport { getGroupStyles } from '../utils/getGroupStyles';\nimport { getReadStates } from '../utils/getReadStates';\n\nexport type UseMessageListParams = {\n deletedMessagesVisibilityType?: DeletedMessagesVisibilityType;\n inverted?: boolean;\n noGroupByUser?: boolean;\n threadList?: boolean;\n};\n\nexport type GroupType = string;\n\nexport type MessagesWithStylesReadByAndDateSeparator<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = MessageResponse<StreamChatGenerics> & {\n groupStyles: GroupType[];\n readBy: boolean | number;\n dateSeparator?: Date;\n};\n\nexport type MessageType<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> =\n | ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>\n | MessagesWithStylesReadByAndDateSeparator<StreamChatGenerics>;\n\n// Type guards to check MessageType\nexport const isMessageWithStylesReadByAndDateSeparator = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n message: MessageType<StreamChatGenerics>,\n): message is MessagesWithStylesReadByAndDateSeparator<StreamChatGenerics> =>\n (message as MessagesWithStylesReadByAndDateSeparator<StreamChatGenerics>).readBy !== undefined;\n\nexport const useMessageList = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n params: UseMessageListParams,\n) => {\n const { inverted, noGroupByUser, threadList } = params;\n const { client } = useChatContext<StreamChatGenerics>();\n const { hideDateSeparators, maxTimeBetweenGroupedMessages, read } =\n useChannelContext<StreamChatGenerics>();\n const { deletedMessagesVisibilityType, getMessagesGroupStyles = getGroupStyles } =\n useMessagesContext<StreamChatGenerics>();\n const { messages } = usePaginatedMessageListContext<StreamChatGenerics>();\n const { threadMessages } = useThreadContext<StreamChatGenerics>();\n\n const messageList = threadList ? threadMessages : messages;\n const readList: ChannelContextValue<StreamChatGenerics>['read'] | undefined = threadList\n ? undefined\n : read;\n\n const dateSeparators = getDateSeparators<StreamChatGenerics>({\n deletedMessagesVisibilityType,\n hideDateSeparators,\n messages: messageList,\n userId: client.userID,\n });\n\n const messageGroupStyles = getMessagesGroupStyles<StreamChatGenerics>({\n dateSeparators,\n hideDateSeparators,\n maxTimeBetweenGroupedMessages,\n messages: messageList,\n noGroupByUser,\n userId: client.userID,\n });\n\n const readData = getReadStates(client.userID, messageList, readList);\n\n const messagesWithStylesReadByAndDateSeparator = messageList\n .filter((msg) => {\n const isMessageTypeDeleted = msg.type === 'deleted';\n if (deletedMessagesVisibilityType === 'sender') {\n return !isMessageTypeDeleted || msg.user?.id === client.userID;\n } else if (deletedMessagesVisibilityType === 'receiver') {\n return !isMessageTypeDeleted || msg.user?.id !== client.userID;\n } else if (deletedMessagesVisibilityType === 'never') {\n return !isMessageTypeDeleted;\n } else {\n return msg;\n }\n })\n .map((msg) => ({\n ...msg,\n dateSeparator: dateSeparators[msg.id] || undefined,\n groupStyles: messageGroupStyles[msg.id] || ['single'],\n readBy: msg.id ? readData[msg.id] || false : false,\n }));\n\n return (\n inverted\n ? messagesWithStylesReadByAndDateSeparator.reverse()\n : messagesWithStylesReadByAndDateSeparator\n ) as MessageType<StreamChatGenerics>[];\n};\n"]}
|
|
@@ -36,7 +36,7 @@ var MessagesProvider = function MessagesProvider(_ref) {
|
|
|
36
36
|
__self: _this,
|
|
37
37
|
__source: {
|
|
38
38
|
fileName: _jsxFileName,
|
|
39
|
-
lineNumber:
|
|
39
|
+
lineNumber: 501,
|
|
40
40
|
columnNumber: 3
|
|
41
41
|
}
|
|
42
42
|
}, children);
|
|
@@ -63,7 +63,7 @@ var withMessagesContext = function withMessagesContext(Component) {
|
|
|
63
63
|
__self: _this,
|
|
64
64
|
__source: {
|
|
65
65
|
fileName: _jsxFileName,
|
|
66
|
-
lineNumber:
|
|
66
|
+
lineNumber: 538,
|
|
67
67
|
columnNumber: 12
|
|
68
68
|
}
|
|
69
69
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MessagesContext.tsx"],"names":["MessagesContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessagesProvider","children","value","useMessagesContext","contextValue","Error","withMessagesContext","Component","WithMessagesContextComponent","props","messagesContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAuDA;;AAEA;;AACA;;;;;;;;;AA4aO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAC7BC,mDAD6B,CAAxB;;;;AAIA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAG9BC,QAH8B,QAG9BA,QAH8B;AAAA,MAI9BC,KAJ8B,QAI9BA,KAJ8B;AAAA,SAQ9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR8B;AAAA,CAAzB;;;;AAaA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,GAE3B;AACL,MAAMC,YAAY,GAAG,uBACnBR,eADmB,CAArB;;AAIA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,yOAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAdM;;;;AAqBA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,CAIjCC,SAJiC,EAKqC;AACtE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGP,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { TouchableOpacityProps } from 'react-native';\n\nimport type { ImageLoadingFailedIndicatorProps } from 'src/components/Attachment/ImageLoadingFailedIndicator';\nimport type { ImageLoadingIndicatorProps } from 'src/components/Attachment/ImageLoadingIndicator';\n\nimport type { MessagePinnedHeaderProps } from 'src/components/Message/MessageSimple/MessagePinnedHeader';\n\nimport type { Attachment, ChannelState, MessageResponse } from 'stream-chat';\n\nimport type { AttachmentProps } from '../../components/Attachment/Attachment';\nimport type { AttachmentActionsProps } from '../../components/Attachment/AttachmentActions';\nimport type { AudioAttachmentProps } from '../../components/Attachment/AudioAttachment';\nimport type { CardProps } from '../../components/Attachment/Card';\nimport type { FileAttachmentProps } from '../../components/Attachment/FileAttachment';\nimport type { FileAttachmentGroupProps } from '../../components/Attachment/FileAttachmentGroup';\nimport type { FileIconProps } from '../../components/Attachment/FileIcon';\nimport type { GalleryProps } from '../../components/Attachment/Gallery';\nimport type { GiphyProps } from '../../components/Attachment/Giphy';\nimport type { VideoThumbnailProps } from '../../components/Attachment/VideoThumbnail';\nimport type {\n MessageProps,\n MessageTouchableHandlerPayload,\n} from '../../components/Message/Message';\nimport type { MessageAvatarProps } from '../../components/Message/MessageSimple/MessageAvatar';\nimport type { MessageContentProps } from '../../components/Message/MessageSimple/MessageContent';\nimport type { MessageDeletedProps } from '../../components/Message/MessageSimple/MessageDeleted';\nimport type { MessageFooterProps } from '../../components/Message/MessageSimple/MessageFooter';\n\nimport type { MessageRepliesProps } from '../../components/Message/MessageSimple/MessageReplies';\nimport type { MessageRepliesAvatarsProps } from '../../components/Message/MessageSimple/MessageRepliesAvatars';\nimport type { MessageSimpleProps } from '../../components/Message/MessageSimple/MessageSimple';\nimport type { MessageStatusProps } from '../../components/Message/MessageSimple/MessageStatus';\nimport type { MessageTextProps } from '../../components/Message/MessageSimple/MessageTextContainer';\nimport type { ReactionListProps } from '../../components/Message/MessageSimple/ReactionList';\nimport type { MarkdownRules } from '../../components/Message/MessageSimple/utils/renderText';\nimport type { MessageActionsParams } from '../../components/Message/utils/messageActions';\nimport type { DateHeaderProps } from '../../components/MessageList/DateHeader';\nimport type { MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { InlineDateSeparatorProps } from '../../components/MessageList/InlineDateSeparator';\nimport type { MessageListProps } from '../../components/MessageList/MessageList';\nimport type { MessageSystemProps } from '../../components/MessageList/MessageSystem';\nimport type { ScrollToBottomButtonProps } from '../../components/MessageList/ScrollToBottomButton';\nimport type { MessageActionType } from '../../components/MessageOverlay/MessageActionListItem';\nimport type { OverlayReactionListProps } from '../../components/MessageOverlay/OverlayReactionList';\nimport type { ReplyProps } from '../../components/Reply/Reply';\nimport type { FlatList } from '../../native';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport type { ReactionData } from '../../utils/utils';\nimport type { Alignment } from '../messageContext/MessageContext';\nimport type { SuggestionCommand } from '../suggestionsContext/SuggestionsContext';\nimport type { DeepPartial } from '../themeContext/ThemeContext';\nimport type { Theme } from '../themeContext/utils/theme';\nimport type { TDateTimeParserInput } from '../translationContext/TranslationContext';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type MessageContentType = 'attachments' | 'files' | 'gallery' | 'quoted_reply' | 'text';\nexport type DeletedMessagesVisibilityType = 'always' | 'never' | 'receiver' | 'sender';\n\nexport type MessagesContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * UI component for Attachment.\n * Defaults to: [Attachment](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Attachment.tsx)\n */\n Attachment: React.ComponentType<AttachmentProps<StreamChatGenerics>>;\n /**\n * UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy\n * Defaults to: [AttachmentActions](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/AttachmentActions.tsx)\n */\n AttachmentActions: React.ComponentType<AttachmentActionsProps<StreamChatGenerics>>;\n /** Custom UI component for AudioAttachment. */\n AudioAttachment: React.ComponentType<AudioAttachmentProps>;\n /**\n * UI component to display generic media type e.g. giphy, url preview etc\n * Defaults to: [Card](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Card.tsx)\n */\n Card: React.ComponentType<CardProps<StreamChatGenerics>>;\n /**\n * UI component for DateHeader\n * Defaults to: [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageList/DateHeader.tsx)\n **/\n DateHeader: React.ComponentType<DateHeaderProps>;\n\n /** Should keyboard be dismissed when messaged is touched */\n dismissKeyboardOnMessageTouch: boolean;\n\n enableMessageGroupingByUser: boolean;\n\n /**\n * UI component to display File type attachment.\n * Defaults to: [FileAttachment](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/FileAttachment.tsx)\n */\n FileAttachment: React.ComponentType<FileAttachmentProps<StreamChatGenerics>>;\n /**\n * UI component to display group of File type attachments or multiple file attachments (in single message).\n * Defaults to: [FileAttachmentGroup](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/FileAttachmentGroup.tsx)\n */\n FileAttachmentGroup: React.ComponentType<FileAttachmentGroupProps<StreamChatGenerics>>;\n /**\n * UI component for attachment icon for type 'file' attachment.\n * Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/FileIcon.tsx\n */\n FileAttachmentIcon: React.ComponentType<FileIconProps>;\n FlatList: typeof FlatList;\n /**\n * UI component to display image attachments\n * Defaults to: [Gallery](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Gallery.tsx)\n */\n Gallery: React.ComponentType<GalleryProps<StreamChatGenerics>>;\n /**\n * UI component for Giphy\n * Defaults to: [Giphy](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Giphy.tsx)\n */\n Giphy: React.ComponentType<GiphyProps<StreamChatGenerics>>;\n /**\n * The giphy version to render - check the keys of the [Image Object](https://developers.giphy.com/docs/api/schema#image-object) for possible values. Uses 'fixed_height' by default\n * */\n giphyVersion: keyof NonNullable<Attachment['giphy']>;\n\n /**\n * The indicator rendered when loading an image fails.\n */\n ImageLoadingFailedIndicator: React.ComponentType<ImageLoadingFailedIndicatorProps>;\n\n /**\n * The indicator rendered when image is loading. By default renders <ActivityIndicator/>\n */\n ImageLoadingIndicator: React.ComponentType<ImageLoadingIndicatorProps>;\n\n /**\n * When true, messageList will be scrolled at first unread message, when opened.\n */\n initialScrollToFirstUnreadMessage: boolean;\n /**\n * UI component for Message Date Separator Component\n * Defaults to: [InlineDateSeparator](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageList/InlineDateSeparator.tsx)\n */\n InlineDateSeparator: React.ComponentType<InlineDateSeparatorProps>;\n /**\n * UI component for InlineUnreadIndicator\n * Defaults to: [InlineUnreadIndicator](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/InlineUnreadIndicator.tsx)\n **/\n InlineUnreadIndicator: React.ComponentType;\n\n Message: React.ComponentType<MessageProps<StreamChatGenerics>>;\n /**\n * UI component for MessageAvatar\n * Defaults to: [MessageAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageAvatar.tsx)\n **/\n MessageAvatar: React.ComponentType<MessageAvatarProps<StreamChatGenerics>>;\n /**\n * UI component for MessageContent\n * Defaults to: [MessageContent](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageContent.tsx)\n */\n MessageContent: React.ComponentType<MessageContentProps<StreamChatGenerics>>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * UI component for MessageDeleted\n * Defaults to: [MessageDeleted](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageSimple/MessageDeleted.tsx)\n */\n MessageDeleted: React.ComponentType<MessageDeletedProps<StreamChatGenerics>>;\n /**\n * Custom message footer component\n */\n MessageFooter: React.ComponentType<MessageFooterProps<StreamChatGenerics>>;\n MessageList: React.ComponentType<MessageListProps<StreamChatGenerics>>;\n /**\n * Custom message pinned component\n */\n MessagePinnedHeader: React.ComponentType<MessagePinnedHeaderProps<StreamChatGenerics>>;\n /**\n * UI component for MessageReplies\n * Defaults to: [MessageReplies](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageSimple/MessageReplies.tsx)\n */\n\n MessageReplies: React.ComponentType<MessageRepliesProps<StreamChatGenerics>>;\n /**\n * UI Component for MessageRepliesAvatars\n * Defaults to: [MessageRepliesAvatars](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageSimple/MessageRepliesAvatars.tsx)\n */\n MessageRepliesAvatars: React.ComponentType<MessageRepliesAvatarsProps<StreamChatGenerics>>;\n /**\n * UI component for MessageSimple\n * Defaults to: [MessageSimple](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageSimple.tsx)\n */\n MessageSimple: React.ComponentType<MessageSimpleProps<StreamChatGenerics>>;\n /**\n * UI component for MessageStatus (delivered/read)\n * Defaults to: [MessageStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageStatus.tsx)\n */\n MessageStatus: React.ComponentType<MessageStatusProps<StreamChatGenerics>>;\n /**\n * UI component for MessageSystem\n * Defaults to: [MessageSystem](https://getstream.io/chat/docs/sdk/reactnative/ui-components/message-system/)\n */\n MessageSystem: React.ComponentType<MessageSystemProps<StreamChatGenerics>>;\n /**\n * UI component for OverlayReactionList\n */\n OverlayReactionList: React.ComponentType<OverlayReactionListProps<StreamChatGenerics>>;\n /**\n * UI component for ReactionList\n * Defaults to: [ReactionList](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Reaction/ReactionList.tsx)\n */\n ReactionList: React.ComponentType<ReactionListProps<StreamChatGenerics>>;\n removeMessage: (message: { id: string; parent_id?: string }) => void;\n /**\n * UI component for Reply\n * Defaults to: [Reply](https://getstream.io/chat/docs/sdk/reactnative/ui-components/reply/)\n */\n Reply: React.ComponentType<ReplyProps<StreamChatGenerics>>;\n /**\n * Override the api request for retry message functionality.\n */\n retrySendMessage: (message: MessageResponse<StreamChatGenerics>) => Promise<void>;\n /**\n * UI component for ScrollToBottomButton\n * Defaults to: [ScrollToBottomButton](https://getstream.io/chat/docs/sdk/reactnative/ui-components/scroll-to-bottom-button/)\n */\n ScrollToBottomButton: React.ComponentType<ScrollToBottomButtonProps>;\n setEditingState: (message: MessageType<StreamChatGenerics>) => void;\n setQuotedMessageState: (message: MessageType<StreamChatGenerics>) => void;\n supportedReactions: ReactionData[];\n /**\n * UI component for TypingIndicator\n * Defaults to: [TypingIndicator](https://getstream.io/chat/docs/sdk/reactnative/ui-components/typing-indicator/)\n */\n TypingIndicator: React.ComponentType;\n /**\n * UI component for TypingIndicatorContainer\n * Defaults to: [TypingIndicatorContainer](https://getstream.io/chat/docs/sdk/reactnative/contexts/messages-context/#typingindicatorcontainer)\n */\n TypingIndicatorContainer: React.ComponentType;\n updateMessage: (\n updatedMessage: MessageResponse<StreamChatGenerics>,\n extraState?: {\n commands?: SuggestionCommand<StreamChatGenerics>[];\n messageInput?: string;\n threadMessages?: ChannelState<StreamChatGenerics>['threads'][string];\n },\n ) => void;\n /**\n * Custom UI component to display enriched url preview.\n * Defaults to https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Card.tsx\n */\n UrlPreview: React.ComponentType<CardProps<StreamChatGenerics>>;\n VideoThumbnail: React.ComponentType<VideoThumbnailProps>;\n /**\n * Provide any additional props for `TouchableOpacity` which wraps inner MessageContent component here.\n * Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props\n *\n * @overrideType Object\n */\n additionalTouchableProps?: Omit<TouchableOpacityProps, 'style'>;\n /**\n * Custom UI component to override default cover (between Header and Footer) of Card component.\n * Accepts the same props as Card component.\n */\n CardCover?: React.ComponentType<CardProps<StreamChatGenerics>>;\n /**\n * Custom UI component to override default Footer of Card component.\n * Accepts the same props as Card component.\n */\n CardFooter?: React.ComponentType<CardProps<StreamChatGenerics>>;\n /**\n * Custom UI component to override default header of Card component.\n * Accepts the same props as Card component.\n */\n CardHeader?: React.ComponentType<CardProps<StreamChatGenerics>>;\n\n /**\n * Full override of the delete message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n\n /** Control if the deleted message is visible to both the send and reciever, either of them or none */\n deletedMessagesVisibilityType?: DeletedMessagesVisibilityType;\n\n disableTypingIndicator?: boolean;\n\n /**\n * Whether messages should be aligned to right or left part of screen.\n * By default, messages will be received messages will be aligned to left and\n * sent messages will be aligned to right.\n */\n forceAlignMessages?: Alignment | boolean;\n /**\n * Optional function to custom format the message date\n */\n formatDate?: (date: TDateTimeParserInput) => string;\n handleBlock?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a copy message action is invoked */\n handleCopy?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a delete message action is invoked */\n handleDelete?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when an edit message action is invoked */\n handleEdit?: (message: MessageType<StreamChatGenerics>) => void;\n /** Handler to access when a flag message action is invoked */\n handleFlag?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a mute user action is invoked */\n handleMute?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a pin/unpin user action is invoked*/\n handlePinMessage?: ((message: MessageType<StreamChatGenerics>) => MessageActionType) | null;\n /** Handler to access when a quoted reply action is invoked */\n handleQuotedReply?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to process a reaction */\n handleReaction?: (\n message: MessageType<StreamChatGenerics>,\n reactionType: string,\n ) => Promise<void>;\n /** Handler to access when a retry action is invoked */\n handleRetry?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a thread reply action is invoked */\n handleThreadReply?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to deal with custom memoization logic of Attachment */\n isAttachmentEqual?: (\n prevAttachment: Attachment<StreamChatGenerics>,\n nextAttachment: Attachment<StreamChatGenerics>,\n ) => boolean;\n legacyImageViewerSwipeBehaviour?: boolean;\n /** Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension */\n markdownRules?: MarkdownRules;\n /**\n * Use this prop to override message actions (which pop-up in message overlay).\n *\n * You can either completely override the default messageActions object.\n *\n * ```\n * <Channel\n * messageActions=[\n * {\n * action: () => { someAction() };\n * title: \"Pin Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * },\n * {\n * action: () => { someAction() };\n * title: \"Delete Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * }\n * ]\n * >\n * </Channel>\n * ```\n *\n * Or you can selectly keep certain action and remove some:\n *\n * e.g. Lets say you only want to keep threadReply and copyMessage actions\n *\n * ```\n * <Channel\n * messageActions={({\n * blockUser,\n * copyMessage,\n * deleteMessage,\n * editMessage,\n * flagMessage,\n * muteUser,\n * quotedReply,\n * retry,\n * threadReply,\n * }) => ([\n * threadReply, copyMessage\n * ])}\n * >\n * </Channel>\n * ```\n *\n * @overrideType Function | Array<Objects>\n */\n messageActions?: (param: MessageActionsParams<StreamChatGenerics>) => MessageActionType[];\n /**\n * Custom message header component\n */\n MessageHeader?: React.ComponentType<MessageFooterProps<StreamChatGenerics>>;\n /** Custom UI component for message text */\n MessageText?: React.ComponentType<MessageTextProps<StreamChatGenerics>>;\n\n /**\n * Theme provided only to messages that are the current users\n */\n myMessageTheme?: DeepPartial<Theme>;\n /**\n * Override default handler for onLongPress on message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onLongPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onLongPressMessage?: (payload: MessageTouchableHandlerPayload<StreamChatGenerics>) => void;\n /**\n * Add onPressIn handler for attachments. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressInMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressInMessage?: (payload: MessageTouchableHandlerPayload<StreamChatGenerics>) => void;\n /**\n * Override onPress handler for message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occurred\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressMessage?: (payload: MessageTouchableHandlerPayload<StreamChatGenerics>) => void;\n\n /**\n * Full override of the reaction function on Message and Message Overlay\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n selectReaction?: (\n message: MessageType<StreamChatGenerics>,\n ) => (reactionType: string) => Promise<void>;\n\n targetedMessage?: string;\n};\n\nexport const MessagesContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as MessagesContextValue,\n);\n\nexport const MessagesProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessagesContextValue<StreamChatGenerics>;\n}>) => (\n <MessagesContext.Provider value={value as unknown as MessagesContextValue}>\n {children}\n </MessagesContext.Provider>\n);\n\nexport const useMessagesContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n MessagesContext,\n ) as unknown as MessagesContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useMessagesContext hook was called outside of the MessagesContext provider. Make sure you have configured MessageList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#message-list`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if MessagesContext\n * typing is desired while using the HOC withMessagesContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessagesContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessagesContextValue<StreamChatGenerics>>> => {\n const WithMessagesContextComponent = (\n props: Omit<P, keyof MessagesContextValue<StreamChatGenerics>>,\n ) => {\n const messagesContext = useMessagesContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messagesContext} />;\n };\n WithMessagesContextComponent.displayName = `WithMessagesContext${getDisplayName(Component)}`;\n return WithMessagesContextComponent;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["MessagesContext.tsx"],"names":["MessagesContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessagesProvider","children","value","useMessagesContext","contextValue","Error","withMessagesContext","Component","WithMessagesContextComponent","props","messagesContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAwDA;;AAEA;;AACA;;;;;;;;;AA6aO,IAAMA,eAAe,GAAGC,kBAAMC,aAAN,CAC7BC,mDAD6B,CAAxB;;;;AAIA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAAA,MAG9BC,QAH8B,QAG9BA,QAH8B;AAAA,MAI9BC,KAJ8B,QAI9BA,KAJ8B;AAAA,SAQ9B,gCAAC,eAAD,CAAiB,QAAjB;AAA0B,IAAA,KAAK,EAAEA,KAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR8B;AAAA,CAAzB;;;;AAaA,IAAME,kBAAkB,GAAG,SAArBA,kBAAqB,GAE3B;AACL,MAAMC,YAAY,GAAG,uBACnBR,eADmB,CAArB;;AAIA,MAAIQ,YAAY,KAAKL,mDAAjB,IAA+C,CAAC,2CAApD,EAAyE;AACvE,UAAM,IAAIM,KAAJ,yOAAN;AAGD;;AAED,SAAOD,YAAP;AACD,CAdM;;;;AAqBA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,CAIjCC,SAJiC,EAKqC;AACtE,MAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACnCC,KADmC,EAEhC;AACH,QAAMC,eAAe,GAAGP,kBAAkB,EAA1C;AAEA,WAAO,gCAAC,SAAD,gCAAgBM,KAAhB,EAAiCC,eAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,4BAA4B,CAACG,WAA7B,2BAAiE,oCAAeJ,SAAf,CAAjE;AACA,SAAOC,4BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { TouchableOpacityProps } from 'react-native';\n\nimport type { ImageLoadingFailedIndicatorProps } from 'src/components/Attachment/ImageLoadingFailedIndicator';\nimport type { ImageLoadingIndicatorProps } from 'src/components/Attachment/ImageLoadingIndicator';\n\nimport type { MessagePinnedHeaderProps } from 'src/components/Message/MessageSimple/MessagePinnedHeader';\n\nimport type { Attachment, ChannelState, MessageResponse } from 'stream-chat';\n\nimport type { AttachmentProps } from '../../components/Attachment/Attachment';\nimport type { AttachmentActionsProps } from '../../components/Attachment/AttachmentActions';\nimport type { AudioAttachmentProps } from '../../components/Attachment/AudioAttachment';\nimport type { CardProps } from '../../components/Attachment/Card';\nimport type { FileAttachmentProps } from '../../components/Attachment/FileAttachment';\nimport type { FileAttachmentGroupProps } from '../../components/Attachment/FileAttachmentGroup';\nimport type { FileIconProps } from '../../components/Attachment/FileIcon';\nimport type { GalleryProps } from '../../components/Attachment/Gallery';\nimport type { GiphyProps } from '../../components/Attachment/Giphy';\nimport type { VideoThumbnailProps } from '../../components/Attachment/VideoThumbnail';\nimport type {\n MessageProps,\n MessageTouchableHandlerPayload,\n} from '../../components/Message/Message';\nimport type { MessageAvatarProps } from '../../components/Message/MessageSimple/MessageAvatar';\nimport type { MessageContentProps } from '../../components/Message/MessageSimple/MessageContent';\nimport type { MessageDeletedProps } from '../../components/Message/MessageSimple/MessageDeleted';\nimport type { MessageFooterProps } from '../../components/Message/MessageSimple/MessageFooter';\n\nimport type { MessageRepliesProps } from '../../components/Message/MessageSimple/MessageReplies';\nimport type { MessageRepliesAvatarsProps } from '../../components/Message/MessageSimple/MessageRepliesAvatars';\nimport type { MessageSimpleProps } from '../../components/Message/MessageSimple/MessageSimple';\nimport type { MessageStatusProps } from '../../components/Message/MessageSimple/MessageStatus';\nimport type { MessageTextProps } from '../../components/Message/MessageSimple/MessageTextContainer';\nimport type { ReactionListProps } from '../../components/Message/MessageSimple/ReactionList';\nimport type { MarkdownRules } from '../../components/Message/MessageSimple/utils/renderText';\nimport type { MessageActionsParams } from '../../components/Message/utils/messageActions';\nimport type { DateHeaderProps } from '../../components/MessageList/DateHeader';\nimport type { MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { InlineDateSeparatorProps } from '../../components/MessageList/InlineDateSeparator';\nimport type { MessageListProps } from '../../components/MessageList/MessageList';\nimport type { MessageSystemProps } from '../../components/MessageList/MessageSystem';\nimport type { ScrollToBottomButtonProps } from '../../components/MessageList/ScrollToBottomButton';\nimport type { getGroupStyles } from '../../components/MessageList/utils/getGroupStyles';\nimport type { MessageActionType } from '../../components/MessageOverlay/MessageActionListItem';\nimport type { OverlayReactionListProps } from '../../components/MessageOverlay/OverlayReactionList';\nimport type { ReplyProps } from '../../components/Reply/Reply';\nimport type { FlatList } from '../../native';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport type { ReactionData } from '../../utils/utils';\nimport type { Alignment } from '../messageContext/MessageContext';\nimport type { SuggestionCommand } from '../suggestionsContext/SuggestionsContext';\nimport type { DeepPartial } from '../themeContext/ThemeContext';\nimport type { Theme } from '../themeContext/utils/theme';\nimport type { TDateTimeParserInput } from '../translationContext/TranslationContext';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type MessageContentType = 'attachments' | 'files' | 'gallery' | 'quoted_reply' | 'text';\nexport type DeletedMessagesVisibilityType = 'always' | 'never' | 'receiver' | 'sender';\n\nexport type MessagesContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * UI component for Attachment.\n * Defaults to: [Attachment](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Attachment.tsx)\n */\n Attachment: React.ComponentType<AttachmentProps<StreamChatGenerics>>;\n /**\n * UI component to display AttachmentActions. e.g., send, shuffle, cancel in case of giphy\n * Defaults to: [AttachmentActions](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/AttachmentActions.tsx)\n */\n AttachmentActions: React.ComponentType<AttachmentActionsProps<StreamChatGenerics>>;\n /** Custom UI component for AudioAttachment. */\n AudioAttachment: React.ComponentType<AudioAttachmentProps>;\n /**\n * UI component to display generic media type e.g. giphy, url preview etc\n * Defaults to: [Card](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Card.tsx)\n */\n Card: React.ComponentType<CardProps<StreamChatGenerics>>;\n /**\n * UI component for DateHeader\n * Defaults to: [DateHeader](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageList/DateHeader.tsx)\n **/\n DateHeader: React.ComponentType<DateHeaderProps>;\n\n /** Should keyboard be dismissed when messaged is touched */\n dismissKeyboardOnMessageTouch: boolean;\n\n enableMessageGroupingByUser: boolean;\n\n /**\n * UI component to display File type attachment.\n * Defaults to: [FileAttachment](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/FileAttachment.tsx)\n */\n FileAttachment: React.ComponentType<FileAttachmentProps<StreamChatGenerics>>;\n /**\n * UI component to display group of File type attachments or multiple file attachments (in single message).\n * Defaults to: [FileAttachmentGroup](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/FileAttachmentGroup.tsx)\n */\n FileAttachmentGroup: React.ComponentType<FileAttachmentGroupProps<StreamChatGenerics>>;\n /**\n * UI component for attachment icon for type 'file' attachment.\n * Defaults to: https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/FileIcon.tsx\n */\n FileAttachmentIcon: React.ComponentType<FileIconProps>;\n FlatList: typeof FlatList;\n /**\n * UI component to display image attachments\n * Defaults to: [Gallery](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Gallery.tsx)\n */\n Gallery: React.ComponentType<GalleryProps<StreamChatGenerics>>;\n /**\n * UI component for Giphy\n * Defaults to: [Giphy](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Giphy.tsx)\n */\n Giphy: React.ComponentType<GiphyProps<StreamChatGenerics>>;\n /**\n * The giphy version to render - check the keys of the [Image Object](https://developers.giphy.com/docs/api/schema#image-object) for possible values. Uses 'fixed_height' by default\n * */\n giphyVersion: keyof NonNullable<Attachment['giphy']>;\n\n /**\n * The indicator rendered when loading an image fails.\n */\n ImageLoadingFailedIndicator: React.ComponentType<ImageLoadingFailedIndicatorProps>;\n\n /**\n * The indicator rendered when image is loading. By default renders <ActivityIndicator/>\n */\n ImageLoadingIndicator: React.ComponentType<ImageLoadingIndicatorProps>;\n\n /**\n * When true, messageList will be scrolled at first unread message, when opened.\n */\n initialScrollToFirstUnreadMessage: boolean;\n /**\n * UI component for Message Date Separator Component\n * Defaults to: [InlineDateSeparator](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageList/InlineDateSeparator.tsx)\n */\n InlineDateSeparator: React.ComponentType<InlineDateSeparatorProps>;\n /**\n * UI component for InlineUnreadIndicator\n * Defaults to: [InlineUnreadIndicator](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/InlineUnreadIndicator.tsx)\n **/\n InlineUnreadIndicator: React.ComponentType;\n\n Message: React.ComponentType<MessageProps<StreamChatGenerics>>;\n /**\n * UI component for MessageAvatar\n * Defaults to: [MessageAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageAvatar.tsx)\n **/\n MessageAvatar: React.ComponentType<MessageAvatarProps<StreamChatGenerics>>;\n /**\n * UI component for MessageContent\n * Defaults to: [MessageContent](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageContent.tsx)\n */\n MessageContent: React.ComponentType<MessageContentProps<StreamChatGenerics>>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * UI component for MessageDeleted\n * Defaults to: [MessageDeleted](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageSimple/MessageDeleted.tsx)\n */\n MessageDeleted: React.ComponentType<MessageDeletedProps<StreamChatGenerics>>;\n /**\n * Custom message footer component\n */\n MessageFooter: React.ComponentType<MessageFooterProps<StreamChatGenerics>>;\n MessageList: React.ComponentType<MessageListProps<StreamChatGenerics>>;\n /**\n * Custom message pinned component\n */\n MessagePinnedHeader: React.ComponentType<MessagePinnedHeaderProps<StreamChatGenerics>>;\n /**\n * UI component for MessageReplies\n * Defaults to: [MessageReplies](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageSimple/MessageReplies.tsx)\n */\n\n MessageReplies: React.ComponentType<MessageRepliesProps<StreamChatGenerics>>;\n /**\n * UI Component for MessageRepliesAvatars\n * Defaults to: [MessageRepliesAvatars](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/MessageSimple/MessageRepliesAvatars.tsx)\n */\n MessageRepliesAvatars: React.ComponentType<MessageRepliesAvatarsProps<StreamChatGenerics>>;\n /**\n * UI component for MessageSimple\n * Defaults to: [MessageSimple](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageSimple.tsx)\n */\n MessageSimple: React.ComponentType<MessageSimpleProps<StreamChatGenerics>>;\n /**\n * UI component for MessageStatus (delivered/read)\n * Defaults to: [MessageStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageSimple/MessageStatus.tsx)\n */\n MessageStatus: React.ComponentType<MessageStatusProps<StreamChatGenerics>>;\n /**\n * UI component for MessageSystem\n * Defaults to: [MessageSystem](https://getstream.io/chat/docs/sdk/reactnative/ui-components/message-system/)\n */\n MessageSystem: React.ComponentType<MessageSystemProps<StreamChatGenerics>>;\n /**\n * UI component for OverlayReactionList\n */\n OverlayReactionList: React.ComponentType<OverlayReactionListProps<StreamChatGenerics>>;\n /**\n * UI component for ReactionList\n * Defaults to: [ReactionList](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Reaction/ReactionList.tsx)\n */\n ReactionList: React.ComponentType<ReactionListProps<StreamChatGenerics>>;\n removeMessage: (message: { id: string; parent_id?: string }) => void;\n /**\n * UI component for Reply\n * Defaults to: [Reply](https://getstream.io/chat/docs/sdk/reactnative/ui-components/reply/)\n */\n Reply: React.ComponentType<ReplyProps<StreamChatGenerics>>;\n /**\n * Override the api request for retry message functionality.\n */\n retrySendMessage: (message: MessageResponse<StreamChatGenerics>) => Promise<void>;\n /**\n * UI component for ScrollToBottomButton\n * Defaults to: [ScrollToBottomButton](https://getstream.io/chat/docs/sdk/reactnative/ui-components/scroll-to-bottom-button/)\n */\n ScrollToBottomButton: React.ComponentType<ScrollToBottomButtonProps>;\n setEditingState: (message: MessageType<StreamChatGenerics>) => void;\n setQuotedMessageState: (message: MessageType<StreamChatGenerics>) => void;\n supportedReactions: ReactionData[];\n /**\n * UI component for TypingIndicator\n * Defaults to: [TypingIndicator](https://getstream.io/chat/docs/sdk/reactnative/ui-components/typing-indicator/)\n */\n TypingIndicator: React.ComponentType;\n /**\n * UI component for TypingIndicatorContainer\n * Defaults to: [TypingIndicatorContainer](https://getstream.io/chat/docs/sdk/reactnative/contexts/messages-context/#typingindicatorcontainer)\n */\n TypingIndicatorContainer: React.ComponentType;\n updateMessage: (\n updatedMessage: MessageResponse<StreamChatGenerics>,\n extraState?: {\n commands?: SuggestionCommand<StreamChatGenerics>[];\n messageInput?: string;\n threadMessages?: ChannelState<StreamChatGenerics>['threads'][string];\n },\n ) => void;\n /**\n * Custom UI component to display enriched url preview.\n * Defaults to https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Attachment/Card.tsx\n */\n UrlPreview: React.ComponentType<CardProps<StreamChatGenerics>>;\n VideoThumbnail: React.ComponentType<VideoThumbnailProps>;\n /**\n * Provide any additional props for `TouchableOpacity` which wraps inner MessageContent component here.\n * Please check docs for TouchableOpacity for supported props - https://reactnative.dev/docs/touchableopacity#props\n *\n * @overrideType Object\n */\n additionalTouchableProps?: Omit<TouchableOpacityProps, 'style'>;\n /**\n * Custom UI component to override default cover (between Header and Footer) of Card component.\n * Accepts the same props as Card component.\n */\n CardCover?: React.ComponentType<CardProps<StreamChatGenerics>>;\n /**\n * Custom UI component to override default Footer of Card component.\n * Accepts the same props as Card component.\n */\n CardFooter?: React.ComponentType<CardProps<StreamChatGenerics>>;\n /**\n * Custom UI component to override default header of Card component.\n * Accepts the same props as Card component.\n */\n CardHeader?: React.ComponentType<CardProps<StreamChatGenerics>>;\n\n /**\n * Full override of the delete message button in the Message Actions\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n */\n\n /** Control if the deleted message is visible to both the send and reciever, either of them or none */\n deletedMessagesVisibilityType?: DeletedMessagesVisibilityType;\n\n disableTypingIndicator?: boolean;\n\n /**\n * Whether messages should be aligned to right or left part of screen.\n * By default, messages will be received messages will be aligned to left and\n * sent messages will be aligned to right.\n */\n forceAlignMessages?: Alignment | boolean;\n /**\n * Optional function to custom format the message date\n */\n formatDate?: (date: TDateTimeParserInput) => string;\n getMessagesGroupStyles?: typeof getGroupStyles;\n handleBlock?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a copy message action is invoked */\n handleCopy?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a delete message action is invoked */\n handleDelete?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when an edit message action is invoked */\n handleEdit?: (message: MessageType<StreamChatGenerics>) => void;\n /** Handler to access when a flag message action is invoked */\n handleFlag?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a mute user action is invoked */\n handleMute?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a pin/unpin user action is invoked*/\n handlePinMessage?: ((message: MessageType<StreamChatGenerics>) => MessageActionType) | null;\n /** Handler to access when a quoted reply action is invoked */\n handleQuotedReply?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to process a reaction */\n handleReaction?: (\n message: MessageType<StreamChatGenerics>,\n reactionType: string,\n ) => Promise<void>;\n /** Handler to access when a retry action is invoked */\n handleRetry?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to access when a thread reply action is invoked */\n handleThreadReply?: (message: MessageType<StreamChatGenerics>) => Promise<void>;\n /** Handler to deal with custom memoization logic of Attachment */\n isAttachmentEqual?: (\n prevAttachment: Attachment<StreamChatGenerics>,\n nextAttachment: Attachment<StreamChatGenerics>,\n ) => boolean;\n legacyImageViewerSwipeBehaviour?: boolean;\n /** Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension */\n markdownRules?: MarkdownRules;\n /**\n * Use this prop to override message actions (which pop-up in message overlay).\n *\n * You can either completely override the default messageActions object.\n *\n * ```\n * <Channel\n * messageActions=[\n * {\n * action: () => { someAction() };\n * title: \"Pin Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * },\n * {\n * action: () => { someAction() };\n * title: \"Delete Message\";\n * icon: PinIcon;\n * titleStyle: {};\n * }\n * ]\n * >\n * </Channel>\n * ```\n *\n * Or you can selectly keep certain action and remove some:\n *\n * e.g. Lets say you only want to keep threadReply and copyMessage actions\n *\n * ```\n * <Channel\n * messageActions={({\n * blockUser,\n * copyMessage,\n * deleteMessage,\n * editMessage,\n * flagMessage,\n * muteUser,\n * quotedReply,\n * retry,\n * threadReply,\n * }) => ([\n * threadReply, copyMessage\n * ])}\n * >\n * </Channel>\n * ```\n *\n * @overrideType Function | Array<Objects>\n */\n messageActions?: (param: MessageActionsParams<StreamChatGenerics>) => MessageActionType[];\n /**\n * Custom message header component\n */\n MessageHeader?: React.ComponentType<MessageFooterProps<StreamChatGenerics>>;\n /** Custom UI component for message text */\n MessageText?: React.ComponentType<MessageTextProps<StreamChatGenerics>>;\n\n /**\n * Theme provided only to messages that are the current users\n */\n myMessageTheme?: DeepPartial<Theme>;\n /**\n * Override default handler for onLongPress on message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onLongPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onLongPressMessage?: (payload: MessageTouchableHandlerPayload<StreamChatGenerics>) => void;\n /**\n * Add onPressIn handler for attachments. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressInMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occured\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressInMessage?: (payload: MessageTouchableHandlerPayload<StreamChatGenerics>) => void;\n /**\n * Override onPress handler for message. You have access to payload of that handler as param:\n *\n * ```\n * <Channel\n * onPressMessage={({\n * actionHandlers: {\n * deleteMessage, // () => Promise<void>;\n * editMessage, // () => void;\n * quotedReply, // () => void;\n * resendMessage, // () => Promise<void>;\n * showMessageOverlay, // () => void;\n * toggleBanUser, // () => Promise<void>;\n * toggleMuteUser, // () => Promise<void>;\n * toggleReaction, // (reactionType: string) => Promise<void>;\n * },\n * defaultHandler, // () => void\n * event, // any event object corresponding to touchable feedback\n * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc\n * message // message object on which longPress occurred\n * }) => {\n * // Your custom action\n * }}\n * />\n * ```\n */\n onPressMessage?: (payload: MessageTouchableHandlerPayload<StreamChatGenerics>) => void;\n\n /**\n * Full override of the reaction function on Message and Message Overlay\n *\n * Please check [cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#override-or-intercept-message-actions-edit-delete-reaction-reply-etc) for details.\n * */\n selectReaction?: (\n message: MessageType<StreamChatGenerics>,\n ) => (reactionType: string) => Promise<void>;\n\n targetedMessage?: string;\n};\n\nexport const MessagesContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as MessagesContextValue,\n);\n\nexport const MessagesProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessagesContextValue<StreamChatGenerics>;\n}>) => (\n <MessagesContext.Provider value={value as unknown as MessagesContextValue}>\n {children}\n </MessagesContext.Provider>\n);\n\nexport const useMessagesContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n MessagesContext,\n ) as unknown as MessagesContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useMessagesContext hook was called outside of the MessagesContext provider. Make sure you have configured MessageList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#message-list`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if MessagesContext\n * typing is desired while using the HOC withMessagesContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessagesContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessagesContextValue<StreamChatGenerics>>> => {\n const WithMessagesContextComponent = (\n props: Omit<P, keyof MessagesContextValue<StreamChatGenerics>>,\n ) => {\n const messagesContext = useMessagesContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messagesContext} />;\n };\n WithMessagesContextComponent.displayName = `WithMessagesContext${getDisplayName(Component)}`;\n return WithMessagesContextComponent;\n};\n"]}
|
package/lib/module/version.json
CHANGED
|
@@ -15,7 +15,7 @@ import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
|
15
15
|
import { ReactionData } from '../../utils/utils';
|
|
16
16
|
import { LoadingErrorProps } from '../Indicators/LoadingErrorIndicator';
|
|
17
17
|
export declare const reactionData: ReactionData[];
|
|
18
|
-
export declare type ChannelPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<ChannelContextValue<StreamChatGenerics>, 'channel'> & Partial<Pick<ChannelContextValue<StreamChatGenerics>, 'EmptyStateIndicator' | 'enableMessageGroupingByUser' | 'enforceUniqueReaction' | 'giphyEnabled' | 'hideStickyDateHeader' | 'hideDateSeparators' | 'LoadingIndicator' | 'maxTimeBetweenGroupedMessages' | 'NetworkDownIndicator' | 'StickyHeader'>> & Pick<ChatContextValue<StreamChatGenerics>, 'client'> & Partial<Omit<InputMessageInputContextValue<StreamChatGenerics>, 'quotedMessage' | 'editing' | 'clearEditingState' | 'clearQuotedMessageState' | 'sendMessage'>> & Partial<Pick<SuggestionsContextValue<StreamChatGenerics>, 'AutoCompleteSuggestionHeader' | 'AutoCompleteSuggestionItem' | 'AutoCompleteSuggestionList'>> & Pick<TranslationContextValue, 't'> & Partial<Pick<PaginatedMessageListContextValue<StreamChatGenerics>, 'messages' | 'loadingMore' | 'loadingMoreRecent'>> & UseChannelStateValue<StreamChatGenerics> & Partial<Pick<MessagesContextValue<StreamChatGenerics>, 'additionalTouchableProps' | 'Attachment' | 'AttachmentActions' | 'AudioAttachment' | 'Card' | 'CardCover' | 'CardFooter' | 'CardHeader' | 'DateHeader' | 'deletedMessagesVisibilityType' | 'disableTypingIndicator' | 'dismissKeyboardOnMessageTouch' | 'FileAttachment' | 'FileAttachmentIcon' | 'FileAttachmentGroup' | 'FlatList' | 'forceAlignMessages' | 'formatDate' | 'Gallery' | 'Giphy' | 'giphyVersion' | 'handleBlock' | 'handleCopy' | 'handleDelete' | 'handleEdit' | 'handleFlag' | 'handleMute' | 'handlePinMessage' | 'handleReaction' | 'handleQuotedReply' | 'handleRetry' | 'handleThreadReply' | 'InlineDateSeparator' | 'InlineUnreadIndicator' | 'isAttachmentEqual' | 'legacyImageViewerSwipeBehaviour' | 'ImageLoadingFailedIndicator' | 'ImageLoadingIndicator' | 'markdownRules' | 'Message' | 'messageActions' | 'MessageAvatar' | 'MessageContent' | 'messageContentOrder' | 'MessageDeleted' | 'MessageFooter' | 'MessageHeader' | 'MessageList' | 'MessagePinnedHeader' | 'MessageReplies' | 'MessageRepliesAvatars' | 'MessageSimple' | 'MessageStatus' | 'MessageSystem' | 'MessageText' | 'myMessageTheme' | 'onLongPressMessage' | 'onPressInMessage' | 'onPressMessage' | 'OverlayReactionList' | 'ReactionList' | 'Reply' | 'ScrollToBottomButton' | 'selectReaction' | 'supportedReactions' | 'TypingIndicator' | 'TypingIndicatorContainer' | 'UrlPreview' | 'VideoThumbnail'>> & Partial<Pick<ThreadContextValue<StreamChatGenerics>, 'allowThreadMessagesInChannel' | 'thread'>> & {
|
|
18
|
+
export declare type ChannelPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<ChannelContextValue<StreamChatGenerics>, 'channel'> & Partial<Pick<ChannelContextValue<StreamChatGenerics>, 'EmptyStateIndicator' | 'enableMessageGroupingByUser' | 'enforceUniqueReaction' | 'giphyEnabled' | 'hideStickyDateHeader' | 'hideDateSeparators' | 'LoadingIndicator' | 'maxTimeBetweenGroupedMessages' | 'NetworkDownIndicator' | 'StickyHeader'>> & Pick<ChatContextValue<StreamChatGenerics>, 'client'> & Partial<Omit<InputMessageInputContextValue<StreamChatGenerics>, 'quotedMessage' | 'editing' | 'clearEditingState' | 'clearQuotedMessageState' | 'sendMessage'>> & Partial<Pick<SuggestionsContextValue<StreamChatGenerics>, 'AutoCompleteSuggestionHeader' | 'AutoCompleteSuggestionItem' | 'AutoCompleteSuggestionList'>> & Pick<TranslationContextValue, 't'> & Partial<Pick<PaginatedMessageListContextValue<StreamChatGenerics>, 'messages' | 'loadingMore' | 'loadingMoreRecent'>> & UseChannelStateValue<StreamChatGenerics> & Partial<Pick<MessagesContextValue<StreamChatGenerics>, 'additionalTouchableProps' | 'Attachment' | 'AttachmentActions' | 'AudioAttachment' | 'Card' | 'CardCover' | 'CardFooter' | 'CardHeader' | 'DateHeader' | 'deletedMessagesVisibilityType' | 'disableTypingIndicator' | 'dismissKeyboardOnMessageTouch' | 'FileAttachment' | 'FileAttachmentIcon' | 'FileAttachmentGroup' | 'FlatList' | 'forceAlignMessages' | 'formatDate' | 'Gallery' | 'getMessagesGroupStyles' | 'Giphy' | 'giphyVersion' | 'handleBlock' | 'handleCopy' | 'handleDelete' | 'handleEdit' | 'handleFlag' | 'handleMute' | 'handlePinMessage' | 'handleReaction' | 'handleQuotedReply' | 'handleRetry' | 'handleThreadReply' | 'InlineDateSeparator' | 'InlineUnreadIndicator' | 'isAttachmentEqual' | 'legacyImageViewerSwipeBehaviour' | 'ImageLoadingFailedIndicator' | 'ImageLoadingIndicator' | 'markdownRules' | 'Message' | 'messageActions' | 'MessageAvatar' | 'MessageContent' | 'messageContentOrder' | 'MessageDeleted' | 'MessageFooter' | 'MessageHeader' | 'MessageList' | 'MessagePinnedHeader' | 'MessageReplies' | 'MessageRepliesAvatars' | 'MessageSimple' | 'MessageStatus' | 'MessageSystem' | 'MessageText' | 'myMessageTheme' | 'onLongPressMessage' | 'onPressInMessage' | 'onPressMessage' | 'OverlayReactionList' | 'ReactionList' | 'Reply' | 'ScrollToBottomButton' | 'selectReaction' | 'supportedReactions' | 'TypingIndicator' | 'TypingIndicatorContainer' | 'UrlPreview' | 'VideoThumbnail'>> & Partial<Pick<ThreadContextValue<StreamChatGenerics>, 'allowThreadMessagesInChannel' | 'thread'>> & {
|
|
19
19
|
shouldSyncChannel: boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Additional props passed to keyboard avoiding view
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MessagesContextValue } from '../../../contexts/messagesContext/MessagesContext';
|
|
2
2
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
3
|
-
export declare const useCreateMessagesContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ additionalTouchableProps, Attachment, AttachmentActions, AudioAttachment, Card, CardCover, CardFooter, CardHeader, channelId, DateHeader, deletedMessagesVisibilityType, disableTypingIndicator, dismissKeyboardOnMessageTouch, enableMessageGroupingByUser, FileAttachment, FileAttachmentGroup, FileAttachmentIcon, FlatList, forceAlignMessages, formatDate, Gallery, Giphy, giphyVersion, handleBlock, handleCopy, handleDelete, handleEdit, handleFlag, handleMute, handlePinMessage, handleQuotedReply, handleReaction, handleRetry, handleThreadReply, ImageLoadingFailedIndicator, ImageLoadingIndicator, initialScrollToFirstUnreadMessage, InlineDateSeparator, InlineUnreadIndicator, isAttachmentEqual, legacyImageViewerSwipeBehaviour, markdownRules, Message, messageActions, MessageAvatar, MessageContent, messageContentOrder, MessageDeleted, MessageFooter, MessageHeader, MessageList, MessagePinnedHeader, MessageReplies, MessageRepliesAvatars, MessageSimple, MessageStatus, MessageSystem, MessageText, myMessageTheme, onLongPressMessage, onPressInMessage, onPressMessage, OverlayReactionList, ReactionList, removeMessage, Reply, retrySendMessage, ScrollToBottomButton, selectReaction, setEditingState, setQuotedMessageState, supportedReactions, targetedMessage, TypingIndicator, TypingIndicatorContainer, updateMessage, UrlPreview, VideoThumbnail, }: MessagesContextValue<StreamChatGenerics> & {
|
|
3
|
+
export declare const useCreateMessagesContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ additionalTouchableProps, Attachment, AttachmentActions, AudioAttachment, Card, CardCover, CardFooter, CardHeader, channelId, DateHeader, deletedMessagesVisibilityType, disableTypingIndicator, dismissKeyboardOnMessageTouch, enableMessageGroupingByUser, FileAttachment, FileAttachmentGroup, FileAttachmentIcon, FlatList, forceAlignMessages, formatDate, Gallery, getMessagesGroupStyles, Giphy, giphyVersion, handleBlock, handleCopy, handleDelete, handleEdit, handleFlag, handleMute, handlePinMessage, handleQuotedReply, handleReaction, handleRetry, handleThreadReply, ImageLoadingFailedIndicator, ImageLoadingIndicator, initialScrollToFirstUnreadMessage, InlineDateSeparator, InlineUnreadIndicator, isAttachmentEqual, legacyImageViewerSwipeBehaviour, markdownRules, Message, messageActions, MessageAvatar, MessageContent, messageContentOrder, MessageDeleted, MessageFooter, MessageHeader, MessageList, MessagePinnedHeader, MessageReplies, MessageRepliesAvatars, MessageSimple, MessageStatus, MessageSystem, MessageText, myMessageTheme, onLongPressMessage, onPressInMessage, onPressMessage, OverlayReactionList, ReactionList, removeMessage, Reply, retrySendMessage, ScrollToBottomButton, selectReaction, setEditingState, setQuotedMessageState, supportedReactions, targetedMessage, TypingIndicator, TypingIndicatorContainer, updateMessage, UrlPreview, VideoThumbnail, }: MessagesContextValue<StreamChatGenerics> & {
|
|
4
4
|
/**
|
|
5
5
|
* To ensure we allow re-render, when channel is changed
|
|
6
6
|
*/
|
|
@@ -7,7 +7,7 @@ export declare type UseMessageListParams = {
|
|
|
7
7
|
noGroupByUser?: boolean;
|
|
8
8
|
threadList?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare type GroupType =
|
|
10
|
+
export declare type GroupType = string;
|
|
11
11
|
export declare type MessagesWithStylesReadByAndDateSeparator<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = MessageResponse<StreamChatGenerics> & {
|
|
12
12
|
groupStyles: GroupType[];
|
|
13
13
|
readBy: boolean | number;
|
|
@@ -2,7 +2,6 @@ import type { DateSeparators } from './getDateSeparators';
|
|
|
2
2
|
import type { PaginatedMessageListContextValue } from '../../../contexts/paginatedMessageListContext/PaginatedMessageListContext';
|
|
3
3
|
import type { ThreadContextValue } from '../../../contexts/threadContext/ThreadContext';
|
|
4
4
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
5
|
-
import type { GroupType } from '../hooks/useMessageList';
|
|
6
5
|
export declare type GetGroupStylesParams<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
7
6
|
dateSeparators: DateSeparators;
|
|
8
7
|
messages: PaginatedMessageListContextValue<StreamChatGenerics>['messages'] | ThreadContextValue<StreamChatGenerics>['threadMessages'];
|
|
@@ -12,5 +11,5 @@ export declare type GetGroupStylesParams<StreamChatGenerics extends DefaultStrea
|
|
|
12
11
|
userId?: string;
|
|
13
12
|
};
|
|
14
13
|
export declare const getGroupStyles: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(params: GetGroupStylesParams<StreamChatGenerics>) => {
|
|
15
|
-
[key: string]:
|
|
14
|
+
[key: string]: string[];
|
|
16
15
|
};
|
|
@@ -33,6 +33,7 @@ import type { InlineDateSeparatorProps } from '../../components/MessageList/Inli
|
|
|
33
33
|
import type { MessageListProps } from '../../components/MessageList/MessageList';
|
|
34
34
|
import type { MessageSystemProps } from '../../components/MessageList/MessageSystem';
|
|
35
35
|
import type { ScrollToBottomButtonProps } from '../../components/MessageList/ScrollToBottomButton';
|
|
36
|
+
import type { getGroupStyles } from '../../components/MessageList/utils/getGroupStyles';
|
|
36
37
|
import type { MessageActionType } from '../../components/MessageOverlay/MessageActionListItem';
|
|
37
38
|
import type { OverlayReactionListProps } from '../../components/MessageOverlay/OverlayReactionList';
|
|
38
39
|
import type { ReplyProps } from '../../components/Reply/Reply';
|
|
@@ -267,6 +268,7 @@ export declare type MessagesContextValue<StreamChatGenerics extends DefaultStrea
|
|
|
267
268
|
* Optional function to custom format the message date
|
|
268
269
|
*/
|
|
269
270
|
formatDate?: (date: TDateTimeParserInput) => string;
|
|
271
|
+
getMessagesGroupStyles?: typeof getGroupStyles;
|
|
270
272
|
handleBlock?: (message: MessageType<StreamChatGenerics>) => Promise<void>;
|
|
271
273
|
/** Handler to access when a copy message action is invoked */
|
|
272
274
|
handleCopy?: (message: MessageType<StreamChatGenerics>) => Promise<void>;
|
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": "5.4.0
|
|
4
|
+
"version": "5.4.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -239,6 +239,7 @@ export type ChannelPropsWithContext<
|
|
|
239
239
|
| 'forceAlignMessages'
|
|
240
240
|
| 'formatDate'
|
|
241
241
|
| 'Gallery'
|
|
242
|
+
| 'getMessagesGroupStyles'
|
|
242
243
|
| 'Giphy'
|
|
243
244
|
| 'giphyVersion'
|
|
244
245
|
| 'handleBlock'
|
|
@@ -430,6 +431,7 @@ const ChannelWithContext = <
|
|
|
430
431
|
forceAlignMessages,
|
|
431
432
|
formatDate,
|
|
432
433
|
Gallery = GalleryDefault,
|
|
434
|
+
getMessagesGroupStyles,
|
|
433
435
|
Giphy = GiphyDefault,
|
|
434
436
|
giphyEnabled,
|
|
435
437
|
giphyVersion = 'fixed_height',
|
|
@@ -1662,6 +1664,7 @@ const ChannelWithContext = <
|
|
|
1662
1664
|
forceAlignMessages,
|
|
1663
1665
|
formatDate,
|
|
1664
1666
|
Gallery,
|
|
1667
|
+
getMessagesGroupStyles,
|
|
1665
1668
|
Giphy,
|
|
1666
1669
|
giphyVersion,
|
|
1667
1670
|
handleBlock,
|
|
@@ -27,6 +27,7 @@ export const useCreateMessagesContext = <
|
|
|
27
27
|
forceAlignMessages,
|
|
28
28
|
formatDate,
|
|
29
29
|
Gallery,
|
|
30
|
+
getMessagesGroupStyles,
|
|
30
31
|
Giphy,
|
|
31
32
|
giphyVersion,
|
|
32
33
|
handleBlock,
|
|
@@ -117,6 +118,7 @@ export const useCreateMessagesContext = <
|
|
|
117
118
|
forceAlignMessages,
|
|
118
119
|
formatDate,
|
|
119
120
|
Gallery,
|
|
121
|
+
getMessagesGroupStyles,
|
|
120
122
|
Giphy,
|
|
121
123
|
giphyVersion,
|
|
122
124
|
handleBlock,
|
|
@@ -23,7 +23,7 @@ export type UseMessageListParams = {
|
|
|
23
23
|
threadList?: boolean;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export type GroupType =
|
|
26
|
+
export type GroupType = string;
|
|
27
27
|
|
|
28
28
|
export type MessagesWithStylesReadByAndDateSeparator<
|
|
29
29
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
@@ -56,7 +56,8 @@ export const useMessageList = <
|
|
|
56
56
|
const { client } = useChatContext<StreamChatGenerics>();
|
|
57
57
|
const { hideDateSeparators, maxTimeBetweenGroupedMessages, read } =
|
|
58
58
|
useChannelContext<StreamChatGenerics>();
|
|
59
|
-
const { deletedMessagesVisibilityType } =
|
|
59
|
+
const { deletedMessagesVisibilityType, getMessagesGroupStyles = getGroupStyles } =
|
|
60
|
+
useMessagesContext<StreamChatGenerics>();
|
|
60
61
|
const { messages } = usePaginatedMessageListContext<StreamChatGenerics>();
|
|
61
62
|
const { threadMessages } = useThreadContext<StreamChatGenerics>();
|
|
62
63
|
|
|
@@ -72,7 +73,7 @@ export const useMessageList = <
|
|
|
72
73
|
userId: client.userID,
|
|
73
74
|
});
|
|
74
75
|
|
|
75
|
-
const messageGroupStyles =
|
|
76
|
+
const messageGroupStyles = getMessagesGroupStyles<StreamChatGenerics>({
|
|
76
77
|
dateSeparators,
|
|
77
78
|
hideDateSeparators,
|
|
78
79
|
maxTimeBetweenGroupedMessages,
|
|
@@ -42,6 +42,7 @@ import type { InlineDateSeparatorProps } from '../../components/MessageList/Inli
|
|
|
42
42
|
import type { MessageListProps } from '../../components/MessageList/MessageList';
|
|
43
43
|
import type { MessageSystemProps } from '../../components/MessageList/MessageSystem';
|
|
44
44
|
import type { ScrollToBottomButtonProps } from '../../components/MessageList/ScrollToBottomButton';
|
|
45
|
+
import type { getGroupStyles } from '../../components/MessageList/utils/getGroupStyles';
|
|
45
46
|
import type { MessageActionType } from '../../components/MessageOverlay/MessageActionListItem';
|
|
46
47
|
import type { OverlayReactionListProps } from '../../components/MessageOverlay/OverlayReactionList';
|
|
47
48
|
import type { ReplyProps } from '../../components/Reply/Reply';
|
|
@@ -296,6 +297,7 @@ export type MessagesContextValue<
|
|
|
296
297
|
* Optional function to custom format the message date
|
|
297
298
|
*/
|
|
298
299
|
formatDate?: (date: TDateTimeParserInput) => string;
|
|
300
|
+
getMessagesGroupStyles?: typeof getGroupStyles;
|
|
299
301
|
handleBlock?: (message: MessageType<StreamChatGenerics>) => Promise<void>;
|
|
300
302
|
/** Handler to access when a copy message action is invoked */
|
|
301
303
|
handleCopy?: (message: MessageType<StreamChatGenerics>) => Promise<void>;
|
package/src/version.json
CHANGED