stream-chat-react-native-core 7.0.0-rc.8 → 7.0.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/README.md +1 -1
- package/lib/commonjs/components/Attachment/AudioAttachment.js +19 -9
- package/lib/commonjs/components/Attachment/AudioAttachment.js.map +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +3 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +16 -3
- package/lib/commonjs/components/Attachment/Gallery.js.map +1 -1
- package/lib/commonjs/components/Attachment/ImageReloadIndicator.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +2 -2
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js +7 -24
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +2 -4
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +320 -310
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useChannelDataState.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/Channel/hooks/useMessageListPagination.js +133 -147
- package/lib/commonjs/components/Channel/hooks/useMessageListPagination.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +8 -13
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +14 -7
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +70 -54
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +14 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js +3 -1
- package/lib/commonjs/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +25 -39
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +18 -15
- package/lib/commonjs/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +96 -74
- package/lib/commonjs/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +2 -1
- package/lib/commonjs/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -1
- package/lib/commonjs/components/MessageInput/hooks/useAudioController.js +4 -4
- package/lib/commonjs/components/MessageInput/hooks/useAudioController.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +281 -223
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js +65 -48
- package/lib/commonjs/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/hooks/useShouldScrollToRecentOnNewOwnMessage.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js +1 -1
- package/lib/commonjs/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/commonjs/components/MessageList/utils/getReadState.js +20 -0
- package/lib/commonjs/components/MessageList/utils/getReadState.js.map +1 -0
- package/lib/commonjs/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
- package/lib/commonjs/components/Poll/components/Button.js.map +1 -1
- package/lib/commonjs/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/commonjs/components/Reply/Reply.js +2 -2
- package/lib/commonjs/components/Reply/Reply.js.map +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +24 -6
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/commonjs/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js +10 -6
- package/lib/commonjs/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/commonjs/components/index.js +15 -4
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js +5 -1
- package/lib/commonjs/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/commonjs/contexts/debugContext/DebugContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +535 -523
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +7 -6
- package/lib/commonjs/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js +37 -41
- package/lib/commonjs/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/utils/utils.js +4 -4
- package/lib/commonjs/contexts/messageInputContext/utils/utils.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/contexts/pollContext/pollContext.js.map +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +23 -14
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js +2 -1
- package/lib/commonjs/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/commonjs/contexts/threadsContext/ThreadListItemContext.js.map +1 -1
- package/lib/commonjs/hooks/index.js +22 -0
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useAudioPlayer.js +60 -69
- package/lib/commonjs/hooks/useAudioPlayer.js.map +1 -1
- package/lib/commonjs/hooks/useStableCallback.js +13 -0
- package/lib/commonjs/hooks/useStableCallback.js.map +1 -0
- package/lib/commonjs/hooks/useTranslatedMessage.js.map +1 -1
- package/lib/commonjs/i18n/en.json +3 -0
- package/lib/commonjs/i18n/es.json +3 -0
- package/lib/commonjs/i18n/fr.json +3 -0
- package/lib/commonjs/i18n/he.json +3 -0
- package/lib/commonjs/i18n/hi.json +2 -0
- package/lib/commonjs/i18n/it.json +3 -0
- package/lib/commonjs/i18n/ja.json +1 -0
- package/lib/commonjs/i18n/ko.json +1 -0
- package/lib/commonjs/i18n/nl.json +2 -0
- package/lib/commonjs/i18n/pt-br.json +3 -0
- package/lib/commonjs/i18n/ru.json +4 -0
- package/lib/commonjs/i18n/tr.json +2 -0
- package/lib/commonjs/mock-builders/api/channelMocks.js.map +1 -1
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/commonjs/types/types.js.map +1 -1
- package/lib/commonjs/utils/compressImage.js +1 -1
- package/lib/commonjs/utils/compressImage.js.map +1 -1
- package/lib/commonjs/utils/removeReservedFields.js.map +1 -1
- package/lib/commonjs/utils/utils.js +17 -4
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/AudioAttachment.js +19 -9
- package/lib/module/components/Attachment/AudioAttachment.js.map +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +3 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js.map +1 -1
- package/lib/module/components/Attachment/Gallery.js +16 -3
- package/lib/module/components/Attachment/Gallery.js.map +1 -1
- package/lib/module/components/Attachment/ImageReloadIndicator.js.map +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +2 -2
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js +7 -24
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +2 -4
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +320 -310
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useChannelDataState.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/Channel/hooks/useMessageListPagination.js +133 -147
- package/lib/module/components/Channel/hooks/useMessageListPagination.js.map +1 -1
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +8 -13
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js.map +1 -1
- package/lib/module/components/Message/Message.js +14 -7
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +70 -54
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +14 -6
- package/lib/module/components/Message/MessageSimple/MessageStatus.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.js.map +1 -1
- package/lib/module/components/Message/hooks/useCreateMessageContext.js +3 -1
- package/lib/module/components/Message/hooks/useCreateMessageContext.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActionHandlers.js.map +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js.map +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +25 -39
- package/lib/module/components/MessageInput/FileUploadPreview.js.map +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +18 -15
- package/lib/module/components/MessageInput/InputButtons.js.map +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +96 -74
- package/lib/module/components/MessageInput/MessageInput.js.map +1 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js +2 -1
- package/lib/module/components/MessageInput/components/AudioRecorder/AudioRecordingButton.js.map +1 -1
- package/lib/module/components/MessageInput/hooks/useAudioController.js +4 -4
- package/lib/module/components/MessageInput/hooks/useAudioController.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +281 -223
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useMessageList.js +65 -48
- package/lib/module/components/MessageList/hooks/useMessageList.js.map +1 -1
- package/lib/module/components/MessageList/hooks/useShouldScrollToRecentOnNewOwnMessage.js.map +1 -1
- package/lib/module/components/MessageList/utils/getGroupStyles.js +1 -1
- package/lib/module/components/MessageList/utils/getGroupStyles.js.map +1 -1
- package/lib/module/components/MessageList/utils/getLastReceivedMessage.js.map +1 -1
- package/lib/module/components/MessageList/utils/getReadState.js +20 -0
- package/lib/module/components/MessageList/utils/getReadState.js.map +1 -0
- package/lib/module/components/MessageMenu/hooks/useFetchReactions.js.map +1 -1
- package/lib/module/components/Poll/components/Button.js.map +1 -1
- package/lib/module/components/Poll/components/PollResults/PollResultItem.js.map +1 -1
- package/lib/module/components/Reply/Reply.js +2 -2
- package/lib/module/components/Reply/Reply.js.map +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +24 -6
- package/lib/module/components/Thread/components/ThreadFooterComponent.js.map +1 -1
- package/lib/module/components/ThreadList/ThreadListItem.js.map +1 -1
- package/lib/module/components/UIComponents/BottomSheetModal.js +10 -6
- package/lib/module/components/UIComponents/BottomSheetModal.js.map +1 -1
- package/lib/module/components/index.js +15 -4
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js.map +1 -1
- package/lib/module/contexts/channelsStateContext/useChannelState.js +5 -1
- package/lib/module/contexts/channelsStateContext/useChannelState.js.map +1 -1
- package/lib/module/contexts/debugContext/DebugContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +535 -523
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js +7 -6
- package/lib/module/contexts/messageInputContext/hooks/useCreateMessageInputContext.js.map +1 -1
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js +37 -41
- package/lib/module/contexts/messageInputContext/hooks/useMessageDetailsForState.js.map +1 -1
- package/lib/module/contexts/messageInputContext/utils/utils.js +4 -4
- package/lib/module/contexts/messageInputContext/utils/utils.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/contexts/pollContext/pollContext.js.map +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +23 -14
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js.map +1 -1
- package/lib/module/contexts/themeContext/utils/theme.js +2 -1
- package/lib/module/contexts/themeContext/utils/theme.js.map +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js.map +1 -1
- package/lib/module/contexts/threadsContext/ThreadListItemContext.js.map +1 -1
- package/lib/module/hooks/index.js +22 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useAudioPlayer.js +60 -69
- package/lib/module/hooks/useAudioPlayer.js.map +1 -1
- package/lib/module/hooks/useStableCallback.js +13 -0
- package/lib/module/hooks/useStableCallback.js.map +1 -0
- package/lib/module/hooks/useTranslatedMessage.js.map +1 -1
- package/lib/module/i18n/en.json +3 -0
- package/lib/module/i18n/es.json +3 -0
- package/lib/module/i18n/fr.json +3 -0
- package/lib/module/i18n/he.json +3 -0
- package/lib/module/i18n/hi.json +2 -0
- package/lib/module/i18n/it.json +3 -0
- package/lib/module/i18n/ja.json +1 -0
- package/lib/module/i18n/ko.json +1 -0
- package/lib/module/i18n/nl.json +2 -0
- package/lib/module/i18n/pt-br.json +3 -0
- package/lib/module/i18n/ru.json +4 -0
- package/lib/module/i18n/tr.json +2 -0
- package/lib/module/mock-builders/api/channelMocks.js.map +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -1
- package/lib/module/types/types.js.map +1 -1
- package/lib/module/utils/compressImage.js +1 -1
- package/lib/module/utils/compressImage.js.map +1 -1
- package/lib/module/utils/removeReservedFields.js.map +1 -1
- package/lib/module/utils/utils.js +17 -4
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/AudioAttachment.d.ts +2 -2
- package/lib/typescript/components/Attachment/AudioAttachment.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/FileAttachmentGroup.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/Gallery.d.ts +3 -3
- package/lib/typescript/components/Attachment/Gallery.d.ts.map +1 -1
- package/lib/typescript/components/Attachment/ImageReloadIndicator.d.ts +4 -3
- package/lib/typescript/components/Attachment/ImageReloadIndicator.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerItem.d.ts +2 -2
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerItem.d.ts.map +1 -1
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteInput.d.ts +2 -3
- package/lib/typescript/components/AutoCompleteInput/AutoCompleteInput.d.ts.map +1 -1
- package/lib/typescript/components/Channel/Channel.d.ts +3 -4
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useChannelDataState.d.ts +2 -3
- package/lib/typescript/components/Channel/hooks/useChannelDataState.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateThreadContext.d.ts +6 -6
- package/lib/typescript/components/Channel/hooks/useCreateThreadContext.d.ts.map +1 -1
- package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts +3 -3
- package/lib/typescript/components/Channel/hooks/useMessageListPagination.d.ts.map +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useChannelPreviewData.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/hooks/useLatestMessagePreview.d.ts +1 -1
- package/lib/typescript/components/Chat/Chat.d.ts +0 -9
- package/lib/typescript/components/Chat/Chat.d.ts.map +1 -1
- package/lib/typescript/components/KeyboardCompatibleView/KeyboardCompatibleView.d.ts +3 -0
- package/lib/typescript/components/KeyboardCompatibleView/KeyboardCompatibleView.d.ts.map +1 -1
- package/lib/typescript/components/Message/Message.d.ts +4 -5
- package/lib/typescript/components/Message/Message.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts +2 -3
- package/lib/typescript/components/Message/MessageSimple/MessageFooter.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageSimple.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageStatus.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageTextContainer.d.ts.map +1 -1
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts +2 -2
- package/lib/typescript/components/Message/MessageSimple/utils/renderText.d.ts.map +1 -1
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useCreateMessageContext.d.ts.map +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts.map +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +2 -2
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts +2 -4
- package/lib/typescript/components/MessageInput/FileUploadPreview.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/InputButtons.d.ts +1 -1
- package/lib/typescript/components/MessageInput/InputButtons.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts +1 -1
- package/lib/typescript/components/MessageInput/MessageInput.d.ts.map +1 -1
- package/lib/typescript/components/MessageInput/hooks/useAudioController.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts +4 -4
- package/lib/typescript/components/MessageList/MessageList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/MessageSystem.d.ts +2 -2
- package/lib/typescript/components/MessageList/MessageSystem.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts +14 -9
- package/lib/typescript/components/MessageList/hooks/useMessageList.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/hooks/useShouldScrollToRecentOnNewOwnMessage.d.ts +2 -2
- package/lib/typescript/components/MessageList/hooks/useShouldScrollToRecentOnNewOwnMessage.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/utils/getGroupStyles.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/utils/getLastReceivedMessage.d.ts +2 -2
- package/lib/typescript/components/MessageList/utils/getLastReceivedMessage.d.ts.map +1 -1
- package/lib/typescript/components/MessageList/utils/getReadState.d.ts +9 -0
- package/lib/typescript/components/MessageList/utils/getReadState.d.ts.map +1 -0
- package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts +2 -3
- package/lib/typescript/components/MessageMenu/hooks/useFetchReactions.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/Button.d.ts +2 -3
- package/lib/typescript/components/Poll/components/Button.d.ts.map +1 -1
- package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts +2 -3
- package/lib/typescript/components/Poll/components/PollResults/PollResultItem.d.ts.map +1 -1
- package/lib/typescript/components/Reply/Reply.d.ts.map +1 -1
- package/lib/typescript/components/Thread/components/ThreadFooterComponent.d.ts.map +1 -1
- package/lib/typescript/components/ThreadList/ThreadListItem.d.ts.map +1 -1
- package/lib/typescript/components/UIComponents/BottomSheetModal.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +2 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts +3 -3
- package/lib/typescript/contexts/attachmentPickerContext/AttachmentPickerContext.d.ts.map +1 -1
- package/lib/typescript/contexts/channelsStateContext/useChannelState.d.ts.map +1 -1
- package/lib/typescript/contexts/debugContext/DebugContext.d.ts +2 -3
- package/lib/typescript/contexts/debugContext/DebugContext.d.ts.map +1 -1
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +3 -3
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts +6 -4
- package/lib/typescript/contexts/messageContext/MessageContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts +13 -15
- package/lib/typescript/contexts/messageInputContext/MessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useCreateMessageInputContext.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts +3 -3
- package/lib/typescript/contexts/messageInputContext/hooks/useMessageDetailsForState.d.ts.map +1 -1
- package/lib/typescript/contexts/messageInputContext/utils/utils.d.ts +2 -2
- package/lib/typescript/contexts/messageInputContext/utils/utils.d.ts.map +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +25 -21
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
- package/lib/typescript/contexts/pollContext/pollContext.d.ts +2 -3
- package/lib/typescript/contexts/pollContext/pollContext.d.ts.map +1 -1
- package/lib/typescript/contexts/suggestionsContext/SuggestionsContext.d.ts.map +1 -1
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts +1 -0
- package/lib/typescript/contexts/themeContext/utils/theme.d.ts.map +1 -1
- package/lib/typescript/contexts/threadContext/ThreadContext.d.ts +4 -5
- package/lib/typescript/contexts/threadContext/ThreadContext.d.ts.map +1 -1
- package/lib/typescript/contexts/threadsContext/ThreadListItemContext.d.ts +3 -4
- package/lib/typescript/contexts/threadsContext/ThreadListItemContext.d.ts.map +1 -1
- package/lib/typescript/hooks/index.d.ts +2 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -1
- package/lib/typescript/hooks/useAudioPlayer.d.ts.map +1 -1
- package/lib/typescript/hooks/useStableCallback.d.ts +26 -0
- package/lib/typescript/hooks/useStableCallback.d.ts.map +1 -0
- package/lib/typescript/hooks/useTranslatedMessage.d.ts +59 -58
- package/lib/typescript/hooks/useTranslatedMessage.d.ts.map +1 -1
- package/lib/typescript/i18n/en.json +3 -0
- package/lib/typescript/i18n/es.json +3 -0
- package/lib/typescript/i18n/fr.json +3 -0
- package/lib/typescript/i18n/he.json +3 -0
- package/lib/typescript/i18n/hi.json +2 -0
- package/lib/typescript/i18n/it.json +3 -0
- package/lib/typescript/i18n/ja.json +1 -0
- package/lib/typescript/i18n/ko.json +1 -0
- package/lib/typescript/i18n/nl.json +2 -0
- package/lib/typescript/i18n/pt-br.json +3 -0
- package/lib/typescript/i18n/ru.json +4 -0
- package/lib/typescript/i18n/tr.json +2 -0
- package/lib/typescript/native.d.ts +8 -11
- package/lib/typescript/native.d.ts.map +1 -1
- package/lib/typescript/store/apis/insertReaction.d.ts +2 -2
- package/lib/typescript/store/apis/insertReaction.d.ts.map +1 -1
- package/lib/typescript/store/apis/updateMessage.d.ts +2 -2
- package/lib/typescript/store/apis/updateMessage.d.ts.map +1 -1
- package/lib/typescript/store/apis/updateReaction.d.ts +2 -2
- package/lib/typescript/store/apis/updateReaction.d.ts.map +1 -1
- package/lib/typescript/store/mappers/mapMessageToStorable.d.ts +2 -2
- package/lib/typescript/store/mappers/mapMessageToStorable.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +28 -50
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/utils/compressImage.d.ts +2 -2
- package/lib/typescript/utils/compressImage.d.ts.map +1 -1
- package/lib/typescript/utils/i18n/Streami18n.d.ts +3 -0
- package/lib/typescript/utils/i18n/Streami18n.d.ts.map +1 -1
- package/lib/typescript/utils/removeReservedFields.d.ts +2 -3
- package/lib/typescript/utils/removeReservedFields.d.ts.map +1 -1
- package/lib/typescript/utils/utils.d.ts +10 -10
- package/lib/typescript/utils/utils.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/Attachment/AudioAttachment.tsx +12 -6
- package/src/components/Attachment/FileAttachmentGroup.tsx +3 -1
- package/src/components/Attachment/Gallery.tsx +22 -7
- package/src/components/Attachment/ImageReloadIndicator.tsx +4 -5
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +4 -10
- package/src/components/AttachmentPicker/components/AttachmentPickerItem.tsx +9 -37
- package/src/components/AutoCompleteInput/AutoCompleteInput.tsx +27 -23
- package/src/components/AutoCompleteInput/__tests__/AutoCompleteInput.test.js +12 -12
- package/src/components/Channel/Channel.tsx +423 -361
- package/src/components/Channel/__tests__/Channel.test.js +10 -3
- package/src/components/Channel/hooks/useChannelDataState.ts +2 -4
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +2 -0
- package/src/components/Channel/hooks/useMessageListPagination.tsx +150 -150
- package/src/components/Chat/Chat.tsx +0 -9
- package/src/components/ImageGallery/__tests__/ImageGallery.test.tsx +8 -7
- package/src/components/ImageGallery/__tests__/ImageGalleryFooter.test.tsx +5 -4
- package/src/components/ImageGallery/__tests__/ImageGalleryHeader.test.tsx +5 -4
- package/src/components/ImageGallery/__tests__/ImageGalleryOverlay.test.tsx +3 -2
- package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx +12 -5
- package/src/components/Message/Message.tsx +16 -15
- package/src/components/Message/MessageSimple/MessageFooter.tsx +2 -3
- package/src/components/Message/MessageSimple/MessageSimple.tsx +112 -70
- package/src/components/Message/MessageSimple/MessageStatus.tsx +19 -17
- package/src/components/Message/MessageSimple/MessageTextContainer.tsx +3 -3
- package/src/components/Message/MessageSimple/__tests__/MessageStatus.test.js +11 -5
- package/src/components/Message/MessageSimple/__tests__/MessageTextContainer.test.tsx +5 -4
- package/src/components/Message/MessageSimple/utils/renderText.tsx +2 -3
- package/src/components/Message/hooks/useCreateMessageContext.ts +3 -0
- package/src/components/Message/hooks/useMessageActionHandlers.ts +1 -3
- package/src/components/Message/hooks/useMessageActions.tsx +4 -3
- package/src/components/MessageInput/FileUploadPreview.tsx +41 -70
- package/src/components/MessageInput/ImageUploadPreview.tsx +2 -2
- package/src/components/MessageInput/InputButtons.tsx +14 -10
- package/src/components/MessageInput/MessageInput.tsx +28 -30
- package/src/components/MessageInput/__tests__/FileUploadPreview.test.js +1 -1
- package/src/components/MessageInput/__tests__/MessageInput.test.js +3 -1
- package/src/components/MessageInput/components/AudioRecorder/AudioRecordingButton.tsx +1 -0
- package/src/components/MessageInput/hooks/useAudioController.tsx +6 -5
- package/src/components/MessageList/MessageList.tsx +253 -137
- package/src/components/MessageList/MessageSystem.tsx +2 -2
- package/src/components/MessageList/hooks/useMessageList.ts +82 -64
- package/src/components/MessageList/hooks/useShouldScrollToRecentOnNewOwnMessage.ts +2 -2
- package/src/components/MessageList/utils/getGroupStyles.ts +7 -5
- package/src/components/MessageList/utils/getLastReceivedMessage.ts +3 -3
- package/src/components/MessageList/utils/getReadState.ts +27 -0
- package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx +2 -3
- package/src/components/MessageMenu/hooks/useFetchReactions.ts +2 -3
- package/src/components/Poll/components/Button.tsx +2 -4
- package/src/components/Poll/components/PollResults/PollResultItem.tsx +2 -3
- package/src/components/Reply/Reply.tsx +1 -2
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +318 -847
- package/src/components/Thread/components/ThreadFooterComponent.tsx +31 -9
- package/src/components/ThreadList/ThreadListItem.tsx +6 -4
- package/src/components/UIComponents/BottomSheetModal.tsx +11 -7
- package/src/components/index.ts +2 -1
- package/src/contexts/attachmentPickerContext/AttachmentPickerContext.tsx +5 -4
- package/src/contexts/channelsStateContext/useChannelState.ts +5 -1
- package/src/contexts/debugContext/DebugContext.tsx +2 -4
- package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +5 -4
- package/src/contexts/messageContext/MessageContext.tsx +6 -4
- package/src/contexts/messageInputContext/MessageInputContext.tsx +295 -262
- package/src/contexts/messageInputContext/__tests__/__snapshots__/sendMessage.test.tsx.snap +10 -6
- package/src/contexts/messageInputContext/__tests__/sendMessage.test.tsx +6 -5
- package/src/contexts/messageInputContext/__tests__/updateMessage.test.tsx +3 -5
- package/src/contexts/messageInputContext/__tests__/useMessageDetailsForState.test.tsx +14 -9
- package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts +7 -3
- package/src/contexts/messageInputContext/hooks/useMessageDetailsForState.ts +37 -40
- package/src/contexts/messageInputContext/utils/utils.ts +6 -8
- package/src/contexts/messagesContext/MessagesContext.tsx +26 -20
- package/src/contexts/pollContext/pollContext.tsx +2 -4
- package/src/contexts/suggestionsContext/SuggestionsContext.tsx +33 -14
- package/src/contexts/themeContext/utils/theme.ts +2 -0
- package/src/contexts/threadContext/ThreadContext.tsx +4 -6
- package/src/contexts/threadsContext/ThreadListItemContext.tsx +3 -5
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useAudioPlayer.ts +37 -31
- package/src/hooks/useStableCallback.ts +37 -0
- package/src/hooks/useTranslatedMessage.ts +2 -2
- package/src/i18n/en.json +3 -0
- package/src/i18n/es.json +3 -0
- package/src/i18n/fr.json +3 -0
- package/src/i18n/he.json +3 -0
- package/src/i18n/hi.json +2 -0
- package/src/i18n/it.json +3 -0
- package/src/i18n/ja.json +1 -0
- package/src/i18n/ko.json +1 -0
- package/src/i18n/nl.json +2 -0
- package/src/i18n/pt-br.json +3 -0
- package/src/i18n/ru.json +4 -0
- package/src/i18n/tr.json +2 -0
- package/src/mock-builders/api/channelMocks.tsx +2 -8
- package/src/native.ts +13 -8
- package/src/store/apis/insertReaction.ts +2 -2
- package/src/store/apis/updateMessage.ts +2 -2
- package/src/store/apis/updateReaction.ts +2 -2
- package/src/store/mappers/mapMessageToStorable.ts +2 -2
- package/src/types/stream-chat-common-custom-data.d.ts +22 -22
- package/src/types/types.ts +35 -54
- package/src/utils/compressImage.ts +3 -4
- package/src/utils/removeReservedFields.ts +3 -5
- package/src/utils/utils.ts +25 -16
- package/src/version.json +1 -1
- package/lib/commonjs/components/MessageList/hooks/useLastReadData.js +0 -20
- package/lib/commonjs/components/MessageList/hooks/useLastReadData.js.map +0 -1
- package/lib/commonjs/components/MessageList/utils/getReadStates.js +0 -34
- package/lib/commonjs/components/MessageList/utils/getReadStates.js.map +0 -1
- package/lib/module/components/MessageList/hooks/useLastReadData.js +0 -20
- package/lib/module/components/MessageList/hooks/useLastReadData.js.map +0 -1
- package/lib/module/components/MessageList/utils/getReadStates.js +0 -34
- package/lib/module/components/MessageList/utils/getReadStates.js.map +0 -1
- package/lib/typescript/components/MessageList/hooks/useLastReadData.d.ts +0 -12
- package/lib/typescript/components/MessageList/hooks/useLastReadData.d.ts.map +0 -1
- package/lib/typescript/components/MessageList/utils/getReadStates.d.ts +0 -5
- package/lib/typescript/components/MessageList/utils/getReadStates.d.ts.map +0 -1
- package/src/components/MessageList/hooks/useLastReadData.ts +0 -29
- package/src/components/MessageList/utils/getReadStates.ts +0 -55
|
@@ -58,7 +58,12 @@ export class KeyboardCompatibleView extends React.Component<
|
|
|
58
58
|
|
|
59
59
|
_relativeKeyboardHeight(keyboardFrame: KeyboardMetrics) {
|
|
60
60
|
const frame = this._frame;
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* With iOS 14 & Reduce Motion > Prefer Cross-Fade Transitions enabled, the keyboard position
|
|
63
|
+
* height is reported differently (0 instead of Y position value) which caused the view to take full height
|
|
64
|
+
* of the screen.
|
|
65
|
+
*/
|
|
66
|
+
if (!frame || !keyboardFrame || keyboardFrame.screenY === 0) {
|
|
62
67
|
return 0;
|
|
63
68
|
}
|
|
64
69
|
|
|
@@ -197,6 +202,8 @@ export class KeyboardCompatibleView extends React.Component<
|
|
|
197
202
|
this.unsetKeyboardListeners();
|
|
198
203
|
}
|
|
199
204
|
|
|
205
|
+
keyboardContextValue = { dismissKeyboard: this.dismissKeyboard };
|
|
206
|
+
|
|
200
207
|
render() {
|
|
201
208
|
const { behavior, children, contentContainerStyle, enabled, style, ...props } = this.props;
|
|
202
209
|
const bottomHeight = enabled ? this.state.bottom : 0;
|
|
@@ -215,7 +222,7 @@ export class KeyboardCompatibleView extends React.Component<
|
|
|
215
222
|
};
|
|
216
223
|
}
|
|
217
224
|
return (
|
|
218
|
-
<KeyboardProvider value={
|
|
225
|
+
<KeyboardProvider value={this.keyboardContextValue}>
|
|
219
226
|
<View
|
|
220
227
|
onLayout={this._onLayout}
|
|
221
228
|
ref={this.viewRef}
|
|
@@ -229,7 +236,7 @@ export class KeyboardCompatibleView extends React.Component<
|
|
|
229
236
|
|
|
230
237
|
case 'position':
|
|
231
238
|
return (
|
|
232
|
-
<KeyboardProvider value={
|
|
239
|
+
<KeyboardProvider value={this.keyboardContextValue}>
|
|
233
240
|
<View onLayout={this._onLayout} ref={this.viewRef} style={style} {...props}>
|
|
234
241
|
<View
|
|
235
242
|
style={StyleSheet.compose(contentContainerStyle, {
|
|
@@ -244,7 +251,7 @@ export class KeyboardCompatibleView extends React.Component<
|
|
|
244
251
|
|
|
245
252
|
case 'padding':
|
|
246
253
|
return (
|
|
247
|
-
<KeyboardProvider value={
|
|
254
|
+
<KeyboardProvider value={this.keyboardContextValue}>
|
|
248
255
|
<View
|
|
249
256
|
onLayout={this._onLayout}
|
|
250
257
|
ref={this.viewRef}
|
|
@@ -258,7 +265,7 @@ export class KeyboardCompatibleView extends React.Component<
|
|
|
258
265
|
|
|
259
266
|
default:
|
|
260
267
|
return (
|
|
261
|
-
<KeyboardProvider value={
|
|
268
|
+
<KeyboardProvider value={this.keyboardContextValue}>
|
|
262
269
|
<View onLayout={this._onLayout} ref={this.viewRef} style={style} {...props}>
|
|
263
270
|
{children}
|
|
264
271
|
</View>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
2
|
import { GestureResponderEvent, Keyboard, StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import type { Attachment, UserResponse } from 'stream-chat';
|
|
4
|
+
import type { Attachment, LocalMessage, UserResponse } from 'stream-chat';
|
|
5
5
|
|
|
6
6
|
import { useCreateMessageContext } from './hooks/useCreateMessageContext';
|
|
7
7
|
import { useMessageActionHandlers } from './hooks/useMessageActionHandlers';
|
|
@@ -41,11 +41,7 @@ import {
|
|
|
41
41
|
MessageStatusTypes,
|
|
42
42
|
} from '../../utils/utils';
|
|
43
43
|
import type { Thumbnail } from '../Attachment/utils/buildGallery/types';
|
|
44
|
-
|
|
45
|
-
import {
|
|
46
|
-
isMessageWithStylesReadByAndDateSeparator,
|
|
47
|
-
MessageType,
|
|
48
|
-
} from '../MessageList/hooks/useMessageList';
|
|
44
|
+
import { getReadState } from '../MessageList/utils/getReadState';
|
|
49
45
|
|
|
50
46
|
export type TouchableEmitter =
|
|
51
47
|
| 'fileAttachment'
|
|
@@ -114,7 +110,7 @@ export type MessagePressableHandlerPayload = PressableHandlerPayload & {
|
|
|
114
110
|
/**
|
|
115
111
|
* Message object, on which interaction occurred.
|
|
116
112
|
*/
|
|
117
|
-
message?:
|
|
113
|
+
message?: LocalMessage;
|
|
118
114
|
};
|
|
119
115
|
|
|
120
116
|
export type MessageActionHandlers = {
|
|
@@ -130,7 +126,7 @@ export type MessageActionHandlers = {
|
|
|
130
126
|
toggleMuteUser: () => Promise<void>;
|
|
131
127
|
toggleReaction: (reactionType: string) => Promise<void>;
|
|
132
128
|
unpinMessage: () => Promise<void>;
|
|
133
|
-
threadReply?: (message:
|
|
129
|
+
threadReply?: (message: LocalMessage) => Promise<void>;
|
|
134
130
|
};
|
|
135
131
|
|
|
136
132
|
export type MessagePropsWithContext = Pick<
|
|
@@ -194,7 +190,7 @@ export type MessagePropsWithContext = Pick<
|
|
|
194
190
|
*
|
|
195
191
|
* @param message A message object to open the thread upon.
|
|
196
192
|
*/
|
|
197
|
-
onThreadSelect?: (message:
|
|
193
|
+
onThreadSelect?: (message: LocalMessage) => void;
|
|
198
194
|
showUnreadUnderlay?: boolean;
|
|
199
195
|
style?: StyleProp<ViewStyle>;
|
|
200
196
|
};
|
|
@@ -267,6 +263,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
267
263
|
threadList = false,
|
|
268
264
|
updateMessage,
|
|
269
265
|
} = props;
|
|
266
|
+
const { read } = useChannelContext();
|
|
270
267
|
const isMessageAIGenerated = messagesContext.isMessageAIGenerated;
|
|
271
268
|
const isAIGenerated = useMemo(
|
|
272
269
|
() => isMessageAIGenerated(message),
|
|
@@ -277,10 +274,11 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
277
274
|
const {
|
|
278
275
|
theme: {
|
|
279
276
|
colors: { targetedMessageBackground },
|
|
280
|
-
messageSimple: { targetedMessageContainer, unreadUnderlayColor },
|
|
277
|
+
messageSimple: { targetedMessageContainer, unreadUnderlayColor, wrapper },
|
|
281
278
|
screenPadding,
|
|
282
279
|
},
|
|
283
280
|
} = useTheme();
|
|
281
|
+
const readBy = useMemo(() => getReadState(message, read), [message, read]);
|
|
284
282
|
|
|
285
283
|
const showMessageOverlay = async (showMessageReactions = false, selectedReaction?: string) => {
|
|
286
284
|
await dismissKeyboard();
|
|
@@ -312,7 +310,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
312
310
|
}
|
|
313
311
|
};
|
|
314
312
|
|
|
315
|
-
const onPressQuotedMessage = (quotedMessage:
|
|
313
|
+
const onPressQuotedMessage = (quotedMessage: LocalMessage) => {
|
|
316
314
|
if (!goToMessage) {
|
|
317
315
|
return;
|
|
318
316
|
}
|
|
@@ -329,7 +327,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
329
327
|
if (isEditedMessage(message)) {
|
|
330
328
|
setIsEditedMessageOpen((prevState) => !prevState);
|
|
331
329
|
}
|
|
332
|
-
const quotedMessage = message.quoted_message
|
|
330
|
+
const quotedMessage = message.quoted_message;
|
|
333
331
|
if (error) {
|
|
334
332
|
setIsErrorInMessage(true);
|
|
335
333
|
/**
|
|
@@ -693,6 +691,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
693
691
|
otherAttachments: attachments.other,
|
|
694
692
|
preventPress,
|
|
695
693
|
reactions,
|
|
694
|
+
readBy,
|
|
696
695
|
setIsEditedMessageOpen,
|
|
697
696
|
showAvatar,
|
|
698
697
|
showMessageOverlay,
|
|
@@ -718,8 +717,12 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
|
|
|
718
717
|
<View
|
|
719
718
|
style={[
|
|
720
719
|
{ marginTop: 2, paddingHorizontal: screenPadding },
|
|
720
|
+
wrapper,
|
|
721
721
|
(isTargetedMessage || message.pinned) && !isMessageTypeDeleted
|
|
722
|
-
? {
|
|
722
|
+
? {
|
|
723
|
+
backgroundColor: targetedMessageBackground,
|
|
724
|
+
...targetedMessageContainer,
|
|
725
|
+
}
|
|
723
726
|
: {},
|
|
724
727
|
]}
|
|
725
728
|
testID='message-wrapper'
|
|
@@ -810,8 +813,6 @@ const areEqual = (prevProps: MessagePropsWithContext, nextProps: MessagePropsWit
|
|
|
810
813
|
|
|
811
814
|
const messageEqual =
|
|
812
815
|
isPrevMessageTypeDeleted === isNextMessageTypeDeleted &&
|
|
813
|
-
(isMessageWithStylesReadByAndDateSeparator(prevMessage) && prevMessage.readBy) ===
|
|
814
|
-
(isMessageWithStylesReadByAndDateSeparator(nextMessage) && nextMessage.readBy) &&
|
|
815
816
|
prevMessage.status === nextMessage.status &&
|
|
816
817
|
prevMessage.type === nextMessage.type &&
|
|
817
818
|
prevMessage.text === nextMessage.text &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import type { Attachment } from 'stream-chat';
|
|
4
|
+
import type { Attachment, LocalMessage } from 'stream-chat';
|
|
5
5
|
|
|
6
6
|
import type { MessageStatusProps } from './MessageStatus';
|
|
7
7
|
|
|
@@ -21,7 +21,6 @@ import { useTranslationContext } from '../../../contexts/translationContext/Tran
|
|
|
21
21
|
import { Eye } from '../../../icons';
|
|
22
22
|
|
|
23
23
|
import { isEditedMessage, MessageStatusTypes } from '../../../utils/utils';
|
|
24
|
-
import type { MessageType } from '../../MessageList/hooks/useMessageList';
|
|
25
24
|
|
|
26
25
|
type MessageFooterComponentProps = {
|
|
27
26
|
date?: string | Date;
|
|
@@ -271,7 +270,7 @@ export type MessageFooterProps = Partial<Pick<ChannelContextValue, 'members'>> &
|
|
|
271
270
|
MessageFooterComponentProps & {
|
|
272
271
|
alignment?: Alignment;
|
|
273
272
|
lastGroupMessage?: boolean;
|
|
274
|
-
message?:
|
|
273
|
+
message?: LocalMessage;
|
|
275
274
|
MessageStatus?: React.ComponentType<MessageStatusProps>;
|
|
276
275
|
otherAttachments?: Attachment[];
|
|
277
276
|
showMessageStatus?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { Dimensions, LayoutChangeEvent, StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
@@ -12,6 +12,8 @@ import Animated, {
|
|
|
12
12
|
withSpring,
|
|
13
13
|
} from 'react-native-reanimated';
|
|
14
14
|
|
|
15
|
+
const AnimatedWrapper = Animated.createAnimatedComponent(View);
|
|
16
|
+
|
|
15
17
|
import {
|
|
16
18
|
MessageContextValue,
|
|
17
19
|
useMessageContext,
|
|
@@ -199,77 +201,104 @@ const MessageSimpleWithContext = (props: MessageSimplePropsWithContext) => {
|
|
|
199
201
|
|
|
200
202
|
const translateX = useSharedValue(0);
|
|
201
203
|
const touchStart = useSharedValue<{ x: number; y: number } | null>(null);
|
|
204
|
+
const isSwiping = useSharedValue<boolean>(false);
|
|
205
|
+
const [isBeingSwiped, setIsBeingSwiped] = useState<boolean>(false);
|
|
202
206
|
|
|
203
|
-
const onSwipeToReply = () => {
|
|
207
|
+
const onSwipeToReply = useCallback(() => {
|
|
204
208
|
clearQuotedMessageState();
|
|
205
209
|
setQuotedMessageState(message);
|
|
206
|
-
};
|
|
210
|
+
}, [clearQuotedMessageState, message, setQuotedMessageState]);
|
|
207
211
|
|
|
208
212
|
const THRESHOLD = 25;
|
|
209
213
|
|
|
210
214
|
const triggerHaptic = NativeHandlers.triggerHaptic;
|
|
211
215
|
|
|
212
|
-
const swipeGesture =
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
216
|
+
const swipeGesture = useMemo(
|
|
217
|
+
() =>
|
|
218
|
+
Gesture.Pan()
|
|
219
|
+
.hitSlop(messageSwipeToReplyHitSlop)
|
|
220
|
+
.onBegin((event) => {
|
|
221
|
+
touchStart.value = { x: event.x, y: event.y };
|
|
222
|
+
})
|
|
223
|
+
.onTouchesMove((event, state) => {
|
|
224
|
+
if (!touchStart.value || !event.changedTouches.length) {
|
|
225
|
+
state.fail();
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const xDiff = Math.abs(event.changedTouches[0].x - touchStart.value.x);
|
|
230
|
+
const yDiff = Math.abs(event.changedTouches[0].y - touchStart.value.y);
|
|
231
|
+
const isHorizontalPanning = xDiff > yDiff;
|
|
232
|
+
|
|
233
|
+
if (isHorizontalPanning) {
|
|
234
|
+
state.activate();
|
|
235
|
+
isSwiping.value = true;
|
|
236
|
+
runOnJS(setIsBeingSwiped)(true);
|
|
237
|
+
} else {
|
|
238
|
+
state.fail();
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
.onStart(() => {
|
|
242
|
+
translateX.value = 0;
|
|
243
|
+
})
|
|
244
|
+
.onChange(({ translationX }) => {
|
|
245
|
+
if (translationX > 0) {
|
|
246
|
+
translateX.value = translationX;
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
.onEnd(() => {
|
|
250
|
+
if (translateX.value >= THRESHOLD) {
|
|
251
|
+
runOnJS(onSwipeToReply)();
|
|
252
|
+
if (triggerHaptic) {
|
|
253
|
+
runOnJS(triggerHaptic)('impactMedium');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
translateX.value = withSpring(
|
|
257
|
+
0,
|
|
258
|
+
{
|
|
259
|
+
dampingRatio: 1,
|
|
260
|
+
duration: 500,
|
|
261
|
+
overshootClamping: true,
|
|
262
|
+
stiffness: 1,
|
|
263
|
+
},
|
|
264
|
+
() => {
|
|
265
|
+
isSwiping.value = false;
|
|
266
|
+
runOnJS(setIsBeingSwiped)(false);
|
|
267
|
+
},
|
|
268
|
+
);
|
|
269
|
+
}),
|
|
270
|
+
[isSwiping, messageSwipeToReplyHitSlop, onSwipeToReply, touchStart, translateX, triggerHaptic],
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
const messageBubbleAnimatedStyle = useAnimatedStyle(
|
|
274
|
+
() =>
|
|
275
|
+
isSwiping.value
|
|
276
|
+
? {
|
|
277
|
+
transform: [{ translateX: translateX.value }],
|
|
278
|
+
}
|
|
279
|
+
: {},
|
|
280
|
+
[],
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
const swipeContentAnimatedStyle = useAnimatedStyle(
|
|
284
|
+
() =>
|
|
285
|
+
isSwiping.value
|
|
286
|
+
? {
|
|
287
|
+
opacity: interpolate(translateX.value, [0, THRESHOLD], [0, 1]),
|
|
288
|
+
transform: [
|
|
289
|
+
{
|
|
290
|
+
translateX: interpolate(
|
|
291
|
+
translateX.value,
|
|
292
|
+
[0, THRESHOLD],
|
|
293
|
+
[-THRESHOLD, 0],
|
|
294
|
+
Extrapolation.CLAMP,
|
|
295
|
+
),
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
}
|
|
299
|
+
: {},
|
|
300
|
+
[],
|
|
301
|
+
);
|
|
273
302
|
|
|
274
303
|
const renderMessageBubble = useMemo(
|
|
275
304
|
() => (
|
|
@@ -303,18 +332,31 @@ const MessageSimpleWithContext = (props: MessageSimplePropsWithContext) => {
|
|
|
303
332
|
() => (
|
|
304
333
|
<GestureDetector gesture={swipeGesture}>
|
|
305
334
|
<View hitSlop={messageSwipeToReplyHitSlop} style={[styles.contentWrapper, contentWrapper]}>
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
335
|
+
{isBeingSwiped ? (
|
|
336
|
+
<>
|
|
337
|
+
<AnimatedWrapper
|
|
338
|
+
style={[
|
|
339
|
+
styles.swipeContentContainer,
|
|
340
|
+
swipeContentAnimatedStyle,
|
|
341
|
+
swipeContentContainer,
|
|
342
|
+
]}
|
|
343
|
+
>
|
|
344
|
+
{MessageSwipeContent ? <MessageSwipeContent /> : null}
|
|
345
|
+
</AnimatedWrapper>
|
|
346
|
+
<AnimatedWrapper pointerEvents='box-none' style={messageBubbleAnimatedStyle}>
|
|
347
|
+
{renderMessageBubble}
|
|
348
|
+
</AnimatedWrapper>
|
|
349
|
+
</>
|
|
350
|
+
) : (
|
|
351
|
+
renderMessageBubble
|
|
352
|
+
)}
|
|
312
353
|
</View>
|
|
313
354
|
</GestureDetector>
|
|
314
355
|
),
|
|
315
356
|
[
|
|
316
357
|
MessageSwipeContent,
|
|
317
358
|
contentWrapper,
|
|
359
|
+
isBeingSwiped,
|
|
318
360
|
messageBubbleAnimatedStyle,
|
|
319
361
|
messageSwipeToReplyHitSlop,
|
|
320
362
|
renderMessageBubble,
|
|
@@ -10,16 +10,16 @@ import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
|
10
10
|
import { Check } from '../../../icons/Check';
|
|
11
11
|
import { CheckAll } from '../../../icons/CheckAll';
|
|
12
12
|
import { Time } from '../../../icons/Time';
|
|
13
|
-
|
|
14
13
|
import { MessageStatusTypes } from '../../../utils/utils';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export type MessageStatusPropsWithContext = Pick<
|
|
16
|
+
MessageContextValue,
|
|
17
|
+
'message' | 'readBy' | 'threadList'
|
|
18
|
+
>;
|
|
19
19
|
|
|
20
20
|
const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
|
|
21
21
|
const { channel } = useChannelContext();
|
|
22
|
-
const { message, threadList } = props;
|
|
22
|
+
const { message, readBy, threadList } = props;
|
|
23
23
|
|
|
24
24
|
const {
|
|
25
25
|
theme: {
|
|
@@ -42,17 +42,17 @@ const MessageStatusWithContext = (props: MessageStatusPropsWithContext) => {
|
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
if (
|
|
45
|
+
if (readBy) {
|
|
46
46
|
const members = channel?.state.members;
|
|
47
47
|
const otherMembers = Object.values(members).filter(
|
|
48
48
|
(member) => member.user_id !== message.user?.id,
|
|
49
49
|
);
|
|
50
50
|
const hasOtherMembersGreaterThanOne = otherMembers.length > 1;
|
|
51
|
-
const hasReadByGreaterThanOne = typeof
|
|
51
|
+
const hasReadByGreaterThanOne = typeof readBy === 'number' && readBy > 1;
|
|
52
52
|
const shouldDisplayReadByCount = hasOtherMembersGreaterThanOne && hasReadByGreaterThanOne;
|
|
53
53
|
const countOfReadBy =
|
|
54
|
-
typeof
|
|
55
|
-
const showDoubleCheck = hasReadByGreaterThanOne ||
|
|
54
|
+
typeof readBy === 'number' && hasOtherMembersGreaterThanOne ? readBy - 1 : 0;
|
|
55
|
+
const showDoubleCheck = hasReadByGreaterThanOne || readBy === true;
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<View style={[styles.statusContainer, statusContainer]}>
|
|
@@ -90,19 +90,21 @@ const areEqual = (
|
|
|
90
90
|
prevProps: MessageStatusPropsWithContext,
|
|
91
91
|
nextProps: MessageStatusPropsWithContext,
|
|
92
92
|
) => {
|
|
93
|
-
const { message: prevMessage, threadList: prevThreadList } = prevProps;
|
|
94
|
-
const { message: nextMessage, threadList: nextThreadList } = nextProps;
|
|
93
|
+
const { message: prevMessage, readBy: prevReadBy, threadList: prevThreadList } = prevProps;
|
|
94
|
+
const { message: nextMessage, readBy: nextReadBy, threadList: nextThreadList } = nextProps;
|
|
95
95
|
|
|
96
96
|
const threadListEqual = prevThreadList === nextThreadList;
|
|
97
97
|
if (!threadListEqual) {
|
|
98
98
|
return false;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
const readByEqual = prevReadBy === nextReadBy;
|
|
102
|
+
if (!readByEqual) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
101
106
|
const messageEqual =
|
|
102
|
-
prevMessage.status === nextMessage.status &&
|
|
103
|
-
prevMessage.type === nextMessage.type &&
|
|
104
|
-
(isMessageWithStylesReadByAndDateSeparator(prevMessage) && prevMessage.readBy) ===
|
|
105
|
-
(isMessageWithStylesReadByAndDateSeparator(nextMessage) && nextMessage.readBy);
|
|
107
|
+
prevMessage.status === nextMessage.status && prevMessage.type === nextMessage.type;
|
|
106
108
|
if (!messageEqual) {
|
|
107
109
|
return false;
|
|
108
110
|
}
|
|
@@ -118,9 +120,9 @@ const MemoizedMessageStatus = React.memo(
|
|
|
118
120
|
export type MessageStatusProps = Partial<MessageStatusPropsWithContext>;
|
|
119
121
|
|
|
120
122
|
export const MessageStatus = (props: MessageStatusProps) => {
|
|
121
|
-
const { message, threadList } = useMessageContext();
|
|
123
|
+
const { message, readBy, threadList } = useMessageContext();
|
|
122
124
|
|
|
123
|
-
return <MemoizedMessageStatus {...{ message, threadList }} {...props} />;
|
|
125
|
+
return <MemoizedMessageStatus {...{ message, readBy, threadList }} {...props} />;
|
|
124
126
|
};
|
|
125
127
|
|
|
126
128
|
MessageStatus.displayName = 'MessageStatus{messageSimple{status}}';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { LocalMessage } from 'stream-chat';
|
|
5
|
+
|
|
4
6
|
import { renderText, RenderTextParams } from './utils/renderText';
|
|
5
7
|
|
|
6
8
|
import {
|
|
@@ -16,8 +18,6 @@ import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
|
16
18
|
import type { MarkdownStyle, Theme } from '../../../contexts/themeContext/utils/theme';
|
|
17
19
|
import { useTranslatedMessage } from '../../../hooks/useTranslatedMessage';
|
|
18
20
|
|
|
19
|
-
import type { MessageType } from '../../MessageList/hooks/useMessageList';
|
|
20
|
-
|
|
21
21
|
const styles = StyleSheet.create({
|
|
22
22
|
textContainer: { maxWidth: 250, paddingHorizontal: 16 },
|
|
23
23
|
});
|
|
@@ -71,7 +71,7 @@ const MessageTextContainerWithContext = (props: MessageTextContainerPropsWithCon
|
|
|
71
71
|
},
|
|
72
72
|
} = theme;
|
|
73
73
|
|
|
74
|
-
const translatedMessage = useTranslatedMessage(message) as
|
|
74
|
+
const translatedMessage = useTranslatedMessage(message) as LocalMessage;
|
|
75
75
|
|
|
76
76
|
if (!message.text) {
|
|
77
77
|
return null;
|
|
@@ -72,26 +72,32 @@ describe('MessageStatus', () => {
|
|
|
72
72
|
|
|
73
73
|
it('should render message status with read by container', async () => {
|
|
74
74
|
const user = generateUser();
|
|
75
|
-
const message = generateMessage({
|
|
75
|
+
const message = generateMessage({ user });
|
|
76
|
+
const readBy = 2;
|
|
76
77
|
|
|
77
78
|
const { getByTestId, getByText, rerender, toJSON } = renderMessageStatus({
|
|
78
79
|
lastReceivedId: message.id,
|
|
79
80
|
message,
|
|
81
|
+
readBy,
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
await waitFor(() => {
|
|
83
85
|
expect(getByTestId('read-by-container')).toBeTruthy();
|
|
84
|
-
expect(getByText((
|
|
86
|
+
expect(getByText((readBy - 1).toString())).toBeTruthy();
|
|
85
87
|
});
|
|
86
88
|
|
|
87
89
|
const staticUser = generateStaticUser(0);
|
|
88
|
-
const staticMessage = generateMessage({ readBy:
|
|
90
|
+
const staticMessage = generateMessage({ readBy, user: staticUser });
|
|
89
91
|
|
|
90
92
|
rerender(
|
|
91
93
|
<ChannelsStateProvider>
|
|
92
94
|
<Chat client={chatClient} i18nInstance={i18nInstance}>
|
|
93
95
|
<Channel channel={channel}>
|
|
94
|
-
<MessageStatus
|
|
96
|
+
<MessageStatus
|
|
97
|
+
lastReceivedId={staticMessage.id}
|
|
98
|
+
message={staticMessage}
|
|
99
|
+
readBy={readBy}
|
|
100
|
+
/>
|
|
95
101
|
</Channel>
|
|
96
102
|
</Chat>
|
|
97
103
|
</ChannelsStateProvider>,
|
|
@@ -100,7 +106,7 @@ describe('MessageStatus', () => {
|
|
|
100
106
|
await waitFor(() => {
|
|
101
107
|
expect(toJSON()).toMatchSnapshot();
|
|
102
108
|
expect(getByTestId('read-by-container')).toBeTruthy();
|
|
103
|
-
expect(getByText((
|
|
109
|
+
expect(getByText((readBy - 1).toString())).toBeTruthy();
|
|
104
110
|
});
|
|
105
111
|
});
|
|
106
112
|
|
|
@@ -3,6 +3,8 @@ import { Text } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { cleanup, render, waitFor } from '@testing-library/react-native';
|
|
5
5
|
|
|
6
|
+
import { LocalMessage } from 'stream-chat';
|
|
7
|
+
|
|
6
8
|
import { OverlayProvider } from '../../../../contexts/overlayContext/OverlayProvider';
|
|
7
9
|
import { ThemeProvider } from '../../../../contexts/themeContext/ThemeContext';
|
|
8
10
|
import { defaultTheme } from '../../../../contexts/themeContext/utils/theme';
|
|
@@ -17,7 +19,6 @@ import { generateStaticUser } from '../../../../mock-builders/generator/user';
|
|
|
17
19
|
import { getTestClientWithUser } from '../../../../mock-builders/mock';
|
|
18
20
|
import { Channel } from '../../../Channel/Channel';
|
|
19
21
|
import { Chat } from '../../../Chat/Chat';
|
|
20
|
-
import type { MessageType } from '../../../MessageList/hooks/useMessageList';
|
|
21
22
|
import { MessageList } from '../../../MessageList/MessageList';
|
|
22
23
|
import { MessageTextContainer } from '../MessageTextContainer';
|
|
23
24
|
|
|
@@ -31,7 +32,7 @@ describe('MessageTextContainer', () => {
|
|
|
31
32
|
});
|
|
32
33
|
const { getByTestId, getByText, rerender, toJSON } = render(
|
|
33
34
|
<ThemeProvider theme={defaultTheme}>
|
|
34
|
-
<MessageTextContainer message={message as unknown as
|
|
35
|
+
<MessageTextContainer message={message as unknown as LocalMessage} />
|
|
35
36
|
</ThemeProvider>,
|
|
36
37
|
);
|
|
37
38
|
|
|
@@ -43,7 +44,7 @@ describe('MessageTextContainer', () => {
|
|
|
43
44
|
rerender(
|
|
44
45
|
<ThemeProvider theme={defaultTheme}>
|
|
45
46
|
<MessageTextContainer
|
|
46
|
-
message={message as unknown as
|
|
47
|
+
message={message as unknown as LocalMessage}
|
|
47
48
|
MessageText={({ message }) => <Text testID='message-text'>{message?.text}</Text>}
|
|
48
49
|
/>
|
|
49
50
|
</ThemeProvider>,
|
|
@@ -61,7 +62,7 @@ describe('MessageTextContainer', () => {
|
|
|
61
62
|
|
|
62
63
|
rerender(
|
|
63
64
|
<ThemeProvider theme={defaultTheme}>
|
|
64
|
-
<MessageTextContainer message={staticMessage as unknown as
|
|
65
|
+
<MessageTextContainer message={staticMessage as unknown as LocalMessage} />
|
|
65
66
|
</ThemeProvider>,
|
|
66
67
|
);
|
|
67
68
|
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
State,
|
|
27
27
|
} from 'simple-markdown';
|
|
28
28
|
|
|
29
|
-
import type { UserResponse } from 'stream-chat';
|
|
29
|
+
import type { LocalMessage, UserResponse } from 'stream-chat';
|
|
30
30
|
|
|
31
31
|
import { generateMarkdownText } from './generateMarkdownText';
|
|
32
32
|
|
|
@@ -34,7 +34,6 @@ import type { MessageContextValue } from '../../../../contexts/messageContext/Me
|
|
|
34
34
|
import type { Colors, MarkdownStyle } from '../../../../contexts/themeContext/utils/theme';
|
|
35
35
|
|
|
36
36
|
import { escapeRegExp } from '../../../../utils/utils';
|
|
37
|
-
import type { MessageType } from '../../../MessageList/hooks/useMessageList';
|
|
38
37
|
|
|
39
38
|
type ReactNodeOutput = NodeOutput<React.ReactNode>;
|
|
40
39
|
type ReactOutput = Output<React.ReactNode>;
|
|
@@ -162,7 +161,7 @@ export type RenderTextParams = Partial<
|
|
|
162
161
|
Pick<MessageContextValue, 'onLongPress' | 'onPress' | 'preventPress'>
|
|
163
162
|
> & {
|
|
164
163
|
colors: typeof Colors;
|
|
165
|
-
message:
|
|
164
|
+
message: LocalMessage;
|
|
166
165
|
markdownRules?: MarkdownRules;
|
|
167
166
|
markdownStyles?: MarkdownStyle;
|
|
168
167
|
messageOverlay?: boolean;
|
|
@@ -34,6 +34,7 @@ export const useCreateMessageContext = ({
|
|
|
34
34
|
otherAttachments,
|
|
35
35
|
preventPress,
|
|
36
36
|
reactions,
|
|
37
|
+
readBy,
|
|
37
38
|
setIsEditedMessageOpen,
|
|
38
39
|
showAvatar,
|
|
39
40
|
showMessageOverlay,
|
|
@@ -81,6 +82,7 @@ export const useCreateMessageContext = ({
|
|
|
81
82
|
otherAttachments,
|
|
82
83
|
preventPress,
|
|
83
84
|
reactions,
|
|
85
|
+
readBy,
|
|
84
86
|
setIsEditedMessageOpen,
|
|
85
87
|
showAvatar,
|
|
86
88
|
showMessageOverlay,
|
|
@@ -103,6 +105,7 @@ export const useCreateMessageContext = ({
|
|
|
103
105
|
stringifiedMessage,
|
|
104
106
|
myMessageThemeString,
|
|
105
107
|
reactionsValue,
|
|
108
|
+
readBy,
|
|
106
109
|
showAvatar,
|
|
107
110
|
showMessageStatus,
|
|
108
111
|
threadList,
|