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
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg';
|
|
4
4
|
|
|
5
|
+
import type { ThreadState } from 'stream-chat';
|
|
6
|
+
|
|
5
7
|
import {
|
|
6
8
|
MessagesContextValue,
|
|
7
9
|
useMessagesContext,
|
|
@@ -12,6 +14,7 @@ import {
|
|
|
12
14
|
useThreadContext,
|
|
13
15
|
} from '../../../contexts/threadContext/ThreadContext';
|
|
14
16
|
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
|
|
17
|
+
import { useStateStore } from '../../../hooks';
|
|
15
18
|
import { useViewport } from '../../../hooks/useViewport';
|
|
16
19
|
|
|
17
20
|
const styles = StyleSheet.create({
|
|
@@ -39,7 +42,7 @@ const styles = StyleSheet.create({
|
|
|
39
42
|
});
|
|
40
43
|
|
|
41
44
|
type ThreadFooterComponentPropsWithContext = Pick<MessagesContextValue, 'Message'> &
|
|
42
|
-
Pick<ThreadContextValue, 'parentMessagePreventPress' | 'thread'>;
|
|
45
|
+
Pick<ThreadContextValue, 'parentMessagePreventPress' | 'thread' | 'threadInstance'>;
|
|
43
46
|
|
|
44
47
|
export const InlineLoadingMoreThreadIndicator = () => {
|
|
45
48
|
const { threadLoadingMore } = useThreadContext();
|
|
@@ -60,8 +63,13 @@ export const InlineLoadingMoreThreadIndicator = () => {
|
|
|
60
63
|
);
|
|
61
64
|
};
|
|
62
65
|
|
|
66
|
+
const selector = (nextValue: ThreadState) =>
|
|
67
|
+
({
|
|
68
|
+
replyCount: nextValue.replyCount,
|
|
69
|
+
}) as const;
|
|
70
|
+
|
|
63
71
|
const ThreadFooterComponentWithContext = (props: ThreadFooterComponentPropsWithContext) => {
|
|
64
|
-
const { Message, parentMessagePreventPress, thread } = props;
|
|
72
|
+
const { Message, parentMessagePreventPress, thread, threadInstance } = props;
|
|
65
73
|
const { t } = useTranslationContext();
|
|
66
74
|
const { vw } = useViewport();
|
|
67
75
|
|
|
@@ -80,12 +88,12 @@ const ThreadFooterComponentWithContext = (props: ThreadFooterComponentPropsWithC
|
|
|
80
88
|
},
|
|
81
89
|
} = useTheme();
|
|
82
90
|
|
|
91
|
+
const { replyCount = thread?.reply_count } = useStateStore(threadInstance?.state, selector) ?? {};
|
|
92
|
+
|
|
83
93
|
if (!thread) {
|
|
84
94
|
return null;
|
|
85
95
|
}
|
|
86
96
|
|
|
87
|
-
const replyCount = thread.reply_count;
|
|
88
|
-
|
|
89
97
|
return (
|
|
90
98
|
<View style={styles.threadHeaderContainer} testID='thread-footer-component'>
|
|
91
99
|
<View style={styles.messagePadding}>
|
|
@@ -93,6 +101,7 @@ const ThreadFooterComponentWithContext = (props: ThreadFooterComponentPropsWithC
|
|
|
93
101
|
groupStyles={['single']}
|
|
94
102
|
message={thread}
|
|
95
103
|
preventPress={parentMessagePreventPress}
|
|
104
|
+
readBy={0}
|
|
96
105
|
threadList
|
|
97
106
|
/>
|
|
98
107
|
</View>
|
|
@@ -138,10 +147,16 @@ const areEqual = (
|
|
|
138
147
|
prevProps: ThreadFooterComponentPropsWithContext,
|
|
139
148
|
nextProps: ThreadFooterComponentPropsWithContext,
|
|
140
149
|
) => {
|
|
141
|
-
const {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
const {
|
|
151
|
+
parentMessagePreventPress: prevParentMessagePreventPress,
|
|
152
|
+
thread: prevThread,
|
|
153
|
+
threadInstance: prevThreadInstance,
|
|
154
|
+
} = prevProps;
|
|
155
|
+
const {
|
|
156
|
+
parentMessagePreventPress: nextParentMessagePreventPress,
|
|
157
|
+
thread: nextThread,
|
|
158
|
+
threadInstance: nextThreadInstance,
|
|
159
|
+
} = nextProps;
|
|
145
160
|
|
|
146
161
|
if (prevParentMessagePreventPress !== nextParentMessagePreventPress) {
|
|
147
162
|
return false;
|
|
@@ -151,10 +166,15 @@ const areEqual = (
|
|
|
151
166
|
prevThread?.id === nextThread?.id &&
|
|
152
167
|
prevThread?.text === nextThread?.text &&
|
|
153
168
|
prevThread?.reply_count === nextThread?.reply_count;
|
|
169
|
+
|
|
154
170
|
if (!threadEqual) {
|
|
155
171
|
return false;
|
|
156
172
|
}
|
|
157
173
|
|
|
174
|
+
if (prevThreadInstance !== nextThreadInstance) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
|
|
158
178
|
const latestReactionsEqual =
|
|
159
179
|
prevThread &&
|
|
160
180
|
nextThread &&
|
|
@@ -182,7 +202,8 @@ export type ThreadFooterComponentProps = Partial<Pick<MessagesContextValue, 'Mes
|
|
|
182
202
|
|
|
183
203
|
export const ThreadFooterComponent = (props: ThreadFooterComponentProps) => {
|
|
184
204
|
const { Message } = useMessagesContext();
|
|
185
|
-
const { parentMessagePreventPress, thread, threadLoadingMore } =
|
|
205
|
+
const { parentMessagePreventPress, thread, threadInstance, threadLoadingMore } =
|
|
206
|
+
useThreadContext();
|
|
186
207
|
|
|
187
208
|
return (
|
|
188
209
|
<MemoizedThreadFooter
|
|
@@ -190,6 +211,7 @@ export const ThreadFooterComponent = (props: ThreadFooterComponentProps) => {
|
|
|
190
211
|
Message,
|
|
191
212
|
parentMessagePreventPress,
|
|
192
213
|
thread,
|
|
214
|
+
threadInstance,
|
|
193
215
|
threadLoadingMore,
|
|
194
216
|
}}
|
|
195
217
|
{...props}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { Thread, ThreadState } from 'stream-chat';
|
|
4
|
+
import { LocalMessage, Thread, ThreadState } from 'stream-chat';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
TranslationContextValue,
|
|
@@ -19,7 +19,6 @@ import { MessageBubble } from '../../icons';
|
|
|
19
19
|
import { getDateString } from '../../utils/i18n/getDateString';
|
|
20
20
|
import { Avatar } from '../Avatar/Avatar';
|
|
21
21
|
import { useChannelPreviewDisplayName } from '../ChannelPreview/hooks/useChannelPreviewDisplayName';
|
|
22
|
-
import { MessageType } from '../MessageList/hooks/useMessageList';
|
|
23
22
|
|
|
24
23
|
export type ThreadListItemProps = {
|
|
25
24
|
thread: Thread;
|
|
@@ -76,7 +75,7 @@ const getTitleFromMessage = ({
|
|
|
76
75
|
}: {
|
|
77
76
|
t: TranslationContextValue['t'];
|
|
78
77
|
currentUserId?: string;
|
|
79
|
-
message?:
|
|
78
|
+
message?: LocalMessage;
|
|
80
79
|
}) => {
|
|
81
80
|
const attachment = message?.attachments?.at(0);
|
|
82
81
|
|
|
@@ -132,7 +131,10 @@ export const ThreadListItemComponent = () => {
|
|
|
132
131
|
<TouchableOpacity
|
|
133
132
|
onPress={() => {
|
|
134
133
|
if (onThreadSelect) {
|
|
135
|
-
onThreadSelect(
|
|
134
|
+
onThreadSelect(
|
|
135
|
+
{ thread: parentMessage as LocalMessage, threadInstance: thread },
|
|
136
|
+
channel,
|
|
137
|
+
);
|
|
136
138
|
}
|
|
137
139
|
}}
|
|
138
140
|
style={[styles.touchableWrapper, threadListItem.touchableWrapper]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { PropsWithChildren, useEffect } from 'react';
|
|
1
|
+
import React, { PropsWithChildren, useEffect, useMemo } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Animated,
|
|
4
4
|
Keyboard,
|
|
@@ -50,13 +50,17 @@ export const BottomSheetModal = (props: PropsWithChildren<BottomSheetModalProps>
|
|
|
50
50
|
},
|
|
51
51
|
} = useTheme();
|
|
52
52
|
|
|
53
|
-
const translateY = new Animated.Value(height);
|
|
53
|
+
const translateY = useMemo(() => new Animated.Value(height), [height]);
|
|
54
54
|
|
|
55
|
-
const openAnimation =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
const openAnimation = useMemo(
|
|
56
|
+
() =>
|
|
57
|
+
Animated.timing(translateY, {
|
|
58
|
+
duration: 200,
|
|
59
|
+
toValue: 0,
|
|
60
|
+
useNativeDriver: true,
|
|
61
|
+
}),
|
|
62
|
+
[translateY],
|
|
63
|
+
);
|
|
60
64
|
|
|
61
65
|
const closeAnimation = Animated.timing(translateY, {
|
|
62
66
|
duration: 50,
|
package/src/components/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './Attachment/FileIcon';
|
|
|
8
8
|
export * from './Attachment/Gallery';
|
|
9
9
|
export * from './Attachment/Giphy';
|
|
10
10
|
export * from './Attachment/VideoThumbnail';
|
|
11
|
+
export * from './Attachment/ImageReloadIndicator';
|
|
11
12
|
export * from './Attachment/utils/buildGallery/buildGallery';
|
|
12
13
|
|
|
13
14
|
export * from './AttachmentPicker/AttachmentPicker';
|
|
@@ -148,7 +149,7 @@ export * from './MessageList/TypingIndicatorContainer';
|
|
|
148
149
|
export * from './MessageList/utils/getDateSeparators';
|
|
149
150
|
export * from './MessageList/utils/getGroupStyles';
|
|
150
151
|
export * from './MessageList/utils/getLastReceivedMessage';
|
|
151
|
-
export * from './MessageList/utils/
|
|
152
|
+
export * from './MessageList/utils/getReadState';
|
|
152
153
|
|
|
153
154
|
export * from './MessageMenu/MessageActionList';
|
|
154
155
|
export * from './MessageMenu/MessageActionListItem';
|
|
@@ -2,7 +2,8 @@ import React, { PropsWithChildren, useContext, useEffect, useState } from 'react
|
|
|
2
2
|
|
|
3
3
|
import { BottomSheetHandleProps } from '@gorhom/bottom-sheet';
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type { File } from '../../types/types';
|
|
6
|
+
|
|
6
7
|
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
7
8
|
|
|
8
9
|
import { isTestEnvironment } from '../utils/isTestEnvironment';
|
|
@@ -82,11 +83,11 @@ export type AttachmentPickerContextValue = {
|
|
|
82
83
|
maxNumberOfFiles: number;
|
|
83
84
|
openPicker: () => void;
|
|
84
85
|
selectedFiles: File[];
|
|
85
|
-
selectedImages:
|
|
86
|
+
selectedImages: File[];
|
|
86
87
|
setBottomInset: React.Dispatch<React.SetStateAction<number>>;
|
|
87
88
|
setMaxNumberOfFiles: React.Dispatch<React.SetStateAction<number>>;
|
|
88
89
|
setSelectedFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
89
|
-
setSelectedImages: React.Dispatch<React.SetStateAction<
|
|
90
|
+
setSelectedImages: React.Dispatch<React.SetStateAction<File[]>>;
|
|
90
91
|
setSelectedPicker: React.Dispatch<React.SetStateAction<'images' | undefined>>;
|
|
91
92
|
setTopInset: React.Dispatch<React.SetStateAction<number>>;
|
|
92
93
|
topInset: number;
|
|
@@ -124,7 +125,7 @@ export const AttachmentPickerProvider = ({
|
|
|
124
125
|
|
|
125
126
|
const [bottomInset, setBottomInset] = useState<number>(bottomInsetValue ?? 0);
|
|
126
127
|
const [maxNumberOfFiles, setMaxNumberOfFiles] = useState(10);
|
|
127
|
-
const [selectedImages, setSelectedImages] = useState<
|
|
128
|
+
const [selectedImages, setSelectedImages] = useState<File[]>([]);
|
|
128
129
|
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);
|
|
129
130
|
const [selectedPicker, setSelectedPicker] = useState<'images'>();
|
|
130
131
|
const [topInset, setTopInset] = useState<number>(topInsetValue ?? 0);
|
|
@@ -45,7 +45,7 @@ export function useChannelState(
|
|
|
45
45
|
const cid = channel?.id || 'id'; // in case channel is not initialized, use generic id string for indexing
|
|
46
46
|
const { setState, state } = useChannelsStateContext();
|
|
47
47
|
|
|
48
|
-
const [threadMessages,
|
|
48
|
+
const [threadMessages, setThreadMessagesInternal] = useStateManager(
|
|
49
49
|
{
|
|
50
50
|
cid,
|
|
51
51
|
key: 'threadMessages',
|
|
@@ -54,6 +54,10 @@ export function useChannelState(
|
|
|
54
54
|
},
|
|
55
55
|
(threadId && channel?.state?.threads?.[threadId]) || [],
|
|
56
56
|
);
|
|
57
|
+
const setThreadMessages = useCallback(
|
|
58
|
+
(value: ChannelState['threadMessages']) => setThreadMessagesInternal([...value]),
|
|
59
|
+
[setThreadMessagesInternal],
|
|
60
|
+
);
|
|
57
61
|
|
|
58
62
|
return {
|
|
59
63
|
setThreadMessages,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useContext, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
import type { Channel, ChannelState, StreamChat } from 'stream-chat';
|
|
4
|
-
|
|
5
|
-
import type { MessageType } from '../../components/MessageList/hooks/useMessageList';
|
|
3
|
+
import type { Channel, ChannelState, LocalMessage, StreamChat } from 'stream-chat';
|
|
6
4
|
|
|
7
5
|
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
8
6
|
|
|
@@ -12,7 +10,7 @@ export type DebugDataType =
|
|
|
12
10
|
data: Channel['data'];
|
|
13
11
|
members: ChannelState['members'];
|
|
14
12
|
}[]
|
|
15
|
-
|
|
|
13
|
+
| LocalMessage[];
|
|
16
14
|
|
|
17
15
|
export type DebugContextValue = {
|
|
18
16
|
eventType?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useContext, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { LocalMessage } from 'stream-chat';
|
|
4
|
+
|
|
4
5
|
import type { UnknownType } from '../../types/types';
|
|
5
6
|
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
6
7
|
|
|
@@ -12,8 +13,8 @@ type SelectedMessage = {
|
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
export type ImageGalleryContextValue = {
|
|
15
|
-
messages:
|
|
16
|
-
setMessages: React.Dispatch<React.SetStateAction<
|
|
16
|
+
messages: LocalMessage[];
|
|
17
|
+
setMessages: React.Dispatch<React.SetStateAction<LocalMessage[]>>;
|
|
17
18
|
setSelectedMessage: React.Dispatch<React.SetStateAction<SelectedMessage | undefined>>;
|
|
18
19
|
selectedMessage?: SelectedMessage;
|
|
19
20
|
};
|
|
@@ -23,7 +24,7 @@ export const ImageGalleryContext = React.createContext(
|
|
|
23
24
|
);
|
|
24
25
|
|
|
25
26
|
export const ImageGalleryProvider = ({ children }: PropsWithChildren<UnknownType>) => {
|
|
26
|
-
const [messages, setMessages] = useState<
|
|
27
|
+
const [messages, setMessages] = useState<LocalMessage[]>([]);
|
|
27
28
|
const [selectedMessage, setSelectedMessage] = useState<SelectedMessage>();
|
|
28
29
|
|
|
29
30
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren, useContext } from 'react';
|
|
2
2
|
|
|
3
|
-
import type { Attachment } from 'stream-chat';
|
|
3
|
+
import type { Attachment, LocalMessage } from 'stream-chat';
|
|
4
4
|
|
|
5
5
|
import type { ActionHandler } from '../../components/Attachment/Attachment';
|
|
6
6
|
import { ReactionSummary } from '../../components/Message/hooks/useProcessReactions';
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
MessagePressableHandlerPayload,
|
|
9
9
|
PressableHandlerPayload,
|
|
10
10
|
} from '../../components/Message/Message';
|
|
11
|
-
import type { GroupType
|
|
11
|
+
import type { GroupType } from '../../components/MessageList/hooks/useMessageList';
|
|
12
12
|
import type { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';
|
|
13
13
|
import type { MessageContentType } from '../../contexts/messagesContext/MessagesContext';
|
|
14
14
|
import type { DeepPartial } from '../../contexts/themeContext/ThemeContext';
|
|
@@ -48,13 +48,13 @@ export type MessageContextValue = {
|
|
|
48
48
|
/**
|
|
49
49
|
* A factory function that determines whether a message is AI generated or not.
|
|
50
50
|
*/
|
|
51
|
-
isMessageAIGenerated: (message:
|
|
51
|
+
isMessageAIGenerated: (message: LocalMessage) => boolean;
|
|
52
52
|
/** Whether or not this is the active user's message */
|
|
53
53
|
isMyMessage: boolean;
|
|
54
54
|
/** Whether or not this is the last message in a group of messages */
|
|
55
55
|
lastGroupMessage: boolean;
|
|
56
56
|
/** Current [message object](https://getstream.io/chat/docs/#message_format) */
|
|
57
|
-
message:
|
|
57
|
+
message: LocalMessage;
|
|
58
58
|
/** Order to render the message content */
|
|
59
59
|
messageContentOrder: MessageContentType[];
|
|
60
60
|
/**
|
|
@@ -87,6 +87,8 @@ export type MessageContextValue = {
|
|
|
87
87
|
/** The images attached to a message */
|
|
88
88
|
otherAttachments: Attachment[];
|
|
89
89
|
reactions: ReactionSummary[];
|
|
90
|
+
/** Whether or not the message has been read by the current user */
|
|
91
|
+
readBy: number | boolean;
|
|
90
92
|
/** React set state function to set the state of `isEditedMessageOpen` */
|
|
91
93
|
setIsEditedMessageOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
92
94
|
/**
|